:root {
  color-scheme: light;
  --ink: #20251f;
  --muted: #70776e;
  --paper: #f4f1ea;
  --card: #fffdf8;
  --line: #e6e1d6;
  --moss: #445f4d;
  --clay: #b85f47;
  --gold: #d6a759;
  --shadow: 0 20px 60px #493e2510;
  font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 80% 0, #eee4d1 0, transparent 33rem), var(--paper); color: var(--ink); }
button, input { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #9b6c22; outline-offset: 3px; }
.topbar { max-width: 1240px; margin: auto; padding: 20px 30px; display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 850; text-decoration: none; }
.brand-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 11px; background: #243d32; color: #e6c982; font-size: 20px; }
.home-link { color: var(--muted); font-size: 12px; text-decoration: none; }
.home-link span { color: var(--moss); margin-left: 4px; }
.page-shell { max-width: 1240px; margin: auto; padding: 22px 30px 48px; }
.intro-row { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin: 8px 0 25px; }
.eyebrow { margin: 0 0 9px; color: #87836f; font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
.intro-row h1 { margin-bottom: 0; font-size: clamp(34px, 4.4vw, 55px); line-height: 1.08; letter-spacing: -.055em; }
.intro-row h1 em { color: var(--moss); font-style: normal; }
.intro-copy { max-width: 390px; margin-bottom: 3px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(330px, .78fr); gap: 18px; align-items: stretch; }
.art-panel, .controls-panel, .collection { border: 1px solid #ebe6db; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
.art-panel { padding: 16px; }
.art-topline, .section-heading, .collection-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.art-topline { margin: 0 2px 13px; }
.art-label { display: flex; align-items: center; gap: 8px; color: #62675e; font-size: 11px; font-weight: 800; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #a1a882; }
.today-button, .icon-button { border: 1px solid var(--line); border-radius: 999px; background: #fbf8f0; color: #554d39; font-size: 11px; font-weight: 800; cursor: pointer; }
.today-button { padding: 8px 12px; }
.canvas-frame { position: relative; width: min(100%, 660px); aspect-ratio: 1; margin: auto; overflow: hidden; border-radius: 15px; background: #f5efdf; }
#art-canvas { display: block; width: 100%; height: 100%; }
.canvas-fallback { position: absolute; inset: 0; display: flex; padding: 30px; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: var(--muted); }
.canvas-fallback[hidden] { display: none; }
.canvas-fallback > span { color: var(--moss); font-size: 55px; }
.canvas-fallback strong { margin: 12px 0 8px; color: var(--ink); font-size: 16px; }
.canvas-fallback p { max-width: 310px; font-size: 12px; line-height: 1.7; }
.art-caption { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 3px 4px; }
.recipe-summary { margin: 0; color: #4c554b; font-size: 11px; line-height: 1.7; }
.size-note { flex: none; color: #9a9a8f; font-size: 9px; }
.motion-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 10px 0 0; padding: 14px 3px 1px; border-top: 1px solid #eee9de; }
.motion-row strong { font-size: 12px; }
.motion-row p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.motion-toggle { display: flex; min-width: 115px; justify-content: center; align-items: center; gap: 8px; border: 1px solid #d9ded3; border-radius: 999px; padding: 10px 13px; background: #edf1e9; color: #354a39; font-size: 11px; font-weight: 850; cursor: pointer; }
.motion-toggle[aria-pressed="true"] { background: #263f34; color: #fff8e8; }
.motion-symbol { font-size: 10px; }
.controls-panel { padding: 22px; }
.section-heading { margin-bottom: 20px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading h2, .collection-head h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.icon-button { width: 38px; height: 38px; font-size: 20px; }
.control-group { margin: 0 0 20px; padding: 0; border: 0; }
.control-group legend, .slider-group label { display: flex; width: 100%; justify-content: space-between; align-items: center; margin-bottom: 9px; color: #3d463d; font-size: 11px; font-weight: 850; }
.control-group output { color: var(--moss); font-variant-numeric: tabular-nums; }
.symmetry-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.symmetry-options button { min-height: 39px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #61685f; font-size: 12px; font-weight: 800; cursor: pointer; }
.symmetry-options button[aria-pressed="true"] { border-color: #445f4d; background: #445f4d; color: #fff; }
.slider-group input { display: block; width: 100%; accent-color: var(--moss); cursor: pointer; }
.range-ends { display: flex; justify-content: space-between; margin-top: 3px; color: #9a9b90; font-size: 9px; }
.palette-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.palette-choice { min-width: 0; padding: 7px 4px 6px; border: 1px solid transparent; border-radius: 9px; background: #f7f4ed; color: #6b6d64; font-size: 9px; cursor: pointer; }
.palette-choice[aria-pressed="true"] { border-color: #445f4d; background: #edf1e9; color: #263f34; font-weight: 850; }
.swatches { display: flex; justify-content: center; gap: 2px; margin: 0 auto 5px; }
.swatches i { width: 8px; height: 8px; border-radius: 50%; }
.control-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 2px; }
.button { min-height: 42px; border: 0; border-radius: 10px; padding: 10px 13px; font-size: 11px; font-weight: 850; cursor: pointer; }
.button.primary { background: #2e4d3c; color: #fff; }
.button.primary span { margin-left: 4px; color: #f0d590; }
.button.secondary { border: 1px solid var(--line); background: #fff; color: #565f54; }
.button:hover, .icon-button:hover, .today-button:hover, .motion-toggle:hover { filter: brightness(.97); }
.share-fallback { margin-top: 14px; padding: 12px; border-radius: 10px; background: #f5f3ed; }
.share-fallback[hidden] { display: none; }
.share-fallback label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.share-fallback > div { display: flex; gap: 6px; }
.share-fallback input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 8px; background: white; font-size: 10px; }
.copy-button { border: 0; border-radius: 7px; padding: 0 10px; background: #e7ecdf; color: var(--moss); font-size: 10px; font-weight: 800; cursor: pointer; }
.collection { margin-top: 18px; padding: 20px 22px; }
.collection-head { margin-bottom: 14px; }
.collection-head .eyebrow { margin-bottom: 5px; }
.count-badge { display: inline-block; margin-left: 5px; border-radius: 999px; padding: 4px 7px; vertical-align: middle; background: #f1eee5; color: #777365; font-size: 9px; font-weight: 700; letter-spacing: 0; }
.text-action { border: 0; padding: 8px; background: transparent; color: #95614e; font-size: 10px; font-weight: 800; cursor: pointer; }
.text-action:disabled { color: #b9b8b0; cursor: default; }
.save-row { display: flex; gap: 8px; }
.save-row input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: #fff; color: var(--ink); font-size: 11px; }
.save-button { flex: none; background: #e7ecdf; color: #354a39; }
.storage-status { margin: 9px 0; color: #929287; font-size: 10px; line-height: 1.6; }
.favorite-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.favorite-card { min-width: 0; padding: 11px; border: 1px solid #ece8de; border-radius: 11px; background: #fff; }
.favorite-name { overflow: hidden; margin: 0 0 5px; color: #39473c; font-size: 11px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.favorite-detail { min-height: 28px; margin: 0 0 7px; color: #8a8d82; font-size: 9px; line-height: 1.5; }
.favorite-actions { display: flex; gap: 5px; }
.favorite-actions button { border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; background: #fbfaf6; color: #586454; font-size: 9px; font-weight: 800; cursor: pointer; }
.favorite-actions button[data-action="delete"] { color: #a05c4b; }
.empty-state { padding: 23px 10px 9px; color: #97978d; text-align: center; }
.empty-state span { color: #c1a46d; font-size: 26px; }
.empty-state p { margin: 5px 0 0; font-size: 10px; }
.empty-state[hidden] { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.toast { position: fixed; z-index: 5; bottom: 20px; left: 50%; max-width: calc(100% - 30px); transform: translate(-50%, 16px); padding: 11px 16px; border-radius: 9px; background: #263b30; color: #fff; font-size: 11px; opacity: 0; pointer-events: none; text-align: center; transition: .18s; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }
footer { display: flex; max-width: 1240px; justify-content: center; align-items: center; gap: 18px; margin: auto; padding: 18px 24px 24px; border-top: 1px solid #e8e3d8; color: #909085; font-size: 10px; }
footer a { color: #656f62; text-decoration: none; }
@media (max-width: 900px) {
  .page-shell { padding-right: 22px; padding-left: 22px; }
  .workspace { grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr); gap: 12px; }
  .controls-panel { padding: 18px; }
  .art-panel { padding: 12px; }
  .intro-copy { max-width: 330px; }
}
@media (max-width: 720px) {
  .topbar { padding: 16px 18px; }
  .page-shell { padding: 18px 16px 34px; }
  .intro-row { display: block; margin: 7px 0 18px; }
  .intro-row h1 { font-size: clamp(34px, 9vw, 46px); }
  .intro-copy { max-width: 520px; margin: 10px 0 0; font-size: 12px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .canvas-frame { width: min(100%, 560px); }
  .controls-panel { padding: 19px; }
  .collection { padding: 18px; }
}
@media (max-width: 420px) {
  .topbar { padding: 14px 13px; }
  .page-shell { padding: 14px 10px 27px; }
  .workspace { gap: 10px; }
  .art-panel { padding: 9px; border-radius: 16px; }
  .art-caption { display: block; }
  .size-note { display: block; margin-top: 4px; }
  .motion-row { gap: 7px; }
  .motion-toggle { min-width: 105px; padding: 9px; }
  .palette-options { gap: 3px; }
  .palette-choice { padding: 6px 1px; font-size: 8px; }
  .swatches { gap: 1px; }
  .swatches i { width: 7px; height: 7px; }
  .collection { padding: 15px 12px; }
  .save-row { align-items: stretch; }
  .save-row input { padding: 9px; font-size: 10px; }
  .save-button { padding: 9px 8px; font-size: 10px; }
  .favorite-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  footer { gap: 10px; }
}
@media (max-width: 360px) {
  .page-shell { padding-right: 8px; padding-left: 8px; }
  .section-heading h2, .collection-head h2 { font-size: 19px; }
  .today-button { padding: 7px 9px; font-size: 10px; }
  .favorite-list { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
