/* Revisions after the first review: foldable Review Center, reading mode, mobile tabs, the three
   evidence layers, number kinds on Media & Budget, and the three calendar statuses. */

/* ------------------------------------------------------------------ review layout */
.review { --q-w: 300px; --i-w: 380px; grid-template-columns: var(--q-w) minmax(0, 1fr); }
.review.q-collapsed { --q-w: 68px; }
.review.i-collapsed { --i-w: 68px; }
.review .rv { grid-template-columns: minmax(0, 1fr) var(--i-w); }
.m-tabs { display: none; }
.rq-rail, .insp-rail { display: none; }
.review.q-collapsed .rq-full { display: none; }
.review.q-collapsed .rq-rail { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 0; overflow-y: auto; }
.review.i-collapsed .insp-full { display: none; }
.review.i-collapsed .insp-rail { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0; }
.rail-btn { width: 46px; height: 46px; border-radius: 12px; border: 1px solid transparent; background: none; display: grid; place-items: center; cursor: pointer; color: var(--text-2); position: relative; flex: none; }
.rail-btn:hover { background: var(--surface-3); color: var(--text); }
.rail-btn em { position: absolute; inset-block-start: 3px; inset-inline-end: 3px; font-style: normal; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; padding-inline: 3px; border-radius: 8px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; }
.rq-rail-item { position: relative; background: none; border: 2px solid transparent; border-radius: 14px; padding: 2px; cursor: pointer; flex: none; }
.rq-rail-item:hover { background: var(--surface-3); }
.rq-rail-item.is-selected { border-color: var(--attn); }
.rail-dot { position: absolute; inset-block-start: 0; inset-inline-end: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--attn); border: 2px solid var(--surface-2); }
.rq-fold, .insp-fold { flex: none; }
.rv-tools { display: flex; gap: 2px; align-self: flex-start; padding: 2px; background: var(--surface-3); border-radius: var(--r-sm); }
.rv-tools .tool[aria-pressed="true"] { background: var(--surface); color: var(--primary-text); box-shadow: var(--shadow-1); }
.insp-top { display: flex; align-items: flex-start; gap: 6px; padding: 14px 10px 0 14px; background: var(--surface-2); position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--border); }
.inspector > div.insp-full { position: static; padding: 0; background: none; border: 0; z-index: auto; top: auto; }
.insp-top .tabs { border-bottom: 0; }
.rv-doc { padding-bottom: 40px; }

/* reading mode: only the document and the decision bar */
.reading-bar { display: none; align-items: center; gap: 10px; padding: 8px 24px; background: var(--primary-soft); color: var(--primary-text); font-size: var(--fs-sm); border-bottom: 1px solid var(--primary-soft-2); }
.review.reading { grid-template-columns: minmax(0, 1fr); }
.review.reading .rq, .review.reading .rv-insp, .review.reading .rv-tools .tool:not(:nth-child(2)) { display: none; }
.review.reading .rv { grid-template-columns: minmax(0, 1fr); }
.review.reading .reading-bar { display: flex; }
.review.reading .rv-doc { padding-inline: clamp(20px, 6vw, 72px); }
.review.reading .doc { max-width: 76ch; margin-inline: auto; gap: 40px; }
.review.reading .doc-lead { font-size: var(--fs-xl); line-height: 1.9; }
.review.reading .claim-text { font-size: var(--fs-lg); line-height: 1.85; }
.review.reading .swot { grid-template-columns: minmax(0, 1fr); }
.review.reading .decision-bar { justify-content: center; }

/* ------------------------------------------------------------------ evidence: three layers */
.ev-chip { position: relative; }
.ev-chip.rv-pending { background: var(--attn-soft); color: var(--attn-text); border: 1px dashed var(--attn); }
.ev-chip.rv-pending:hover, .ev-chip.rv-pending.is-active { background: var(--attn); color: #fff; border-style: solid; }
.ev-chip.rv-rejected { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger); text-decoration: line-through; }
.ev-chip.is-confirmed { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--success); }
.ev-card.rv-pending { border-style: dashed; border-color: var(--attn); }
.ev-card.rv-rejected { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 4%, var(--surface)); }
.layers { display: flex; flex-direction: column; gap: 6px; }
.layer { display: flex; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--divider); }
.layer-ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-3); }
.layer-ok .layer-ico { background: var(--success-soft); color: var(--success-text); }
.layer-bad .layer-ico { background: var(--danger-soft); color: var(--danger-text); }
.layer-wait .layer-ico { background: var(--attn-soft); color: var(--attn-text); }
.layer-title { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.layer-value { font-size: var(--fs-sm); font-weight: 500; line-height: 1.5; }
.layer-note { font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.rej-why { display: inline-flex; gap: 5px; align-items: flex-start; color: var(--danger-text); font-weight: 500; }
.ev-date { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.ev-date.is-old { color: var(--attn-text); }
.ev-date em { font-style: normal; font-weight: 700; margin-inline-start: 4px; background: var(--attn-soft); padding: 0 6px; border-radius: 6px; }
.ev-actions { display: flex; gap: 6px; margin-inline-start: auto; }
.ev-sum { display: flex; gap: 8px; flex-wrap: wrap; }
.ev-sum span { display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-xs); padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.ev-sum .ok { color: var(--success-text); } .ev-sum .wait { color: var(--attn-text); } .ev-sum .ind { color: var(--info-text); }
.ev-help summary { cursor: pointer; font-size: var(--fs-sm); color: var(--primary-text); font-weight: 600; }
.ev-help p { margin-top: 8px; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.8; }
.before { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.before ul { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); }
.before li { display: flex; gap: 8px; align-items: center; }
.calc-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.calc-li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--divider); border-radius: var(--r-sm); flex-wrap: wrap; }
.calc-li.is-missing { border-style: dashed; border-color: var(--attn-border); }

/* ------------------------------------------------------------------ media & budget: kinds of number */
.kinds { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: var(--sp-5); }
.calc-formula { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-3); }
.calc-uses { display: flex; flex-wrap: wrap; gap: 6px; }
.use-chip { display: inline-flex; gap: 6px; align-items: baseline; font-size: 11.5px; padding: 2px 8px; border-radius: 7px; background: var(--surface-3); color: var(--text-2); }
.use-chip em { font-style: normal; color: var(--text-3); }
.use-chip.is-mine { background: var(--attn-soft); color: var(--attn-text); }
.use-chip.is-empty { border: 1px dashed var(--attn-border); }
button.calc-missing { background: none; border: 0; text-align: start; cursor: pointer; font: inherit; padding: 0; }
button.calc-missing:hover span { text-decoration: underline; text-underline-offset: 3px; }
.calc-val small { display: block; font-size: 11.5px; font-weight: 500; color: var(--attn-text); margin-top: 2px; }
.calc.is-scenario { border-color: var(--attn-border); background: color-mix(in srgb, var(--attn) 5%, var(--surface)); }

/* ------------------------------------------------------------------ calendar: three statuses */
.cal-post { border: 1px solid transparent; }
.cal-post svg { color: var(--c); flex: none; }
.cal-post.st-proposed { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-2); font-style: italic; }
.cal-post.st-approved { border-inline-start: 3px solid var(--c); }
.cal-post.st-ready { background: color-mix(in srgb, var(--c) 20%, var(--surface)); border: 1px solid var(--c); font-weight: 600; }
.cal-post.st-ready svg { color: var(--success-text); }
.cal-dots i.st-proposed { background: transparent; border: 1.5px dashed var(--c); }
.cal-dots i.st-approved { background: var(--c); }
.cal-dots i.st-ready { background: var(--c); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--success); }
.cal-count { display: flex; gap: 12px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-2); }
.cal-count span { display: inline-flex; gap: 5px; align-items: center; }
.cal-count .st-ready { color: var(--success-text); } .cal-count .st-approved { color: var(--info-text); } .cal-count .st-proposed { color: var(--text-3); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 14px; font-size: var(--fs-xs); color: var(--text-3); }
.cal-legend .swatch { min-width: 36px; height: 22px; justify-content: center; }
.agenda-item.st-proposed { border-style: dashed; }
.agenda-item.st-ready { border-color: var(--success); }

/* ------------------------------------------------------------------ narrower than a desktop */
@media (max-width: 1279px) {
  .review { height: auto; min-height: 0; overflow: visible; }
  .review .rv { grid-template-columns: minmax(0, 1fr); }
  .review.i-collapsed .insp-rail { flex-direction: row; justify-content: flex-start; padding: 8px 14px; }
  .review.i-collapsed .rv-insp { border-top: 1px solid var(--border); }
  .rv-doc { overflow: visible; padding-bottom: 90px; }
  .rv-insp { overflow: visible; }
  .insp-top { top: var(--topbar-h); }
  .rq-list { max-height: 70vh; }
}
@media (max-width: 899px) {
  .review { grid-template-columns: minmax(0, 1fr); border-radius: var(--r-lg); }
  .m-tabs { display: grid; grid-template-columns: repeat(4, 1fr); position: sticky; top: var(--topbar-h); z-index: 6; background: var(--surface); border-bottom: 1px solid var(--border); }
  .m-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; font: inherit; font-size: 11.5px; color: var(--text-3); background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer; position: relative; min-height: 52px; }
  .m-tab[aria-selected="true"] { color: var(--primary-text); font-weight: 700; border-bottom-color: var(--primary); }
  .m-tab:disabled { opacity: .4; }
  .m-tab em { position: absolute; inset-block-start: 4px; inset-inline-start: calc(50% + 6px); font-style: normal; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; padding-inline: 4px; border-radius: 8px; background: var(--attn); color: #fff; display: grid; place-items: center; }
  .review[data-mtab="queue"] .rv-slot { display: none; }
  .review:not([data-mtab="queue"]) .rq { display: none; }
  .review[data-mtab="output"] .rv-insp { display: none; }
  .review[data-mtab="evidence"] .rv-main, .review[data-mtab="decision"] .rv-main { display: none; }
  .review[data-mtab="evidence"] .rv-slot, .review[data-mtab="decision"] .rv-slot { display: flex; }
  .rv-tools, .rv-back, .rq-fold, .insp-fold, .rq-rail, .insp-rail, .reading-bar { display: none !important; }
  .review.q-collapsed .rq-full, .review.i-collapsed .insp-full { display: block; }
  .rv-head { padding: 14px 16px; }
  .rv-status { flex: 0 0 100%; flex-direction: row; align-items: center; justify-content: space-between; }
  .rv-doc { padding: 18px 16px 28px; }
  /* sticky, not fixed: the page fades in with a transform, which would pin a fixed bar to the page instead of the screen */
  .decision-bar { position: sticky; bottom: var(--bottom-nav-h); z-index: 7; padding: 10px 16px; box-shadow: 0 -8px 20px -12px rgba(20, 26, 40, .35); }
  .decision-bar > .grow { display: none; }
  .decision-bar .btn { flex: 1; justify-content: center; min-height: 46px; }
  .insp-top { top: calc(var(--topbar-h) + 52px); }
  .insp-panel { padding-bottom: calc(var(--bottom-nav-h) + 24px); }
}
@media (max-width: 759px) {
  .drawer { width: 100% !important; max-width: 100% !important; border-radius: 0; }
  .drawer-foot, .modal-foot { position: sticky; bottom: 0; background: var(--surface); }
  .drawer-foot .btn { flex: 1; justify-content: center; min-height: 46px; }
  .cal-filters > .row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .cal-filters .chip { flex: none; }
  .cal-legend { gap: 8px 14px; }
}

.claim-meta .badge { white-space: normal; text-align: start; max-width: 100%; }
@media (max-width: 759px) { .swot { grid-template-columns: minmax(0, 1fr); } }

.insp-top .tab .count { display: none; }
.insp-top .tab { padding-inline: 10px; }

@media (max-width: 1099px) { .cmdk-trigger .kbd { display: none; } }
