/* ════════════════════════════════════════════════════════════════════
   VYAN REVIEWS · app.css · the instrument
   Dark, still, precise, editorial. Left-aligned and asymmetric. Character
   from structure (hairlines, ruled rows, figures), not decoration. Every
   color, space, and radius is a token from ../assets/tokens.css; raw hex
   here is a defect. One gold CTA per page: .btn-gold, reserved for the
   next-action hero.
   ════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body.app-ground {
  background: var(--obsidian);
  color: var(--platinum);
  font-family: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono-cap { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--plat-faint); }
.lbl { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--plat-faint); }
.lbl.ember { color: var(--ember); }
.ember { color: var(--ember); }
.why { display: block; margin-top: 5px; font-family: var(--mono); font-size: 11px; letter-spacing: .02em; color: var(--plat-faint); text-transform: none; }
.grow { flex: 1 1 auto; min-width: 0; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 12px; top: 12px; background: var(--graphite); padding: 8px 12px; border-radius: var(--r-control); z-index: 99; }

/* ── shell ──────────────────────────────────────────────────────────── */
.app { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px; height: 58px;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
  margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter);
}
.tb-brand { display: inline-flex; align-items: baseline; gap: 8px; }
.tb-brand .disp { font-family: var(--disp); font-size: 15px; letter-spacing: .04em; }
.tb-brand .tb-room { font-family: var(--disp); font-size: 15px; letter-spacing: .04em; color: var(--plat-dim); }
.tb-mid { color: var(--plat-dim); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.tb-mode { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ember); border: 1px solid var(--line-hi); border-radius: var(--r-chip); padding: 3px 7px; }
.clock { font-family: var(--mono); font-size: 12px; color: var(--plat-dim); }
.tb-op { color: var(--plat-dim); }
.tb-reset { background: none; border: 1px solid var(--line-hi); color: var(--plat-dim); border-radius: var(--r-control); padding: 5px 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; transition: color var(--m-fast) var(--ease), border-color var(--m-fast) var(--ease); }
.tb-reset:hover { color: var(--platinum); border-color: var(--ember-deep); }
@media (max-width: 620px) { .tb-mid { display: none; } }

.view { flex: 1 1 auto; padding: 26px 0 40px; outline: none; }
.app-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 20px 0 30px; }
@media (max-width: 560px) { .app-foot > span:last-child { display: none; } }

/* ── the next-action hero · the one gold CTA ────────────────────────── */
.hero-next {
  display: grid; grid-template-columns: 1.55fr 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden;
  background: var(--graphite-2); margin-bottom: 26px;
}
.hn-main { padding: 22px 24px 24px; }
.hn-label { font-size: clamp(20px, 3.4vw, 27px); font-weight: 700; letter-spacing: -.02em; margin-top: 10px; line-height: 1.12; }
.hn-sub { color: var(--plat-dim); font-size: 14px; line-height: 1.55; margin-top: 10px; max-width: 46ch; }
.hn-cta { margin-top: 20px; }
.hn-rep { padding: 22px 24px; border-left: 1px solid var(--line); background: linear-gradient(180deg, var(--tint-row), transparent); display: flex; flex-direction: column; justify-content: center; }
.hn-num { font-size: clamp(40px, 8vw, 58px); font-weight: 750; letter-spacing: -.03em; line-height: 1; margin-top: 8px; }
.hn-of { font-size: 18px; color: var(--plat-faint); font-weight: 500; margin-left: 6px; letter-spacing: 0; }
.hn-trend { margin-top: 12px; }
.hn-trend.up { color: var(--green); }
.hn-trend.down { color: var(--red); }
@media (max-width: 720px) {
  .hero-next { grid-template-columns: 1fr; }
  .hn-rep { border-left: none; border-top: 1px solid var(--line); }
}

/* ── the gold CTA ───────────────────────────────────────────────────── */
.btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--ember); color: var(--ember-ink);
  font-family: var(--body); font-weight: 700; font-size: 14.5px;
  border: none; cursor: pointer; padding: 13px 22px; border-radius: var(--r-control);
  transition: background var(--m-fast) var(--ease), transform var(--m-fast) var(--ease-spring);
}
.btn-gold:hover { background: var(--ember-hi); }
.btn-gold:active { transform: translateY(1px); }

/* ── ordinary controls (never gold) ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--graphite); color: var(--platinum);
  border: 1px solid var(--line-hi); border-radius: var(--r-control);
  font-family: var(--body); font-size: 13px; cursor: pointer;
  padding: 8px 13px; transition: border-color var(--m-fast) var(--ease), background var(--m-fast) var(--ease);
}
.btn:hover { border-color: var(--ember-deep); background: var(--tint-hover); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; min-width: 30px; }
.btn-link { background: none; border: none; color: var(--ember); padding: 4px 0; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.btn-link:hover { color: var(--ember-hi); }

/* ── grid ───────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 880px) { .grid-2 { grid-template-columns: 1fr; } }
.col-side { display: flex; flex-direction: column; gap: 22px; }

/* ── panel · the instrument frame ───────────────────────────────────── */
.panel { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--graphite-2); overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-title { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.panel-sub { margin-top: 5px; text-transform: none; letter-spacing: .02em; }
.panel-head .btn { margin-left: auto; }
.panel-body { padding: 4px 18px 8px; }

/* ── completed-work rows (ported from vReviews) ─────────────────────── */
.vrow { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.panel-body > .vrow:last-of-type, .panel-body > .sub-row:last-child { border-bottom: none; }
.vr-name { font-weight: 600; font-size: 14.5px; }
.vr-right { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 62%; }

.sub-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 13px; margin: 0 0 14px; border-radius: var(--r-control); font-size: 13px; }
.sub-row.up { background: color-mix(in srgb, var(--green) 7%, transparent); border-left: 1px solid var(--green); }
.sub-row.down { background: color-mix(in srgb, var(--red) 7%, transparent); border-left: 1px solid var(--red); }
.sub-row.info { background: var(--tint-row); border-left: 1px solid var(--line-hi); align-items: center; }
.sub-row .mono-cap { text-transform: none; letter-spacing: .01em; font-size: 11.5px; color: var(--plat-dim); }
.sub-row .btn-link { margin-left: auto; white-space: nowrap; }
.draft-line { font-size: 13.5px; color: var(--platinum); line-height: 1.5; }
.draft-line .lbl { display: block; margin-bottom: 5px; }

.status { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; }
.status.bad { color: var(--red); }

.empty { padding: 26px 2px 28px; }
.empty p { color: var(--plat-dim); font-size: 14px; margin-bottom: 12px; }

/* ── chips ──────────────────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border-radius: var(--r-chip); border: 1px solid var(--line-hi); color: var(--plat-dim); white-space: nowrap; }
.chip.ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, var(--line-hi)); }
.chip.info { color: var(--trust); border-color: color-mix(in srgb, var(--trust) 40%, var(--line-hi)); }
.chip.bad { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line-hi)); }
.chip.dim { color: var(--plat-faint); }

/* ── reputation dashboard ───────────────────────────────────────────── */
.rep-grid { padding: 4px 0 10px; }
.rep-row { display: grid; grid-template-columns: 1.3fr 1.1fr 2fr 0.7fr 0.6fr; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rep-row:last-child { border-bottom: none; }
.rep-head { color: var(--plat-faint); font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; padding-bottom: 6px; }
.rep-head div:nth-child(3) { text-align: left; }
.rep-src { font-size: 13.5px; font-weight: 600; }
.rep-rating { font-size: 14px; font-weight: 650; display: flex; flex-direction: column; gap: 2px; }
.rep-rating .stars { font-size: 9px; letter-spacing: 1px; color: var(--ember); }
.rep-meter { height: 6px; background: var(--graphite); border-radius: var(--r-pill); overflow: hidden; }
.rep-meter span { display: block; height: 100%; background: var(--grad-ember); border-radius: var(--r-pill); }
.rep-count { font-size: 13px; color: var(--plat-dim); text-align: right; }
.rep-trend { font-size: 12.5px; text-align: right; color: var(--plat-faint); }
.rep-trend.up { color: var(--green); }
.rep-trend.down { color: var(--red); }
@media (max-width: 460px) {
  .rep-row { grid-template-columns: 1.2fr 1fr 0.6fr; }
  .rep-meter { display: none; } .rep-head div:nth-child(3) { display: none; }
}

/* ── activity feed ──────────────────────────────────────────────────── */
.act-list { padding: 2px 0 8px; }
.act-row { display: flex; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.act-row:last-child { border-bottom: none; }
.act-type { white-space: nowrap; min-width: 96px; color: var(--plat-dim); }
.act-type.up { color: var(--green); }
.act-type.down { color: var(--red); }
.act-subj { font-size: 13px; color: var(--platinum); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-ago { white-space: nowrap; }

/* ── toasts ─────────────────────────────────────────────────────────── */
.toasts {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  background: var(--graphite); border: 1px solid var(--line-hi); border-radius: var(--r-control);
  padding: 12px 16px; display: flex; gap: 12px; align-items: center; max-width: 90vw;
  box-shadow: 0 10px 40px var(--scrim); opacity: 0; pointer-events: none;
  transition: opacity var(--m-base) var(--ease), transform var(--m-base) var(--ease-exit); z-index: 80;
}
.toasts.on { opacity: 1; transform: translate(-50%, 0); }
.toast-tag { color: var(--ember); }
.toast-msg { font-size: 13.5px; color: var(--platinum); }
