:root {
  --navy: #17232f; --navy2: #243445; --navy3: #34475a;
  --orange: #F6921E; --orange-d: #d97a0a;
  --teal: #0d8a94; --green: #25834a; --amber: #b87300; --red: #b3372b;
  --ink: #1a2530; --muted: #6b7885; --line: #e1e7ee; --bg: #f5f7fa; --card: #ffffff;
  --shadow: 0 1px 2px rgba(20, 35, 50, .05), 0 3px 10px rgba(20, 35, 50, .04);
  --shadow-up: 0 2px 4px rgba(20, 35, 50, .06), 0 10px 22px rgba(20, 35, 50, .08);
  --side-w: 204px;
  --r: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 14.5px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); }
h1 { margin: 0 0 4px; font-size: 22px; font-weight: 650; color: var(--navy2); letter-spacing: -.015em; }
h2 { margin: 24px 0 10px; font-size: 16px; font-weight: 650; color: var(--navy2); }
h3 { margin: 0 0 8px; font-size: 15px; font-weight: 650; color: var(--navy2); }
.sub { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); font-size: 13px; }
.note { color: #4a5764; font-size: 14px; }

/* ---------- layout: sidebar + content ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side-w); flex: 0 0 var(--side-w); background: linear-gradient(180deg, var(--navy) 0%, #101a24 100%); color: #d5deE8; display: flex; flex-direction: column; padding: 16px 10px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; line-height: 1.2; margin: 2px 8px 22px; }
.mark { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; background: conic-gradient(from 210deg, var(--orange), #ffc46b, var(--teal), var(--orange)); box-shadow: inset 0 0 0 6px var(--navy2); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 8px; color: #b9c6d4; text-decoration: none; font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
.side nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side nav a[aria-current="page"] { background: rgba(246, 146, 30, .16); color: #fff; box-shadow: inset 2px 0 0 var(--orange); }
.ico { width: 17px; height: 17px; flex: 0 0 17px; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content > main, .plain > main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 20px 24px 60px; }

/* ---------- header ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; height: 52px; padding: 0 22px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.where { display: flex; align-items: baseline; gap: 10px; min-width: 0; white-space: nowrap; }
.crumb { font-size: 13px; color: var(--muted); }
.crumb strong { color: var(--navy2); font-size: 15px; font-weight: 650; }
.date { font-size: 12.5px; color: var(--muted); }
.head-tools { display: flex; align-items: center; gap: 8px; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.week-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: #eaf6f7; color: #0b6d76; font-size: 13px; border: 1px solid #d3eaec; white-space: nowrap; }
.week-pill .ico { width: 15px; height: 15px; flex-basis: 15px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 2px 4px; cursor: default; }
.avatar { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy3), var(--teal)); color: #fff; font-weight: 600; font-size: 11px; letter-spacing: .02em; }
.avatar.sm { width: 34px; height: 34px; flex-basis: 34px; font-size: 12px; }
.uname { display: flex; flex-direction: column; line-height: 1.15; font-weight: 600; font-size: 13px; color: var(--navy2); }
.uname small { font-weight: 400; color: var(--muted); font-size: 11px; }
.plain .topbar.plainbar { background: var(--navy); border-bottom: 3px solid var(--orange); backdrop-filter: none; }
.plain .brand { margin: 0; }

/* ---------- buttons and inputs ---------- */
button, a.button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; font: inherit; font-size: 13.5px; font-weight: 600; color: #fff; background: var(--navy2); border: 0; border-radius: 8px; cursor: pointer; text-decoration: none; line-height: 1.4; transition: background .15s, transform .1s, box-shadow .15s; }
button:hover, a.button:hover { background: var(--navy); }
button:active, a.button:active { transform: translateY(1px); }
.btn-accent, a.btn-accent { background: linear-gradient(180deg, #ffa83e, var(--orange)); color: #2b1a00; box-shadow: 0 1px 0 rgba(0, 0, 0, .08), 0 2px 8px rgba(246, 146, 30, .28); }
.btn-accent:hover, a.btn-accent:hover { background: linear-gradient(180deg, #ff9d28, var(--orange-d)); }
.btn-ghost { background: transparent; color: #d5deE8; border: 1px solid rgba(255, 255, 255, .25); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.btn-ghost.dark { color: var(--navy2); border: 1px solid var(--line); background: #fff; font-weight: 500; }
.btn-ghost.dark:hover { background: #f0f4f8; border-color: #cbd5df; }
.plain .btn-ghost.dark { color: #fff; border-color: rgba(255, 255, 255, .3); background: transparent; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
button.link { background: none; color: var(--teal); padding: 0; font-weight: 500; text-decoration: none; }
button.link:hover { background: none; text-decoration: underline; }
button.link.danger { color: var(--red); }
.icon-btn { background: transparent; color: var(--muted); font-size: 24px; line-height: 1; padding: 0 9px; }
.icon-btn:hover { background: #eef2f6; color: var(--ink); }
form.inline { display: inline; margin: 0; }
form.inline input, form.inline select { display: inline-block; width: auto; margin: 0; }
label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 10px; color: #3b4b5c; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 7px 10px; font: inherit; font-size: 14px; color: var(--ink); border: 1px solid #c3ccd6; border-radius: 8px; background: #fff; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13, 138, 148, .16); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ---------- cards, stats, charts ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin: 12px 0; box-shadow: var(--shadow); }
.card.accent { border-top: 3px solid var(--orange); }
.card.narrow { max-width: 400px; }
.card h2, .card h3 { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px; }
.filters.card { padding: 12px 14px; }
.filters label { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 4px 0 14px; }
.stat { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 14px 10px 17px; box-shadow: var(--shadow); overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--teal)); }
.stat .num { font-size: 26px; font-weight: 700; color: var(--navy2); font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -.01em; }
.stat .lbl { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.s-week { --c: var(--orange); } .s-month { --c: var(--teal); } .s-n { --c: #7a4fd1; }

.hello h1 { font-size: 24px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px 8px; box-shadow: var(--shadow); margin-bottom: 4px; }
.day { text-align: center; }
.bar-wrap { height: 60px; display: flex; align-items: flex-end; justify-content: center; }
.col { width: 56%; max-width: 38px; height: 0; min-height: 3px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--teal), #5cc0c8); transition: height .8s cubic-bezier(.2, .8, .2, 1); }
.day.today .col { background: linear-gradient(180deg, var(--orange), #ffc46b); }
.dh { font-size: 12px; font-weight: 600; color: var(--navy2); margin-top: 4px; font-variant-numeric: tabular-nums; }
.dl { font-size: 11px; color: var(--muted); }
.day.today .dl { color: var(--orange-d); font-weight: 700; }

.track { height: 8px; border-radius: 999px; background: #e8edf3; overflow: hidden; min-width: 80px; }
.fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--teal), #5cc0c8); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.fill[class*="pc"] { background: var(--c); }
td.share { width: 34%; }

/* ---------- tables, pills, badges ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); font-size: 14px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: #f9fbfd; }
tbody tr:last-child td, tfoot th { border-bottom: 0; }
th { background: #f1f5f8; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: #526273; }
tfoot th { background: #f7f9fb; font-size: 13.5px; text-transform: none; letter-spacing: 0; color: var(--navy2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.desc { white-space: pre-wrap; word-break: break-word; }
td.actions { white-space: nowrap; font-size: 13px; }
td.empty, p.empty { text-align: center; color: var(--muted); padding: 18px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }

.pill { --c: var(--navy3); display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--c); background: #eef2f6; background: color-mix(in srgb, var(--c) 12%, white); border: 1px solid color-mix(in srgb, var(--c) 26%, white); }
.pc0 { --c: #1d6fd8; } .pc1 { --c: #0d8f86; } .pc2 { --c: #7a4fd1; } .pc3 { --c: #c63e7b; }
.pc4 { --c: #2f9a49; } .pc5 { --c: #b87300; } .pc6 { --c: #cf4a3a; } .pc7 { --c: #4f6475; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.badge.unbilled { background: #fff1d6; color: #8a5600; }
.badge.billable { background: #dcf3e3; color: #1d6c3a; }
.badge.closed { background: #e6eaee; color: #55636f; }
.badge.admin { background: #e5ecfa; color: #254a9a; }
.badge.member { background: #eef1f4; color: #55636f; }

/* ---------- admin: people and projects ---------- */
.section-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 26px 0 10px; }
.section-head h2 { margin: 0; }
.section-head .grow { flex: 1; }
.count { color: var(--muted); font-size: 13px; }
.search { width: 210px; margin: 0; padding: 5px 10px; font-size: 13.5px; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; margin: 0 0 14px; border-radius: var(--r); background: #fff8ea; border: 1px solid #f3dfb4; color: #6b4a0d; font-size: 13.5px; }
.callout .ico { margin-top: 2px; color: var(--orange-d); }

/* lists: compact tables that stay readable with hundreds of rows */
table.list { font-size: 13.5px; }
table.list th, table.list td { padding: 7px 12px; vertical-align: middle; }
table.list .rt, table.list th.rt { text-align: right; }
table.list tr.off td { opacity: .55; }
.who2 { display: flex; align-items: center; gap: 10px; }
.who2 strong { color: var(--navy2); }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin: 0 4px 1px 6px; }
tr.off .status-dot { background: #9aa5b1; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--navy3)); margin-right: 9px; }
.acts { white-space: nowrap; }
.acts button.link { font-size: 13px; }
.dotsep { color: #b4bfca; margin: 0 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.chip { background: #fff; color: #44525f; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 13px; font-weight: 500; }
.chip span { color: var(--muted); margin-left: 3px; }
.chip:hover { background: #f0f4f8; }
.chip.on { background: var(--navy2); color: #fff; border-color: var(--navy2); }
.chip.on span { color: #c3cfdb; }
th button.sort { background: none; color: inherit; padding: 0; border-radius: 0; font: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; align-items: center; gap: 4px; }
th button.sort:hover { background: none; color: var(--navy2); }
th[aria-sort] button.sort { color: var(--navy2); }
th[aria-sort="ascending"] button.sort::after { content: "\25B2"; font-size: 8px; }
th[aria-sort="descending"] button.sort::after { content: "\25BC"; font-size: 8px; }

/* dialogs */
dialog.dlg { border: 0; border-radius: 14px; padding: 0; width: min(520px, 94vw); box-shadow: 0 24px 70px rgba(10, 20, 30, .4); color: var(--ink); }
dialog.dlg::backdrop { background: rgba(12, 22, 32, .5); }
dialog.dlg form { padding: 20px 22px 18px; }
dialog.dlg h3 { font-size: 17px; margin-bottom: 12px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #962d22; }
.radios { display: grid; gap: 8px; margin-bottom: 4px; }
label.radio { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 400; transition: border-color .15s, background .15s; }
label.radio:hover { background: #f8fafc; }
label.radio input { width: auto; margin: 3px 0 0; }
label.radio strong { color: var(--navy2); }
label.radio em { display: block; color: var(--muted); font-style: normal; font-size: 13px; }
label.radio:has(input:checked) { border-color: var(--orange); background: #fff8ea; }
.warn { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; margin: 8px 0 0; border-radius: 8px; background: #fff3d9; color: #6b4a0d; font-size: 13px; }
.warn .ico { margin-top: 2px; color: var(--orange-d); }

/* ---------- wide entry sheets: dates stay on one line, the description takes the leftover space ---------- */
.page-entries .content > main, .page-report .content > main { max-width: 1640px; }
#entries-table, #rep-detail { table-layout: fixed; }   /* widths come from each table's <colgroup>; the description column takes what is left */
#entries-table td:first-child, #rep-detail td:first-child { white-space: nowrap; }
#entries-table td.tm, #rep-detail td.tm { white-space: normal; }
col.c-date { width: 116px; } col.c-person { width: 190px; } col.c-project { width: 260px; }
col.c-time { width: 185px; } col.c-hours { width: 70px; } col.c-actions { width: 132px; }

/* ---------- everyone's entries: view-only rows ---------- */
.entries-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 22px 0 8px; }
.entries-head h2 { margin: 0; }
.tabs { display: inline-flex; padding: 3px; gap: 2px; background: #e9eef3; border-radius: 9px; }
.tab { padding: 4px 14px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: #5b6b7b; text-decoration: none; }
.tab:hover { color: var(--navy2); }
.tab.on { background: #fff; color: var(--navy2); box-shadow: 0 1px 2px rgba(20, 35, 50, .15); }
.hint.viewonly { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.hint.viewonly .ico { width: 15px; height: 15px; flex-basis: 15px; color: var(--muted); }
tr.mine td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
tr.theirs td { background: #fbfcfd; }
.locked { display: inline-flex; align-items: center; gap: 6px; color: #9aa6b2; cursor: not-allowed; }
.locked .ico { width: 14px; height: 14px; flex-basis: 14px; }
button.link.dis, button.link.dis:hover { color: #a9b4bf; text-decoration: none; cursor: not-allowed; background: none; }

/* ---------- time zones ---------- */
.hint { margin: -2px 0 12px; color: var(--muted); font-size: 13px; }
.tm { white-space: nowrap; color: #44525f; font-size: 13px; font-variant-numeric: tabular-nums; }
.tzlink { color: var(--teal); font-weight: 600; text-decoration: none; }
.tzlink:hover { text-decoration: underline; }
.tznote { margin: -4px 0 12px; }
.tzask { background: linear-gradient(100deg, #7a4a0b, var(--orange-d)); }
.tz-now { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 12px; margin: 4px 0 14px; border-radius: 8px; background: #eaf6f7; border: 1px solid #d3eaec; color: #0b6d76; font-size: 14px; }
.card h2 .ico { vertical-align: -3px; margin-right: 4px; color: var(--orange-d); }
input[readonly] { background: #f3f6f9; color: #44525f; }
#tz-select { max-width: 460px; }

/* ---------- show / hide password ---------- */
.pwfield { position: relative; display: block; margin-top: 4px; }
.pwfield input { margin-top: 0; padding-right: 44px; }
button.eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 34px; min-height: 0; padding: 0; background: none; color: #6b7885; border-radius: 8px; box-shadow: none; }
button.eye:hover { background: #eef2f6; color: var(--navy2); }
button.eye:active { transform: translateY(-50%); }
button.eye[aria-pressed="true"] { color: var(--teal); }
button.eye svg { width: 19px; height: 19px; }
.typedhint { margin: -6px 0 12px; transition: color .2s; }
.typedhint.flash { color: var(--red); font-weight: 600; }

/* ---------- messages ---------- */
.errors { color: var(--red); background: #fdeeed; border: 1px solid #eebbb6; border-radius: 8px; padding: 8px 14px; list-style-position: inside; font-size: 14px; }
.flash { border-radius: 8px; padding: 8px 14px; font-size: 14px; transition: opacity .5s, transform .5s; }
.flash.ok { color: #1d6c3a; background: #e6f6ec; border: 1px solid #b8e0c6; }
.flash.gone { opacity: 0; transform: translateY(-6px); }
.login-hero { text-align: center; margin: 22px 0 10px; }
.login-hero h1 { font-size: 26px; }
.plain .card.narrow { margin-left: auto; margin-right: auto; }

/* ---------- welcome banner ---------- */
.welcome { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; margin-bottom: 14px; border-radius: var(--r); color: #fff; font-size: 14px; background: linear-gradient(100deg, var(--navy2), var(--teal)); box-shadow: var(--shadow); }
.welcome-actions { display: flex; align-items: center; gap: 12px; }
.welcome button.link { color: #fff; text-decoration: underline; }

/* ---------- help drawer ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(12, 22, 32, .4); z-index: 90; opacity: 0; transition: opacity .25s; }
.backdrop.open { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 92vw); background: #fff; z-index: 100; display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(12, 22, 32, .22); transform: translateX(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); border-left: 3px solid var(--orange); }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: linear-gradient(100deg, var(--navy2), var(--navy3)); color: #fff; }
.drawer-head h2 { margin: 0; font-size: 16px; color: #fff; }
.drawer-head .icon-btn { color: #fff; }
.drawer-head .icon-btn:hover { background: rgba(255, 255, 255, .15); }
.drawer-body { padding: 16px 20px 26px; overflow: auto; font-size: 14.5px; }
.drawer-body .lead { font-size: 15.5px; color: var(--navy2); margin-top: 0; }
.drawer-body h3 { margin-top: 18px; }
.steps, .tips { padding-left: 20px; }
.steps li, .tips li { margin: 0 0 6px; }
.steps li::marker { color: var(--orange-d); font-weight: 700; }
.more { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- guided tour ---------- */
#tour-layer { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
#tour-layer[hidden] { display: none; }
.spot { position: absolute; border-radius: 10px; border: 2px solid var(--orange); box-shadow: 0 0 0 9999px rgba(12, 22, 32, .6); transition: top .35s, left .35s, width .35s, height .35s; pointer-events: none; }
.tour-card { position: absolute; width: min(340px, 92vw); background: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: 0 14px 44px rgba(0, 0, 0, .35); pointer-events: auto; border-top: 4px solid var(--orange); }
.tour-card h3 { margin: 2px 0 4px; }
.tour-card p { margin: 0 0 12px; color: #3a4856; font-size: 14px; }
.tour-count { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--orange-d); }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-actions .grow { flex: 1; }

/* ---------- help page ---------- */
.helpbar { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; }
.helpbar input { max-width: 480px; margin: 0; padding: 9px 12px; font-size: 14.5px; }
.topics { display: grid; gap: 8px; }
.topic { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); transition: border-color .15s; }
.topic[open] { border-color: var(--orange); }
.topic summary { cursor: pointer; padding: 11px 16px; font-weight: 600; font-size: 14.5px; color: var(--navy2); list-style: none; display: flex; align-items: center; gap: 10px; }
.topic summary::before { content: "+"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff1d6; color: var(--orange-d); font-weight: 700; flex: 0 0 22px; }
.topic[open] summary::before { content: "\2212"; }
.topic summary::-webkit-details-marker { display: none; }
.topic-body { padding: 0 18px 10px 48px; color: #3a4856; }
.glossary { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); }
.glossary dt { font-weight: 650; color: var(--navy2); }
.glossary dd { margin: 0; color: #3a4856; }

/* ---------- tablets and small laptops (these rules come first so the phone rules below can override them) ---------- */
@media (max-width: 860px) {
  .shell { display: block; }
  .side { position: static; width: auto; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 8px 10px; border-bottom: 3px solid var(--orange); }
  .brand { margin: 0 12px 0 0; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .topbar { position: static; height: auto; padding: 10px 14px; flex-wrap: wrap; }
  .where { flex-wrap: wrap; }
  .head-tools { flex-wrap: wrap; }
  .content > main, .plain > main { padding: 16px 14px 50px; }
  .uname small { display: none; }
  .person { flex-wrap: wrap; }
}

/* ---------- phones: bottom tab bar, compact header, finger-sized controls ---------- */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .shell { display: block; }
  .side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; height: auto; z-index: 60; flex-direction: row; align-items: center; flex-wrap: nowrap; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-bottom: 0; border-top: 3px solid var(--orange); }
  .side .brand { display: none; }
  .side nav { flex: 1; flex-direction: row; flex-wrap: nowrap; justify-content: space-around; gap: 0; }
  .side nav a { flex-direction: column; gap: 2px; padding: 5px 4px; font-size: 11px; min-width: 56px; text-align: center; }
  .side nav a:hover { transform: none; }
  .side nav a[aria-current="page"] { box-shadow: none; background: rgba(246, 146, 30, .22); }
  .topbar { position: sticky; top: 0; flex-wrap: nowrap; height: auto; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); gap: 6px 8px; }
  .where { flex-wrap: nowrap; }
  .date, .sep, .week-pill, .user-chip { display: none; }
  .head-tools { flex-wrap: nowrap; gap: 6px; margin-left: auto; }
  .lbl, .uname { display: none; }
  .btn-ghost.dark.btn-sm { padding: 6px 9px; }
  .content > main, .plain > main { padding: 14px 12px 28px; }
  h1 { font-size: 20px; }
  .hello h1 { font-size: 21px; }
  #entries-table, #rep-detail { min-width: 880px; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 9px 10px 8px 13px; }
  .stat .num { font-size: 21px; }
  .stat .lbl { display: block; font-size: 11px; }
  .week { padding: 10px 8px 6px; gap: 4px; }
  .drawer { width: 100vw; }
  dialog.dlg { width: 96vw; }
}
@media (pointer: coarse) {
  button, a.button { min-height: 40px; }
  input, select, textarea { font-size: 16px; min-height: 42px; }   /* 16px stops iPhones from zooming into fields */
  .side nav a { min-height: 48px; justify-content: center; }
  .acts button.link, td.actions a, td.actions button.link { padding: 6px 4px; }
}

@media print { .side, .topbar, form.card, .drawer, .backdrop, .filters, .welcome { display: none !important; } body { background: #fff; } .content > main { padding: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
