@layer reset, base, components, responsive;
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p { margin: 0; }
  button, input, select { font: inherit; color: inherit; }
  button { cursor: pointer; }
  button:disabled { cursor: not-allowed; }
  svg { display: block; }
  :where(button, input, select, a, pre, summary):focus-visible { outline: 3px solid #7264d7; outline-offset: 4px; }
  [hidden] { display: none !important; }
}
@layer base {
  :root { font: 16px/1.7 "Avenir Next", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; color: #203d33; background: #f4f3ec; --ink: #203d33; --muted: #63766c; --line: #cdd5c9; --paper: #fffef8; --green: #007967; --lime: #c5ff80; }
  body { min-width: 320px; background: radial-gradient(ellipse at 100% 0, #e4e0f360, transparent 28%); }
  button, a { touch-action: manipulation; }
  .page { width: min(1560px, calc(100% - 80px)); margin: auto; }
  .hero { padding: 38px 0 34px; }
  .eyebrow, .kicker { font-size: 12px; font-weight: 750; letter-spacing: .11em; color: var(--green); }
  .eyebrow { display: flex; align-items: center; gap: 13px; }
  h1 { font-size: clamp(36px, 4.05vw, 64px); font-weight: 800; line-height: 1.2; letter-spacing: 0; margin: 24px 0; }
  h1 > span { color: #f47862; }
  h2 { font-size: clamp(23px, 2vw, 29px); line-height: 1.4; }
  h3 { font-size: 18px; line-height: 1.5; }
  .hero-bottom { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
  .lead { font-size: 16px; }
  .lead strong { color: var(--green); }
  .quiet, .primary { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); font-size: 14px; font-weight: 750; white-space: nowrap; transition: background .18s, box-shadow .18s; }
  .quiet { color: var(--ink); }
  .quiet:hover { background: #e8ede4; box-shadow: 0 3px 10px #203d3310; }
  .primary { background: var(--ink); color: #f6ffeb; border-color: var(--ink); }
  .primary:hover { background: #305b4b; }
  .quiet svg, .primary svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; fill: none; }
  .field { display: grid; gap: 8px; margin-top: 20px; font-size: 14px; font-weight: 650; }
  .field-label { font-size: 14px; font-weight: 650; margin: 20px 0 8px; }
  input[type=text], select { min-width: 0; width: 100%; padding: 11px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
  select { appearance: none; padding-right: 35px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%23203d33' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
  .range { display: grid; grid-template-columns: 1fr auto; gap: 8px; font-size: 14px; font-weight: 650; margin-top: 22px; }
  .range output { color: var(--green); font-size: 13px; font-variant-numeric: tabular-nums; }
  .range input { grid-column: 1/-1; width: 100%; accent-color: var(--green); height: 22px; }
  .check { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 22px 0 9px; }
  .check input { width: 18px; height: 18px; accent-color: var(--green); }
  .note { font-size: 13px; color: var(--muted); line-height: 1.8; margin-top: 13px; }
  .text-button { border: 0; padding: 4px 0; background: none; color: var(--green); font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
  a { color: inherit; text-underline-offset: 3px; }
}
@layer components {
  .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
  .section-heading h2 { margin-top: 5px; }
  .section-note { color: var(--muted); font-size: 14px; margin: -3px 0 20px; }
  .preset-section { margin: 0 0 36px; }
  .preset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .preset-card { min-width: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; padding: 0; background: var(--paper); color: var(--ink); text-align: left; transition: border-color .2s, box-shadow .2s; }
  .preset-card:hover { border-color: #849487; box-shadow: 0 4px 12px #203d3310; }
  .preset-card[aria-pressed=true] { border-color: var(--green); box-shadow: 0 0 0 2px var(--green); }
  .preset-art { min-height: 112px; display: grid; place-items: center; padding: 22px 16px; background: #e7ece5; pointer-events: none; }
  .preset-card:nth-child(3n + 2) .preset-art { background: #eee6df; }
  .preset-card:nth-child(3n) .preset-art { background: #e9e6f2; }
  .preset-info { display: grid; grid-template-columns: 1fr auto; padding: 13px 16px; }
  .preset-info strong { font-size: 14px; font-weight: 750; }
  .preset-info small { grid-column: 1/-1; margin-top: 3px; color: var(--muted); font-size: 12px; }
  .selected-mark { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; color: var(--paper); background: var(--green); opacity: 0; }
  .selected-mark svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
  .preset-card[aria-pressed=true] .selected-mark { opacity: 1; }
  .studio { border: 1px solid var(--line); background: var(--paper); border-radius: 24px; overflow: clip; container-type: inline-size; container-name: studio; }
  .studio-heading { display: flex; align-items: center; gap: 16px; padding: 22px 26px; border-bottom: 1px solid var(--line); }
  .section-icon { width: 50px; height: 50px; flex: 0 0 50px; display: grid; place-items: center; border-radius: 15px; background: #ff876e; color: #fff; }
  .section-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .badge { margin-left: auto; border: 1px solid var(--line); border-radius: 100px; padding: 6px 10px; font-size: 11px; font-weight: 750; white-space: nowrap; }
  .studio-grid { display: grid; grid-template-columns: 310px minmax(0, 1fr); }
  .controls { background: #f5f4ee; border-right: 1px solid var(--line); }
  .control-section { padding: 24px; border-top: 1px solid var(--line); }
  .control-section:first-child { border-top: 0; }
  .control-section .kicker { margin-bottom: 5px; }
  .tabs { margin: 20px 20px 0; }
  .segmented { position: relative; display: flex; padding: 4px; gap: 3px; border: 1px solid var(--line); background: #e8ede5; border-radius: 11px; isolation: isolate; }
  .segmented button { position: relative; flex: 1; min-width: 0; min-height: 36px; border: 0; border-radius: 7px; padding: 7px 11px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 750; transition: color .2s; }
  .segmented button:is([aria-selected=true], [aria-pressed=true]) { background: var(--ink); color: #e4ffd0; }
  .segmented button:hover:not([aria-selected=true]):not([aria-pressed=true]) { background: #203d330a; }
  @supports (anchor-name: --button-selection) and (anchor-scope: --button-selection) {
    .segmented { anchor-scope: --button-selection; }
    .segmented::before { content: ""; position: absolute; z-index: -1; position-anchor: --button-selection; top: anchor(top); left: anchor(left); width: anchor-size(width); height: anchor-size(height); background: var(--ink); border-radius: 7px; pointer-events: none; transition: left .22s, top .22s, width .22s, height .22s; }
    .segmented button:is([aria-selected=true], [aria-pressed=true]) { anchor-name: --button-selection; background: transparent; }
  }
  .palette-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
  .palette { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; min-height: 36px; gap: 0; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
  .palette[aria-pressed=true] { outline: 2px solid var(--green); outline-offset: 1px; }
  .palette i { width: 12px; height: 15px; background: var(--swatch); }
  .palette i:first-child { border-radius: 5px 0 0 5px; }.palette i:last-child { border-radius: 0 5px 5px 0; }
  .color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 20px; }
  .color-grid label { display: grid; gap: 5px; font-size: 13px; }
  .color-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
  .color-block h4 { font-size: 14px; margin: 0 0 10px; }
  .color-block .color-grid { margin-top: 13px; }
  .color-inline { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 20px; font-size: 14px; }
  .color-inline input[type=color] { width: 80px; }
  .gradient-palettes { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
  .gradient-palette { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 9px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
  .gradient-palette i { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--gradient); }
  .gradient-palette[aria-pressed=true] { outline: 2px solid var(--green); outline-offset: 1px; }
  #gradientContrastNote { margin-top: 6px; }
  .color-block .segmented button { padding-inline: 5px; font-size: 12px; }
  input[type=color] { width: 100%; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); cursor: pointer; }
  .contrast-note { margin-top: 18px; font-size: 12px; color: var(--muted); }
  #contrastWarning { margin-top: 6px; color: #a33725; }
  .preview-column { min-width: 0; background: #edf1e9; padding: 0 24px 24px; }
  .preview-sticky { position: sticky; top: 12px; }
  .preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 0; }
  .preview-label { font-size: 11px; font-weight: 750; letter-spacing: .1em; color: var(--green); }
  .canvas-switch { width: 122px; }
  .preview-canvas { position: relative; padding: 26px; border: 1px solid #d6dfd2; border-radius: 16px; overflow: hidden; color: #203d33; background: radial-gradient(ellipse at 50% 30%, #fffefb, #e2eadb); }
  .preview-canvas::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(#203d3308 1px, transparent 1px), linear-gradient(90deg, #203d3308 1px, transparent 1px); background-size: 28px 28px; pointer-events: none; }
  .preview-canvas[data-canvas=dark] { color: #dcebd5; background: radial-gradient(ellipse at 50% 30%, #294d40, #142b25); border-color: #36594a; }
  .preview-canvas[data-canvas=dark]::before { filter: invert(1); opacity: .4; }
  .stage-caption { position: relative; }
  .stage-caption p { font-size: 11px; letter-spacing: .12em; opacity: .65; margin-bottom: 3px; }
  .stage-caption h3 { font-size: 21px; }
  .live-stage { position: relative; display: grid; place-items: center; min-height: 230px; padding: 45px 20px; }
  .stage-tip { position: relative; text-align: center; font-size: 12px; opacity: .7; }
  .preview-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin: 13px 0 8px; font-size: 13px; color: var(--muted); }
  .click-status { font-size: 13px; color: var(--muted); min-height: 1.8em; }
  .state-section { margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--line); }
  .compact { margin-bottom: 12px; }.compact > span { font-size: 12px; color: var(--muted); }
  .state-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .state-item { min-width: 0; padding: 14px 12px 22px; background: #fffef8b8; border: 1px solid var(--line); border-radius: 11px; }
  .state-name { display: block; color: var(--muted); font-size: 12px; margin-bottom: 16px; }
  .state-button { display: grid; place-items: center; min-height: 66px; pointer-events: none; }
  .motion-check { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 19px; }
  .motion-check strong { font-size: 14px; }.motion-check p { font-size: 12px; color: var(--muted); max-width: 330px; }.motion-check .segmented { flex: 0 1 235px; }
  .export-section { margin-top: 38px; }
  .export-grid { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.5fr); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--paper); }
  .export-guide { padding: 29px; }.export-guide h3 { margin: 23px 0 8px; }.export-guide p { font-size: 14px; line-height: 1.9; color: var(--muted); }.export-guide code { background: #e8ede4; padding: 2px 4px; border-radius: 3px; font-size: 12px; color: var(--ink); }
  .code-symbol { display: grid; place-items: center; width: 50px; height: 50px; color: var(--green); background: #e9f1df; border-radius: 12px; }.code-symbol svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .code-panel { min-width: 0; padding: 24px; background: #1b3028; color: #edf4e6; }.code-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }.code-tabs { background: #2e4438; border-color: #4e6556; }.code-tabs button { color: #bfcfbd; }.code-tabs button[aria-selected=true] { color: #d7ffb7; }.code-toolbar .quiet { min-height: 40px; font-size: 13px; }
  pre { height: 465px; overflow: auto; margin: 0; padding: 20px; border: 1px solid #4b6151; border-radius: 12px; background: #14271f; font: 12px/1.9 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 2; color: #d4e7c8; }.code-note { font-size: 12px; color: #a1b89e; margin-top: 12px; }
  footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 25px 0 30px; font-size: 11px; color: var(--muted); }footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
  .toast { position: fixed; z-index: 100; bottom: 25px; left: 50%; transform: translate(-50%, 14px); max-width: calc(100% - 30px); width: max-content; background: var(--ink); color: #fff; border: 1px solid var(--lime); padding: 12px 20px; border-radius: 100px; font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }.toast.visible { opacity: 1; transform: translate(-50%, 0); }
}
@layer responsive {
  @container studio (max-width: 900px) { .studio-grid { grid-template-columns: 270px minmax(0, 1fr); }.control-section { padding: 21px; }.preview-column { padding-inline: 18px; }.state-grid { grid-template-columns: 1fr; }.preview-canvas { padding: 22px 16px; }.live-stage { padding-inline: 5px; } }
  @container studio (max-width: 700px) { .studio-grid { grid-template-columns: 1fr; }.controls { border-right: 0; border-bottom: 1px solid var(--line); }.controls [role=tabpanel] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }.control-section + .control-section { border-top: 0; border-left: 1px solid var(--line); }.tabs { width: min(320px, calc(100% - 40px)); }.preview-sticky { position: static; }.state-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @container studio (max-width: 480px) { .controls [role=tabpanel] { display: block; }.control-section + .control-section { border-left: 0; border-top: 1px solid var(--line); }.state-grid { grid-template-columns: 1fr; }.studio-heading { padding: 19px; gap: 12px; }.studio-heading h2 { font-size: 21px; }.badge { display: none; }.preview-column { padding-inline: 16px; }.stage-tip { font-size: 11px; }.live-stage { min-height: 200px; } }
  @media (max-width: 1100px) { .preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }.hero-bottom { align-items: start; }.hero-bottom .quiet { flex: none; }.export-grid { grid-template-columns: minmax(230px, .8fr) minmax(0, 1.3fr); } }
  @media (max-width: 800px) { .page { width: calc(100% - 40px); }.hero-bottom { flex-direction: column; gap: 16px; }.preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.export-grid { grid-template-columns: 1fr; }.export-guide { padding: 24px; }.code-panel { padding: 20px; }footer { align-items: start; flex-direction: column; } }
  @media (max-width: 480px) { .page { width: calc(100% - 24px); }.hero { padding-top: 26px; }h1 { font-size: 37px; }.eyebrow { font-size: 11px; }.section-heading { gap: 10px; align-items: start; }.section-heading h2 { font-size: 23px; }.preset-info { padding: 11px; }.preset-info strong { font-size: 13px; }.preset-info small { font-size: 11px; line-height: 1.6; }.preset-art { padding: 24px 8px; min-height: 107px; }.preset-grid { gap: 10px; }.section-heading .quiet { padding: 10px; font-size: 12px; }.section-heading .quiet svg { display: none; }.code-toolbar { flex-wrap: wrap; gap: 12px; }.export-section .section-heading .primary { font-size: 12px; padding: 10px; }.export-section .section-heading .primary svg { display: none; }pre { padding: 14px; } }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
}
