@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin-ext-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist Mono'; src: url('/fonts/geist-mono-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  --sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.2, .6, .2, 1);
  --top: 64px;
  --bottom: 0px;
  --r-s: 8px; --r-m: 12px; --r-l: 16px; --r-xl: 24px; --pill: 999px;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0a0a0a; --panel: #121212; --raised: #171717; --hover: #1f1f1f;
  --line: #262626; --line-strong: #404040; --grid: rgba(255, 255, 255, .055);
  --text: #fafafa; --text-2: #a3a3a3; --text-3: #858585;
  --invert: #fafafa; --on-invert: #0a0a0a; --invert-hover: #dedede;
  --danger: #f87171;
  --shadow-box: 0 4px 18px rgba(0, 0, 0, .65);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, .7);
  --thumb: #333333; --thumb-hover: #4d4d4d;
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #ffffff; --panel: #fafafa; --raised: #ffffff; --hover: #f2f2f2;
  --line: #e5e5e5; --line-strong: #c9c9c9; --grid: rgba(10, 10, 10, .06);
  --text: #171717; --text-2: #525252; --text-3: #6b6b6b;
  --invert: #171717; --on-invert: #ffffff; --invert-hover: #333333;
  --danger: #b91c1c;
  --shadow-box: 0 2px 10px rgba(15, 23, 42, .12);
  --shadow-pop: 0 12px 32px rgba(15, 23, 42, .18);
  --thumb: #cfcfcf; --thumb-hover: #ababab;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: var(--thumb) transparent; }
@supports selector(::-webkit-scrollbar) {
  * { scrollbar-width: auto; scrollbar-color: auto; }
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--thumb); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
  ::-webkit-scrollbar-thumb:hover { background-color: var(--thumb-hover); }
  ::-webkit-scrollbar-button { display: none; }
}
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--text); font: 400 16px/1.5 var(--sans); letter-spacing: -.005em; -webkit-font-smoothing: antialiased; overflow-x: hidden; padding-bottom: var(--bottom); }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul { list-style: none; margin: 0; padding: 0; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; padding: 0; background: none; border: 0; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
#main:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 60; padding: 8px 16px; background: var(--invert); color: var(--on-invert); border-radius: var(--pill); }
.skip:focus { top: 8px; }
.mono { font-family: var(--mono); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.ic { flex: none; }
.noscript { padding: 24px; text-align: center; }

/* ---------- cabeçalho ---------- */
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 32px; padding: 0 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--text); text-decoration: none; font-weight: 600; }
.nav-top { display: flex; gap: 4px; }
.nav-top a { display: flex; align-items: center; height: 40px; padding: 0 12px; border-radius: var(--pill); color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .15s var(--ease), background-color .15s var(--ease); }
.nav-top a:hover { color: var(--text); background: var(--hover); }
.nav-top a[aria-current] { color: var(--text); background: var(--hover); }
.theme-btn { margin-left: auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--pill); border: 1px solid var(--line); background: var(--panel); color: var(--text-2); transition: color .15s var(--ease), border-color .15s var(--ease); }
.theme-btn:hover { color: var(--text); border-color: var(--line-strong); }
.nav-bottom { display: none; }

/* ---------- botões, campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--pill); border: 1px solid transparent; font-size: 14px; font-weight: 500; white-space: nowrap; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .15s var(--ease); }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .4; }
.btn-primary { background: var(--invert); color: var(--on-invert); }
.btn-primary:hover:not(:disabled) { background: var(--invert-hover); }
.btn-secondary { background: var(--panel); border-color: var(--line); color: var(--text); box-shadow: var(--shadow-box); }
.btn-secondary:hover:not(:disabled) { background: var(--hover); border-color: var(--line-strong); }
.btn-secondary[aria-pressed='true'] .ic, .btn-primary[aria-pressed='true'] .ic, .col-act[data-act='fav'][aria-pressed='true'] .ic { fill: currentColor; }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.btn-ghost[aria-pressed='true'], .btn-ghost[aria-expanded='true'] { background: var(--hover); color: var(--text); }
.btn-icon { width: 40px; padding: 0; flex: none; }
.field { width: 100%; height: 44px; padding: 0 16px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--raised); font-size: 14px; outline: none; transition: border-color .15s var(--ease); }
.field:hover { border-color: var(--line-strong); }
.field:focus { border-color: var(--text-2); }
.field[aria-invalid='true'] { border-color: var(--danger); }
.field::placeholder { color: var(--text-3); }
.field::-webkit-search-cancel-button { -webkit-appearance: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 16px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--panel); color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap; transition: color .15s var(--ease), border-color .15s var(--ease); }
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-selected='true'] { background: var(--invert); border-color: var(--invert); color: var(--on-invert); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--pill); }
.seg-btn { min-height: 32px; padding: 0 16px; border-radius: var(--pill); font-size: 14px; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-selected='true'] { background: var(--invert); color: var(--on-invert); }
kbd { display: inline-block; padding: 0 8px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--r-s); font: 500 12px/20px var(--mono); color: var(--text-2); }

/* ---------- base de página ---------- */
.grid-bg { position: absolute; z-index: -1; left: 0; right: 0; top: var(--top); height: 880px; pointer-events: none;
  background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px), linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 220px 220px; background-position: calc(50% + 110px) 219px;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent); }
.grid-bg.short { height: 480px; }
.wrap { width: min(1008px, 100%); margin: 0 auto; padding: 0 24px; }
.panel { border: 1px solid var(--line); background: var(--panel); border-radius: var(--r-xl); box-shadow: var(--shadow-box); }

/* ---------- extrator ---------- */
.hero { max-width: 768px; margin: 0 auto; padding: 96px 24px 0; text-align: center; }
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.hero h1 { max-width: 600px; margin: 12px auto 0; font-size: 56px; line-height: 1.04; font-weight: 700; letter-spacing: -.04em; }
.lead { max-width: 620px; margin: 24px auto 0; font-size: 18px; line-height: 1.6; color: var(--text-2); }
.url-form { display: flex; align-items: center; gap: 12px; max-width: 600px; height: 64px; margin: 48px auto 0; padding: 0 12px 0 24px; border: 1px solid var(--line-strong); border-radius: var(--pill); background: var(--raised); box-shadow: var(--shadow-box); text-align: left; transition: border-color .15s var(--ease); }
.url-form:focus-within { border-color: var(--text-2); }
.url-form:has([aria-invalid]) { border-color: var(--danger); }
.url-form input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; }
.url-form input::placeholder { color: var(--text-3); }
.url-go { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: var(--pill); background: var(--invert); color: var(--on-invert); transition: background-color .15s var(--ease), transform .15s var(--ease); }
.url-go:hover:not(:disabled) { background: var(--invert-hover); }
.url-go:active:not(:disabled) { transform: scale(.96); }
.url-go.spin .ic { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.url-msg { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 24px; margin-top: 12px; font-size: 14px; color: var(--danger); }
.url-msg:empty { min-height: 0; }
.examples { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; color: var(--text-3); }
.result { margin-top: 64px; scroll-margin-top: 88px; }
.result:empty { display: none; }
.result-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.result h2 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }
.result > .muted, .result-note { margin-top: 4px; font-size: 14px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.card-color { display: flex; flex-direction: column; width: 100%; text-align: left; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--panel); box-shadow: var(--shadow-box); transition: border-color .15s var(--ease), transform .15s var(--ease); }
button.card-color:hover { border-color: var(--line-strong); }
button.card-color:active { transform: scale(.98); }
.swatch { display: grid; place-items: center; height: 96px; border-bottom: 1px solid var(--line); }
.swatch-hint { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .15s var(--ease); }
.copied .swatch-hint { opacity: 1; }
.meta { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; min-width: 0; }
.hex { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.role { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); }
.skeleton .swatch, .skeleton i { background: var(--hover); }
.skeleton i { display: block; width: 50%; height: 12px; margin: 4px 0; border-radius: 4px; }
.skeleton i:last-child { width: 80%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.contrast-box { display: flex; align-items: center; gap: 16px; margin-top: 24px; padding: 16px 20px; font-size: 14px; color: var(--text-2); }
.contrast-box strong { color: var(--text); font-weight: 600; }
.aa { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: var(--r-m); border: 1px solid var(--line); font-size: 18px; font-weight: 700; }
.use-code { margin-top: 48px; padding: 32px; }
.use-code > h2 { font-size: 24px; font-weight: 700; }
.use-code > p { max-width: 640px; margin-top: 12px; font-size: 14px; }
.code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.code-block { min-width: 0; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg); }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 0 16px; }
.code-head h3 { font-size: 14px; font-weight: 600; }
.code { margin: 0; padding: 16px; overflow: auto; max-height: 360px; font: 400 12px/1.7 var(--mono); color: var(--text); }
.faq { margin-top: 96px; padding-bottom: 96px; }
.faq h2 { margin-bottom: 24px; font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; cursor: pointer; font-weight: 500; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { color: var(--text-3); transition: transform .2s var(--ease); }
.faq details[open] summary .ic { transform: rotate(180deg); }
.faq details p { max-width: 640px; padding-bottom: 24px; font-size: 14px; line-height: 1.65; color: var(--text-2); }

/* ---------- gerador ---------- */
.generator { display: flex; flex-direction: column; height: calc(100vh - var(--top) - var(--bottom)); height: calc(100dvh - var(--top) - var(--bottom)); min-height: 520px; }
.toolbar { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.tool-hint { font-size: 14px; color: var(--text-3); white-space: nowrap; }
.tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.tool-sep { width: 1px; height: 24px; margin: 0 4px; background: var(--line); }
.tools .btn-secondary { margin: 0 4px; box-shadow: none; }
.gen-body { position: relative; display: flex; flex: 1; min-height: 0; }
.stage { position: relative; display: flex; flex: 1; min-width: 0; }
.columns { display: flex; flex: 1; min-width: 0; min-height: 0; }
.col { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 24px; padding: 16px 4px 48px; }
.col-actions { display: flex; flex-direction: column; align-items: center; gap: 0; }
.col-act { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-m); opacity: 0; transition: opacity .15s var(--ease), background-color .15s var(--ease), transform .15s var(--ease); }
.col:hover .col-act, .col:focus-within .col-act, .col-act.keep, .dragging .grabbed .col-act { opacity: 1; }
.col-act:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.col-act:active { transform: scale(.96); }
.col :focus-visible { outline-color: currentColor; }
.col-act[data-act='drag'] { cursor: grab; touch-action: none; }
.dragging, .dragging * { cursor: grabbing !important; user-select: none; }
.col-text { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 100%; text-align: center; }
.col-hex { min-height: 40px; max-width: 100%; padding: 0 8px; border-radius: var(--r-s); font-size: clamp(14px, 1.7vw, 24px); font-weight: 600; text-transform: uppercase; }
.col-hex:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.col-name { min-height: 36px; padding: 0 4px; font-size: 12px; line-height: 1.5; opacity: .85; }
.col-add { position: absolute; top: 0; bottom: 0; width: 40px; z-index: 3; display: grid; place-items: center; pointer-events: none; }
.col-add.before { left: -20px; }
.col-add.after { right: 0; }
.col:first-child .col-add.before { left: 0; }
.col-add button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--pill); background: #fff; color: #0a0a0a; box-shadow: 0 2px 12px rgba(0, 0, 0, .35); opacity: 0; pointer-events: auto; transition: opacity .15s var(--ease), transform .15s var(--ease); }
.col-add button:hover, .col-add button:focus-visible { opacity: 1; }
.col-add button:focus-visible { outline: 2px solid #0a0a0a; outline-offset: 2px; }
.col.shading { padding: 0; justify-content: stretch; }
.shade-list { display: flex; flex-direction: column; flex: 1; width: 100%; min-height: 0; overflow: auto; }
.shade { flex: 1 0 24px; width: 100%; font-size: 12px; }
.shade span { opacity: 0; }
.shade:hover span, .shade:focus-visible span, .shade[aria-selected='true'] span { opacity: 1; }
.shade[aria-selected='true'] { font-weight: 700; }
.shade:focus-visible { outline-offset: -4px; }
.shade-close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--pill); background: #fff; color: #0a0a0a; box-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.vision-chip { color: var(--text); }
.flyout { position: absolute; top: 16px; right: 16px; z-index: 8; display: flex; flex-direction: column; width: min(320px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--panel); color: var(--text); box-shadow: var(--shadow-pop); }
.flyout > * { flex: none; }
.flyout > .flyout-body { flex: 0 1 auto; display: flex; flex-direction: column; gap: 16px; min-height: 0; overflow-y: auto; padding: 4px 20px 8px; }
.flyout-body > * { flex: none; }
.slider { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.slider > span { display: flex; justify-content: space-between; }
.slider output { font-family: var(--mono); color: var(--text-2); }
input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; margin: 0; background: none; cursor: pointer; }
input[type='range']::-webkit-slider-runnable-track { height: 8px; border-radius: var(--pill); background: var(--track, var(--line-strong)); }
input[type='range']::-moz-range-track { height: 8px; border-radius: var(--pill); background: var(--track, var(--line-strong)); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -6px; border-radius: 50%; border: 3px solid #fff; background: #171717; box-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
input[type='range']::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; border: 3px solid #fff; background: #171717; box-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.editor-top { display: flex; gap: 12px; }
.editor-sample { flex: none; width: 44px; height: 44px; border-radius: var(--r-m); border: 1px solid var(--line); }

/* painel explorar */
.explore { display: flex; flex-direction: column; flex: none; width: 312px; min-height: 0; border-left: 1px solid var(--line); background: var(--bg); }
.explore-head { display: flex; align-items: center; gap: 4px; padding: 12px 8px 8px 16px; }
.explore-head .seg { margin-right: auto; }
.explore-head [data-close-panel] { display: none; }
.explore-filter { padding: 0 8px; }
.explore-filter .btn { flex-direction: row-reverse; padding: 0 8px; color: var(--text); }
.explore-search { padding: 4px 16px 12px; }
.explore-list { flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding: 4px 16px 24px; overscroll-behavior: contain; }
.explore-list > .btn { flex: none; }
.explore-item { flex: none; }
.strip { display: flex; width: 100%; height: 48px; overflow: hidden; border-radius: var(--r-m); border: 1px solid var(--line); box-shadow: var(--shadow-box); }
.strip span { flex: 1; transition: flex-grow .2s var(--ease); }
.strip:hover span:hover { flex-grow: 1.8; }
.explore-meta { display: flex; align-items: center; margin-top: 4px; font-size: 12px; color: var(--text-2); }
.explore-meta > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.explore-meta .btn-icon { width: 32px; min-height: 32px; }
.explore-meta .btn[aria-pressed='true'] { background: none; color: var(--text); }
.explore-meta .btn[aria-pressed='true']:hover { background: var(--hover); }
.explore-meta .btn[aria-pressed='true'] .ic { fill: currentColor; }
.empty-small { padding: 24px 8px; text-align: center; font-size: 14px; color: var(--text-2); }
.scrim { display: none; }

/* ---------- salvas ---------- */
.saved { padding-top: 64px; padding-bottom: 96px; }
.page-head h1 { font-size: 40px; font-weight: 700; letter-spacing: -.03em; }
.page-head p { margin-top: 8px; }
.saved-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 32px 0 20px; }
.saved-bar .actions { margin: 0; }
.saved-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.saved-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--panel); box-shadow: var(--shadow-box); }
.saved-strip { display: flex; height: 120px; border-bottom: 1px solid var(--line); }
.saved-strip button { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; overflow: hidden; transition: flex-grow .2s var(--ease); }
.saved-strip button span { font-size: 12px; opacity: 0; }
.saved-strip button:hover, .saved-strip button:focus-visible { flex-grow: 3; }
.saved-strip button:hover span, .saved-strip button:focus-visible span { opacity: 1; }
.saved-strip button:focus-visible { outline-color: currentColor; outline-offset: -4px; }
.saved-meta { display: flex; align-items: center; gap: 4px; padding: 12px 8px 12px 16px; }
.saved-meta > div { flex: 1; min-width: 0; }
.saved-meta h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.saved-meta p { margin-top: 4px; font-size: 12px; color: var(--text-2); }
.saved-colors { margin-top: 0; }
.saved-color { position: relative; }
.saved-color > .btn { position: absolute; right: 8px; bottom: 12px; }
.saved-color .meta { padding-right: 48px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 64px 24px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 8px; border-radius: var(--r-l); border: 1px solid var(--line); color: var(--text-2); }
.empty h2 { font-size: 20px; font-weight: 600; }
.empty p { font-size: 14px; max-width: 420px; }
.empty .actions { justify-content: center; }

/* ---------- menus, janelas, avisos ---------- */
.menu { position: fixed; z-index: 50; min-width: 232px; max-width: calc(100vw - 16px); overflow-y: auto; margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--raised); box-shadow: var(--shadow-pop); animation: pop .15s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 0 12px; border-radius: var(--r-s); font-size: 14px; text-align: left; color: var(--text); }
.menu-item:hover, .menu-item:focus-visible, .menu-item[aria-expanded='true'] { background: var(--hover); outline: none; }
.menu-item:focus-visible { box-shadow: inset 0 0 0 2px var(--line-strong); }
.menu-item .ic { color: var(--text-2); }
.menu-item.danger, .menu-item.danger .ic { color: var(--danger); }
.menu-label { flex: 1; }
.menu-check { display: grid; place-items: center; width: 16px; }
.menu-sep { height: 1px; margin: 8px 4px; background: var(--line); }

.modal { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--panel); color: var(--text); box-shadow: var(--shadow-pop); }
.modal[open] { display: flex; flex-direction: column; animation: pop .2s var(--ease); }
.modal:focus { outline: none; }
.modal-wide { width: min(760px, calc(100% - 32px)); }
.modal::backdrop { background: rgba(0, 0, 0, .65); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 12px 12px 20px; }
.modal-head h2 { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.modal-body { display: flex; flex-direction: column; gap: 16px; min-height: 0; overflow: auto; padding: 4px 20px 20px; }
.modal-body h3 { font-size: 14px; font-weight: 600; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 20px 20px; }
.modal-body .chips { flex: none; }
.modal-body .chip { padding: 0 12px; }
.export-view { display: flex; flex-direction: column; gap: 12px; }
.export-view .code { height: 280px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg); }
.export-view p { font-size: 14px; }
.export-strip { display: flex; height: 240px; overflow: hidden; border-radius: var(--r-l); border: 1px solid var(--line); }
.export-strip span { flex: 1; }
.quick { display: flex; flex: none; height: 320px; overflow: hidden; border-radius: var(--r-l); border: 1px solid var(--line); }
.quick-color { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 16px 4px; font-size: 12px; text-align: center; }
.quick-color strong { font-size: 14px; font-weight: 600; }
.quick-color:focus-visible { outline-color: currentColor; outline-offset: -4px; }
.full { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; }
.full[open] { display: flex; }
.full .quick-color { padding-bottom: 48px; }
.full-close { position: fixed; top: 16px; right: 16px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--pill); background: #fff; color: #0a0a0a; box-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.info-swatch { display: flex; align-items: flex-end; flex: none; min-height: 96px; padding: 16px; border-radius: var(--r-l); border: 1px solid var(--line); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.info-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.values { margin: 0; }
.values > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; border-bottom: 1px solid var(--line); }
.values dt { font-size: 12px; color: var(--text-2); }
.values dd { margin: 0; min-width: 0; }
.value-copy { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 4px; font-size: 12px; text-align: right; }
.value-copy .ic { color: var(--text-3); }
.value-copy:hover .ic { color: var(--text); }
.contrast-list { display: flex; flex-direction: column; gap: 12px; }
.contrast-row { display: flex; align-items: center; gap: 16px; }
.contrast-row div { display: flex; flex-direction: column; font-size: 14px; }
.form-row { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; }

.toast { position: fixed; inset: auto auto calc(24px + var(--bottom)) 50%; display: none; align-items: center; gap: 16px; width: max-content; max-width: calc(100vw - 32px); min-height: 48px; margin: 0; padding: 8px 20px; border: 0; border-radius: var(--pill); background: var(--invert); color: var(--on-invert); box-shadow: var(--shadow-pop); font-size: 14px; font-weight: 500; transform: translateX(-50%); z-index: 70; overflow: visible; }
.toast.show { display: flex; }
.toast-action { min-height: 32px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }
.toast :focus-visible { outline-color: var(--on-invert); }
.tip { position: fixed; z-index: 80; padding: 4px 12px; border-radius: var(--r-s); background: var(--invert); color: var(--on-invert); font-size: 12px; font-weight: 500; white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; left: 0; top: 0; }
.tip.show { opacity: 1; visibility: visible; }

@media (min-width: 768px) and (max-height: 780px) {
  .col { gap: 8px; padding-bottom: 16px; }
  .col-act { height: 36px; }
}

/* ---------- toque ---------- */
@media (hover: none) {
  .col-act { opacity: 1; }
  .col-add { display: none; }
}

/* ---------- telas menores ---------- */
@media (max-width: 1099px) {
  .explore { position: absolute; top: 0; bottom: 0; right: 0; z-index: 12; width: min(360px, 100%); box-shadow: var(--shadow-pop); }
  .explore-head [data-close-panel] { display: inline-flex; }
  .scrim { display: block; position: absolute; inset: 0; z-index: 11; background: rgba(0, 0, 0, .55); cursor: default; }
  .tool-hint { display: none; }
}
@media (min-width: 768px) and (max-width: 1099px) {
  .col-hex { font-size: 14px; }
}
@media (min-width: 768px) {
  [data-add-end] { display: none; }
}
@media (max-width: 899px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .saved-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .code-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  :root { --top: 56px; --bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .topbar { padding: 0 16px; }
  .nav-top { display: none; }
  .theme-btn { width: 44px; height: 44px; }
  .nav-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); height: var(--bottom); padding-bottom: env(safe-area-inset-bottom, 0px); border-top: 1px solid var(--line); background: var(--bg); }
  .nav-bottom a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--text-3); text-decoration: none; }
  .nav-bottom a[aria-current] { color: var(--text); }
  .nav-bottom a[aria-current] .ic { stroke-width: 2.4; }
  .btn { min-height: 44px; }
  .btn-icon { width: 44px; }
  .chip { min-height: 40px; }
  .seg-btn { min-height: 40px; }
  .wrap { padding: 0 16px; }
  .hero { padding: 48px 16px 0; }
  .eyebrow { font-size: 12px; }
  .hero h1 { font-size: 36px; letter-spacing: -.03em; }
  .lead { margin-top: 16px; font-size: 16px; }
  .url-form { height: 56px; margin-top: 32px; padding: 0 6px 0 20px; }
  .url-go { width: 44px; height: 44px; }
  .examples span { width: 100%; }
  .result { margin-top: 48px; scroll-margin-top: 72px; }
  .result .actions .btn { flex: 1 1 100%; }
  .contrast-box { align-items: flex-start; padding: 16px; }
  .use-code { padding: 20px 16px; }
  .faq { margin-top: 64px; padding-bottom: 48px; }
  .faq h2 { font-size: 24px; }

  .generator { min-height: 0; }
  .toolbar { flex-wrap: wrap; gap: 0 8px; padding: 8px 4px 4px; }
  .toolbar::after { content: ''; order: 2; width: 100%; height: 4px; }
  .toolbar > .btn-primary { order: 0; flex: 1; margin-left: 4px; }
  .tools { display: contents; }
  .tools .btn-secondary { order: 1; flex: 1; margin: 0 4px 0 0; }
  .tools .btn-icon { order: 3; flex: 1 1 0; width: auto; }
  .tools .btn-icon + .btn-icon { margin-left: -8px; }
  .tool-sep { display: none; }
  .vision-chip { order: 4; margin: 4px auto; }
  .gen-body { overflow: hidden; }
  .columns { flex-direction: column; overflow-y: auto; }
  .col { flex: 1 0 96px; flex-direction: column-reverse; justify-content: center; align-items: stretch; gap: 0; padding: 4px 8px; }
  .col-text { flex-direction: row; justify-content: flex-start; align-items: center; gap: 8px; text-align: left; }
  .col-hex { flex: none; font-size: 18px; }
  .col-name { min-height: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .col-actions { flex-direction: row; justify-content: space-between; }
  .col-act { flex: 1 1 0; width: auto; max-width: 48px; height: 44px; }
  .col.shading { padding: 0; flex-basis: 240px; flex-direction: column; }
  .shade-list { flex-direction: row; flex-wrap: wrap; align-content: stretch; }
  .shade { flex: 1 0 20%; min-height: 48px; }
  .shade span { opacity: 1; }
  .shade-close { top: auto; bottom: 8px; }
  .explore { width: 100%; }
  .explore-meta .btn-icon { width: 44px; min-height: 44px; }
  .flyout { top: auto; bottom: 8px; right: 8px; left: 8px; width: auto; max-height: calc(100% - 16px); }
  .flyout .modal-head { padding: 4px 8px 0 20px; }
  .flyout .flyout-body { gap: 4px; }
  .flyout .modal-foot { padding: 8px 16px 16px; }

  .saved { padding-top: 32px; padding-bottom: 48px; }
  .page-head h1 { font-size: 32px; }
  .saved-bar { margin-top: 24px; }
  .saved-bar .seg { width: 100%; }
  .saved-bar .seg-btn { flex: 1; }
  .saved-bar .actions { width: 100%; }
  .saved-bar .actions .btn { flex: 1; }
  .saved-grid { grid-template-columns: minmax(0, 1fr); }
  .empty { padding: 48px 16px; }
  .empty .actions { flex-direction: column; align-self: stretch; }

  .quick, .full[open] { flex-direction: column; }
  .quick { height: auto; }
  .quick-color { flex: 1 0 56px; flex-direction: row; justify-content: space-between; align-items: center; padding: 0 16px; }
  .full .quick-color { padding: 0 24px; }
  .export-strip { height: 160px; }
  .modal-foot .btn { flex: 1 1 auto; }
  .values dt { flex: none; }
  .value-copy { min-height: 44px; }
}
@media (max-width: 639px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card-color { flex-direction: row; }
  .card-color .swatch { width: 104px; height: auto; min-height: 72px; flex: none; border-bottom: 0; border-right: 1px solid var(--line); }
  .card-color .meta { flex: 1; justify-content: center; }
  .card-color .role { justify-content: flex-start; gap: 12px; }
  .saved-color > .btn { top: 50%; bottom: auto; margin-top: -22px; }
  .swatch-hint { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
