/* ---------- cabeçalho: conta e ferramentas ---------- */
.top-end { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.top-end .theme-btn { margin-left: 0; }
.account-btn span { max-width: 128px; overflow: hidden; text-overflow: ellipsis; }
.nav-top button { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px; border-radius: var(--pill); color: var(--text-2); font-size: 14px; font-weight: 500; transition: color .15s var(--ease), background-color .15s var(--ease); }
.nav-top button:hover, .nav-top button[aria-current], .nav-top button[aria-expanded='true'] { color: var(--text); background: var(--hover); }
.nav-top button .ic { transition: transform .2s var(--ease); }
.nav-top button[aria-expanded='true'] .ic { transform: rotate(180deg); }
.mega { position: fixed; z-index: 19; left: 0; right: 0; top: var(--top); max-height: calc(100dvh - var(--top)); overflow: auto; border-bottom: 1px solid var(--line); background: var(--bg); box-shadow: var(--shadow-pop); animation: pop .15s var(--ease); }
.mega-inner { width: min(1008px, 100%); margin: 0 auto; padding: 24px; }
.tool-groups { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.tool-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tool-card, .tool-link { display: flex; align-items: flex-start; gap: 12px; color: var(--text); text-decoration: none; transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.tool-card { min-height: 96px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); box-shadow: var(--shadow-box); }
.tool-card:hover, .tool-card[aria-current] { border-color: var(--line-strong); background: var(--hover); }
.tool-card .ic, .tool-link .ic { color: var(--text-2); }
.tool-card span { display: flex; flex-direction: column; gap: 4px; }
.tool-card b { font-size: 16px; font-weight: 600; }
.tool-card small { font-size: 12px; line-height: 1.5; color: var(--text-2); }
.tool-discover { display: flex; flex-direction: column; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); box-shadow: var(--shadow-box); }
.tool-title { padding: 4px 12px 8px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.tool-link { align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--r-s); }
.tool-link b { font-size: 14px; font-weight: 500; }
.tool-link:hover, .tool-link[aria-current] { background: var(--hover); }

/* ---------- formulários de conta ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-intro { font-size: 14px; }
.form-error { font-size: 14px; color: var(--danger); }
.form-error:empty { display: none; }
.form .btn { min-height: 44px; }
.seg-full { display: flex; width: 100%; }
.seg-full .seg-btn { flex: 1; }
.btn-danger { background: var(--danger); color: var(--bg); }
.text-link { display: inline; padding: 0; color: var(--text); font: inherit; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- base das ferramentas ---------- */
.tool { display: flex; flex-direction: column; gap: 16px; padding-top: 64px; padding-bottom: 96px; }
.tool > .page-head { margin-bottom: 16px; }
.tool .actions, .tool .cards { margin-top: 0; }
.tool .saved-grid, .tool .tool-groups { width: 100%; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack.hidden, .dropzone-wrap.hidden { display: none; }
.pad { padding: 24px; min-width: 0; }
.panel h2 { font-size: 18px; font-weight: 600; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.actions.center, .chips.center { justify-content: center; }
.actions.top { margin: 0; }
.loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 96px 24px; }
.loading .ic, .typing .ic { animation: spin .9s linear infinite; }
.row-head { display: flex; align-items: center; gap: 4px; }
.row-head > div { flex: 1; min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.control { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.control.grow { flex: 1 1 240px; }
.control-label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.select { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 200px; height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--raised); font-size: 14px; text-align: left; transition: border-color .15s var(--ease); }
.select:hover, .select[aria-expanded='true'] { border-color: var(--line-strong); }
.fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; align-items: end; }
.slider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.area { height: auto; min-height: 112px; padding: 12px 16px; resize: vertical; line-height: 1.6; font-size: 12px; }

/* seletor de cor */
.color-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.color-field-row { display: flex; gap: 8px; }
.color-swatch { flex: none; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: var(--r-m); }
.popover { position: fixed; z-index: 55; width: 264px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--raised); box-shadow: var(--shadow-pop); }
.picker { display: flex; flex-direction: column; gap: 12px; }
.sv { position: relative; height: 160px; border-radius: var(--r-m); cursor: crosshair; touch-action: none; background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, var(--h, #f00)); }
.sv-thumb { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 1px 6px rgba(0, 0, 0, .5); pointer-events: none; }
input[type='range'].hue { --track: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }

/* amostras */
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; }
.swatch-btn { display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 4px; width: 100%; min-height: 112px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-l); text-align: left; font-size: 12px; transition: transform .15s var(--ease); }
.swatch-btn strong { font-size: 14px; font-weight: 600; }
.swatch-btn:active { transform: scale(.98); }
.palette-block { display: flex; flex-direction: column; gap: 16px; }
.ramp { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-m); }
.ramp button { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-height: 72px; padding: 8px 2px; font-size: 12px; }
.ramp button:focus-visible { outline-color: currentColor; outline-offset: -4px; }
.ramp button[aria-current] span, .ramp button[aria-current] b { text-decoration: underline; text-underline-offset: 4px; }
.ramp .mono { overflow: hidden; max-width: 100%; }

/* envio de arquivos */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 240px; padding: 32px 24px; border: 1px dashed var(--line-strong); border-radius: var(--r-xl); background: var(--panel); box-shadow: var(--shadow-box); text-align: center; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.dropzone:hover, .dropzone.over { border-color: var(--text-2); background: var(--hover); }
.dropzone strong { font-size: 18px; font-weight: 600; }
.dropzone .muted { font-size: 14px; }

/* cores de imagem */
.picker-image { position: relative; width: min(100%, calc(64vh * var(--ratio, 1.5))); margin: 0 auto 12px; cursor: crosshair; }
.picker-image canvas { display: block; width: 100%; height: auto; border-radius: var(--r-m); }
.mark { position: absolute; width: 32px; height: 32px; margin: -16px 0 0 -16px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 1px 8px rgba(0, 0, 0, .6); cursor: grab; touch-action: none; }
.mark.active { width: 40px; height: 40px; margin: -20px 0 0 -20px; z-index: 2; }

/* contraste */
.contrast-fields { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: end; }
.contrast-fields > .btn { width: 44px; height: 44px; }
.score { display: flex; flex-direction: column; gap: 4px; }
.score strong { font-size: 48px; line-height: 1.15; font-weight: 600; }
.score span { color: var(--text-2); font-size: 14px; }
.checks li { display: flex; align-items: center; gap: 12px; min-height: 40px; border-top: 1px solid var(--line); font-size: 14px; }
.checks li > span:nth-child(2) { flex: 1; }
.checks strong { font-weight: 600; font-size: 12px; }
.checks li.no, .checks li.no strong { color: var(--danger); }
.preview-panel { overflow: hidden; display: flex; }
.contrast-preview { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 32px; background: var(--pb); color: var(--pt); }
.contrast-preview .big { font-size: 28px; line-height: 1.25; font-weight: 700; }
.preview-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; }
.preview-row > span:last-child { display: flex; gap: 12px; }
.preview-button, .preview-outline { padding: 8px 16px; border: 2px solid var(--pt); border-radius: var(--pill); }
.preview-button { background: var(--pt); color: var(--pb); }

/* visualizador: dentro das prévias, --bg e --text são as cores escolhidas */
.chips-scroll { overflow-x: auto; }
.chips-scroll .seg { min-width: max-content; }
.mock-stage { overflow: hidden; }
.role-bar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.role-chip { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); box-shadow: var(--shadow-box); text-align: left; }
.role-chip:hover { border-color: var(--line-strong); }
.role-chip > span:first-child { flex: none; width: 32px; height: 32px; border-radius: var(--r-s); border: 1px solid var(--line-strong); }
.role-chip > span:last-child { display: flex; flex-direction: column; min-width: 0; font-size: 12px; }
.role-chip b { font-weight: 600; }
.role-chip small { color: var(--text-2); }
.mk { min-height: 520px; background: var(--bg); color: var(--text); font-size: 14px; }
.mk h3 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.mk i { font-style: normal; }
.mk-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 16px; border-radius: var(--pill); background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 600; white-space: nowrap; }
.mk-btn.outline { background: none; color: var(--text); border: 1px solid var(--primary); }
.mk-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-site { padding: 24px; display: flex; flex-direction: column; gap: 32px; }
.mk-nav { display: flex; align-items: center; gap: 24px; }
.mk-nav b { margin-right: auto; font-size: 16px; }
.mk-hero { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: center; }
.mk-hero > div:first-child { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.mk-hero h3 { font-size: 32px; line-height: 1.15; }
.mk-art { position: relative; height: 220px; border-radius: var(--r-xl); background: var(--surface); overflow: hidden; }
.mk-art span { position: absolute; border-radius: 50%; }
.mk-art span:nth-child(1) { width: 140px; height: 140px; left: 12%; bottom: -30px; background: var(--primary); }
.mk-art span:nth-child(2) { width: 88px; height: 88px; right: 16%; top: 24px; background: var(--accent); }
.mk-art span:nth-child(3) { width: 120px; height: 120px; right: 24%; bottom: -56px; background: var(--text); border-radius: var(--r-xl); }
.mk-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mk-cards > div { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--r-l); background: var(--surface); }
.mk-cards span { height: 64px; border-radius: var(--r-m); background: var(--primary); }
.mk-cards > div:nth-child(2) span { background: var(--accent); }
.mk-cards > div:nth-child(3) span { background: var(--text); }
.mk-dash { display: grid; grid-template-columns: 160px minmax(0, 1fr); }
.mk-dash aside { display: flex; flex-direction: column; gap: 4px; padding: 24px 12px; background: var(--surface); }
.mk-dash aside b { padding: 0 12px 16px; font-size: 16px; }
.mk-dash aside span { padding: 8px 12px; border-radius: var(--r-s); }
.mk-dash aside span.on { background: var(--primary); color: var(--on-primary); }
.mk-dash > div { display: flex; flex-direction: column; gap: 16px; padding: 24px; min-width: 0; }
.mk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; }
.mk-stats > div { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--r-m); background: var(--surface); }
.mk-stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.mk-chart { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-m); background: var(--surface); }
.mk-bars { display: flex; align-items: flex-end; gap: 8px; height: 128px; }
.mk-bars span { flex: 1; border-radius: 4px 4px 0 0; }
.mk-table > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--surface); }
.mk-table i { color: var(--text); font-size: 12px; padding: 0 8px; border-radius: var(--pill); border: 1px solid var(--accent); }
.mk-app { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; padding: 24px; background: var(--surface); }
.mk-phone { display: flex; flex-direction: column; gap: 12px; width: 264px; min-height: 472px; padding: 24px 16px; border: 8px solid var(--text); border-radius: 32px; background: var(--bg); }
.mk-phone .mk-btn { margin-top: auto; min-height: 44px; }
.mk-ring { display: grid; place-items: center; align-self: center; width: 128px; height: 128px; border-radius: 50%; background: radial-gradient(closest-side, var(--bg) 76%, transparent 77%), conic-gradient(var(--primary) 72%, var(--surface) 0); font-size: 24px; }
.mk-item { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-m); background: var(--surface); }
.mk-item span { width: 32px; height: 32px; border-radius: var(--r-s); background: var(--accent); }
.mk-poster { position: relative; width: min(400px, 100%); min-height: 560px; margin: 0 auto; overflow: hidden; }
.mk-sun { position: absolute; width: 200px; height: 200px; right: 40px; top: 56px; border-radius: 50%; background: var(--accent); }
.mk-hill { position: absolute; width: 150%; height: 320px; border-radius: 50%; }
.mk-hill.a { left: -60%; bottom: -60px; background: var(--primary); }
.mk-hill.b { right: -70%; bottom: -130px; background: var(--text); }
.mk-words { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 32px; }
.mk-words h3 { font-size: 48px; line-height: 1.15; max-width: 5em; }
.mk-brand { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 24px; }
.mk-logo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 160px; border-radius: var(--r-l); box-shadow: inset 0 0 0 1px var(--surface); }
.mk-logo svg-mark { width: 48px; height: 48px; border-radius: 50% 50% 50% 4px; background: currentColor; }
.mk-card { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-height: 160px; padding: 20px; border-radius: var(--r-m); border-top: 12px solid var(--accent); background: var(--surface); }
.mk-card span { margin-top: 12px; font-size: 12px; }
.mk-pattern { grid-column: span 2; display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-content: center; }
.mk-pattern span { aspect-ratio: 1; border-radius: 50%; }
.mk-pattern .p { background: var(--primary); }
.mk-pattern .a { background: var(--accent); border-radius: 4px; }
.mk-pattern .t { background: var(--text); border-radius: 50% 0; }
.mk-pattern .s { background: var(--surface); }

/* seletor de cor (página) */
.big-swatch { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-height: 128px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-l); }
.big-swatch strong { font-size: 32px; font-weight: 600; }
.vision-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.vision-grid > div { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.vision-grid span { height: 56px; border-radius: var(--r-m); border: 1px solid var(--line); }
.vision-grid small { color: var(--text-2); }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.related button { display: flex; flex-direction: column; gap: 8px; text-align: left; font-size: 12px; color: var(--text-2); }

/* tailwind */
.tw-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.tw-actions { display: flex; gap: 4px; height: 44px; align-items: center; }
.tw-ramp button { min-height: 88px; }
.tw-preview { display: flex; flex-direction: column; gap: 16px; }
.tw-demo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; font-size: 14px; }
.tw-demo i { font-style: normal; }
.tw-card { display: flex; flex-direction: column; gap: 12px; padding: 24px; border-radius: var(--r-l); background: var(--p50); color: var(--p950); }
.tw-card.dark { background: var(--p950); color: var(--p50); }
.tw-card b { font-size: 24px; }
.tw-badge { align-self: flex-start; padding: 4px 12px; border-radius: var(--pill); background: var(--s200); color: var(--s950); font-size: 12px; font-weight: 600; }
.tw-line { display: flex; align-items: center; gap: 8px; }
.tw-line .ic { color: var(--p700); }
.tw-btn { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: var(--r-m); background: var(--p600); color: var(--on-p); font-weight: 600; }
.tw-btn.soft { background: var(--p100); color: var(--p800); }
.tw-input { display: flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r-m); border: 1px solid var(--p700); background: var(--p900); color: var(--p200); }
.tw-progress { height: 8px; border-radius: var(--pill); background: var(--p800); overflow: hidden; }
.tw-progress span { display: block; width: 64%; height: 100%; background: var(--s400); }
.tw-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tw-tags span { padding: 4px 12px; border-radius: var(--pill); background: var(--p800); color: var(--p100); font-size: 12px; }
.tw-tags span:last-child { background: var(--s300); color: var(--s950); }

/* assistente */
.chat { display: flex; flex-direction: column; height: min(640px, calc(100dvh - 240px)); min-height: 420px; overflow: hidden; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding: 24px; }
.chat-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: auto; max-width: 560px; text-align: center; font-size: 14px; }
.msg { flex: none; display: flex; flex-direction: column; gap: 12px; max-width: 80%; font-size: 14px; line-height: 1.6; }
.msg > p { padding: 12px 16px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--raised); overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; }
.msg.user > p { background: var(--invert); border-color: var(--invert); color: var(--on-invert); }
.msg.assistant { align-self: flex-start; }
.msg.assistant:has(.chat-palette) { width: 80%; }
.msg.error > p { color: var(--danger); }
.typing { display: flex; align-items: center; gap: 8px; }
.chat-palette { flex: none; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--raised); }
.chat-strip { display: flex; height: 88px; }
.chat-strip button { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; padding: 8px 0; overflow: hidden; font-size: 12px; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-form .field { border-radius: var(--pill); }
.chat-form .url-go { width: 44px; height: 44px; }

/* lista de cores */
.color-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.named { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); box-shadow: var(--shadow-box); }
.named-swatch { display: block; width: 100%; height: 96px; border-bottom: 1px solid var(--line); }
.named-swatch:focus-visible { outline-color: currentColor; outline-offset: -4px; }
.named > div { display: flex; align-items: center; gap: 4px; padding: 8px 4px 8px 16px; }
.named > div > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.named b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.named small { font-size: 12px; color: var(--text-2); }

/* degradês */
.gradient-swatch { display: block; width: 100%; height: 160px; border-bottom: 1px solid var(--line); }
.saved-meta p.mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gradient-preview { height: 320px; }
.stop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 16px; align-items: end; }
.stop .slider input { height: 44px; margin-bottom: -4px; }
.key-field { display: flex; align-items: flex-end; gap: 4px; }
.key-field .color-field { flex: 1; }
.step-strip { height: 96px; }

/* conversor */
.file-list { display: flex; flex-direction: column; }
.file-list li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.file-list li:first-child { border-top: 0; padding-top: 0; }
.file-list img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--r-s); border: 1px solid var(--line); }
.file-list li > div { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.file-list b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file-list small { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* editor, svg, colagem */
.editor-holder { position: relative; width: min(100%, calc(64vh * var(--ratio, 1.5))); margin: 0 auto; }
.editor-canvas { display: block; width: 100%; height: auto; border-radius: var(--r-m); }
.editor-holder.cropping { overflow: hidden; cursor: crosshair; touch-action: none; }
.editor-holder.cropping .editor-canvas { border-radius: 0; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); cursor: move; }
.svg-preview { display: block; width: 100%; height: 400px; object-fit: contain; border-radius: var(--r-m); background: repeating-conic-gradient(var(--hover) 0 25%, transparent 0 50%) 0 0 / 24px 24px; }
.collage-canvas { display: block; max-width: 100%; max-height: 64vh; width: auto; height: auto; margin: 0 auto; border-radius: var(--r-s); border: 1px solid var(--line); touch-action: none; cursor: grab; }

/* fontes */
.font-list { display: flex; flex-direction: column; gap: 16px; }
.font-sample { font-size: var(--size); line-height: 1.35; overflow-wrap: anywhere; }
.font-list a { align-self: flex-start; font-size: 14px; display: inline-flex; align-items: center; min-height: 32px; }

@media (max-width: 899px) {
  .tool-groups, .split, .tw-demo { grid-template-columns: minmax(0, 1fr); }
  .color-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .role-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-hero { grid-template-columns: minmax(0, 1fr); }
  .mk-brand { grid-template-columns: minmax(0, 1fr); }
  .mk-pattern { grid-column: auto; }
}
@media (max-width: 767px) {
  .nav-bottom { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .top-end { gap: 8px; }
  .account-btn { min-height: 44px; }
  .mega { display: none; }
  .tool { gap: 16px; padding-top: 32px; padding-bottom: 48px; }
  .tool > .page-head { margin-bottom: 8px; }
  .pad { padding: 16px; }
  .tool-main { grid-template-columns: minmax(0, 1fr); }
  .tool-card { min-height: 0; }
  .tool-link { min-height: 48px; }
  .select { min-width: 0; width: 100%; }
  .filters > .control { flex: 1 1 100%; }
  .tool .actions .btn { flex: 1 1 auto; }
  .contrast-fields { grid-template-columns: minmax(0, 1fr); }
  .contrast-fields > .btn { justify-self: center; transform: rotate(90deg); }
  .contrast-preview { padding: 24px 16px; }
  .slider-grid { grid-template-columns: minmax(0, 1fr); }
  .stop { grid-template-columns: minmax(0, 1fr) auto; }
  .stop .slider { grid-column: 1; grid-row: 2; }
  .stop > .btn { grid-column: 2; grid-row: 1; align-self: end; }
  .tw-head { grid-template-columns: minmax(0, 1fr); }
  .tw-actions { justify-content: flex-end; }
  .ramp { flex-direction: column; }
  .ramp button, .tw-ramp button { flex: none; flex-direction: row-reverse; justify-content: space-between; align-items: center; min-height: 44px; padding: 0 16px; }
  .ramp button span:only-child { margin-right: auto; }
  .swatches { grid-template-columns: minmax(0, 1fr); }
  .swatch-btn { flex-direction: row; justify-content: space-between; align-items: center; min-height: 56px; padding: 0 16px; }
  .color-grid { grid-template-columns: minmax(0, 1fr); }
  .named { display: grid; grid-template-columns: 96px minmax(0, 1fr); }
  .named-swatch { height: 100%; min-height: 72px; border-bottom: 0; border-right: 1px solid var(--line); }
  .mk-dash { grid-template-columns: minmax(0, 1fr); }
  .mk-dash aside { flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .mk-dash aside b { width: 100%; padding-bottom: 8px; }
  .mk-dash > div { padding: 16px; }
  .mk-site { padding: 16px; }
  .mk-nav span { display: none; }
  .mk-cards { grid-template-columns: minmax(0, 1fr); }
  .chat { height: calc(100dvh - var(--top) - var(--bottom) - 160px); }
  .chat-log { padding: 16px; }
  .msg { max-width: 92%; }
  .msg.assistant:has(.chat-palette) { width: 100%; max-width: 100%; }
  .chat-strip span { display: none; }
  .gradient-preview { height: 224px; }
  .svg-preview { height: 280px; }
  .file-list li { grid-template-columns: 48px minmax(0, 1fr) auto auto; gap: 8px; }
  .file-list img { width: 48px; height: 48px; }
}
@media (max-width: 379px) {
  .account-btn { padding: 0 12px; }
  .account-btn span { max-width: 80px; }
}

/* ---------- regras ---------- */
.rule-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rule-grid li { display: flex; }
.rule-card { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 168px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); box-shadow: var(--shadow-box); color: var(--text); text-decoration: none; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.rule-card:hover { border-color: var(--line-strong); background: var(--hover); }
.rule-card strong { font-size: 16px; font-weight: 600; line-height: 1.3; }
.rule-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.rule-meta > span:first-child { margin-right: auto; }
.rule-flag { display: flex; color: var(--text); }
.rule-flag.fav .ic { fill: currentColor; }
.rule-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; color: var(--text-2); }
.panel .rule-title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.rule-summary { max-width: 640px; line-height: 1.6; }
.panel h3 { font-size: 14px; font-weight: 600; }
.how { display: flex; flex-direction: column; gap: 8px; }
.how li { display: flex; gap: 12px; max-width: 680px; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.how .ic { margin-top: 3px; color: var(--text); }
.rule-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rule-nav .btn:last-child { flex-direction: row-reverse; }
.btn-secondary[aria-pressed='true'] .ic { fill: currentColor; }
.btn-primary[aria-pressed='true'] .ic, .btn-secondary[aria-pressed='true'] .lucide-check { fill: none; }
.study-progress { display: flex; flex-direction: column; gap: 12px; font-size: 14px; color: var(--text-2); }
.study-progress strong { color: var(--text); font-weight: 600; }
.meter { height: 8px; overflow: hidden; border-radius: var(--pill); background: var(--hover); }
.meter span { display: block; height: 100%; border-radius: var(--pill); background: var(--text); transition: width .2s var(--ease); }
.flash { min-height: 240px; scroll-margin-top: 80px; }
.keys { text-align: center; }
.check-list { display: flex; flex-direction: column; }
.check-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 4px; border-top: 1px solid var(--line); text-align: left; font-size: 14px; }
.check-item:hover { background: var(--hover); }
.check-box { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border: 1px solid var(--line-strong); border-radius: var(--r-s); }
.check-box .ic { opacity: 0; }
.check-item[aria-checked='true'] .check-box { background: var(--invert); border-color: var(--invert); color: var(--on-invert); }
.check-item[aria-checked='true'] .check-box .ic { opacity: 1; }
.area.plain { font: 400 14px/1.6 var(--sans); min-height: 80px; }

/* exemplos "evite / prefira" */
.demos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.demo { display: flex; flex-direction: column; margin: 0; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg); }
.demo figcaption { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.demo.bad figcaption .ic { color: var(--danger); }
.demo.good figcaption .ic { color: var(--ok); }
.demo-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; min-height: 200px; padding: 20px; overflow: hidden; font-size: 14px; }
:root[data-theme='dark'] { --ok: #4ade80; --info: #60a5fa; }
:root[data-theme='light'] { --ok: #15803d; --info: #1d4ed8; }
.d-text { text-align: center; font-size: 16px; }
.d-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.d-col { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: min(100%, 288px); margin: 0 auto; }
.d-wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.d-box { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--panel); }
.d-box.heavy { border: 3px solid var(--text-2); }
.d-box.sharp { border-radius: 0; }
.d-box.round { border-radius: var(--pill); align-items: center; }
.d-box.hard { box-shadow: 6px 6px 0 var(--text-3); }
.d-box.lift { box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.d-box.lift2, .d-box.flat { box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.d-box.flat { box-shadow: none; }
.d-box.tall { min-height: 88px; }
.d-t { line-height: 1.4; }
.d-t.b { font-weight: 600; }
.d-t.m { color: var(--text-2); font-size: 12px; }
.d-t.xl { font-size: 24px; font-weight: 700; }
.d-t.r { text-align: right; }
.d-t.push { margin-left: auto; }
.d-t.tiny { font-size: 9px; }
.d-t.faint { color: var(--line-strong); }
.d-t.err { color: var(--danger); font-size: 12px; }
.d-t.link { color: var(--info); text-decoration: underline; }
.d-t.serif { font-family: Georgia, serif; font-size: 20px; }
.d-t.wide { letter-spacing: .24em; }
.d-t.script { font-family: cursive; font-size: 22px; font-style: italic; }
.d-t.mono { font-family: var(--mono); }
.d-t.break { overflow-wrap: anywhere; }
.d-t.chunk { padding: 4px 8px; border-radius: var(--r-s); background: var(--hover); font-family: var(--mono); }
.d-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--pill); font-size: 12px; font-weight: 500; white-space: nowrap; }
.d-btn.main { background: var(--invert); border-color: var(--invert); color: var(--on-invert); }
.d-btn.ghost { border-color: transparent; color: var(--text-2); }
.d-btn.danger { border-color: var(--danger); color: var(--danger); }
.d-btn.small { min-height: 24px; padding: 0 8px; font-size: 10px; }
.d-btn.big { min-height: 48px; padding: 0 24px; font-size: 14px; }
.d-btn.sharp { border-radius: 0; }
.d-btn.block { width: 100%; }
.d-btn.corner { align-self: flex-end; min-height: 20px; }
.d-btn.focus { outline: 2px solid var(--text); outline-offset: 3px; }
.d-btn.hoverable { background: var(--hover); }
.d-field { display: flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-s); font-size: 12px; white-space: pre; }
.d-field.ph { color: var(--text-3); }
.d-field.bad { border-color: var(--danger); }
.d-bar { display: block; height: 8px; border-radius: 4px; background: var(--line-strong); }
.d-dot { display: inline-block; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--text-2); }
.d-dot.big { width: 36px; height: 36px; }
.d-dot.tiny { width: 8px; height: 8px; }
.d-dot.hollow { background: none; border: 2px solid var(--line-strong); }
.d-dot.sq { border-radius: 4px; }
.d-dot.tri { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.d-dot.red { background: var(--danger); }
.d-dot.green { background: var(--ok); }
.d-ic { display: inline-flex; }
.d-ic.red { color: var(--danger); }
.d-ic.green { color: var(--ok); }
.d-ic.blue { color: var(--info); }
.d-progress { height: 8px; border-radius: var(--pill); background: var(--hover); overflow: hidden; }
.d-progress span { display: block; height: 100%; background: var(--text); }
.d-line { width: 24px; height: 2px; background: var(--text-2); }
.d-step { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 12px; }
.d-step.on { background: var(--invert); color: var(--on-invert); border-color: var(--invert); }
.d-row > .d-line { margin: 0 -8px; }
.d-loose, .d-tight { display: flex; flex-direction: column; width: min(100%, 240px); margin: 0 auto; }
.d-loose { gap: 23px; }
.d-tight { gap: 1px; margin-top: -4px; }
.d-spaced { display: flex; flex-direction: column; gap: 24px; width: min(100%, 288px); margin: 0 auto; }
.d-spaced .d-col { gap: 4px; }
.d-gap { height: 4px; }
.d-off { display: flex; flex-direction: column; gap: 8px; }
.d-off.a > :nth-child(1) { margin-left: 18%; }
.d-off.a > :nth-child(2) { margin-left: 3%; }
.d-off.a > :nth-child(3) { margin-left: 41%; }
.d-off.b > :nth-child(odd) { align-self: flex-end; }
.d-off.c { align-items: center; }
.d-phone { width: 168px; margin: 0 auto; padding: 12px; border: 2px solid var(--line-strong); border-radius: var(--r-xl); overflow: hidden; }
.d-phone .d-col { width: 100%; }
.d-clip { overflow: hidden; }
.d-clip .d-row { flex-wrap: nowrap; justify-content: flex-start; }
.d-clip .d-box { flex: none; min-width: 72px; }
.d-table { display: grid; grid-template-columns: 1fr auto; width: min(100%, 264px); margin: 0 auto; }
.d-table .d-t { padding: 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.d-table.grid .d-t { border: 2px solid var(--text-2); text-align: center; }
.d-spin { display: flex; }
.d-spin.forever .ic { animation: spin 1.4s linear infinite; }
.d-bounce { display: flex; animation: nudge 1.6s ease-in-out infinite; }
.d-bounce.late { animation-delay: .4s; }
@keyframes nudge { 50% { transform: translateY(-8px); } }
.d-jump { display: grid; place-items: center; height: 72px; border: 1px dashed var(--danger); border-radius: var(--r-s); }
.d-skeleton { height: 72px; border-radius: var(--r-s); background: var(--hover); }
.d-theme { display: flex; flex-direction: column; gap: 8px; width: 112px; padding: 16px; border-radius: var(--r-m); border: 1px solid var(--line); }
.d-theme .d-bar { background: currentColor; opacity: .3; }
.d-theme.invert { background: #00ffff; color: #ff0000; }
.d-theme.black { background: #000; color: #fff; }
.d-theme.black .d-bar { opacity: 1; }
.d-theme.light { background: #fafafa; color: #171717; }
.d-theme.dark { background: #121212; color: #e5e5e5; }
.d-far { display: flex; flex-direction: column; justify-content: space-between; align-self: stretch; min-height: 140px; }
.d-stage { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: min(100%, 288px); margin: 0 auto; }
.d-stage.dim > .d-bar { opacity: .25; }
.d-stage .d-box { align-self: center; }
.d-scatter { position: relative; height: 120px; }
.d-scatter .d-dot { position: absolute; }
.d-scatter .s0 { left: 8%; top: 12px; } .d-scatter .s1 { left: 62%; top: 4px; } .d-scatter .s2 { left: 30%; top: 70px; } .d-scatter .s3 { left: 80%; top: 62px; } .d-scatter .s4 { left: 46%; top: 30px; }
.d-messy { display: flex; flex-direction: column; align-items: flex-start; }
.d-messy > :nth-child(2) { align-self: flex-end; }
.d-banner { padding: 12px; background: #facc15; color: #000; text-align: center; }
.d-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; width: min(100%, 264px); margin: 0 auto; text-align: center; font-size: 12px; }
.d-cal .d-t { padding: 4px 0; border-radius: 4px; }
.d-cal .d-t.on { background: var(--invert); color: var(--on-invert); }

/* ---------- criador de logos ---------- */
.logo-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.logo-preview { position: sticky; top: calc(var(--top) + 16px); }
.logo-stage { position: relative; display: grid; place-items: center; height: 360px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-l); }
.logo-stage.transparent { background: repeating-conic-gradient(rgba(128, 128, 128, .22) 0 25%, transparent 0 50%) 0 0 / 24px 24px; }
.logo-stage img { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); object-fit: contain; }
.logo-ghost { pointer-events: none; }
.logo-stage .logo-ghost { z-index: 0; }
.logo-stage .logo-main { z-index: 1; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.ref-grid li { display: flex; flex-direction: column; min-width: 0; }
.ref-grid .wide { grid-column: 1 / -1; }
.ref-thumb { display: grid; place-items: center; width: 100%; height: 112px; padding: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--raised); }
.ref-thumb:hover { border-color: var(--line-strong); }
.ref-thumb[aria-pressed='true'] { border: 2px solid var(--text); }
.ref-thumb img { max-width: 100%; max-height: 94px; object-fit: contain; }
.ref-meta { display: flex; align-items: center; gap: 4px; min-height: 40px; font-size: 12px; color: var(--text-2); }
.ref-meta > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-large { display: block; width: 100%; max-height: 240px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r-m); background: repeating-conic-gradient(rgba(128, 128, 128, .18) 0 25%, transparent 0 50%) 0 0 / 24px 24px; }
.ref-name { overflow-wrap: anywhere; }
.link-form { display: flex; gap: 8px; }
.link-form .btn { height: 44px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; max-height: 288px; overflow-y: auto; padding: 2px; }
.icon-grid.shapes { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); max-height: none; }
.icon-option { display: grid; place-items: center; height: 48px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--raised); }
.shapes .icon-option { height: 72px; }
.icon-option:hover { border-color: var(--line-strong); background: var(--hover); }
.icon-option[aria-selected='true'] { background: var(--invert); border-color: var(--invert); color: var(--on-invert); }
.variations { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.variations:empty { display: none; }
.variations > p { grid-column: 1 / -1; }
.variation { display: grid; place-items: center; height: 144px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-box); overflow: hidden; }
.variation img { width: 100%; height: 118px; object-fit: contain; }
.loading-inline { display: flex; align-items: center; gap: 8px; }
.loading-inline .ic { animation: spin .9s linear infinite; }
.mockups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mockup { display: flex; flex-direction: column; gap: 8px; margin: 0; min-width: 0; }
.mockup figcaption { font-size: 12px; color: var(--text-2); }
.mockup-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 176px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-m); }
.mockup-stage img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.mockup-stage.app img { width: 104px; height: 104px; border-radius: 24px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.mockup-stage.card img { height: 104px; }
.mockup-stage.card span { font-size: 12px; }

@media (max-width: 899px) {
  .rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logo-layout, .demos { grid-template-columns: minmax(0, 1fr); }
  .logo-preview { position: static; }
  .variations, .mockups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .rule-grid, .variations, .mockups { grid-template-columns: minmax(0, 1fr); }
  .rule-card { min-height: 0; }
  .panel .rule-title { font-size: 20px; }
  .keys { display: none; }
  .logo-stage { height: 264px; }
  .link-form { flex-direction: column; }
  .link-form .field { flex: none; }
  .logo-layout .seg-full { overflow-x: auto; }
  .logo-layout .seg-full .seg-btn { flex: 1 0 auto; padding: 0 12px; }
}
@media (max-width: 479px) {
  .ref-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
  .nav-bottom { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.25fr); }
  .logo-layout .seg-full { flex-wrap: wrap; overflow: visible; border-radius: var(--r-xl); }
}
