@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url("vendor/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url("vendor/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("vendor/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
:root {
  --bg: #f6f4ef;
  --panel: #ffffff;
  --ink: #1d1b26;
  --muted: #6b6878;
  --line: #e4e0d6;
  --accent: #5b4bd6;
  --accent-ink: #ffffff;
  --sam: #ece8ff;
  --lyra: #ffffff;
  --warn: #b4441f;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e17;
    --panel: #17152a;
    --ink: #ece9f7;
    --muted: #a09cb8;
    --line: #2b2847;
    --accent: #a79bff;
    --accent-ink: #0f0e17;
    --sam: #2a2550;
    --lyra: #17152a;
    --warn: #ff9b73;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0e17; --panel: #17152a; --ink: #ece9f7; --muted: #a09cb8; --line: #2b2847;
  --accent: #a79bff; --accent-ink: #0f0e17; --sam: #2a2550; --lyra: #17152a; --warn: #ff9b73;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }

.app { display: flex; flex-direction: column; height: 100dvh; max-width: 860px; margin: 0 auto; position: relative; }
header.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--accent); }
.turn { display: flex; gap: 10px; align-items: flex-start; align-self: flex-start; max-width: 92%; }
.turn .avatar { width: 32px; height: 32px; margin-top: 2px; }
.turn .msg { max-width: 100%; min-width: 0; }
.hero { display: block; width: calc(100% + 48px); margin: -24px -24px 16px; border-radius: 16px 16px 0 0; aspect-ratio: 709 / 475; object-fit: cover; }
.brand small { color: var(--muted); font-weight: 400; }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; white-space: nowrap; }
button.link:hover { color: var(--ink); }

#log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 92%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--sam); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--lyra); border-bottom-left-radius: 4px; }
.msg p:first-child { margin-top: 0; } .msg p:last-child { margin-bottom: 0; }
.msg pre { background: var(--bg); padding: 10px; border-radius: 8px; overflow-x: auto; font: 14px/1.45 var(--mono); }
.msg code { font-family: var(--mono); font-size: .92em; }
.msg table { border-collapse: collapse; display: block; overflow-x: auto; }
.msg th, .msg td { border: 1px solid var(--line); padding: 4px 8px; }
.msg .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.att { font-size: 13px; color: var(--muted); margin-top: 6px; }
.status { align-self: flex-start; margin-left: 42px; font-size: 14px; color: var(--muted); font-style: italic; }
.error { color: var(--warn); }

form.composer { border-top: 1px solid var(--line); padding: 10px 16px 14px; background: var(--bg); }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip { font-size: 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; margin-left: 4px; }
.row { display: flex; gap: 8px; align-items: flex-end; }
textarea {
  flex: 1; resize: none; min-height: 46px; max-height: 40vh; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit;
}
textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.icon-btn, .send {
  height: 46px; min-width: 46px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer;
  background: var(--panel); color: var(--ink); font: inherit;
}
.send { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); padding: 0 16px; font-weight: 700; }
.send:disabled { opacity: .5; cursor: default; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* login and admin */
.center { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.card h1 { margin: 0 0 4px; font-size: 22px; }
.card p { margin: 0 0 16px; color: var(--muted); }
.card label { display: block; font-size: 14px; margin: 12px 0 4px; }
.card input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; }
.card .send { width: 100%; margin-top: 18px; }
.wide { max-width: 860px; margin: 0 auto; padding: 16px; }
.wide table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wide th, .wide td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 12px 0 20px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.tile b { display: block; font-size: 24px; }
.tile span { color: var(--muted); font-size: 13px; }

/* ---------- chats sidebar ---------- */
.shell { display: flex; height: 100dvh; }
.shell .app { flex: 1; min-width: 0; height: 100dvh; }
.sidebar {
  width: 270px; flex: none; display: flex; flex-direction: column; gap: 8px;
  padding: 14px 10px; border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto;
}
.newchat {
  height: 42px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent);
  color: var(--accent-ink); font: inherit; font-weight: 700; cursor: pointer;
}
.convlabel { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 6px 2px; }
.conv { display: flex; align-items: center; border-radius: 10px; }
.conv:hover, .conv.active { background: var(--sam); }
.convbtn {
  flex: 1; min-width: 0; text-align: left; background: none; border: 0; color: var(--ink); font: inherit;
  padding: 8px 8px; cursor: pointer; display: flex; flex-direction: column;
}
.convbtn .ct { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.convbtn .cd { font-size: 12px; color: var(--muted); }
.convdel { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 10px; visibility: hidden; font: inherit; }
.conv:hover .convdel, .conv.active .convdel { visibility: visible; }
.convdel:hover { color: var(--warn); }
.menu { display: none; height: 36px; min-width: 36px; }
.brand span { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.brand small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.scrim { display: none; }
@media (max-width: 760px) {
  .menu { display: inline-block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 30px rgba(0,0,0,.4); }
  body.show-side .sidebar { transform: none; }
  body.show-side .scrim { display: block; position: fixed; inset: 0; z-index: 10; background: rgba(0,0,0,.4); }
}

/* ---------- attachments ---------- */
.atts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.atts:last-child { margin-bottom: 0; }
.thumb { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; background: var(--bg); }
.filechip { display: inline-block; font-size: 13px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-decoration: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chipimg { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.8); display: grid; place-items: center; cursor: zoom-out; padding: 16px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ---------- empty chat ---------- */
.empty { margin: auto; text-align: center; color: var(--muted); }
.empty img { border-radius: 50%; box-shadow: 0 0 0 3px var(--accent); }

/* ---------- sketchpad ---------- */
.sketch { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bg); }
.sketch[hidden] { display: none; }
body.sketching { overflow: hidden; }
.sketchbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel); align-items: center; }
.sgroup { display: flex; gap: 4px; align-items: center; padding-right: 8px; border-right: 1px solid var(--line); }
.sgroup:last-child { border-right: 0; }
.sright { margin-left: auto; }
.sbtn { min-height: 40px; min-width: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.sbtn.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.sbtn.swatch { padding: 0; width: 34px; min-width: 34px; height: 34px; min-height: 34px; border-radius: 50%; border: 2px solid var(--panel); }
.sprimary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.sketchstage { position: relative; flex: 1; margin: 10px; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.sketchstage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sketchink { touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.sketchhint { font-size: 12px; color: var(--muted); padding: 0 12px 8px; }
.markup { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 16px; padding: 0 2px; }

/* ---------- equations (MathJax SVG) ---------- */
.msg mjx-container[display="true"] { display: block; overflow-x: auto; overflow-y: hidden; margin: 10px 0; padding: 4px 0; }
.msg mjx-container.eq { cursor: zoom-in; border-radius: 8px; }
.msg mjx-container.eq:hover { background: var(--sam); }
.eqviewer { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.eqviewer[hidden] { display: none; }
.eqcard { background: #ffffff; color: #111111; border-radius: 14px; padding: 20px; max-width: min(96vw, 900px); width: 100%; }
.eqbig { overflow-x: auto; text-align: center; font-size: 200%; padding: 12px 0; }
.eqbig svg { max-width: none; }
.eqbtns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.eqbtns button { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid #d8d4e8; background: #f4f2fb; color: #111; font: inherit; cursor: pointer; }
.eqbtns button[data-a="save"] { background: #5b4bd6; color: #fff; border-color: #5b4bd6; font-weight: 700; }
.eqmsg { text-align: center; font-size: 14px; color: #555; margin-top: 8px; min-height: 1.2em; }
/* MathJax SVG base styles (the page inserts equations as HTML, so MathJax's own sheet is not added) */
mjx-container[jax="SVG"] { direction: ltr; }
mjx-container[jax="SVG"] > svg { overflow: visible; min-height: 1px; min-width: 1px; }
mjx-container[jax="SVG"][display="true"] { display: block; text-align: center; }
mjx-assistive-mml { position: absolute !important; top: 0; left: 0; clip: rect(1px, 1px, 1px, 1px); padding: 1px 0 0 0 !important; border: 0 !important; display: block !important; width: auto !important; overflow: hidden !important; user-select: none; }
mjx-container { position: relative; }

/* ---------- full-width chat frame ---------- */
:root { --side-w: 270px; }
.sidebar { width: var(--side-w); }
.shell .app { max-width: none; margin: 0; width: calc(100% - var(--side-w)); flex: 1 1 auto; }
.msg, .turn { max-width: min(96%, 1200px); }
.turn .msg { max-width: 100%; }
@media (max-width: 760px) {
  .shell .app { width: 100%; }
}

/* ---------- header actions ---------- */
.homebtn { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; border-radius: 999px; }
.homebtn:focus-visible, .pill:focus-visible, .link:focus-visible, .continue:focus-visible, .links a:focus-visible, .links summary:focus-visible, .newsitem a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand { min-width: 0; }
.baractions { display: flex; align-items: center; gap: 14px; flex: none; }
.pill { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.pill:hover, .pill[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.hintrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hintrow .hint { min-width: 0; }
button.link.urgent { font-size: 13px; text-decoration: underline; text-underline-offset: 3px; flex: none; margin-top: 6px; padding: 0; }

/* ---------- home: news ---------- */
.home { width: 100%; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.homehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.homehead h1 { margin: 0; font-size: 26px; line-height: 1.2; }
.continue { display: flex; align-items: center; gap: 10px; max-width: 100%; min-height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: inherit; cursor: pointer; }
.continue .clabel { font-weight: 700; }
.continue .ctitle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue .cdate { font-size: 13px; opacity: .8; white-space: nowrap; }
.newsmeta { margin: 0; color: var(--muted); font-size: 14px; }
.newsgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.newscard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.newscard h2 { margin: 0 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.newsitem { padding: 10px 0; border-top: 1px solid var(--line); }
.newscard h2 + .newsitem { border-top: 0; }
.newstitle { color: var(--ink); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.newstitle:hover { color: var(--accent); text-decoration: underline; }
.newssyn { margin: 4px 0 0; font-size: 15px; }
.newsfoot { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.newsopen { color: var(--accent); text-decoration: none; white-space: nowrap; font-weight: 700; }
.newsopen::after { content: " \2197"; }
.newsopen:hover { text-decoration: underline; }
.newsempty { margin: 8px 0 2px; color: var(--muted); font-size: 14px; }
@media (max-width: 980px) { .newsgrid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- McMaster links panel ---------- */
.links { width: 330px; flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--panel); height: 100dvh; }
.links[hidden] { display: none; }
.linkshead { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.linkshead h2 { margin: 0; font-size: 17px; }
.linkshead .icon-btn { height: 36px; min-width: 36px; font-size: 20px; line-height: 1; }
.linksbody { flex: 1; overflow-y: auto; padding: 6px 10px; }
.linkgroup { border-bottom: 1px solid var(--line); }
.linkgroup:last-child { border-bottom: 0; }
.linkgroup summary { cursor: pointer; padding: 12px 6px; font-weight: 700; font-size: 14px; border-radius: 8px; }
.linkgroup ul { list-style: none; margin: 0 0 8px; padding: 0; }
.linkrow { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.linkrow:hover { background: var(--sam); }
.linklabel { font-size: 15px; }
.linklabel::after { content: " \2197"; color: var(--muted); font-size: 12px; }
.linkhint { font-size: 13px; color: var(--muted); }
.urgentbox { margin: 0 6px 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; }
.urgentbox dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; }
.urgentbox dt:first-child { margin-top: 0; }
.urgentbox dd { margin: 0; font-weight: 700; }
.linksfoot { margin: 0; padding: 10px 16px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.linkscrim { display: none; }
body.show-links .shell .app { width: auto; }
@media (max-width: 1100px) {
  .links { position: fixed; inset: auto 0 0 0; z-index: 30; width: 100%; height: auto; max-height: 82dvh; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.4); }
  body.show-links .linkscrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.45); }
}
@media (max-width: 760px) {
  .pill { padding: 0 10px; font-size: 13px; }
  .brand small { display: none; }
  .homehead h1 { font-size: 22px; }
}

/* ---------- calendar ---------- */
.sidebar { overflow: hidden; }
#convs { flex: 1 1 auto; min-height: 60px; overflow-y: auto; }
.comingup { flex: none; border-top: 1px solid var(--line); padding-top: 4px; }
.comingup .convlabel { margin-top: 8px; }
#cuplist { list-style: none; margin: 4px 0 8px; padding: 0; }
.cupitem { padding: 6px 6px; border-radius: 8px; }
.cupdate { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.cupin { color: var(--accent); white-space: nowrap; }
.cuptitle { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.cupempty { font-size: 13px; color: var(--muted); padding: 6px; }
.calbtn { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.calbtn:hover { border-color: var(--accent); color: var(--accent); }
.calbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.checktag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--warn); color: var(--warn); font-size: 11px; line-height: 16px; vertical-align: 1px; text-transform: uppercase; letter-spacing: .04em; }
.nextdate { margin: 0; font-size: 15px; }
.calview { width: 100%; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.calbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.calbar h1 { margin: 0; font-size: 26px; line-height: 1.2; }
.calnav { display: flex; gap: 8px; }
.calmonth, .callist { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.calmonth h2, .callist h2 { margin: 0 0 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.callist h3 { margin: 14px 0 4px; font-size: 14px; color: var(--muted); font-weight: 400; }
.callist h2 + h3 { margin-top: 0; }
.calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calhead { font-size: 12px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.calcell { min-height: 84px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 5px; background: var(--bg); overflow: hidden; }
.calcell.blank { border: 0; background: none; }
.calcell.past { opacity: .55; }
.calcell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); opacity: 1; }
.calnum { font-size: 12px; color: var(--muted); }
.calcell.today .calnum { color: var(--accent); font-weight: 700; }
.calchip { font-size: 12px; line-height: 1.25; margin-top: 3px; padding: 2px 5px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calchip.k-term { background: var(--line); color: var(--ink); }
.calchip.k-course { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.calchip.ischeck { background: none; color: var(--warn); border: 1px dashed var(--warn); }
.calmore { font-size: 11px; color: var(--muted); margin-top: 2px; }
.calrow { display: grid; grid-template-columns: minmax(150px, 240px) minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.callist h3 + .calrow, .callist h2 + .calrow { border-top: 0; }
.calrow.past { opacity: .55; }
.calwhen { font-size: 14px; color: var(--muted); }
.caltitle { font-weight: 700; }
.calmeta { display: block; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) {
  .calmonth { display: none; }                 /* a month grid is too small on a phone; the date list stays */
  .calrow { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .calbar h1 { font-size: 22px; }
  .calnav { display: none; }
  .sidebar { overflow: hidden; }
}

/* ---------- profile ---------- */
:root[data-theme="light"] {
  --bg: #f6f4ef; --panel: #ffffff; --ink: #1d1b26; --muted: #6b6878; --line: #e4e0d6;
  --accent: #5b4bd6; --accent-ink: #ffffff; --sam: #ece8ff; --lyra: #ffffff; --warn: #b4441f;
}
:root.ts-large body { font-size: 18px; }
:root.ts-larger body { font-size: 20px; }
:root.ts-large .newssyn, :root.ts-large .cuptitle, :root.ts-large .linklabel { font-size: 17px; }
:root.ts-larger .newssyn, :root.ts-larger .cuptitle, :root.ts-larger .linklabel { font-size: 19px; }
.avatarbtn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--sam); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; flex: none; }
.avatarbtn:hover { border-color: var(--accent); }
.avatarbtn:focus-visible, .segbtn:focus-visible, .setinput:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.profileview { width: 100%; max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.profileview h1 { margin: 0; font-size: 26px; line-height: 1.2; }
.setcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.setcard h2 { margin: 0 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.setrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.setcard h2 + .setrow { border-top: 0; }
.settext { flex: 1 1 260px; min-width: 0; }
.setlabel { font-weight: 700; display: block; }
.sethelp { font-size: 13px; color: var(--muted); margin: 0; display: block; }
.savenote { font-size: 12px; color: var(--accent); min-height: 16px; }
.savenote.error { color: var(--warn); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.segbtn { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.segbtn:hover { border-color: var(--accent); }
.segbtn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.setinput { height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; width: 180px; max-width: 100%; }
.checks { display: flex; flex-direction: column; gap: 6px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.rules { list-style: none; margin: 6px 0 0; padding: 0; }
.rules li { padding: 10px 0; border-top: 1px solid var(--line); }
.rules li:first-child { border-top: 0; }
.rule { display: block; font-weight: 700; }
@media (max-width: 760px) {
  #logout { display: none; }                  /* the header is narrow on a phone; Sign out is on the Profile screen */
  .baractions { gap: 8px; }
  .seg { width: 100%; }
}

/* ---------- admin: users ---------- */
.wide h2 { font-size: 16px; margin: 22px 0 6px; }
.adduser { margin: 16px 0 26px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.adduser h3 { margin: 0 0 10px; font-size: 14px; }
.adduser .wideinput { width: 100%; margin-top: 8px; }
.wide td .pill { height: 30px; font-size: 13px; }
.wide #usernote { font-size: 15px; min-height: 22px; overflow-wrap: anywhere; user-select: all; }
/* ---------- admin: welcome email draft ---------- */
.maildraft { margin: -10px 0 26px; padding: 14px 16px; border: 1px solid var(--accent); border-radius: 14px; background: var(--panel); }
.maildraft h3 { margin: 0 0 4px; font-size: 14px; }
.maildraft .inline { margin-top: 10px; }
.maildraft .mailto { width: 340px; }
.maildraft select.setinput { width: auto; }
.mailsubject { font-size: 14px; margin: 12px 0 6px; }
.mailbody { font-size: 14px; line-height: 1.5; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow-wrap: anywhere; }
.mailbody a { color: var(--accent); }
a.pill { display: inline-flex; align-items: center; text-decoration: none; }

/* Drag and drop attach, 2026-10-13 */
.dropzone { position: absolute; inset: 8px; z-index: 40; display: grid; place-items: center; border: 3px dashed var(--accent); border-radius: 16px; background: color-mix(in srgb, var(--bg) 85%, transparent); pointer-events: none; }
.dropzone[hidden] { display: none; }
.dropcard { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 26px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.dropcard b { font-size: 18px; color: var(--accent); }
.dropcard span { font-size: 13px; color: var(--muted); }
.hint.hintwarn { color: var(--warn); }
