/* ─────────────────────────────────────────────────────────────
   Result redesign (staging3) — Step 1: hero = passport + score side panel.
   Scoped with rr- prefix to avoid collisions with the existing tool CSS.
   Reuses base.css design tokens (--accent, --card-bg, etc.).
   ───────────────────────────────────────────────────────────── */
/* FULL-PAGE RESULTS: once a result is showing, body.rr-results (added by the
   island) collapses the tool's two-pane .calc-layout into a single full-width
   column — the input form becomes a compact bar on top, the result spans the
   whole .container (~1216px) below. This gives the hero room to be INLINE
   (passport + score panel side-by-side) instead of the ~794px squeeze. */
body.rr-results .calc-layout{display:block}
body.rr-results .calc-layout > .panel:first-child{max-width:780px;margin:0 0 1.4rem}
body.rr-results .calc-layout > .panel:last-child{width:100%}
/* Modest widen of the result view beyond the site's 1280px container so the
   report uses more of a wide screen WITHOUT over-stretching the 2-column hero
   (passport 580 + score panel). ~1360 keeps the score panel ≈640px — still a
   tidy 3-dial row, not a stranded sliver. Only when a result is showing. */
body.rr-results #main-content > .container{max-width:1360px}

/* ════════════════════════════════════════════════════════════════
   DECK INPUT REDESIGN — island mode only (body.rr-island; the
   ?island=0 vanilla escape hatch is left completely untouched).
   Brings the input to the result's tile fidelity and kills the wasted
   space in both states. Colors stay system-correct per base.css:
   GOLD frame/borders (every card site-wide), PURPLE inputs + CTA
   (every input + .btn-primary site-wide). Fidelity + layout, not hue.
   ════════════════════════════════════════════════════════════════ */
/* input panel → modern tile (same treatment as the result tiles) */
body.rr-island .calc-layout > .panel:first-child{
  background:linear-gradient(180deg,var(--card-bg-hi),var(--card-bg) 42%);
  border:1px solid var(--card-border);border-radius:14px;
  box-shadow:0 10px 26px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.03);
  position:relative;overflow:hidden;
}
body.rr-island .calc-layout > .panel:first-child::after{
  content:"";position:absolute;inset:0 0 auto 0;height:1px;
  background:linear-gradient(90deg,transparent,rgba(212,175,55,.35),transparent);
}
/* header → serif + gold icon chip (matches result tile headers) */
body.rr-island .calc-layout > .panel:first-child > h2{
  font-family:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,"Times New Roman",serif;
  font-weight:600;font-size:1.15rem;display:flex;align-items:center;gap:10px;
}
body.rr-island .calc-layout > .panel:first-child > h2::before{
  content:"\229F";flex:none;width:26px;height:26px;border-radius:8px;display:grid;place-items:center;
  font-size:.85rem;color:var(--accent);background:rgba(212,175,55,.12);border:1px solid rgba(212,175,55,.22);
}
/* tabs → segmented control, gold-active (result control idiom) */
body.rr-island .calc-layout .bb-input-tabs{
  background:rgba(0,0,0,.25);border:1px solid rgba(255,255,255,.05);border-radius:11px;padding:5px;gap:6px;
}
body.rr-island .calc-layout .bb-input-tab-btn{
  border:none;background:rgba(255,255,255,.04);color:var(--text-secondary);border-radius:8px;box-shadow:none;font-weight:700;white-space:nowrap;
}
body.rr-island .calc-layout .bb-input-tab-btn:hover{background:rgba(255,255,255,.06);color:var(--text-primary);border:none}
body.rr-island .calc-layout .bb-input-tab-btn[aria-selected="true"]{
  background:var(--gradient-gold);color:#0e0b14;border:none;box-shadow:none;
}
/* advanced → neutral/gold tint (was purple) */
body.rr-island .calc-layout .bb-advanced{border:1px solid var(--card-border);background:rgba(255,255,255,.018)}
body.rr-island .calc-layout .bb-advanced-summary{background:transparent;border:none;color:var(--text-secondary)}
body.rr-island .calc-layout .bb-advanced-summary:hover{background:rgba(212,175,55,.05);color:var(--text-primary)}

/* ── LANDING (island, pre-result): one focused centered tile; drop the
   empty ~700px "Results" placeholder pane entirely. ── */
body.rr-island:not(.rr-results) .calc-layout{display:block}
body.rr-island:not(.rr-results) .calc-layout > .panel:first-child{max-width:640px;margin:0 auto}
body.rr-island:not(.rr-results) .calc-layout > .panel:last-child{display:none}

/* ── POST-RESULT (island): input becomes a full-width slim bar (no ~548px
   void), compacted into a single row; the report renders full-width below. ── */
body.rr-island.rr-results .calc-layout > .panel:first-child{
  max-width:none;width:100%;margin:0 0 16px;
  display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px;padding:14px 20px;
}
body.rr-island.rr-results .calc-layout > .panel:first-child > h2{margin:0;font-size:1rem;white-space:nowrap}
body.rr-island.rr-results .calc-layout .bb-input-tabs{margin:0;width:auto}
body.rr-island.rr-results .calc-layout .bb-input-panel{flex:1 1 300px;min-width:0}
body.rr-island.rr-results .calc-layout .bb-input-label,
body.rr-island.rr-results .calc-layout > .panel:first-child .field-hint,
body.rr-island.rr-results .calc-layout .import-status{display:none}
body.rr-island.rr-results .calc-layout .bb-advanced{margin:0;flex:0 0 auto;border:none;background:transparent}
body.rr-island.rr-results .calc-layout #analyzeBtn{width:auto;margin:0;flex:0 0 auto}

/* required-asterisk on the (paste-only) commander field */
body.rr-island .req-mark{color:#f87171;font-weight:700}

/* "Powered by" data-sources bar: below the input. Centered to match the 640px
   landing tile; hidden once a result is shown (doesn't belong above the report). */
body.rr-island:not(.rr-results) .bb-trust{max-width:640px;margin:14px auto 0}
body.rr-island.rr-results .bb-trust{display:none}

/* redundant "Results" h2 — the passport/report is self-evident (island only) */
body.rr-island .calc-layout > .panel:last-child > h2{display:none}

/* ── Post-result: the deck input collapses; "Run another deck" re-opens it.
   Default (collapsed) → input hidden, button shown. .rr-input-open → input bar
   shown (overrides), button hidden. ── */
body.rr-island.rr-results:not(.rr-input-open) .calc-layout > .panel:first-child{display:none}
.rr-new-deck{display:none}
body.rr-island.rr-results:not(.rr-input-open) #rrNewDeck{
  display:inline-flex;align-items:center;gap:8px;margin:0 0 16px;cursor:pointer;
  font-family:inherit;font-size:.9rem;font-weight:600;color:var(--accent-purple);
  background:rgba(167,139,250,.12);border:1px solid rgba(167,139,250,.35);border-radius:10px;padding:.7rem 1.15rem;
  transition:background .15s ease;
}
body.rr-island.rr-results:not(.rr-input-open) #rrNewDeck:hover{background:rgba(167,139,250,.22)}

/* Hero is side-by-side (passport flexes, score panel a solid 320–360px) and
   only stacks on genuinely narrow screens. Now that the result is full-width,
   there's room for inline at all normal laptop widths. */
/* ── Report grid (island reflow): LEFT = passport, RIGHT = score panel +
   essentials bento. Fills the vertical space beside the tall passport card
   instead of stranding it. Accordions stay full-width below. ── */
.rr-report{display:grid;grid-template-columns:minmax(0,540px) minmax(0,1fr);gap:20px;align-items:start;margin:0 0 18px}
.rr-col-main{min-width:0}
.rr-col-main #passportCard{margin:0}
.rr-col-main{display:flex;flex-direction:column}
/* share/action buttons sit BELOW the passport card in the left column */
.rr-col-main .passport-actions{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 0;justify-content:flex-start}
.rr-col-side{min-width:0;display:flex;flex-direction:column;gap:16px}
/* bento + power panel sit in the side column — column gap handles spacing, so
   kill their own vertical margins. #rrSidePower is also a .rr-bento (so the
   .acc/.tile styles apply) but holds a single full-width power panel. */
.rr-col-side .rr-bento{margin:0}
@media (max-width:900px){ .rr-report{grid-template-columns:1fr} }

/* legacy hero wrapper — emptied by the island reflow; collapse it */
.rr-hero{display:grid;grid-template-columns:minmax(0,580px) minmax(320px,1fr);gap:18px;align-items:start;margin:0 0 22px}
.rr-hero:empty{display:none;margin:0}
.rr-hero #passportCard{margin:0}
.rr-hero-side{display:flex;flex-direction:column;gap:16px;min-width:0}

.rr-dials{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.rr-dial{background:linear-gradient(180deg,var(--card-bg-hi),var(--card-bg) 45%);border:1px solid var(--card-border);border-radius:14px;
  padding:16px 8px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:2px;box-shadow:var(--shadow-md)}
.rr-ring{width:104px;height:104px;border-radius:50%;display:grid;place-items:center;position:relative;
  background:conic-gradient(var(--rr-col,var(--accent)) calc(var(--rr-val,0)*3.6deg),rgba(255,255,255,.07) 0);
  filter:drop-shadow(0 6px 14px rgba(0,0,0,.4))}
.rr-ring::before{content:"";position:absolute;inset:8px;border-radius:50%;background:radial-gradient(circle at 50% 35%,var(--card-bg-hi),var(--card-bg))}
.rr-ring .rr-num{position:relative;font-size:1.7rem;font-weight:700;line-height:1;color:var(--text-primary)}
.rr-ring .rr-den{position:relative;font-size:.62rem;color:var(--text-muted)}
.rr-dial .rr-lbl{font-size:.72rem;letter-spacing:.1em;text-transform:uppercase;font-weight:700;margin-top:10px}
.rr-dial .rr-cap{font-size:.72rem;color:var(--text-secondary)}
.rr-dial .rr-band{font-size:.62rem;color:var(--text-secondary);margin-top:3px;padding:2px 8px;border-radius:10px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.06)}

.rr-clock{background:linear-gradient(180deg,var(--card-bg-hi),var(--card-bg) 45%);border:1px solid var(--card-border);border-radius:14px;padding:14px 18px;box-shadow:var(--shadow-md)}
.rr-clock-h{font-size:.66rem;letter-spacing:.13em;text-transform:uppercase;color:var(--accent);font-weight:700;margin-bottom:9px}
.rr-clock-row{display:flex;gap:14px;flex-wrap:wrap;font-size:.84rem;color:var(--text-secondary)}
.rr-clock-row b{color:var(--text-primary)}

/* keep the relocated action buttons tidy inside the side panel */
.rr-hero-side .passport-actions{display:flex;flex-wrap:wrap;gap:8px;margin:2px 0 0;justify-content:flex-start}

/* Stack the hero only on genuinely narrow screens (where even the full-width
   result pane can't host passport + a 320px score panel comfortably). */
@media (max-width:760px){ .rr-hero{grid-template-columns:1fr} }
@media (max-width:560px){
  .rr-dials{gap:8px}
  .rr-ring{width:86px;height:86px}
  .rr-ring .rr-num{font-size:1.4rem}
}

/* ── Discord bot CTA banner (added 2026-06-30) — converts tool traffic into bot installs ──
   Capped to 640px (≈ input-panel width, slightly wider than the 590px input group) + centered
   so it sits neatly above the deck-input panel instead of spanning the full page. */
.discord-cta{
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  max-width:640px; margin:0 auto 1.25rem; padding:.6rem .9rem;
  background:linear-gradient(100deg,#5865F2 0%,#7e8cff 100%);
  border:1px solid rgba(255,255,255,.18); border-radius:12px; color:#fff;
  box-shadow:0 6px 18px rgba(88,101,242,.30);
}
.discord-cta-text{display:flex; flex-direction:column; gap:.1rem; min-width:0;}
.discord-cta-badge{
  display:inline-block; width:fit-content; margin-bottom:.15rem;
  font-size:.56rem; font-weight:800; letter-spacing:.08em;
  background:rgba(255,255,255,.22); padding:.1rem .42rem; border-radius:999px;
}
.discord-cta-title{font-size:.95rem; font-weight:800; line-height:1.2;}
.discord-cta-sub{font-size:.78rem; opacity:.94; line-height:1.32;}
.discord-cta-sub code{
  background:rgba(255,255,255,.2); padding:.05em .32em; border-radius:5px;
  font-size:.92em; font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
}
.discord-cta-btn{
  flex:0 0 auto; display:inline-flex; align-items:center; gap:.45rem;
  background:#fff; color:#404EED; font-weight:800; font-size:.88rem;
  padding:.48rem .95rem; border-radius:9px; text-decoration:none; white-space:nowrap;
  transition:transform .12s ease, box-shadow .12s ease;
}
.discord-cta-btn:hover{transform:translateY(-1px); box-shadow:0 5px 14px rgba(0,0,0,.22);}
.discord-cta-btn:focus-visible{outline:3px solid #fff; outline-offset:2px;}
.discord-cta-btn svg{width:18px; height:18px; flex:0 0 auto;}
.discord-cta-actions{display:flex; flex-direction:column; align-items:flex-end; gap:.35rem; flex:0 0 auto;}
.discord-cta-alt{font-size:.72rem; color:#fff; opacity:.9; text-decoration:underline; text-underline-offset:2px; white-space:nowrap;}
.discord-cta-alt:hover{opacity:1;}
.discord-cta-alt:focus-visible{outline:2px solid #fff; outline-offset:2px; border-radius:4px;}
@media (max-width:560px){
  .discord-cta{flex-direction:column; align-items:stretch; gap:.7rem; padding:.85rem;}
  .discord-cta-actions{align-items:stretch; width:100%;}
  .discord-cta-btn{width:100%; justify-content:center;}
  .discord-cta-alt{text-align:center; white-space:normal;}
}

/* ── Dispute status: post-submit success panel + ?dispute= outcome banner ── */
.dispute-success { display: flex; flex-direction: column; gap: 10px; }
.dispute-success-lead { font-size: 0.95rem; color: var(--text-primary, #e8e3f0); margin: 0; }
.dispute-success-id { font-size: 0.85rem; color: var(--text-secondary, #b7aecb); }
.dispute-success-id code { background: rgba(212, 175, 55, 0.12); border: 1px solid rgba(212, 175, 55, 0.3); border-radius: 6px; padding: 2px 8px; font-size: 0.9em; }
.dispute-success-note { font-size: 0.8rem; color: var(--text-secondary, #b7aecb); margin: 0; }
.dispute-success-linkrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dispute-success-link { font-size: 0.8rem; word-break: break-all; }
.dispute-copy-link { flex: none; }
.dispute-status-banner { position: relative; margin: 14px auto; max-width: 900px; padding: 14px 44px 14px 16px; border-radius: 12px; font-size: 0.9rem; line-height: 1.55; border: 1px solid; }
.dispute-status-banner.is-pending { border-color: rgba(96, 165, 250, 0.4); background: rgba(96, 165, 250, 0.08); }
.dispute-status-banner.is-granted { border-color: rgba(74, 222, 128, 0.45); background: rgba(74, 222, 128, 0.09); }
.dispute-status-banner.is-denied { border-color: rgba(251, 146, 60, 0.4); background: rgba(251, 146, 60, 0.07); }
.dispute-status-banner.is-adjusted { border-color: rgba(212, 175, 55, 0.4); background: rgba(212, 175, 55, 0.08); }
.dispute-status-banner.is-error { border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.07); }
.dispute-status-note { display: block; margin-top: 8px; font-size: 0.82rem; color: var(--text-secondary, #b7aecb); }
.dispute-status-close { position: absolute; top: 8px; right: 10px; background: none; border: none; color: inherit; font-size: 1.3rem; cursor: pointer; line-height: 1; opacity: 0.7; }
.dispute-status-close:hover { opacity: 1; }

/* ── Pod note — borderline verdict, stated plainly + copyable for the playgroup ── */
.pod-note { margin: 0 0 1rem; padding: 0.85rem 1rem 0.9rem; border-radius: 10px; border: 1px solid rgba(212, 175, 55, 0.38); border-left: 4px solid rgba(212, 175, 55, 0.85); background: rgba(212, 175, 55, 0.09); }
.pod-note-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pod-note-icon { font-size: 1.05rem; line-height: 1; }
.pod-note-title { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.01em; text-transform: uppercase; color: #e5c964; }
.pod-note-body { margin: 0 0 0.7rem; font-size: 0.9rem; line-height: 1.5; color: var(--text-primary, #e8e3f0); }
.pod-note-copy { font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; padding: 6px 14px; border-radius: 7px; border: 1px solid rgba(212, 175, 55, 0.5); background: rgba(212, 175, 55, 0.14); color: #e5c964; transition: background 0.15s ease, border-color 0.15s ease; }
.pod-note-copy:hover { background: rgba(212, 175, 55, 0.24); border-color: rgba(212, 175, 55, 0.7); }
.pod-note-copy:active { transform: translateY(1px); }
/* Rule-vs-table note — blue, not gold. Gold pod-notes mean "this is a judgment call";
   here the rule is certain and only the power read differs. Overrides .pod-note. */
.rule-gap-note { border-color: rgba(96, 165, 250, 0.34); border-left-color: rgba(96, 165, 250, 0.8); background: rgba(96, 165, 250, 0.08); }
.rule-gap-note .pod-note-title { color: #9ecbff; text-transform: none; font-size: 0.9rem; }
.rule-gap-note .pod-note-copy { border-color: rgba(96, 165, 250, 0.5); background: rgba(96, 165, 250, 0.14); color: #9ecbff; }
.rule-gap-note .pod-note-copy:hover { background: rgba(96, 165, 250, 0.24); border-color: rgba(96, 165, 250, 0.7); }
.rule-gap-cards { font-size: 0.83rem; color: var(--text-secondary, #b9b2c9); }
@media (prefers-color-scheme: light) {
  .rule-gap-note .pod-note-title, .rule-gap-note .pod-note-copy { color: #1d4ed8; }
}
@media (prefers-color-scheme: light) {
  .pod-note-title, .pod-note-copy { color: #8a6d17; }
  .pod-note-body { color: #2a2333; }
}
:root[data-theme="dark"] .pod-note-title, :root[data-theme="dark"] .pod-note-copy { color: #e5c964; }
:root[data-theme="dark"] .pod-note-body { color: var(--text-primary, #e8e3f0); }
:root[data-theme="light"] .pod-note-title, :root[data-theme="light"] .pod-note-copy { color: #8a6d17; }
:root[data-theme="light"] .pod-note-body { color: #2a2333; }

/* ── The links from the calculator into the precon library ──
   The library was getting ~97 views/week against this page's ~6,500 because nothing here
   linked to it. These are the path in: a nudge in the input panel for visitors with no
   decklist to hand, and a crawlable section below the fold (which is also the only place
   the 58 precon pages get an internal link from a page with any authority). */
.precon-nudge {
    margin: 0.6rem 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.5;
}
.precon-nudge a { font-weight: 600; }

.precon-lib-list {
    list-style: none;
    margin: 1rem 0 1.2rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.15rem 1.5rem;
}
.precon-lib-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.precon-lib-list a { font-weight: 600; }
.precon-lib-cmd {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
}
.precon-lib-why {
    flex: 1 0 100%;
    font-size: 0.73rem;
    color: rgba(255, 255, 255, 0.4);
}
.precon-lib-all { font-weight: 600; }
