
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #eef0f4; --text: #15181e; --muted: #5d6573; --border: #dde1e8;
  --accent: #3b5bdb; --accent-text: #ffffff; --ok: #2b8a3e; --warn: #b26a00; --err: #c92a2a; --code-bg: #f1f3f7;
  --k: #364fc7; --s: #2b8a3e; --n: #c2255c; --b: #9c36b5;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --surface: #171a21; --surface-2: #20242d; --text: #e8eaef; --muted: #9aa3b2; --border: #2a2f3a;
    --accent: #7491ff; --accent-text: #0f1115; --ok: #69db7c; --warn: #ffc078; --err: #ff8787; --code-bg: #12151b;
    --k: #91a7ff; --s: #8ce99a; --n: #faa2c1; --b: #e599f7;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --surface: #171a21; --surface-2: #20242d; --text: #e8eaef; --muted: #9aa3b2; --border: #2a2f3a;
  --accent: #7491ff; --accent-text: #0f1115; --ok: #69db7c; --warn: #ffc078; --err: #ff8787; --code-bg: #12151b;
  --k: #91a7ff; --s: #8ce99a; --n: #faa2c1; --b: #e599f7;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.top { position: sticky; top: 0; z-index: 2; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.top .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
.title p { margin: 2px 0 0; font-size: 13px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.filter { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 5px 10px; font: inherit; font-size: 13px; max-width: 100%; }
#search { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 14px; width: 200px; max-width: 100%; }
main { padding-top: 20px; padding-bottom: 40px; }
.simple-link { font-size: 13px; color: var(--muted); text-decoration: none; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; }
.simple-link:hover { color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.frame { aspect-ratio: 4 / 5; background: #2a2a2e; position: relative; display: flex; align-items: center; justify-content: center; }
.frame video { width: 100%; height: 100%; object-fit: contain; display: block; }
.placeholder { color: #c9ced8; text-align: center; padding: 16px; font-size: 14px; }
.placeholder .bar { width: 160px; height: 6px; background: #333a46; border-radius: 3px; margin: 10px auto 0; overflow: hidden; }
.placeholder .bar span { display: block; height: 100%; background: #7491ff; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h3 { font-size: 16px; margin: 0; }
.card .desc { font-size: 13px; color: var(--muted); margin: 0; flex: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.err { color: var(--err); }
.btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn:hover { filter: brightness(1.05); }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
dialog { width: min(1100px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
.detail-head { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.detail-head h2 { margin: 0; font-size: 18px; }
.detail-head p { margin: 2px 0 0; font-size: 13px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.detail-body { display: grid; grid-template-columns: 300px 1fr; gap: 18px; padding: 16px 18px 18px; }
.detail-media .frame { border-radius: 10px; overflow: hidden; }
.detail-media .notes { font-size: 13px; margin-top: 10px; }
.detail-media .notes ul { padding-left: 18px; margin: 4px 0; }
.detail-info { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.tab { border: 0; background: transparent; color: var(--muted); padding: 8px 12px; font: inherit; font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.hint code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.code-actions { display: flex; gap: 8px; align-items: center; }
.panel { min-height: 0; }
pre.json { margin: 0; background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; overflow: auto; max-height: 60vh;
  font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.j-k { color: var(--k); } .j-s { color: var(--s); } .j-n { color: var(--n); } .j-b { color: var(--b); }
.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.flow li { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; }
.flow li + li::before { content: "→"; color: var(--muted); margin: 0 8px 0 -2px; }
.flow li strong { font-weight: 600; }
table.usage { width: 100%; border-collapse: collapse; font-size: 13px; }
table.usage th, table.usage td { text-align: left; vertical-align: top; padding: 7px 8px; border-bottom: 1px solid var(--border); }
table.usage th { color: var(--muted); font-weight: 600; font-size: 12px; }
table.usage td.val { white-space: pre-line; max-width: 280px; }
table.usage tr.unused td { color: var(--muted); opacity: .65; }
table.usage code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.warns { font-size: 13px; color: var(--warn); margin: 10px 0 0; padding-left: 18px; }
.panel h4 { margin: 14px 0 6px; font-size: 13px; }
.attachments { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.att { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); font-size: 12px; }
.att img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.att audio { width: 100%; display: block; margin-top: 8px; }
.att div { padding: 8px; }
.att a { color: var(--accent); }
button.simple-link { background: transparent; font: inherit; font-size: 13px; cursor: pointer; }
/* marca */
.brand-body { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 18px; padding: 16px 18px 18px; }
.brand-logos { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.brand-logo { border-radius: 10px; padding: 12px 16px; display: flex; align-items: center; justify-content: center; min-height: 56px; border: 1px solid var(--border); }
.brand-logo img { max-height: 34px; max-width: 170px; display: block; }
.brand-logo .cap { font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: #c9ced8; margin-left: 10px; }
.swatches { display: flex; flex-direction: column; gap: 8px; }
.swatch { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; font-size: 13px; }
.swatch .dot { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); }
.swatch code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.swatch .use { color: var(--muted); font-size: 12px; }
.gradient { height: 12px; border-radius: 999px; border: 1px solid var(--border); margin: 4px 0 2px; }
.brand-fonts { font-size: 13px; margin: 0; padding-left: 18px; }
#brand-view h4, .panel .brand-mini h4 { margin: 14px 0 6px; font-size: 13px; }
#brand-view h4:first-child { margin-top: 0; }
.brand-mini { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.brand-mini .dot { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); }
.brand-mini .btn { margin-left: 6px; }
@media (max-width: 760px) {
  .detail-body, .brand-body { grid-template-columns: 1fr; }
  .detail-media .frame { max-width: 320px; margin: 0 auto; }
  #search { width: 100%; }
  .controls { width: 100%; }
}
