/* GMUN 2027 Resolution Desk
   Navy from the conference seal, warm paper background, serif headings like a printed resolution. */
:root {
  --navy: #161c52; --brand: #343f93; --brand-ink: #ffffff; --brand-soft: #e8e9f4;
  --bg: #f5f4ef; --surface: #ffffff; --ink: #1b1e2b; --muted: #5f6474; --line: #dddbd3; --line-strong: #c4c1b6;
  --ok: #2c6b40; --ok-soft: #e4efe5; --warn: #8a5800; --warn-soft: #f7ecd6; --bad: #a3312f; --bad-soft: #f6e2e0;
  --f-body: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --f-doc: "Source Serif 4", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #0e1236; --brand: #9aa5f0; --brand-ink: #0e1236; --brand-soft: #23284d;
    --bg: #13151d; --surface: #1b1e29; --ink: #e8e9ee; --muted: #a1a5b3; --line: #2e3241; --line-strong: #444a5c;
    --ok: #7fc795; --ok-soft: #1c3124; --warn: #e2b562; --warn-soft: #382b12; --bad: #ee8f89; --bad-soft: #3b1f1e;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1100px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); padding-block: 36px 80px; }
body.out .wrap { max-width: none; padding: 0; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

h1 { font: 600 clamp(28px, 4vw, 38px)/1.15 var(--f-doc); letter-spacing: -.01em; margin: 2px 0 0; text-wrap: balance; }
h2 { font-size: 18px; margin: 0; }
h2.section { font: 600 20px/1.3 var(--f-doc); color: var(--ink); margin: 40px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 14px; color: var(--muted); font-weight: 600; }
.lede { color: var(--muted); font-size: 17px; margin: 8px 0 0; max-width: 62ch; }
.lede b { color: var(--ink); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.hint { font-weight: 400; font-size: 13.5px; color: var(--muted); }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; } .mt24 { margin-top: 24px; }
.who { font-size: 14px; color: var(--muted); }

/* ---------- Signed-in top bar ---------- */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top, 0px); }
.topbar-in { max-width: 1280px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: flex; flex-wrap: wrap; align-items: center; gap: 0 28px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; padding-block: 10px; }
.brand img { width: 36px; height: auto; }
.brand .mark { font: 600 18px var(--f-doc); }
.brand-sub { font-size: 14px; color: rgba(255,255,255,.7); padding-left: 10px; border-left: 1px solid rgba(255,255,255,.3); }
.mainnav { display: flex; flex-wrap: nowrap; flex: 1; align-self: stretch; min-width: 0; }
.mainnav a { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; font-size: 15px; color: rgba(255,255,255,.75); text-decoration: none; padding: 0 12px; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.mainnav a:hover { color: #fff; }
.mainnav a[aria-current="page"] { color: #fff; border-bottom-color: #fff; }
.mainnav .count:not(:empty) { font-size: 12px; font-weight: 700; background: #fff; color: var(--navy); border-radius: 3px; padding: 0 5px; line-height: 1.5; }
.me { display: flex; align-items: center; gap: 12px; font-size: 14px; color: rgba(255,255,255,.8); flex-wrap: wrap; padding-block: 10px; }
.me select { width: auto; padding: 5px 8px; font-size: 14px; }
.me .username { display: none; }
.topbar .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.topbar .btn.ghost:hover { border-color: #fff; }
@media (max-width: 980px) {
  .topbar-in { gap: 0 16px; }
  .mainnav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; margin-inline: -12px; }
  .mainnav a { padding: 10px 12px; white-space: nowrap; }
  .me { margin-left: auto; }
  .me #me-label { display: none; }
}

/* ---------- Sign-in page ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; background: #0f1440; color: #fff; overflow: hidden; isolation: isolate; }
.glow { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; }
.glow i { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; -webkit-filter: blur(90px); filter: blur(90px); mix-blend-mode: screen; opacity: .35; will-change: opacity, transform; }
.glow i:nth-child(1) { background: #3d52e0; left: -25vmax; top: -30vmax; animation: pulse 9s ease-in-out infinite alternate, drift1 26s ease-in-out infinite alternate; }
.glow i:nth-child(2) { background: #14a58a; right: -30vmax; top: -10vmax; animation: pulse 12s ease-in-out -4s infinite alternate, drift2 30s ease-in-out infinite alternate; }
.glow i:nth-child(3) { background: #8d47d6; left: 5vmax; bottom: -40vmax; animation: pulse 10s ease-in-out -7s infinite alternate, drift3 34s ease-in-out infinite alternate; }
.glow i:nth-child(4) { background: #d98d2b; right: -20vmax; bottom: -45vmax; width: 55vmax; height: 55vmax; animation: pulse 14s ease-in-out -2s infinite alternate, drift1 38s ease-in-out -10s infinite alternate-reverse; }
@keyframes pulse { 0% { opacity: .1; } 45% { opacity: .7; } 100% { opacity: .25; } }
@keyframes drift1 { to { transform: translate(14vmax, 10vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-16vmax, 12vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(12vmax, -14vmax) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .glow i:nth-child(1) { animation: pulse 9s ease-in-out infinite alternate; } .glow i:nth-child(2) { animation: pulse 12s ease-in-out -4s infinite alternate; } .glow i:nth-child(3) { animation: pulse 10s ease-in-out -7s infinite alternate; } .glow i:nth-child(4) { animation: pulse 14s ease-in-out -2s infinite alternate; } }
.hero-bar { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 20px max(24px, env(safe-area-inset-left, 0px)); padding-top: max(20px, env(safe-area-inset-top, 0px)); }
.hero-name { font: 600 16px var(--f-doc); letter-spacing: .01em; color: rgba(255,255,255,.85); }
.btn.on-dark { background: #fff; color: var(--navy); padding: 10px 22px; white-space: nowrap; flex: none; }
@media (max-width: 520px) { .hero-name { font-size: 14px; } .btn.on-dark { padding: 9px 16px; } }
.btn.on-dark:hover { background: #eceefb; }
.hero-body { display: grid; justify-items: center; align-content: center; text-align: center; padding: 8px 20px 24px; gap: 6px; }
/* The seal sits on its own navy disc with a faint Gordon's-green glow that breathes slowly. */
.seal-wrap { position: relative; width: min(380px, 68vw, 46vh); aspect-ratio: 1; margin-bottom: 3%; }
.seal-wrap::before { content: ""; position: absolute; top: -9%; right: -9%; bottom: -9%; left: -9%; border-radius: 50%; background: radial-gradient(circle, rgba(60,200,110,0) 48%, rgba(60,200,110,.85) 60%, rgba(40,160,85,.35) 72%, rgba(40,160,85,0) 86%); filter: blur(12px); opacity: .5; animation: greenpulse 5.5s ease-in-out infinite; }
.seal-wrap::after { content: ""; position: absolute; top: -1.5%; right: -1.5%; bottom: -1.5%; left: -1.5%; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #232b78 0%, #141a4c 70%); box-shadow: inset 0 0 0 1.5px rgba(120,210,150,.28), 0 18px 50px rgba(0,0,0,.35); }
.seal { position: relative; z-index: 1; display: block; width: 100%; height: auto; }
@keyframes greenpulse { 0%, 100% { opacity: .35; transform: scale(.99); } 50% { opacity: .8; transform: scale(1.03); } }

.hero-body h1 { font-size: clamp(32px, 5vw, 52px); color: #fff; margin-top: 22px; }
.hero-body p { margin: 0; font-size: 18px; color: rgba(255,255,255,.78); max-width: 40ch; }
.hero-more { justify-self: center; margin-bottom: 26px; color: rgba(255,255,255,.75); font-size: 15px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.35); padding-bottom: 2px; }
.hero-more:hover { color: #fff; border-color: #fff; }
.hub-below { max-width: 1100px; margin: 0 auto; padding: 56px max(20px, env(safe-area-inset-left, 0px)) 72px; }
.hub-below > h2 { font: 600 30px var(--f-doc); margin-bottom: 24px; }
.committee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 40px; }
.committee { padding: 18px 0 20px; border-top: 2px solid var(--ink); }
.committee h3 { margin: 0; font: 600 20px var(--f-doc); }
.committee .full-name { margin: 2px 0 10px; color: var(--muted); font-size: 14.5px; }
.committee ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 15px; }
.hub-foot { margin-top: 40px; color: var(--muted); font-size: 15px; }
.login-dialog { border: 0; border-radius: 6px; padding: 0; width: min(400px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgba(0,0,0,.35); }
dialog:not([open]) { display: none; }
.dlg-fallback .login-dialog { position: fixed; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); z-index: 100; margin: 0; }
.login-dialog::backdrop { background: rgba(8, 10, 30, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.login-dialog form { padding: 26px 28px 22px; gap: 16px; }
.login-head { display: flex; justify-content: space-between; align-items: center; }
.login-head h2 { font: 600 24px var(--f-doc); }
.x { border: 0; background: none; font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.x:hover { color: var(--ink); }
.login-dialog .btn[type="submit"] { padding: 11px; }

/* ---------- Page structure ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px 24px; margin-bottom: 24px; }
.page-head select { width: auto; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 10px; margin: 40px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.section-head h2.section { margin: 0; padding: 0; border: 0; }
.section-head input { max-width: 260px; }
.banner { padding: 12px 16px; border-left: 4px solid var(--warn); font-size: 15px; margin-bottom: 20px; background: var(--warn-soft); color: var(--ink); }
.banner.info { background: var(--brand-soft); border-left-color: var(--brand); }
.banner.bad { background: var(--bad-soft); border-left-color: var(--bad); }
.banner.ok { background: var(--ok-soft); border-left-color: var(--ok); }

/* Dashboard */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
@media (max-width: 860px) { .home-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
.home-grid h2.section:first-child { margin-top: 8px; }
.side { border-top: 2px solid var(--ink); padding-top: 14px; }
.side h3 { font: 600 17px var(--f-doc); margin: 0 0 8px; }
.side h3:not(:first-child) { margin-top: 26px; }
.facts { margin: 0; display: grid; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.side .topic-list { font-size: 15px; }
.side .side-note { font-size: 14.5px; color: var(--muted); margin: 0; }

/* ---------- Forms ---------- */
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: start; }
@media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
form { display: grid; gap: 18px; }
fieldset { border: 0; border-top: 1px solid var(--line); padding: 16px 0 0; margin: 0; display: grid; gap: 14px; min-width: 0; }
fieldset:first-of-type { border-top: 0; padding-top: 0; }
legend { font: 600 19px var(--f-doc); color: var(--ink); padding: 0 12px 0 0; }
label, .field { display: grid; gap: 5px; font-weight: 600; font-size: 15px; }
label.check { display: flex; align-items: center; gap: 8px; align-self: end; padding-bottom: 10px; }
label.check input { width: 18px; height: 18px; accent-color: var(--brand); }
input, textarea, select { font: 400 16px var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 3px; padding: 9px 11px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
textarea { min-height: 120px; resize: vertical; font-family: var(--f-doc); font-size: 16.5px; line-height: 1.5; }
textarea.tall { min-height: 200px; }
textarea.short { min-height: 70px; font-family: var(--f-body); font-size: 15px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
.btn { font: 600 15px var(--f-body); border: 1px solid transparent; background: var(--brand); color: var(--brand-ink); padding: 9px 18px; border-radius: 3px; cursor: pointer; text-align: center; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink); filter: none; }
.btn.danger { background: transparent; color: var(--bad); border-color: currentColor; }
.btn.small { padding: 5px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
a.btn { text-decoration: none; display: inline-block; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.status-line { font-size: 14.5px; color: var(--muted); min-height: 1.4em; }
.status-line.bad { color: var(--bad); }
.card, .settings, .login { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 24px; }
.settings { margin-bottom: 16px; max-width: 760px; }
.amend { display: grid; gap: 16px; max-width: 780px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }
.chip-x { display: inline-flex; align-items: center; gap: 4px; font: 600 14px var(--f-body); background: var(--brand-soft); color: var(--ink); border-radius: 3px; padding: 3px 4px 3px 9px; }
.chip-x.locked { padding-right: 9px; }
.chip-x button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 17px; line-height: 1; padding: 0 4px; }
.chip-x button:hover { color: var(--bad); }

.picker { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 20; list-style: none; margin: 0; padding: 4px 0; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 3px; box-shadow: 0 10px 24px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; }
.suggest li { padding: 7px 12px; cursor: pointer; font-weight: 400; font-size: 15px; }
.suggest li:hover, .suggest li[aria-selected="true"] { background: var(--brand); color: var(--brand-ink); }

/* Format check */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 14.5px; }
.checks li { display: flex; gap: 8px; align-items: baseline; }
.dot { flex: none; width: 1em; text-align: center; font-weight: 700; color: var(--ok); }
.dot::before { content: "✓"; }
.checks li.warn .dot { color: var(--warn); } .checks li.warn .dot::before { content: "!"; }
.checks li.bad .dot { color: var(--bad); } .checks li.bad .dot::before { content: "✕"; }
.sticky { position: sticky; top: 88px; display: grid; gap: 18px; }
.sticky .eyebrow { font: 600 17px var(--f-doc); color: var(--ink); }
@media (max-width: 860px) { .sticky { position: static; } }

/* The resolution, set like a printed document */
.paper { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(20, 20, 40, .05); padding: 36px 40px; font-family: var(--f-doc); font-size: 16.5px; line-height: 1.6; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .paper { padding: 22px 18px; } }
.paper .code { font: 600 13px var(--f-body); color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 16px; }
.paper h3 { font: 700 21px/1.3 var(--f-doc); margin: 0 0 12px; text-wrap: balance; }
.paper .meta { font-family: var(--f-body); font-size: 14px; color: var(--muted); display: grid; gap: 2px; margin-bottom: 18px; }
.paper .meta b { color: var(--ink); font-weight: 600; }
.paper p { margin: 0 0 8px; }
.paper ol { margin: 10px 0 0; padding-left: 26px; }
.paper ol li { margin-bottom: 8px; }
.paper u { text-underline-offset: 3px; }
.paper .empty { color: var(--muted); font-style: italic; }

/* ---------- Lists of resolutions ---------- */
.docket { display: grid; gap: 12px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 16px 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; align-items: start; }
.item h3 { margin: 0; font: 600 18px/1.3 var(--f-doc); }
.item .sub { font-size: 14.5px; color: var(--muted); margin-top: 2px; }
.item .fb { grid-column: 1 / -1; font-size: 15px; border-left: 3px solid var(--brand); background: var(--bg); padding: 8px 12px; white-space: pre-wrap; }
.item .full { grid-column: 1 / -1; }
.item .right { display: grid; justify-items: end; gap: 6px; align-content: start; }
.right .chip, .right .btn { align-self: start; }
a.linkrow { text-decoration: none; color: var(--ink); }
a.linkrow:hover { border-color: var(--brand); }
a.linkrow:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.code-tag { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip { font: 600 13px var(--f-body); padding: 2px 8px; border-radius: 3px; white-space: nowrap; background: var(--brand-soft); color: var(--brand); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.neutral { background: transparent; color: var(--muted); border: 1px solid var(--line-strong); }
.summary { display: flex; flex-wrap: wrap; gap: 8px; }
.empty-state { border: 1px dashed var(--line-strong); border-radius: 4px; padding: 24px; color: var(--muted); font-size: 15px; }
.empty-state b { color: var(--ink); display: block; margin-bottom: 2px; font-weight: 600; }
.empty-state a { font-weight: 600; }
details.view summary { cursor: pointer; font-size: 15px; color: var(--brand); font-weight: 600; width: fit-content; }
details.view .paper { margin-top: 12px; }
.chair-edit { grid-column: 1 / -1; display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.chair-edit textarea { min-height: 70px; font-family: var(--f-body); font-size: 15px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.toolbar input[type="search"] { max-width: 260px; }
.toolbar select { width: auto; }

/* Admin overview */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
table.overview { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
table.overview th { text-align: left; font-size: 13.5px; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.overview td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.overview tr:last-child td { border-bottom: 0; }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Old uploaded documents */
.doc-box { display: grid; gap: 12px; font-family: var(--f-body); }
.doc-preview { border-top: 1px solid var(--line); padding-top: 14px; font-family: var(--f-doc); max-height: 70vh; overflow: auto; }
.doc-preview img { max-width: 100%; height: auto; }
.doc-preview table { border-collapse: collapse; }
.doc-preview td, .doc-preview th { border: 1px solid var(--line); padding: 4px 6px; }

/* ---------- Amendments ---------- */
.amends { border-top: 1px solid var(--line); padding-top: 12px; display: grid; }
.amends > .eyebrow { font: 600 16px var(--f-doc); color: var(--ink); }
.amend-list { display: grid; grid-template-columns: minmax(0, 1fr); padding-block: 4px; }
.amend-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.amend-row:last-child { border-bottom: 0; }
.amend-main { display: grid; gap: 4px; min-width: 0; }
.amend-text { font-family: var(--f-doc); font-size: 16.5px; overflow-wrap: anywhere; }
del { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1.5px; }
ins { color: var(--ok); text-decoration: underline; text-underline-offset: 3px; }
.hl-toolbar { display: grid; gap: 8px; }
.hl-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hl-actions input { width: auto; flex: 1 1 200px; padding: 6px 10px; font-size: 15px; }
.hl-editor { font-family: var(--f-doc); font-size: 18px; line-height: 1.75; padding: 18px 20px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); user-select: text; -webkit-user-select: text; cursor: text; overflow-wrap: anywhere; }
.hl-editor .w { border-radius: 2px; }
.hl-editor .w.picked { background: #fbe7a6; color: #1b1e2b; box-shadow: 0 0 0 2px #fbe7a6; }
.hl-editor .w.struck { color: var(--bad); text-decoration: line-through; opacity: .8; }
.hl-editor ::selection { background: #fbe7a6; color: #1b1e2b; }
.hl-after { font-family: var(--f-doc); font-size: 16.5px; line-height: 1.6; padding: 14px 16px; border-left: 3px solid var(--line-strong); background: var(--surface); overflow-wrap: anywhere; }
.hl-after .eyebrow { font-family: var(--f-body); font-size: 13.5px; }
.amended { font: 600 12px var(--f-body); color: var(--ok); margin-left: 6px; white-space: nowrap; font-style: italic; }
.topic-list { margin: 4px 0 0; padding-left: 22px; font-weight: 400; display: grid; gap: 4px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Clause builder ---------- */
.clause-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: cl; }
.clause-list:empty { display: none; }
.clause-list > li { border: 1px solid var(--line); border-bottom: 0; background: var(--surface); padding: 10px 12px; font-weight: 400; }
.clause-list > li:first-child { border-radius: 3px 3px 0 0; }
.clause-list > li:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 3px 3px; }
.clause-list > li:only-child { border-radius: 3px; }
.clause-list.ops > li { counter-increment: cl; padding-left: 40px; position: relative; }
.clause-list.ops > li::before { content: counter(cl) "."; position: absolute; left: 14px; top: 10px; font: 600 15px var(--f-doc); color: var(--muted); }
.clause-row { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; }
.clause-text { font-family: var(--f-doc); font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.sub-list { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 4px; }
.sub-list li::marker { font-family: var(--f-doc); color: var(--muted); }
.link-btn { border: 0; background: none; padding: 2px 0; font: 600 14px var(--f-body); color: var(--brand); cursor: pointer; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn.rm { color: var(--muted); font-weight: 400; font-size: 13.5px; }
.link-btn.rm:hover { color: var(--bad); }
.add-sub { margin-top: 6px; }
.clause-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.clause-add textarea { min-height: 0; resize: vertical; }
.clause-add > .btn { white-space: nowrap; }
.clause-add.sub { grid-template-columns: minmax(0, 1fr); margin-top: 8px; padding-left: 22px; }
@media (max-width: 520px) { .clause-add { grid-template-columns: minmax(0, 1fr); } .clause-add > .btn { justify-self: start; } }
.submitting-as { margin: 0 0 4px; font-weight: 400; }

/* ---------- Section colours ----------
   The top bar carries a soft, slowly drifting glow like the sign-in page. Each section has its
   own pair of colours, so moving between sections gently changes the light. A faint wash of the
   same colour sits behind the top of the page. */
/* One colour family per section, so every tab looks clearly different. */
body { --a1: #4f6bff; --a2: #38a3ff; }                                  /* Dashboard: blue */
body[data-view="write"]    { --a1: #1fbf74; --a2: #6fdc9c; }            /* Write a draft: green */
body[data-view="docket"]   { --a1: #8455ff; --a2: #b48bff; }            /* My committee: violet */
body[data-view="amend"]    { --a1: #f09a2a; --a2: #ffc85e; }            /* Amendments: amber */
body[data-view="review"]   { --a1: #18bcd6; --a2: #55dccd; }            /* Review: cyan */
body[data-view="settings"] { --a1: #7d8fae; --a2: #a9b6cc; }            /* Settings: slate */
.topbar { overflow: hidden; isolation: isolate; }
.bar-glow { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; pointer-events: none; }
.bar-glow i { position: absolute; top: -120%; width: 46%; height: 340%; border-radius: 50%; -webkit-filter: blur(42px); filter: blur(42px); opacity: .42; mix-blend-mode: screen;
  -webkit-transition: background-color 1.4s ease; transition: background-color 1.4s ease; will-change: transform, opacity; }
.bar-glow i:nth-child(1) { left: -12%; background-color: var(--a1); animation: barA 16s ease-in-out infinite alternate, barPulse 7s ease-in-out infinite alternate; }
.bar-glow i:nth-child(2) { left: 34%; background-color: var(--a2); animation: barB 19s ease-in-out infinite alternate, barPulse 9s ease-in-out -3s infinite alternate; }
.bar-glow i:nth-child(3) { right: -14%; background-color: var(--a1); animation: barC 22s ease-in-out infinite alternate, barPulse 8s ease-in-out -5s infinite alternate; }
body .bar-glow i:nth-child(1), body .bar-glow i:nth-child(3) { background-color: #4f6bff; } body .bar-glow i:nth-child(2) { background-color: #38a3ff; }
body[data-view="write"] .bar-glow i:nth-child(1), body[data-view="write"] .bar-glow i:nth-child(3) { background-color: #1fbf74; } body[data-view="write"] .bar-glow i:nth-child(2) { background-color: #6fdc9c; }
body[data-view="docket"] .bar-glow i:nth-child(1), body[data-view="docket"] .bar-glow i:nth-child(3) { background-color: #8455ff; } body[data-view="docket"] .bar-glow i:nth-child(2) { background-color: #b48bff; }
body[data-view="amend"] .bar-glow i:nth-child(1), body[data-view="amend"] .bar-glow i:nth-child(3) { background-color: #f09a2a; } body[data-view="amend"] .bar-glow i:nth-child(2) { background-color: #ffc85e; }
body[data-view="review"] .bar-glow i:nth-child(1), body[data-view="review"] .bar-glow i:nth-child(3) { background-color: #18bcd6; } body[data-view="review"] .bar-glow i:nth-child(2) { background-color: #55dccd; }
body[data-view="settings"] .bar-glow i:nth-child(1), body[data-view="settings"] .bar-glow i:nth-child(3) { background-color: #7d8fae; } body[data-view="settings"] .bar-glow i:nth-child(2) { background-color: #a9b6cc; }
body[data-view="awards"] .bar-glow i:nth-child(1), body[data-view="awards"] .bar-glow i:nth-child(3) { background-color: #e2b714; } body[data-view="awards"] .bar-glow i:nth-child(2) { background-color: #ffe066; }
@keyframes barA { to { transform: translateX(28%); } }
@keyframes barB { to { transform: translateX(-30%); } }
@keyframes barC { to { transform: translateX(-24%); } }
@keyframes barPulse { from { opacity: .26; } to { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .bar-glow i:nth-child(1) { animation: barPulse 7s ease-in-out infinite alternate; } .bar-glow i:nth-child(2) { animation: barPulse 9s ease-in-out -3s infinite alternate; } .bar-glow i:nth-child(3) { animation: barPulse 8s ease-in-out -5s infinite alternate; } }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--a1), var(--a2), transparent); opacity: .7; }
.mainnav a[aria-current="page"] { border-bottom-color: #fff; text-shadow: 0 0 14px rgba(255,255,255,.35); }


/* ---------- Polish ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; }
body:not(.out) .page-head .eyebrow:not(:empty)::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--a1), var(--a2)); }
.item, .card, .settings { box-shadow: 0 1px 2px rgba(20, 22, 50, .04), 0 4px 14px rgba(20, 22, 50, .04); }
a.item, .item.linkrow { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.item:hover, .item.linkrow:hover { transform: translateY(-1px); border-color: var(--line-strong); box-shadow: 0 2px 4px rgba(20, 22, 50, .05), 0 10px 24px rgba(20, 22, 50, .07); }
.btn { transition: filter .15s, background-color .15s, border-color .15s, box-shadow .15s; }
.btn:not(.ghost):not(.danger):not(.on-dark):hover { box-shadow: 0 4px 14px rgba(52, 63, 147, .28); }
main.wrap > section:not(#view-hub) { animation: viewIn .28s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes viewFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { main.wrap > section:not(#view-hub) { animation: viewFade .28s ease both; } }
.link-btn.danger-link { color: var(--bad); }
.item > .btn-row.full { padding-top: 4px; }

/* ---------- Joke awards & pop-ups ---------- */
body[data-view="awards"]   { --a1: #e2b714; --a2: #ffe066; }            /* Joke awards: gold */
.mainnav .count.award:not(:empty) { background: #ffd43b; color: #3a2c00; }
.pops { position: fixed; top: 76px; right: max(16px, env(safe-area-inset-right, 0px)); z-index: 30; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.pop { pointer-events: auto; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; box-shadow: 0 14px 40px rgba(10, 14, 50, .22); animation: popIn .35s cubic-bezier(.2, .9, .3, 1.2); }
.pop b { display: block; font-size: 15.5px; }
.pop p { margin: 2px 0 10px; font-size: 14px; color: var(--muted); }
.pop-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.award-pop { border-top: 3px solid #e2b714; }
.award-pop .pop-icon { background: linear-gradient(135deg, #ffe066, #e2b714); color: #3a2c00; }
.lock-pop { border-top: 3px solid var(--bad); }
.lock-pop .pop-icon { background: var(--bad-soft); color: var(--bad); }
.pop-icon.ok { background: var(--ok-soft); color: var(--ok); }
@keyframes popIn { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }
@media (max-width: 980px) { .pops { top: 112px; } }
@media (prefers-reduced-motion: reduce) { .pop { animation: none; } }
.card.awards { display: grid; gap: 14px; max-width: 760px; }
.award-q { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 8px 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.award-t { display: flex; gap: 10px; align-items: baseline; }
.award-n { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 50%; background: #fff3bf; color: #5c4600; font: 700 13px var(--f-body); margin-right: 8px; flex: none; }
.award-list { list-style: none; margin: 0; padding: 0; display: grid; }
.award-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.award-add { display: flex; gap: 10px; }
.award-add input { flex: 1; }
.award-result h3 { display: flex; align-items: baseline; }
.award-bars { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.award-bars li { display: grid; grid-template-columns: 140px 1fr 28px; gap: 10px; align-items: center; font-size: 14.5px; }
.award-bars li.win .award-c { font-weight: 700; }
.award-bar { height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.award-bar i { display: block; height: 100%; border-radius: 5px; background: var(--line-strong); }
.award-bars li.win .award-bar i { background: linear-gradient(90deg, #e2b714, #ffd43b); }
.award-bars b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .award-q { grid-template-columns: 1fr; } .award-bars li { grid-template-columns: 96px 1fr 24px; } .award-add { flex-direction: column; } }
.ok-pop { border-top: 3px solid var(--ok); }
#me-label { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me { flex: none; }
@media (max-width: 1320px) { .me #me-label { display: none; } }

/* General Assembly switch (GA chairs' dashboard) */
.ga-card { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 24px; border-left: 4px solid var(--brand); background: var(--brand-soft); }
.ga-card.live { border-left-color: var(--ok); background: var(--ok-soft); }
.ga-card p { margin: 6px 0 0; max-width: 62ch; }
.ga-card .btn-row { margin: 0; }

/* Not-found page */
body.not-found-page { background: var(--navy); color: #fff; min-height: 100vh; display: grid; place-items: center; margin: 0; }
.not-found { text-align: center; padding: 40px 16px; display: grid; gap: 14px; justify-items: center; }
.not-found h1 { margin: 6px 0 0; color: #fff; }
.not-found p { margin: 0 0 8px; opacity: .8; }
