/* CSE 2027 Reviewer — styles */
:root {
  --navy: #0A2A6B; --navy2: #0038A8; --gold: #FCD116; --gold-soft: #FFF6CC; --red: #CE1126; --red-soft: #FDE8EA; --ph-blue: #0038A8; --ph-red: #CE1126; --ph-yellow: #FCD116;
  --bg: #F5F6FA; --surface: #FFFFFF; --surface2: #F1F3F8; --ink: #1F2328; --muted: #667085; --line: #E3E7EF;
  --good: #1E7B45; --good-bg: #E6F4EC; --bad: #B42318; --bad-bg: #FDECEA; --warn: #B54708; --warn-bg: #FEF3E6;
  --accent: #0038A8; --focus: #0038A8;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --head: "Poppins", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0F1522; --surface: #172033; --surface2: #1D2840; --ink: #E7EAF0; --muted: #98A2B3; --line: #2A3650;
  --navy: #0B1220; --navy2: #8FB0F0; --gold-soft: #3A2E12; --good: #52C28A; --good-bg: #133226; --bad: #F97066; --bad-bg: #3B1716;
  --warn: #F7B267; --warn-bg: #3A2A12; --accent: #8FB0F0; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0F1522; --surface: #172033; --surface2: #1D2840; --ink: #E7EAF0; --muted: #98A2B3; --line: #2A3650;
  --navy: #0B1220; --navy2: #8FB0F0; --gold-soft: #3A2E12; --good: #52C28A; --good-bg: #133226; --bad: #F97066; --bad-bg: #3B1716;
  --warn: #F7B267; --warn-bg: #3A2A12; --accent: #8FB0F0; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 3.2vw, 2rem); } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; margin-top: 1.2em; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .tiny { font-size: .78rem; }
.sr { position: absolute; left: -9999px; }

/* ---------- layout */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #fff; padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand .logo { width: 40px; height: 40px; border-radius: 11px; display: block; flex: none; } .brand .logo svg { width: 100%; height: 100%; display: block; }
.brand b { font-family: var(--head); font-size: 15px; line-height: 1.15; display: block; }
.brand span { font-size: 12px; color: #C9D3E6; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #D8DEEA; text-decoration: none; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.on { background: rgba(252,209,22,.14); color: #fff; box-shadow: inset 3px 0 0 var(--ph-yellow); }
.nav svg { width: 20px; height: 20px; flex: none; }
.side .foot { margin-top: auto; font-size: 12px; color: #9FB0CF; padding: 8px; }
.main { padding: 28px clamp(16px, 4vw, 44px) 96px; max-width: 1180px; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.mobilebar, .tabbar { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobilebar { display: flex; align-items: center; justify-content: space-between; background: var(--navy); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 20; }
  .mobilebar .brand { padding: 0; } .mobilebar .brand .logo { width: 32px; height: 32px; font-size: 13px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11px; color: var(--muted); text-decoration: none; font-weight: 500; }
  .tabbar a.on { color: var(--accent); }
  .tabbar svg { width: 22px; height: 22px; }
  .main { padding: 18px 16px 110px; }
}

/* ---------- components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.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)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .g2, .g3 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .05s, background .15s; min-height: 42px; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--navy2); color: #fff; } :root[data-theme="dark"] .btn.primary { color: #0F1522; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0F1522; } }
.btn.primary:hover { filter: brightness(1.08); }
.btn.gold { background: var(--ph-yellow); color: #0A2A6B; } .btn.red { background: var(--ph-red); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--surface2); }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, .choice:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface2); color: var(--muted); }
.pill.good { background: var(--good-bg); color: var(--good); } .pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.gold { background: var(--gold-soft); color: #7A5B00; } .pill.red { background: var(--red-soft); color: var(--ph-red); } :root[data-theme="dark"] .pill.gold { color: var(--gold); }
.seg { display: inline-flex; background: var(--surface2); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* hero */
.hero { background: linear-gradient(135deg, #0A2A6B 0%, #0038A8 70%, #1447B8 100%); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -70px; top: -70px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(252,209,22,.35) 0 30%, rgba(252,209,22,.12) 31% 60%, transparent 61%); }
.hero::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--ph-blue) 0 40%, var(--ph-yellow) 40% 60%, var(--ph-red) 60%); }
.hero h1 { color: #fff; } .hero .muted { color: #C9D3E6; }
.count { display: flex; gap: 14px; margin: 14px 0 4px; flex-wrap: wrap; }
.count div { background: rgba(255,255,255,.08); border-radius: 12px; padding: 10px 14px; min-width: 76px; text-align: center; }
.count b { font: 700 1.7rem var(--head); display: block; line-height: 1.1; } .count span { font-size: .75rem; color: #C9D3E6; text-transform: uppercase; letter-spacing: .06em; }

.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi b { font: 700 1.6rem var(--head); } .kpi span { color: var(--muted); font-size: .85rem; }
.bar { height: 10px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--navy2); transition: width .4s; }
.mbar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.gauge { position: relative; width: 150px; height: 150px; }
.gauge svg { transform: rotate(-90deg); }
.gauge .v { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge .v b { font: 700 1.9rem var(--head); display: block; line-height: 1; } .gauge .v span { font-size: .75rem; color: var(--muted); }

.topic { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; transition: border-color .15s, transform .1s; }
.topic:hover { border-color: var(--navy2); transform: translateY(-1px); }
.topic .t { font-weight: 600; line-height: 1.3; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* lessons */
.lessonlist a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.lessonlist a:hover { background: var(--surface2); }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-size: 13px; }
.check.done { background: var(--good); border-color: var(--good); color: #fff; }
.lesson { font-size: 1.02rem; }
.lesson table.facts, .facts { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: .94rem; }
.facts th, .facts td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.facts th { background: var(--surface2); font-weight: 600; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
.note, .tip, .trap { border-radius: 10px; padding: 12px 14px; margin: 14px 0; border-left: 4px solid; }
.note { background: var(--surface2); border-color: var(--navy2); }
.tip { background: var(--good-bg); border-color: var(--good); }
.trap { background: var(--warn-bg); border-color: var(--warn); }

/* quiz */
.qwrap { max-width: 820px; margin: 0 auto; }
.qhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.qtext { font-size: 1.08rem; margin: 6px 0 16px; overflow-wrap: anywhere; }
.qtext .passage { background: var(--surface2); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; font-size: .98rem; }
.qtext .stem, .qtext .er { display: block; margin-top: 8px; padding: 10px 14px; background: var(--surface2); border-radius: 10px; font-size: 1.06rem; }
.qtext .er u { text-decoration-thickness: 2px; text-underline-offset: 4px; } .qtext .er sub { font-weight: 700; color: var(--accent); margin: 0 3px 0 1px; }
.qtext .kw { color: var(--accent); letter-spacing: .02em; }
.qtext .math { font-family: var(--mono); background: var(--surface2); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.qtext .series { display: inline-block; margin-top: 8px; font-size: 1.15rem; padding: 8px 14px; white-space: normal; }
.qtext .analogy { font-family: var(--head); font-weight: 600; font-size: 1.15rem; }
.qtext .sents { margin-top: 10px; display: grid; gap: 6px; } .qtext .sent { padding: 8px 12px; background: var(--surface2); border-radius: 8px; }
.qtext table.dtable, .qtext table.cmp { border-collapse: collapse; margin: 10px 0; font-size: .95rem; background: var(--surface); }
.qtext table.dtable caption { caption-side: top; text-align: left; font-weight: 600; padding-bottom: 6px; }
.qtext table.dtable th, .qtext table.dtable td, .qtext table.cmp th, .qtext table.cmp td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.qtext table.cmp td { font-family: var(--mono); font-size: .95rem; }
.qtext table.code th, .qtext table.code td { text-align: center; min-width: 34px; }
.chartwrap { max-width: 420px; margin: 8px 0; } .chart .bar { fill: var(--navy2); } .chart .axis { stroke: var(--muted); } .chart text { fill: var(--ink); font: 10px var(--font); text-anchor: middle; } .chart .bar-v { font-weight: 600; }
.figrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.figq { font: 700 1.6rem var(--head); color: var(--accent); padding: 0 8px; }
.fig .fig-box { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.fig .fig-stroke { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.fig .fig-fill { fill: var(--ink); stroke: var(--ink); stroke-width: 1.5; }
.choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .12s, background .12s; min-height: 50px; }
.choice:hover:not(:disabled) { border-color: var(--navy2); }
.choice .k { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--surface2); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.choice .ct { padding-top: 2px; overflow-wrap: anywhere; } .choice svg.fig { display: block; }
.choice.sel { border-color: var(--navy2); background: color-mix(in srgb, var(--navy2) 8%, var(--surface)); }
.choice.sel .k { background: var(--navy2); color: #fff; }
.choice.right { border-color: var(--good); background: var(--good-bg); } .choice.right .k { background: var(--good); color: #fff; }
.choice.wrong { border-color: var(--bad); background: var(--bad-bg); } .choice.wrong .k { background: var(--bad); color: #fff; }
.choice:disabled { cursor: default; }
.explain { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--surface2); border-left: 4px solid var(--navy2); }
.explain.ok { border-color: var(--good); } .explain.no { border-color: var(--bad); }
.explain .tag, .tag { display: inline-block; font-size: .72rem; font-weight: 700; background: var(--gold-soft); color: #7A5B00; padding: 1px 8px; border-radius: 999px; margin-left: 4px; }
.qfoot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.progress { height: 6px; background: var(--surface2); border-radius: 999px; overflow: hidden; margin-bottom: 14px; } .progress i { display: block; height: 100%; background: var(--gold); transition: width .25s; }
.timer { font: 700 1.05rem var(--mono); padding: 6px 12px; border-radius: 8px; background: var(--surface2); }
.timer.low { background: var(--bad-bg); color: var(--bad); }
.navgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.navgrid button { height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: .8rem; font-weight: 600; cursor: pointer; }
.navgrid button.ans { background: var(--navy2); color: #fff; border-color: var(--navy2); }
.navgrid button.flag { box-shadow: inset 0 -3px 0 var(--gold); }
.navgrid button.cur { outline: 2px solid var(--gold); outline-offset: 1px; }
.navgrid button.right { background: var(--good); color: #fff; border-color: var(--good); } .navgrid button.wrong { background: var(--bad); color: #fff; border-color: var(--bad); }
.examlayout { display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: start; }
.examlayout aside { position: sticky; top: 16px; }
@media (max-width: 900px) { .examlayout { grid-template-columns: 1fr; } .examlayout aside { position: static; order: 2; } }
.kbd { font: 600 .75rem var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; }

/* charts */
.spark { width: 100%; height: 160px; } .spark path.line { fill: none; stroke: var(--navy2); stroke-width: 2.5; } .spark path.area { fill: color-mix(in srgb, var(--navy2) 12%, transparent); }
.spark line.goal { stroke: var(--gold); stroke-dasharray: 5 4; stroke-width: 1.5; } .spark text { fill: var(--muted); font: 11px var(--font); } .spark circle { fill: var(--navy2); }
.cal { display: grid; grid-template-rows: repeat(7, 12px); grid-auto-flow: column; grid-auto-columns: 12px; gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.cal i { width: 12px; height: 12px; border-radius: 3px; background: var(--surface2); display: block; }
.cal i.l1 { background: color-mix(in srgb, var(--good) 30%, var(--surface2)); } .cal i.l2 { background: color-mix(in srgb, var(--good) 55%, var(--surface2)); } .cal i.l3 { background: color-mix(in srgb, var(--good) 80%, var(--surface2)); } .cal i.l4 { background: var(--good); }
table.list { width: 100%; border-collapse: collapse; font-size: .93rem; } table.list th, table.list td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; } table.list th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.plan-day { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.plan-day.today { background: var(--gold-soft); margin: 0 -20px; padding: 12px 20px; border-radius: 10px; border-bottom: 0; }
@media (max-width: 600px) { .plan-day { grid-template-columns: 1fr; gap: 6px; } }
.field { display: flex; flex-direction: column; gap: 6px; } .field label { font-weight: 600; font-size: .9rem; }
input[type=text], input[type=number], select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 42px; }
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 99; box-shadow: var(--shadow); }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.srcs li { margin-bottom: 6px; }
.fade-in { animation: fi .25s ease; } @keyframes fi { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .side, .tabbar, .mobilebar { display: none; } .app { display: block; } }
@media (max-width: 700px) { .qfoot > .tiny { display: none; } .qfoot { flex-wrap: nowrap; } .qhead { position: sticky; top: 56px; z-index: 5; background: var(--bg); padding: 6px 0; } }

/* ---------- accounts & study groups ---------- */
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font: 700 13px var(--head); flex: none; vertical-align: middle; letter-spacing: .02em; }
.side .foot .chip { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.06); }
.side .foot .chip:hover { background: rgba(255,255,255,.12); }
.side .foot .chip b { display: block; font-size: 13px; }
.side .foot .chip .tiny, .side .foot .chip a { color: #C9D3E6; display: block; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 15% 8%, rgba(252,209,22,.22), transparent 38%), radial-gradient(circle at 90% 95%, rgba(206,17,38,.10), transparent 40%), radial-gradient(circle at 85% 5%, rgba(0,56,168,.12), transparent 40%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { padding: 0; } .auth-card .brand b { color: var(--ink); }
.auth-card input[type=text], .auth-card input[type=password] { width: 100%; }
.seg.scrollx { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .seg.scrollx::-webkit-scrollbar { display: none; } .seg.scrollx button { white-space: nowrap; }
.snap { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.snap > div { background: var(--surface2); border-radius: 12px; padding: 12px; }
.snap b { display: block; font: 700 1.35rem var(--head); } .snap span { font-size: .8rem; color: var(--muted); }
.lb { display: flex; flex-direction: column; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--line); border-radius: 10px; }
.lb-row:last-child { border-bottom: 0; }
.lb-row.me, tr.me td { background: var(--gold-soft); }
.lb-rank { width: 30px; text-align: center; font-size: 1.3rem; flex: none; }
.lb-rank .rk { font: 700 .95rem var(--head); color: var(--muted); }
.lb-name { flex: 1; min-width: 0; } .lb-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.lb-val { font: 700 1.05rem var(--head); white-space: nowrap; }
.lb.compact .lb-row { padding: 6px 8px; gap: 10px; } .lb.compact .lb-rank { font-size: 1.05rem; } .lb.compact .lb-val { font-size: .95rem; }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-top: 6px; }
.vs > div { height: 10px; background: var(--surface2); border-radius: 6px; overflow: hidden; display: flex; }
.vs-l { justify-content: flex-end; } .vs-l i { background: var(--navy2); } .vs-r i { background: var(--gold) !important; }
.vs i { display: block; height: 100%; border-radius: 6px; }
.mini { background: var(--surface2); border-radius: 12px; padding: 10px 12px; }
.chal { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.chal.ended { opacity: .75; }
table.tt td, table.tt th { text-align: center; padding: 6px 4px; } table.tt td:first-child, table.tt th:first-child { text-align: left; }
table.tt td.best { background: var(--good-bg); color: var(--good); font-weight: 700; border-radius: 6px; }
.feed { height: min(58vh, 520px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 85%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { background: var(--surface2); border-radius: 14px 14px 14px 4px; padding: 8px 12px; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.mine .bubble { background: var(--navy2); color: #fff; border-radius: 14px 14px 4px 14px; } .msg.mine .bubble .muted { color: rgba(255,255,255,.7); }
:root[data-theme="dark"] .msg.mine .bubble { color: #0F1522; } :root[data-theme="dark"] .msg.mine .bubble .muted { color: rgba(15,21,34,.7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg.mine .bubble { color: #0F1522; } :root:not([data-theme="light"]) .msg.mine .bubble .muted { color: rgba(15,21,34,.7); } }
.bubble b { display: block; color: var(--accent); }
.evt { text-align: center; font-size: .8rem; color: var(--muted); } .evt span { background: var(--surface2); padding: 4px 10px; border-radius: 999px; display: inline-block; }
input[type=password] { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 42px; }
.main { min-width: 0; } .card { min-width: 0; }
.seg.scrollx { display: flex; width: max-content; }
@media (max-width: 700px) { .topbar .row .btn { padding: 8px 12px; } .feed { height: 52vh; } }
.grid > * { min-width: 0; } .field input, .field select { width: 100%; min-width: 0; max-width: 100%; }

/* ---------- answer comparison ---------- */
.cmpgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
@media (max-width: 700px) { .cmpgrid { grid-template-columns: 1fr; } }
.cmp { border-radius: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-left-width: 4px; font-weight: 400; }
.cmp.mine { border-left-color: var(--bad); } .cmp.right { border-left-color: var(--good); }
.cmp-h { font: 700 .78rem var(--head); letter-spacing: .04em; text-transform: uppercase; }
.cmp.mine .cmp-h { color: var(--bad); } .cmp.right .cmp-h { color: var(--good); }
.cmp-c { margin: 6px 0; font-weight: 600; }
.cmp-w { font-size: .92rem; line-height: 1.5; }
.k.sm { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--surface2); font: 700 .72rem var(--head); vertical-align: 1px; margin-right: 2px; }
.otherwhy { margin-top: 10px; font-size: .9rem; } .otherwhy summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.otherwhy ul { margin: 8px 0 0; padding-left: 18px; } .otherwhy li { margin: 4px 0; }

/* ---------- presence ---------- */
.av-wrap { position: relative; display: inline-flex; flex: none; vertical-align: middle; }
.on-dot { position: absolute; right: -1px; bottom: -1px; width: 30%; height: 30%; min-width: 9px; min-height: 9px; max-width: 14px; max-height: 14px; border-radius: 50%; background: #31A24C; border: 2px solid var(--surface); box-sizing: border-box; }
.on-dot.inline { position: static; display: inline-block; width: 9px; height: 9px; min-width: 0; min-height: 0; border: 0; vertical-align: 0; }
.online-txt { color: #1E8E3E; font-weight: 600; } :root[data-theme="dark"] .online-txt { color: #52C28A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .online-txt { color: #52C28A; } }
.nav-badge { margin-left: auto; background: #E41E3F; color: #fff; font: 700 11px var(--font); border-radius: 999px; padding: 1px 7px; }
.mobilebar .nav-badge { position: absolute; top: -6px; right: -6px; margin: 0; }
.lb-chat { padding: 4px 8px; }
.fr-act { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
@media (max-width: 600px) { .lb-row:has(.fr-act) { flex-wrap: wrap; } .fr-act { width: 100%; justify-content: flex-start; padding-left: 46px; } }

/* ---------- messenger dock ---------- */
#msgr.hide { display: none; }
#m-launch { position: fixed; right: 22px; bottom: 22px; z-index: 60; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #0038A8, #1F5FD6); box-shadow: 0 6px 20px rgba(16,24,40,.28); display: grid; place-items: center; }
:root[data-theme="dark"] #m-launch { background: linear-gradient(135deg, #0038A8, #1F5FD6); }
#m-badge { position: absolute; top: -3px; right: -3px; background: #E41E3F; color: #fff; font: 700 12px var(--font); min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; padding: 0 6px; border: 2px solid var(--bg); }
#m-panel { position: fixed; right: 22px; bottom: 92px; z-index: 61; width: 340px; height: min(520px, calc(100vh - 120px)); background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 12px 40px rgba(16,24,40,.25); display: flex; flex-direction: column; overflow: hidden; }
#m-panel[hidden] { display: none; }
.m-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 6px; } .m-head b { font: 700 1.25rem var(--head); }
.m-ic { position: relative; border: 0; background: var(--surface2); color: var(--ink); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: inline-grid; place-items: center; font-size: 14px; text-decoration: none; }
.m-ic:hover { filter: brightness(.95); }
.m-count { display: inline-grid; place-items: center; background: #E41E3F; color: #fff; font: 700 10px var(--font); font-style: normal; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; }
.m-ic .m-count { position: absolute; top: -4px; right: -4px; }
.m-search { padding: 4px 12px 8px; } .m-search input { width: 100%; border-radius: 999px; background: var(--surface2); border: 0; min-height: 36px; }
.m-tabs { margin: 0 12px 6px; display: flex; } .m-tabs button { flex: 1; }
.m-list { overflow-y: auto; flex: 1; padding: 0 6px 8px; }
.m-sec { font: 700 .75rem var(--head); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 10px 4px; }
.m-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 8px; border-radius: 10px; cursor: pointer; text-align: left; color: var(--ink); font: inherit; }
.m-item:hover, .m-item.sel { background: var(--surface2); }
.m-it { flex: 1; min-width: 0; display: flex; flex-direction: column; } .m-it b { font-size: .95rem; } .m-it span { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-it span.unread { color: var(--ink); font-weight: 700; }
.m-meta { font-size: .72rem; color: var(--muted); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
#m-wins { position: fixed; right: 380px; bottom: 0; z-index: 59; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 10px; pointer-events: none; }
#msgr:not(.panel-open) #m-wins { right: 96px; }
.m-win { pointer-events: auto; width: 330px; height: 450px; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0; box-shadow: 0 8px 30px rgba(16,24,40,.22); display: flex; flex-direction: column; overflow: hidden; }
.m-win.min { height: 52px; width: 240px; } .m-win.min .m-msgs, .m-win.min .m-form { display: none; }
.m-whead { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 10px; border-bottom: 1px solid var(--line); min-height: 52px; }
.m-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; cursor: pointer; } .m-who b { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .m-who .tiny { color: var(--muted); }
.m-wbtn { display: flex; gap: 4px; } .m-wbtn .m-ic { width: 28px; height: 28px; background: transparent; }
.m-back { display: none; border: 0; background: transparent; font-size: 1.3rem; cursor: pointer; color: var(--accent); }
.m-msgs { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 3px; }
.m-row { display: flex; align-items: flex-end; gap: 6px; max-width: 88%; } .m-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.m-row.pending { opacity: .6; } .m-avsp { width: 26px; flex: none; }
.m-bub-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .m-row.mine .m-bub-wrap { align-items: flex-end; }
.m-bub { background: var(--surface2); padding: 8px 12px; border-radius: 18px; overflow-wrap: anywhere; font-size: .93rem; line-height: 1.4; }
.m-row.mine .m-bub { background: #0038A8; color: #fff; }
.m-time { text-align: center; font-size: .72rem; color: var(--muted); margin: 10px 0 4px; }
.m-hello { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.m-form { display: flex; align-items: flex-end; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.m-input { flex: 1; resize: none; border-radius: 18px; background: var(--surface2); border: 0; padding: 9px 14px; min-height: 38px; max-height: 110px; font: inherit; color: var(--ink); }
.m-send { border: 0; background: transparent; color: #0038A8; font-size: 1.3rem; cursor: pointer; width: 36px; height: 38px; }
.qshare { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--surface); max-width: 280px; font-size: .88rem; }
.qshare.invite { border-color: var(--gold); background: var(--gold-soft); }
.qs-q { margin: 6px 0; } .qs-q svg { max-width: 100%; height: auto; } .qs-q table { font-size: .8rem; }
.qs-c { margin: 0; padding-left: 0; list-style: none; } .qs-c li { padding: 3px 6px; border-radius: 6px; } .qs-c li.right { background: var(--good-bg); color: var(--good); font-weight: 600; }
.qs-ans { margin-top: 8px; padding: 8px; background: var(--good-bg); border-radius: 8px; }
.msg-toast { display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left; bottom: 92px; }
.modal-ov { position: fixed; inset: 0; z-index: 80; background: rgba(10,15,30,.45); display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.qs-prev { max-height: 120px; overflow: auto; background: var(--surface2); border-radius: 10px; padding: 8px 10px; margin-top: 10px; } .qs-prev svg { max-height: 100px; width: auto; }
.sh-list { max-height: 230px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
@media (max-width: 899px) {
  #m-launch { right: 16px; bottom: 80px; width: 52px; height: 52px; }
  #m-panel { inset: 0; width: auto; height: auto; border-radius: 0; bottom: 0; right: 0; z-index: 70; }
  #m-wins, #msgr:not(.panel-open) #m-wins { right: 0; left: 0; }
  .m-win { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; z-index: 71; }
  .m-win.min { display: none; }
  .m-back { display: block; }
  .msg-toast { bottom: 140px; }
}
#m-badge[hidden] { display: none; }
@media (max-width: 899px) { #msgr.panel-open #m-launch, #msgr.win-open #m-launch { display: none; } #m-wins { z-index: 71; } }

/* ---------- tab badge ---------- */
.tabbar a { position: relative; }
.tab-badge { position: absolute; top: 3px; left: 50%; margin-left: 6px; background: #E41E3F; color: #fff; font: 700 10px var(--font); min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--surface); }
.side .nav a .tab-badge { position: static; margin-left: auto; border: 0; }
@media (max-width: 380px) { .tabbar a { font-size: 10px; } .mobilebar .brand b { font-size: 13px; } }
@media (max-width: 899px) { .mobilebar .row { gap: 6px; } .mobilebar .row .btn.sm { padding: 6px 8px; } }

/* ---------- messages page & full-screen chat ---------- */
.ml-page { max-width: 720px; }
.ml-page input[type=search] { width: 100%; border-radius: 999px; background: var(--surface2); border: 0; min-height: 42px; padding: 0 16px; font: inherit; color: var(--ink); }
.ml-online { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; } .ml-online::-webkit-scrollbar { display: none; }
.ml-online a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--ink); font-size: .78rem; width: 62px; flex: none; }
.ml-online a span:last-child { max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-tabs { display: flex; margin-bottom: 6px; } .ml-tabs button { flex: 1; }
.ml-list { display: flex; flex-direction: column; }
.ml-item { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.ml-item:active, .ml-item:hover { background: var(--surface2); }
.ml-item .m-it b { font-size: 1rem; } .ml-item .m-it span { font-size: .86rem; }
.chat-page { position: fixed; left: 0; right: 0; top: 0; height: 100vh; height: 100dvh; z-index: 90; background: var(--surface); display: flex; flex-direction: column; }
body.in-chat .tabbar, body.in-chat .mobilebar, body.in-chat #m-launch { display: none !important; }
body.in-chat { overflow: hidden; }
.cp-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--surface); }
.cp-back { border: 0; background: transparent; color: var(--accent); font-size: 2rem; line-height: 1; width: 40px; height: 40px; cursor: pointer; flex: none; }
.cp-head .m-who { flex: 1; min-width: 0; cursor: default; } .cp-head .m-who b { font-size: 1rem; }
.cp-act { flex: none; }
.cp-msgs { flex: 1; padding: 12px 10px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.cp-msgs .m-row { max-width: 84%; } .cp-msgs .qshare { max-width: 100%; }
.cp-form { padding: 8px 10px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); background: var(--surface); }
.cp-form .m-input { font-size: 16px; } /* 16px stops iOS from zooming in */

/* ---------- notifications ---------- */
.n-card { padding: 6px; }
.n-list { display: flex; flex-direction: column; }
.n-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; text-align: left; padding: 10px; border-radius: 12px; cursor: pointer; color: var(--ink); font: inherit; }
.n-item:hover { background: var(--surface2); } .n-item.unread { background: rgba(59,111,216,.07); }
.n-ic { flex: none; } .n-emoji { width: 40px; height: 40px; border-radius: 50%; background: var(--surface2); display: grid; place-items: center; font-size: 1.2rem; }
.n-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .n-txt b { font-weight: 600; } .n-txt > span { font-size: .88rem; color: var(--muted); }
.n-item.unread .n-txt b { font-weight: 700; }
.n-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ph-red); flex: none; }
.news-list { display: flex; flex-direction: column; }
.news-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.news-item:last-child { border-bottom: 0; } .news-item .pill { flex: none; margin-top: 2px; }
.msg-toast .n-ic { font-size: 1.3rem; }
.msg-toast { width: min(92vw, 380px); font-weight: 400; } .msg-toast b { font-weight: 700; }

/* ---------- Philippine tricolor accents ---------- */
.side { box-shadow: inset -4px 0 0 0 transparent; background: linear-gradient(180deg, #0A2A6B 0%, #08214F 100%); }
.side::before, .mobilebar::after { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--ph-blue) 0 40%, var(--ph-yellow) 40% 60%, var(--ph-red) 60%); }
.side::before { margin: -22px -16px 16px; }

.mobilebar::after { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.mobilebar { background: linear-gradient(90deg, #0A2A6B, #0038A8); }
.nav-badge, .tab-badge, #m-badge, .m-count { background: var(--ph-red) !important; }
.progress i, .bar i { background: linear-gradient(90deg, var(--ph-blue), #1F5FD6); }
.timer.low { color: var(--ph-red); }
.card.hero .btn.gold { box-shadow: 0 4px 14px rgba(252,209,22,.35); }
:root[data-theme="dark"] .nav a.on { background: rgba(252,209,22,.12); }
.people-tabs { display: flex; width: 100%; max-width: 420px; margin-bottom: 16px; }
.people-tabs a { flex: 1; text-align: center; text-decoration: none; padding: 9px 12px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.people-tabs a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
/* floating messenger on phones: sits above the bottom navigation bar */
@media (max-width: 899px) {
  #m-launch { right: 16px; bottom: calc(70px + env(safe-area-inset-bottom)); width: 54px; height: 54px; z-index: 29; }
  #m-panel, #m-wins { display: none !important; }
  .msg-toast { bottom: calc(136px + env(safe-area-inset-bottom)); }
  .main { padding-bottom: 150px; }
}
.mobilebar .btn.on { background: rgba(252,209,22,.22) !important; color: #fff !important; border-color: var(--ph-yellow) !important; }

/* ---------- forms lesson ---------- */
.form-ex .ex, .lesson .ex { display: inline-block; font-family: var(--mono); font-size: .86rem; background: #FFFBE6; color: #0A2A6B; border: 1px dashed #D8B800; padding: 1px 6px; border-radius: 4px; margin: 2px 0; }
:root[data-theme="dark"] .lesson .ex { background: #2A2410; color: #FCD116; }
.sheet-demo { overflow-x: auto; padding: 8px 0; }
.sheet-svg .sh-box { fill: var(--surface); stroke: var(--ink); stroke-width: 1; }
.sheet-svg .sh-digit { font: 700 13px var(--mono); fill: var(--ink); }
.sheet-svg .sh-lbl { font: 600 11px var(--font); fill: var(--muted); }
.sh-off { fill: none; stroke: var(--muted); stroke-width: 1.2; }
.sh-on, .sh-inkfill { fill: #111; stroke: #111; }
:root[data-theme="dark"] .sh-on, :root[data-theme="dark"] .sh-inkfill { fill: #E7EAF0; stroke: #E7EAF0; }
.sh-ink { fill: none; stroke: #111; stroke-width: 2.2; stroke-linecap: round; } :root[data-theme="dark"] .sh-ink { stroke: #E7EAF0; }
.mark-demo { display: flex; flex-wrap: wrap; gap: 24px; margin: 10px 0 16px; } .mark-demo > div { display: flex; flex-direction: column; gap: 4px; }
.bad-txt { color: var(--bad); } .good-txt { color: var(--good); }

/* ---------- v8: reactions & shared files ---------- */
.m-att { border: 0; background: transparent; font-size: 1.15rem; width: 32px; height: 38px; cursor: pointer; flex: none; border-radius: 50%; padding: 0; }
.m-att:hover { background: var(--surface2); }
.m-row { position: relative; }
.m-react-btn { align-self: center; flex: none; border: 0; background: transparent; color: var(--muted); font-size: 1.05rem; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; opacity: 0; transition: opacity .12s; padding: 0; }
.m-row:hover .m-react-btn, .m-react-btn:focus-visible { opacity: 1; } .m-react-btn:hover { background: var(--surface2); }
@media (hover: none) { .m-react-btn { opacity: .45; } }
.m-bub-wrap { position: relative; }
.m-rx { align-self: flex-start; margin-top: -10px; margin-left: 8px; display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; font-size: .82rem; line-height: 1.35; box-shadow: 0 1px 3px rgba(16,24,40,.15); cursor: pointer; position: relative; z-index: 1; color: var(--ink); }
.m-row.mine .m-rx { align-self: flex-end; margin-left: 0; margin-right: 8px; }
.m-rx span { font-size: .72rem; color: var(--muted); margin-left: 2px; font-weight: 600; }
.m-rx.own { border-color: #0038A8; background: #EAF0FF; } :root[data-theme="dark"] .m-rx.own { background: #1B2B55; }
.rx-picker { position: fixed; z-index: 95; display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px; box-shadow: 0 8px 26px rgba(16,24,40,.25); animation: rxpop .14s ease-out; }
.rx-picker button { border: 0; background: transparent; font-size: 1.6rem; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; transition: transform .1s; padding: 0; }
.rx-picker button:hover { transform: scale(1.25) translateY(-3px); } .rx-picker button.on { background: var(--surface2); }
@keyframes rxpop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.m-imgwrap { display: block; max-width: 240px; border-radius: 16px; overflow: hidden; background: var(--surface2); line-height: 0; }
.m-img { display: block; width: 100%; max-width: 240px; max-height: 320px; object-fit: cover; height: auto; }
.m-exp { font-size: .7rem; }
.m-file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--surface2); color: var(--ink); text-decoration: none; max-width: 250px; font-size: .88rem; overflow-wrap: anywhere; }
.m-file .m-fi { font-size: 1.5rem; flex: none; } .m-file b { font-size: .9rem; font-weight: 600; } .m-exp + .m-rx { margin-top: 0; }
.m-row.mine .m-file { background: #0038A8; color: #fff; } .m-row.mine .m-file .muted { color: #D6E0FF; }
.m-file.expired { flex-wrap: wrap; opacity: .75; background: var(--surface2) !important; color: var(--muted) !important; border: 1px dashed var(--line); }
.m-prog { width: 160px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; } .m-prog i { display: block; height: 100%; background: #0038A8; transition: width .15s; }
.m-row.failed .m-bub, .m-row.failed .m-file { outline: 1px solid var(--bad); }
@media (max-width: 899px) { .m-imgwrap, .m-img { max-width: 62vw; } }
@media (max-width: 640px) {
  .form-ex, .form-ex tbody, .form-ex tr, .form-ex th, .form-ex td { display: block; width: 100%; }
  .form-ex th { white-space: normal; border-bottom: 0; padding-bottom: 4px; } .form-ex td { padding-top: 4px; }
  .facts th { white-space: normal; }
}
