/* Painel JDB — direction A "Selva". One visual system; every screen uses only this file. */
:root {
  --bg:#F3F5EF; --surface:#FFFFFF; --surface-2:#F8FAF5; --ink:#17231B; --muted:#5E6B61; --line:#DDE3D8;
  --nav:#14432A; --nav-ink:#E6F0DF; --nav-muted:#9DB7A2; --nav-active:#1E5A38;
  --accent:#F4AE1A; --accent-ink:#2A1A00; --accent-edge:#C9870A;
  --pos:#1F7A3A; --neg:#B3261E; --warn:#8A5A00; --info:#2B5C8A;
  --pos-bg:#E4F2E5; --neg-bg:#FBE7E5; --warn-bg:#FFF1CF; --info-bg:#E3EEF8;
  --mark:#F4AE1A; --house:#1F7A3A; --out:#7E8A80;
  --shadow:0 12px 40px rgba(20,40,25,.18);
  --r:14px; --r-sm:10px;
  color-scheme:light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#0F1612; --surface:#161F19; --surface-2:#1B261F; --ink:#E8EFE6; --muted:#93A396; --line:#27352C;
    --nav:#0B1C12; --nav-ink:#E6F0DF; --nav-muted:#7E9A84; --nav-active:#173826;
    --pos:#6CCB7A; --neg:#FF7A6E; --warn:#F2C155; --info:#7DB3E8;
    --pos-bg:#16301E; --neg-bg:#3A1C19; --warn-bg:#33290F; --info-bg:#15283A;
    --house:#6CCB7A; --out:#6F7D73; --shadow:0 12px 40px rgba(0,0,0,.5);
    color-scheme:dark;
  }
}
:root[data-theme="dark"] {
  --bg:#0F1612; --surface:#161F19; --surface-2:#1B261F; --ink:#E8EFE6; --muted:#93A396; --line:#27352C;
  --nav:#0B1C12; --nav-ink:#E6F0DF; --nav-muted:#7E9A84; --nav-active:#173826;
  --pos:#6CCB7A; --neg:#FF7A6E; --warn:#F2C155; --info:#7DB3E8;
  --pos-bg:#16301E; --neg-bg:#3A1C19; --warn-bg:#33290F; --info-bg:#15283A;
  --house:#6CCB7A; --out:#6F7D73; --shadow:0 12px 40px rgba(0,0,0,.5);
  color-scheme:dark;
}

* { box-sizing:border-box; }
[hidden] { display:none !important; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; background:var(--bg); color:var(--ink); font:15px/1.5 Manrope, system-ui, sans-serif; font-variant-numeric:tabular-nums; }
a { color:inherit; }
button, input, select, textarea { font:inherit; color:inherit; }
:focus-visible { outline:3px solid var(--accent); outline-offset:2px; }
@media (prefers-reduced-motion: reduce) { * { transition:none !important; animation:none !important; } }

/* Shell */
.shell { display:grid; grid-template-columns:240px minmax(0,1fr); min-height:100vh; }
.nav { background:var(--nav); color:var(--nav-ink); padding:20px 14px; display:flex; flex-direction:column; gap:20px; position:sticky; top:0; height:100vh; overflow-y:auto; }
.brand { font-family:"Lilita One", sans-serif; font-size:26px; line-height:1; letter-spacing:.5px; color:var(--mark); padding:4px 10px; text-decoration:none; display:block; }
.brand small { display:block; font:700 11px/1.4 Manrope, sans-serif; letter-spacing:.14em; text-transform:uppercase; color:var(--nav-muted); margin-top:6px; }
.nav h6 { margin:0 10px 4px; font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--nav-muted); font-weight:700; }
.nav a.item { display:flex; justify-content:space-between; align-items:center; padding:7px 10px; border-radius:8px; color:var(--nav-ink); text-decoration:none; font-weight:600; font-size:14px; }
.nav a.item:hover { background:var(--nav-active); }
.nav a.item[aria-current] { background:var(--nav-active); box-shadow:inset 3px 0 0 var(--mark); }
.nav .count { background:var(--mark); color:var(--accent-ink); font-size:11px; font-weight:800; border-radius:999px; padding:1px 7px; }
.topbar { display:none; }
main { padding:26px 36px 56px; min-width:0; }
.wrap { max-width:1280px; }

/* Breadcrumbs and page header */
.crumbs { font-size:13px; color:var(--muted); display:flex; gap:8px; flex-wrap:wrap; }
.crumbs a { color:var(--muted); }
.crumbs .sep { opacity:.6; }
.head { display:flex; justify-content:space-between; align-items:flex-end; gap:16px 20px; margin:8px 0 22px; flex-wrap:wrap; }
.head h1 { margin:0; font-size:28px; line-height:1.15; font-weight:800; letter-spacing:-.01em; }
.head .meta { color:var(--muted); font-size:14px; margin-top:4px; }
h2.section { font-size:16px; font-weight:800; margin:28px 0 12px; }
.lede { color:var(--muted); margin:-12px 0 20px; font-size:14px; max-width:70ch; }

/* Buttons: always a button, always aligned in an .actions row */
.actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.actions.end { justify-content:flex-end; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; border:1px solid var(--line); background:var(--surface); color:var(--ink); padding:8px 16px; border-radius:var(--r-sm); font-weight:700; font-size:14px; min-height:40px; cursor:pointer; text-decoration:none; white-space:nowrap; }
.btn:hover { border-color:var(--muted); }
.btn.primary { background:var(--accent); color:var(--accent-ink); border-color:var(--accent-edge); box-shadow:0 3px 0 var(--accent-edge); }
.btn.primary:active { transform:translateY(2px); box-shadow:0 1px 0 var(--accent-edge); }
.btn.danger { color:var(--neg); }
.btn.danger.solid { background:var(--neg); color:#fff; border-color:var(--neg); }
.btn.sm { min-height:32px; padding:4px 12px; font-size:13px; }
.btn[disabled] { opacity:.5; cursor:not-allowed; }

/* Tags and statuses */
.tags { display:flex; gap:6px; margin-top:10px; flex-wrap:wrap; }
.tag { display:inline-block; font-size:12px; font-weight:700; padding:2px 9px; border-radius:999px; background:var(--pos-bg); color:var(--pos); white-space:nowrap; }
.tag.warn { background:var(--warn-bg); color:var(--warn); }
.tag.neg { background:var(--neg-bg); color:var(--neg); }
.tag.info { background:var(--info-bg); color:var(--info); }
.tag.muted { background:var(--surface-2); color:var(--muted); border:1px solid var(--line); }

/* Cards, tiles, deflist */
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:18px 20px; }
.grid { display:grid; gap:12px; }
.g2 { grid-template-columns:repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns:repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns:repeat(4, minmax(0,1fr)); }
.tiles { grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); }
.tile { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:14px 16px; }
.tile .label { font-size:13px; color:var(--muted); font-weight:600; }
.tile .value { font-size:24px; font-weight:800; margin-top:2px; letter-spacing:-.01em; white-space:nowrap; }
.tile .hint { font-size:12px; color:var(--muted); }
.tile.main { border-color:var(--mark); box-shadow:inset 0 3px 0 var(--mark); }
dl.def { display:grid; grid-template-columns:180px 1fr; gap:8px 16px; margin:0; font-size:14px; }
dl.def dt { color:var(--muted); font-weight:600; }
dl.def dd { margin:0; }

/* Money story — the signature */
.story-top { display:flex; justify-content:space-between; align-items:baseline; gap:12px; flex-wrap:wrap; }
.story-top h2 { margin:0; font-size:15px; font-weight:800; }
.verdict { font-weight:800; font-size:15px; }
.verdict b { color:var(--house); }
.bar { display:flex; height:14px; border-radius:999px; overflow:hidden; margin:14px 0 12px; background:var(--line); }
.bar i { display:block; }
.legend { display:grid; grid-template-columns:repeat(5, minmax(0,1fr)); gap:10px; }
.legend div { font-size:13px; color:var(--muted); }
/* Bet validation per day: accepted up, refused down, each on its own scale. */
.vcard { display:grid; grid-template-columns:minmax(0,1fr) minmax(260px,340px); gap:8px 32px; align-items:start; }
.vcard > dl.def { grid-template-columns:minmax(0,1fr) auto; }
.vcard > dl.def dd { text-align:right; }
.vchart { display:grid; grid-template-columns:auto minmax(0,1fr); gap:0 10px; margin:4px 0 6px; }
.vchart-scale { display:grid; grid-template-rows:120px 48px 22px; font-size:12px; font-weight:700; text-align:right; }
.vchart-scale .pos { color:var(--pos); align-self:start; }
.vchart-scale .neg { color:var(--neg); align-self:end; }
.vchart-bars { display:flex; gap:2px; align-items:stretch; }
.vbar { flex:1 1 0; min-width:0; max-width:64px; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:120px 48px 22px; padding:0; border:0; border-radius:6px; background:none; cursor:pointer; }
.vbar:hover, .vbar[aria-pressed="true"] { background:var(--surface-2); }
.vbar .up { display:flex; align-items:flex-end; border-bottom:1px solid var(--line); padding:0 18%; }
.vbar .down { display:flex; align-items:flex-start; padding:0 18%; }
.vbar i { display:block; width:100%; }
.vbar .up i { background:var(--pos); border-radius:3px 3px 0 0; }
.vbar .down i { background:var(--neg); border-radius:0 0 3px 3px; }
.vbar .tick { font-size:11px; color:var(--muted); white-space:nowrap; align-self:end; justify-self:center; }
.vbar[aria-pressed="true"] .tick { color:var(--ink); font-weight:700; }
.vbar[aria-pressed="true"] { box-shadow:inset 0 -3px 0 var(--accent); }
.vchart-day { margin:0 0 14px; font-weight:700; font-size:14px; }
.legend strong { display:block; color:var(--ink); font-size:16px; }
.dot { display:inline-block; width:9px; height:9px; border-radius:3px; margin-right:6px; vertical-align:1px; }

/* Tabs (query-string driven in the real app) */
.tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:14px; overflow-x:auto; }
.tabs a { padding:10px 14px; font-weight:700; color:var(--muted); border-bottom:3px solid transparent; white-space:nowrap; text-decoration:none; font-size:14px; }
.tabs a[aria-selected="true"] { color:var(--ink); border-color:var(--mark); }
.tabs .count { font-size:12px; color:var(--muted); margin-left:4px; }

/* Filter bar */
.filters { display:flex; gap:8px; flex-wrap:wrap; align-items:flex-end; margin-bottom:14px; }
.field { display:flex; flex-direction:column; gap:4px; min-width:0; }
.field label, .field .label { font-size:13px; font-weight:700; color:var(--ink); }
.field .help { font-size:12px; color:var(--muted); }
.input, select.input, textarea.input { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm); padding:8px 12px; min-height:40px; width:100%; }
textarea.input { min-height:88px; resize:vertical; }
.input:focus { border-color:var(--accent-edge); outline:none; box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.input.money { font-weight:800; font-size:18px; }
.search { flex:1 1 320px; }
.form { display:grid; gap:14px; }
.form.cols { grid-template-columns:repeat(2, minmax(0,1fr)); }
.check { display:flex; gap:10px; align-items:flex-start; font-size:14px; }
.check input { width:18px; height:18px; margin-top:2px; accent-color:var(--pos); }
.choice { display:flex; gap:8px; flex-wrap:wrap; }
.choice label { border:1px solid var(--line); border-radius:var(--r-sm); padding:8px 12px; font-weight:700; font-size:14px; cursor:pointer; display:flex; gap:8px; align-items:center; background:var(--surface); }
.choice input { accent-color:var(--pos); }

/* Tables — fixed layout; become cards on phones */
.table-wrap { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; }
table { width:100%; border-collapse:collapse; }
th { text-align:left; font-size:12px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); padding:10px 14px; border-bottom:1px solid var(--line); font-weight:700; white-space:nowrap; }
td { padding:11px 14px; border-bottom:1px solid var(--line); font-size:14px; vertical-align:middle; }
tbody tr:last-child td { border-bottom:0; }
tbody tr:hover, tbody tr[aria-selected="true"] { background:var(--surface-2); }
.num { text-align:right; white-space:nowrap; }
td.act { text-align:right; white-space:nowrap; }
td.act .actions { justify-content:flex-end; flex-wrap:nowrap; }
.in { color:var(--pos); font-weight:700; }
.out { color:var(--neg); font-weight:700; }
.sub { font-size:12px; color:var(--muted); }
.strong { font-weight:700; }
/* Between phone and wide desktop, the fixed columns would squeeze the first one
   until its text runs under the next: the secondary ones step out. */
[data-show-narrow] { display:none; }
th.act-one { width:90px; }
th.act-two { width:200px; }
@media (max-width: 1439px) {
  [data-hide-narrow] { display:none; }
  [data-show-narrow] { display:block; margin-top:4px; }
  th.act-two { width:90px; }
}
/* One line that never spills into the next column: cut with an ellipsis, whole on hover. */
.clip { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bicho { font-weight:700; }
.bicho small { color:var(--muted); font-weight:600; }
.mono { font-family:"JetBrains Mono", ui-monospace, monospace; font-size:13px; }

/* Pager */
.pager { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:12px; font-size:13px; color:var(--muted); flex-wrap:wrap; }

/* Banner and empty state */
.banner { border-radius:var(--r); padding:12px 16px; font-size:14px; display:flex; gap:12px; justify-content:space-between; align-items:center; flex-wrap:wrap; margin-bottom:16px; }
.banner.warn { background:var(--warn-bg); color:var(--warn); }
.banner.neg { background:var(--neg-bg); color:var(--neg); }
.banner.info { background:var(--info-bg); color:var(--info); }
.banner strong { color:inherit; }
dialog .banner { margin:0; }
pre.raw { font-family:"JetBrains Mono", ui-monospace, monospace; font-size:12px; white-space:pre-wrap; word-break:break-word; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:12px; margin:8px 0 0; }
.empty { text-align:center; padding:40px 20px; color:var(--muted); }

/* Attention list (home) */
.todo { display:grid; gap:10px; }
.todo .row { display:flex; gap:16px; align-items:center; justify-content:space-between; background:var(--surface); border:1px solid var(--line); border-left:4px solid var(--mark); border-radius:var(--r); padding:14px 16px; flex-wrap:wrap; }
.todo .row.neg { border-left-color:var(--neg); }
.todo .row.ok { border-left-color:var(--pos); }
.todo .what { font-weight:800; }
.todo .why { font-size:13px; color:var(--muted); }

/* Timeline */
.timeline { list-style:none; margin:0; padding:0; }
.timeline li { position:relative; padding:0 0 16px 22px; font-size:14px; }
.timeline li::before { content:""; position:absolute; left:4px; top:7px; width:9px; height:9px; border-radius:50%; background:var(--mark); }
.timeline li::after { content:""; position:absolute; left:8px; top:18px; bottom:0; width:1px; background:var(--line); }
.timeline li:last-child::after { display:none; }
.timeline .when { font-size:12px; color:var(--muted); }

/* Results board — draws, the game's own artifact */
.board { display:grid; grid-template-columns:repeat(5, minmax(0,1fr)); gap:8px; }
.board .pos { background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:8px 10px; text-align:center; }
.board .pos .n { font-size:11px; color:var(--muted); font-weight:700; }
.board .pos .milhar { font-size:20px; font-weight:800; letter-spacing:.04em; }
.board .pos .g { font-size:12px; font-weight:700; color:var(--muted); }

/* Dialog — forms and confirmations over the current screen */
dialog { border:0; padding:0; border-radius:18px; box-shadow:var(--shadow); background:var(--surface); color:var(--ink); width:min(560px, calc(100vw - 32px)); max-height:calc(100vh - 32px); }
dialog::backdrop { background:rgba(10,25,15,.55); }
dialog .dh { padding:18px 22px 0; }
dialog .dh h3 { margin:0; font-size:19px; font-weight:800; }
dialog .dh p { margin:4px 0 0; color:var(--muted); font-size:14px; }
dialog .db { padding:18px 22px; display:grid; gap:14px; }
dialog .df { padding:14px 22px 18px; border-top:1px solid var(--line); display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; }
.preview { background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:12px 14px; display:grid; grid-template-columns:1fr auto; gap:4px 12px; font-size:14px; }
.preview .after { font-weight:800; }

/* Toggle row (settings) */
.toggles { display:grid; gap:0; }
.toggles .t { display:flex; justify-content:space-between; gap:16px; align-items:center; padding:14px 0; border-bottom:1px solid var(--line); }
.toggles .t:last-child { border-bottom:0; }
.switch { position:relative; display:inline-block; width:44px; height:26px; flex:none; vertical-align:middle; }
.switch input { opacity:0; width:100%; height:100%; margin:0; cursor:pointer; position:absolute; z-index:1; }
.switch span { position:absolute; inset:0; background:var(--line); border-radius:999px; }
.switch span::after { content:""; position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background:var(--pos); }
.switch input:checked + span::after { left:21px; }
.switch input:focus-visible + span { outline:3px solid var(--accent); outline-offset:2px; }

/* Chat transcript (AI support) */
.chat { display:grid; gap:10px; }
.bubble { max-width:78%; padding:10px 14px; border-radius:14px; font-size:14px; background:var(--surface-2); border:1px solid var(--line); }
.bubble.me { justify-self:end; background:var(--pos-bg); border-color:transparent; }
.bubble .sub { display:block; margin-top:4px; }
.bubble .tag { display:table; margin-bottom:6px; }

/* Tables become cards before their fixed columns run out of room: below
   this width the columns would overlap (painel2-cx-feedback). */
@media (max-width: 1180px) {
  .table-wrap { background:none; border:0; overflow:visible; }
  table, tbody, tr, td { display:block; }
  thead { display:none; }
  tbody tr { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:10px 12px; margin-bottom:10px; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 12px; }
  tbody tr:hover { background:var(--surface); }
  td { border:0; padding:0; }
  td.num { grid-column:2; grid-row:1; }
  td.act { grid-column:1 / -1; text-align:left; margin-top:8px; }
  td.act .actions { justify-content:stretch; flex-wrap:wrap; }
  tbody td:not(:first-child):not(.num):not(.act) { grid-column:1 / -1; }
  td.act .actions .btn { flex:1; }
  td[data-hide-phone] { display:none; }
}

/* Phone */
@media (max-width: 860px) {
  .shell { grid-template-columns:1fr; }
  .nav { display:none; position:fixed; inset:0; z-index:20; height:auto; }
  .nav.open { display:flex; }
  .topbar { display:flex; align-items:center; justify-content:space-between; background:var(--nav); padding:10px 16px; position:sticky; top:0; z-index:10; }
  .topbar .brand { font-size:22px; padding:0; }
  main { padding:16px 16px 72px; }
  .head h1 { font-size:22px; }
  .head > .actions { width:100%; display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); align-items:stretch; }
  /* A long label wraps inside its button instead of pushing the page sideways. */
  .head > .actions .btn { width:100%; white-space:normal; text-align:center; }
  .g2 { grid-template-columns:1fr; }
  .g3, .g4 { grid-template-columns:1fr 1fr; }
  .tile .value { font-size:20px; }
  .legend { grid-template-columns:1fr 1fr; }
  .form.cols { grid-template-columns:1fr; }
  dl.def { grid-template-columns:1fr; gap:2px; }
  .vcard { grid-template-columns:minmax(0,1fr); }
  .vchart { grid-template-columns:minmax(0,1fr); }
  .vchart-scale { grid-template-rows:none; display:flex; gap:12px; margin-bottom:6px; }
  dl.def dd { margin-bottom:8px; }
  .board { grid-template-columns:repeat(5, minmax(0,1fr)); gap:4px; }
  .board .pos { padding:6px 2px; }
  .board .pos .milhar { font-size:15px; }
  .filters > * { flex:1 1 100%; }
  .filters .actions { width:100%; }
  dialog { width:100vw; max-width:100vw; margin:auto 0 0; border-radius:18px 18px 0 0; max-height:92vh; }
  .bubble { max-width:92%; }
}

/* ---------- Refinement pass: identity and finish ---------- */
:root { --grp-bg:#14432A; --grp-ink:#F4AE1A; --elev:0 1px 2px rgba(20,40,25,.05), 0 2px 8px rgba(20,40,25,.04); }
:root[data-theme="dark"] { --grp-bg:#1E5A38; --elev:0 1px 0 rgba(0,0,0,.4); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --grp-bg:#1E5A38; --elev:0 1px 0 rgba(0,0,0,.4); } }

/* Real logo in the menu */
.nav { background:radial-gradient(140% 50% at 0% 100%, rgba(244,174,26,.10), transparent 60%), var(--nav); }
.brand-logo { display:block; padding:0 6px; text-decoration:none; }
.brand-logo img { display:block; width:156px; height:auto; filter:drop-shadow(0 3px 0 rgba(0,0,0,.28)); }
.brand-logo small { display:block; font:700 11px/1.4 Manrope, sans-serif; letter-spacing:.14em; text-transform:uppercase; color:var(--nav-muted); margin:4px 0 0 4px; }
.topbar .brand-logo img { width:96px; }

/* Signature: the animal group as a plaque, wherever a group appears */
.grp { display:inline-flex; align-items:center; justify-content:center; min-width:24px; height:20px; padding:0 4px; margin-right:5px; border-radius:6px; background:var(--grp-bg); color:var(--grp-ink); font-weight:800; font-size:11.5px; letter-spacing:.02em; vertical-align:1px; box-shadow:inset 0 -2px 0 rgba(0,0,0,.28); }

/* Results board: the game's own plaque; the 1st prize leads */
.board .pos { position:relative; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:18px 8px 10px; }
.board .pos .n { position:absolute; top:-1px; left:50%; transform:translateX(-50%); background:var(--line); color:var(--muted); font-size:11px; font-weight:800; padding:1px 9px; border-radius:0 0 7px 7px; }
.board .pos .milhar { font-size:26px; font-weight:800; letter-spacing:.08em; line-height:1.1; }
.board .pos .g { margin-top:4px; color:var(--ink); }
.board .pos:first-child { border-color:var(--mark); background:color-mix(in srgb, var(--mark) 9%, var(--surface)); }
.board .pos:first-child .n { background:var(--mark); color:var(--accent-ink); }

/* Money: the currency steps back, the number leads */
.cur { font-size:.6em; font-weight:700; color:var(--muted); margin-right:3px; letter-spacing:0; vertical-align:.22em; }
.value.in .cur, .value.out .cur { color:inherit; opacity:.75; }

/* Status tags carry a dot */
.tag::before { content:""; display:inline-block; width:6px; height:6px; border-radius:50%; background:currentColor; margin-right:6px; vertical-align:1px; }

/* Surfaces, headers, type */
.card, .tile, .table-wrap, .todo .row { box-shadow:var(--elev); }
thead th { background:var(--surface-2); }
.head h1 { font-size:30px; letter-spacing:-.02em; }
.tile .label, dl.def dt { letter-spacing:.01em; }
.btn { transition:background-color .12s, border-color .12s, box-shadow .12s, transform .06s; }
.btn:not(.primary):not(.solid):hover { background:var(--surface-2); }
.tabs a { transition:color .12s, border-color .12s; }
.tabs a:hover { color:var(--ink); }

/* Dialogs arrive, they don't pop */
dialog[open] { animation:dlg-in .18s ease-out; }
dialog::backdrop { backdrop-filter:blur(2px); }
@keyframes dlg-in { from { opacity:0; transform:translateY(10px) scale(.985); } to { opacity:1; transform:none; } }

@media (max-width: 860px) {
  .head h1 { font-size:24px; }
  .board .pos { padding:16px 2px 8px; }
  .board .pos .milhar { font-size:16px; letter-spacing:.02em; }
  .board .pos .g .grp { display:none; }
  .board .pos .n { font-size:10px; padding:0 6px; }
}

/* Permission matrix: labels appear only where the column header is gone (phone) */
table.perms th:not(:first-child), table.perms td:not(:first-child) { text-align:center; width:90px; }
table.perms td.na { color:var(--muted); }
.perm { display:inline-flex; gap:6px; align-items:center; cursor:pointer; }
.perm span { display:none; font-size:13px; font-weight:700; }
.perm input { width:18px; height:18px; margin:0; accent-color:var(--pos); }
@media (max-width: 1180px) {
  .table-wrap table.perms tbody tr { display:flex; flex-wrap:wrap; gap:10px 18px; }
  table.perms td:first-child { flex-basis:100%; }
  table.perms td:not(:first-child) { width:auto; text-align:left; }
  table.perms td.na { display:none; }
  .perm span { display:inline; }
}

/* ---------- Panel additions: login, closing the phone menu, notices ---------- */
.auth { min-height:100vh; display:grid; place-items:center; padding:24px 16px; background:radial-gradient(140% 60% at 0% 100%, rgba(244,174,26,.14), transparent 60%), var(--nav); }
.auth .card { width:min(420px, 100%); padding:26px 24px; box-shadow:var(--shadow); }
.auth .brand-logo { display:flex; justify-content:center; margin-bottom:18px; }
.auth h1 { margin:0; font-size:24px; font-weight:800; letter-spacing:-.01em; }
.auth .meta { color:var(--muted); font-size:14px; margin:4px 0 18px; }
.auth .form .btn { width:100%; }
.auth .banner { margin:0 0 16px; }
.rules { margin:0; padding-left:18px; color:var(--muted); font-size:13px; line-height:1.6; }
/* A password field with its own Mostrar button, the button at the end of the row. */
.reveal { display:flex; gap:8px; }
.reveal .input { flex:1; min-width:0; }
.input.code { font:800 26px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing:.4em; text-align:center; }
.nav .close-menu { display:none; }
dialog.wide { width:min(760px, calc(100vw - 32px)); }
@media (max-width: 860px) {
  .nav .close-menu { display:flex; justify-content:flex-end; }
  dialog.wide { width:100vw; }
}

/* Communication: banner thumbnails. */
.thumb { display:block; width:120px; height:50px; object-fit:cover; border-radius:var(--r-sm); border:1px solid var(--line); background:var(--surface-2); }
.thumb.wide { width:100%; height:auto; aspect-ratio:1080 / 450; }
.thumb.wide.small { aspect-ratio:1080 / 300; }

/* Banner dialog: where the image comes from, and its preview. */
.guide { border:1px solid var(--line); background:var(--surface-2); border-radius:var(--r-sm); padding:12px 16px; display:flex; flex-direction:column; align-items:flex-start; gap:10px; font-size:14px; }
.steps { margin:0; padding-left:20px; display:flex; flex-direction:column; gap:4px; }
.img-preview { display:flex; flex-direction:column; gap:6px; }
.img-preview .help { font-size:13px; color:var(--muted); }
.img-preview .help.neg { color:var(--neg); }

/* Account menu: the operator's initials, then name, e-mail, theme and "Sair". */
.account { position:relative; }
/* Kept at the bottom of the sidebar even when a long menu scrolls under it. */
.nav .account { flex:none; position:sticky; bottom:-20px; margin:auto -14px -20px; padding:12px 14px 20px; background:var(--nav); border-top:1px solid color-mix(in srgb, var(--nav-ink) 10%, transparent); }
.account-btn { list-style:none; display:flex; align-items:center; gap:10px; min-width:0; cursor:pointer; border-radius:var(--r-sm); }
.account-btn::-webkit-details-marker { display:none; }
.nav .account-btn { padding:8px 10px; color:var(--nav-ink); border:1px solid color-mix(in srgb, var(--nav-ink) 14%, transparent); transition:background-color .12s, border-color .12s; }
.nav .account-btn:hover, .nav .account[open] .account-btn { background:var(--nav-active); border-color:color-mix(in srgb, var(--nav-ink) 24%, transparent); }
.avatar { flex:none; display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:50%; background:var(--mark); color:var(--accent-ink); font-weight:800; font-size:13px; letter-spacing:.02em; box-shadow:inset 0 -2px 0 rgba(0,0,0,.22); }
.avatar.lg { width:40px; height:40px; font-size:15px; }
.who-text { display:flex; flex-direction:column; min-width:0; line-height:1.3; }
.who-text strong, .who-text small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.who-text strong { font-size:14px; font-weight:700; }
.who-text small { font-size:12px; color:var(--nav-muted); }
.account-pop { position:fixed; z-index:30; width:300px; display:flex; flex-direction:column; gap:14px; padding:16px; background:var(--surface); color:var(--ink); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow); }
.account[open] .account-pop { animation:dlg-in .14s ease-out; }
.nav .account-pop { left:14px; bottom:84px; }
.account-head { display:flex; gap:12px; align-items:center; min-width:0; }
.account-head div { min-width:0; }
.account-head strong { display:block; font-size:15px; font-weight:800; line-height:1.3; }
.account-head small { display:block; font-size:13px; color:var(--muted); overflow-wrap:anywhere; }
.account .theme { border:0; border-top:1px solid var(--line); margin:0; padding:12px 0 0; min-width:0; }
.account .theme legend { float:left; width:100%; padding:0; margin-bottom:8px; font-size:13px; font-weight:700; }
.seg { clear:both; display:flex; gap:3px; padding:3px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); }
.seg label { flex:1 1 auto; display:flex; position:relative; cursor:pointer; }
.seg input { position:absolute; inset:0; margin:0; opacity:0; cursor:pointer; }
.seg span { flex:1; text-align:center; padding:6px 8px; border-radius:7px; font-size:13px; font-weight:700; color:var(--muted); transition:background-color .12s, color .12s; }
.seg label:hover span { color:var(--ink); }
.seg input:checked + span { background:var(--surface); color:var(--ink); box-shadow:0 1px 2px rgba(0,0,0,.12), inset 0 -2px 0 var(--mark); }
.seg input:focus-visible + span { outline:3px solid var(--accent); outline-offset:1px; }
/* A quantity with less and more buttons around it (the roulettes dialog). */
.stepper { display:flex; gap:6px; align-items:stretch; }
.stepper .btn { min-width:44px; padding:0; font-size:18px; }
.stepper .input { width:72px; text-align:center; font-weight:800; font-size:16px; -moz-appearance:textfield; }
.stepper .input::-webkit-inner-spin-button, .stepper .input::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
dialog .seg span { font-size:14px; padding:8px 6px; }
.account form { border-top:1px solid var(--line); padding-top:14px; }
.account form .btn { width:100%; }
.topbar .actions { flex-wrap:nowrap; }
.topbar .account-btn { width:40px; height:40px; justify-content:center; border-radius:50%; }
.topbar .who-text { display:none; }
.topbar .account-pop { top:64px; right:16px; width:min(300px, calc(100vw - 32px)); }
@media (max-width: 860px) {
  .nav .account { display:none; }
}
/* The payment at the provider (withdrawal and deposit detail) and its receipt. */
.grid.stack { margin-top:12px; }
.card-note { margin:12px 0 8px; color:var(--muted); font-size:14px; }
.card-actions { margin-top:16px; display:flex; gap:8px; flex-wrap:wrap; }
.copyable { display:flex; gap:8px; align-items:center; flex-wrap:wrap; min-width:0; }
dl.def dd.mono, .copyable .mono { overflow-wrap:anywhere; min-width:0; }
.receipt-amount { display:grid; gap:4px; justify-items:start; padding:14px 16px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); }
.receipt-amount strong { font-size:26px; font-weight:800; line-height:1.1; }
@media (max-width: 860px) {
  .card-actions .btn { flex:1; }
}
@media print {
  body:has(dialog.receipt[open]) > :not(dialog.receipt) { display:none; }
  dialog.receipt[open] { position:static; box-shadow:none; width:auto; max-height:none; border:1px solid #999; }
  dialog.receipt .df { display:none; }
}

/* The provider's PDF receipt in a dialog; full screen on phones. */
dialog.pdf { width:min(920px, calc(100vw - 32px)); height:calc(100vh - 32px); }
dialog.pdf[open] { display:flex; flex-direction:column; }
dialog.pdf .db { flex:1; min-height:0; grid-template-rows:1fr; }
.pdf-frame { min-height:0; }
.pdf-frame iframe { display:block; width:100%; height:100%; border:1px solid var(--line); border-radius:var(--r-sm); background:#fff; }
.pdf-fallback { align-self:center; justify-self:center; display:grid; gap:12px; justify-items:center; text-align:center; max-width:360px; }
.pdf-fallback p { margin:0; }
@media (max-width: 860px) {
  dialog.pdf { width:100vw; max-width:100vw; height:100dvh; max-height:100dvh; margin:0; border-radius:0; }
  dialog.pdf .db { padding:12px; }
  dialog.pdf .df .btn { flex:1; }
}

/* ---------- Player record: team notes, where the player bets, phone notifications (painel2-cx-feedback) ---------- */
/* Two cards one above the other in a grid cell, each as tall as it needs. */
.col-stack { display:flex; flex-direction:column; gap:12px; min-width:0; }

/* The team's notes, read before anyone acts on the player: a note pinned under the name. */
.note-strip { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:start; gap:6px 18px; margin:0 0 14px; padding:12px 16px; background:var(--warn-bg); border:1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-left:4px solid var(--mark); border-radius:var(--r-sm); }
.note-strip h2 { margin:0; font-size:13px; font-weight:800; color:var(--warn); white-space:nowrap; padding-top:2px; }
.note-strip p { margin:0; color:var(--ink); font-size:14px; line-height:1.55; max-width:80ch; overflow-wrap:anywhere; }
.note-strip.empty { grid-template-columns:minmax(0,1fr) auto; align-items:center; background:transparent; border:1px dashed var(--line); border-left-width:1px; }
.note-strip.empty p { color:var(--muted); font-size:13px; }

/* Where the player bets: the map beside the two places and how far apart they are. */
.where { margin-bottom:12px; }
.where-body { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:18px; margin-top:12px; align-items:start; }
.where .map { margin:0; }
.where .map iframe { display:block; width:100%; height:240px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface-2); }
.where .map figcaption { font-size:12px; color:var(--muted); margin-top:6px; }
.where .places { display:flex; flex-direction:column; gap:14px; min-width:0; }
.where .distance { margin:0; padding:10px 12px; border-radius:var(--r-sm); background:var(--surface-2); border:1px solid var(--line); font-size:14px; }
.where .distance b { font-size:18px; font-weight:800; }
.where .place h3 { margin:0 0 2px; font-size:13px; font-weight:700; color:var(--muted); }
.where .place p { margin:0; font-size:14px; overflow-wrap:anywhere; }
.where .coords { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:6px !important; }
@media (max-width: 860px) {
  .where-body { grid-template-columns:1fr; }
  .where .map iframe { height:200px; }
  .note-strip { grid-template-columns:1fr; }
  .note-strip .actions, .note-strip.empty .actions { justify-content:flex-start; }
}

/* ---------- App opening (app-opening-animations): the phone shows the opening as the player sees it ---------- */
/* The phone is an object, not a surface: the same dark frame and screen in either theme. */
:root { --phone:#0B1C12; --phone-screen:#14432A; --phone-ink:var(--nav-ink); --phone-muted:#9DB7A2; --phone-neg:#FFB4AB; }
.opening { display:grid; grid-template-columns:minmax(240px, 300px) minmax(0, 1fr); gap:24px; align-items:start; }
.opening .col-stack { gap:16px; }
.phone-wrap { position:sticky; top:24px; display:flex; flex-direction:column; gap:10px; align-items:center; }
.phone { position:relative; width:100%; max-width:280px; aspect-ratio:9 / 19.5; border-radius:38px; border:10px solid var(--phone); background:var(--phone-screen); box-shadow:var(--shadow); overflow:hidden; }
.phone::before { content:""; position:absolute; top:10px; left:50%; transform:translateX(-50%); width:34%; height:20px; border-radius:999px; background:var(--phone); z-index:2; }
.phone .bg { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.phone .logo { position:absolute; left:50%; top:30%; transform:translate(-50%, -50%); width:62%; height:auto; filter:drop-shadow(0 4px 0 rgba(0,0,0,.3)); }
.phone .blank { position:absolute; inset:0; display:grid; place-items:center; text-align:center; padding:24px; color:var(--phone-muted); font-size:13px; font-weight:700; }
.phone-wrap .sub { text-align:center; max-width:260px; }
/* When it shows: the week, Federal days marked with the time their bets close. */
.week { display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:6px; margin-top:14px; }
.week .d { border:1px solid var(--line); border-radius:var(--r-sm); padding:8px 4px 10px; text-align:center; background:var(--surface-2); min-width:0; }
.week .d b { display:block; font-size:12px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.week .d span { display:block; font-size:12px; color:var(--muted); margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.week .d span i { font-style:normal; }
.week .d.fed { background:color-mix(in srgb, var(--mark) 14%, var(--surface)); border-color:var(--accent-edge); }
.week .d.fed b, .week .d.fed span { color:var(--ink); }
.week .d.fed span { font-weight:700; }
.week .d.today { box-shadow:inset 0 0 0 2px var(--ink); }
.when-line { margin:12px 0 0; font-size:14px; }
.when-line strong { font-weight:800; }
.when-note { margin:4px 0 0; }
/* One file of the opening: what it is, whether it is set, its link. */
.pieces { display:grid; margin-top:6px; }
.piece { display:grid; grid-template-columns:minmax(0, 1fr) auto; gap:2px 12px; padding:12px 0; border-bottom:1px solid var(--line); }
.piece:last-child { border-bottom:0; }
.piece .what { font-weight:700; font-size:14px; }
.piece .tag { align-self:center; }
.piece .file { grid-column:1 / -1; min-width:0; }
/* The review of a long link: the field's name on its own line, "de … para …" under it. */
.preview.links { grid-template-columns:minmax(0, 1fr); gap:2px; overflow-wrap:anywhere; }
.preview.links [data-name] { font-weight:700; }
.preview.links b { font-weight:600; }
.preview.links [data-name]:not(:first-child) { margin-top:10px; }
/* The opening dialog: the phone preview beside the two links, updated as a link is pasted. */
.opening-edit { grid-template-columns:150px minmax(0, 1fr); gap:24px; align-items:start; }
.opening-edit .mini { margin:0; display:flex; flex-direction:column; align-items:center; gap:6px; }
.opening-edit .mini figcaption { font-size:12px; color:var(--muted); font-weight:700; }
.phone.small { max-width:150px; border-width:6px; border-radius:24px; box-shadow:none; }
.phone.small::before { top:6px; height:12px; }
.phone .layer { position:absolute; inset:0; }
.phone .layer .bg, .phone .layer .logo { display:block; }
.phone .layer .blank { font-size:12px; }
.phone .layer .blank.neg, .phone .layer .pill.neg { color:var(--phone-neg); }
.phone .layer .pill { position:absolute; left:50%; top:30%; transform:translate(-50%, -50%); white-space:nowrap; padding:4px 10px; border-radius:999px; background:color-mix(in srgb, var(--phone) 85%, transparent); color:var(--phone-ink); font-size:11px; font-weight:700; }
.opening-edit .tip { margin:2px 0 0; font-size:13px; color:var(--muted); }
.opening-edit .tip strong { color:var(--ink); }
@media (max-width: 860px) {
  .opening { grid-template-columns:1fr; }
  .phone-wrap { position:static; order:2; }
  .phone { max-width:220px; }
  .week { gap:4px; }
  .week .d { padding:6px 2px 8px; }
  .week .d span { font-size:11px; }
  .week .d span i { display:none; }
  .opening-edit { grid-template-columns:1fr; }
  .phone.small { max-width:110px; }
}

/* The GoaPay wallet in place of the balances (panel-goapay-player design D2). */
.wallet { background:var(--nav); color:var(--nav-ink); border-radius:var(--r); padding:20px 22px; display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr) auto; gap:20px 28px; align-items:end; box-shadow:var(--elev); }
.wallet > div { min-width:0; }
:root[data-theme="dark"] .wallet { background:var(--nav-active); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wallet { background:var(--nav-active); } }
.wallet h2 { margin:0; font-size:15px; font-weight:800; color:var(--nav-ink); display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.wallet-state { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700; color:#9BE3A8; background:rgba(108,203,122,.14); border-radius:999px; padding:2px 9px; }
.wallet-state::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.wallet-state.off { color:var(--nav-muted); background:rgba(230,240,223,.08); }
.wallet-who p { margin:10px 0 0; font-size:13px; color:var(--nav-muted); line-height:1.6; }
.wallet-who .mono { color:var(--nav-ink); }
.wallet-money { display:flex; gap:28px; flex-wrap:wrap; }
.wallet-money .label { font-size:13px; font-weight:600; color:var(--nav-muted); }
.wallet-money .big { font-family:"Lilita One", Manrope, sans-serif; font-size:44px; line-height:1; color:var(--accent); margin-top:4px; letter-spacing:.01em; font-variant-numeric:tabular-nums; }
.wallet-money .mid { font-size:24px; font-weight:800; margin-top:10px; font-variant-numeric:tabular-nums; }
.wallet-money .hint { font-size:12px; color:var(--nav-muted); margin-top:4px; }
.wallet-side { text-align:right; font-size:12px; color:var(--nav-muted); display:grid; gap:8px; justify-items:end; }
.wallet .btn { background:transparent; color:var(--nav-ink); border-color:rgba(230,240,223,.28); }
.wallet-off { font-size:14px; line-height:1.5; max-width:46ch; }
.wallet-off strong { display:block; font-size:18px; margin-bottom:4px; color:var(--nav-ink); }
.wallet-transit { grid-column:1 / -1; border-top:1px solid rgba(230,240,223,.14); padding-top:12px; font-size:13px; display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.wallet-transit span { color:var(--nav-muted); }
.wallet-transit a { color:var(--nav-ink); }
.wallet a:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
/* "Desde o cadastro" split at the activation (design D3). */
.periods { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); margin-top:14px; }
.periods > div { padding-right:20px; min-width:0; }
.periods > div + div { padding:0 0 0 20px; border-left:1px solid var(--line); }
.periods h3 { margin:0 0 10px; font-size:13px; font-weight:700; color:var(--muted); }
.periods .legend { grid-template-columns:repeat(3, minmax(0,1fr)); }
@media (max-width: 860px) {
  .wallet { grid-template-columns:1fr; }
  .wallet-side { text-align:left; justify-items:start; }
  .periods { grid-template-columns:1fr; }
  .periods > div + div { border-left:0; border-top:1px solid var(--line); padding:14px 0 0; margin-top:14px; }
  .periods .legend { grid-template-columns:1fr 1fr; }
}

/* Result apps (result-apps design D8): the status word, and each banner list
   as cards — the image whole, its position over it, the add card last. */
.status-word { font-size:20px; font-weight:800; }
.bn-section { margin-top:32px; }
/* Two switches of an app, one under the other (app-premium-layout). */
.app-switch + .app-switch { margin-top:12px; }
.bn-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:14px; }
.bn-head h2 { margin:0; font-size:17px; font-weight:800; }
.bn-head p { margin:2px 0 0; }
.bn-grid { list-style:none; margin:0; padding:0; display:grid; gap:16px; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); align-items:start; }
.bn-grid.small { grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); }
.bn-card { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; }
.bn-shot { position:relative; display:block; background:var(--surface-2); border-bottom:1px solid var(--line); }
.bn-shot img { display:block; width:100%; height:auto; }
.bn-pos { position:absolute; top:10px; left:10px; min-width:34px; height:34px; padding:0 8px; display:grid; place-items:center; border-radius:10px; background:var(--accent); color:var(--accent-ink); border:1px solid var(--accent-edge); box-shadow:0 2px 0 var(--accent-edge); font:22px/1 "Lilita One", Manrope, sans-serif; }
.bn-body { padding:12px 14px 14px; display:grid; gap:12px; }
.bn-link { display:grid; gap:1px; min-width:0; }
.bn-link-to { font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bn-link-to.none { font-weight:500; color:var(--muted); }
.bn-actions { display:flex; gap:8px; }
.bn-actions .btn { flex:1; }
.bn-add button { width:100%; aspect-ratio:1080 / 450; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; border:2px dashed var(--line); border-radius:var(--r); background:transparent; color:var(--ink); font-weight:700; cursor:pointer; }
.bn-add.small button { aspect-ratio:1080 / 300; }
.bn-add button:hover { border-color:var(--accent-edge); background:var(--surface); }
.bn-plus { font:30px/1 "Lilita One", Manrope, sans-serif; color:var(--accent-edge); }
.bn-none { display:grid; align-content:center; gap:4px; padding:18px 20px; border-radius:var(--r); background:var(--surface-2); border:1px solid var(--line); }
@media (max-width: 640px) {
  .bn-grid, .bn-grid.small { grid-template-columns:1fr; }
  .bn-add button, .bn-add.small button { aspect-ratio:auto; padding:22px 12px; }
}

/* Apps (app-menu-webview-live design D6): each link list as an ordered table
   with the banners' position badge, and the start WebView beside a phone that
   shows the message as the player sees it. */
.ln-item { display:flex; align-items:center; gap:10px; min-width:0; }
.ln-item strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ln-pos { flex:none; min-width:28px; height:28px; padding:0 6px; display:grid; place-items:center; border-radius:8px; background:var(--accent); color:var(--accent-ink); border:1px solid var(--accent-edge); box-shadow:0 2px 0 var(--accent-edge); font:16px/1 "Lilita One", Manrope, sans-serif; }
.ln-url { color:var(--muted); text-decoration:none; }
.ln-url:hover { color:var(--ink); text-decoration:underline; }
th.ln-act { width:190px; }
.ln-add { margin-top:12px; width:100%; display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; padding:14px; border:2px dashed var(--line); border-radius:var(--r); background:transparent; color:var(--ink); font-weight:700; cursor:pointer; }
.ln-add:hover { border-color:var(--accent-edge); background:var(--surface); }
.ln-add .bn-plus { font-size:24px; }
.ln-full { margin:12px 0 0; padding:12px 16px; border-radius:var(--r); background:var(--surface-2); border:1px solid var(--line); color:var(--muted); font-size:14px; }
.wv-alert { margin-bottom:14px; }
.wv-body { display:grid; grid-template-columns:minmax(0, 1fr) 170px; gap:24px; align-items:start; }
.wv-main { display:grid; gap:14px; min-width:0; }
.wv-main .toggles .t { padding-top:0; }
.wv-hint { color:var(--warn); font-weight:700; margin-top:2px; }
.wv-saved { margin:0; display:grid; gap:10px; }
.wv-saved > div { display:grid; grid-template-columns:minmax(0, 1fr); gap:2px; min-width:0; }
.wv-saved dt { font-size:12px; font-weight:700; color:var(--muted); }
.wv-saved dd { margin:0; font-size:14px; overflow-wrap:anywhere; }
.wv-saved .none { color:var(--muted); }
.wv-saved a { color:inherit; }
.wv-figure { margin:0; display:flex; flex-direction:column; align-items:center; gap:6px; }
.wv-figure figcaption { font-size:12px; font-weight:700; color:var(--muted); text-align:center; }
.wv-screen { position:absolute; inset:0; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:14px; padding:28px 14px; text-align:center; }
.wv-msg { margin:0; max-width:100%; color:var(--phone-ink); font-size:12px; font-weight:700; line-height:1.4; white-space:pre-line; overflow-wrap:anywhere; overflow:hidden; display:-webkit-box; -webkit-line-clamp:10; -webkit-box-orient:vertical; }
.wv-go { max-width:100%; padding:5px 10px; border-radius:12px; background:var(--accent); color:var(--accent-ink); font-size:11px; font-weight:800; line-height:1.3; overflow-wrap:anywhere; }
.wv-msg.none { color:var(--phone-muted); font-weight:600; }
.wv-go.none { background:transparent; color:var(--phone-muted); border:1px dashed var(--phone-muted); }
.wv-edit { display:grid; grid-template-columns:minmax(0, 1fr) 150px; gap:20px; align-items:start; }
.wv-review { display:grid; grid-template-columns:110px minmax(0, 1fr); gap:16px; align-items:start; }
@media (max-width: 640px) {
  .wv-body, .wv-edit { grid-template-columns:minmax(0, 1fr); }
  .wv-review { grid-template-columns:90px minmax(0, 1fr); }
}

/* Rich message body (rich-messages design D5): the editor and every preview share .rich-body, which draws what the
   app draws — the image fits the width without growing past its size, and an action button looks like ours. */
.rich { border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface); position:relative; }
.rich:focus-within { border-color:var(--muted); }
.rich > textarea.input { border:0; border-radius:var(--r-sm); }
.rich-bar { display:flex; flex-wrap:wrap; gap:4px; padding:6px 8px; border-bottom:1px solid var(--line); background:var(--surface-2); border-radius:var(--r-sm) var(--r-sm) 0 0; }
.rich-tool { display:inline-flex; align-items:center; gap:6px; min-height:32px; min-width:34px; padding:0 10px; border:1px solid var(--line); background:var(--surface); color:var(--ink); border-radius:8px; font-weight:700; font-size:13px; cursor:pointer; justify-content:center; }
.rich-tool:hover { border-color:var(--muted); }
.rich-sep { width:1px; background:var(--line); margin:4px 2px; }
.rich-area { min-height:160px; max-height:420px; overflow-y:auto; padding:12px 14px; outline:none; }
.rich-area[aria-invalid="true"] { box-shadow:inset 0 0 0 2px var(--neg); border-radius:0 0 var(--r-sm) var(--r-sm); }
.rich-pop { position:absolute; left:12px; right:12px; top:48px; z-index:2; max-width:360px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm); box-shadow:var(--shadow); padding:12px; display:flex; flex-direction:column; gap:8px; }
.rich-pop .actions { display:flex; justify-content:flex-end; gap:6px; }
.rich-body { font-size:14px; line-height:1.55; overflow-wrap:anywhere; }
.rich-body p { margin:0 0 10px; }
.rich-body p:last-child { margin-bottom:0; }
.rich-body img { display:block; max-width:100%; height:auto; border-radius:8px; margin:6px 0; }
.rich-body a { color:var(--info); font-weight:700; }
.rich-body a[data-button] { display:inline-block; background:var(--accent); color:var(--accent-ink); border:1px solid var(--accent-edge); box-shadow:0 3px 0 var(--accent-edge); border-radius:var(--r-sm); padding:7px 16px; font-weight:800; text-decoration:none; margin:4px 0; }
.rich-preview { background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:12px 14px; margin-top:10px; }
.preview .rich-preview { grid-column:1 / -1; margin-top:0; }
.check-row { display:flex; gap:10px; align-items:flex-start; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:10px 12px; font-size:14px; cursor:pointer; }
.check-row input { margin-top:4px; accent-color:var(--pos); }
.check-row .help { display:block; }
.check-row:has(input:disabled) { cursor:not-allowed; opacity:.7; }
