:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --border: #e2e5ef;
  --text: #1a1d2e;
  --muted: #6a7088;
  --accent: #6d5efc;
  --accent-hover: #5a4be8;
  --accent-soft: #eeecff;
  --on-accent: #ffffff;
  --ins-bg: #d9f5e3;
  --ins-fg: #0c5a2c;
  --del-bg: #fde0e0;
  --del-fg: #8a1c1c;
  --warn-bg: #fff4d6;
  --warn-fg: #7a5600;
  --ok: #16a34a;
  --err: #d92d2d;
  --shadow: 0 1px 2px rgba(20, 24, 50, .06), 0 8px 24px rgba(20, 24, 50, .06);
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --dot-role: #6d5efc;
  --dot-goal: #0ea5e9;
  --dot-context: #14b8a6;
  --dot-constraints: #f59e0b;
  --dot-output: #ec4899;
  --dot-examples: #84cc16;
}

:root[data-theme="dark"] {
  --bg: #0e1020;
  --surface: #161933;
  --surface-2: #1d2142;
  --border: #2a2f57;
  --text: #e8eaf8;
  --muted: #9aa0c3;
  --accent: #8b7fff;
  --accent-hover: #a094ff;
  --accent-soft: #28254f;
  --on-accent: #0e1020;
  --ins-bg: #123d26;
  --ins-fg: #8df0b4;
  --del-bg: #4a1c24;
  --del-fg: #ffadb3;
  --warn-bg: #3b3010;
  --warn-fg: #f6d57a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
}

h1, h2, h3, p { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

[hidden] { display: none !important; }

/* ------------------------------------------------------------ top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 40px);
}

.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 38px; height: 38px; color: var(--accent); flex: none; }
.brand h1 { font-size: 20px; letter-spacing: -.01em; }
.tagline { color: var(--muted); font-size: 13.5px; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

/* ------------------------------------------------------------- layout */

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px;
  padding: 4px clamp(16px, 4vw, 40px) 28px;
  align-items: start;
}

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.panel-head h2 { font-size: 16px; }
.head-actions { display: flex; align-items: center; gap: 12px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ------------------------------------------------------------ controls */

textarea, input[type="text"], input[type="password"], input[type="search"], select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea:focus, input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
textarea { resize: vertical; }

.input-area { min-height: 240px; line-height: 1.55; }
.final-area { min-height: 380px; font-family: var(--mono); font-size: 13.5px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--text); border-color: var(--border); }
.btn.small { padding: 6px 12px; font-size: 13px; }

kbd {
  font: 11px var(--mono);
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .22);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field.grow { flex: 1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field-row { display: flex; gap: 10px; }
.field-row .field:first-child { width: 150px; flex: none; }
.key-row { display: flex; gap: 8px; }

/* ------------------------------------------------------------- AI panel */

.ai {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.ai summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px;
  font-weight: 600;
}
.ai summary::-webkit-details-marker { display: none; }
.ai summary::before {
  content: "";
  width: 7px; height: 7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform .15s;
  margin-right: 4px;
}
.ai[open] summary::before { transform: rotate(45deg); }
.ai summary > span:first-child { margin-right: auto; display: flex; align-items: center; gap: 8px; }
.ai-body { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 12px; }

.pill {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}

.note {
  font-size: 12.5px; color: var(--muted);
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

.status { min-height: 1.4em; font-size: 13.5px; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }
.status.busy::before {
  content: ""; display: inline-block;
  width: 12px; height: 12px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab {
  font: inherit; font-weight: 600; font-size: 14px;
  padding: 8px 14px;
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); cursor: pointer; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

.empty {
  display: grid; place-items: center; gap: 6px; text-align: center;
  padding: 56px 16px; color: var(--muted);
}
.empty svg { width: 52px; height: 52px; opacity: .6; }

.view { display: flex; flex-direction: column; gap: 12px; }

/* ------------------------------------------------------- section cards */

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px 0;
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.card-head h3 { font-size: 13px; letter-spacing: .02em; text-transform: uppercase; }
.badge {
  margin-left: auto;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.badge.default, .badge.inferred { background: var(--warn-bg); color: var(--warn-fg); }
.badge.empty { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.card textarea {
  border: 0; border-radius: 0; background: transparent;
  box-shadow: none; padding: 6px 12px 12px;
  min-height: 44px; resize: none; overflow: hidden;
}
.card textarea:focus { box-shadow: none; }
.card:focus-within { border-color: var(--accent); }

/* ----------------------------------------------------------------- diff */

.diff-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg-btn {
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 12px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--muted);
}
.seg-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.legend { font-size: 12.5px; display: inline-flex; gap: 8px; }

.diff-out {
  margin: 0;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  font: 13.5px/1.7 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-height: 80px;
}
ins, del { text-decoration: none; border-radius: 4px; padding: 1px 2px; }
ins { background: var(--ins-bg); color: var(--ins-fg); }
del { background: var(--del-bg); color: var(--del-fg); text-decoration: line-through; text-decoration-thickness: 1px; }

.diff-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.diff-split h3 { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 640px) { .diff-split { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------- footer */

.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 8px 16px 22px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: 0.01ms !important; }
}

/* ======================================================= v2 additions */

.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn.small { width: 32px; height: 32px; border-radius: 9px; box-shadow: none; font-size: 14px; }
.dot-on { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; }

.field.inline { flex: 1; min-width: 160px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tool-group { display: flex; gap: 6px; }
.tool-group.right { margin-left: auto; }

.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }

.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; }

.score-pill, .count-pill {
  display: inline-block; min-width: 22px; text-align: center;
  font-size: 11px; font-weight: 700; line-height: 1;
  padding: 3px 6px; border-radius: 999px; margin-left: 4px;
  background: var(--accent-soft); color: var(--accent);
}
.score-pill.good { background: var(--ins-bg); color: var(--ins-fg); }
.score-pill.mid { background: var(--warn-bg); color: var(--warn-fg); }
.score-pill.low { background: var(--del-bg); color: var(--del-fg); }

/* variables */
.vars { border: 1px dashed var(--accent); border-radius: 12px; padding: 12px; background: var(--accent-soft); display: flex; flex-direction: column; gap: 10px; }
.vars-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.vars-head h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--accent); }
.vars-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.vars-fields .field label { font-family: var(--mono); }
.vars-fields textarea { min-height: 38px; resize: vertical; }

/* quality */
.score-card { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.score-ring {
  --pct: 0; --ring: var(--accent);
  width: 84px; height: 84px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: conic-gradient(var(--ring) calc(var(--pct) * 1%), var(--border) 0);
  position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface-2); }
.score-ring span { position: relative; font-size: 24px; font-weight: 800; }
.score-title { font-size: 20px; font-weight: 800; }
.score-title #score-grade { font-size: 28px; margin-right: 4px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checks li { display: grid; grid-template-columns: 24px 1fr auto; gap: 4px 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.checks .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.checks .pass .mark { background: var(--ins-bg); color: var(--ins-fg); }
.checks .fail .mark { background: var(--del-bg); color: var(--del-fg); }
.checks .name { font-weight: 600; }
.checks .tip { grid-column: 2 / 4; font-size: 13px; color: var(--muted); }
.checks .pts { font-size: 12px; color: var(--muted); }

/* library */
.save-form { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.lib-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.lib-tools .field.grow { min-width: 180px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.lib-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lib-item { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.lib-item.current { border-color: var(--accent); }
.star { background: none; border: 0; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px; }
.star[aria-pressed="true"] { color: #f5a623; }
.lib-title { font: inherit; font-weight: 600; background: none; border: 0; padding: 0; text-align: left; color: var(--text); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-title:hover { color: var(--accent); }
.lib-meta { grid-column: 2 / 3; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.lib-actions { display: flex; gap: 4px; grid-row: 1 / 3; grid-column: 3; }
.tag { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.history { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.history summary { cursor: pointer; font-weight: 600; }
.history ul { margin-top: 8px; }

/* dialogs */
dialog {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  padding: 0; width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
dialog::backdrop { background: rgba(8, 10, 24, .55); }
.dialog-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.dialog-card h3 { font-size: 14px; margin-top: 8px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-actions { margin-top: 8px; position: sticky; bottom: 0; }
.rule-roles { display: flex; flex-direction: column; gap: 8px; }
.rule-role { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; }
.kw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.keys { border-collapse: collapse; width: 100%; }
.keys td { padding: 8px 6px; border-bottom: 1px solid var(--border); }
.keys td:first-child { white-space: nowrap; }
.keys kbd, .dialog-card kbd { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }

/* ======================================================= color themes
 * Ten palettes (5 light, 5 dark). Each only overrides the core variables; shared
 * status colors (ins/del/warn/ok/err) come from the light/dark base blocks above.
 * tests/themes.test.js checks every palette meets WCAG AA text contrast. */

:root[data-palette="lavender"] { --bg:#f6f7fb; --surface:#ffffff; --surface-2:#f1f3f9; --border:#dfe3ef; --text:#1a1d2e; --muted:#586080; --accent:#5a4be8; --accent-hover:#4a3bd4; --accent-soft:#eeecff; --on-accent:#ffffff; }
:root[data-palette="sky"]      { --bg:#f2f8fd; --surface:#ffffff; --surface-2:#eaf3fb; --border:#d3e3f1; --text:#10263a; --muted:#4f6579; --accent:#0a68c4; --accent-hover:#0856a3; --accent-soft:#e1f0ff; --on-accent:#ffffff; }
:root[data-palette="mint"]     { --bg:#f1f9f5; --surface:#ffffff; --surface-2:#e8f4ee; --border:#cfe5d9; --text:#11281e; --muted:#4a6556; --accent:#0b7a53; --accent-hover:#096443; --accent-soft:#dcf5e9; --on-accent:#ffffff; }
:root[data-palette="sand"]     { --bg:#faf6ef; --surface:#fffdf9; --surface-2:#f4eee2; --border:#e6dcc8; --text:#2b2417; --muted:#665a45; --accent:#a64a12; --accent-hover:#8a3d0b; --accent-soft:#fcebdc; --on-accent:#ffffff; }
:root[data-palette="rose"]     { --bg:#fdf3f6; --surface:#ffffff; --surface-2:#faebf0; --border:#efd5de; --text:#2d1520; --muted:#744f5f; --accent:#c2255c; --accent-hover:#a61c4c; --accent-soft:#fde0ea; --on-accent:#ffffff; }

:root[data-palette="midnight"] { --bg:#0e1020; --surface:#161933; --surface-2:#1d2142; --border:#2a2f57; --text:#e8eaf8; --muted:#9aa0c3; --accent:#9a8fff; --accent-hover:#b0a7ff; --accent-soft:#2c2860; --on-accent:#0e1020; }
:root[data-palette="ocean"]    { --bg:#08141f; --surface:#0e2233; --surface-2:#13304a; --border:#1f4160; --text:#e6f2fb; --muted:#93b0c6; --accent:#4cb8ff; --accent-hover:#7ccbff; --accent-soft:#12385a; --on-accent:#06121c; }
:root[data-palette="forest"]   { --bg:#0b1510; --surface:#12211a; --surface-2:#182c22; --border:#25402f; --text:#e5f3ea; --muted:#92b3a0; --accent:#4fd18b; --accent-hover:#7be0a9; --accent-soft:#17402b; --on-accent:#07120c; }
:root[data-palette="ember"]    { --bg:#1a110d; --surface:#261a14; --surface-2:#30221a; --border:#4a3426; --text:#f7ebe3; --muted:#c4a592; --accent:#ff9a52; --accent-hover:#ffb27a; --accent-soft:#4a2a14; --on-accent:#1a0e07; }
:root[data-palette="graphite"] { --bg:#121212; --surface:#1c1c1e; --surface-2:#262628; --border:#38383c; --text:#ececec; --muted:#a3a3ab; --accent:#8fb8ff; --accent-hover:#b3d0ff; --accent-soft:#26334d; --on-accent:#0b1220; }

/* ======================================================= a11y + responsive fixes */

/* Shortcut hint inside the primary button: outline only, so it inherits the button's contrast. */
.btn kbd { background: transparent; border: 1px solid currentColor; opacity: .95; }
.pill { color: var(--accent); }
.muted { color: var(--muted); }

.palette-select { width: auto; min-width: 118px; padding: 7px 10px; font-size: 13.5px; font-weight: 600; }

.check { padding: 6px 0; min-height: 32px; }
.check input { width: 18px; height: 18px; }
.toolbar select { width: 100%; }
.field.inline { flex: 1 1 190px; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding-bottom: 8px; }
  .brand h1 { white-space: nowrap; font-size: 18px; }
  .tagline { display: none; }
  .top-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .top-actions .palette-select { flex: 1; }
  .panel { padding: 14px; }
  .ai summary > .small { display: none; }
  .tabs { flex-wrap: wrap; overflow: visible; }
  .tab { padding: 8px 10px; font-size: 13.5px; }
  .tool-group.right { margin-left: 0; width: 100%; }
  .tool-group.right .btn { flex: 1; justify-content: center; }
  .field-row { flex-wrap: wrap; }
  .field-row .field:first-child { width: 100%; }
  .rule-role { grid-template-columns: 1fr; }
  .lib-item { grid-template-columns: auto 1fr; }
  .lib-actions { grid-column: 1 / 3; grid-row: auto; }
  .btn { padding: 10px 14px; }
  .btn.small { padding: 8px 12px; }
}

/* Reserve space so late-populated controls don't shift the layout. */
.status { min-height: 1.4em; }
#template, #format { min-height: 40px; }

/* ======================================================= edition (Lite) */
.edition-banner { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: center; text-align: center; padding: 9px 16px; background: var(--accent-soft); color: var(--text); font-size: 13.5px; border-bottom: 1px solid var(--border); }
.edition-link { color: var(--accent); font-weight: 700; text-decoration: underline; }
.lite-tag { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); vertical-align: middle; }
.locked-panel { display: none; text-align: center; padding: 28px 16px; border: 1px dashed var(--accent); border-radius: 12px; background: var(--accent-soft); }
.locked-panel h3 { font-size: 16px; margin-bottom: 6px; }
.locked-panel p { color: var(--muted); margin-bottom: 14px; }
#view-library.locked > :not(#lib-locked) { display: none !important; }
#view-library.locked #lib-locked { display: block; }
.upsell-row { grid-template-columns: 1fr !important; text-align: center; background: var(--accent-soft) !important; }
.upsell-row a { color: var(--accent); font-weight: 700; }
