/* Pink School · Reader — the approved design of 25 Oct 2026 (Main, Reading, Formulas, Phone boards). */
:root {
  --bg: #f4f1f3; --ink: #22161c; --muted: #5e4a54; --faint: #7a6570; --line: #e3d8dd; --line2: #efe7eb;
  --card: #ffffff; --head: #3f0d24; --head-ink: #fbf3f6; --head-soft: #e9c3d3; --head-line: #8a4a66;
  --rose: #9d174d; --rose-soft: #fbe7ef; --rose-mark: #e9a6c1; --drop: #c98aa4;
  --ok-bg: #def2e7; --ok: #1c6b43; --warn-bg: #fbead3; --warn: #8a4a06; --warn-box: #fdf4e6; --warn-line: #c98a3a;
  --bad-bg: #fbe2df; --bad: #a12a20; --run: #2c4a8a; --bar: #2f6fed; --track: #ece4e8; --code: #f7f3f5;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', 'IBM Plex Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
html[lang="th"] { --sans: 'IBM Plex Sans Thai', 'IBM Plex Sans', system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: var(--rose); } a:hover { color: var(--head); }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
.boot { padding: 40px 16px; color: var(--faint); font-family: var(--mono); text-align: center; }
.mono { font-family: var(--mono); }

/* header */
header.top { background: var(--head); color: var(--head-ink); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 14px 24px; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.mark { width: 30px; height: 30px; border-radius: 7px; background: var(--rose-mark); color: var(--head); display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex: 0 0 auto; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 16px; }
.brand-host { font-family: var(--mono); font-size: 12px; color: var(--head-soft); }
.top-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lang { display: flex; border: 1px solid var(--head-line); border-radius: 6px; overflow: hidden; }
.lang button { background: transparent; color: var(--head-ink); border: 0; padding: 6px 12px; font-size: 13px; min-height: 32px; }
.lang button.on { background: var(--head-ink); color: var(--head); font-weight: 600; }
.who { display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--rose); display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 600; }
.signout { color: var(--head-soft); font-size: 13px; background: none; border: 0; padding: 4px 0; text-decoration: underline; }
.back { color: var(--head-soft); font-size: 14px; }
.back:hover { color: #fff; }

main.wrap { max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; display: flex; flex-direction: column; gap: 24px; }
main.wide { max-width: 1180px; padding-top: 24px; gap: 18px; }
h1 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 700; }
.lede { margin: 0; color: var(--muted); max-width: 64ch; }
.head-block { display: flex; flex-direction: column; gap: 6px; }

/* sign in */
.signin { max-width: 400px; margin: 48px auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.signin h1 { font-size: 24px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
label.f input { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #d9cdd3; border-radius: 8px;
  background: #fff; color: var(--ink); min-height: 44px; }
label.f input:focus { outline: 2px solid var(--rose); outline-offset: 1px; }
.btn { background: var(--rose); color: #fff; border: 0; border-radius: 8px; padding: 12px 20px; font-weight: 600;
  font-size: 15px; min-height: 44px; }
.btn:hover { background: #831340; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid #d9cdd3; font-weight: 400; }
.btn.soft { background: var(--rose-soft); color: var(--rose); text-decoration: none; display: inline-block; text-align: center;
  padding: 9px 14px; font-size: 14px; min-height: 0; }
.btn.soft:hover { background: #f6d3e1; }
.err { color: var(--bad); font-size: 14px; margin: 0; }

/* drop zone */
.drop { border: 2px dashed var(--drop); background: var(--card); border-radius: 12px; padding: 28px 24px; display: flex;
  flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.drop.over { background: var(--rose-soft); border-color: var(--rose); }
.drop-l { display: flex; align-items: center; gap: 16px; min-width: 0; }
.drop-ico { width: 52px; height: 52px; border-radius: 12px; background: var(--rose-soft); display: flex; align-items: center;
  justify-content: center; flex: 0 0 auto; }
.drop-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.drop-t b { font-weight: 600; font-size: 17px; }
.drop-t span { color: var(--muted); font-size: 14px; }
.upbar { display: flex; flex-direction: column; gap: 6px; width: 100%; }

/* banners and meter */
.banner { border-radius: 10px; padding: 12px 16px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start;
  justify-content: space-between; }
.banner.warn { background: var(--warn-box); border: 1px dashed var(--warn-line); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner button { background: none; border: 0; color: inherit; font-size: 18px; line-height: 1; padding: 0 4px; }
.meter { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; display: flex;
  flex-wrap: wrap; gap: 8px 24px; align-items: center; font-size: 14px; color: var(--muted); }
.meter b { color: var(--ink); font-weight: 600; }
.meter .m { display: flex; flex-direction: column; gap: 4px; min-width: 180px; flex: 1 1 180px; }
.track { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--bar); border-radius: 4px; }
.track.rose i { background: var(--rose); }
.track.full i { background: var(--bad); }

/* document list */
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.list-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.table { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(0, 2.4fr) 70px minmax(0, 2fr) 120px 110px; gap: 16px; padding: 16px 20px;
  align-items: center; border-bottom: 1px solid var(--line2); }
.row:last-child { border-bottom: 0; }
.row.th { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint);
  padding: 12px 20px; border-bottom: 1px solid var(--line); }
.doc-name { display: flex; flex-direction: column; min-width: 0; }
.doc-name b { font-weight: 600; overflow-wrap: anywhere; }
.doc-name span { color: var(--faint); font-size: 13px; }
.st { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st small { font-size: 13px; color: var(--muted); }
.when { color: var(--muted); font-size: 14px; }
.lbl { display: none; }
.pill { align-self: flex-start; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.run { background: #eef2fd; color: var(--run); }
.running { font-size: 13px; color: var(--run); font-weight: 600; }
.empty { padding: 28px 20px; color: var(--faint); text-align: center; }
.foot { margin: 0; color: var(--faint); font-size: 13px; }
.dim { color: #a8949e; font-size: 14px; text-align: center; }

/* document view */
.doc-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.doc-top .t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.doc-top h1 { font-size: 26px; line-height: 1.2; overflow-wrap: anywhere; }
.sub { font-family: var(--mono); font-size: 12px; color: var(--faint); }
nav.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); }
nav.tabs button { background: none; border: 0; padding: 10px 14px; color: var(--muted); border-bottom: 3px solid transparent;
  margin-bottom: -1px; }
nav.tabs button.on { font-weight: 600; color: var(--rose); border-bottom-color: var(--rose); }
nav.tabs button:disabled { color: #b3a3ab; }
nav.tabs button .soon { display: block; font-size: 11px; font-weight: 400; color: #a8949e; }
.cols { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
aside.pages { flex: 1 1 150px; max-width: 170px; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; display: flex; flex-direction: column; gap: 2px; max-height: 70vh; overflow-y: auto; position: sticky; top: 12px; }
aside.pages .cap { font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--faint); padding: 4px 6px; }
aside.pages button { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: 6px; color: var(--ink);
  font-size: 14px; background: none; border: 0; text-align: left; }
aside.pages button.on { background: var(--rose-soft); color: var(--rose); font-weight: 600; }
aside.pages .key { font-size: 12px; color: var(--faint); padding: 6px 8px; }
.dot-ok { color: var(--ok); } .dot-warn { color: #a2580b; } .dot-bad { color: var(--bad); }
.pagepick { display: none; }
section.img { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
section.img img { width: 100%; height: auto; background: #fff; border: 1px solid #d9cdd3; border-radius: 6px;
  box-shadow: 0 1px 2px rgba(63, 13, 36, 0.08); display: block; }
section.img .ph { aspect-ratio: 4 / 3; background: #fff; border: 1px solid #d9cdd3; border-radius: 6px; display: flex;
  align-items: center; justify-content: center; color: #9a9a9a; font-size: 13px; }
section.read { flex: 999 1 420px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.read-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.pill.sm { font-size: 12.5px; white-space: normal; }
.md { display: flex; flex-direction: column; gap: 10px; overflow-wrap: anywhere; }
.md h3 { margin: 0; font-size: 19px; font-weight: 700; } .md h4 { margin: 0; font-size: 16px; font-weight: 700; }
.md p { margin: 0; }
.md ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.md .fig { color: var(--faint); font-style: italic; font-size: 14px; }
.fbox { background: var(--code); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.fbox .cap { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.fbox .tex { overflow-x: auto; overflow-y: hidden; }
.fbox code { font-family: var(--mono); font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.tbl { overflow-x: auto; }
.tbl table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.tbl th { background: var(--code); font-weight: 600; }
.unread { border: 1px dashed var(--warn-line); background: var(--warn-box); border-radius: 8px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px; }
.unread b { color: var(--warn); font-size: 14px; }
.unread span { font-size: 14px; color: var(--muted); }
.unread-inline { background: var(--warn-bg); color: var(--warn); border-radius: 4px; padding: 0 4px; font-size: 13px; }
.note { font-size: 13px; color: var(--warn); background: var(--warn-box); border-radius: 6px; padding: 6px 10px; }
pre.raw { white-space: pre-wrap; font-family: var(--mono); font-size: 13px; background: var(--code); border-radius: 8px;
  padding: 10px 12px; margin: 0; overflow-wrap: anywhere; }
.nav2 { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.linkbtn { background: none; border: 0; color: var(--rose); padding: 0; text-decoration: underline; font-size: 13px; align-self: flex-start; }
.progress { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex;
  flex-direction: column; gap: 8px; }
.soonbox { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; color: var(--muted); }
.dl { display: flex; flex-direction: column; gap: 10px; }
.dl a.item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex;
  justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.dl a.item:hover { border-color: var(--rose); }
.dl a.item span { display: flex; flex-direction: column; }
.dl a.item small { color: var(--faint); font-size: 13px; }
.dl a.item em { font-style: normal; color: var(--rose); font-weight: 600; white-space: nowrap; }

/* phone */
@media (max-width: 760px) {
  .top-in { padding: 14px 16px; }
  .brand-host, .who .name { display: none; }
  main.wrap, main.wide { padding: 18px 16px 40px; gap: 14px; }
  h1 { font-size: 22px; line-height: 1.25; }
  .doc-top h1 { font-size: 20px; }
  .lede { font-size: 14px; }
  .drop { padding: 16px; border-style: solid; border-width: 1px; border-color: var(--line); }
  .drop .drop-l { display: none; }
  .drop .btn { width: 100%; font-size: 16px; min-height: 52px; border-radius: 10px; }
  .drop .phone-cap { display: block; }
  .row.th { display: none; }
  .table { background: transparent; border: 0; display: flex; flex-direction: column; gap: 10px; }
  .row { grid-template-columns: 1fr auto; grid-template-areas: "name name" "st st" "when act"; background: var(--card);
    border: 1px solid var(--line); border-radius: 12px; padding: 14px; gap: 8px; }
  .row:last-child { border-bottom: 1px solid var(--line); }
  .row .doc-name { grid-area: name; } .row .st { grid-area: st; } .row .when { grid-area: when; align-self: center; }
  .row .act { grid-area: act; } .row .pg { display: none; }
  aside.pages { display: none; }
  .pagepick { display: flex; gap: 8px; align-items: center; }
  .pagepick select { font: inherit; font-size: 16px; padding: 8px 10px; border-radius: 8px; border: 1px solid #d9cdd3;
    background: #fff; flex: 1 1 auto; min-height: 44px; }
  section.read { padding: 14px; }
  nav.tabs { overflow-x: auto; flex-wrap: nowrap; }
  nav.tabs button { white-space: nowrap; }
}
.mob { display: none; }
@media (max-width: 760px) { .dsk { display: none; } .mob { display: inline; } }
.phone-cap { display: none; font-size: 13px; color: var(--muted); text-align: center; width: 100%; margin-top: -8px; }

/* the CFA assistant (Assistant, Review boards) */
nav.appnav { max-width: 1180px; margin: 0 auto; padding: 10px 24px 0; display: flex; gap: 6px; }
nav.appnav a { padding: 6px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 14px; }
nav.appnav a.on { background: var(--rose-soft); color: var(--rose); font-weight: 600; }
.head-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.head-row .meter { min-width: 260px; flex: 0 1 360px; }
.two { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.two > .card { flex: 1 1 380px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.card h2 { margin: 0; font-size: 17px; font-weight: 600; }
label.pick { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
label.pick:has(input:checked) { border-color: var(--rose); background: #fdf6f9; }
label.pick span { display: flex; flex-direction: column; min-width: 0; } label.pick b { overflow-wrap: anywhere; }
label.pick small, label.chk small { color: var(--faint); font-size: 13px; display: block; }
label.chk { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--rose); margin-top: 3px; flex: 0 0 auto; }
.sub { display: flex; flex-direction: column; gap: 8px; }
.selects { display: flex; flex-wrap: wrap; gap: 10px; padding-left: 28px; }
.selects label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.selects select, .card select { font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid #d9cdd3; border-radius: 8px; background: #fff; min-height: 40px; }
.langs { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; } .langs span { color: var(--muted); font-size: 14px; }
.langs label { display: flex; gap: 6px; align-items: center; }
.fmt { display: flex; flex-direction: column; gap: 4px; } .fmt-act { padding-left: 28px; }
.btn.wide { width: 100%; } .btn:disabled { opacity: 0.55; }
.row.set { grid-template-columns: minmax(0, 2.4fr) minmax(0, 2fr) 120px 110px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.cols2 { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.cols2 .items { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.cols2 .side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 12px; }
.item.held { background: var(--warn-box); border: 1px dashed var(--warn-line); }
.item.removed { opacity: 0.6; } .item.approved { border-color: #b9dfc9; }
.ihead { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.stem p, .stem { margin: 0; } .th { color: var(--muted); font-size: 14px; }
.opts { display: flex; flex-direction: column; gap: 6px; }
.opt { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fff; }
.opt.right { border: 2px solid var(--ok); background: #f1faf5; padding: 7px 11px; font-weight: 600; }
.work { background: var(--code); border-radius: 8px; padding: 10px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; } .acts .btn { padding: 8px 14px; min-height: 40px; font-size: 14px; }
.editor { display: flex; flex-direction: column; gap: 8px; }
.editor textarea, .editor input { font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid #d9cdd3; border-radius: 8px; background: #fff; width: 100%; }
.case { background: #f7f3f5; } .vars { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--muted); }
.fname h3, .fname p { margin: 0; font-weight: 600; }
.dlrow { display: flex; flex-direction: column; gap: 6px; } .dim2 { color: var(--faint); font-size: 13px; }
.note { margin: 0; font-size: 14px; color: var(--muted); }
@media (max-width: 760px) {
  nav.appnav { padding: 10px 16px 0; }
  .row.set { grid-template-columns: 1fr auto; grid-template-areas: "name name" "st st" "when act"; }
  .selects { padding-left: 0; } .fmt-act { padding-left: 0; }
  .cols2 .side { position: static; }
}
