/* Elective -- one stylesheet for every page */
:root {
  --ground: #f7f6f3; --surface: #ffffff; --ink: #1d1d1f; --muted: #5f5f66; --soft: #45454b;
  --line: #e6e4df; --line2: #efeee9; --chip: #f2f1ec;
  --accent: #7a3b69; --accent-ink: #3d1f35; --accent-bg: #f4eaf1;
  --blue: #1f5f8b; --blue-bg: #e8f1f8; --green: #2f6b3d; --green-bg: #eef5ef;
  --amber: #7a5200; --amber-bg: #fbf1df; --grey-bg: #efeee9; --gold: #b7791f;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink);
  font-family: 'Anuphan', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 16px; }
a { color: var(--accent); } a:hover { color: #5c2a4f; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
.wait { display: flex; align-items: center; justify-content: center; min-height: 100vh; color: var(--muted); font-size: 14px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top.dark { background: #1d1d1f; color: #fff; border-bottom: none; }
.top-in { max-width: 1280px; margin: 0 auto; padding: 12px 20px; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand b { font-size: 22px; font-weight: 700; color: inherit; text-decoration: none; }
/* PRISM: mark, word, and the full name that unfolds from it */
.brand { align-items: center; }
.brand .prism-id { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); }
.prism-home { display: inline-flex; }
.prism-mark { width: 30px; height: 30px; border-radius: 22%; display: block; }
.brand .prism-brand { font-size: 21px; color: var(--ink); font-weight: 700; letter-spacing: .08em; cursor: pointer; outline: none;
  display: inline-flex; align-items: center; margin-left: -2px; white-space: nowrap; }
.brand .prism-brand:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 6px; }
.brand .prism-full { display: inline-block; max-width: 0; opacity: 0; overflow: hidden; vertical-align: middle;
  white-space: nowrap; margin-left: 0; font-size: 11px; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
  transition: max-width .7s cubic-bezier(.2,.7,.2,1), opacity .5s ease .12s, margin-left .7s cubic-bezier(.2,.7,.2,1); }
.brand .prism-full::before { content: '\00b7'; margin-right: .7em; letter-spacing: 0; color: #c4c4c8; }
.brand .prism-brand:hover .prism-full, .brand .prism-brand:focus .prism-full, .brand .prism-brand.open .prism-full {
  max-width: 640px; opacity: 1; margin-left: 10px; }
@media (max-width: 700px) { .brand .prism-brand:hover .prism-full, .brand .prism-brand:focus .prism-full, .brand .prism-brand.open .prism-full {
  max-width: 60vw; white-space: normal; letter-spacing: .08em; line-height: 1.35; } }
.top.dark .brand .prism-brand { color: #fff; }
.top.dark .brand .prism-full { color: #d4d2cc; }
.brand .tag-staff { color: #fff; }
@media (prefers-reduced-motion: reduce) { .brand .prism-full { transition: none; } }
.prism-title { display: flex; align-items: center; gap: 12px; letter-spacing: .08em; margin: 0; }
.prism-title .prism-mark { width: 40px; height: 40px; }
.prism-sub { margin: -6px 0 0; font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); line-height: 1.6; }
.brand span { font-size: 15px; color: var(--muted); }
.top.dark .brand span, .top.dark .who { color: #d4d2cc; }
.who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.pill-btn { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 999px; background: #fafaf8; color: var(--ink); text-decoration: none; font-size: 14px; }
.top.dark .pill-btn { background: transparent; border-color: #4a4a50; color: #fff; }
.tag-staff { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #1d1d1f; color: #fff; }

main { max-width: 1120px; margin: 0 auto; padding: 24px 20px 64px; display: flex; flex-direction: column; gap: 22px; }
main.narrow { max-width: 880px; }
main.wide { max-width: 1240px; }
h1 { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.3; }
h2 { margin: 0; font-size: 21px; font-weight: 700; }
.muted { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.pad { padding: 18px 20px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-weight: 600; font-size: 14px;
  background: var(--chip); border-radius: 8px; padding: 5px 9px; min-width: 52px; text-align: center; display: inline-block; }
.chip { font-size: 13px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.c-todo { background: var(--grey-bg); color: var(--soft); }
.c-done { background: var(--blue-bg); color: var(--blue); }
.c-part { background: var(--blue-bg); color: var(--blue); }
.c-open { background: var(--accent-bg); color: var(--accent); }
.c-ready { background: var(--green-bg); color: var(--green); }
.c-soon { background: var(--amber-bg); color: var(--amber); }
.c-kind { background: var(--grey-bg); color: var(--soft); }
.c-unknown { background: var(--amber-bg); color: var(--amber); }
.b-strong { font-weight: 600; }

.intro { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.stat { border-radius: 12px; padding: 10px 16px; min-width: 110px; }
.stat b { display: block; font-size: 24px; }
.stat span { font-size: 13px; }

.list { overflow: hidden; }
.item { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line2);
  text-decoration: none; color: var(--ink); }
.item:first-child { border-top: none; }
.item:hover { background: #fcfbf9; color: var(--ink); }
.item .t { flex: 1 1 300px; display: flex; flex-direction: column; gap: 2px; }
.item .t b { font-weight: 500; font-size: 16px; }
.item .t span { font-size: 13px; color: var(--muted); }
.study { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; align-items: baseline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid #d9d7d0; background: var(--surface); color: var(--ink);
  text-decoration: none; font-size: 15px; font-weight: 600; }
.btn:hover { color: var(--ink); background: #fbfaf8; }
.btn.dark { background: #1d1d1f; color: #fff; border-color: #1d1d1f; }
.btn.dark:hover { background: #333; color: #fff; }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.accent:hover { background: #6a3159; color: #fff; }
.btn.big { min-height: 56px; padding: 0 30px; font-size: 18px; border-radius: 14px; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn[disabled], .btn.off { opacity: .45; pointer-events: none; }
.btn svg { flex-shrink: 0; }

.slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.clue { background: var(--accent-bg); border-radius: 16px; padding: 16px 20px; display: flex; gap: 12px; }
.clue b { font-size: 14px; color: var(--accent); }
.clue p, .note p { margin: 4px 0 0; line-height: 1.65; color: var(--accent-ink); white-space: pre-line; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; }
.note p { color: var(--ink); }
.q { display: flex; flex-direction: column; gap: 10px; }
.q label { font-weight: 600; line-height: 1.6; white-space: pre-line; }
textarea, input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%; padding: 11px 13px; border: 1px solid #d9d7d0; border-radius: 12px; background: #fcfcfa; line-height: 1.6; }
textarea { resize: vertical; min-height: 92px; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea[readonly] { background: #f6f5f1; color: var(--soft); }
.saved { font-size: 14px; color: var(--green); }
.saved.bad { color: #a12b2b; }
.lockbox { border: 1px dashed #cfccc3; background: var(--surface); border-radius: 16px; padding: 14px 18px;
  display: flex; gap: 12px; align-items: center; color: var(--soft); line-height: 1.6; }
.key { background: var(--accent-bg); border-radius: 18px; padding: 20px 24px; }
.key b { color: var(--accent); font-size: 14px; }
.key p { margin: 8px 0 0; font-size: 17px; line-height: 1.7; color: var(--accent-ink); white-space: pre-line; }
.answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ans { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.ans.mine { border-color: var(--blue); }
.ans.star { border: 2px solid var(--gold); }
.ans header { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; }
.ans p { margin: 0; line-height: 1.7; white-space: pre-line; }
.star-btn { width: 42px; height: 42px; border: none; border-radius: 10px; background: var(--ground);
  display: inline-flex; align-items: center; justify-content: center; }
.teach .ans p { font-size: 17px; }
.teach h1 { font-size: 34px; }
.qhead { font-size: 18px; font-weight: 600; line-height: 1.6; white-space: pre-line; }
.empty { text-align: center; padding: 44px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.empty .big { font-size: 26px; font-weight: 600; }
.nav2 { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { padding: 10px 12px; border-bottom: 1px solid var(--line2); text-align: left; vertical-align: middle; }
table.grid th { background: #fafaf8; color: var(--soft); font-weight: 600; position: sticky; top: 0; }
table.grid td.n, table.grid th.n { text-align: center; }
.cnt { display: inline-block; min-width: 46px; padding: 3px 9px; border-radius: 999px; font-weight: 600; font-size: 13px; text-align: center; }
.cnt.full { background: var(--blue); color: #fff; }
.cnt.part { background: var(--blue-bg); color: var(--blue); }
.cnt.none { background: var(--grey-bg); color: var(--muted); }
.scroll { overflow-x: auto; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form .full { grid-column: 1 / -1; }
.form label span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.msg { padding: 12px 16px; border-radius: 12px; background: var(--amber-bg); color: var(--amber); }
.msg.ok { background: var(--green-bg); color: var(--green); }
.login { max-width: 400px; margin: 10vh auto; padding: 28px; }
.login h1 { font-size: 26px; }

@media (max-width: 640px) {
  h1 { font-size: 25px; }
  .teach h1 { font-size: 26px; }
  main { padding: 18px 14px 48px; }
  .form { grid-template-columns: minmax(0, 1fr); }
  .item { padding: 12px 14px; }
}

/* ---- the list: side menu, cards ---- */
.with-side { max-width: 1280px; margin: 0 auto; padding: 22px 20px 64px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.side { flex: 1 1 220px; max-width: 260px; position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
.side-h { font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 10px; }
.side a { display: flex; flex-direction: column; gap: 6px; padding: 9px 11px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.side a:hover { background: var(--accent-bg); color: var(--ink); }
.side-row { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; font-weight: 500; }
.side-row .muted { font-size: 13px; }
.bar { display: block; height: 6px; border-radius: 3px; background: var(--grey-bg); overflow: hidden; }
.bar > span { display: block; height: 6px; border-radius: 3px; background: var(--accent); }
main.flow { flex: 999 1 640px; min-width: 0; max-width: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.resume { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 16px; border-radius: 18px; }
.resume img { width: 168px; height: 112px; object-fit: contain; background: #fff; border: 1px solid var(--line2); border-radius: 12px; }
.kicker { font-size: 13px; font-weight: 600; color: var(--accent); }
.privacy { display: flex; gap: 10px; align-items: center; margin: 0; font-size: 14px; line-height: 1.6; }
.privacy svg { width: 18px; height: 18px; }
details.sec { display: flex; flex-direction: column; gap: 12px; }
details.sec > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 4px 2px; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec[data-done]:not([open]) > summary { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; align-items: center; }
.sec-name { font-size: 24px; font-weight: 700; }
details.sec[data-done]:not([open]) .sec-name { font-size: 18px; }
.sec-count { font-size: 14px; }
.toggle { margin-left: auto; font-size: 14px; }
.tick { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; align-self: center; }
details.sec > .study, details.sec > .cards { margin-top: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.ccard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.ccard:hover { color: var(--ink); box-shadow: 0 6px 20px rgba(0,0,0,.08); transform: translateY(-1px); }
.thumb { position: relative; display: block; background: #fff; border-bottom: 1px solid var(--line2); height: 128px; }
.thumb img { display: block; width: 100%; height: 128px; object-fit: contain; padding: 8px; }
.nothumb { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--amber); background: var(--amber-bg); font-size: 13px; }
.ov-code { position: absolute; top: 8px; left: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; }
.ov-st { position: absolute; top: 8px; right: 8px; font-size: 12px; }
.cbody { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.cbody b { font-size: 15px; font-weight: 600; line-height: 1.45; }
.cbody span { font-size: 13px; color: var(--muted); }
.ov-st.c-done { background: var(--blue); color: #fff; }
.ov-st.c-open { background: var(--accent); color: #fff; }

/* ---- one case: two columns ---- */
.casebar { background: var(--surface); border-bottom: 1px solid var(--line); }
.casebar-in { max-width: 1280px; margin: 0 auto; padding: 8px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.split { max-width: 1280px; margin: 0 auto; padding: 22px 20px 64px; display: flex; flex-wrap: wrap; gap: 26px; align-items: flex-start; }
.split-l { flex: 1 1 380px; max-width: 520px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.split-r { flex: 999 1 480px; min-width: 0; max-width: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.slidebox { overflow: hidden; border-radius: 18px; }
.bigthumb { display: block; background: #fff; }
.bigthumb img { display: block; width: 100%; height: 260px; object-fit: contain; padding: 14px; }
.bigthumb.nothumb { height: 160px; display: flex; align-items: center; justify-content: center; }
.strip { display: flex; gap: 8px; padding: 0 14px 10px; overflow-x: auto; }
.strip a { flex: 0 0 72px; height: 52px; border: 1px solid var(--line2); border-radius: 8px; background: #fff; }
.strip img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.slidefoot { border-top: 1px solid var(--line2); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.btn.wide { width: 100%; }
.q label { display: flex; gap: 10px; align-items: flex-start; }
.num { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--grey-bg); color: var(--soft); font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.num.on { background: var(--blue); color: #fff; }
.q.todo { border: 2px solid var(--accent); }
.nav2 { padding-top: 8px; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .with-side { padding: 14px 14px 48px; gap: 14px; }
  .side { position: static; max-width: none; flex: 1 1 100%; flex-direction: row; overflow-x: auto; padding: 0; border: none; background: transparent; gap: 8px; }
  .side-h { display: none; }
  .side a { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
  .side a .bar { display: none; }
  .side-row { font-size: 14px; gap: 6px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .thumb, .thumb img { height: 96px; }
  .resume img { width: 92px; height: 64px; }
  .split { padding: 14px 14px 48px; }
  .split-l { position: static; max-width: none; }
  .bigthumb img { height: 200px; }
}
