/* Guardian Time — brand tokens from Guardian Brand Guide 2022 v3 */
@font-face { font-family: 'Larken'; src: url('/fonts/larken-regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Larken'; src: url('/fonts/larken-italic.otf') format('opentype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Larken'; src: url('/fonts/larken-bold.otf') format('opentype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Sailec'; src: url('/fonts/sailec-regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Sailec'; src: url('/fonts/sailec-medium.otf') format('opentype'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Sailec'; src: url('/fonts/sailec-bold.otf') format('opentype'); font-weight: 700; font-display: swap; }

:root {
  --blue: #005DF8; --blue-80: #477AF1; --blue-60: #729CF3; --blue-40: #A0BDF7; --blue-20: #CFDDFB; --blue-8: #ECF2FD; --blue-shade: #2B46B8;
  --navy: #1B224B; --navy-shade: #0F0C2E;
  --white: #fff; --gray: #F2F1F4; --gray-shade: #D7D3DD;
  --ink: #1B224B; --ink-2: #4A506F; --ink-3: #7A7F99;
  --salmon: #FF784D; --clover: #3BAB11; --denim: #114BAB; --plum: #AB2273; --gold: #FFC40D; --aqua: #14C5AF;
  --danger: #C8321E;
  --font-head: 'Larken', 'Fraunces', Georgia, serif;
  --font-body: 'Sailec', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(27,34,75,.06), 0 4px 16px rgba(27,34,75,.05);
  --sidebar-w: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font-body); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--gray); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--ink-3); }

/* ---------- layout ---------- */
.app { min-height: 100vh; }
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 30px; height: 30px; }
.brand .wordmark { font-family: var(--font-body); font-weight: 700; font-size: 17px; letter-spacing: .01em; }
.brand .wordmark span { font-weight: 400; color: var(--blue-40); }
.nav-group { margin-top: 14px; }
.nav-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-40); padding: 0 10px 6px; font-weight: 500; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: #fff; font-weight: 500; font-size: 14px; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.active { background: var(--blue); }
.nav a svg { width: 17px; height: 17px; opacity: .9; }
.sidebar .spacer { flex: 1; }
.timer-card { margin: 10px 0 0; border-radius: var(--radius); background: var(--navy-shade); padding: 12px; font-size: 13px; }
.timer-card .tc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.timer-card .tc-time { font-family: var(--font-head); font-size: 26px; font-weight: 700; letter-spacing: .01em; }
.timer-card .tc-what { color: var(--blue-40); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-card .tc-stop { background: var(--blue); color: #fff; border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 500; cursor: pointer; }
.timer-card .tc-stop:hover { background: var(--blue-80); }
.timer-card.idle { color: var(--blue-40); }
.timer-card.idle .tc-time { color: #fff; opacity: .5; font-size: 20px; }
.me { display: flex; align-items: center; gap: 10px; padding: 14px 8px 0; margin-top: 8px; border-top: 1px solid rgba(255,255,255,.1); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.me .me-name { font-weight: 500; font-size: 13px; }
.me .me-role { font-size: 11.5px; color: var(--blue-40); text-transform: capitalize; }
.me button { margin-left: auto; background: none; border: 0; color: var(--blue-40); cursor: pointer; font-size: 12px; }
.me button:hover { color: #fff; }

.main { padding: 28px 36px 60px; min-width: 0; }
.page { max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-family: var(--font-head); font-size: 32px; font-weight: 700; line-height: 1.1; color: var(--navy); position: relative; display: inline-block; }
.page-title .brush { position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; background: var(--blue); -webkit-mask: url('/img/brush-stroke.svg') no-repeat left center / 100% 100%; mask: url('/img/brush-stroke.svg') no-repeat left center / 100% 100%; opacity: .95; pointer-events: none; }
.page-sub { color: var(--ink-3); margin-top: 14px; font-size: 13px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- components ---------- */
.card { background: var(--white); border: 1px solid var(--gray-shade); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--gray-shade); font-weight: 500; }
.card-body { padding: 18px; }
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--gray-shade); background: #fff; color: var(--ink); border-radius: 999px; padding: 8px 15px; font-weight: 500; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--blue-8); border-color: var(--blue-40); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-80); border-color: var(--blue-80); }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.navy:hover { background: var(--navy-shade); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--blue-8); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: #FBEAE7; border-color: #F3C3BB; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }
.btn.icon { padding: 7px; border-radius: 50%; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn svg { width: 15px; height: 15px; }
.btn-group { display: inline-flex; border: 1px solid var(--gray-shade); border-radius: 999px; overflow: hidden; background: #fff; }
.btn-group button { border: 0; background: transparent; padding: 7px 14px; font-weight: 500; cursor: pointer; color: var(--ink-2); }
.btn-group button.active { background: var(--blue-8); color: var(--blue); }
.btn-group button + button { border-left: 1px solid var(--gray-shade); }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--gray-shade); background: #fff; border-radius: var(--radius-sm); padding: 8px 11px; outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue-60); box-shadow: 0 0 0 3px var(--blue-20); }
textarea { min-height: 72px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234A506F' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.field { display: block; margin-bottom: 14px; }
.field > .label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.field.inline { display: flex; align-items: center; gap: 8px; }
.field.inline input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); margin: 0; }
.row { display: flex; gap: 14px; }
.row > * { flex: 1; min-width: 0; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.form-actions .left { margin-right: auto; }
.error { color: var(--danger); font-size: 13px; margin: 4px 0 10px; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--gray-shade); }
.table td { padding: 11px 12px; border-bottom: 1px solid #EBE9EF; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FAFAFC; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }
.table .muted { color: var(--ink-3); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn { opacity: 0; }
.table tr:hover .actions .btn, .table tr:focus-within .actions .btn { opacity: 1; }
.table.compact td { padding: 7px 12px; }
.table-wrap { overflow-x: auto; }
.group-head td { background: var(--gray); font-weight: 500; color: var(--ink-2); font-size: 12.5px; padding: 8px 12px; }
.group-head td:hover { background: var(--gray); }

.badge { display: inline-block; font-size: 11px; font-weight: 500; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; background: var(--gray); color: var(--ink-2); border: 1px solid var(--gray-shade); white-space: nowrap; }
.badge.blue { background: var(--blue-8); color: var(--blue); border-color: var(--blue-20); }
.badge.navy { background: var(--navy); color: #fff; border-color: var(--navy); }
.badge.off { color: var(--ink-3); border-style: dashed; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.strong { font-weight: 500; }
.num { font-variant-numeric: tabular-nums; }
.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); }
.empty .quote { font-family: var(--font-head); font-size: 18px; color: var(--ink-2); font-style: italic; margin-bottom: 4px; }
.bar { height: 6px; border-radius: 999px; background: var(--blue-8); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.bar > i.over { background: var(--salmon); }
.bar.thin { height: 4px; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.tile { background: #fff; border: 1px solid var(--gray-shade); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.tile .t-label { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.tile .t-value { font-family: var(--font-head); font-size: 30px; font-weight: 700; line-height: 1.1; margin-top: 4px; color: var(--navy); }
.tile .t-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.tile.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.tile.navy .t-label, .tile.navy .t-sub { color: var(--blue-40); }
.tile.navy .t-value { color: #fff; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--gray-shade); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 500; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--navy); border-bottom-color: var(--blue); }
.tabs button:hover { color: var(--navy); }

/* date nav */
.date-nav { display: inline-flex; align-items: center; border: 1px solid var(--gray-shade); border-radius: 999px; background: #fff; overflow: hidden; }
.date-nav button { border: 0; background: none; padding: 7px 12px; cursor: pointer; color: var(--ink-2); }
.date-nav button:hover { background: var(--blue-8); color: var(--blue); }
.date-nav .label { padding: 7px 8px; font-weight: 500; border-left: 1px solid var(--gray-shade); border-right: 1px solid var(--gray-shade); white-space: nowrap; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.toolbar select, .toolbar input { width: auto; min-width: 160px; }

/* timesheet day */
.day-strip { display: grid; grid-template-columns: repeat(7, 1fr) 1.2fr; border-bottom: 1px solid var(--gray-shade); }
.day-strip button { border: 0; background: none; padding: 12px 6px; text-align: left; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--ink-3); }
.day-strip button .d { font-weight: 500; font-size: 13px; color: var(--ink-2); }
.day-strip button .h { font-size: 13px; font-variant-numeric: tabular-nums; }
.day-strip button.active { border-bottom-color: var(--blue); }
.day-strip button.active .d, .day-strip button.active .h { color: var(--navy); font-weight: 700; }
.day-strip button.today .d::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); margin-left: 6px; vertical-align: middle; }
.day-strip .total { padding: 12px 10px; text-align: right; }
.day-strip .total .d { font-size: 12px; color: var(--ink-3); }
.day-strip .total .h { font-weight: 700; font-variant-numeric: tabular-nums; }
.entry { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid #EBE9EF; }
.entry:last-child { border-bottom: 0; }
.entry.running { background: var(--blue-8); }
.entry .e-proj { font-weight: 500; }
.entry .e-client { color: var(--ink-3); font-size: 12.5px; }
.entry .e-task { color: var(--ink-2); font-size: 13px; }
.entry .e-notes { color: var(--ink-3); font-size: 13px; margin-top: 2px; white-space: pre-wrap; }
.entry .e-hours { font-family: var(--font-head); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 84px; text-align: right; color: var(--navy); }
.entry .e-hours input { width: 84px; text-align: right; font-family: var(--font-head); font-size: 20px; font-weight: 700; padding: 4px 8px; }
.entry .e-actions { display: flex; gap: 6px; }
.play { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--gray-shade); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--blue); }
.play:hover { background: var(--blue-8); border-color: var(--blue-40); }
.play.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.play svg { width: 14px; height: 14px; }

/* week grid */
.week { width: 100%; border-collapse: collapse; }
.week th { font-size: 11.5px; color: var(--ink-3); font-weight: 500; padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--gray-shade); }
.week th .dn { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.week th.today { color: var(--blue); }
.week th.today .dn { color: var(--blue); }
.week th:first-child { text-align: left; padding-left: 16px; }
.week td { padding: 6px 6px; border-bottom: 1px solid #EBE9EF; text-align: center; }
.week td:first-child { text-align: left; padding-left: 16px; }
.week td.today { background: var(--blue-8); }
.week td input { width: 64px; text-align: center; padding: 6px 4px; font-variant-numeric: tabular-nums; border-radius: 6px; }
.week td input.multi { background: var(--gray); color: var(--ink-3); }
.week td input.running { border-color: var(--blue); color: var(--blue); font-weight: 700; }
.week td.rt { font-weight: 700; font-variant-numeric: tabular-nums; }
.week tfoot td { border-bottom: 0; font-weight: 700; font-variant-numeric: tabular-nums; background: #FAFAFC; }
.week .w-proj { font-weight: 500; }
.week .w-client { font-size: 12px; color: var(--ink-3); }
.week .w-task { font-size: 12.5px; color: var(--ink-2); }
.week .w-del { opacity: 0; }
.week tr:hover .w-del { opacity: 1; }
.week-foot { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--gray-shade); }

/* expenses */
.exp-week { margin-bottom: 18px; }
.exp-week .card-head .total { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.exp { display: grid; grid-template-columns: 96px 1fr auto auto; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid #EBE9EF; }
.exp:last-child { border-bottom: 0; }
.exp .x-date { color: var(--ink-2); font-size: 13px; }
.exp .x-proj { font-weight: 500; }
.exp .x-cat { font-size: 13px; color: var(--ink-2); }
.exp .x-notes { font-size: 13px; color: var(--ink-3); }
.exp .x-amt { font-family: var(--font-head); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); }
.exp .x-actions { display: flex; gap: 6px; }
.receipt-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--gray-shade); }

/* project detail */
.proj-head .client { font-size: 13px; color: var(--ink-3); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.check-list { max-height: 260px; overflow: auto; border: 1px solid var(--gray-shade); border-radius: var(--radius-sm); padding: 6px 10px; }
.check-list label { display: flex; align-items: center; gap: 8px; padding: 5px 2px; font-size: 13px; }
.check-list label input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--blue); margin: 0; }
.check-list label .bill { margin-left: auto; font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }

/* picker */
.picker { position: relative; }
.picker .pk-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--gray-shade); border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(27,34,75,.15); max-height: 280px; overflow: auto; }
.picker .pk-item { padding: 8px 12px; cursor: pointer; }
.picker .pk-item .c { font-size: 12px; color: var(--ink-3); }
.picker .pk-item:hover, .picker .pk-item.hi { background: var(--blue-8); }
.picker .pk-empty { padding: 10px 12px; color: var(--ink-3); }

/* charts */
.donut { display: flex; align-items: center; gap: 18px; }
.donut svg { width: 96px; height: 96px; flex: none; }
.legend { font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hbar { display: flex; align-items: center; gap: 10px; }
.hbar .bar { flex: 1; }

/* modal + toast */
.modal-back { position: fixed; inset: 0; background: rgba(15,12,46,.45); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: 560px; max-width: 100%; max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 30px 80px rgba(15,12,46,.35); }
.modal.wide { width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 12px; }
.modal-head h3 { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--navy); }
.modal-body { padding: 4px 22px 22px; }
.modal .close { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-3); }
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13.5px; animation: toast-in .18s ease-out; }
.toast.err { background: var(--danger); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login .side { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login .side::before { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: var(--navy-shade); right: -180px; bottom: -220px; }
.login .side::after { content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%; border: 2px solid var(--blue-shade); opacity: .6; left: -80px; top: 120px; }
.login .side > * { position: relative; }
.login .side h1 { font-family: var(--font-head); font-size: 44px; font-weight: 700; line-height: 1.1; max-width: 440px; }
.login .side h1 em { font-style: normal; position: relative; display: inline-block; }
.login .side h1 em::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 10px; background: var(--blue); -webkit-mask: url('/img/brush-stroke.svg') no-repeat left center / 100% 100%; mask: url('/img/brush-stroke.svg') no-repeat left center / 100% 100%; }
.login .side p { color: var(--blue-40); max-width: 400px; font-size: 15px; }
.login .form { display: grid; place-items: center; padding: 40px; }
.login .form .box { width: 380px; max-width: 100%; }
.login .form h2 { font-family: var(--font-head); font-size: 28px; color: var(--navy); margin-bottom: 18px; }
@media (max-width: 800px) { .login { grid-template-columns: 1fr; } .login .side { min-height: 240px; padding: 32px; } }

pre.log { background: var(--navy); color: var(--blue-20); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 12px 14px; border-radius: var(--radius-sm); max-height: 260px; overflow: auto; margin: 12px 0 0; white-space: pre-wrap; }

/* ---------- receipt picker + sheets ---------- */
.receipt-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.receipt-thumb { margin-top: 10px; width: 120px; height: 120px; }
.sheet-list a { display: flex; align-items: center; gap: 12px; padding: 14px 6px; border-bottom: 1px solid #EBE9EF; color: var(--ink); font-weight: 500; font-size: 15px; }
.sheet-list a:last-child { border-bottom: 0; }
.sheet-list a:hover { text-decoration: none; color: var(--blue); }
.bottom-nav { display: none; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 40; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); overflow: visible; box-shadow: 0 2px 10px rgba(15,12,46,.25); }
  .sidebar .nav, .sidebar .spacer, .sidebar .me { display: none; }
  .brand { padding: 0; gap: 8px; }
  .brand img { width: 28px; height: 28px; }
  .brand .wordmark { font-size: 15px; white-space: nowrap; }
  .sidebar > .btn.primary { order: 3; margin-left: auto; padding: 8px 12px; font-size: 13px; }
  .sidebar > .btn.primary span + * { display: none; }
  .timer-card { order: 2; margin: 0; padding: 6px 10px; flex: 0 1 auto; min-width: 0; }
  .timer-card .tc-top { gap: 8px; }
  .timer-card .tc-time { font-size: 18px; }
  .timer-card.idle .tc-time { font-size: 15px; }
  .timer-card.idle .small { display: none; }
  .timer-card .tc-what { display: none; }
  .timer-card .tc-stop { padding: 4px 10px; font-size: 12px; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--navy); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 10px rgba(15,12,46,.25); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--blue-40); font-size: 10.5px; font-weight: 500; border-radius: 10px; }
  .bottom-nav a.active { color: #fff; }
  .bottom-nav a.active span { color: #fff; }
  .bottom-nav a:hover { text-decoration: none; }
  .main { padding: 16px 14px calc(84px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 14px; }
  .page-title { font-size: 26px; }
  .head-actions { width: 100%; }
  .head-actions > select { flex: 1; min-width: 0; }
  .toolbar { gap: 8px; }
  .toolbar select, .toolbar input { min-width: 0; flex: 1; }
  .toolbar .strong.num { width: 100%; text-align: right; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile { padding: 12px 14px; }
  .tile .t-value { font-size: 24px; }
  .tile[style*="span 2"] { grid-column: span 2 !important; }
  .day-strip { grid-template-columns: repeat(7, 1fr); }
  .day-strip button { padding: 10px 4px; text-align: center; }
  .day-strip .total { display: none; }
  .entry { grid-template-columns: 1fr auto; gap: 10px 12px; padding: 12px 14px; }
  .entry .e-hours { font-size: 20px; min-width: 60px; }
  .entry .e-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .table .actions .btn { opacity: 1; }
  .week .w-del { opacity: 1; }
  .week td input { width: 52px; }
  .exp { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 14px; }
  .exp .x-date { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); }
  .exp .x-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .modal-back { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: calc(100vh - 24px); border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal.wide { width: 100%; }
  .modal-head { padding: 16px 18px 8px; }
  .modal-body { padding: 4px 18px 18px; }
  .row { flex-direction: column; gap: 0; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1; justify-content: center; }
  .card-head { flex-wrap: wrap; }
  .tabs { overflow-x: auto; }
  .tabs button { padding: 10px 10px; white-space: nowrap; }
  input, select, textarea { font-size: 16px; } /* stops iOS zooming into fields */
  .week-foot { flex-wrap: wrap; }
  .login .side { min-height: 0; padding: 28px 24px; }
  .login .side h1 { font-size: 30px; }
  .login .side p.small { display: none; }
  .login .form { padding: 24px 20px; }
}
@media print {
  .sidebar, .head-actions, .toolbar, .table .actions { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  body { background: #fff; }
}
