/* NDCC eServices: graphite theme. Color only carries meaning (pass, fail, progress, caution). */
:root {
  --canvas: #303030;
  --shell: #121212;
  --panel: #1b1b1b;
  --raised: #262626;
  --raised-hover: #2f2f2f;
  --line: #2c2c2c;
  --line-strong: #3a3a3a;
  --ink: #ededed;
  --muted: #8a8a8a;
  --faint: #5e5e5e;
  --field-line: #6b6b6b;
  --placeholder: #7a7a7a;
  --gain: #3cc45a;
  --loss: #e5484d;
  --progress: #2f7ff0;
  --caution: #e0b43a;
  --hatch: repeating-linear-gradient(45deg, transparent 0 5px, var(--line) 5px 6px);
  --sans: "Fira Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "Sometype Mono", ui-monospace, Menlo, Consolas, monospace;
  --tabbar: 62px;
  --btn-hover: #ffffff;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--shell); }
body { min-height: 100vh; line-height: 1.45; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--muted); }
a:hover { text-decoration-color: var(--ink); }
img { max-width: 100%; }
h1 { font-size: 22px; font-weight: 500; line-height: 1.2; letter-spacing: -0.005em; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 500; line-height: 1.3; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 500; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-family: var(--mono); }
.boot { padding: 40px; text-align: center; color: var(--muted); }
svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- shell ---------- */
.app { min-height: 100vh; background: var(--shell); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 16px; padding-top: env(safe-area-inset-top);
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.topbar img { height: 30px; width: auto; }
.topbar .brand { font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none; }
.topbar .brand span { font-weight: 400; color: var(--muted); }
.topbar .who { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.layout { display: flex; min-height: calc(100vh - 52px); }
.sidebar { display: none; }
main { flex: 1; min-width: 0; padding: 20px 16px calc(var(--tabbar) + 24px + env(safe-area-inset-bottom)); max-width: 1000px; margin: 0 auto; width: 100%; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: var(--panel); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--tabbar); color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 500;
}
.tabbar a svg { width: 22px; height: 22px; stroke-width: 1.6; }
.tabbar a.active { color: var(--ink); }

@media (min-width: 860px) {
  .tabbar, .topbar { display: none; }
  .layout { min-height: 100vh; }
  .sidebar {
    display: flex; flex-direction: column; gap: 2px; width: 248px; flex-shrink: 0;
    position: sticky; top: 0; height: 100vh; overflow: hidden;
    background: var(--panel); border-right: 1px solid var(--line); padding: 14px 12px;
  }
  .sidebar a {
    display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: 7px;
    color: var(--muted); text-decoration: none; font-size: 14px;
    transition: background 140ms, color 140ms;
  }
  .sidebar a svg { width: 16px; height: 16px; stroke-width: 1.6; }
  .sidebar a:hover { background: var(--raised); color: var(--ink); }
  .sidebar a.active { background: var(--raised); color: var(--ink); }
  .sidebar .side-brand { flex-shrink: 0; min-height: 48px; margin-bottom: 10px; color: var(--ink); font-weight: 600; font-size: 15px; }
  .sidebar .side-brand:hover { background: none; }
  .sidebar .side-brand img { height: 30px; width: auto; }
  .sidebar .side-brand .muted { font-weight: 400; }
  .sidebar .group { margin: 16px 10px 4px; font-size: 13px; color: var(--muted); }
  /* Links scroll; the brand and your own name stay put. */
  .sidebar .side-nav { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px 8px; }
  .sidebar .side-me { flex-shrink: 0; margin-top: 8px; min-height: 56px; padding: 8px 10px; border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; }
  .sidebar .side-me .avatar { width: 32px; height: 32px; font-size: 12px; }
  .sidebar .side-me > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
  .sidebar .side-me .nm { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar .side-me .rk { font-size: 12px; color: var(--muted); }
  main { padding: 32px 40px 56px; max-width: 1080px; margin: 0; }
}

/* shortcut tiles */
.tools { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 8px; }
@media (min-width: 640px) { .tools { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .tools { grid-template-columns: repeat(3, 1fr); } }
.tool { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: background 140ms, border-color 140ms; }
.tool:hover { background: var(--raised); border-color: var(--line-strong); }
.tool-ic { width: 36px; height: 36px; border-radius: 7px; background: var(--raised); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tool-ic svg { width: 18px; height: 18px; color: var(--ink); }
.tool-tx { display: flex; flex-direction: column; gap: 3px; }
.tool-nm { font-weight: 500; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.tool-ds { font-size: 13px; color: var(--muted); line-height: 1.4; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 4px; background: var(--caution); color: var(--shell); font-size: 12px; font-weight: 500; }

/* ---------- building blocks ---------- */
.page-head { margin-bottom: 20px; }
.page-head .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .row > :last-child:not(:first-child) { margin-left: auto; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; font-size: 13px; text-decoration: none; color: var(--muted); }
.back:hover { color: var(--ink); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.card.tight { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head > :last-child:not(:first-child) { margin-left: auto; }
.grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 7px; border: 1px solid var(--line-strong);
  font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--ink); color: var(--shell); border-color: var(--ink);
  transition: background 140ms, border-color 140ms;
}
.btn:hover { background: var(--btn-hover); }
.btn.secondary { background: var(--raised); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--raised-hover); }
.btn.danger { background: var(--raised); color: var(--loss); border-color: var(--line-strong); }
.btn.danger:hover { background: var(--raised-hover); border-color: var(--loss); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 0 10px; }
.btn.ghost:hover { background: var(--raised); color: var(--ink); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.big { min-height: 52px; font-size: 15px; }
.btn:disabled { background: var(--panel) var(--hatch); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.icon-btn { background: none; border: 0; padding: 7px; border-radius: 7px; cursor: pointer; color: var(--muted); display: inline-flex; transition: background 140ms, color 140ms; }
.icon-btn:hover { background: var(--raised); color: var(--ink); }
.icon-btn:disabled { color: var(--muted); background: none; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-weight: 500; font-size: 13px; margin-bottom: 6px; color: var(--ink); }
label.field > small { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px;
  font: inherit; font-size: 16px; background: var(--shell); color: var(--ink);
  transition: border-color 140ms;
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input[type=date], input[type=number] { font-family: var(--mono); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--muted); }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; cursor: pointer; font-size: 14px; }
.check input, .choice input, .q-edit .choice-row input[type=radio] { accent-color: var(--ink); }
.check input { width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0; }
.check small { display: block; color: var(--muted); font-size: 12px; }

.alert { padding: 11px 14px; border-radius: 7px; margin-bottom: 16px; font-size: 14px; background: var(--raised); border: 1px solid var(--line-strong); border-left-width: 3px; }
.alert.error { border-left-color: var(--loss); }
.alert.ok { border-left-color: var(--gain); }
.alert.warn { border-left-color: var(--caution); }
.alert.info { border-left-color: var(--muted); }

/* status: signal dot + real state word */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.pill.ok { color: var(--ink); } .pill.ok::before { background: var(--gain); }
.pill.no { color: var(--ink); } .pill.no::before { background: var(--loss); }
.pill.wait { color: var(--ink); } .pill.wait::before { background: var(--caution); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.list > li:last-child { border-bottom: 0; }
.list > li .grow { flex: 1; min-width: 0; }
.list > li .title { font-weight: 500; color: var(--ink); }
.list a.row { display: flex; align-items: center; gap: 12px; width: 100%; color: inherit; text-decoration: none; }
.list > li.link { padding: 0; }
.list > li.link > a { padding: 10px 16px; min-height: 52px; }
.list > li.link:hover { background: var(--raised); }
.list svg { color: var(--muted); width: 16px; height: 16px; }
.chev { color: var(--muted) !important; }

table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th, td { text-align: left; padding: 0 14px; vertical-align: middle; }
td { height: 48px; border-bottom: 1px solid var(--line); color: var(--muted); }
tr:last-child td { border-bottom: 0; }
th { height: 40px; font-weight: 400; color: var(--ink); background: var(--shell); }
th:first-child { border-radius: 7px 0 0 7px; } th:last-child { border-radius: 0 7px 7px 0; }
.table-wrap { overflow-x: auto; padding: 8px; }
.table-wrap td:first-child { color: var(--ink); }
td.num, .num { font-family: var(--mono); font-size: 13px; }

.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--raised); box-shadow: 0 0 0 2px var(--raised); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 500; font-size: 14px; }
.avatar.lg { width: 88px; height: 88px; font-size: 24px; }
.avatar.xl { width: 140px; height: 140px; font-size: 32px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 1px solid transparent; margin-bottom: -1px; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--ink); border-color: var(--ink); }

.empty { margin: 12px; padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; border-radius: 10px; background: var(--panel) var(--hatch); border: 1px solid var(--line); }
td.empty { margin: 0; border-radius: 0; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* promotion report */
.rank-hero { display: flex; align-items: center; gap: 16px; }
.rank-hero .rank { font-size: 22px; font-weight: 500; }
.progress { height: 5px; background: var(--raised); border-radius: 999px; overflow: hidden; margin: 12px 0 8px; }
.progress > div { height: 100%; background: var(--progress); border-radius: 999px; }
.req { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.req:last-child { border-bottom: 0; }
.req .mark { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.req .mark.done { background: var(--gain); color: var(--shell); }
.req .mark.todo { border: 1px solid var(--line-strong); background: var(--hatch); }
.req .mark svg { width: 14px; height: 14px; stroke-width: 2.5; }

/* PT figures */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat { padding: 6px 4px; text-align: center; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .v { font-family: var(--mono); font-size: 30px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--muted); margin: 4px 0; }
.stat .pill { justify-content: center; }

/* PT scoring */
.pt-events { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .pt-events { grid-template-columns: repeat(3, 1fr); } }
.pt-event { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; padding: 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--ink); font: inherit; cursor: pointer; text-align: left; transition: background 140ms; }
.pt-event:hover { background: var(--raised-hover); }
.pt-event .n { font-weight: 500; font-size: 16px; }
.pt-event .s { color: var(--muted); font-size: 13px; }
.score-input { font-family: var(--mono) !important; font-size: 40px !important; text-align: center; font-weight: 500; min-height: 72px !important; letter-spacing: -0.02em; }
.run-inputs { display: flex; align-items: center; gap: 8px; }
.run-inputs span { font-family: var(--mono); font-size: 36px; }

/* setup wizard */
.wizard { max-width: 520px; margin: 0 auto; }
.steps { display: flex; gap: 6px; margin-bottom: 20px; }
.steps div { flex: 1; height: 5px; border-radius: 999px; background: var(--raised); }
.steps div.on { background: var(--progress); }
.photo-preview { width: 220px; height: 220px; border-radius: 10px; object-fit: cover; display: block; margin: 0 auto 12px; background: var(--raised); }
.photo-rules { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.photo-rules li { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.photo-rules svg { width: 16px; height: 16px; color: var(--ink); }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 72px 16px 24px; background: var(--shell); }
.login-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px 24px; }
.login-card .logo { display: block; width: 88px; margin: -72px auto 12px; }
.login-card h1 { text-align: center; }
.login-card .sub { text-align: center; color: var(--muted); margin-bottom: 22px; font-size: 14px; }

/* modal */
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--panel); border: 1px solid var(--line-strong); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 14px 14px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 600px) { .modal-bg { align-items: center; } .modal { border-radius: 10px; padding: 22px; } }
.modal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.modal-head h2 { margin: 0; flex: 1; }

.note-card { background: var(--shell); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 18px; text-align: center; }
.note-card .k { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.note-card .v { font-family: var(--mono); font-size: 24px; font-weight: 500; margin-bottom: 12px; word-break: break-all; }
.code-display { font-family: var(--mono); font-size: 40px; font-weight: 500; letter-spacing: .12em; text-align: center; padding: 20px; background: var(--shell); border: 1px solid var(--line); border-radius: 10px; }

.yc-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.yc-row:last-child { border-bottom: 0; }
.yc-dot { width: 12px; height: 16px; border-radius: 2px; background: var(--caution); flex-shrink: 0; }
.yc-photo { width: 100%; border-radius: 7px; border: 1px solid var(--line); }

.quiz-q { padding: 16px 0; border-bottom: 1px solid var(--line); }
.quiz-q:last-child { border-bottom: 0; }
.quiz-q .qt { font-weight: 500; margin-bottom: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 7px; margin-bottom: 8px; cursor: pointer; font-size: 14px; transition: background 140ms; }
.choice:hover { background: var(--raised); }
.choice:has(input:checked) { border-color: var(--line-strong); background: var(--raised-hover); }
.choice input { width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0; }

.q-edit { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: var(--shell); }
.q-edit .choice-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.q-edit .choice-row input[type=radio] { width: 18px; height: 18px; flex-shrink: 0; }

#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(16px); opacity: 0; pointer-events: none; background: var(--raised); color: var(--ink); border: 1px solid var(--line-strong); padding: 10px 16px; border-radius: 7px; font-size: 14px; z-index: 60; transition: 140ms; max-width: calc(100% - 32px); box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { border-color: var(--loss); }
@media (min-width: 860px) { #toast { bottom: 28px; } }

@media (max-width: 699px) { .hide-sm { display: none !important; } }

.section { margin: 4px 0 24px; }
.section > h2 { margin-bottom: 4px; }
.searchbar { margin-bottom: 16px; }

/* user detail */
.user-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.user-head h1 { margin: 0 0 2px; }
.user-flags { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.user-flags:empty { display: none; }
.split { display: grid; gap: 0 20px; max-width: 1080px; }
@media (min-width: 1000px) { .split { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
.perm-grid { display: grid; grid-template-columns: 1fr; column-gap: 20px; }
@media (min-width: 640px) { .perm-grid { grid-template-columns: 1fr 1fr; } }
.perm-grid .check { padding: 8px 0; }
.form-foot { display: flex; justify-content: flex-start; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
fieldset:disabled { opacity: .55; }

/* Owner preview strip */
.preview-bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--caution); color: #121212; font-weight: 500; font-size: 14px; }
.preview-bar .btn { background: #121212; color: var(--ink); border-color: #121212; }

/* Site banner */
.site-banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--raised); border-bottom: 1px solid var(--line-strong); font-size: 14px; }
.site-banner > svg { color: var(--caution); }
.site-banner span { flex: 1; }

/* Rank progress */
.rank-card .rank-top { display: flex; align-items: flex-end; gap: 16px; }
.rank-card .rank { font-size: 22px; font-weight: 500; line-height: 1.2; }
.rank-pct { margin-left: auto; text-align: right; display: flex; flex-direction: column; }
.rank-pct .num { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.progress.big { height: 10px; margin: 14px 0 2px; }

/* Announcements */
.ann.unread { border-left: 3px solid var(--progress); }
.ann .card-head { margin-bottom: 6px; }
.ann h3 { margin: 0; }
.ann-flags { display: flex; gap: 6px; }
.ann-body { white-space: pre-wrap; font-size: 14px; }
.linkish { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; cursor: pointer; font: inherit; }
.list.compact > li { min-height: 40px; padding: 8px 0; }

/* Calendar */
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-nav h2 { margin: 0; min-width: 150px; text-align: center; }
.cal-nav .btn { margin-left: auto; }
.cal { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 96px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: var(--raised); }
.cal-day.out { background: var(--shell); }
.cal-day.out .cal-n { color: var(--muted); }
.cal-n { font-size: 12px; color: var(--muted); }
.cal-day.today .cal-n { background: var(--ink); color: var(--shell); border-radius: 999px; padding: 0 6px; align-self: flex-start; }
.cal-ev { all: unset; font-size: 12px; padding: 2px 6px; border-radius: 4px; background: var(--raised-hover); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-ev:hover { background: var(--line-strong); }
.cal-ev .t { color: var(--muted); }
.cal-dots { display: none; align-self: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--progress); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; margin-top: auto; }
@media (max-width: 699px) {
  .cal-day { min-height: 54px; align-items: center; }
  .cal-ev, .cal-more { display: none; }
  .cal-dots { display: block; }
  .cal-day.today .cal-n { align-self: center; }
}
.list button.row { all: unset; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; min-height: 52px; box-sizing: border-box; cursor: pointer; }
.ev-date { width: 44px; flex-shrink: 0; text-align: center; border: 1px solid var(--line-strong); border-radius: 7px; padding: 3px 0; line-height: 1.1; }
.ev-date .m { display: block; font-size: 11px; color: var(--muted); }
.ev-date .d { display: block; font-size: 18px; }

/* Ribbons */
.ribbon { display: inline-block; width: 46px; height: 13px; border-radius: 1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); vertical-align: middle; flex-shrink: 0; }
.rack { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; }
.rack-row { display: flex; gap: 2px; }
.rack .ribbon { width: 58px; height: 16px; }
.ribbon-wrap { position: relative; display: inline-flex; }
.ribbon-n { position: absolute; right: 2px; top: 1px; font-size: 10px; color: #fff; text-shadow: 0 0 2px #000; }
.award-list { list-style: none; margin: 12px 0 0; padding: 0; }
.award-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.award-list .grow { flex: 1; min-width: 0; }
.award-pick .check span { display: flex; align-items: center; gap: 10px; }
.color-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.color-pick { display: inline-flex; align-items: center; gap: 2px; }
.color-pick input[type=color] { width: 40px; height: 32px; padding: 0; border: 1px solid var(--line-strong); border-radius: 6px; background: none; }

/* ROTC hour chips */
.hour-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 6px; }
.chip { display: flex; align-items: center; justify-content: center; min-height: 46px; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; font-size: 14px; position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: var(--ink); color: var(--shell); border-color: var(--ink); font-weight: 500; }
.chip:has(input:focus-visible) { outline: 2px solid var(--progress); outline-offset: 2px; }

/* Online status */
.av-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.online-dot { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--gain); box-shadow: 0 0 0 2px var(--panel); }
.avatar.lg + .online-dot { width: 18px; height: 18px; right: 4px; bottom: 4px; box-shadow: 0 0 0 3px var(--shell); }

/* Users filters */
.searchbar.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.searchbar.filters input[type=search] { flex: 1 1 200px; }
.searchbar.filters select { flex: 0 1 160px; width: auto; }
.check.inline { padding: 0; align-items: center; }
.perm-grid.people { max-height: 260px; overflow: auto; }

/* Practice answers */
.choice.right { border-color: var(--gain); }
.choice.right span::after { content: "  Correct"; color: var(--gain); font-size: 12px; }
.choice.wrong { border-color: var(--loss); }
.choice.wrong span::after { content: "  Your answer"; color: var(--loss); font-size: 12px; }

/* General orders */
.creed-text { white-space: pre-wrap; font-size: 16px; line-height: 1.7; }

/* Printable login slips */
#print-root { display: none; }
@media print {
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; }
  body.printing { background: #fff; color: #000; }
  .slip { display: flex; gap: 14px; align-items: center; padding: 14px 10px; border-bottom: 1px dashed #000; break-inside: avoid; font: 14px/1.5 var(--sans); color: #000; }
  .slip img { width: 54px; height: auto; }
  .slip-name { font-size: 16px; font-weight: 600; }
  .slip b { font-family: var(--mono); font-size: 15px; }
  .slip-note { font-size: 12px; color: #444; }
}

/* Save button that stays in reach on long forms */
.save-bar { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 8px); z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 16px; margin-bottom: 20px; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
@media (min-width: 860px) { .save-bar { bottom: 16px; } }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.photo-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--muted); }
.hour-chips { max-width: 520px; margin-bottom: 10px; }

/* Profile photo: tap it to change. Grey with a camera on hover; a small camera badge on touch screens. */
.avatar-edit { all: unset; position: relative; display: inline-flex; border-radius: 50%; cursor: pointer; flex-shrink: 0; }
.avatar-edit:focus-visible { outline: 2px solid var(--progress); outline-offset: 3px; }
.avatar-cover { position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(18,18,18,.6); color: #fff; opacity: 0; transition: opacity 140ms; }
.avatar-cover svg { width: 26px; height: 26px; }
.avatar-edit:hover .avatar-cover, .avatar-edit:focus-visible .avatar-cover { opacity: 1; }
@media (hover: none) {
  .avatar-cover { inset: auto -2px -2px auto; width: 30px; height: 30px; opacity: 1; background: var(--raised); border: 2px solid var(--shell); }
  .avatar-cover svg { width: 15px; height: 15px; }
}

/* Loading screen: 3x3 squares that pulse in sequence, then fade out as the page fades in. */
.page-loader { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  pointer-events: none; color: var(--muted); font-size: 14px; opacity: 0; animation: loader-in 200ms ease-out 120ms forwards; transition: opacity 200ms ease-out; }
.page-loader.done { opacity: 0 !important; animation: none; }
@media (min-width: 860px) { .page-loader.in-shell { left: 248px; } }
.sq9 { display: grid; grid-template-columns: repeat(3, 10px); gap: 10px; }
.sq9 i { width: 10px; height: 10px; background: var(--ink); animation: sq-pulse 675ms ease-in-out infinite alternate; }
.sq9 i:nth-child(1) { animation-delay: 0ms; } .sq9 i:nth-child(2) { animation-delay: 75ms; } .sq9 i:nth-child(3) { animation-delay: 150ms; }
.sq9 i:nth-child(4) { animation-delay: 225ms; } .sq9 i:nth-child(5) { animation-delay: 300ms; } .sq9 i:nth-child(6) { animation-delay: 375ms; }
.sq9 i:nth-child(7) { animation-delay: 450ms; } .sq9 i:nth-child(8) { animation-delay: 525ms; } .sq9 i:nth-child(9) { animation-delay: 600ms; }
@keyframes sq-pulse { from { opacity: 0; } to { opacity: 1; } }
@keyframes loader-in { to { opacity: 1; } }

/* Page and tab fades */
#main, #app { transition: opacity 220ms ease-out; }
.page-hidden { opacity: 0; }
.fade-in { animation: fade-in 220ms ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #main, #app, .page-loader, .fade-in { transition: none; animation: none; } .page-loader { opacity: 1; } }

/* sign in */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--shell); }
.signin-side { background: var(--panel); border-right: 1px solid var(--line); display: flex; align-items: center; justify-content: center; padding: 48px; }
.signin-side img { width: min(220px, 50%); filter: drop-shadow(0 18px 40px rgba(0,0,0,.45)); }
.signin-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.signin-form { width: 100%; max-width: 360px; }
.signin-form h1 { font-size: 28px; margin-bottom: 6px; }
.signin-form > p.muted { margin-bottom: 28px; }
.signin-logo { display: none; width: 64px; margin-bottom: 20px; }
.signin-form .btn.big { margin-top: 8px; }
.signin-help { margin-top: 18px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 6px; cursor: pointer; }
.pw-eye:hover, .pw-eye.on { color: var(--ink); }
.pw-eye svg { width: 18px; height: 18px; }
.caps-note { color: var(--caution); margin: -4px 0 10px; }
@media (max-width: 859px) {
  .signin { grid-template-columns: 1fr; }
  .signin-side { display: none; }
  .signin-main { align-items: flex-start; padding: 56px 16px 32px; }
  .signin-logo { display: block; }
}

/* turbo PT */
.turbo-bar { display: grid; grid-template-columns: 180px 1fr; gap: 12px; margin-bottom: 18px; align-items: end; }
.seg { display: flex; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 8px; padding: 3px; gap: 3px; }
.seg button { flex: 1; min-height: 38px; border: 0; border-radius: 6px; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--shell); font-weight: 500; }
.turbo-step { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.turbo-q { font-size: 18px !important; min-height: 52px !important; }
.turbo-results { margin-top: 8px; }
.turbo-results .list li { padding: 0; }
.turbo-pick { width: 100%; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; padding: 10px 6px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.turbo-pick:hover, .turbo-pick.first { background: var(--raised); }
.turbo-who { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.turbo-evs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.turbo-evs .pt-event { align-items: center; padding: 18px 8px; }
.turbo-val { font-family: var(--mono); font-size: 17px; margin-right: 4px; }
@media (max-width: 599px) { .turbo-bar { grid-template-columns: 1fr; } .turbo-step { padding: 14px; } }

/* activity log */
.log-list li { align-items: flex-start; gap: 12px; }
.log-top { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.log-act { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.log-detail { color: var(--muted); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.log-when { white-space: nowrap; padding-top: 2px; }
@media (max-width: 599px) {
  .log-list li { flex-direction: column; gap: 2px; }
  .log-when { order: -1; padding: 0; }
}

/* PT standards on phones: one card per age group */
@media (max-width: 699px) {
  .std-table, .std-table tbody { display: block; width: 100%; }
  .std-table thead { display: none; }
  .std-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; padding: 14px; border-bottom: 1px solid var(--line); }
  .std-table td { display: block; height: auto; padding: 0 !important; border: 0 !important; }
  .std-table td[data-label]::before { content: attr(data-label); display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
  .std-table td input { width: 100%; min-width: 0 !important; }
  .std-table td.std-del { display: flex; align-items: flex-end; justify-content: flex-end; }
}
.turbo-who .grow { flex: 1; min-width: 0; }

/* --- UX pass --- */
/* phone header: your name opens My account */
.topbar .who { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; padding: 4px 4px 4px 8px; border-radius: 999px; min-height: 40px; }
.topbar .who:hover, .topbar .who:active { background: var(--raised); color: var(--ink); }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; box-shadow: none; }

/* sidebar: foldable groups, Files beside your account, cadet search */
.sidebar .nav-group .group { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 14px 0 2px; padding: 6px 10px; border-radius: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.sidebar .nav-group .group:hover { color: var(--ink); background: var(--raised); }
.sidebar .nav-group .group svg { width: 14px; height: 14px; transition: transform 160ms; }
.sidebar .nav-group.closed .group svg { transform: rotate(-90deg); }
.sidebar .nav-group .nav-items { display: flex; flex-direction: column; gap: 2px; }
.sidebar .nav-group.closed .nav-items { display: none; }
.sidebar .side-files { flex-shrink: 0; margin-top: 8px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 8px; min-height: 46px; }
.sidebar .side-files + .side-me { margin-top: 0; border-top: 0; }
.side-search { flex-shrink: 0; margin-bottom: 10px; }
.qs { position: relative; }
.qs-ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.qs-ic svg { width: 15px; height: 15px; }
.qs input { width: 100%; padding-left: 32px !important; min-height: 38px !important; font-size: 14px !important; }
.qs-res { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--raised); border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px; z-index: 40; box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.4); }
.qs-row { display: flex !important; align-items: center; gap: 10px; min-height: 40px !important; padding: 0 8px !important; border-radius: 6px; color: var(--ink) !important; text-decoration: none; font-size: 14px; }
.qs-row span:nth-child(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-row.first, .qs-row:hover { background: var(--raised-hover) !important; }
.qs-none { padding: 10px; }
.staff-search { margin-bottom: 16px; }
.staff-search .qs input { min-height: 48px !important; font-size: 16px !important; }

/* page header with two actions */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* bigger tap targets */
.icon-btn.big { min-width: 44px; min-height: 44px; justify-content: center; align-items: center; }
.list.reorder li { gap: 4px; }
.row-btn { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; cursor: pointer; }
.row-btn:focus-visible { outline: 2px solid var(--progress); outline-offset: -2px; border-radius: 6px; }
.danger-zone { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.btn.danger-ghost { background: none; border-color: transparent; color: var(--loss); }
.btn.danger-ghost:hover { background: var(--raised); border-color: var(--loss); }

/* My account */
.pw-others { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.logout-row { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
@media (min-width: 600px) { .logout-row .btn { width: auto; } }

/* busy buttons */
.btn.busy { opacity: .85; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: -2px; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* offline */
#offline { position: fixed; left: 0; right: 0; top: 0; z-index: 70; padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top)); background: var(--caution); color: #1a1400; font-size: 14px; font-weight: 500; text-align: center; }

/* toasts sit clear of the tab bar; some carry an action */
#toast { display: flex; align-items: center; gap: 14px; bottom: calc(var(--tabbar) + 28px + env(safe-area-inset-bottom)); }
#toast.show { pointer-events: auto; }
.toast-act { all: unset; cursor: pointer; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; padding: 4px 2px; }

/* Score PT: confirmation stays on the page */
.turbo-done { min-height: 22px; margin-top: 10px; font-size: 14px; color: var(--gain); }
.turbo-done.flash { animation: doneflash 900ms ease-out; }
@keyframes doneflash { from { opacity: .2; } to { opacity: 1; } }
.turbo-name { text-decoration: none; color: inherit; min-width: 0; }

/* photo approvals: two across on phones */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.photo-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; background: var(--raised); }
.photo-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.photo-acts .btn { min-height: 40px; padding: 0 6px; justify-content: center; }
@media (min-width: 860px) { .photo-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }

/* user page: changed sections */
.card.changed > h2::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--caution); margin-left: 8px; vertical-align: middle; }

/* site banner: one compact line on phones, tap to read all */
@media (max-width: 599px) {
  .site-banner { padding: 6px 8px 6px 14px; font-size: 13px; cursor: pointer; }
  .site-banner span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .site-banner.open span { white-space: normal; }
}

/* --- supply --- */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--progress); color: #fff; font-size: 11px; font-weight: 600; line-height: 1; font-family: var(--mono); }
.sidebar a .nav-badge { margin-left: auto; }
.tabs .nav-badge { margin-left: 4px; vertical-align: 1px; }
.seg label { flex: 1; position: relative; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label span { display: flex; align-items: center; justify-content: center; min-height: 38px; border-radius: 6px; color: var(--muted); cursor: pointer; font-size: 14px; }
.seg label input:checked + span { background: var(--ink); color: var(--shell); font-weight: 500; }
.seg label input:focus-visible + span { outline: 2px solid var(--progress); }
.shoe-row { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: center; }
.sizes { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 12px 0 0; font-size: 14px; }
.sizes dt { color: var(--muted); }
.sizes dd { margin: 0; }
.req-note { margin: 10px 0 0; padding-left: 10px; border-left: 2px solid var(--line-strong); color: var(--muted); font-size: 14px; white-space: pre-wrap; }
.sreq .btn-row { margin-top: 14px; }
.sreq .card-head { align-items: flex-start; }
.ink { color: var(--ink); }
.chat-entry { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.chat-entry > .grow { flex: 1; min-width: 0; }
.chat-entry:hover { background: var(--raised); }
.inbox-top { display: flex; justify-content: space-between; gap: 8px; }
.inbox-last { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-last.unread { color: var(--ink); font-weight: 500; }

/* chat */
.chat-page.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.chat-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.chat-side h2 { margin-top: 4px; }
.chat-reqbtn { display: none; }
@media (max-width: 1023px) { .chat-page.with-side { grid-template-columns: 1fr; } .chat-side { display: none; } .chat-reqbtn { display: inline-flex; } }
.chat { display: flex; flex-direction: column; min-height: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.chat-head { padding: 10px 14px 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.chat-head .back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.chat-head .back svg { width: 14px; height: 14px; }
.chat-who { display: flex; align-items: center; gap: 12px; }
.chat-team { width: 40px; height: 40px; border-radius: 50%; background: var(--raised); display: inline-flex; align-items: center; justify-content: center; color: var(--ink); flex-shrink: 0; }
.chat-team svg { width: 20px; height: 20px; }
.chat-admin { display: flex; align-items: center; gap: 6px; padding: 6px 14px; background: var(--raised); border-bottom: 1px solid var(--line); }
.chat-admin svg { width: 14px; height: 14px; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.chat-stamp { align-self: center; font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
.chat-event { align-self: center; display: flex; align-items: flex-start; gap: 8px; max-width: 92%; margin: 8px 0; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: 8px; font-size: 13px; color: var(--muted); }
.chat-event svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
.msg { display: flex; flex-direction: column; max-width: 78%; }
.msg.run { margin-top: 8px; }
.msg.us { align-self: flex-end; align-items: flex-end; }
.msg.them { align-self: flex-start; align-items: flex-start; }
.msg-name { font-size: 12px; color: var(--muted); margin: 0 4px 3px; }
.bubble { padding: 8px 12px; border-radius: 16px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 6px; }
.msg.them .bubble { background: var(--raised); border-bottom-left-radius: 5px; }
.msg.us .bubble { background: var(--ink); color: var(--shell); border-bottom-right-radius: 5px; }
.msg.us .bubble[data-mine] { cursor: pointer; }
.bubble img { max-width: 240px; max-height: 300px; border-radius: 10px; display: block; cursor: zoom-in; object-fit: cover; }
.bubble.photo-only { padding: 3px; background: transparent !important; }
.bubble.deleted { background: none !important; color: var(--muted) !important; border: 1px dashed var(--line-strong); font-style: italic; font-size: 14px; }
.bubble.deleted-admin { background: none !important; color: var(--muted) !important; border: 1px dashed var(--loss); }
.bubble.deleted-admin .bubble-text { text-decoration: line-through; text-decoration-color: var(--muted); }
.del-note { font-size: 12px; color: var(--loss); font-style: normal; }
.msg-seen { font-size: 11.5px; color: var(--muted); margin: 3px 4px 0; }
.chat-typing { min-height: 24px; padding: 0 16px 4px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: typing 1.1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.chat-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--line); flex-shrink: 0; background: var(--panel); }
.chat-compose textarea { flex: 1; resize: none; min-height: 44px !important; max-height: 140px; padding: 11px 14px !important; border-radius: 22px !important; font-size: 15px !important; line-height: 1.4; }
.chat-send { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; justify-content: center; flex-shrink: 0; }
.chat-photo { cursor: pointer; flex-shrink: 0; }
.chat-empty { margin: auto; text-align: center; max-width: 300px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.zoom-img { width: 100%; border-radius: 8px; }
@media (max-width: 859px) {
  .chat { border-radius: 0; border-left: 0; border-right: 0; margin: -16px -16px 0; }
  .msg { max-width: 85%; }
}
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .6; } }

/* ---------- light theme (My account > Appearance) ---------- */
:root[data-theme="light"] {
  --canvas: #e4e4e2;
  --shell: #f4f4f2;
  --panel: #ffffff;
  --raised: #ececea;
  --raised-hover: #e1e1df;
  --line: #e2e2df;
  --line-strong: #cbcbc7;
  --ink: #161616;
  --muted: #5f5f5c;
  --faint: #9b9b97;
  --field-line: #8a8a86;
  --placeholder: #77776f;
  --gain: #1d8a39;
  --loss: #c8312c;
  --progress: #1f63d1;
  --caution: #e0b43a;
  --btn-hover: #333333;
  color-scheme: light;
}
:root[data-theme="light"] .modal-bg { background: rgba(0, 0, 0, .35); }
:root[data-theme="light"] #toast,
:root[data-theme="light"] .qs-res,
:root[data-theme="light"] .search-res { box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.12); }
:root[data-theme="light"] .avatar-cover { background: rgba(0,0,0,.45); }

/* ---------- appearance controls ---------- */
.seg-row { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-row label { flex: 1; min-width: 90px; }
.seg-row input { position: absolute; opacity: 0; pointer-events: none; }
.seg-row span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--muted); font-size: 14px; cursor: pointer; text-align: center; }
.seg-row input:checked + span { background: var(--ink); color: var(--shell); border-color: var(--ink); }
.seg-row input:focus-visible + span { outline: 2px solid var(--progress); outline-offset: 2px; }

/* ---------- search (everything) ---------- */
.side-search .search-btn, .search-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--shell); color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.search-btn:hover { color: var(--muted); border-color: var(--muted); }
.search-btn svg { width: 15px; height: 15px; }
.search-btn kbd { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 5px; }
.topbar .top-search { margin-left: auto; }
.topbar .top-search + .who { margin-left: 0; }
.search-box { position: relative; }
.search-box .qs-ic { left: 12px; }
.search-box input { width: 100%; padding-left: 38px !important; min-height: 48px; font-size: 16px; }
.search-res { margin-top: 12px; max-height: min(60vh, 520px); overflow-y: auto; }
.search-group { margin-bottom: 10px; }
.search-group h3 { font-size: 13px; color: var(--muted); font-weight: 500; margin: 8px 8px 4px; }
.search-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 8px; border-radius: 7px; text-decoration: none; color: var(--ink); }
.search-row:hover, .search-row.sel { background: var(--raised); }
.search-row .s-ic { width: 32px; height: 32px; border-radius: 7px; background: var(--raised); display: flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; }
.search-row.sel .s-ic, .search-row:hover .s-ic { background: var(--raised-hover); }
.search-row .s-ic svg { width: 16px; height: 16px; }
.search-row .s-tx { flex: 1; min-width: 0; }
.search-row .s-tx b { display: block; font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-row .s-tx span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-row mark { background: none; color: var(--ink); text-decoration: underline; text-decoration-color: var(--progress); text-underline-offset: 3px; }
.search-empty { padding: 18px 8px; color: var(--muted); font-size: 14px; }

/* Live pop-up for new announcements and supply messages */
#notice { position: fixed; right: 16px; left: 16px; top: calc(12px + env(safe-area-inset-top)); z-index: 70; display: flex; justify-content: center; pointer-events: none; opacity: 0; transform: translateY(-12px); transition: 160ms; }
#notice.show { opacity: 1; transform: none; }
#notice.show .notice-card { pointer-events: auto; }
.notice-card { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 440px; background: var(--raised); color: var(--ink); border: 1px solid var(--line-strong); border-left: 3px solid var(--progress); border-radius: 8px; padding: 12px 12px 12px 16px; box-shadow: 0 1px 2px rgba(0,0,0,.25), 0 10px 28px rgba(0,0,0,.3); }
.notice-card .title { font-weight: 600; }
.notice-card .grow { min-width: 0; }
@media (min-width: 860px) { #notice { left: auto; top: 20px; } }
.chat-older { display: flex; justify-content: center; padding: 8px 0 12px; }
.cal-ev.auto { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.cal-ev.off { background: var(--raised-hover); color: var(--muted); font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 16px; }
body.quiz-mode .sidebar, body.quiz-mode .tabbar, body.quiz-mode .topbar, body.quiz-mode #search-btn { display: none !important; }
body.quiz-mode main { margin-left: 0 !important; }
.quiz-bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 10px 0; background: var(--canvas, var(--bg)); }
.quiz-bar .low { color: var(--loss); font-weight: 600; }
fieldset.quiz-q { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.quiz-q legend { padding: 0; }
.save-bar { flex-wrap: wrap; } .save-bar .form-error { flex-basis: 100%; margin: 0; } .save-bar .form-error:empty { display: none; }

/* Review fixes: field borders you can see (79), focus outline everywhere (74), iPhone zoom (40), phone header (80) */
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=search], input[type=url], select, textarea { border-color: var(--field-line); }
input[type=url] { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--field-line); border-radius: 7px; font: inherit; font-size: 16px; background: var(--shell); color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
:focus-visible { outline: 2px solid var(--progress); outline-offset: 1px; }
.list .row:focus-visible, .list li > button:focus-visible, .list li > a:focus-visible { outline-offset: -3px; }
.qs input { min-height: 48px !important; font-size: 16px !important; }
.chat-compose textarea { font-size: 16px !important; }
.search-btn:hover { color: var(--ink); }
.topbar .brand { white-space: nowrap; flex-shrink: 0; }
.topbar .who { min-width: 0; flex-shrink: 1; }
.topbar .who > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .who .avatar, .topbar .who img { flex-shrink: 0; }
.home-reply { display: block; text-decoration: none; }
/* Photo and file pickers stay reachable by keyboard (75) */
input[type=file].sr-file, .file-pick input[type=file] { position: absolute; opacity: 0; width: 1px; height: 1px; }
label:has(> input[type=file]:focus-visible) { outline: 2px solid var(--progress); outline-offset: 2px; }
label.btn, label.icon-btn { position: relative; overflow: hidden; }
/* Preview strip (33): light button text in both looks; strip and top bar stay pinned together; sidebar starts below it. */
.preview-bar .btn { color: #f2f2f2; }
.preview-bar { min-height: 48px; box-sizing: border-box; }
.app:has(.preview-bar) .topbar { top: 48px; }
@media (min-width: 860px) { .app:has(.preview-bar) .sidebar { top: 48px; height: calc(100vh - 48px); } }
.load-error { text-align: center; }
/* Home: calm summary with room between sections */
.home { max-width: 760px; display: flex; flex-direction: column; gap: 40px; padding-bottom: 24px; }
.home h2 { margin: 0 0 14px; }
.home .card-head { margin-bottom: 14px; }
.home-hello h1 { margin: 0 0 4px; }
.home-hello p { margin: 0; }
.home-today { margin-top: 12px !important; font-weight: 500; color: var(--ink); }
.home-block > .card + .card { margin-top: 12px; }
.home-rank { display: block; padding: 24px; text-decoration: none; color: inherit; }
.home-rank:hover { background: var(--raised); }
.home-rank-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.home-rank-name { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.home-pct { font-size: 32px; font-weight: 500; }
.home-todo { margin: 20px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.home-ready { margin: 18px 0 0; color: var(--gain); font-weight: 500; }
.home-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 20px; font-size: 14px; color: var(--muted); }
.home-more svg { width: 16px; height: 16px; }
.home-links { display: grid; gap: 12px; }
@media (min-width: 700px) { .home-links { grid-template-columns: 1fr 1fr; } }
.home-links .card { margin: 0 !important; }
.home [data-ready]:empty { display: none; }
/* Home, calmer pass */
.home { max-width: 640px; gap: 48px; }
.home-hello h1 { font-size: 30px; }
.home-today { margin-top: 8px !important; }
.home-rank { padding: 28px; }
.home-rank-top { align-items: baseline; margin: 6px 0 18px; }
.home-left { margin: 24px 0 0; font-weight: 500; }
.home-todo { margin-top: 10px; }
.home-ic { display: inline-flex; color: var(--muted); margin-right: 4px; }
.home-ic svg { width: 20px; height: 20px; }
.home .list .row { padding-top: 16px; padding-bottom: 16px; }
.home-cols, .home-col { display: flex; flex-direction: column; gap: 48px; }
@media (min-width: 960px) {
  .home { max-width: 1180px; }
  .home-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; align-items: start; }
}
@media (min-width: 960px) { .home-cols.one { grid-template-columns: minmax(0, 1fr); max-width: 760px; } }
@media (max-width: 959px) { .home-col { display: contents; } .home-news { order: 1; } .home-up { order: 2; } .home-links-sec { order: 10; } }
@media (min-width: 960px) { .home-col { gap: 32px; } }
/* Take a new photo (locked account) */
.np-wrap { padding: 24px 16px; }
.np-card { max-width: 520px; padding: 32px 28px; text-align: center; }
.np-logo { display: block; width: 72px; margin: 0 auto 20px; }
.np-card h1 { margin: 0 0 8px; }
.np-card > form > p { margin: 0 auto 20px; max-width: 400px; }
.np-card ul { text-align: left; display: inline-flex; flex-direction: column; margin: 0 auto 20px; }
.np-out { display: block; margin: 20px auto 0; }
/* Dropdowns: our own arrow, set in from the edge, same on every browser */
select:not([multiple]) {
  -webkit-appearance: none; appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A3A39D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 18px 18px;
}
select::-ms-expand { display: none; }
.claim-row { display: flex; align-items: center; gap: 12px; width: 100%; }
.claim-row .title { display: block; }
.claim-row .title { color: var(--ink); text-decoration: none; font-weight: 600; }
@media (max-width: 640px) { .claim-row { flex-wrap: wrap; } .claim-row .grow { flex: 1 1 calc(100% - 64px); } .claim-row .btn-row { width: 100%; } .claim-row .btn-row .btn { flex: 1; } }
.inline-loader { display: flex; align-items: center; justify-content: center; padding: 40px 16px; color: var(--muted); font-size: 14px; }
.inline-loader .spin { width: 18px; height: 18px; margin-right: 10px; }
.hour-chips.yn { grid-template-columns: 1fr 1fr; margin-bottom: 8px; }
/* First-login tour */
.tour h1 { margin: 0 0 10px; }
.tour > p { margin: 0 auto; max-width: 380px; min-height: 48px; }
.tour-ic { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 16px; background: var(--raised); color: var(--ink); margin: 4px auto 20px; }
.tour-ic svg { width: 28px; height: 28px; }
.tour-dots { display: flex; justify-content: center; gap: 8px; margin: 28px 0 20px; }
.tour-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.tour-dots span.on { background: var(--ink); }
.hour-chips.role3 { grid-template-columns: repeat(3, 1fr); }
.add-pos { margin: 8px 0 16px; }
.add-pos summary { cursor: pointer; font-weight: 500; padding: 8px 0; }
/* Hands-on tour */
.tour-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.tour-ring { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .62); outline: 2px solid var(--ink); will-change: top, left, width, height; }
.tour-ring.glide { transition: top .32s cubic-bezier(.2,.8,.2,1), left .32s cubic-bezier(.2,.8,.2,1), width .32s cubic-bezier(.2,.8,.2,1), height .32s cubic-bezier(.2,.8,.2,1); }
.tour-tip { position: fixed; pointer-events: auto; background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 12px 32px rgba(0,0,0,.35); }
.tour-tip p { margin: 4px 0 0; font-size: 15px; line-height: 1.45; }
.tour-tip .btn { margin-top: 14px; }
.tour-tip.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(360px, calc(100vw - 32px)) !important; }
.tour-layer:has(.tour-ring[hidden]) { background: rgba(0, 0, 0, .62); pointer-events: auto; }
/* ---------- weather ---------- */
.wx-in { animation: wx-up .5s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes wx-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.wx-ic { width: 32px; height: 32px; flex: none; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.wx-ic.big { width: 112px; height: 112px; stroke-width: 1.6; }
.wx-sun circle { fill: #f2c94c; stroke: #f2c94c; }
.wx-rays line { stroke: #f2c94c; }
.wx-rays { transform-origin: 24px 24px; animation: wx-spin 24s linear infinite; }
.wx-moon { fill: #d9d7cf; stroke: #d9d7cf; animation: wx-bob 6s ease-in-out infinite; }
.wx-cloud { fill: var(--raised); stroke: var(--ink); animation: wx-drift 7s ease-in-out infinite; }
.wx-cloud.back { opacity: .55; animation-duration: 9s; animation-direction: reverse; }
.wx-drop { stroke: #5aa3ff; animation: wx-fall 1s linear infinite; animation-delay: var(--d); }
.wx-flake { fill: #e8f1ff; stroke: none; animation: wx-snow 2.4s linear infinite; animation-delay: var(--d); }
.wx-bolt { fill: #f2c94c; stroke: #f2c94c; stroke-width: 1; animation: wx-flash 2.6s steps(1) infinite; }
.wx-haze line, .wx-wind path { animation: wx-slide 3.5s ease-in-out infinite; }
.wx-haze line:nth-child(2), .wx-wind path:nth-child(2) { animation-delay: .4s; }
.wx-haze line:nth-child(3), .wx-wind path:nth-child(3) { animation-delay: .8s; }
@keyframes wx-spin { to { transform: rotate(360deg); } }
@keyframes wx-bob { 50% { transform: translateY(-1.5px); } }
@keyframes wx-drift { 50% { transform: translateX(2.5px); } }
@keyframes wx-fall { from { transform: translateY(-4px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(6px); opacity: 0; } }
@keyframes wx-snow { from { transform: translateY(-3px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(6px) translateX(1.5px); opacity: 0; } }
@keyframes wx-flash { 0%, 70%, 80% { opacity: 1; } 75%, 85% { opacity: .15; } }
@keyframes wx-slide { 50% { transform: translateX(3px); } }
.wx-hero { display: grid; gap: 28px; padding: 28px; margin-bottom: 32px; }
@media (min-width: 860px) { .wx-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; } }
.wx-now { display: flex; align-items: center; gap: 20px; }
.wx-temp { font-size: 72px; line-height: 1; font-weight: 500; letter-spacing: -2px; }
.wx-cond { font-size: 18px; font-weight: 500; margin: 6px 0 4px; }
.wx-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wx-stat { background: var(--raised); border-radius: 12px; padding: 14px 16px; }
.wx-stat-v { font-size: 26px; font-weight: 500; margin-top: 4px; }
.wx-stat-v small { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.wx-heat { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: #121212; }
.wx-heat.c1 { background: #f2d06b; } .wx-heat.c2 { background: #f2a03d; } .wx-heat.c3 { background: #e5484d; color: #fff; } .wx-heat.c4 { background: #a3161b; color: #fff; }
.wx-alerts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.wx-alert { border-radius: 12px; border: 1px solid var(--line-strong); background: var(--panel); overflow: hidden; }
.wx-alert summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.wx-alert summary::-webkit-details-marker { display: none; }
.wx-alert-t { display: block; font-weight: 600; }
.wx-alert-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.wx-alert.severe { border-color: color-mix(in srgb, var(--loss) 60%, transparent); background: color-mix(in srgb, var(--loss) 10%, var(--panel)); }
.wx-alert.severe .wx-alert-dot { background: var(--loss); animation: wx-pulse 1.8s ease-in-out infinite; }
.wx-alert.moderate { border-color: color-mix(in srgb, var(--caution) 55%, transparent); background: color-mix(in srgb, var(--caution) 9%, var(--panel)); }
.wx-alert.moderate .wx-alert-dot { background: var(--caution); }
.wx-alert[open] .chev { transform: rotate(180deg); }
.wx-alert-b { padding: 0 16px 14px 38px; white-space: pre-wrap; font-size: 14px; }
.wx-alert-b p { margin: 0 0 10px; }
@keyframes wx-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--loss) 25%, transparent); } }
.wx-hours { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 12px; margin-bottom: 28px; scroll-snap-type: x proximity; }
.wx-hour { flex: 0 0 78px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.wx-h-t { font-size: 18px; font-weight: 500; }
.wx-h-hi { color: var(--caution); }
.wx-rainbar { width: 6px; height: 28px; border-radius: 3px; background: var(--raised); display: flex; align-items: flex-end; overflow: hidden; }
.wx-rainbar span { display: block; width: 100%; background: #5aa3ff; border-radius: 3px; }
.wx-days li { gap: 14px; }
.wx-d-name { width: 48px; font-weight: 500; }
.wx-d-rain { width: 36px; color: var(--muted); }
.wx-d-rain.wet { color: #5aa3ff; }
.wx-d-lo, .wx-d-hi { width: 34px; text-align: right; }
.wx-range { flex: 1; height: 6px; border-radius: 3px; background: var(--raised); position: relative; min-width: 60px; }
.wx-range span { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #5aa3ff, #f2c94c, #f2803d); }
:root[data-theme="light"] .wx-cloud { fill: #fff; }
@media (prefers-reduced-motion: reduce) { .wx-in, .wx-ic *, .wx-alert-dot { animation: none !important; } }
.wx-days .wx-ic { width: 26px; height: 26px; }
.wx-days li.link { cursor: pointer; }
.wx-days li.link:hover { background: var(--raised); }
.wx-days li .chev { width: 16px; height: 16px; color: var(--muted); flex: none; margin-left: -6px; }
.wx-dsum { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.wx-dsum .wx-ic { width: 44px; height: 44px; }
.wx-hlist { margin: 0 -4px; }
.wx-hlist li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; }
.wx-hlist .wx-ic { width: 26px; height: 26px; flex: none; }
.wx-hl-time { width: 44px; flex: none; }
.wx-hl-t { width: 38px; flex: none; font-weight: 500; font-size: 16px; }
.wx-hl-r { width: 36px; flex: none; text-align: right; }
.wx-hl-r.wet { color: #5aa3ff; }
.wx-hl-w { width: 52px; flex: none; text-align: right; }
@media (max-width: 420px) { .wx-hl-w { display: none; } }

/* Ask (AI search) */
.search-row .s-ic.ai { color: var(--ink); background: conic-gradient(from 0deg, #ffffff40, #8d929b33, #ffffff26, #8d929b40); }
.ai-panel { margin-top: 12px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); animation: ai-in .25s ease-out; }
@keyframes ai-in { from { opacity: 0; transform: translateY(-4px); } }
.ai-think { display: flex; align-items: center; gap: 14px; min-height: 40px; }
.ai-orb { position: relative; width: 36px; height: 36px; flex: none; animation: ai-spin 2.4s linear infinite; }
.ai-orb span { position: absolute; width: 14px; height: 14px; border-radius: 50%; top: 11px; left: 11px; mix-blend-mode: screen; filter: blur(.5px); }
.ai-orb span:nth-child(1) { background: #e6e8ec; animation: ai-a 1.2s ease-in-out infinite alternate; }
.ai-orb span:nth-child(2) { background: #b9bec7; animation: ai-b 1.2s ease-in-out infinite alternate; }
.ai-orb span:nth-child(3) { background: #8d929b; animation: ai-c 1.2s ease-in-out infinite alternate; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
@keyframes ai-a { from { transform: translate(0, 0) scale(.7); } to { transform: translate(0, -11px) scale(1.1); } }
@keyframes ai-b { from { transform: translate(0, 0) scale(.7); } to { transform: translate(10px, 7px) scale(1.1); } }
@keyframes ai-c { from { transform: translate(0, 0) scale(.7); } to { transform: translate(-10px, 7px) scale(1.1); } }
:root[data-theme="light"] .ai-orb span { mix-blend-mode: multiply; }
.ai-shimmer { display: inline-block; font-weight: 500; background: linear-gradient(90deg, var(--muted) 0%, var(--ink) 45%, var(--muted) 90%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ai-sh 1.4s linear infinite; }
.ai-shimmer.swap { animation: ai-sh 1.4s linear infinite, ai-fade .35s ease-out; }
@keyframes ai-sh { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes ai-fade { from { opacity: 0; transform: translateY(4px); } }
.ai-ans { display: flex; gap: 12px; align-items: flex-start; }
.ai-ans.err { color: var(--loss); }
.ai-ans-ic { width: 28px; height: 28px; border-radius: 7px; flex: none; display: flex; align-items: center; justify-content: center; background: conic-gradient(from 0deg, #ffffff40, #8d929b33, #ffffff26, #8d929b40); }
.ai-ans-ic svg { width: 15px; height: 15px; }
.ai-text { margin: 3px 0 0; line-height: 1.5; white-space: pre-wrap; }
.ai-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .ai-orb, .ai-orb span, .ai-shimmer, .ai-panel { animation: none !important; } }
.cf-box { margin: 4px 0 12px; min-height: 65px; }

/* AI Search button: a slowly turning ring in the crest colors so it stands out. */
@property --ai-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.side-search .search-btn.ai-btn { position: relative; min-height: 44px; color: var(--ink); font-weight: 500; border: 1.5px solid transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, conic-gradient(from var(--ai-a), #6f747d, #ffffff, #b9bec7, #5a5f68, #6f747d) border-box;
  animation: ai-ring 6s linear infinite; }
.side-search .search-btn.ai-btn:hover { background: linear-gradient(var(--raised), var(--raised)) padding-box, conic-gradient(from var(--ai-a), #6f747d, #ffffff, #b9bec7, #5a5f68, #6f747d) border-box; }
.search-btn.ai-btn svg { width: 17px; height: 17px; color: #e6e8ec; }
.topbar .top-search.ai-btn { border: 1.5px solid transparent; border-radius: 50%;
  background: linear-gradient(var(--shell), var(--shell)) padding-box, conic-gradient(from var(--ai-a), #6f747d, #ffffff, #b9bec7, #5a5f68, #6f747d) border-box;
  animation: ai-ring 6s linear infinite; }
.topbar .top-search.ai-btn svg { color: #e6e8ec; }
.search-box .qs-ic svg { color: #e6e8ec; }
@keyframes ai-ring { to { --ai-a: 360deg; } }
@media (prefers-reduced-motion: reduce) { .ai-btn { animation: none !important; } }
/* AI Search person card */
.ai-person { display: flex; align-items: center; gap: 18px; }
.ai-ph { position: relative; width: 84px; height: 84px; flex: none; display: flex; align-items: center; justify-content: center; }
.ai-ph-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from var(--ai-a), #6f747d, #ffffff, #b9bec7, #5a5f68, #6f747d); animation: ai-ring 3s linear infinite, ai-ring-in .6s cubic-bezier(.2,.8,.2,1) both;
  -webkit-mask: radial-gradient(circle, transparent 38px, #000 39px); mask: radial-gradient(circle, transparent 38px, #000 39px); }
.ai-ph .ai-av { width: 72px; height: 72px; border-radius: 50%; font-size: 24px; object-fit: cover; animation: ai-ph-in .7s cubic-bezier(.2,.8,.2,1) .15s both; }
@keyframes ai-ring-in { from { transform: scale(.4) rotate(-90deg); opacity: 0; } }
@keyframes ai-ph-in { from { transform: scale(.6); opacity: 0; filter: blur(6px); } }
.ai-cap { margin: 0 0 4px; font-size: 17px; font-weight: 600; min-height: 1.4em; }
.ai-extra { animation: ai-fade .4s ease-out 1.2s both; }
.ai-open { margin-top: 10px; animation: ai-fade .4s ease-out 1.4s both; }
@media (prefers-reduced-motion: reduce) { .ai-ph-ring, .ai-ph .ai-av, .ai-extra, .ai-open { animation: none !important; } }
/* Thinking loader (max's pick): four dots that turn and pulse. */
.ai-think { min-height: 56px; padding-left: 6px; }
.ai-loader { --dim: 2.1rem; width: var(--dim); height: var(--dim); position: relative; flex: none; margin: 0 6px; animation: ai-spin988 2s linear infinite; }
.ai-loader .circle { --dim: .82rem; width: var(--dim); height: var(--dim); border-radius: 50%; position: absolute; }
.ai-loader .circle:nth-child(1) { top: 0; left: 0; background: #ffffff; }
.ai-loader .circle:nth-child(2) { top: 0; right: 0; background: #c9cdd3; }
.ai-loader .circle:nth-child(3) { bottom: 0; left: 0; background: #9aa0a8; }
.ai-loader .circle:nth-child(4) { bottom: 0; right: 0; background: #e6e8ec; }
@keyframes ai-spin988 { 0% { transform: scale(1) rotate(0); } 20%, 25% { transform: scale(1.3) rotate(90deg); } 45%, 50% { transform: scale(1) rotate(180deg); } 70%, 75% { transform: scale(1.3) rotate(270deg); } 95%, 100% { transform: scale(1) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-loader { animation: none !important; } }
/* AI filling in a form: pretend mouse and the stop bar */
.ghost-cursor { position: fixed; z-index: 9999; width: 26px; height: 26px; margin: -3px 0 0 -4px; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); transition: opacity .25s; }
.ghost-cursor svg { width: 100%; height: 100%; fill: #fff; stroke: #111; stroke-width: 1.4; stroke-linejoin: round; transition: transform .15s; }
.ghost-cursor::after { content: ''; position: absolute; left: 0; top: 0; width: 28px; height: 28px; margin: -11px 0 0 -10px; border-radius: 50%; border: 2px solid #e6e8ec; opacity: 0; transform: scale(.3); }
.ghost-cursor.press svg { transform: scale(.82); }
.ghost-cursor.press::after { animation: ghost-ripple .45s ease-out; }
.ghost-cursor.out { opacity: 0; }
@keyframes ghost-ripple { 0% { opacity: 1; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.6); } }
.ghost-hl { outline: 2px solid #e6e8ec !important; box-shadow: 0 0 0 5px rgba(230,232,236,.18), 0 0 18px rgba(230,232,236,.25); outline-offset: 2px; transition: outline-color .2s; }
.ghost-need { outline: 2px solid var(--caution) !important; outline-offset: 2px; animation: ghost-need 1s ease-in-out 3; }
@keyframes ghost-need { 50% { outline-color: transparent; } }
.ghost-bar { position: fixed; z-index: 9998; left: 50%; top: 12px; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 16px; border-radius: 10px; background: var(--panel); color: var(--ink); font-size: 14px; border: 1.5px solid transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, conic-gradient(from var(--ai-a), #8d929b, #ffffff, #b9bec7, #6f747d, #8d929b) border-box;
  animation: ai-ring 4s linear infinite, ai-in .25s ease-out; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.ghost-dot { width: 8px; height: 8px; border-radius: 50%; background: #e6e8ec; flex: none; animation: ghost-need 1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .ghost-bar, .ghost-dot { animation: none !important; } }

.ghost-menu { position: fixed; z-index: 9990; overflow-y: auto; padding: 4px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line-strong);
  box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.45); transform-origin: top; animation: ghost-open .18s ease-out; scrollbar-width: thin; }
.ghost-menu.up { transform-origin: bottom; }
.ghost-menu.closing { opacity: 0; transform: scaleY(.9); transition: .15s; }
@keyframes ghost-open { from { opacity: 0; transform: scaleY(.85); } }
.ghost-opt { padding: 9px 12px; border-radius: 6px; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ghost-opt.cur { color: var(--muted); }
.ghost-opt.hover { background: var(--raised-hover); }
.ghost-opt.pick { background: #e6e8ec; color: #111; }
:root[data-theme="light"] .ghost-opt.pick { background: #2a2c30; color: #fff; }
:root[data-theme="light"] .ghost-hl { outline-color: #6f747d !important; }

:root[data-theme="light"] .search-btn.ai-btn svg, :root[data-theme="light"] .topbar .top-search.ai-btn svg, :root[data-theme="light"] .search-box .qs-ic svg { color: #4a4e56; }
.side-search .search-btn.ai-btn { box-shadow: 0 0 14px rgba(230,232,236,.10); }
:root[data-theme="light"] .ai-loader .circle:nth-child(1) { background: #3a3d43; } :root[data-theme="light"] .ai-loader .circle:nth-child(4) { background: #6f747d; }
/* Thinking loader (max's pick, in silver): a glowing ring that turns while the letters light up one by one. */
.ai-think2 { display: flex; justify-content: center; padding: 18px 0 14px; }
.ai-lw { position: relative; display: flex; align-items: center; justify-content: center; width: 110px; height: 110px; border-radius: 50%; font-size: 1.05em; font-weight: 300; color: #fff; user-select: none; }
.ai-lc { position: absolute; inset: 0; border-radius: 50%; animation: ai-lc 2.3s linear infinite; }
@keyframes ai-lc {
  0% { transform: rotate(90deg); box-shadow: 0 6px 12px 0 #f5f6f8 inset, 0 12px 18px 0 #b9bec7 inset, 0 36px 36px 0 #6f747d inset, 0 0 3px 1.2px rgba(245,246,248,.3), 0 0 6px 1.8px rgba(185,190,199,.2); }
  25% { transform: rotate(180deg); box-shadow: 0 6px 12px 0 #d7dade inset, 0 12px 18px 0 #f5f6f8 inset, 0 36px 36px 0 #b9bec7 inset, 0 0 6px 2.4px rgba(245,246,248,.3), 0 0 12px 3.6px rgba(185,190,199,.2), 0 0 18px 6px rgba(111,116,125,.15); }
  50% { transform: rotate(270deg); box-shadow: 0 6px 12px 0 #e6e8ec inset, 0 12px 6px 0 #9aa0a8 inset, 0 24px 36px 0 #b9bec7 inset, 0 0 3px 1.2px rgba(245,246,248,.3), 0 0 6px 1.8px rgba(185,190,199,.2); }
  75% { transform: rotate(360deg); box-shadow: 0 6px 12px 0 #c9cdd3 inset, 0 12px 18px 0 #e6e8ec inset, 0 36px 36px 0 #8d929b inset, 0 0 6px 2.4px rgba(245,246,248,.3), 0 0 12px 3.6px rgba(185,190,199,.2), 0 0 18px 6px rgba(111,116,125,.15); }
  100% { transform: rotate(450deg); box-shadow: 0 6px 12px 0 #f5f6f8 inset, 0 12px 18px 0 #b9bec7 inset, 0 36px 36px 0 #6f747d inset, 0 0 3px 1.2px rgba(245,246,248,.3), 0 0 6px 1.8px rgba(185,190,199,.2); }
}
.ai-ll { display: inline-block; opacity: .4; animation: ai-ll 2.4s infinite; z-index: 1; }
.ai-ll:nth-of-type(2) { animation-delay: 0s; } .ai-ll:nth-of-type(3) { animation-delay: .1s; } .ai-ll:nth-of-type(4) { animation-delay: .2s; } .ai-ll:nth-of-type(5) { animation-delay: .3s; }
.ai-ll:nth-of-type(6) { animation-delay: .4s; } .ai-ll:nth-of-type(7) { animation-delay: .5s; } .ai-ll:nth-of-type(8) { animation-delay: .6s; } .ai-ll:nth-of-type(9) { animation-delay: .7s; }
@keyframes ai-ll { 0%, 100% { opacity: .4; } 20% { opacity: 1; text-shadow: #f8fcff 0 0 5px; } 40% { opacity: .7; } }
:root[data-theme="light"] .ai-lw { color: #2a2c30; }
:root[data-theme="light"] .ai-ll { animation-name: ai-ll-light; }
@keyframes ai-ll-light { 0%, 100% { opacity: .4; } 20% { opacity: 1; } 40% { opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .ai-lc, .ai-ll { animation: none !important; } .ai-ll { opacity: 1; } }
/* Thinking loader (max's pick, in silver): letters flash in turn while a striped silver glow sweeps across. */
.ai-think3 { display: flex; justify-content: center; padding: 10px 0; overflow: hidden; }
.ai-gw { position: relative; display: flex; align-items: center; justify-content: center; height: 76px; padding: 0 24px; font-size: 1.9em; font-weight: 600; color: #fff; user-select: none; }
.ai-gm { position: absolute; inset: 0; z-index: 1; mask: repeating-linear-gradient(90deg, transparent 0, transparent 6px, #000 7px, #000 8px); -webkit-mask: repeating-linear-gradient(90deg, transparent 0, transparent 6px, #000 7px, #000 8px); pointer-events: none; }
.ai-gm::after { content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 50% 50%, #ffffff 0%, transparent 50%), radial-gradient(circle at 45% 45%, #d7dade 0%, transparent 45%),
    radial-gradient(circle at 55% 55%, #b9bec7 0%, transparent 45%), radial-gradient(circle at 45% 55%, #9aa0a8 0%, transparent 45%), radial-gradient(circle at 55% 45%, #e6e8ec 0%, transparent 45%);
  mask: radial-gradient(circle at 50% 50%, transparent 0%, transparent 10%, #000 25%); -webkit-mask: radial-gradient(circle at 50% 50%, transparent 0%, transparent 10%, #000 25%);
  animation: ai-gt 2s infinite alternate, ai-go 4s infinite; animation-timing-function: cubic-bezier(.6,.8,.5,1); }
@keyframes ai-gt { 0% { transform: translate(-55%); } 100% { transform: translate(55%); } }
@keyframes ai-go { 0%, 100% { opacity: 0; } 15% { opacity: 1; } 65% { opacity: 0; } }
.ai-gl { display: inline-block; opacity: 0; animation: ai-gla 4s infinite linear; z-index: 2; }
.ai-gl:nth-child(1) { animation-delay: .1s; } .ai-gl:nth-child(2) { animation-delay: .205s; } .ai-gl:nth-child(3) { animation-delay: .31s; } .ai-gl:nth-child(4) { animation-delay: .415s; }
.ai-gl:nth-child(5) { animation-delay: .521s; } .ai-gl:nth-child(6) { animation-delay: .626s; } .ai-gl:nth-child(7) { animation-delay: .731s; } .ai-gl:nth-child(8) { animation-delay: .837s; }
@keyframes ai-gla { 0% { opacity: 0; } 5% { opacity: 1; text-shadow: 0 0 4px #fff; transform: scale(1.1) translateY(-2px); } 20% { opacity: .2; } 100% { opacity: 0; } }
:root[data-theme="light"] .ai-gw { color: #2a2c30; }
:root[data-theme="light"] .ai-gm::after { filter: invert(.75); }
@media (prefers-reduced-motion: reduce) { .ai-gm::after, .ai-gl { animation: none !important; } .ai-gl { opacity: 1; } }
/* Thinking loader (max's pick, permanent): a 3 by 3 grid of squares that fade in turn. */
.ai-think4 { display: flex; justify-content: center; padding: 22px 0; }
.ai-sq { position: relative; width: 60px; height: 60px; }
.ai-sq .square { background: #ddd; width: 10px; height: 10px; position: absolute; top: 50%; left: 50%; margin-top: -5px; margin-left: -5px; }
.ai-sq [data-sq="1"] { margin-top: -25px; margin-left: -25px; animation: loader_5191 675ms ease-in-out 0s infinite alternate; }
.ai-sq [data-sq="2"] { margin-top: -25px; animation: loader_5191 675ms ease-in-out 75ms infinite alternate; }
.ai-sq [data-sq="3"] { margin-top: -25px; margin-left: 15px; animation: loader_5191 675ms ease-in-out 150ms infinite; }
.ai-sq [data-sq="4"] { margin-left: -25px; animation: loader_5191 675ms ease-in-out 225ms infinite; }
.ai-sq [data-sq="5"] { animation: loader_5191 675ms ease-in-out 300ms infinite; }
.ai-sq [data-sq="6"] { margin-left: 15px; animation: loader_5191 675ms ease-in-out 375ms infinite; }
.ai-sq [data-sq="7"] { margin-top: 15px; margin-left: -25px; animation: loader_5191 675ms ease-in-out 450ms infinite; }
.ai-sq [data-sq="8"] { margin-top: 15px; animation: loader_5191 675ms ease-in-out 525ms infinite; }
.ai-sq [data-sq="9"] { margin-top: 15px; margin-left: 15px; animation: loader_5191 675ms ease-in-out 600ms infinite; }
@keyframes loader_5191 { from { opacity: 0; } to { opacity: 1; } }
:root[data-theme="light"] .ai-sq .square { background: #6f747d; }
@media (prefers-reduced-motion: reduce) { .ai-sq .square { animation: none !important; } }
/* The ring only moves during the short shine at the start of a visit; otherwise it holds still. */
.side-search .search-btn.ai-btn, .topbar .top-search.ai-btn { animation: none; }
.side-search .search-btn.ai-btn.shine, .topbar .top-search.ai-btn.shine { animation: ai-ring 5s cubic-bezier(.45,.05,.35,1) 1 both; }
@media (prefers-reduced-motion: reduce) { .ai-btn.shine { animation: none !important; } }
/* AI usage page */
.ai-u-big { font-size: 28px; font-weight: 500; margin: 6px 0 10px; }
.ai-u-big small { font-size: 14px; }
.ai-u-bar { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.ai-u-bar span { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.ai-u-bar.hot span { background: var(--caution); }
.ai-u-people li { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.ai-u-left { width: 56px; text-align: right; }
.ai-u-list summary { list-style: none; cursor: pointer; }
.ai-u-list summary::-webkit-details-marker { display: none; }
.ai-u-q { margin-top: 2px; }
.ai-u-a { margin-top: 8px; font-size: 14px; white-space: pre-wrap; }

/* Tour box fades up into place; its words arrive letter by letter. */
.tour-tip { opacity: 0; translate: 0 8px; transition: opacity .28s ease, translate .32s cubic-bezier(.2,.8,.2,1); }
.tour-tip.show { opacity: 1; translate: 0 0; }
.tour-tip .tt-w { display: inline-block; white-space: nowrap; }
.tour-tip .tt-c { display: inline-block; opacity: 0; transform: translateY(7px); filter: blur(3px); animation: tt-in .5s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes tt-in { to { opacity: 1; transform: none; filter: blur(0); } }
@media (prefers-reduced-motion: reduce) { .tour-tip, .tour-ring.glide { transition: none; } .tour-tip .tt-c { animation: none; opacity: 1; transform: none; filter: none; } }
.site-ver { text-align: center; margin: 16px 0 0; }
.std-bar { display: flex; gap: 6px; align-items: center; }
.std-bar select { width: auto; min-width: 0; }
.std-bar input { width: 64px; }
.turbo-bar .seg button { white-space: nowrap; padding: 0 4px; }
@media (max-width: 420px) { .turbo-bar .seg button { font-size: 14px; } }
@media (max-width: 699px) {
  .std-table td[data-label="Pull-ups or hang"] { grid-column: 1 / -1; }
  .std-table .std-bar select { flex: 1; }
  .std-table .std-bar input { width: 96px; flex: none; }
}
/* School discipline */
.disc-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.disc-row:last-child { border-bottom: 0; }
.disc-row:hover { background: var(--raised); }
.disc-snip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.disc-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.disc-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); display: block; }
.disc-docs { list-style: none; padding: 0; margin: 8px 0; }
.disc-docs li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.disc-docs li:last-child { border-bottom: 0; }
.disc-docs li a, .disc-docs li .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.disc-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.disc-thumb { position: relative; width: 84px; height: 84px; }
.disc-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.disc-thumb .icon-btn { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; min-height: 0; background: rgba(0,0,0,.65); border-radius: 50%; color: #fff; }
.disc-add { width: 84px; height: 84px; border: 1px dashed var(--line-strong); border-radius: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); cursor: pointer; }
.disc-add:hover { color: var(--ink); border-color: var(--ink); }

/* Owner screen lock button: after the title in the phone top bar, on its own row under the title in the sidebar. */
.lock-btn { display: inline-flex; align-items: center; gap: 6px; width: auto; padding: 0 8px; flex-shrink: 0; white-space: nowrap; }
.topbar .lock-btn { margin-left: 8px; }
.lock-word { font-size: 13px; }
.lock-count { font-size: 12px; color: var(--caution); white-space: nowrap; }
.lock-count:empty { display: none; }
.side-lock { display: flex; margin: -4px 0 10px; }
.side-lock .lock-btn { height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; }

/* School staff are view-only: buttons that add, change or remove things are hidden (the server refuses them anyway). */
body.view-only .save-bar, body.view-only .btn.danger,
body.view-only [data-add], body.view-only [data-bulk], body.view-only [data-del], body.view-only [data-delete], body.view-only [data-edit],
body.view-only [data-reset], body.view-only [data-suspend], body.view-only [data-unsuspend], body.view-only [data-archive], body.view-only [data-logoutall],
body.view-only [data-rmphoto], body.view-only [data-ok], body.view-only [data-no], body.view-only [data-fix], body.view-only [data-preview],
body.view-only [data-viewas], body.view-only [data-school], body.view-only [data-sign], body.view-only [data-delpt], body.view-only [data-rmaward],
body.view-only [data-delfile], body.view-only [data-delfolder], body.view-only [data-adddisc], body.view-only [data-addyc], body.view-only [data-delann],
body.view-only [data-delreq], body.view-only button[data-unlock], body.view-only [data-end],
body.view-only #main form:not([data-pw]) button[type=submit] { display: none !important; }

/* Owner notes: list on the left, a calm writing page on the right. One at a time on a phone. */
.notes { display: grid; grid-template-columns: 1fr; gap: 0; min-height: calc(100vh - 140px); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
@media (min-width: 860px) { .notes { grid-template-columns: 300px minmax(0, 1fr); } .notes.focus { grid-template-columns: minmax(0, 1fr); } }
.notes [hidden] { display: none !important; }
.notes-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; background: var(--shell); }
.notes-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 16px 12px; border-bottom: 1px solid var(--line); }
.notes-head h1 { font-size: 20px; margin: 0; }
.note-item { display: grid; gap: 3px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; color: var(--ink); cursor: pointer; font: inherit; }
.note-item:hover { background: var(--raised); }
.note-item.on { background: var(--raised); box-shadow: inset 3px 0 0 var(--ink); }
.note-t { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-p { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-d { font-size: 12px; color: var(--faint, var(--muted)); }
.notes-pane { display: flex; flex-direction: column; min-width: 0; }
.note-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; flex-wrap: wrap; }
.note-tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.note-tools .icon-btn { width: 34px; height: 34px; font-size: 15px; color: var(--ink); }
.note-tools select { height: 34px; padding: 0 28px 0 10px; font-size: 13px; width: auto; }
.note-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.note-status { margin-left: auto; white-space: nowrap; }
.note-doc { width: 100%; max-width: 760px; margin: 0 auto; padding: 36px 28px 80px; }
.notes.focus .note-doc { max-width: 860px; }
.note-title { width: 100%; border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 !important; font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; outline: none; }
.note-meta { margin: 8px 0 22px; }
.note-ed { min-height: 50vh; outline: none; font-size: 17px; line-height: 1.7; color: var(--ink); }
.note-ed:empty::before { content: attr(data-ph); color: var(--muted); }
.note-ed p, .note-ed div { margin: 0 0 12px; }
.note-ed h2 { font-size: 24px; margin: 26px 0 10px; line-height: 1.3; }
.note-ed h3 { font-size: 19px; margin: 20px 0 8px; }
.note-ed ul, .note-ed ol { margin: 0 0 12px; padding-left: 24px; }
.note-ed li { margin: 4px 0; }
.note-ed .fs-small { font-size: 14px; }
.note-ed .fs-large { font-size: 21px; }
.note-blank { margin: auto; text-align: center; color: var(--muted); padding: 60px 20px; display: grid; justify-items: center; gap: 10px; }
.note-blank svg { width: 36px; height: 36px; }
body.note-focus .sidebar, body.note-focus .topbar, body.note-focus .tabbar { display: none !important; }
body.note-focus .notes { min-height: calc(100vh - 48px); }
@media (max-width: 859px) { .notes { border-radius: 0; border-left: 0; border-right: 0; min-height: calc(100vh - 160px); } .note-doc { padding: 24px 18px 80px; } .note-title { font-size: 24px; } .notes-list { border-right: 0; } }
body.note-focus main { max-width: none; }
@media (max-width: 859px) { .note-tools { order: 3; flex-basis: 100%; justify-content: space-between; } .note-tools .note-sep { display: none; } }
/* School staff all share the battalion crest as their picture. */
img.avatar.school-av { object-fit: contain; background: var(--raised); padding: 3px; }
