/* Portal, presentation only. The tokens are tutor-app/app.css, copied rather
 * than imported so the portal can be served on its own; keep them in step.
 * Anything that looks different from the lesson player here is a bug. */

:root {
  --bg:        #fbfcfe;
  --surface:   #ffffff;
  --fg:        #14161c;
  --muted:     #5c6472;
  --line:      #dde2ea;
  --line-soft: #eef1f6;
  --accent:    #1f5fd0;
  --accent-sf: #e8f0fd;
  --ok:        #16794a;
  --ok-sf:     #e6f5ec;
  --bad:       #b02a30;
  --bad-sf:    #fdecec;
  --warn:      #8a5a05;
  --warn-sf:   #fdf4e1;
  --tile:      #f2f5fa;
  --radius:    12px;
  --tap:       44px;
}

* { box-sizing: border-box; }
/* .chip and .btn set display, which outranks the attribute. An "Assigned"
 * badge showed as a green blob before it had any text in it. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px 72px; }
.wrap.narrow { max-width: 880px; }

a { color: var(--accent); }

/* ── shared header ───────────────────────────────────────────────────── */

.ph {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251,252,254,0.95);
  backdrop-filter: saturate(1.6) blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.ph-bar {
  max-width: 1180px; margin: 0 auto; padding: 10px 22px;
  display: flex; align-items: center; gap: 22px;
}
.ph-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.ph-crest {
  width: 26px; height: 26px; flex: none; border-radius: 7px;
  background: var(--accent); color: #fff;
  font: 700 11px/26px -apple-system, sans-serif; text-align: center; letter-spacing: 0.04em;
}
.ph-brand-name { font-weight: 650; font-size: 14.5px; letter-spacing: -0.01em; }
.ph-nav { display: flex; gap: 4px; }
.ph-link {
  padding: 6px 11px; border-radius: 8px; text-decoration: none;
  color: var(--muted); font-size: 13.5px; font-weight: 550;
}
.ph-link:hover { background: var(--tile); color: var(--fg); }
.ph-link.on { background: var(--accent-sf); color: var(--accent); }
.ph-who { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ph-initials {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--tile); border: 1px solid var(--line); color: var(--muted);
  font: 650 11px/26px -apple-system, sans-serif; text-align: center;
}
.ph-name { font-size: 13.5px; color: var(--muted); }
.ph-out {
  min-height: 32px; padding: 0 12px; font: 550 13px -apple-system, sans-serif;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.ph-out:hover { color: var(--fg); border-color: var(--muted); }
.ph-out:focus-visible, .ph-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ── page head ───────────────────────────────────────────────────────── */

.head { padding: 26px 0 18px; display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.head h1 { font-size: 25px; margin: 0 0 4px; letter-spacing: -0.02em; font-weight: 650; }
.head .sub { color: var(--muted); font-size: 14px; margin: 0; }
.head .right { margin-left: auto; text-align: right; color: var(--muted); font-size: 13px; }
.crumb { font-size: 13px; color: var(--muted); margin: 18px 0 0; }
.crumb a { color: var(--muted); }

/* ── tiles ───────────────────────────────────────────────────────────── */

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 6px 0 26px; }
.tile-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  border-left: 3px solid var(--line);
}
.tile-card .n { font: 650 30px/1 -apple-system, sans-serif; letter-spacing: -0.02em; }
.tile-card .l { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.tile-card.green { border-left-color: var(--ok); }
.tile-card.green .n { color: var(--ok); }
.tile-card.yellow { border-left-color: var(--warn); }
.tile-card.yellow .n { color: var(--warn); }
.tile-card.accent { border-left-color: var(--accent); }
.tile-card.accent .n { color: var(--accent); }

/* ── cards and tables ────────────────────────────────────────────────── */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.card + .card { margin-top: 16px; }
.card h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; letter-spacing: -0.01em; }
.k {
  font: 700 10.5px/1 -apple-system, sans-serif; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--muted); display: block; margin-bottom: 8px;
}

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th {
  text-align: left; font: 700 10.5px/1 -apple-system, sans-serif;
  text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted);
  padding: 0 12px 10px; border-bottom: 1px solid var(--line);
}
table.list td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.list tbody tr.tappable { cursor: pointer; }
table.list tbody tr.tappable:hover { background: var(--accent-sf); }
table.list tbody tr.tappable:focus-within { background: var(--accent-sf); }
table.list td .nm { font-weight: 600; }
table.list td a { text-decoration: none; }
table.list td a:hover { text-decoration: underline; }
.num { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.mono { font: 500 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }

.chip {
  display: inline-block; padding: 3px 9px; border-radius: 99px;
  font: 600 11.5px/1.35 -apple-system, sans-serif; white-space: nowrap;
}
.chip.green  { background: var(--ok-sf);     color: var(--ok); }
.chip.yellow { background: var(--warn-sf);   color: var(--warn); }
.chip.accent { background: var(--accent-sf); color: var(--accent); }
.chip.grey   { background: var(--tile);      color: var(--muted); }
.chip.tiny   { font-size: 10.5px; padding: 2px 7px; }

/* ── buttons ─────────────────────────────────────────────────────────── */

.btn {
  min-height: var(--tap); padding: 0 20px; font: 600 15px/1 -apple-system, sans-serif;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.ghost:hover { color: var(--fg); border-color: var(--muted); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; cursor: default; }

/* ── the graph ───────────────────────────────────────────────────────── */

.graph-wrap { position: relative; margin: 4px 0 0; }
svg.kgraph { width: 100%; height: auto; display: block; overflow: visible; }
svg.kgraph .kg-node { cursor: pointer; }
svg.kgraph .kg-node rect:first-child { transition: filter .12s; }
svg.kgraph .kg-node:hover rect:first-child { filter: brightness(0.97); }
svg.kgraph .kg-node:focus { outline: none; }
svg.kgraph .kg-node:focus-visible rect:first-child { stroke: var(--accent); stroke-width: 3; }
svg.kgraph .kg-node.on-path rect:first-child { stroke: var(--accent); stroke-width: 2.5; }
svg.kgraph .kg-layer { font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-weight: 700; }
svg.kgraph text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif; }
svg.kgraph .kg-teks { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }

.kg-pop {
  position: absolute; z-index: 30; width: 306px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px 12px;
  box-shadow: 0 8px 28px rgba(20,22,28,.16);
}
.kg-pop h4 { margin: 0 0 8px; font-size: 14.5px; font-weight: 650; padding-right: 18px; }
.kg-pop-meta { margin: 0 0 9px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kg-pop-teks {
  font: 600 11px ui-monospace, Menlo, monospace;
  background: var(--accent-sf); color: var(--accent); padding: 3px 7px; border-radius: 5px;
}
.kg-pop-state { font: 600 11.5px -apple-system, sans-serif; }
.kg-pop-state.green { color: var(--ok); }
.kg-pop-state.yellow { color: var(--warn); }
.kg-pop-state.grey, .kg-pop-state.goal { color: var(--muted); }
.kg-pop-teks-text {
  margin: 0 0 9px; font-size: 12.5px; line-height: 1.45; color: var(--muted);
  border-left: 2px solid var(--line); padding-left: 9px;
}
.kg-pop-line { margin: 0 0 10px; font-size: 13px; }
.kg-pop-k {
  margin: 0 0 6px; font: 700 10px/1 -apple-system, sans-serif;
  text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted);
}
.kg-pop ul { list-style: none; margin: 0; padding: 0; }
.kg-pop li {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 8px;
  align-items: baseline; padding: 4px 0; font-size: 12.5px;
  border-top: 1px solid var(--line-soft);
}
.kg-pop-date { font: 500 11px ui-monospace, Menlo, monospace; color: var(--muted); white-space: nowrap; }
.kg-pop-item { color: var(--fg); }
.kg-pop-mark { font: 600 11px -apple-system, sans-serif; }
.kg-pop-mark.ok { color: var(--ok); }
.kg-pop-mark.no { color: var(--bad); }
.kg-pop-close {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  border: none; background: transparent; color: var(--muted);
  font: 600 14px -apple-system, sans-serif; cursor: pointer; border-radius: 6px;
}
.kg-pop-close:hover { background: var(--tile); color: var(--fg); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 13px; height: 13px; border-radius: 4px; display: inline-block; border: 1px solid; }
.legend i.green  { background: var(--ok-sf);   border-color: #bce3cd; }
.legend i.yellow { background: var(--warn-sf); border-color: #ecd9a8; }
.legend i.grey   { background: var(--tile);    border-color: var(--line); }
.legend i.goal   { background: var(--tile);    border-color: var(--accent); border-width: 2px; }

/* ── the six week strip ──────────────────────────────────────────────── */

.strip { display: flex; gap: 10px; align-items: flex-end; height: 84px; margin: 4px 0 0; }
.strip .wk { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.strip .bar { width: 100%; background: var(--accent-sf); border-radius: 5px 5px 0 0; min-height: 6px; }
.strip .wk.now .bar { background: var(--accent); }
.strip .cap { font: 500 10.5px ui-monospace, Menlo, monospace; color: var(--muted); }
.strip .mins { font: 600 11px -apple-system, sans-serif; color: var(--muted); }

/* ── two column body ─────────────────────────────────────────────────── */

.cols { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .cols { grid-template-columns: 1fr; } .tiles { grid-template-columns: 1fr; } }

/* ── the recommendation ──────────────────────────────────────────────── */

.rec { border-left: 3px solid var(--accent); animation: rise .3s cubic-bezier(.2,.7,.3,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.rec .rule { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.rec .steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.rec .steps .arrow { color: var(--muted); }
.rec .step-chip {
  border: 1px solid var(--accent); background: var(--accent-sf); color: var(--accent);
  border-radius: 9px; padding: 7px 12px; font-size: 13px; font-weight: 600;
}
.rec .step-chip small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.pick {
  border: 1px solid var(--accent); background: var(--accent-sf);
  border-radius: 10px; padding: 14px 16px; margin: 0 0 12px;
}
.pick .t { font-weight: 650; font-size: 15px; margin: 0 0 5px; }
.pick .w { font-size: 13px; color: var(--muted); margin: 0; }
.alt {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px;
  margin: 0 0 8px; opacity: .62; background: var(--tile);
}
.alt .t { font-weight: 600; font-size: 13.5px; margin: 0 0 4px; }
.alt .w { font-size: 12.5px; color: var(--muted); margin: 0; }
.aside-note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }
.assigned-line { display: flex; align-items: center; gap: 10px; margin-top: 14px; }

/* ── sign in ─────────────────────────────────────────────────────────── */

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-card {
  width: 100%; max-width: 396px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 30px 30px 26px;
  box-shadow: 0 2px 20px rgba(20,22,28,.05);
}
.crest-big {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px;
  background: var(--accent); color: #fff;
  font: 700 18px/52px -apple-system, sans-serif; text-align: center; letter-spacing: 0.04em;
}
.login h1 { font-size: 19px; text-align: center; margin: 0 0 4px; font-weight: 650; letter-spacing: -0.01em; }
.login .dist { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.fld { margin: 0 0 13px; }
.fld label { display: block; font: 600 12px -apple-system, sans-serif; color: var(--muted); margin: 0 0 5px; }
.fld input {
  width: 100%; height: var(--tap); padding: 0 13px; font: 15px -apple-system, sans-serif;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--fg);
}
.fld input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-sf); }
.fld.bad input { border-color: var(--bad); background: var(--bad-sf); }
.err {
  display: none; margin: 0 0 13px; padding: 10px 13px; border-radius: 9px;
  background: var(--bad-sf); border: 1px solid #f3c9c9; color: var(--bad); font-size: 13px;
}
.err.on { display: block; }
.rule-or {
  display: flex; align-items: center; gap: 12px; margin: 20px 0 14px;
  color: var(--muted); font-size: 12px;
}
.rule-or::before, .rule-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sso { display: grid; gap: 9px; }
.sso button {
  min-height: var(--tap); width: 100%; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  font: 600 14px -apple-system, sans-serif; color: var(--fg);
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.sso button:hover { border-color: var(--muted); }
.sso button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sso .mark { width: 18px; height: 18px; border-radius: 4px; flex: none; }
.sso .mark.clever { background: #436cf4; }
.sso .mark.google {
  background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0);
  border-radius: 50%;
}
.foot-note { text-align: center; color: var(--muted); font-size: 11.5px; margin: 20px 0 0; line-height: 1.5; }

/* ── the SSO choosers ────────────────────────────────────────────────── */

.veil {
  position: fixed; inset: 0; z-index: 60; background: rgba(20,22,28,.42);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.veil.on { display: flex; }
.chooser {
  width: 100%; max-width: 392px; background: var(--surface);
  border-radius: 14px; padding: 24px 24px 18px; box-shadow: 0 20px 60px rgba(20,22,28,.3);
}
.chooser .brandline { display: flex; align-items: center; gap: 9px; margin: 0 0 4px; font-weight: 650; font-size: 15px; }
.chooser .dist { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.acct {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; margin: 0 0 9px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  font: inherit; color: var(--fg);
}
.acct:hover { border-color: var(--accent); background: var(--accent-sf); }
.acct:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.acct .av {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: var(--tile); border: 1px solid var(--line); color: var(--muted);
  font: 650 13px/34px -apple-system, sans-serif; text-align: center;
}
.acct .who { flex: 1; min-width: 0; }
.acct .who b { display: block; font-size: 14px; font-weight: 650; }
.acct .who span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.chooser .cancel {
  width: 100%; min-height: 40px; margin-top: 8px; background: transparent;
  border: none; color: var(--muted); font: 550 13px -apple-system, sans-serif; cursor: pointer;
}

/* ── content bank ────────────────────────────────────────────────────── */

.bank-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 16px; }
.bank-controls select, .bank-controls input {
  min-height: 38px; padding: 0 11px; font: 14px -apple-system, sans-serif;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--fg);
}
.bank-controls label { font: 600 12px -apple-system, sans-serif; color: var(--muted); }
.bank-count { margin-left: auto; font-size: 13px; color: var(--muted); }
.nodes-cell { display: flex; gap: 5px; flex-wrap: wrap; }

.abstract { font-size: 15px; line-height: 1.6; max-width: 62ch; }
.nothing {
  margin-top: 20px; padding: 16px 18px; border: 1px dashed var(--line);
  border-radius: var(--radius); color: var(--muted); background: var(--tile); font-size: 14px;
}

/* The sidebar tables are 320px wide: the roomy row padding of the main tables
 * turns a date into two lines and "3 of 5" into three. */
aside table.list td { padding: 9px 6px; font-size: 13.5px; }
aside table.list td:first-child { padding-left: 0; }
aside table.list td:last-child { padding-right: 0; text-align: right; }

.chip.mono-chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; }
