/* ===== Tokens ===== */
:root {
  --bg: #fdf7f2;
  --bg-warm: #fdf2e9;          /* matches the illustration background */
  --surface: #ffffff;
  --band: #f8d3c3;
  --band-soft: #fde9df;
  --rose: #e9a9b8;
  --ink: #3f241b;
  --ink-soft: #7a5546;
  --accent: #b9573e;
  --accent-strong: #9a4330;
  --accent-ink: #ffffff;
  --line: #f1dccf;
  --ok: #3f7f4f;
  --warn: #b5651d;
  --err: #b23b3b;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(90, 45, 30, .05), 0 8px 28px rgba(120, 60, 40, .08);
  --shadow-hover: 0 2px 4px rgba(90, 45, 30, .06), 0 16px 40px rgba(120, 60, 40, .14);
  --maxw: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1512; --bg-warm: #241a16; --surface: #2a201b; --band: #5b3a2f; --band-soft: #392820; --rose: #8a5260;
    --ink: #f7e9df; --ink-soft: #d2b7a8; --accent: #ec9a7f; --accent-strong: #f4b39e; --accent-ink: #1c1512;
    --line: #463329; --shadow: 0 8px 24px rgba(0,0,0,.35); --shadow-hover: 0 14px 36px rgba(0,0,0,.45);
  }
}
:root[data-theme="dark"] {
  --bg: #1c1512; --bg-warm: #241a16; --surface: #2a201b; --band: #5b3a2f; --band-soft: #392820; --rose: #8a5260;
  --ink: #f7e9df; --ink-soft: #d2b7a8; --accent: #ec9a7f; --accent-strong: #f4b39e; --accent-ink: #1c1512;
  --line: #463329; --shadow: 0 8px 24px rgba(0,0,0,.35); --shadow-hover: 0 14px 36px rgba(0,0,0,.45);
}

/* ===== Base ===== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Sarabun", system-ui, sans-serif; font-size: 17px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: "Prompt", "Sarabun", sans-serif; line-height: 1.3; margin: 0 0 .5em; font-weight: 600; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.rounded { border-radius: var(--radius); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
main { max-width: var(--maxw); margin: 0 auto; padding: 8px 20px 0; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); margin-right: auto; min-width: 0; }
.brand img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.brand span { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-family: "Prompt", sans-serif; font-size: 1.02rem; font-weight: 600; line-height: 1.25; }
.brand small { color: var(--ink-soft); font-size: .8rem; line-height: 1.3; }
.brand:hover { color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 12px; border-radius: 999px; text-decoration: none;
  color: var(--ink); font-size: .94rem; white-space: nowrap; transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--band-soft); color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--accent); font-weight: 600; background: var(--band-soft); }
.nav-links a.cta { background: var(--accent); color: var(--accent-ink); font-weight: 600; padding: 8px 16px; margin-left: 6px; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.nav-links a.cta:hover { background: var(--accent-strong); }
.menu-btn {
  display: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 12px; padding: 7px 14px; font: inherit; cursor: pointer;
}
@media (max-width: 1120px) {
  .menu-btn { display: block; }
  .nav { flex-wrap: wrap; }
  .nav-links { display: none; width: 100%; flex-direction: column; align-items: stretch; padding: 6px 0 10px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 14px; border-radius: 12px; }
  .nav-links a.cta { margin: 6px 0 0; text-align: center; }
}
@media (max-width: 420px) { .brand small { display: none; } }

/* ===== Page hero (inner pages) ===== */
.page-hero {
  position: relative; overflow: hidden;
  background: radial-gradient(900px 260px at 90% -30%, var(--band) 0%, transparent 65%), var(--bg-warm);
  border-bottom: 1px solid var(--line);
}
.page-hero::after {
  content: ""; position: absolute; right: -70px; bottom: -150px; width: 340px; height: 340px; border-radius: 50%;
  border: 30px solid color-mix(in srgb, var(--rose) 26%, transparent); pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; padding-top: 38px; padding-bottom: 34px; }
.page-hero .crumb { font-size: .88rem; color: var(--ink-soft); margin-bottom: 4px; }
.page-hero .crumb a { color: inherit; text-decoration: none; }
.page-hero .crumb a:hover { color: var(--accent); }
.page-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); margin: 0; }
.page-hero p { margin: 6px 0 0; color: var(--ink-soft); max-width: 720px; }

/* ===== Home hero ===== */
.hero { background: radial-gradient(800px 400px at 0% 0%, var(--band-soft), transparent 70%), var(--bg-warm); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero .container { display: grid; justify-items: center; gap: 22px; padding-top: 36px; padding-bottom: 60px; }
.hero-art { width: min(100%, 680px); }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 600; color: var(--accent-strong); background: var(--surface); border: 1px solid var(--line); padding: 5px 14px 5px 6px; border-radius: 999px; }
.hero .eyebrow img { width: 26px; height: 26px; object-fit: contain; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); margin: 18px 0 12px; line-height: 1.22; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: 1.12rem; color: var(--ink-soft); margin: 0 0 28px; max-width: 540px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero-art { position: relative; }
.hero-art img { width: 100%; border-radius: 32px; box-shadow: var(--shadow-hover); }
.deadline {
  position: absolute; left: -22px; bottom: -26px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 20px; box-shadow: var(--shadow-hover); display: flex; gap: 14px; align-items: center;
}
.deadline .num { font-family: "Prompt", sans-serif; font-size: 2.2rem; font-weight: 700; color: var(--accent); line-height: 1; min-width: 1.4em; text-align: center; }
.deadline small { display: block; color: var(--ink-soft); font-size: .82rem; line-height: 1.4; }
.deadline strong { font-size: .98rem; line-height: 1.4; }
@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; padding-top: 36px; gap: 36px; }
  .deadline { left: 12px; bottom: -20px; }
}

/* ===== Sections ===== */
.section { padding: 64px 0 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); margin: 2px 0 0; }
.section-head p { margin: 4px 0 0; color: var(--ink-soft); }
.kicker { font-size: .85rem; font-weight: 700; color: var(--accent); letter-spacing: .03em; }

/* Section title used by inner pages */
.band {
  display: flex; align-items: center; gap: 12px;
  font-family: "Prompt", sans-serif; font-size: clamp(1.25rem, 2.2vw, 1.5rem); font-weight: 600;
  margin: 44px 0 18px; padding: 0; background: none; border-radius: 0; color: var(--ink);
}
.band::before { content: ""; width: 6px; height: 1.3em; border-radius: 6px; background: linear-gradient(var(--accent), var(--rose)); flex: none; }
main > .band:first-child { margin-top: 36px; }

/* ===== Cards & grids ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .grid-4 { grid-template-columns: 1fr; } }

.link-card {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.link-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--band); color: var(--ink); }
.link-card .icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--band-soft); color: var(--accent); margin-bottom: 8px; }
.link-card .icon svg { width: 24px; height: 24px; }
.link-card strong { font-family: "Prompt", sans-serif; font-size: 1.08rem; font-weight: 600; }
.link-card span { color: var(--ink-soft); font-size: .95rem; line-height: 1.55; }
.link-card .go { margin-top: auto; padding-top: 10px; color: var(--accent); font-weight: 600; font-size: .92rem; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 18px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px 20px; box-shadow: var(--shadow); }
.steps li::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--rose)); color: #fff; font-family: "Prompt", sans-serif; font-weight: 700; margin-bottom: 14px;
}
.steps strong { display: block; font-family: "Prompt", sans-serif; font-weight: 600; margin-bottom: 4px; }
.steps span { color: var(--ink-soft); font-size: .95rem; line-height: 1.55; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 640px) { .gallery { grid-template-columns: 1fr; } }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; line-height: 1.3;
  text-decoration: none; transition: background .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btn:hover { background: var(--accent-strong); color: var(--accent-ink); transform: translateY(-1px); }
.btn.secondary { background: var(--band-soft); color: var(--accent-strong); box-shadow: none; }
.btn.secondary:hover { background: var(--band); color: var(--ink); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--band); background: var(--band-soft); }
.btn.lg { padding: 14px 28px; font-size: 1.05rem; }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ===== Document lists ===== */
.doc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.doc-list li {
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px;
  transition: border-color .15s, box-shadow .15s;
}
.doc-list li:hover { border-color: var(--band); box-shadow: var(--shadow); }
.doc-list li > span:first-child { display: flex; align-items: center; gap: 14px; }
.doc-list li > span:first-child::before {
  content: ""; flex: none; width: 40px; height: 40px; border-radius: 11px; background: var(--band-soft)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b9573e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h4'/%3E%3C/svg%3E") center / 22px no-repeat;
}
.doc-list li.muted { justify-content: center; }
.doc-list .code { font-weight: 700; color: var(--accent); margin-right: 6px; white-space: nowrap; }
.doc-list .btn { padding: 8px 18px; flex: none; }
@media (max-width: 560px) { .doc-list li { flex-direction: column; align-items: stretch; } }

/* ===== Forms ===== */
form .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
label { font-weight: 600; }
.req::after { content: " *"; color: var(--err); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 14px; width: 100%;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--band); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.choice { display: flex; flex-wrap: wrap; gap: 10px; }
.choice label {
  font-weight: 500; display: flex; gap: 8px; align-items: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; background: var(--bg); transition: all .15s;
}
.choice label:has(input:checked) { border-color: var(--accent); background: var(--band-soft); color: var(--accent-strong); }
.choice input { width: auto; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; }
.alert { border-radius: var(--radius-sm); padding: 14px 16px; margin: 16px 0; }
.alert.ok { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 50%, transparent); }
.alert.err { background: color-mix(in srgb, var(--err) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--err) 50%, transparent); }
.code-big { font-family: "Prompt", monospace; font-size: 1.9rem; letter-spacing: .08em; font-weight: 700; color: var(--accent); margin: 6px 0; }
fieldset.uploads { border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--radius); padding: 18px 20px 4px; margin: 4px 0 18px; background: var(--bg-warm); }
fieldset.uploads legend { font-family: "Prompt", sans-serif; font-weight: 600; padding: 0 8px; }
input[type=file] { background: var(--surface); padding: 8px; }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: 6px 16px; margin-right: 12px;
  background: var(--band); color: var(--ink); cursor: pointer;
}
progress { width: 100%; height: 10px; margin: 0 0 12px; accent-color: var(--accent); }
.form-card { padding: 30px; }
.side-card { position: sticky; top: 90px; }
.side-card ul { padding-left: 1.2em; }
.side-card li { margin-bottom: 8px; }

/* ===== Status ===== */
.badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .88rem; font-weight: 600; background: var(--band-soft); color: var(--ink); white-space: nowrap; }
.badge.ok { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); }
.badge.warn { background: color-mix(in srgb, var(--warn) 20%, var(--surface)); }
.timeline { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.timeline li { display: flex; gap: 12px; align-items: center; color: var(--ink-soft); }
.timeline li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.timeline li.done { color: var(--ink); font-weight: 500; }
.timeline li.done::before { background: var(--accent); border-color: var(--accent); }
.file-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; font-size: .92rem; }
.file-list li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.file-list button.linkish { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }

/* ===== Committee ===== */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px 18px; }
.member {
  margin: 0; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 14px 20px; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s;
}
.member:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.member img, .member .avatar {
  width: 128px; height: 128px; margin: 0 auto 14px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--surface); outline: 2px solid var(--band); background: var(--band-soft);
}
.member .avatar { display: grid; place-items: center; font-family: "Prompt", sans-serif; font-size: 2.6rem; color: var(--accent); }
.member figcaption { line-height: 1.5; font-weight: 500; }
.member figcaption strong { display: table; margin-left: auto; margin-right: auto; font-size: .8rem; font-weight: 600; color: var(--accent-strong); background: var(--band-soft); border-radius: 999px; padding: 2px 12px; margin-bottom: 8px; }

/* ===== Admin ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--band-soft); position: sticky; top: 0; font-family: "Prompt", sans-serif; font-weight: 600; font-size: .9rem; }
tbody tr:hover td { background: color-mix(in srgb, var(--band-soft) 40%, transparent); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; flex: 1 1 200px; }
.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 18px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.tabs button { font: inherit; border: 0; background: transparent; color: var(--ink); border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.tabs button:hover { background: var(--band-soft); }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tabs .btn { padding: 6px 16px; }
@media (max-width: 640px) { .tabs { border-radius: var(--radius); } }
.editor-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.editor-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; }
.editor-item .thumb { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--band-soft); display: grid; place-items: center; color: var(--accent); font-weight: 700; }
.editor-item .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.editor-item .actions button { padding: 6px 14px; }
.icon-btn { font: inherit; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px; width: 34px; height: 34px; cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: var(--band-soft); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 26px 0 12px; }
.section-title h3 { margin: 0; }
dialog { border: 0; border-radius: var(--radius); padding: 26px; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.28); }
dialog::backdrop { background: rgba(40, 20, 10, .45); backdrop-filter: blur(2px); }
@media (max-width: 640px) { .editor-item { grid-template-columns: 1fr; } .editor-item .actions { justify-content: flex-start; } }

/* ===== Footer ===== */
.site-footer { margin-top: 80px; background: #3a211a; color: #f3e3d9; }
.site-footer .container { display: flex; justify-content: flex-end; padding-top: 40px; padding-bottom: 28px; }
.site-footer .foot-contact { text-align: right; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.site-footer p, .site-footer li { color: #dcc5b8; font-size: .94rem; margin: 0 0 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { color: #ffd2c2; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .foot-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.site-footer .foot-brand img { width: 54px; height: 54px; background: #fff; border-radius: 50%; padding: 5px; object-fit: contain; }
.site-footer .foot-brand strong { color: #fff; font-family: "Prompt", sans-serif; font-weight: 600; display: block; line-height: 1.3; }
.site-footer .bottom { border-top: 1px solid rgba(255,255,255,.1); text-align: center; padding: 16px 20px; font-size: .85rem; color: #b89d90; }


.map { width: 100%; aspect-ratio: 16 / 10; border: 0; border-radius: var(--radius-sm); margin-top: 8px; }
@media (max-width: 520px) {
  .members { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .member { padding: 16px 8px 14px; }
  .member img, .member .avatar { width: 96px; height: 96px; }
  .member figcaption { font-size: .92rem; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Steps page summary list */
.step-list { list-style: none; counter-reset: s; padding: 0; margin: 0 0 16px; display: grid; gap: 14px; }
.step-list li { counter-increment: s; position: relative; padding-left: 46px; }
.step-list li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--band-soft); color: var(--accent-strong); font-family: "Prompt", sans-serif; font-weight: 700; font-size: .95rem;
}
.step-list li.muted { padding-left: 0; }
.step-list li.muted::before { display: none; }
.step-list strong { display: block; font-family: "Prompt", sans-serif; font-weight: 600; line-height: 1.4; }
.step-list span { display: block; color: var(--ink-soft); font-size: .95rem; line-height: 1.6; white-space: pre-line; }

/* ===== Submit page ===== */
.submit-hero { background: radial-gradient(800px 400px at 0% 0%, var(--band-soft), transparent 70%), var(--bg-warm); border-bottom: 1px solid var(--line); }
.submit-hero .container { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 48px; align-items: center; padding-top: 40px; padding-bottom: 60px; }
.submit-hero .eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 600; color: var(--accent-strong); background: var(--surface); border: 1px solid var(--line); padding: 5px 14px 5px 6px; border-radius: 999px; margin-bottom: 18px; }
.submit-hero .eyebrow img { width: 26px; height: 26px; object-fit: contain; }
.auth-card { padding: 24px; max-width: 460px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; margin-bottom: 18px; }
.auth-tabs button { font: inherit; border: 0; background: transparent; color: var(--ink); border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.auth-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.welcome-title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 0 0 4px; }
.welcome-title span { color: var(--accent); }
.welcome-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 460px; }
.welcome-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.welcome-stats strong { display: block; font-family: "Prompt", sans-serif; font-size: 1.7rem; line-height: 1.1; color: var(--accent); }
.welcome-stats span { font-size: .86rem; color: var(--ink-soft); }
@media (max-width: 860px) {
  .submit-hero .container { grid-template-columns: 1fr; gap: 36px; padding-top: 28px; }
  .submit-hero .hero-art { width: min(100%, 520px); justify-self: center; }
  .auth-card { max-width: none; }
}
.status-list { display: grid; gap: 16px; }
.status-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.timeline-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.status-card details summary { cursor: pointer; font-weight: 600; color: var(--accent-strong); }
form.revise { margin-top: 16px; background: var(--bg-warm); box-shadow: none; }

/* ===== Sign-in by role ===== */
.auth-card { padding: 28px; max-width: 480px; }
.auth-title { font-size: 1.6rem; margin: 0; }
.auth-sub { margin: 2px 0 16px; }
.role-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.role-pick button {
  font: inherit; cursor: pointer; text-align: center; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px 12px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--bg);
  transition: border-color .15s, background .15s, box-shadow .15s, transform .15s;
}
.role-pick button:hover { border-color: var(--band); transform: translateY(-1px); }
.role-pick button svg { width: 30px; height: 30px; padding: 6px; border-radius: 10px; background: var(--surface); color: var(--ink-soft); box-sizing: content-box; }
.role-pick button span { font-family: "Prompt", sans-serif; font-weight: 600; font-size: .98rem; line-height: 1.3; }
.role-pick button small { font-size: .76rem; color: var(--ink-soft); line-height: 1.3; }
.role-pick button[aria-checked="true"] {
  border-color: var(--accent); background: var(--band-soft);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}
.role-pick button[aria-checked="true"] svg { background: var(--accent); color: var(--accent-ink); }
.role-pick button[aria-checked="true"] span { color: var(--accent-strong); }
.btn-block { width: 100%; }
.auth-note { font-size: .86rem; margin: 10px 0 0; line-height: 1.55; }
.role-badge {
  display: inline-block; font-size: .82rem; font-weight: 600; color: var(--accent-strong);
  background: var(--surface); border: 1px solid var(--band); border-radius: 999px; padding: 2px 12px; margin-bottom: 8px;
}
@media (max-width: 420px) {
  .role-pick { gap: 6px; }
  .role-pick button { padding: 12px 4px 10px; }
  .role-pick button small { display: none; }
}

/* ===== Polish ===== */
/* brand accent line on top of the header and the footer */
.site-header::before, .site-footer::before {
  content: ""; display: block; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--rose), #f4c27a, var(--accent));
}
.site-footer::before { height: 3px; opacity: .85; }

/* home hero: text on the left, the college building in an organic frame on the right */
.home-hero {
  position: relative; isolation: isolate; overflow: hidden; border-bottom: 1px solid var(--line);
  background:
    radial-gradient(700px 420px at 100% 0%, color-mix(in srgb, #f4c27a 22%, transparent), transparent 70%),
    radial-gradient(800px 520px at 0% 100%, color-mix(in srgb, var(--rose) 20%, transparent), transparent 70%),
    var(--bg-warm);
}
.home-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 22%, transparent) 1.2px, transparent 1.3px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(100deg, #000, transparent 45%); mask-image: linear-gradient(100deg, #000, transparent 45%);
}
.home-hero .container { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: 40px; padding-top: 64px; padding-bottom: 72px; }
.hh-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 18px 7px 12px; border-radius: 999px; white-space: nowrap;
  font-weight: 700; font-size: .95rem; color: var(--accent-strong); background: var(--surface); border: 1px solid color-mix(in srgb, #f4c27a 70%, var(--line)); box-shadow: var(--shadow);
}
.hh-chip svg { width: 20px; height: 20px; flex: none; }
.home-hero h1 { font-family: "Noto Serif Thai", "Prompt", serif; font-weight: 700; font-size: clamp(2.5rem, 5.6vw, 4.5rem); line-height: 1.28; margin: 26px 0 22px; color: var(--ink); text-wrap: balance; }
.home-hero h1 span { display: block; white-space: nowrap; }
.home-hero h1 span + span { color: var(--accent); }
.hh-org { margin: 0; font-family: "Prompt", sans-serif; font-weight: 500; font-size: clamp(1.05rem, 1.9vw, 1.4rem); line-height: 1.75; }
.hh-en { margin: 10px 0 0; color: var(--ink-soft); font-size: 1.02rem; }
.hh-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hh-note { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 26px 0 0; padding: 9px 18px 9px 14px; border-radius: 14px; background: color-mix(in srgb, var(--band-soft) 70%, transparent); color: var(--ink-soft); }
.hh-note svg { width: 20px; height: 20px; flex: none; color: var(--accent-strong); }
.hh-note strong { color: var(--ink); white-space: nowrap; }

.hh-art { position: relative; margin: 0; justify-self: center; width: min(100%, 470px); }
.hh-blob {
  aspect-ratio: 5 / 6; overflow: hidden; background: var(--surface); border: 10px solid var(--surface);
  border-radius: 58% 42% 44% 56% / 46% 50% 50% 54%; box-shadow: 0 30px 70px rgba(120, 60, 40, .22);
}
.hh-blob picture { display: block; width: 100%; height: 100%; border-radius: inherit; overflow: hidden; }
.hh-blob img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.hh-badge {
  position: absolute; right: -8px; top: 5%; display: grid; gap: 1px; padding: 12px 22px 13px; border-radius: 18px;
  background: #3a211a; color: #f7e9df; box-shadow: 0 16px 36px rgba(58, 33, 26, .32); white-space: nowrap;
}
.hh-badge strong { font-family: "Prompt", sans-serif; font-size: 1.15rem; font-weight: 700; letter-spacing: .03em; color: #f4c27a; line-height: 1.3; }
.hh-badge span { font-size: .92rem; }
.hh-seal { position: absolute; left: -16px; bottom: 5%; width: 132px; height: 132px; padding: 16px; object-fit: contain; border-radius: 50%; background: #fff; box-shadow: 0 16px 40px rgba(120, 60, 40, .22); }
#start { scroll-margin-top: 70px; }
@media (max-width: 900px) {
  .home-hero .container { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 40px; padding-bottom: 56px; }
  .hh-art { width: min(86%, 380px); }
  .hh-seal { width: 104px; height: 104px; padding: 12px; left: -12px; }
}
@media (max-width: 480px) {
  .hh-chip { font-size: .84rem; padding: 6px 14px 6px 10px; }
  .home-hero h1 { margin: 20px 0 16px; }
  .hh-en { font-size: .92rem; }
  .hh-actions .btn { width: 100%; }
  .hh-badge { right: -4px; padding: 9px 16px 10px; }
  .hh-badge strong { font-size: 1rem; }
}
.home-hero + main > .section:first-child { padding-top: 30px; }
@media (max-width: 560px) { .home-hero + main > .section:first-child { padding-top: 14px; } }

/* menu cards: icon fills with the accent on hover, arrow nudges */
.link-card .icon { transition: background .18s, color .18s; }
.link-card:hover .icon { background: linear-gradient(135deg, var(--accent), var(--rose)); color: #fff; }
.link-card .go { display: inline-flex; align-items: center; gap: 4px; transition: gap .18s; }
.link-card:hover .go { gap: 10px; }

/* inner page title bands get the same arch accent */
.page-hero::before {
  content: ""; position: absolute; left: -40px; bottom: -70px; width: 150px; height: 150px; border-radius: 50%;
  border: 16px solid color-mix(in srgb, var(--band) 55%, transparent); pointer-events: none;
}

/* softer section rhythm */
.section-head h2 { position: relative; }
.kicker::before { content: ""; display: inline-block; width: 18px; height: 2px; background: var(--accent); vertical-align: middle; margin-right: 8px; border-radius: 2px; }

/* ===== Messages & notifications ===== */
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.count-badge { display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 999px; background: var(--err); color: #fff; font-size: .78rem; font-weight: 700; line-height: 1.5; text-align: center; margin-left: 4px; }
.msg-card.unread { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent), var(--shadow); }
.toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 100; max-width: min(380px, calc(100vw - 32px));
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow-hover);
  animation: toast-in .25s ease;
}
.toast span { grid-column: 1; color: var(--ink-soft); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast button { grid-column: 2; grid-row: 1 / 3; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Members without a photo: no photo frame, just the name card */
.member.no-photo { padding: 22px 14px; display: flex; align-items: center; justify-content: center; }

/* Committee: each name stays on one line, so cards are wide enough for the longest name */
.members { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.member .m-name { display: block; white-space: nowrap; }
.member figcaption strong { white-space: nowrap; }
@media (max-width: 520px) {
  .members { grid-template-columns: 1fr; }
  .member img { width: 110px; height: 110px; }
}

/* Nav: outlined "เข้าสู่ระบบ" next to the filled "ยื่นโครงร่างวิจัย" */
.nav-links a.login { border: 1.5px solid var(--accent); color: var(--accent-strong); font-weight: 600; padding: 6.5px 16px; margin-left: 4px; }
.nav-links a.login:hover { background: var(--accent); color: var(--accent-ink); }
.nav-links a.login[aria-current="page"] { background: var(--band-soft); color: var(--accent-strong); }
@media (max-width: 1120px) { .nav-links a.login { margin: 6px 0 0; text-align: center; } }

/* ===== Guide page & popup ===== */
.pill-cta, .pill-login { display: inline-block; font-weight: 600; font-size: .92em; padding: 1px 12px; border-radius: 999px; white-space: nowrap; line-height: 1.6; }
.pill-cta { background: var(--accent); color: var(--accent-ink); }
.pill-login { border: 1.5px solid var(--accent); color: var(--accent-strong); background: var(--surface); }
.guide-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 28px 0 8px; }
.guide-tabs a { text-decoration: none; padding: 10px 20px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; }
.guide-tabs a:hover { border-color: var(--accent); }
.guide-sec { scroll-margin-top: 90px; }
.guide-sec > .band { margin-top: 34px; }
.guide-lead { color: var(--ink-soft); margin: -6px 0 20px; }
.guide-steps { list-style: none; counter-reset: g; padding: 0; margin: 0; display: grid; gap: 16px; }
.guide-steps > li { counter-increment: g; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px 20px 78px; box-shadow: var(--shadow); }
.guide-steps > li::before {
  content: counter(g); position: absolute; left: 20px; top: 18px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-family: "Prompt", sans-serif; font-weight: 700; font-size: 1.1rem;
  background: linear-gradient(135deg, var(--accent), var(--rose));
}
.guide-steps h3 { margin: 0 0 4px; font-size: 1.1rem; }
.guide-steps p { margin: 4px 0 0; color: var(--ink-soft); }
.guide-steps ul { margin: 6px 0 0; padding-left: 1.2em; color: var(--ink-soft); }
.guide-steps .tip { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--band-soft); color: var(--ink); font-size: .93rem; }
.menu-demo { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px 10px; margin-top: 8px; background: var(--bg-warm); border: 1px dashed var(--line); border-radius: 999px; font-size: .9rem; }
.menu-demo i { font-style: normal; color: var(--ink-soft); padding: 0 6px; }
.menu-demo .arrow { color: var(--accent); font-weight: 700; }
@media (max-width: 560px) { .guide-steps > li { padding: 18px 16px 18px 64px; } .guide-steps > li::before { left: 14px; width: 36px; height: 36px; } }

.guide-popup { width: min(680px, calc(100vw - 28px)); padding: 28px 28px 22px; border: 0; border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.guide-popup::backdrop { background: rgba(40, 20, 10, .5); backdrop-filter: blur(3px); }
.guide-popup h2 { font-size: 1.5rem; margin: 0 0 2px; }
.gp-close { position: absolute; right: 14px; top: 12px; border: 0; background: var(--band-soft); color: var(--ink); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1rem; }
.gp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.gp-cols section { background: var(--bg-warm); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.gp-cols h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1.05rem; }
.gp-cols h3 span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .85rem; }
.gp-cols ol { margin: 0; padding-left: 1.3em; font-size: .94rem; line-height: 1.65; }
.gp-check { display: flex; gap: 8px; align-items: center; font-weight: 400; color: var(--ink-soft); cursor: pointer; }
.gp-check input { width: auto; accent-color: var(--accent); }
.gp-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 14px; }
@media (max-width: 600px) { .gp-cols { grid-template-columns: 1fr; } .guide-popup { padding: 22px 18px 18px; } }
@media (max-width: 640px) {
  .menu-demo { border-radius: 14px; }
  .menu-demo i { display: none; }
}
.guide-steps > li.muted::before { display: none; }
.guide-steps li p + ul, .guide-steps li ul + p { margin-top: 8px; }

/* ===== Submit page: layout and no awkward line breaks ===== */
/* Short UI text never wraps; headings and paragraphs break at balanced word boundaries. */
.btn, .badge, .role-badge, .eyebrow, .tabs button, .auth-tabs button, .nav-links a, .choice label,
.welcome-stats span, .welcome-stats strong, .sec-title, .sec-title .n, th, .deadline strong, .deadline small,
.role-pick button span, .code-big, .count-badge, summary { white-space: nowrap; }
h1, h2, h3, h4, .guide-lead, .welcome-title { text-wrap: balance; }
p, li, small { text-wrap: pretty; }
/* long field labels wrap only between words; the * stays glued to the last word */
.field > label, .field > span { white-space: normal; }
.req::after { content: "\00a0*"; }

.submit-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 960px) { .submit-grid { grid-template-columns: minmax(0, 1fr); } .submit-grid .side-card { position: static; order: -1; } }
.submit-grid .form-card { padding: 8px 30px 30px; }
.form-sec { padding: 22px 0 6px; }
.form-sec + .form-sec { border-top: 1px dashed var(--line); }
.sec-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 16px; font-size: 1.15rem; }
.sec-title .n {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--rose)); color: #fff; font-family: "Prompt", sans-serif; font-weight: 700; font-size: .98rem;
}
.sec-title small { font-family: "Sarabun", sans-serif; font-weight: 400; font-size: .86rem; color: var(--ink-soft); white-space: normal; }
.form-grid { gap: 0 16px; }
@media (max-width: 1180px) and (min-width: 961px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
fieldset.uploads { padding-top: 16px; margin-top: 0; }
.submit-grid .choice { gap: 10px; }
.submit-grid .choice label { padding: 9px 18px; }
.tips-title { display: flex; align-items: center; gap: 8px; }
.side-card ul { list-style: none; padding: 0; margin: 0 0 12px; }
.side-card li { position: relative; padding-left: 28px; margin-bottom: 12px; }
.side-card li::before { content: "✓"; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; background: var(--band-soft); color: var(--accent-strong); }
.welcome-stats strong { font-size: clamp(1.4rem, 5vw, 1.7rem); }
@media (max-width: 420px) {
  .welcome-stats { gap: 8px; }
  .welcome-stats div { padding: 10px 8px; text-align: center; }
  .welcome-stats span { font-size: .74rem; }
  .submit-grid .form-card { padding: 4px 18px 22px; }
  .tabs button { padding: 8px 14px; }
}

/* ===== Committee comments ===== */
.review-box { margin-top: 18px; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--bg-warm); border: 1px solid var(--line); }
.review-box h4 { margin: 0 0 10px; font-size: 1rem; }
.comment { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.comment-head .linkish { margin-left: auto; font-size: .88rem; }
.comment p { margin: 4px 0 0; white-space: pre-line; }
.comment-form { margin-top: 12px; }
.comment-form label { display: block; margin-bottom: 6px; font-weight: 600; }
.comment-form textarea { background: var(--surface); }
.comment-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

/* ===== Guide embedded in pages ===== */
.guide-embed { margin-top: 56px; padding: 44px 0 52px; background: var(--bg-warm); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.guide-embed-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.guide-embed-head h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); margin: 2px 0 0; }
.guide-embed-head .guide-lead { margin: 6px 0 0; }

/* "ดูคู่มือการเข้าใช้งาน" link under the sign-in / submit heading */
.guide-link { display: flex; width: max-content; max-width: 100%; align-items: center; gap: 8px; margin: 2px 0 16px 2px; color: var(--accent-strong); font-weight: 700; text-decoration: none; }
.guide-link svg { width: 24px; height: 24px; flex: none; }
.guide-link span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; white-space: nowrap; }
.guide-link:hover { color: var(--accent); }
.submit-hero .eyebrow:has(+ .guide-link) { margin-bottom: 12px; }

/* ===== Sign-in card: subtitle and next-round date share one band ===== */
.auth-card { max-width: 540px; }
.auth-band {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px;
  margin: 8px 0 20px; padding: 12px 14px; border-radius: 16px; background: var(--band-soft); border: 1px solid var(--line);
}
.auth-band .auth-sub { margin: 0; flex: 1 1 210px; color: var(--ink-soft); text-wrap: balance; }
.round-chip { display: inline-flex; align-items: center; gap: 12px; padding: 8px 16px 8px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(120, 60, 40, .1); flex: none; }
.round-chip .num { font-family: "Prompt", sans-serif; font-weight: 700; font-size: 1.9rem; line-height: 1; color: var(--accent); min-width: 1.3em; text-align: center; }
.round-chip .txt { display: flex; flex-direction: column; line-height: 1.35; }
.round-chip small { color: var(--ink-soft); font-size: .8rem; white-space: nowrap; }
.round-chip strong { font-size: .95rem; white-space: nowrap; }
@media (max-width: 480px) { .auth-card { padding: 22px 18px; } .auth-band { justify-content: stretch; } .round-chip { width: 100%; justify-content: center; } }
@media (min-width: 861px) {
  .submit-hero .container { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); }
  .auth-card { max-width: 620px; }
  .auth-band .auth-sub { flex: 1 1 230px; }
}

/* ===== Motion & flair ===== */
/* pages cross-fade into each other where the browser supports it */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .26s; }

@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes flow { to { background-position: -200% 0; } }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-.6deg); } }
@keyframes drift { 50% { transform: translate(-14px, -12px) scale(1.05); } }
@keyframes wiggle { 30% { transform: rotate(-12deg) scale(1.12); } 65% { transform: rotate(9deg) scale(1.12); } }
@keyframes nudge-up { 50% { transform: translateY(-3px); } }
@keyframes tick { from { opacity: .35; transform: translateY(-7px); } }
@keyframes kenburns { from { scale: 1.08; } to { scale: 1.18; } }
@keyframes halo {
  0%, 100% { box-shadow: 0 0 0 7px rgba(255, 255, 255, .22), 0 14px 34px rgba(20, 8, 4, .35); }
  50% { box-shadow: 0 0 0 15px rgba(255, 255, 255, .08), 0 14px 34px rgba(20, 8, 4, .35); }
}
@keyframes ping {
  0% { box-shadow: 0 0 0 6px var(--surface), 0 0 0 6px color-mix(in srgb, var(--accent) 50%, transparent); }
  100% { box-shadow: 0 0 0 6px var(--surface), 0 0 0 22px transparent; }
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(16px); } }
@keyframes glow {
  0%, 100% { box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); }
  55% { box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 0 9px transparent; }
}
@keyframes lb-in { from { opacity: 0; transform: scale(.94); } }

/* scroll reveal (classes are added and removed by effects.js) */
.rv { opacity: 0; transform: translateY(24px); }
.rv.rv-in {
  opacity: 1; transform: none;
  transition: opacity .6s ease var(--rv-delay, 0ms), transform .7s cubic-bezier(.2, .7, .2, 1) var(--rv-delay, 0ms);
}
@media print { .rv { opacity: 1 !important; transform: none !important; } }

/* header: flowing accent line, shadow once the page is scrolled, a soft pulse on the main action */
.site-header { transition: box-shadow .25s ease; }
.site-header.scrolled { box-shadow: 0 8px 28px rgba(90, 45, 30, .12); }
.site-header::before { background-size: 200% 100%; animation: flow 10s linear infinite; }
.nav-links a.cta { animation: glow 3.2s ease-in-out infinite; }
.brand img { transition: transform .35s cubic-bezier(.2, 1.4, .4, 1); }
.brand:hover img { transform: rotate(-8deg) scale(1.08); }

/* buttons: a light sweeps across on hover, and they press in */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-130%);
  background: linear-gradient(110deg, transparent 32%, rgba(255, 255, 255, .38) 50%, transparent 68%);
}
.btn:hover::after { transform: translateX(130%); transition: transform .75s ease; }
.btn:active { transform: translateY(0) scale(.97); }
.auth-tabs button, .tabs button { transition: background .2s, color .2s; }

/* back to top, with a ring that fills as the page is read */
.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 50px; height: 50px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--accent-strong);
  background: conic-gradient(var(--accent) calc(var(--sp, 0) * 1turn), var(--line) 0);
  box-shadow: var(--shadow-hover); opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.to-top::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface); }
.to-top svg { position: relative; width: 20px; height: 20px; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover svg { animation: nudge-up .7s ease-in-out infinite; }
.to-top ~ .toast { bottom: 80px; }

/* home hero: text rises in, the photo frame slowly changes shape, the badge and seal float */
@keyframes morph {
  0%, 100% { border-radius: 58% 42% 44% 56% / 46% 50% 50% 54%; }
  50% { border-radius: 46% 54% 56% 44% / 54% 44% 56% 46%; }
}
.hh-text > * { animation: rise .7s ease both; }
.hh-text > :nth-child(2) { animation-delay: .1s; } .hh-text > :nth-child(3) { animation-delay: .2s; }
.hh-text > :nth-child(4) { animation-delay: .26s; } .hh-text > :nth-child(5) { animation-delay: .34s; } .hh-text > :nth-child(6) { animation-delay: .42s; }
.hh-art { animation: pop .9s cubic-bezier(.2, 1.1, .3, 1) .15s both; }
.hh-blob { animation: morph 14s ease-in-out infinite; }
.hh-badge { animation: bob 5.5s ease-in-out infinite; }
.hh-seal { animation: bob 6.5s ease-in-out -2s infinite; }

/* soft colour drifting behind the home page content */
.home-hero + main { position: relative; isolation: isolate; }
.home-hero + main::before, .home-hero + main::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none;
}
.home-hero + main::before {
  width: min(520px, 80%); aspect-ratio: 1; right: 0; top: 120px;
  background: radial-gradient(circle, color-mix(in srgb, var(--rose) 24%, transparent), transparent 68%);
  animation: drift 16s ease-in-out infinite;
}
.home-hero + main::after {
  width: min(480px, 76%); aspect-ratio: 1; left: 0; top: 46%;
  background: radial-gradient(circle, color-mix(in srgb, #f4c27a 22%, transparent), transparent 68%);
  animation: drift 21s ease-in-out infinite reverse;
}

/* menu cards: light follows the pointer, accent bar draws in, the card leans, the icon wiggles */
.link-card, .member { position: relative; overflow: hidden; }
.link-card::before, .member::before, .round-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 15%, transparent), transparent 70%);
}
.link-card:hover::before, .member:hover::before, .round-card:hover::before { opacity: 1; }
.link-card > *, .member > *, .round-card > * { position: relative; }
.link-card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, var(--accent), var(--rose), #f4c27a); transition: transform .4s ease;
}
.link-card:hover::after { transform: scaleX(1); }
.link-card:hover .icon svg { animation: wiggle .55s ease; }
@media (hover: hover) and (pointer: fine) {
  .link-card:hover { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px); }
}

/* short steps: lift on hover, the number spins once */
.steps li { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.steps li:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--band); }
.steps li::before { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.steps li:hover::before { transform: rotate(360deg) scale(1.08); }

/* this round: live countdown and a timeline whose rail fills up to today */
.round-card { position: relative; overflow: hidden; padding: 30px; }
.round-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px 28px; }
.round-intro { flex: 1 1 320px; max-width: 580px; }
.round-intro h2 { font-size: 1.5rem; margin: 2px 0 6px; }
.round-intro p { margin: 0; }
.countdown {
  flex: none; text-align: center; padding: 16px 18px 14px; border-radius: 22px; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--rose)));
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 32%, transparent);
}
.cd-label { display: block; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.cd-tiles { display: flex; justify-content: center; gap: 8px; margin: 10px 0 8px; }
.cd-tiles span { min-width: 64px; padding: 8px 6px 6px; border-radius: 13px; background: rgba(255, 255, 255, .17); border: 1px solid rgba(255, 255, 255, .24); }
.cd-tiles b { display: block; font-family: "Prompt", sans-serif; font-size: 1.75rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-tiles b.tick { animation: tick .35s ease; }
.cd-tiles small { display: block; font-size: .74rem; white-space: nowrap; opacity: .92; }
.cd-date { display: block; font-size: .86rem; white-space: nowrap; opacity: .95; }

.round-track { --p: 0; position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; margin: 34px 0 4px; padding: 0; }
.round-track::before, .round-track::after { content: ""; position: absolute; left: calc(100% / 6); top: 27px; height: 6px; border-radius: 6px; }
.round-track::before { right: calc(100% / 6); background: var(--band-soft); }
.round-track::after {
  width: calc(100% * 2 / 3 * var(--p)); background: linear-gradient(90deg, var(--accent), var(--rose));
  transition: width 1.5s cubic-bezier(.2, .7, .2, 1) .25s;
}
.round-track li { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0 6px; text-align: center; }
.round-track .node {
  display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 8px; border-radius: 50%;
  font-family: "Prompt", sans-serif; font-weight: 700; font-size: 1.45rem; color: var(--accent);
  background: var(--surface); border: 3px solid var(--band); box-shadow: 0 0 0 6px var(--surface);
  transition: transform .25s cubic-bezier(.2, 1.4, .4, 1);
}
.round-track li:hover .node { transform: scale(1.1); }
.round-track li.done .node { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--rose)); }
.round-track li.next .node { border-color: var(--accent); animation: ping 2.2s ease-out infinite; }
.round-track li.today .node { animation: ping 2.2s ease-out infinite; }
.round-track .tag { font-style: normal; font-size: .74rem; font-weight: 700; line-height: 1.5; padding: 0 10px; border-radius: 999px; background: var(--band-soft); color: var(--accent-strong); white-space: nowrap; }
.round-track li.today .tag { background: var(--accent); color: var(--accent-ink); }
.round-track strong { font-family: "Prompt", sans-serif; font-weight: 600; line-height: 1.4; }
.round-track .date { font-size: .86rem; color: var(--ink-soft); white-space: nowrap; }
@media (max-width: 760px) { .countdown { flex: 1 1 100%; } }
@media (max-width: 520px) {
  .round-card { padding: 22px 16px; }
  .cd-tiles { gap: 6px; }
  .cd-tiles span { min-width: 0; flex: 1; }
  .cd-tiles b { font-size: 1.45rem; }
  .cd-label { white-space: normal; }
  /* on phones the timeline runs top to bottom, so every label stays on one line */
  .round-track { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 26px; }
  .round-track::before, .round-track::after { left: 22px; top: 25px; right: auto; width: 6px; }
  .round-track::before { height: calc(100% - 50px); }
  .round-track::after { height: calc((100% - 50px) * var(--p)); background: linear-gradient(180deg, var(--accent), var(--rose)); transition: height 1.5s cubic-bezier(.2, .7, .2, 1) .25s; }
  .round-track li { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; column-gap: 14px; align-items: center; justify-items: start; padding: 0; text-align: left; }
  .round-track .node { grid-column: 1; grid-row: 1 / 3; width: 50px; height: 50px; margin: 0; font-size: 1.2rem; box-shadow: 0 0 0 4px var(--surface); }
  .round-track strong { grid-column: 2; grid-row: 1; align-self: end; white-space: nowrap; }
  .round-track .date { grid-column: 2; grid-row: 2; align-self: start; }
  .round-track .tag { grid-column: 3; grid-row: 1 / 3; }
}

/* photos, charts and the calendar open large on click */
.gallery img, main > .section > img.rounded, #charts img { cursor: zoom-in; }
.gallery img, #charts img { transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .3s ease; }
.gallery img:hover { transform: scale(1.025) rotate(-.5deg); box-shadow: var(--shadow-hover); }
#charts img:hover { transform: scale(1.015); }
.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 20px; background: transparent; box-shadow: none; border-radius: 0; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(30, 14, 8, .82); backdrop-filter: blur(6px); }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 12px; animation: lb-in .3s cubic-bezier(.2, .7, .2, 1); }
.lightbox figure img { max-width: min(100%, 1400px); max-height: calc(100dvh - 110px); width: auto; border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); background: #fff; }
.lightbox figcaption { color: #f7e9df; font-size: .95rem; text-align: center; max-width: 760px; }
.lb-btn {
  position: fixed; z-index: 1; width: 46px; height: 46px; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font: 600 1.5rem/1 "Prompt", sans-serif; color: #fff; background: rgba(255, 255, 255, .16);
  transition: background .2s, transform .2s;
}
.lb-btn:hover { background: rgba(255, 255, 255, .3); transform: scale(1.08); }
.lb-close { right: 18px; top: 18px; font-size: 1.1rem; }
.lb-prev { left: 18px; top: 50%; margin-top: -23px; }
.lb-next { right: 18px; top: 50%; margin-top: -23px; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }

/* committee, document lists */
.member img { transition: transform .35s cubic-bezier(.2, .7, .2, 1), outline-color .3s ease; }
.member:hover img { transform: scale(1.05); outline-color: var(--accent); }
.doc-list li { transition: border-color .15s, box-shadow .15s, transform .2s ease; }
.doc-list li:not(.muted):hover { transform: translateX(5px); }
.doc-list li > span:first-child::before { transition: transform .3s cubic-bezier(.2, 1.4, .4, 1); }
.doc-list li:hover > span:first-child::before { transform: rotate(-8deg) scale(1.1); }
.guide-steps > li { transition: transform .2s ease, box-shadow .2s ease; }
.guide-steps > li:not(.muted):hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

/* inner page title band: drifting rings, a dot grid, the title slides in */
.page-hero::before { animation: drift 12s ease-in-out infinite reverse; }
.page-hero::after { animation: drift 15s ease-in-out infinite; }
.page-hero .container::after {
  content: ""; position: absolute; z-index: -1; right: 24px; top: 16px; width: 200px; height: 112px; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 34%, transparent) 1.6px, transparent 1.7px); background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(115deg, transparent 5%, #000 75%); mask-image: linear-gradient(115deg, transparent 5%, #000 75%);
}
.page-hero .crumb { animation: rise .55s ease both; }
.page-hero h1 { animation: rise .6s ease .08s both; }
.page-hero p { animation: rise .6s ease .16s both; }
@media (max-width: 760px) { .page-hero .container::after { display: none; } }

/* submit / sign-in: the card rises in, the illustration floats */
.auth-card, #welcome { animation: rise .6s ease both; }
.submit-hero .hero-art img { animation: bob 6.5s ease-in-out infinite; }
.role-pick button[aria-checked="true"] svg { animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); }
.round-chip .num { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .hh-blob img { translate: 0 calc(var(--py, 0px) * -.25); animation: kenburns 24s ease-in-out infinite alternate; }
}

/* ===== Calendar motion graphic (home) ===== */
/* A self-contained stage with the calendar artwork's own palette; every size is in --u so it scales like a video. */
.cal-motion {
  --u: 1cqw; --cream: #fdf3ee; --grid: #f6d9dc; --ink: #1d1a1a; --blue: #58a8d8; --pink: #f3a3c6; --yellow: #f6cf6b; --terra: #b9573e;
  position: relative; container-type: inline-size; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius);
  background: var(--cream); color: var(--ink); box-shadow: var(--shadow); font-family: "Prompt", "Sarabun", sans-serif; user-select: none;
}
.cal-motion.paused *, .cal-motion.paused *::before, .cal-motion.paused *::after { animation-play-state: paused !important; }
.cm-scene { position: absolute; inset: 0; display: none; place-items: center; overflow: hidden; }
.cm-scene.prev { display: grid; z-index: 1; }
.cm-scene.on { display: grid; z-index: 2; animation: cm-reveal .75s cubic-bezier(.7, 0, .2, 1) both; }
.cm-title, .cm-months {
  background-color: var(--cream);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: calc(var(--u) * 3.2) calc(var(--u) * 3.2);
}
.cm-title.on { --o: 50% 50%; animation-name: cm-fade; }
.cm-center { position: relative; display: grid; justify-items: center; text-align: center; gap: calc(var(--u) * .6); }
.cm-line, .cm-what { display: block; overflow: hidden; line-height: 1.25; padding: 0 calc(var(--u) * .5); }
.cm-line b, .cm-what b { display: block; font-weight: 700; }

/* scene 1: title */
.cm-kicker { font-size: calc(var(--u) * 2.1); font-weight: 600; letter-spacing: .04em; padding: calc(var(--u) * .3) calc(var(--u) * 1.6); border-radius: 999px; background: var(--ink); color: var(--cream); margin-bottom: calc(var(--u) * 1); }
.cm-line b { font-size: calc(var(--u) * 7.2); }
.cm-line.l2 b { color: var(--terra); }
.cm-rule { width: calc(var(--u) * 26); height: calc(var(--u) * .9); border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--pink), var(--yellow)); transform-origin: left; }
.cm-title.on .cm-kicker { animation: cm-pop .6s cubic-bezier(.2, 1.5, .4, 1) .15s both; }
.cm-title.on .cm-line b { animation: cm-up .7s cubic-bezier(.2, .8, .2, 1) .35s both; }
.cm-title.on .cm-line.l2 b { animation-delay: .55s; }
.cm-title.on .cm-rule { animation: cm-grow .7s cubic-bezier(.7, 0, .2, 1) .95s both; }
.cm-shape { position: absolute; display: block; }
.cm-shape.s1 { left: 5%; top: 10%; width: calc(var(--u) * 9); aspect-ratio: 3 / 4; border-radius: calc(var(--u) * 1.2); background: var(--blue); --r: -14deg; }
.cm-shape.s2 { right: 7%; top: 12%; width: calc(var(--u) * 8); aspect-ratio: 1; border-radius: 50%; background: var(--yellow); --r: 0deg; }
.cm-shape.s3 { left: 9%; bottom: 10%; width: calc(var(--u) * 11); aspect-ratio: 1; border-radius: calc(var(--u) * 2); background: var(--pink); --r: 12deg; }
.cm-shape.s4 { right: 9%; bottom: 12%; width: calc(var(--u) * 10); aspect-ratio: 1; border-radius: 50%; border: calc(var(--u) * 1.6) solid var(--terra); --r: 0deg; }
.cm-shape.s5 { left: 27%; top: 9%; width: calc(var(--u) * 3.4); aspect-ratio: 1; border-radius: 50%; background: var(--ink); --r: 0deg; }
.cm-title.on .cm-shape { animation: cm-shape-in .8s cubic-bezier(.2, 1.4, .4, 1) both, cm-float 3.2s ease-in-out .8s infinite; }
.cm-title.on .s2 { animation-delay: .12s, .9s; } .cm-title.on .s3 { animation-delay: .24s, 1s; }
.cm-title.on .s4 { animation-delay: .36s, 1.1s; } .cm-title.on .s5 { animation-delay: .48s, 1.2s; }

/* scene 2: one beat per date */
.cm-beat.blue { background: var(--blue); --o: 0% 100%; } .cm-beat.pink { background: var(--pink); --o: 100% 0%; } .cm-beat.yellow { background: var(--yellow); --o: 0% 0%; }
.cm-day { font-size: calc(var(--u) * 3); font-weight: 600; }
.cm-num { font-size: calc(var(--u) * 24); font-weight: 700; line-height: .95; text-shadow: calc(var(--u) * .7) calc(var(--u) * .7) 0 rgba(255, 255, 255, .55); }
.cm-what b { font-size: calc(var(--u) * 4.4); }
.cm-beat .cm-what { background: var(--ink); color: var(--cream); border-radius: 999px; padding: calc(var(--u) * .5) calc(var(--u) * 2.6); margin-top: calc(var(--u) * .8); }
.cm-beat.on .cm-day { animation: cm-up .45s ease .2s both; }
.cm-beat.on .cm-num { animation: cm-slam .6s cubic-bezier(.2, 1.5, .35, 1) .22s both; }
.cm-beat.on .cm-what { animation: cm-pop .5s cubic-bezier(.2, 1.4, .4, 1) .5s both; }
.cm-ring { position: absolute; left: 50%; top: 50%; width: calc(var(--u) * 46); aspect-ratio: 1; margin: calc(var(--u) * -23) 0 0 calc(var(--u) * -23); border-radius: 50%; border: calc(var(--u) * .5) dashed rgba(29, 26, 26, .35); }
.cm-ring.r2 { width: calc(var(--u) * 62); margin: calc(var(--u) * -31) 0 0 calc(var(--u) * -31); border-style: solid; border-color: rgba(255, 255, 255, .5); }
.cm-scene.on .cm-ring { animation: cm-spin 9s linear infinite, cm-fade .6s ease both; }
.cm-scene.on .cm-ring.r2 { animation: cm-ring-in 1s cubic-bezier(.2, .8, .2, 1) both; }

/* scene 3: twelve months */
.cm-months { --o: 100% 100%; align-content: center; gap: calc(var(--u) * 1.6); padding: calc(var(--u) * 3) calc(var(--u) * 4) calc(var(--u) * 4); }
.cm-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: calc(var(--u) * 2); }
.cm-head strong { font-size: calc(var(--u) * 3.4); font-weight: 700; white-space: nowrap; }
.cm-legend { display: flex; gap: calc(var(--u) * 1.6); font-family: "Sarabun", sans-serif; font-size: calc(var(--u) * 1.7); font-weight: 600; white-space: nowrap; }
.cm-legend span { display: flex; align-items: center; gap: calc(var(--u) * .6); }
.cm-legend i, .cm-dots i {
  display: grid; place-items: center; width: calc(var(--u) * 3.4); aspect-ratio: 1; border-radius: 50%; font-style: normal;
  font-family: "Prompt", sans-serif; font-weight: 700; font-size: calc(var(--u) * 1.5); color: var(--ink);
}
i.blue { background: var(--blue); } i.pink { background: var(--pink); } i.yellow { background: var(--yellow); }
.cm-grid { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(var(--u) * 1.3); }
.cm-month {
  position: relative; display: grid; gap: calc(var(--u) * .7); padding: calc(var(--u) * 1.3) calc(var(--u) * 1.6);
  border-radius: calc(var(--u) * 1.6); background: #fff; border: calc(var(--u) * .22) solid var(--ink); box-shadow: calc(var(--u) * .45) calc(var(--u) * .45) 0 var(--ink);
}
.cm-month strong { font-size: calc(var(--u) * 2.3); font-weight: 600; line-height: 1.2; white-space: nowrap; }
.cm-dots { display: flex; gap: calc(var(--u) * .6); }
.cm-month.now { background: var(--terra); color: #fff; }
.cm-month em { position: absolute; right: calc(var(--u) * 1); top: calc(var(--u) * -1.2); font-style: normal; font-size: calc(var(--u) * 1.4); font-weight: 700; padding: 0 calc(var(--u) * 1); border-radius: 999px; background: var(--ink); color: var(--cream); white-space: nowrap; }
.cm-months.on .cm-head { animation: cm-up .5s ease .25s both; }
.cm-months.on .cm-month { animation: cm-card .55s cubic-bezier(.2, 1.4, .4, 1) calc(.35s + var(--i) * 75ms) both; }
.cm-months.on .cm-dots i { animation: cm-blip .5s ease calc(1.7s + var(--i) * 190ms) both; }
.cm-months.on .cm-dots i:nth-child(2) { animation-delay: calc(1.78s + var(--i) * 190ms); }
.cm-months.on .cm-dots i:nth-child(3) { animation-delay: calc(1.86s + var(--i) * 190ms); }
.cm-months.on .cm-month.now { animation: cm-card .55s cubic-bezier(.2, 1.4, .4, 1) calc(.35s + var(--i) * 75ms) both, cm-now 1s ease-in-out 4.1s 2; }

/* scene 4: closing card */
.cm-end { background: var(--terra); color: #fff; --o: 50% 50%; }
.cm-end img { width: calc(var(--u) * 9); height: auto; background: #fff; border-radius: 50%; padding: calc(var(--u) * .8); }
.cm-trio { display: flex; align-items: center; gap: calc(var(--u) * 2.2); font-size: calc(var(--u) * 11); font-weight: 700; line-height: 1.05; }
.cm-trio i { width: calc(var(--u) * 1.3); aspect-ratio: 1; border-radius: 50%; background: var(--yellow); }
.cm-end .cm-what b { font-size: calc(var(--u) * 3.2); font-weight: 600; }
.cm-end .cm-ring { border-color: rgba(255, 255, 255, .3); }
.cm-end.on img { animation: cm-pop .5s cubic-bezier(.2, 1.5, .4, 1) .2s both; }
.cm-end.on .cm-trio b { animation: cm-slam .5s cubic-bezier(.2, 1.5, .35, 1) .3s both; }
.cm-end.on .cm-trio b:nth-of-type(2) { animation-delay: .42s; } .cm-end.on .cm-trio b:nth-of-type(3) { animation-delay: .54s; }
.cm-end.on .cm-trio i { animation: cm-pop .4s ease .7s both; }
.cm-end.on .cm-what b { animation: cm-up .5s ease .8s both; }

/* progress bar and pause button */
.cm-bar { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(29, 26, 26, .12); }
.cm-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--pink), var(--yellow)); }
.cm-toggle {
  position: absolute; z-index: 5; right: 12px; bottom: 16px; width: 38px; height: 38px; border: 0; border-radius: 50%; cursor: pointer;
  font-size: .8rem; color: #fff; background: rgba(29, 26, 26, .55); opacity: 0; transition: opacity .2s, background .2s;
}
.cal-motion:hover .cm-toggle, .cm-toggle:focus-visible, .cal-motion.paused .cm-toggle { opacity: 1; }
.cm-toggle:hover { background: rgba(29, 26, 26, .8); }
@media (hover: none) { .cm-toggle { opacity: 1; } }
.cal-motion.still .cm-bar, .cal-motion.still .cm-toggle { display: none; }

@keyframes cm-reveal { from { clip-path: circle(0% at var(--o, 50% 50%)); } to { clip-path: circle(150% at var(--o, 50% 50%)); } }
@keyframes cm-fade { from { opacity: 0; } }
@keyframes cm-up { from { opacity: 0; transform: translateY(110%); } }
@keyframes cm-pop { from { opacity: 0; transform: scale(.4); } }
@keyframes cm-grow { from { transform: scaleX(0); } }
@keyframes cm-slam { from { opacity: 0; transform: scale(2.6) rotate(-8deg); } }
@keyframes cm-spin { to { rotate: 360deg; } }
@keyframes cm-ring-in { from { opacity: 0; transform: scale(.3); } }
@keyframes cm-shape-in { from { opacity: 0; transform: scale(0) rotate(-90deg); } to { transform: rotate(var(--r)); } }
@keyframes cm-float { 0%, 100% { transform: translateY(0) rotate(var(--r)); } 50% { transform: translateY(calc(var(--u) * -1.4)) rotate(calc(var(--r) + 6deg)); } }
@keyframes cm-card { from { opacity: 0; transform: translateY(60%) scale(.7) rotate(-6deg); } }
@keyframes cm-blip { 40% { transform: scale(1.55); box-shadow: 0 0 0 calc(var(--u) * .5) rgba(255, 255, 255, .8); } }
@keyframes cm-now { 50% { transform: scale(1.09) rotate(-2deg); } }

/* phones: a taller stage with three columns, so the months stay readable */
@media (max-width: 640px) {
  .cal-motion { --u: 1.75cqw; aspect-ratio: 4 / 5; }
  .cm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cm-head { flex-direction: column; align-items: flex-start; gap: calc(var(--u) * .8); }
  .cm-legend { flex-wrap: wrap; gap: calc(var(--u) * .6) calc(var(--u) * 1.4); }
  .cm-line b { font-size: calc(var(--u) * 5.4); }
  .cm-what b { font-size: calc(var(--u) * 3.2); }
  .cm-shape.s5 { display: none; }
}

/* ===== Admin: users and roles ===== */
.btn.sm { padding: 6px 14px; font-size: .92rem; gap: 6px; }
.btn.sm svg { width: 16px; height: 16px; }
.btn.danger { background: var(--surface); color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, var(--line)); box-shadow: none; }
.btn.danger:hover { background: color-mix(in srgb, var(--err) 9%, var(--surface)); color: var(--err); border-color: var(--err); }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.pw-show { font-family: ui-monospace, Consolas, monospace; font-size: 1.1em; letter-spacing: .04em; user-select: all; }
.users-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.users-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.35rem; }
.users-head h2 svg { width: 24px; height: 24px; color: var(--accent); }
.users-head h2 span { color: var(--ink-soft); font-weight: 500; }
.users-head .btn svg { width: 18px; height: 18px; }
.role-legend { display: grid; gap: 8px; padding: 14px 16px; margin-bottom: 18px; border-radius: var(--radius); background: color-mix(in srgb, #f4c27a 12%, var(--surface)); border: 1px solid var(--line); }
.role-legend p { display: flex; align-items: baseline; gap: 10px; margin: 0; font-size: .95rem; }
.role-pill { display: inline-block; flex: none; padding: 1px 12px; border-radius: 999px; font-size: .84rem; font-weight: 700; white-space: nowrap; }
.role-pill.admin { background: #f8e7b8; color: #7a5410; }
.role-pill.committee { background: #dbe9fb; color: #24518c; }
.role-pill.researcher { background: #dcefe0; color: #2f6b3d; }
.users-table table { border-collapse: separate; border-spacing: 0; }
.users-table th { background: none; position: static; color: var(--ink-soft); font-weight: 600; border-bottom: 1px solid var(--line); padding: 12px 14px; }
.users-table td { padding: 16px 14px; vertical-align: middle; border-bottom: 1px solid var(--line); }
.users-table tbody tr:hover td { background: color-mix(in srgb, var(--band-soft) 35%, transparent); }
.users-table tr.is-off td { opacity: .62; }
.users-table tr.is-off td:last-child { opacity: 1; }
.u-name { display: block; font-family: "Prompt", sans-serif; font-weight: 600; white-space: nowrap; }
.u-mail { display: block; color: var(--ink-soft); font-size: .86rem; margin-top: 2px; }
.users-table select { width: auto; min-width: 150px; padding: 8px 12px; background: var(--surface); }
.users-table select:disabled { color: var(--ink-soft); background: var(--bg); cursor: not-allowed; }
.users-table .num { font-variant-numeric: tabular-nums; }
.users-table .when { color: var(--ink-soft); font-size: .86rem; white-space: nowrap; }
.state { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.state.on { background: #dcefe0; color: #2f6b3d; }
.state.off { background: color-mix(in srgb, var(--err) 14%, var(--surface)); color: var(--err); }
.state.lock { background: #f8e7b8; color: #7a5410; }
.u-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.u-self { font-size: .84rem; white-space: nowrap; }
.mail-card { margin-top: 26px; }
.mail-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.mail-card h3 svg { width: 22px; height: 22px; color: var(--accent); }
.mail-test { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.mail-test input { flex: 1 1 260px; width: auto; }

/* ===== Researcher: own documents and revisions ===== */
.doc-files { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.doc-files li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.df-info { display: grid; min-width: 0; }
.df-info strong { font-size: .95rem; }
.df-info small { color: var(--ink-soft); font-size: .84rem; overflow-wrap: anywhere; }
.df-act { display: flex; gap: 6px; flex: none; }
.replace-list { display: grid; gap: 8px; }
.replace-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 12px; border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: var(--radius-sm); background: var(--surface); font-weight: 400; }
.replace-row span { display: grid; }
.replace-row strong { font-size: .95rem; }
.replace-row small { color: var(--ink-soft); font-size: .82rem; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .doc-files li { flex-direction: column; align-items: stretch; }
  .df-act .btn { flex: 1; }
  .replace-row { grid-template-columns: minmax(0, 1fr); }
}

/* /admin for committee accounts: the submissions list only */
.role-committee .tabs [role="tab"]:not([data-tab="panel"]),
.role-committee .del, .role-committee [data-del-comment], .role-committee #storageBar { display: none !important; }
