@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/instrument-serif-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/instrument-serif-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/instrument-serif-latin-400-italic.woff2) format("woff2"); }
:root {
  --bg: #f6f3ec; --card: #fffdf8; --card2: #f1ede3; --ink: #1d1d1b; --muted: #6b675e; --faint: #9a958a;
  --line: #e2dbcc; --line2: #cfc6b2; --accent: #a31f1f; --ok: #2f7a4a; --warn: #b7791f; --info: #2f6f9f;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 12px; --shadow: 0 1px 2px rgba(40, 30, 10, .05), 0 4px 16px rgba(40, 30, 10, .04);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #16181b; --card: #1f2226; --card2: #262a2f; --ink: #ecebe7; --muted: #a3a19a; --faint: #7a7872;
    --line: #2f3338; --line2: #3d4248; --accent: #e06c5f; --ok: #5cb87a; --warn: #e0a84a; --info: #6aa7d6;
    --shadow: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-text-size-adjust: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 22px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 19px; }
.brand .mark { width: 32px; height: 32px; display: block; }
.tabs { display: flex; gap: 2px; }
.tabs a { text-decoration: none; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.tabs a:hover { color: var(--ink); background: var(--card2); }
.tabs a.active { color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.search { margin-left: auto; }
.search input { width: 260px; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); outline: none; }
.search input:focus { border-color: var(--line2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 18%, transparent); }
.bottomnav { display: none; }
main { max-width: 1240px; margin: 0 auto; padding: 22px 22px 80px; outline: none; }

/* ---------- generic ---------- */
.pagehead { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 4px 0 18px; }
.pagehead h1 { margin: 0; font-size: 30px; line-height: 1.1; }
.pagehead .sub { color: var(--muted); }
.pagehead .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9px; border: 1px solid var(--line2); background: var(--card); cursor: pointer; text-decoration: none; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--card2); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: .9; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--accent); }
.btn.sm { padding: 4px 9px; font-size: 13px; border-radius: 7px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.card h2 { font-size: 13px; font-family: var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.card h2 .right { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--card2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; text-decoration: none; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.proj { background: color-mix(in srgb, var(--c) 12%, var(--card)); color: color-mix(in srgb, var(--c) 80%, var(--ink)); border-color: color-mix(in srgb, var(--c) 30%, var(--line)); }
.chip.red { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.chip.amber { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); background: color-mix(in srgb, var(--warn) 8%, var(--card)); }
.chip.green { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); background: color-mix(in srgb, var(--ok) 8%, var(--card)); }
.empty { color: var(--muted); padding: 10px 0; font-size: 14px; }
.empty b { color: var(--ink); }
input.field, select.field, textarea.field { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); outline: none; }
input.field:focus, select.field:focus, textarea.field:focus { border-color: var(--line2); background: var(--card); }
label.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; text-transform: uppercase; letter-spacing: .05em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: 9px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 2px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
mark { background: color-mix(in srgb, #f2c94c 45%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- dashboard ---------- */
.dash-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; border-bottom: 3px double var(--ink); padding-bottom: 12px; margin-bottom: 18px; }
.dash-head .date { font-family: var(--serif); font-size: 34px; font-weight: 700; line-height: 1.05; }
.dash-head .kicker { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; align-items: start; }
.span-8 { grid-column: span 8; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-12 { grid-column: span 12; }
.stack { display: grid; gap: 16px; }
.quick { display: flex; gap: 8px; margin-top: 2px; }
.quick textarea { flex: 1; min-height: 42px; resize: vertical; }
.desk-kicker { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.desk-headline { font-family: var(--serif); font-size: 27px; line-height: 1.15; font-weight: 700; margin: 4px 0 6px; }
.desk-dek { font-family: var(--serif); font-style: italic; color: var(--muted); margin-bottom: 12px; }
.desk-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 0 22px; border-top: 1px solid var(--line); padding-top: 12px; }
.desk-cols h3 { font-family: var(--sans); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--ink); }
.desk-item { margin-bottom: 11px; }
.desk-item .t { font-family: var(--serif); font-weight: 700; font-size: 16px; line-height: 1.25; }
.desk-item .m { font-size: 13px; color: var(--muted); }
.signature { margin-top: 12px; border: 1px solid var(--ink); padding: 10px 12px; border-radius: 4px; font-family: var(--serif); }
.signature .lbl2 { font-family: var(--sans); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; margin-bottom: 4px; }
.cal-ev { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.cal-ev:first-child { border-top: 0; }
.cal-ev .tm { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 2px; }
.cal-day { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 12px 0 2px; }
.cal-day:first-child { margin-top: 0; }
.research { max-height: 560px; overflow: auto; }
.research details { border-top: 1px solid var(--line); padding: 6px 0; }
.research details:first-of-type { border-top: 0; }
.research summary { cursor: pointer; font-weight: 600; font-family: var(--serif); font-size: 16px; padding: 4px 0; }
.research .md { font-size: 14px; }
.explant { display: flex; gap: 10px; align-items: baseline; }
.todo { display: flex; gap: 8px; align-items: baseline; }
.todo .box { width: 13px; height: 13px; border: 1.5px solid var(--line2); border-radius: 3px; flex: 0 0 13px; transform: translateY(2px); }

/* ---------- logbook ---------- */
.logwrap > section, .dash-grid > *, .stack > * { min-width: 0; }
.logwrap { display: grid; grid-template-columns: 250px 1fr; gap: 22px; align-items: start; }
.daylist { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; padding-right: 4px; }
.daylist .month { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 14px 0 4px 8px; }
.daylist a { display: block; text-decoration: none; padding: 6px 9px; border-radius: 8px; }
.daylist a:hover { background: var(--card2); }
.daylist a.active { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.daylist .d { font-weight: 600; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.daylist .h { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daylist .new { font-size: 10px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.daydots { display: inline-flex; gap: 3px; } .daydots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.dayhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dayhead h1 { margin: 0; font-size: 28px; }
.dayhead .nav { display: flex; gap: 4px; }
.status { font-size: 12px; color: var(--muted); min-width: 70px; }
.status.err { color: var(--accent); font-weight: 600; }
.editor-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.banner { padding: 9px 12px; border-radius: 9px; margin-bottom: 10px; font-size: 14px; border: 1px solid var(--line); background: var(--card2); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 10%, var(--card)); }
.banner.err { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.menu { position: relative; }
.menu .pop { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 220px; background: var(--card); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 5px; max-height: 320px; overflow: auto; }
.menu .pop button { display: flex; width: 100%; text-align: left; padding: 7px 9px; border: 0; background: none; border-radius: 7px; cursor: pointer; gap: 8px; align-items: center; }
.menu .pop button:hover { background: var(--card2); }

/* Toast UI editor theming */
.toastui-editor-defaultUI { border-color: var(--line) !important; border-radius: var(--radius) !important; background: var(--card); overflow: hidden; }
.toastui-editor-defaultUI-toolbar { flex-wrap: wrap; height: auto !important; background: var(--card2) !important; border-bottom-color: var(--line) !important; }
.toastui-editor-contents, .toastui-editor-contents p, .ProseMirror { font-family: var(--sans) !important; font-size: 15px !important; color: var(--ink) !important; }
.toastui-editor-contents h1, .toastui-editor-contents h2 { font-family: var(--serif) !important; border-bottom: 0 !important; color: var(--ink) !important; }
.toastui-editor-contents h1 { font-size: 22px !important; margin-top: 18px !important; padding-bottom: 2px !important; border-bottom: 1px solid var(--line) !important; }
.toastui-editor-contents img { max-width: 100%; border-radius: 6px; }
.toastui-editor-mode-switch { background: var(--card2) !important; border-top-color: var(--line) !important; }
.toastui-editor-md-container, .toastui-editor-ww-container { background: var(--card) !important; }
@media (prefers-color-scheme: dark) {
  .toastui-editor-defaultUI-toolbar button { filter: invert(.85); border-color: transparent !important; }
  .toastui-editor-md-container .toastui-editor, .toastui-editor-md-preview, .ProseMirror, .toastui-editor-contents * { color: var(--ink) !important; }
  .toastui-editor-contents pre, .toastui-editor-contents code { background: var(--card2) !important; }
  .toastui-editor-contents table td, .toastui-editor-contents table th { border-color: var(--line2) !important; }
  .toastui-editor-contents th { background: var(--card2) !important; }
  .toastui-editor-mode-switch .tab-item { background: var(--card2) !important; color: var(--muted) !important; border-color: var(--line) !important; }
  .toastui-editor-mode-switch .tab-item.active { background: var(--card) !important; color: var(--ink) !important; }
  .toastui-editor-md-splitter { background: var(--line) !important; }
  .toastui-editor-popup, .toastui-editor-context-menu { background: var(--card) !important; color: var(--ink); border-color: var(--line2) !important; }
}

/* ---------- rendered markdown ---------- */
.md { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.md h1 { font-size: 22px; margin: 22px 0 8px; padding-bottom: 3px; border-bottom: 1px solid var(--line); }
.md h2 { font-size: 19px; margin: 18px 0 6px; } .md h3 { font-size: 16px; margin: 14px 0 4px; }
.md > :first-child { margin-top: 0; }
.md img { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); }
.md table { border-collapse: collapse; margin: 10px 0; display: block; overflow-x: auto; max-width: 100%; font-size: 14px; }
.md th, .md td { border: 1px solid var(--line2); padding: 5px 9px; text-align: left; vertical-align: top; }
.md th { background: var(--card2); }
.md code { font-family: var(--mono); font-size: .88em; background: var(--card2); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--card2); padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 10px 0; padding: 4px 14px; border-left: 3px solid var(--line2); color: var(--muted); }
.md ul, .md ol { padding-left: 24px; }
.md li.task { list-style: none; margin-left: -20px; }
.md li.task input { margin-right: 7px; transform: translateY(1px); accent-color: var(--ok); }
.md a.wiki { color: var(--info); text-decoration: none; border-bottom: 1px dashed color-mix(in srgb, var(--info) 50%, transparent); }
.md a.embed { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card2); text-decoration: none; }
.callout { border-left: 4px solid var(--cc, var(--info)); background: color-mix(in srgb, var(--cc, var(--info)) 8%, var(--card)); border-radius: 8px; padding: 9px 13px; margin: 10px 0; color: var(--ink) !important; }
.callout .ct { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--cc, var(--info)); margin-bottom: 3px; }
.callout.warning, .callout.caution, .callout.danger, .callout.error { --cc: var(--accent); }
.callout.tip, .callout.success, .callout.check { --cc: var(--ok); }
.callout.note, .callout.info, .callout.abstract { --cc: var(--info); }
.callout.question, .callout.todo, .callout.important { --cc: var(--warn); }
.qty { display: inline-block; padding: 0 5px; margin: 0 1px; border-radius: 5px; font-weight: 600; font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--info) 11%, transparent); color: color-mix(in srgb, var(--info) 75%, var(--ink)); }
.qty.temp { background: color-mix(in srgb, var(--accent) 11%, transparent); color: color-mix(in srgb, var(--accent) 80%, var(--ink)); }
.qty.time { background: color-mix(in srgb, var(--ok) 13%, transparent); color: color-mix(in srgb, var(--ok) 80%, var(--ink)); cursor: pointer; }
.qty.time::before { content: "⏱ "; font-size: .85em; }
.qty.time:hover { outline: 1px solid var(--ok); }

/* ---------- protocols ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pcard { text-decoration: none; display: flex; flex-direction: column; gap: 6px; border-top: 4px solid var(--c, var(--line2)); }
.pcard:hover { border-color: var(--line2); border-top-color: var(--c, var(--line2)); }
.pcard .t { font-family: var(--serif); font-weight: 700; font-size: 18px; line-height: 1.25; }
.pcard .s { color: var(--muted); font-size: 13.5px; }
.protocol-doc { max-width: 860px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); padding: 40px 52px 48px; }
.protocol-doc .ph { border-bottom: 3px double var(--ink); padding-bottom: 14px; margin-bottom: 18px; }
.protocol-doc .ph .k { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.protocol-doc .ph h1 { font-size: 34px; margin: 4px 0 10px; line-height: 1.1; }
.protocol-doc .meta { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.protocol-doc .meta b { color: var(--ink); font-weight: 600; }
.protocol-doc .md h1, .protocol-doc .md h2 { font-family: var(--sans); font-size: 12.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 5px; margin-top: 28px; }
.protocol-doc .md h1 { color: var(--ink); font-size: 14px; }
.protocol-doc .md ol.steps { list-style: none; padding: 0; counter-reset: step; }
.protocol-doc .md ol.steps > li { counter-increment: step; position: relative; padding: 9px 12px 9px 50px; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.protocol-doc .md ol.steps > li::before { content: counter(step); position: absolute; left: 12px; top: 9px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.protocol-doc .md ol.steps > li.done { opacity: .55; }
.protocol-doc .md ol.steps > li.done::before { background: var(--ok); content: "✓"; }
.protocol-doc .md li.task.checkstep { list-style: none; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; margin: 0 0 6px -20px; background: var(--bg); }
.protocol-doc .md li.task.checkstep:has(input:checked) { opacity: .55; }
.protocol-doc .md table { display: table; width: 100%; }

/* ---------- animals ---------- */
.study-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
table.grid th { position: sticky; top: 0; background: var(--card2); text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td { padding: 3px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid input, table.grid select { width: 100%; min-width: 60px; padding: 5px 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; outline: none; }
table.grid input:hover, table.grid select:hover { border-color: var(--line); }
table.grid input:focus, table.grid select:focus { border-color: var(--line2); background: var(--bg); }
table.grid input[type=date] { min-width: 128px; }
table.grid select[data-f=status] { min-width: 112px; }
table.grid td.w-s input { min-width: 64px; } table.grid td.w-l input { min-width: 190px; }
table.grid tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.grid tr.soon td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
table.grid tr.done td { color: var(--muted); }
.st-implanted { color: var(--info); } .st-explanted { color: var(--ok); } .st-excluded, .st-died, .st-euthanized { color: var(--accent); }
.gantt { display: grid; gap: 4px; font-size: 12px; }
.gantt .g { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: center; }
.gantt .track { position: relative; height: 16px; background: var(--card2); border-radius: 4px; }
.gantt .bar { position: absolute; top: 2px; height: 12px; border-radius: 3px; background: var(--info); }
.gantt .bar.planned { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--info) 45%, transparent) 0 4px, transparent 4px 8px); border: 1px solid var(--info); }
.gantt .today { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--accent); }
.links-list a { color: var(--info); word-break: break-all; }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--card); border-radius: 14px; border: 1px solid var(--line2); width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 18px 20px; }
.modal h3 { margin: 0 0 10px; }

/* ---------- projects ---------- */
.proj-card { border-left: 5px solid var(--c); display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.proj-card .t { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.timeline .entry { border-left: 2px solid var(--line2); padding: 0 0 14px 16px; position: relative; }
.timeline .entry::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--ink)); }
.timeline .entry .when { font-size: 12px; color: var(--muted); font-weight: 600; }
.timeline .entry .md { font-size: 14px; max-height: 220px; overflow: hidden; position: relative; }
.timeline .entry .md.clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 50px; background: linear-gradient(transparent, var(--card)); }
.color-input { width: 38px; height: 34px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }

/* ---------- search ---------- */
.results li { padding: 12px 0; }
.results .rt { font-weight: 600; text-decoration: none; font-size: 16px; }
.results .rs { font-size: 14px; color: var(--muted); margin-top: 2px; }
.typeicon { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }

/* ---------- timers / toast ---------- */
.timers { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: grid; gap: 8px; }
.timer { background: var(--ink); color: var(--bg); padding: 9px 12px; border-radius: 12px; display: flex; gap: 10px; align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-variant-numeric: tabular-nums; }
.timer.done { background: var(--accent); animation: pulse 1s infinite alternate; }
.timer button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 16px; opacity: .8; }
@keyframes pulse { to { transform: scale(1.04); } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s; background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 10px; z-index: 60; pointer-events: none; font-size: 14px; }
.toast.show { opacity: 1; transform: translateX(-50%); }


/* ---------- mouse diagrams ---------- */
svg.mouse { display: block; }
svg.mouse.mini { width: 58px; flex: 0 0 58px; }
svg.mouse.full { width: 100%; max-width: 280px; margin: 0 auto; }
.m-body, .m-ear, .m-limb { fill: var(--card2); stroke: var(--line2); stroke-width: 2.5; }
.m-ear { fill: color-mix(in srgb, var(--accent) 10%, var(--card2)); }
.m-tail { fill: none; stroke: var(--line2); stroke-width: 5; stroke-linecap: round; }
.m-nose { fill: var(--muted); }
.m-mid { stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 5 4; }
.m-implant rect { stroke: rgba(0,0,0,.18); stroke-width: 1; }
.m-implant text { fill: #fff; font: 700 15px var(--sans); pointer-events: none; }
.m-implant.sel rect { stroke: var(--ink); stroke-width: 3.5; }
svg.mouse.full .m-implant, .m-add { cursor: pointer; }
.m-add rect { fill: color-mix(in srgb, var(--info) 8%, transparent); stroke: var(--info); stroke-width: 2; stroke-dasharray: 5 3; }
.m-add text { fill: var(--info); font: 700 22px var(--sans); pointer-events: none; }
.m-add.small text { font-size: 18px; }
.m-add:hover rect { fill: color-mix(in srgb, var(--info) 18%, transparent); }
.m-side { font: 700 15px var(--sans); fill: var(--muted); }
.m-cap { font: 9px var(--sans); fill: var(--faint); }
.m-leg { font-size: 12.5px; line-height: 1.5; display: flex; gap: 5px; align-items: baseline; }
.m-dot { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; color: #fff; font: 700 10.5px var(--sans); flex: 0 0 17px; transform: translateY(2px); margin-right: 2px; }
.m-site { font-weight: 700; color: var(--muted); min-width: 20px; }
.mice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.mcard svg.mouse.mini { width: 70px; flex-basis: 70px; }
.mcard { display: flex; gap: 12px; align-items: flex-start; text-align: left; cursor: pointer; padding: 12px; font: inherit; color: inherit; }
.mcard:hover { border-color: var(--line2); }
.mcard.overdue { box-shadow: inset 4px 0 0 var(--accent); } .mcard.soon { box-shadow: inset 4px 0 0 var(--warn); } .mcard.done { opacity: .7; }
.mc-info { min-width: 0; flex: 1; display: grid; gap: 3px; }
.red { color: var(--accent); } .amber { color: var(--warn); } .tiny { font-size: 11px; }
.subhead { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 4px 0 6px; }
.subhead + .list { margin-bottom: 10px; }
.explant { align-items: flex-start !important; }
.mtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.mtile { text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); text-align: center; }
.mtile:hover { border-color: var(--line2); }
.mtile svg.mouse.mini { width: 50px; flex-basis: auto; }
.modal.wide { width: min(1040px, 100%); }
.animal-ed { display: grid; grid-template-columns: 270px 1fr; gap: 22px; margin-top: 10px; }
.srow { display: grid; grid-template-columns: 20px 140px 1.2fr 1fr 1.2fr 1fr 30px; gap: 6px; align-items: center; padding: 5px; border-radius: 9px; border: 1px solid transparent; margin-bottom: 4px; }
.srow.sel { border-color: var(--line2); background: var(--bg); }
.srow .field { padding: 6px 8px; }
.newmouse { display: grid; grid-template-columns: 1fr 200px 1fr; gap: 14px; align-items: center; }
.newmouse svg.mouse.full { max-width: 180px; }
.tabledet summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.sbtn { text-align: left; white-space: nowrap; }
@media (max-width: 760px) {
  .animal-ed { grid-template-columns: 1fr; }
  .animal-ed svg.mouse.full { max-width: 220px; }
  .srow { grid-template-columns: 20px 1fr 30px; }
  .srow [data-sf=site] { grid-column: 2; } .srow [data-sf=sample], .srow [data-sf=condition], .srow [data-sf=outcome], .srow [data-sf=notes] { grid-column: 2 / 4; }
  .srow [data-rmsample] { grid-column: 3; grid-row: 1; }
  .newmouse { grid-template-columns: 1fr 1fr; } .newmouse #newMouseSvg { grid-column: 1 / 3; grid-row: 1; }
}

/* ---------- Instrument Serif tuning (single weight display face) ---------- */
h1, h2, h3, .brand, .dash-head .date, .desk-headline, .desk-item .t, .pcard .t, .proj-card .t, .research summary, .signature b,
.toastui-editor-contents h1, .toastui-editor-contents h2, .md h1, .md h2, .md h3, .protocol-doc .ph h1, .modal h3 { font-weight: 400 !important; letter-spacing: 0; }
.brand { font-size: 24px; white-space: nowrap; }
.pagehead h1 { font-size: 40px; } .dayhead h1 { font-size: 36px; } .dash-head .date { font-size: 46px; }
.desk-headline { font-size: 34px; line-height: 1.08; } .desk-item .t { font-size: 20px; line-height: 1.15; }
.pcard .t, .proj-card .t { font-size: 23px; line-height: 1.12; } .research summary { font-size: 20px; }
.md h1, .toastui-editor-contents h1 { font-size: 27px !important; } .md h2 { font-size: 23px; }
.protocol-doc .ph h1 { font-size: 46px; line-height: 1.02; }
.desk-dek, .signature { font-size: 17px; }
.modal h3 { font-size: 26px; }
/* papers */
.papers li { padding: 8px 0; }
.papers .pt { font-weight: 600; text-decoration: none; line-height: 1.3; display: block; }
.papers .pt:hover { text-decoration: underline; }
.papers details.abs { border: 0; padding: 2px 0 0; }
.papers details.abs summary { font-family: var(--sans); font-size: 12px; color: var(--faint); padding: 0; }
/* mini calendar */
.minical { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 10px; }
.mc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; font-size: 14px; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mc-dow span { font-size: 10px; font-weight: 700; color: var(--faint); padding: 2px 0; }
.mc-grid a { position: relative; display: block; padding: 5px 0 7px !important; border-radius: 7px; font-size: 12.5px; text-decoration: none; color: var(--faint); }
.mc-grid a.has { color: var(--ink); font-weight: 600; }
.mc-grid a i { position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; }
.mc-grid a.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.mc-grid a.sel { background: var(--ink); color: var(--bg); }
.mc-grid a:hover:not(.sel) { background: var(--card2); }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .dash-grid > * { grid-column: span 12 !important; }
  .logwrap { grid-template-columns: 1fr; }
  .daylist { position: static; max-height: none; display: none; }
  .daylist.open { display: block; }
  .study-meta, .grid3 { grid-template-columns: 1fr 1fr; }
  .desk-cols { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .pagehead h1, .dayhead h1 { font-size: 30px !important; } .dash-head .date { font-size: 34px !important; } .desk-headline { font-size: 28px; }
  .topbar { padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); gap: 10px; }
  .tabs { display: none; }
  .search input { width: 150px; }
  .brand-name { display: none; }
  main { padding: 14px 14px calc(84px + env(safe-area-inset-bottom)); }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 25; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; text-decoration: none; color: var(--muted); font-weight: 600; }
  .bottomnav a svg { width: 23px; height: 23px; fill: currentColor; }
  .bottomnav a.active { color: var(--ink); }
  .pagehead h1, .dayhead h1 { font-size: 24px; }
  .dash-head .date { font-size: 26px; }
  .protocol-doc { padding: 22px 18px; border-radius: 10px; }
  .protocol-doc .ph h1 { font-size: 26px; }
  .grid2, .study-meta, .grid3 { grid-template-columns: 1fr; }
  .timers { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .card { padding: 14px; }
}
@media print {
  .topbar, .bottomnav, .no-print, .timers, .toast { display: none !important; }
  body, main { background: #fff; color: #000; padding: 0; }
  .protocol-doc { box-shadow: none; border: 0; padding: 0; max-width: none; }
  .protocol-doc .md ol.steps > li { break-inside: avoid; }
}

/* =====================================================================
   Glass theme — iOS / macOS (Liquid Glass) look. Overrides the base theme.
   ===================================================================== */
:root {
  --tint: #0a7cff; --tint-ink: #fff;
  --bg: #f3efe9; --ink: #1c1c1e; --muted: #6e6e73; --faint: #a1a1a6;
  --card: rgba(255, 255, 255, .58); --card2: rgba(118, 118, 128, .10);
  --line: rgba(60, 60, 67, .12); --line2: rgba(60, 60, 67, .22);
  --glass-border: rgba(255, 255, 255, .75); --glass-hi: rgba(255, 255, 255, .85);
  --glass-shadow: 0 1px 1px rgba(0, 0, 0, .04), 0 10px 34px rgba(60, 40, 20, .10);
  --fill: rgba(118, 118, 128, .12); --fill-strong: rgba(118, 118, 128, .2);
  --radius: 22px; --shadow: var(--glass-shadow);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, sans-serif;
  --blur: blur(28px) saturate(180%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --tint: #3b9bff; --bg: #121214; --ink: #f2f2f7; --muted: #a1a1aa; --faint: #6e6e76;
    --card: rgba(44, 44, 48, .55); --card2: rgba(118, 118, 128, .18);
    --line: rgba(255, 255, 255, .08); --line2: rgba(255, 255, 255, .16);
    --glass-border: rgba(255, 255, 255, .12); --glass-hi: rgba(255, 255, 255, .14);
    --glass-shadow: 0 10px 40px rgba(0, 0, 0, .45);
    --fill: rgba(118, 118, 128, .24); --fill-strong: rgba(118, 118, 128, .34);
  }
}
html { background: var(--bg); }
/* The gradient lives on a fixed layer behind everything: it covers the strip above the floating
   toolbar (the toolbar's top margin used to collapse through <body>, leaving plain background there),
   the iOS status-bar area and the rubber-band overscroll, and works on iOS where background-attachment: fixed does not. */
body { background: transparent; min-height: 100vh; display: flow-root; -webkit-font-smoothing: antialiased; }
body::before {
  content: ''; position: fixed; left: 0; right: 0; top: -25vh; bottom: -25vh; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 8% 17%, rgba(244, 170, 150, .55), transparent 60%),
    radial-gradient(800px 600px at 100% 20%, rgba(140, 180, 255, .45), transparent 60%),
    radial-gradient(900px 700px at 70% 80%, rgba(255, 210, 160, .45), transparent 60%),
    radial-gradient(700px 600px at 0% 72%, rgba(200, 160, 230, .30), transparent 60%),
    var(--bg);
}
@media (prefers-color-scheme: dark) {
  body::before {
    background:
      radial-gradient(900px 600px at 8% 17%, rgba(196, 64, 47, .30), transparent 60%),
      radial-gradient(800px 600px at 100% 20%, rgba(40, 90, 200, .32), transparent 60%),
      radial-gradient(900px 700px at 70% 80%, rgba(150, 80, 40, .25), transparent 60%),
      radial-gradient(700px 600px at 0% 72%, rgba(110, 60, 160, .25), transparent 60%),
      var(--bg);
  }
}
a { color: inherit; }
::selection { background: color-mix(in srgb, var(--tint) 30%, transparent); }

/* glass surfaces */
.card, .minical, .modal, .protocol-doc, .tablewrap, .toastui-editor-defaultUI {
  background: var(--card) !important;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi) !important;
}
.card { border-radius: var(--radius); }
.card h2 { font-family: var(--sans); font-size: 13px; letter-spacing: .02em; text-transform: none; font-weight: 600; color: var(--muted); }
.card h2 .right { font-weight: 500; }

/* floating toolbar (macOS) */
.topbar {
  position: sticky; top: 10px; margin: 10px auto 0; max-width: 1240px; width: calc(100% - 28px);
  border-radius: 999px; padding: 7px 8px 7px 14px; border: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border);
  background: var(--card); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi);
}
.brand .mark { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
/* segmented control */
.tabs { background: var(--fill); padding: 3px; border-radius: 999px; gap: 0; }
.tabs a { border-radius: 999px; padding: 6px 15px; font-size: 14px; color: var(--ink); opacity: .78; transition: background .2s, box-shadow .2s, opacity .2s; }
.tabs a:hover { background: transparent; opacity: 1; }
.tabs a.active { opacity: 1; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 4px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
@media (prefers-color-scheme: dark) { .tabs a.active { background: rgba(120, 120, 128, .45); box-shadow: 0 1px 4px rgba(0, 0, 0, .4); } }
.search input { border-radius: 999px; border: 0; background: var(--fill); padding: 8px 14px 8px 32px; width: 240px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238e8e93'%3E%3Cpath d='M10 4a6 6 0 0 1 4.8 9.6l4.8 4.8-1.4 1.4-4.8-4.8A6 6 0 1 1 10 4zm0 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center; background-size: 16px; }
.search input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 35%, transparent); background-color: var(--card); }
main { padding-top: 26px; }

/* buttons — capsules */
.btn { border-radius: 999px; border: 0; padding: 8px 16px; font-weight: 590; font-size: 14px; color: var(--ink);
  background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), inset 0 0 0 .5px rgba(0, 0, 0, .08), inset 0 1px 0 rgba(255, 255, 255, .8);
  transition: transform .12s ease, background .2s, box-shadow .2s, filter .2s; }
.btn:hover { background: rgba(255, 255, 255, .8); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--tint); color: var(--tint-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--tint) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.primary:hover { filter: brightness(1.08); opacity: 1; background: var(--tint); }
.btn.ghost { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--tint); }
.btn.ghost:hover { background: var(--fill); }
.btn.danger { color: #ff3b30; }
.btn.sm { padding: 5px 12px; font-size: 13px; border-radius: 999px; }
@media (prefers-color-scheme: dark) {
  .btn { background: rgba(120, 120, 128, .28); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .1), inset 0 1px 0 rgba(255, 255, 255, .1); }
  .btn:hover { background: rgba(120, 120, 128, .4); }
  .btn.primary { background: var(--tint); }
  .btn.ghost { background: transparent; box-shadow: none; }
}

/* fields — iOS grouped inputs */
input.field, select.field, textarea.field, table.grid input, table.grid select {
  border: 0 !important; border-radius: 12px; background: var(--fill); padding: 9px 12px; transition: box-shadow .15s, background .15s; }
input.field:focus, select.field:focus, textarea.field:focus, table.grid input:focus, table.grid select:focus {
  background: var(--card) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 35%, transparent); }
table.grid input, table.grid select { background: transparent; }
table.grid input:hover, table.grid select:hover { background: var(--fill); }
select.field { -webkit-appearance: none; appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
label.lbl { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }
input[type=checkbox] { accent-color: var(--tint); }

/* chips — tinted capsules */
.chip { border: 0; background: var(--fill); color: var(--muted); padding: 2px 9px; font-weight: 600; }
.chip.proj { border: 0; background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 85%, var(--ink)); }
.chip.red { background: rgba(255, 59, 48, .14); color: #e0281f; border: 0; }
.chip.amber { background: rgba(255, 159, 10, .16); color: #c27400; border: 0; }
.chip.green { background: rgba(52, 199, 89, .16); color: #1f8a3d; border: 0; }
@media (prefers-color-scheme: dark) { .chip.red { color: #ff6961; } .chip.amber { color: #ffb340; } .chip.green { color: #4cd964; } }

/* lists, links */
.list > li { border-top: .5px solid var(--line2); }
.md a.wiki, .links-list a, .papers .pt:hover { color: var(--tint); }
.daylist a { border-radius: 12px; }
.daylist a.active { background: color-mix(in srgb, var(--tint) 14%, transparent); box-shadow: none; }
.daylist a:hover { background: var(--fill); }
.mc-grid a { border-radius: 999px; aspect-ratio: 1; padding: 0 !important; display: grid; place-items: center; }
.mc-grid a.sel { background: var(--tint); color: #fff; }
.mc-grid a.today { box-shadow: none; color: var(--tint); font-weight: 700; }
.mc-grid a.today.sel { color: #fff; }
.mc-grid a i { bottom: 3px; }
.banner { border-radius: 14px; border: 0; background: var(--fill); }
.banner.warn { background: rgba(255, 159, 10, .14); } .banner.err { background: rgba(255, 59, 48, .12); }

/* dashboard head: large title (iOS) */
.dash-head { border-bottom: 0; padding-bottom: 4px; }
.dash-head .kicker { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.desk-cols h3 { border-bottom: .5px solid var(--line2); text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--muted); }
.desk-cols { border-top: .5px solid var(--line2); }
.signature { border: 0; background: color-mix(in srgb, var(--tint) 9%, transparent); border-radius: 16px; padding: 12px 14px; }
.desk-kicker { color: #ff3b30; }

/* tables */
table.grid th { background: transparent; border-bottom: .5px solid var(--line2); text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; }
table.grid td { border-bottom: .5px solid var(--line); }

/* modal = sheet */
.modal-back { background: rgba(0, 0, 0, .22); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal { border-radius: 26px; padding: 20px 22px; }
@media (prefers-color-scheme: light) { .modal { background: rgba(250, 250, 252, .78) !important; } }
@media (prefers-color-scheme: dark) { .modal { background: rgba(36, 36, 40, .82) !important; } }

/* cards with hover lift */
.pcard, .proj-card, .mcard, .mtile { transition: transform .18s ease, box-shadow .18s ease; }
.pcard:hover, .proj-card:hover, .mcard:hover { transform: translateY(-2px); }
.pcard { border-top: 0 !important; position: relative; overflow: hidden; }
.pcard::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--c, transparent); opacity: .9; }
.proj-card { border-left: 1px solid var(--glass-border) !important; position: relative; overflow: hidden; }
.proj-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.mtile { background: var(--fill); border: 0; border-radius: 16px; }
.mcard { border-radius: 20px; }

/* protocol document */
.protocol-doc { border-radius: 26px; }
.protocol-doc .md ol.steps > li { border: 0; background: var(--fill); border-radius: 16px; }
.protocol-doc .md ol.steps > li::before { background: var(--tint); color: #fff; }
.protocol-doc .md li.task.checkstep { border: 0; background: var(--fill); border-radius: 14px; }
.protocol-doc .ph { border-bottom: .5px solid var(--line2); }

/* editor */
.toastui-editor-defaultUI { border-radius: var(--radius) !important; overflow: hidden; }
.toastui-editor-defaultUI-toolbar { background: transparent !important; border-bottom: .5px solid var(--line2) !important; }
.toastui-editor-md-container, .toastui-editor-ww-container, .toastui-editor-main, .toastui-editor-md-preview { background: transparent !important; }
.toastui-editor-mode-switch { background: transparent !important; border-top: .5px solid var(--line2) !important; }
.toastui-editor-defaultUI-toolbar button { border-radius: 9px !important; }

/* timers / toast */
.timer, .toast { -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); background: rgba(28, 28, 30, .78); color: #fff; border-radius: 18px; }
.toast { border-radius: 999px; padding: 10px 18px; }

/* iOS floating tab bar */
@media (max-width: 680px) {
  .topbar { top: max(6px, env(safe-area-inset-top)); width: calc(100% - 20px); margin-top: 6px; padding: 6px 6px 6px 10px; }
  .search input { width: 160px; }
  main { padding-top: 16px; }
  .bottomnav {
    left: 12px; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); border-radius: 999px; padding: 7px 6px;
    background: var(--card); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi);
  }
  .bottomnav a { border-radius: 999px; padding: 4px 0; }
  .bottomnav a.active { color: var(--tint); background: var(--fill); }
  main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .timers { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .card { border-radius: 20px; }
}

/* photos */
.pblock { display: grid; gap: 10px; }
.pgroup { background: var(--fill); border-radius: 16px; padding: 10px 12px; }
.pg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.pg-thumbs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.thumb { position: relative; width: 92px; height: 92px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--card2); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10.5px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); padding: 10px 5px 3px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb:hover { transform: scale(1.03); }
.lightbox .modal { display: grid; gap: 12px; }
.lb-img { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 14px; margin: 0 auto; display: block; background: var(--fill); }

/* to-dos & calendar dots */
.todo-add { display: flex; gap: 6px; margin-bottom: 8px; }
.todo-add #todoText { flex: 1; min-width: 0; }
.todo-add select { width: 120px; flex: 0 0 120px; font-size: 13px; }
.todo { display: flex; gap: 9px; align-items: flex-start; }
.todo .tcheck { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 18px; accent-color: var(--tint); cursor: pointer; }
.todo.done > div { text-decoration: line-through; opacity: .5; transition: opacity .3s; }
.cal-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.green { color: #1f8a3d; }

/* calendar views */
.calview .cv-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.calview .seg { display: inline-flex; background: var(--fill); border-radius: 999px; padding: 2px; }
.calview .seg button { border: 0; background: transparent; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink); opacity: .75; cursor: pointer; }
.calview .seg button.on { opacity: 1; background: rgba(255,255,255,.92); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
@media (prefers-color-scheme: dark) { .calview .seg button.on { background: rgba(120,120,128,.45); } }
.calview .cv-nav { display: inline-flex; gap: 2px; }
.calview .cv-title { font-family: var(--serif); font-size: 22px; margin-left: 4px; }
.calview.compact .cv-title { font-size: 17px; flex-basis: 100%; margin: 0; }
.calview .cv-cals { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.cv-chip { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 4px 11px 4px 8px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: color-mix(in srgb, var(--cc) 16%, transparent); color: color-mix(in srgb, var(--cc) 80%, var(--ink)); }
.cv-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--cc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--cc) 30%, transparent); }
.cv-chip.off { background: var(--fill); color: var(--faint); }
.cv-chip.off i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.cv-chip.gear { background: var(--fill); color: var(--muted); padding: 4px 9px; }
.cv-err { color: #c27400; margin-top: 6px; }
.cv-heads, .cv-allday { display: grid; grid-template-columns: 46px repeat(var(--n), 1fr); gap: 0; font-size: 12px; }
.cv-heads span { text-align: center; color: var(--muted); padding: 4px 0; }
.cv-heads span b { font-size: 15px; color: var(--ink); margin-left: 2px; }
.cv-heads span.today b { background: #ff3b30; color: #fff; border-radius: 999px; padding: 1px 6px; }
.cv-allday { border-bottom: .5px solid var(--line2); padding-bottom: 4px; margin-bottom: 2px; }
.cv-allday .tm, .cv-hours div { font-size: 10.5px; color: var(--faint); text-align: right; padding-right: 6px; }
.cv-allday > div { padding: 1px; min-width: 0; }
.cv-grid { display: grid; grid-template-columns: 46px repeat(var(--n), 1fr); max-height: 62vh; overflow: auto; position: relative; }
.calview.compact .cv-grid { max-height: 380px; }
.cv-hours div { transform: translateY(-6px); }
.cv-col { position: relative; border-left: .5px solid var(--line); background-image: linear-gradient(var(--line) .5px, transparent .5px); background-size: 100% var(--hpx, 46px); }
.calview.compact .cv-col { --hpx: 34px; }
.cv-col.today { background-color: color-mix(in srgb, var(--tint) 4%, transparent); }
.cv-tev { position: absolute; border-radius: 7px; padding: 2px 5px; font-size: 11.5px; line-height: 1.25; overflow: hidden;
  background: color-mix(in srgb, var(--cc) 20%, var(--card)); border-left: 3px solid var(--cc); color: var(--ink); }
.cv-tev b { font-weight: 600; color: color-mix(in srgb, var(--cc) 75%, var(--ink)); }
.cv-tev .loc { color: var(--muted); font-size: 10.5px; }
.cv-now { position: absolute; left: 0; right: 0; height: 2px; background: #ff3b30; z-index: 2; }
.cv-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #ff3b30; }
.cv-ev { font-size: 11.5px; border-radius: 6px; padding: 1px 6px; margin: 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--cc) 18%, transparent); color: color-mix(in srgb, var(--cc) 60%, var(--ink)); }
.cv-ev b { font-weight: 600; }
.cv-mhead, .cv-mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cv-mhead span { text-align: center; font-size: 11px; font-weight: 600; color: var(--faint); padding: 2px 0; }
.cv-cell { border: 0; background: var(--fill); border-radius: 10px; min-height: 104px; padding: 4px; text-align: left; font: inherit; color: inherit; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; gap: 1px; }
.calview.compact .cv-cell { min-height: 0; aspect-ratio: 1; align-items: center; justify-content: center; padding: 2px; background: transparent; }
.cv-cell .n { font-size: 12px; font-weight: 600; }
.cv-cell.out { opacity: .4; }
.cv-cell.today .n { background: #ff3b30; color: #fff; border-radius: 999px; padding: 0 6px; align-self: flex-start; }
.calview.compact .cv-cell.today .n { align-self: center; }
.cv-cell.sel { box-shadow: inset 0 0 0 2px var(--tint); }
.cv-cell .dots { display: flex; gap: 2px; height: 5px; } .cv-cell .dots i { width: 5px; height: 5px; border-radius: 50%; }
.cv-cell .more { font-size: 10.5px; color: var(--muted); padding-left: 4px; }
.cv-mday { margin-top: 8px; }
.cv-aday { padding: 6px 0; border-top: .5px solid var(--line2); }
.cv-aday:first-child { border-top: 0; }
.cv-ahead { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.cv-aday.today .cv-ahead { color: #ff3b30; }
.cv-arow { display: grid; grid-template-columns: 62px 10px 1fr; align-items: baseline; gap: 4px; padding: 2px 0; font-size: 13.5px; }
.cv-arow .tm { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
@media (max-width: 680px) { .cv-cell { min-height: 64px; } .cv-grid { max-height: 70vh; } .calview.full .cv-title { flex-basis: 100%; margin: 0; } }

/* weather strip */
.wx-strip { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 14px; margin: 0 -2px 4px; scroll-snap-type: x proximity; }
.wx-card { flex: 0 0 min(330px, 86vw); scroll-snap-align: start; border-radius: 20px; padding: 12px 14px; background: var(--card); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi); display: grid; gap: 6px; align-content: start; }
.wx-loading { color: var(--muted); font-size: 14px; }
.wx-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.wx-name { font-weight: 700; font-size: 15px; }
.wx-now { display: flex; align-items: center; gap: 4px; }
.wx-icon { font-size: 28px; line-height: 1; } .wx-temp { font-family: var(--serif); font-size: 40px; line-height: 1; }
.wx-wind { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.wx-windnow { font-size: 15px; padding: 2px 9px; border-radius: 999px; }
.wx-arrow { display: inline-block; font-weight: 700; line-height: 1; }
.wx-arrow.sm { font-size: 10px; color: var(--muted); }
.w1 { background: rgba(52,199,89,.16); } .w2 { background: rgba(10,124,255,.14); } .w3 { background: rgba(255,159,10,.2); } .w4 { background: rgba(255,59,48,.2); }
.wx-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; align-items: end; height: 70px; }
.wx-h { display: flex; flex-direction: column; align-items: center; gap: 1px; height: 100%; justify-content: flex-end; }
.wx-bar { position: relative; width: 100%; max-width: 16px; flex: 1; }
.wx-bar i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 4px 4px 2px 2px; }
.wx-bar i.g { background: var(--fill-strong); }
.wx-bar i.s.w1 { background: #34c759; } .wx-bar i.s.w2 { background: #0a7cff; } .wx-bar i.s.w3 { background: #ff9f0a; } .wx-bar i.s.w4 { background: #ff3b30; }
.wx-hl { font-size: 9.5px; color: var(--faint); height: 11px; }
.wx-add { flex: 0 0 96px; place-items: center; align-content: center; cursor: pointer; font-size: 26px; color: var(--tint); font-family: inherit; }
.wx-add .small { display: block; color: var(--muted); }

/* weather panel (full width) */
.wx-panel { margin-bottom: 16px; padding: 12px 16px 10px; }
.wx-empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.wx-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 6px; scrollbar-width: thin; }
.wx-tab { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 6px 13px; background: var(--fill); color: var(--ink); font: 600 13px var(--sans); cursor: pointer; white-space: nowrap; }
.wx-tab b { font-weight: 700; margin-left: 2px; }
.wx-tab.on { background: var(--tint); color: #fff; }
.wx-tab.add { color: var(--tint); background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 40%, transparent); }
.wx-main { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.wx-hero { display: flex; gap: 14px; align-items: center; }
.wx-hero .wx-now { display: flex; align-items: center; gap: 6px; }
.wx-hero .wx-icon { font-size: 44px; } .wx-hero .wx-temp { font-family: var(--serif); font-size: 64px; line-height: .9; }
.wx-hero .wx-name { font-weight: 700; font-size: 17px; }
.wx-hero .wx-wind { margin: 4px 0 2px; }
.wx-days { display: flex; gap: 8px; flex-wrap: wrap; }
.wx-day { display: grid; gap: 1px; background: var(--fill); border-radius: 14px; padding: 7px 12px; min-width: 128px; font-size: 13.5px; }
.wx-day span:nth-child(2) { font-size: 20px; }
.wx-hours-label { margin: 10px 0 4px; }
.wx-hours { display: flex; overflow-x: auto; gap: 0; padding-bottom: 6px; scrollbar-width: thin; }
.wx-col { flex: 0 0 50px; display: grid; justify-items: center; gap: 2px; padding: 4px 0; border-radius: 12px; font-size: 12px; }
.wx-col.midnight { box-shadow: inset 1px 0 0 var(--line2); border-radius: 0; }
.wx-col.sun { flex-basis: 58px; background: color-mix(in srgb, #ff9f0a 10%, transparent); }
.wx-c-h { font-weight: 600; color: var(--muted); }
.wx-col:first-child .wx-c-h { color: var(--ink); }
.wx-c-i { font-size: 20px; line-height: 1.1; }
.wx-c-r { height: 14px; font-size: 10.5px; color: #0a7cff; font-weight: 600; }
.wx-c-t { position: relative; height: 44px; width: 100%; }
.wx-c-t span { position: absolute; left: 0; right: 0; text-align: center; font-weight: 600; font-size: 13px; }
.wx-c-w { height: 46px; width: 100%; display: flex; justify-content: center; align-items: flex-end; }
.wx-c-w .wx-bar { height: 100%; width: 14px; flex: none; }
.wx-c-ws { font-weight: 700; font-size: 12px; } .wx-c-ws span { font-weight: 400; color: var(--faint); margin-left: 2px; font-size: 10.5px; }
.wx-c-d { font-size: 9.5px; color: var(--faint); }
.wx-c-sun { font-size: 10.5px; color: #c27400; font-weight: 600; }
.wx-arrow.sm { font-size: 12px; }
@media (max-width: 680px) { .wx-hero .wx-temp { font-size: 50px; } .wx-days { width: 100%; flex-wrap: nowrap; overflow-x: auto; } }

/* compact weather graph */
.wx-panel .wx-hero .wx-icon { font-size: 34px; } .wx-panel .wx-hero .wx-temp { font-size: 50px; }
.wx-panel .wx-day { padding: 5px 10px; min-width: 112px; font-size: 12.5px; }
.wx-panel .wx-day span:nth-child(2) { font-size: 16px; }
.wx-dayhead { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 14px; }
.wx-dayhead .btn[disabled] { opacity: .3; pointer-events: none; }
.wx-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin: 0 3px 0 8px; }
.wx-legend i.lt { background: #ff9f0a; } .wx-legend i.lw { background: var(--tint); } .wx-legend i.lg { background: color-mix(in srgb, var(--tint) 35%, transparent); }
.wx-graph { width: 100%; overflow: hidden; }
.wx-graph svg { display: block; }
.wg-grid { stroke: var(--line); stroke-width: .5; }
.wg-h { font: 600 10px var(--sans); fill: var(--muted); text-anchor: middle; }
.wg-i { font-size: 13px; text-anchor: middle; }
.wg-t { fill: none; stroke: #ff9f0a; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.wg-td { fill: #ff9f0a; }
.wg-tv { font: 600 10px var(--sans); fill: var(--ink); text-anchor: middle; }
.wg-ga { fill: color-mix(in srgb, var(--tint) 12%, transparent); }
.wg-g { fill: none; stroke: color-mix(in srgb, var(--tint) 40%, transparent); stroke-width: 1.4; stroke-dasharray: 3 3; }
.wg-w { fill: none; stroke: var(--tint); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.wg-wv { font: 700 10px var(--sans); fill: var(--ink); text-anchor: middle; }
.wg-ar { font: 700 10px var(--sans); fill: var(--muted); text-anchor: middle; }
.wg-r { font: 600 9.5px var(--sans); fill: #0a7cff; text-anchor: middle; }
.wg-ax { font: 600 9.5px var(--sans); fill: var(--faint); }
.wg-sun { stroke: #ff9f0a; stroke-width: 1.2; stroke-dasharray: 2 3; }
.wg-sunt { font: 600 9.5px var(--sans); fill: #c27400; }
.wg-now { stroke: #ff3b30; stroke-width: 1.5; }

.wx-panel .wx-main { gap: 12px; }
.wx-panel .wx-days { display: grid; gap: 3px; flex-wrap: nowrap; }
.wx-panel .wx-day { display: grid; grid-template-columns: 46px 22px 62px auto auto; align-items: center; gap: 6px; min-width: 0; padding: 3px 10px; border: 0; border-radius: 10px; font: 12.5px var(--sans); color: var(--ink); cursor: pointer; text-align: left; background: var(--fill); }
.wx-panel .wx-day span:nth-child(2) { font-size: 14px; }
.wx-panel .wx-day.on { box-shadow: inset 0 0 0 1.5px var(--tint); }
.wx-panel .wx-hero .wx-wind { margin: 2px 0 0; }
.wx-dayhead { margin-top: 4px; }
@media (max-width: 680px) { .wx-panel .wx-days { width: 100%; } .wx-panel .wx-day { grid-template-columns: 44px 20px 58px 1fr auto; } }

/* ===== iOS-style weather pane ===== */
.wx-host { margin-bottom: 16px; }
.wxi { background: var(--sky); border-radius: 26px; padding: 12px 16px 14px; color: #fff; box-shadow: 0 10px 34px rgba(20, 40, 80, .25); overflow: hidden; }
.wxi .wx-empty { color: rgba(255,255,255,.8); }
.wxi-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.wxi-tabs::-webkit-scrollbar { display: none; }
.wxi-tab { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 5px 12px; background: rgba(255,255,255,.16); color: #fff; font: 600 13px var(--sans); cursor: pointer; white-space: nowrap; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.wxi-tab.on { background: rgba(255,255,255,.92); color: #1c1c1e; }
.wxi-tab.add { padding: 5px 11px; }
.wxi-top { display: grid; grid-template-columns: 210px 1fr; gap: 14px; align-items: center; }
.wxi-hero { text-align: center; text-shadow: 0 1px 6px rgba(0,0,0,.15); }
.wxi-hero .city { font-size: 20px; font-weight: 500; }
.wxi-hero .big { font-size: 68px; font-weight: 200; line-height: 1; letter-spacing: -2px; margin-left: 14px; }
.wxi-hero .cond, .wxi-hero .hl { font-size: 15px; font-weight: 600; opacity: .95; }
.wxi-hero .wind { font-size: 12.5px; opacity: .9; margin-top: 2px; }
.wxi-hero .wx-arrow { color: #fff; }
.wxi-strip { display: flex; overflow-x: auto; gap: 0; background: rgba(255,255,255,.14); border-radius: 18px; padding: 8px 6px; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); scrollbar-width: none; }
.wxi-strip::-webkit-scrollbar { display: none; }
.wxi-h { flex: 0 0 46px; display: grid; justify-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; }
.wxi-h .ic { font-size: 20px; line-height: 1.1; } .wxi-h .rp { font-size: 10px; color: #b8e3ff; height: 11px; } .wxi-h b { font-size: 15px; }
.wxi-chartcard { margin-top: 12px; background: rgba(0,0,0,.14); border-radius: 18px; padding: 10px 12px 6px; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.wxi-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.wxi-days { display: flex; gap: 4px; }
.wxi-day { border: 0; background: transparent; color: #fff; border-radius: 12px; padding: 3px 9px; display: grid; justify-items: center; font: 11px var(--sans); cursor: pointer; opacity: .85; }
.wxi-day b { font-size: 15px; } .wxi-day .ic { font-size: 13px; }
.wxi-day.on { background: rgba(255,255,255,.92); color: #1c1c1e; opacity: 1; }
.wxi-seg { display: inline-flex; background: rgba(255,255,255,.16); border-radius: 999px; padding: 2px; }
.wxi-seg button { border: 0; background: transparent; color: #fff; padding: 5px 12px; border-radius: 999px; font: 600 12.5px var(--sans); cursor: pointer; }
.wxi-seg button.on { background: rgba(255,255,255,.92); color: #1c1c1e; }
.wxi-sum { font-size: 13.5px; margin: 8px 2px 2px; min-height: 19px; opacity: .95; }
.wxi-sum .wx-arrow { color: #fff; }
.wxi-chart svg { display: block; touch-action: pan-y; }
.wi-grid { stroke: rgba(255,255,255,.18); stroke-width: 1; stroke-dasharray: 2 4; }
.wi-y { font: 600 10.5px var(--sans); fill: rgba(255,255,255,.75); }
.wi-x { font: 600 10.5px var(--sans); fill: rgba(255,255,255,.75); text-anchor: middle; }
.wi-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.wi-gust { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1.5; stroke-dasharray: 4 4; }
.wi-v { font: 700 11px var(--sans); fill: #fff; text-anchor: middle; }
.wi-arrow { font: 700 11px var(--sans); fill: rgba(255,255,255,.85); text-anchor: middle; }
.wi-sun { stroke: rgba(255,214,10,.7); stroke-width: 1; stroke-dasharray: 2 3; }
.wi-sunt { font: 600 9.5px var(--sans); fill: rgba(255,230,150,.95); text-anchor: middle; }
.wi-now { stroke: rgba(255,255,255,.7); stroke-width: 1.2; }
.wi-scrub { stroke: #fff; stroke-width: 1; }
.wi-dot { fill: #fff; stroke: rgba(0,0,0,.25); stroke-width: 1; }
@media (max-width: 760px) {
  .wxi-top { grid-template-columns: 1fr; gap: 8px; }
  .wxi-hero .big { font-size: 58px; }
  .wxi-row { flex-direction: column; align-items: stretch; }
  .wxi-seg { justify-content: space-between; } .wxi-seg button { flex: 1; }
}

/* animal editor tabs, implant media, actuation */
.ad-tabs { margin: 10px 0 12px; display: inline-flex; background: var(--fill); border-radius: 999px; padding: 2px; flex-wrap: wrap; }
.ad-tabs button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font: 600 13px var(--sans); color: var(--ink); opacity: .75; cursor: pointer; }
.ad-tabs button.on { opacity: 1; background: rgba(255,255,255,.92); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
@media (prefers-color-scheme: dark) { .ad-tabs button.on { background: rgba(120,120,128,.45); } }
.pblock.row-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.pblock .pgroup { padding: 8px 10px; }
.pblock .pg-head { margin-bottom: 6px; font-size: 13px; }
.pblock .thumb { width: 74px; height: 74px; }
.thumb.vid video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.thumb.vid em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; color: #fff; font-size: 22px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.mcase { border-radius: 18px; background: var(--fill); padding: 10px 12px; margin-bottom: 10px; }
.mcase .pgroup { background: var(--card); }
.mcase-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.mcase-mouse svg.mouse.mini { width: 34px; flex-basis: 34px; }
.act-plan { background: var(--fill); border-radius: 16px; padding: 10px 14px 12px; }
.act-toggle { display: flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.act-toggle input { width: 18px; height: 18px; accent-color: var(--tint); }
.act-plan .dim { opacity: .45; }
table.grid.daily input[type=date] { min-width: 130px; } table.grid.daily input[type=number] { min-width: 56px; }
table.grid.daily input[type=checkbox] { width: 18px; height: 18px; min-width: 0; accent-color: var(--tint); }
.wchart { display: block; margin-bottom: 8px; }
.wc-line { fill: none; stroke: var(--tint); stroke-width: 2.2; stroke-linejoin: round; }
.wc-dot { fill: var(--tint); }
.wc-axis { stroke: var(--line2); }
.wc-t { font: 10px var(--sans); fill: var(--muted); }
.wc-act { stroke: #ff9f0a; stroke-width: 1.5; stroke-dasharray: 3 3; }
.wc-at { font: 600 10px var(--sans); fill: #c27400; }
.wc-ad { fill: #ff9f0a; }
.lb-img { max-width: 100%; max-height: 70vh; }

/* ---------- weather: collapsible ---------- */
.wxi-sp { flex: 1 0 8px; }
.wxi-tab.tog { padding: 3px 11px; font-size: 15px; line-height: 1; position: sticky; right: 0; }
.wxi.collapsed { padding-bottom: 10px; }
.wxi.collapsed .wxi-chartcard { display: none; }
.wxi.collapsed .wxi-top { grid-template-columns: auto 1fr; gap: 12px; }
.wxi.collapsed .wxi-hero { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto auto; column-gap: 10px; text-align: left; align-items: center; }
.wxi.collapsed .wxi-hero .city { display: none; }
.wxi.collapsed .wxi-hero .big { grid-row: 1 / span 3; font-size: 46px; margin-left: 0; letter-spacing: -1px; }
.wxi.collapsed .wxi-hero .cond, .wxi.collapsed .wxi-hero .hl { font-size: 13.5px; }
.wxi.collapsed .wxi-hero .wind { font-size: 12px; margin: 0; }
.wxi.collapsed .wxi-strip { padding: 5px 4px; }
.wxi.collapsed .wxi-h { flex-basis: 40px; font-size: 11.5px; gap: 1px; }
.wxi.collapsed .wxi-h .ic { font-size: 16px; } .wxi.collapsed .wxi-h b { font-size: 13px; }
@media (max-width: 680px) { .wxi.collapsed .wxi-top { grid-template-columns: 1fr; } .wxi.collapsed .wxi-hero { justify-content: center; } }

/* ---------- travel ---------- */
.flight-next { background: linear-gradient(150deg, color-mix(in srgb, #ff9500 10%, var(--card)), var(--card)); border: 1px solid color-mix(in srgb, #ff9500 25%, var(--line)); border-radius: 16px; padding: 10px 12px; margin-bottom: 10px; }
.fn-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: 6px 0 4px; }
.fn-route .code { font: 600 30px/1 var(--sans); letter-spacing: .02em; }
.fn-route .plane { font-size: 20px; color: #ff9500; padding: 0 8px; }
.fn-meta { font-size: 13.5px; margin-bottom: 2px; }
.fn-more { margin-top: 6px; } .fn-more summary { cursor: pointer; color: var(--muted); }
.leg { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; padding: 2px 0; }
.leg .lt { font-variant-numeric: tabular-nums; color: var(--muted); }
.leg .lline { flex: 0 0 24px; height: 1px; background: var(--line2); }
.leg .lmeta { flex-basis: 100%; margin-top: -2px; }
.hol .flag { font-size: 16px; }
.fl-list li { flex-wrap: wrap; gap: 8px; }
.fl-form { margin-top: 6px; background: var(--card2); }
.green { color: var(--ok); }

/* ---------- budget ---------- */
.bbar { height: 8px; border-radius: 99px; background: var(--card2); overflow: hidden; border: 1px solid var(--line); margin: 6px 0 3px; }
.bbar span { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 60%, var(--warn))); border-radius: 99px; }
.bbar.big { height: 14px; } .bbar.thin { height: 6px; margin: 4px 0 2px; }
.bmini { display: block; text-decoration: none; color: inherit; padding: 4px 0 8px; }
.bmini + .bmini { border-top: 1px solid var(--line); padding-top: 10px; }
.bstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.bstat .lbl2 { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--faint); }
.bstat .v { font: 600 28px/1.15 var(--sans); font-variant-numeric: tabular-nums; margin-top: 4px; }
.bcat { margin-bottom: 10px; }
.cdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 0; }
.exp-grid { display: grid; grid-template-columns: 150px 1fr 1fr; gap: 0 12px; }
.exp-grid .wide { grid-column: span 2; }
.exp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.exp-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.exp-table td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.exp-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.exp-table tr:hover td { background: var(--card2); }
.nowrap { white-space: nowrap; }
.bmonths { width: 100%; height: auto; }
.bmonths rect { fill: var(--info); opacity: .85; }
.bmonths .mx { font-size: 11px; fill: var(--faint); text-anchor: middle; }
.bmonths .mv { font-size: 10px; fill: var(--muted); text-anchor: middle; }
@media (max-width: 680px) {
  .bstats { grid-template-columns: 1fr; gap: 8px; } .bstat .v { font-size: 22px; }
  .exp-grid { grid-template-columns: 1fr 1fr; } .exp-grid .wide { grid-column: span 2; }
  .fn-route .code { font-size: 24px; }
}
.list > li.hol { flex-wrap: nowrap; align-items: flex-start; }
.list > li.hol > span:nth-child(2) { flex: 1; min-width: 0; }
.list > li.hol > .faint:last-child { white-space: nowrap; }

/* ---------- customisable dashboard layout ---------- */
.dash-top { display: grid; gap: 16px; margin-bottom: 16px; }
.dash-top.empty-zone { margin-bottom: 0; }
.dash-top > .wx-host { margin-bottom: 0; }
.dash-cols { display: grid; gap: 0 8px; align-items: start; }
.dcol { min-width: 0; min-height: 40px; }
.col-resize { align-self: stretch; cursor: col-resize; border-radius: 4px; min-height: 60px; }
.col-resize:hover, body.resizing .col-resize { background: color-mix(in srgb, var(--info) 25%, transparent); }
body.resizing { cursor: col-resize; user-select: none; }
.panel > h2 { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.panel > h2 .right { margin-left: auto; }
.pcoll { border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 0 2px 0 4px; font-size: 15px; line-height: 1; align-self: center; }
.pcoll:hover { color: var(--ink); }
.pcoll span { display: inline-block; transition: transform .2s; }
.panel.collapsed .pcoll span { transform: rotate(180deg); }
.panel.collapsed > :not(h2):not(.pbar) { display: none !important; }
.panel.collapsed > h2 { margin-bottom: 0; }
.panel.collapsed { padding-top: 12px; padding-bottom: 12px; }
.pbar { display: none; }
body.layout-edit .pbar { display: flex; align-items: center; gap: 8px; margin: -6px -6px 10px; padding: 6px 10px; border-radius: 12px; background: color-mix(in srgb, var(--info) 12%, var(--card2)); cursor: grab; touch-action: none; user-select: none; font-size: 13px; font-weight: 600; }
body.layout-edit .wx-host > .pbar { margin: 0 0 6px; }
.pbar .grip { font-size: 16px; color: var(--info); }
.pbar .pb { border: 0; background: transparent; color: var(--muted); cursor: pointer; font: 600 12px var(--sans); }
.pbar .pb:hover { color: var(--accent); }
body.layout-edit .panel { outline: 1.5px dashed color-mix(in srgb, var(--info) 45%, transparent); outline-offset: 3px; }
body.layout-edit .dcol, body.layout-edit .dash-top { min-height: 80px; border-radius: 16px; background: color-mix(in srgb, var(--info) 5%, transparent); }
body.layout-edit .dash-top.empty-zone { margin-bottom: 16px; }
body.layout-edit .dash-top.empty-zone::before { content: 'Full-width area — drop panels here'; display: grid; place-items: center; min-height: 70px; color: var(--faint); font-size: 13px; }
body.layout-edit .col-resize { background: color-mix(in srgb, var(--info) 14%, transparent); }
.panel.dragging { opacity: .9; box-shadow: 0 20px 50px rgba(0,0,0,.25); max-height: 260px; overflow: hidden; }
.panel-ph { border: 2px dashed color-mix(in srgb, var(--info) 60%, transparent); border-radius: var(--radius); background: color-mix(in srgb, var(--info) 8%, transparent); }
.layout-bar { position: sticky; top: 70px; z-index: 40; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border-radius: 18px; background: color-mix(in srgb, var(--card) 85%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--line); box-shadow: var(--shadow); }
.layout-bar .seg { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); border-radius: 99px; padding: 2px 4px; font-size: 13px; }
.layout-bar .seg button { border: 0; background: var(--card2); border-radius: 99px; width: 26px; height: 26px; cursor: pointer; font-size: 15px; }
.layout-bar .seg button:disabled { opacity: .35; cursor: default; }
.layout-bar select.sm { padding: 4px 8px; font-size: 13px; width: auto; }
#layoutEdit.on { background: var(--info); color: #fff; border-color: var(--info); }
@media (max-width: 680px) { .layout-bar { top: 6px; } .col-resize { min-height: 40px; } }

/* ---------- protocol form ---------- */
.pf-host { max-width: 920px; }
.pform .pf-field { margin-top: 4px; }
.pform .pf-lbl { align-items: flex-end; margin-top: 10px; } .pform .pf-lbl .lbl { margin: 0; }
.pform textarea.mdta { resize: vertical; min-height: 44px; }
.pf-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pf-thumbs:empty { display: none; }
.pf-thumbs img { height: 64px; width: auto; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; }
.mat { display: grid; grid-template-columns: 2fr 1.2fr 1.4fr auto; gap: 6px; margin-bottom: 6px; }
.pf-steps { list-style: none; counter-reset: st; padding: 0; margin: 4px 0 8px; display: grid; gap: 8px; }
.pf-step { counter-increment: st; display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: start; }
.pf-step::before { content: counter(st); width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font: 700 13px var(--sans); margin-top: 7px; }
.pf-step textarea { resize: vertical; min-height: 44px; }
.pf-step-tools { display: flex; flex-wrap: wrap; gap: 0; max-width: 120px; }
.pf-step-tools .btn { padding: 3px 6px; }
.pf-actions { position: sticky; bottom: 0; margin: 16px -18px -16px; padding: 12px 18px; background: color-mix(in srgb, var(--card) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.seg-sw { display: inline-flex; border: 1px solid var(--line2); border-radius: 99px; padding: 2px; background: var(--card2); }
.seg-sw button { border: 0; background: transparent; padding: 5px 12px; border-radius: 99px; cursor: pointer; font: 600 13px var(--sans); color: var(--muted); }
.seg-sw button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.proto-table th.sortable { cursor: pointer; user-select: none; }
.proto-table td a { text-decoration: none; }
@media (max-width: 680px) { .mat { grid-template-columns: 1fr 1fr; } .mat input:first-child { grid-column: span 2; } .pf-step { grid-template-columns: 26px 1fr; } .pf-step-tools { grid-column: 2; max-width: none; } }

/* ---------- reading list ---------- */
.paper .pt { font-weight: 600; text-decoration: none; color: var(--ink); line-height: 1.3; display: block; }
.paper .pt:hover { text-decoration: underline; }
.paper.reading .pt::before { content: '📖 '; }
.paper.read .pt { color: var(--muted); text-decoration: line-through; }
.paper .ptools { display: flex; align-self: flex-start; }
.paper .ptools .btn { padding: 2px 5px; color: var(--faint); } .paper .ptools .btn.on { color: var(--warn); }
.read-done { margin-top: 6px; opacity: .8; }
.paper .pt { font: 600 14px/1.3 var(--sans); }

/* ---------- desk statuses — same capsule .btn as the rest of the page ---------- */
.dstat-row { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; }
.dstat { display: flex; flex-wrap: wrap; gap: 6px; }
.dstat .btn.on { background: var(--tint); color: var(--tint-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--tint) 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, .3); }
.dstat .btn.on[data-st=applied] { background: var(--ok); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--ok) 30%, transparent); }
.dstat .btn.on[data-st=cant_apply], .dstat .btn.on[data-st=wont_apply] { background: var(--accent); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
/* desk deadlines */
.dl-item { display: flex; align-items: center; gap: 6px; }
.dl-item .m { flex: 1; }
.dl-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dl-add input, .dl-add select { font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); color: var(--ink); }
.dl-add input[name=title] { flex: 1; min-width: 140px; }
.dsync { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); animation: dsync 1.2s ease-in-out infinite; flex: 0 0 7px; }
@keyframes dsync { 50% { opacity: .25; } }
.desk-decided .dsync { align-self: center; }
.desk-decided { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
.desk-decided summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.desk-decided .list li { gap: 8px; flex-wrap: wrap; }
.heic-loading{opacity:.35;filter:blur(2px);transition:opacity .3s}

/* ---------------------------------------------------------------- Animals: groups, rows, board, timeline */
.agroup { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 22px 2px 10px; }
.agroup:first-child { margin-top: 4px; }
.chip.faint { opacity: .65; }
.aprog { height: 5px; border-radius: 3px; background: var(--fill); overflow: hidden; margin: 2px 0 6px; }
.aprog i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.arows tbody tr { cursor: pointer; }
.arows tbody tr:hover td { background: var(--fill); }
.arows tr.ph-done td { opacity: .6; }
.arows .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.aboard { display: grid; grid-template-columns: repeat(5, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.acol { background: var(--fill); border-radius: 16px; padding: 10px; min-height: 120px; }
.acol h4 { margin: 2px 4px 10px; font-size: 13px; font-weight: 600; }
.acard { display: block; background: var(--card); border-radius: 12px; padding: 9px 11px; margin-bottom: 8px; color: var(--ink); text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.acard:hover { box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.acard > div { margin-bottom: 3px; }
.tl { --lab: 190px; padding: 14px 16px; overflow-x: auto; }
.tl-head, .tl-row { display: grid; grid-template-columns: var(--lab) 1fr; align-items: center; min-width: 720px; }
.tl-head { height: 22px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tl-track { position: relative; height: 100%; min-height: 26px; }
.tl-head .tick { position: absolute; top: 2px; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.tl-body { position: relative; min-width: 720px; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--accent); z-index: 2; pointer-events: none; }
.tl-today span { position: absolute; top: -2px; left: 4px; font-size: 10px; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.tl-study { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 13.5px; color: var(--ink); text-decoration: none; border-left: 4px solid var(--c); padding-left: 8px; }
.tl-study .chip { font-size: 10.5px; }
.tl-row { padding: 2px 0; }
.tl-row .tl-track { min-height: 32px; }
.tl-tag { position: absolute; top: 5px; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; line-height: 16px; }
.tl-tag.od { color: var(--accent); }
.tl .mk.od { background: transparent; border: 2px solid var(--accent); top: 7px; width: 9px; height: 9px; }
.tl-bar.overdue { box-shadow: inset -3px 0 0 var(--accent); }
.tl-lab { font-size: 13px; padding-right: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-bar { position: absolute; top: 5px; height: 14px; border-radius: 7px; }
.tl-bar.live { background: var(--ok); }
.tl-bar.planned { background: transparent; border: 2px dashed var(--info); }
.tl-bar.done { background: var(--line2); }
.tl-bar.live.open { background: linear-gradient(90deg, var(--ok) 70%, color-mix(in srgb, var(--ok) 35%, transparent)); }
.tl .mk { position: absolute; top: 21px; width: 7px; height: 7px; transform: translateX(-50%) rotate(45deg); border-radius: 2px; z-index: 1; }
.tl .mk.po { background: var(--warn); }
.tl .mk.fx { background: var(--accent); }
.tl .mk.ok { opacity: .35; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend .lg { display: inline-block; width: 18px; height: 9px; border-radius: 5px; }
.tl-legend .lg.live { background: var(--ok); } .tl-legend .lg.planned { border: 2px dashed var(--info); } .tl-legend .lg.done { background: var(--line2); }
.tl-legend .mk { position: static; transform: rotate(45deg); }
.tl-legend .mk.od { border: 2px solid var(--accent); background: transparent; }
@media (max-width: 700px) { .tl { --lab: 110px; } .aboard { grid-template-columns: repeat(5, 78vw); } }
