/* Apollo — one stylesheet for the whole app.
 *
 * Light and warm by default, with a colour per area so a screen tells you
 * where you are before you read a word. Built phone first: the bottom bar is
 * the real navigation, the sidebar only appears when there is room for it.
 */

:root {
	color-scheme: light;

	--bg: #f4f6fb;
	--surface: #ffffff;
	--surface-2: #f7f8fc;
	--line: #e3e7f0;
	--line-strong: #cfd6e6;
	--text: #131a2b;
	--muted: #667089;
	--accent: #4f46e5;
	--accent-soft: #eef0ff;
	--accent-ink: #ffffff;

	--good: #0f9d6f;
	--good-soft: #e6f7f0;
	--warn: #b7791f;
	--warn-soft: #fdf4e3;
	--bad: #d1435b;
	--bad-soft: #fdecef;

	--radius: 18px;
	--radius-sm: 12px;
	--shadow: 0 1px 2px rgba(19, 26, 43, .05), 0 8px 24px rgba(19, 26, 43, .06);
	--shadow-lift: 0 2px 6px rgba(19, 26, 43, .08), 0 18px 40px rgba(19, 26, 43, .10);
	--bar-height: 64px;

	/* One colour per area. */
	--tone-flow: #4f46e5;
	--tone-money: #0f9d6f;
	--tone-health: #e0457b;
	--tone-assets: #d97706;
	--tone-official: #2563eb;
	--tone-growth: #7c3aed;
	--tone-people: #0891b2;
	--tone-business: #475569;
}

* { box-sizing: border-box; }

body.apollo {
	margin: 0;
	padding-bottom: calc(var(--bar-height) + env(safe-area-inset-bottom, 0px));
	background: var(--bg);
	color: var(--text);
	font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.icon { width: 22px; height: 22px; flex: 0 0 auto; }

/* ---------- top bar ---------- */

.topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 16px;
	padding-top: calc(10px + env(safe-area-inset-top, 0px));
	background: rgba(255, 255, 255, .86);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--line);
}
.topbar__brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; }
.topbar__brand:hover { text-decoration: none; }
.topbar__mark,
.login__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 10px;
	background: linear-gradient(140deg, #6366f1, #4f46e5 60%, #7c3aed);
	color: #fff;
	font-weight: 700;
	font-size: 16px;
}
.topbar__right { display: flex; align-items: center; gap: 8px; }

/* ---------- layout ---------- */

.layout { display: block; }
.main { padding: 18px 16px 28px; max-width: 1080px; }
.page__title { margin: 0 0 4px; font-size: 26px; font-weight: 700; }
.page__meta { margin: 0 0 18px; color: var(--muted); font-size: 14px; }

/* ---------- cards ---------- */

.card {
	margin-bottom: 14px;
	padding: 18px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 10px; font-size: 17px; font-weight: 650; }
.card p { margin: 0 0 8px; color: var(--muted); }
.card p:last-child { margin-bottom: 0; }
.card--empty { background: var(--surface-2); box-shadow: none; }

/* Dashboard tiles: the first thing you see, one per area. */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile {
	display: block;
	padding: 16px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
	color: var(--text);
}
.tile:hover { text-decoration: none; box-shadow: var(--shadow-lift); transform: translateY(-1px); transition: .15s; }
.tile__head { display: flex; align-items: center; gap: 8px; color: var(--tone, var(--accent)); font-size: 13px; font-weight: 600; }
.tile__head .icon { width: 18px; height: 18px; }
.tile__value { display: block; margin: 10px 0 2px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile__sub { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }
.tile--wide { grid-column: 1 / -1; }
.tile__value.is-good { color: var(--good); }
.tile__value.is-bad { color: var(--bad); }
/* A tile whose numbers open: closed it shows the periods, tapped it adds what
 * went in and out under each, and a link into the module. */
.tile--figures { padding: 0; }
.tile--figures:hover { transform: none; box-shadow: var(--shadow); }
.tile__toggle > summary { display: block; padding: 16px; list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tile__toggle > summary::-webkit-details-marker { display: none; }
.tile__toggle > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }
.tile__chevron { margin-left: auto; color: var(--muted); font-size: 12px; transition: transform .15s; }
.tile__toggle[open] .tile__chevron { transform: rotate(180deg); }
.tile__toggle:not([open]) .tile__stat i { display: none; }

/* A tile's columns — a period each, what is left on top, in and out beneath. */
.tile__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.tile__head + .tile__stats { margin-top: 10px; padding-top: 10px; }
.tile__stat { display: block; min-width: 0; line-height: 1.35; }
.tile__stat b { display: block; margin: 2px 0 3px; color: var(--text); font-size: 19px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile__stat b.is-good { color: var(--good); }
.tile__stat b.is-bad { color: var(--bad); }
.tile__stat i { display: block; font-style: normal; font-size: 11px; }
.tile--money-figures .tile__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile--money-figures .tile__stat b { font-size: clamp(14px, 3.8vw, 19px); }

.tile--money-figures .tile__chevron { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; }

/* The Money tile is a link; its separate native summary only opens details. */
.tile--money-figures { position: relative; }
.tile--money-figures .tile__money-toggle > summary { position: absolute; z-index: 1; top: 6px; right: 8px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.tile--money-figures .tile__money-link { display: block; padding: 16px; color: var(--text); border-radius: inherit; }
.tile--money-figures .tile__money-link:hover { text-decoration: none; }
.tile--money-figures .tile__money-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tile--money-figures .tile__money-link .tile__head { padding-right: 38px; }
.tile--money-figures .tile__money-toggle:not([open]) + .tile__money-link .tile__stat i { display: none; }

/* Initials stay inline with expenses and income in every module. */
.account-initial { display: inline; font-size: 12px; font-weight: 700; white-space: nowrap; }
.account-initial--bilge { color: #7e22ce; }
.account-initial--mehmet { color: #b45309; }
.account-initial--unknown { color: var(--muted); }
#sheet-account .account-identity { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
#sheet-account .account-identity .field { flex: 1; margin: 0; }
#sheet-account .account-identity .field > span { margin-bottom: 4px; }
#sheet-account .account-identity__current { min-width: 20px; text-align: center; }

/* Content cards stay within their column even with long names or amounts. */
.main .card { min-width: 0; padding: 14px 16px; margin-bottom: 12px; }
.main .card h2 { margin-bottom: 8px; }
.main .field { margin-bottom: 10px; }
.main .field > span { margin-bottom: 4px; }
.main .card h2, .main .goal__title { overflow-wrap: anywhere; }
.main .stat { min-width: 0; }
.main .stat b { overflow-wrap: anywhere; }
.main .list__meta { overflow-wrap: anywhere; }
.main .goal__actions form { max-width: 100%; flex-wrap: wrap; }
.main .goal__actions input[type="text"] { max-width: 100%; min-width: 0; }

/* Three numbers side by side: spent, earned, left. */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 12px; }
.stat { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.stat__label { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.stat b { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat b.is-in { color: var(--good); }
.stat b.is-over { color: var(--bad); }

/* A money line opens its own page when tapped: date, what it was, amount —
 * the amount stays on the first line however long the text is, and the cross
 * keeps its own column instead of dropping below. */
.list__row.txn-row { flex-wrap: nowrap; align-items: center; gap: 6px; }
.txn-row__open { display: grid; flex: 1 1 auto; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 2px 8px; min-width: 0; color: var(--text); }
.txn-row__open .list__title { font-size: 15px; overflow-wrap: anywhere; }
.txn-row__open .money-amount { margin-left: 0; white-space: nowrap; }
.txn-row__open:hover { text-decoration: none; }
.txn-row__open:hover .list__title { color: var(--accent); }
.txn-row .row-actions { align-self: center; }
.card__more { margin: 10px 0 0; font-size: 14px; font-weight: 600; }
.entry__back { margin: 0 0 8px; font-size: 14px; }
.entry .grid-form { margin-top: 14px; }
.entry__remove { margin: 16px 0 10px; }
.entry__remove > summary { color: var(--bad); font-size: 14px; font-weight: 600; cursor: pointer; }
.entry__remove form { margin-top: 10px; }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.month-nav__name { margin: 0; font-size: 18px; }
.month-nav__step { min-width: 40px; font-size: 20px; line-height: 1; }
.btn.is-disabled { opacity: .35; pointer-events: none; }
.search .input-inline { width: 100%; min-height: 42px; font-size: 16px; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.entry__section { margin: 22px 0 6px; font-size: 16px; }

/* Calendar: the subscribe box and the month ahead. */
.calendar-setup .btn--primary { margin: 6px 0 4px; }
.steps { margin: 8px 0 12px; padding-left: 20px; color: var(--muted); font-size: 14px; }
.steps li + li { margin-top: 6px; }
.copy-link { display: flex; gap: 8px; }
.copy-link .input-inline { flex: 1 1 auto; width: auto; min-width: 0; font-size: 13px; }
.calendar-day { margin: 18px 0 2px; font-size: 14px; font-weight: 700; }
.calendar-day.is-late { color: var(--bad); }
.calendar-time { flex: 0 0 64px; }

/* A bill: when, what, how much, and the Paid button. */
.list__row.bill-row { flex-wrap: nowrap; }
.bill-row .pill { flex: 0 0 auto; min-width: 86px; text-align: center; }
.bill-row__main { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; color: var(--text); }
.bill-row__main:hover { text-decoration: none; }
.bill-row__main:hover .list__title { color: var(--accent); }
.bill-row .money-amount { margin-left: 0; }
@media (max-width: 520px) {
	.list__row.bill-row { flex-wrap: wrap; }
	.bill-row__main { flex-basis: calc(100% - 100px); }
	.bill-row .money-amount { margin-left: auto; }
}

/* ---------- lists ---------- */

.list { margin: 0; padding: 0; list-style: none; }
.list__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	padding: 11px 0;
	border-top: 1px solid var(--line);
}
.list__row:first-child { border-top: 0; padding-top: 2px; }

/* What just changed: the event on one line, its time on the next. */
.list--activity .list__row { flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 0; }
.list--activity .list__title { flex: 1 1 auto; width: 100%; min-width: 0; font-size: 14px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.list--activity .list__meta { flex: 0 0 auto; font-size: 11px; }
.list__title { flex: 1 1 55%; min-width: 0; font-weight: 500; }
.list__meta { color: var(--muted); font-size: 13px; font-weight: 400; }

.pill {
	flex: 0 0 auto;
	min-width: 72px;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	white-space: nowrap;
}
.pill--alert { background: var(--bad-soft); color: var(--bad); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--calm { background: var(--surface-2); color: var(--muted); }

.row-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; margin-left: auto; }

/* ---------- money figures ---------- */

.money-total__main { margin: 4px 0 2px; font-size: 38px; font-weight: 700; letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.money-total__alt { margin: 0 0 12px; color: var(--muted); }
.money-amount { flex: 0 0 auto; margin-left: auto; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.money-amount.is-in { color: var(--good); }

.meter { flex: 1 1 100%; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter__fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.meter__fill.is-over { background: var(--bad); }
.rates-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }

/* ---------- tabs inside a module ---------- */

.subnav {
	display: flex;
	gap: 4px;
	margin: -4px 0 16px;
	padding: 4px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--surface-2);
	overflow-x: auto;
}
.subnav__item {
	flex: 1 1 0;
	padding: 8px 14px;
	border-radius: 10px;
	color: var(--muted);
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	white-space: nowrap;
}
.subnav__item:hover { text-decoration: none; color: var(--text); }
.subnav__item.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* A section folded behind a quiet heading. */
.fold > summary { color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.fold[open] > summary { margin-bottom: 12px; }

/* ---------- quick money entry ---------- */

.flash {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
	padding: 8px 10px 8px 16px;
	border-radius: var(--radius-sm);
	background: var(--good-soft);
	color: var(--good);
	font-weight: 600;
}
.flash__undo { border-color: transparent; background: var(--surface); color: var(--good); }

/* Segmented choice: real radio buttons, drawn as one pill. */
.seg { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.seg__option { position: relative; flex: 1 1 0; margin: 0; }
.seg__option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg__option span {
	display: block;
	padding: 9px 10px;
	border-radius: 10px;
	color: var(--muted);
	font-size: 15px;
	font-weight: 650;
	text-align: center;
	white-space: nowrap;
}
.seg__option input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg__option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg--direction .seg__option--out input:checked + span { color: var(--bad); }
.seg--direction .seg__option--in input:checked + span { color: var(--good); }
.seg--small { display: inline-flex; margin-top: 10px; }
.seg--small .seg__option span { padding: 5px 12px; font-size: 13px; }

.quick__amount { display: flex; gap: 8px; margin-top: 12px; }
.quick__note { width: 100%; min-height: 42px; margin: 10px 0 2px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; }
.quick__note:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.quick__input {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 58px;
	padding: 8px 14px;
	border: 1px solid var(--line-strong);
	border-radius: 14px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: 30px;
	font-weight: 700;
	letter-spacing: -.02em;
	font-variant-numeric: tabular-nums;
}
.quick__input:focus { outline: 2px solid var(--tone-money); outline-offset: 1px; border-color: var(--tone-money); }
.quick__save { min-width: 84px; min-height: 58px; border-radius: 14px; }
.quick .quick__hint { margin: 16px 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.quick .quick__chips { margin-bottom: 0; }
.quick .fold { margin-top: 16px; }
.chip--tap {
	min-height: 40px;
	padding: 8px 14px;
	border-color: var(--line-strong);
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}
.chip--tap:hover { border-color: var(--tone-money); }
.chip--tap:active { background: var(--good-soft); }
.chip--tap.is-in { color: var(--good); }

/* Only the chips for the chosen direction; without :has() both sets show. */
@supports selector(:has(*)) {
	.quick:not(:has(.seg__option--in input:checked)) .quick__chips--in,
	.quick:has(.seg__option--in input:checked) .quick__chips--out { display: none; }
}

/* ---------- forms ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 40px;
	padding: 9px 16px;
	border: 1px solid var(--line-strong);
	border-radius: 11px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #4338ca; border-color: #4338ca; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn--sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn--block { width: 100%; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }

/* 16px keeps iOS from zooming in; the explicit height and appearance reset
 * stop Safari's native date and time controls from overflowing their box. */
.field input,
.field select,
.field textarea,
.input-inline {
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	max-width: 100%;
	min-height: 46px;
	padding: 11px 13px;
	border: 1px solid var(--line-strong);
	border-radius: 11px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: 16px;
	line-height: 1.2;
}
.field select {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667089' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 38px;
}
.field input:focus,
.field select:focus,
.input-inline:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

input[type="date"],
input[type="time"],
input[type="datetime-local"] { display: block; text-align: left; }
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; min-height: 1.3em; margin: 0; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { margin-left: auto; opacity: .55; }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.check { display: flex; align-items: center; gap: 10px; margin: 2px 0 16px; color: var(--text); font-size: 15px; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }

.grid-form { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.grid-form .btn { justify-self: start; margin-top: 2px; }
.grid-form--tight { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.input-inline { width: 104px; min-height: 34px; padding: 5px 9px; font-size: 14px; }

/* A form tucked behind its own heading, so a screen reads as content first. */
.adder { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.adder > summary {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--accent);
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
	list-style: none;
}
.adder > summary::-webkit-details-marker { display: none; }
.adder > summary::before {
	content: "+";
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 8px;
	background: var(--accent-soft);
	font-size: 17px;
	line-height: 1;
}
.adder[open] > summary { margin-bottom: 12px; }

.alert {
	margin: 0 0 14px;
	padding: 11px 13px;
	border-radius: var(--radius-sm);
	background: var(--bad-soft);
	color: var(--bad);
	font-size: 14px;
}

/* ---------- boards ---------- */

/* One colour per board, worn by its tile and its header. */
.board--indigo { --board: #4f46e5; --board-2: #7c3aed; }
.board--blue { --board: #2563eb; --board-2: #0ea5e9; }
.board--teal { --board: #0d9488; --board-2: #14b8a6; }
.board--green { --board: #16a34a; --board-2: #4ade80; }
.board--orange { --board: #ea580c; --board-2: #f59e0b; }
.board--pink { --board: #db2777; --board-2: #f472b6; }
.board--purple { --board: #7c3aed; --board-2: #a855f7; }
.board--slate { --board: #475569; --board-2: #64748b; }

.board-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.board-tile {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-height: 118px;
	padding: 14px;
	border-radius: var(--radius);
	background: linear-gradient(140deg, var(--board, var(--accent)), var(--board-2, var(--accent)));
	color: #fff;
	box-shadow: var(--shadow);
}
.board-tile:hover { text-decoration: none; box-shadow: var(--shadow-lift); transform: translateY(-1px); transition: .15s; }
.board-tile__name { font-size: 17px; font-weight: 700; }
.board-tile__meta { font-size: 13px; opacity: .85; }
.board-tile__lists { display: flex; align-items: flex-end; gap: 4px; margin-top: auto; height: 26px; }
.board-tile__list { width: 16px; height: calc(6px + var(--cards, 0) * 3px); border-radius: 3px; background: rgba(255, 255, 255, .45); }

.board-tile--new { background: var(--surface); border: 1px dashed var(--line-strong); color: var(--accent); }
.board-tile--new > summary { font-weight: 650; cursor: pointer; list-style: none; }
.board-tile--new > summary::-webkit-details-marker { display: none; }
.board-tile--new[open] { grid-column: 1 / -1; color: var(--text); }
.board-tile--new[open] > summary { margin-bottom: 12px; color: var(--accent); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.swatch { position: relative; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(140deg, var(--board), var(--board-2)); cursor: pointer; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.swatch:has(input:checked) { outline: 2px solid var(--text); outline-offset: 2px; }

/* A board's own header, in the board's colour. */
.board-top {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: -18px -16px 14px;
	padding: 14px 16px;
	background: linear-gradient(120deg, var(--board), var(--board-2));
	color: #fff;
}
.board-top__back { color: #fff; font-size: 20px; line-height: 1; }
.board-top__back:hover { text-decoration: none; }
.board-top { flex-wrap: wrap; }
.board-top__name { flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; font-size: 20px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
/* On a phone the view switch and + Task take the second row, so the ⋯ stays at
 * the end of the first one and its menu opens on screen instead of off the left. */
.board-top__tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.board-top__views { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .18); }
.board-top__views a { padding: 4px 12px; border-radius: 999px; color: #fff; font-size: 13px; font-weight: 600; }
.board-top__views a:hover { text-decoration: none; background: rgba(255, 255, 255, .18); }
.board-top__views a.is-active { background: #fff; color: var(--text); }
.board-top__add { border-color: #fff; background: #fff; color: var(--text); font-weight: 700; }
.board-top__add:hover { text-decoration: none; }
.board-top__menu { margin-left: auto; }
.board-top .menu__panel { right: 0; left: auto; }
@media (max-width: 559px) {
	.board-top__tools { order: 3; flex: 1 1 100%; margin-left: 0; }
	.board-top__menu { order: 2; }
}

/* The quick task box: one line, a row of date chips, dated today unless told otherwise. */
.quick-task { display: none; margin: 0 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.quick-task.is-open,
.quick-task-card .quick-task { display: block; }
.quick-task-card .quick-task { margin: 0; padding: 0; border: 0; box-shadow: none; }
.quick-task__line { display: flex; gap: 8px; }
.quick-task__title { flex: 1 1 auto; min-width: 0; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; }
.quick-task__title:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.quick-task__preview { margin: 8px 2px 0; color: var(--accent); font-size: 13px; font-weight: 600; }
.quick-task__when { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; transition: opacity .15s; }
.quick-task.has-written-date .quick-task__when { opacity: .45; }
.chip--pick { position: relative; margin: 0; cursor: pointer; }
.chip--pick input { position: absolute; opacity: 0; pointer-events: none; }
.chip--pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.chip--pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip--quiet { background: transparent; }
.quick-task__more { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.quick-task__more .field { flex: 1 1 140px; margin: 0; }
.quick-task__date { display: none; }
.quick-task:has(input[value="pick"]:checked) .quick-task__date { display: block; }
.quick-task__added { margin: 10px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.quick-task__added li + li { margin-top: 4px; }

/* A board by date. */
.due-group h2 { display: flex; align-items: center; gap: 8px; }
.due-group--late h2 { color: var(--bad); }
.list__row.due-row { flex-wrap: nowrap; }
.due-row__main { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; color: var(--text); }
.due-row__main:hover { text-decoration: none; }
.due-row__main:hover .list__title { color: var(--accent); }
.due-fields { display: flex; gap: 8px; }
.due-fields .field { flex: 1 1 0; min-width: 0; }

/* A menu behind a ⋯, closed until it is asked for. */
.menu { position: relative; }
.menu > summary { padding: 2px 8px; border-radius: 8px; font-size: 20px; line-height: 1; cursor: pointer; list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__panel {
	position: absolute;
	right: 0;
	z-index: 25;
	width: min(300px, calc(100vw - 32px));
	margin-top: 8px;
	padding: 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--text);
	box-shadow: var(--shadow-lift);
	text-align: left;
}
.menu__section + .menu__section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.menu__title { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.menu__row { display: flex; gap: 8px; margin-top: 10px; }
.menu__danger > summary { color: var(--bad); font-size: 14px; font-weight: 600; cursor: pointer; }
.btn--danger { border-color: var(--bad); color: var(--bad); }
.btn--danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn--done { border-color: var(--good); color: var(--good); }
.label-name { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.label-name .input-inline { flex: 1 1 auto; width: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--muted);
	font-size: 13px;
	font-weight: 500;
}
.chip b { color: var(--text); font-variant-numeric: tabular-nums; }
a.chip:hover { text-decoration: none; border-color: var(--line-strong); }
.chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip.is-active b { color: var(--accent); }
.chips { margin-bottom: 14px; }
.chip--action { padding: 0 6px 0 0; }
.chip--action button {
	padding: 7px 4px 7px 12px;
	border: 0;
	background: none;
	color: var(--text);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.chip__remove { color: var(--muted) !important; padding: 7px 4px !important; font-weight: 400 !important; }

/* The lists themselves: sideways on a phone, one list at a time. */
.lanes {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	margin: 0 -16px 14px;
	padding: 2px 16px 10px;
	-webkit-overflow-scrolling: touch;
}
/* A drag on a board moves cards or scrolls — it never selects text. Fields stay selectable. */
.lanes { user-select: none; -webkit-user-select: none; }
.lanes input,
.lanes textarea { user-select: text; -webkit-user-select: text; }
.lanes.is-panning { cursor: grabbing; }

.lane {
	flex: 0 0 86%;
	max-width: 300px;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	padding: 10px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface-2);
}
.lane__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lane__title { flex: 1 1 auto; margin: 0; color: var(--muted); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.lane--done .lane__title { color: var(--good); }
.lane__done { color: var(--good); }
.lane__count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; }
.lane__cards { display: flex; flex-direction: column; gap: 8px; min-height: 30px; border-radius: var(--radius-sm); }
.lane__add { margin-top: 8px; }
.lane__add > summary,
.lane--new > summary { padding: 6px 4px; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; }
.lane__add > summary::-webkit-details-marker,
.lane--new > summary::-webkit-details-marker { display: none; }
.lane__add > summary:hover,
.lane--new > summary:hover { color: var(--accent); }
.lane__add textarea,
.comment-add textarea,
.modal__notes {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: 16px;
	resize: vertical;
}
.lane__add .btn,
.comment-add .btn,
.modal__notes + .btn { margin-top: 8px; }
.lane--new { flex: 0 0 auto; width: 210px; background: transparent; border-style: dashed; }
.lane--new .input-inline { width: 100%; margin: 10px 0 8px; }

/* A card, and the badges that say what is on it. */
.card-mini {
	display: block;
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--surface);
	box-shadow: 0 1px 2px rgba(19, 26, 43, .06);
	color: var(--text);
	touch-action: pan-y;
	-webkit-touch-callout: none;
	user-select: none;
}
.card-mini:hover { text-decoration: none; border-color: var(--line-strong); }
.card-mini.is-done .card-mini__title { color: var(--muted); text-decoration: line-through; }
.card-mini__labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.card-mini__title { display: block; font-weight: 600; line-height: 1.35; }
.card-mini__badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.card-mini.is-dragging { pointer-events: none; opacity: .96; box-shadow: var(--shadow-lift); }
.card-mini__placeholder { border: 2px dashed var(--line-strong); border-radius: var(--radius-sm); background: rgba(79, 70, 229, .06); }
body.is-dragging-card { cursor: grabbing; user-select: none; }

.badge { padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge--late,
.badge--high { background: var(--bad-soft); color: var(--bad); }
.badge--soon { background: var(--warn-soft); color: var(--warn); }
.badge--done { background: var(--good-soft); color: var(--good); }

.label-strip { display: block; width: 34px; height: 8px; border-radius: 999px; background: var(--label, var(--line-strong)); }
.label--green { --label: #22c55e; }
.label--yellow { --label: #eab308; }
.label--orange { --label: #f97316; }
.label--red { --label: #ef4444; }
.label--purple { --label: #a855f7; }
.label--blue { --label: #3b82f6; }

/* ---------- the open card ---------- */

.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(19, 26, 43, .45); }
.modal__panel {
	position: relative;
	width: 100%;
	max-height: 92vh;
	overflow-y: auto;
	padding: 16px 16px calc(28px + env(safe-area-inset-bottom, 0px));
	border-radius: 22px 22px 0 0;
	background: var(--bg);
}
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal__where { margin: 0; color: var(--muted); font-size: 13px; }
.modal__title-form { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0 14px; }
.modal__title {
	flex: 1 1 auto;
	min-height: 46px;
	padding: 10px 12px;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--text);
	font: inherit;
	font-size: 21px;
	font-weight: 700;
	line-height: 1.3;
	resize: vertical;
}
.modal__title:focus { outline: none; border-color: var(--line-strong); background: var(--surface); }
.modal__section { margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.modal__section h3 { margin: 0 0 10px; color: var(--muted); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
/* A card's settings: one block under another on a phone, two columns when
 * there is room. Each block is a form — done, date, priority, move. */
.modal__grid { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.modal__grid > form { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.modal__grid > form > .btn { align-self: flex-start; }
.modal__grid > form:first-child > .btn { align-self: stretch; text-align: center; }
.modal__grid .field { margin: 0; min-width: 0; }
.modal__grid .seg { margin: 0; }
@media (max-width: 559px) {
	.modal__grid > form + form { padding-top: 14px; border-top: 1px solid var(--line); }
}
@media (min-width: 560px) {
	.modal__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
body.apollo:has(.modal) { overflow: hidden; }

.label-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.label-chip { position: relative; display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.label-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.label-chip:has(input:checked) { background: var(--label); color: #fff; }

.checklist__items { margin: 0 0 10px; padding: 0; list-style: none; }
.checklist__item { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.checklist__item.is-done .check-row__title { color: var(--muted); text-decoration: line-through; }
.checklist__add { display: flex; gap: 8px; }
.checklist__add .input-inline { flex: 1 1 auto; width: auto; }
.progress { display: block; height: 6px; margin-bottom: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress[hidden] { display: none; }
.progress__fill { display: block; height: 100%; border-radius: 999px; background: var(--good); }

.comments { margin: 14px 0 0; padding: 0; list-style: none; }
.comment { padding: 10px 0; border-top: 1px solid var(--line); }
.comment__meta { margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.comment__text { margin: 0 0 6px; color: var(--text); }

.screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- checklists ---------- */

.check-list .list__row { gap: 12px; }
.check-list .is-done .list__title { color: var(--muted); text-decoration: line-through; }

/* A shopping row is one tap target — box and name together — so a thumb on
 * the word "Milk" ticks it off. */
.check-form { display: flex; flex: 1 1 auto; min-width: 0; margin: 0; }
.check-row {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 12px;
	min-width: 0;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--text);
	font: inherit;
	text-align: left;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.check-row__title { flex: 1 1 auto; min-width: 0; font-weight: 500; }
.check-row__title .pill { min-width: 0; margin-left: 4px; }
.check-list .is-done .check-row__title { color: var(--muted); text-decoration: line-through; }

/* A usual item that is already waiting on this week's list. */
.chip--action.is-on { border-color: transparent; background: var(--accent-soft); }
.chip--action.is-on button[disabled] { color: var(--accent); cursor: default; }

.tickbox {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 2px solid var(--line-strong);
	border-radius: 9px;
	background: var(--surface);
	color: var(--accent);
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}
.is-done .tickbox { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 14px 9px 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table th:first-child, .table td:first-child { text-align: left; }
.table thead th { color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.table tbody tr + tr td { border-top: 1px solid var(--line); }

/* ---------- bottom bar and sheets (phone) ---------- */

.tabbar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 30;
	display: flex;
	align-items: stretch;
	height: calc(var(--bar-height) + env(safe-area-inset-bottom, 0px));
	padding-bottom: env(safe-area-inset-bottom, 0px);
	background: rgba(255, 255, 255, .94);
	backdrop-filter: saturate(180%) blur(12px);
	border-top: 1px solid var(--line);
}
.tabbar__item {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	border: 0;
	background: none;
	color: var(--muted);
	font: inherit;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
}
.tabbar__item:hover { text-decoration: none; color: var(--text); }
.tabbar__item.is-active { color: var(--accent); }
.tabbar__item--accent .icon {
	width: 40px;
	height: 40px;
	padding: 9px;
	border-radius: 14px;
	background: var(--accent);
	color: #fff;
	box-shadow: 0 6px 16px rgba(79, 70, 229, .35);
}

.sheet[hidden] { display: none; }
.sheet {
	position: fixed;
	inset: 0;
	z-index: 40;
	display: flex;
	align-items: flex-end;
	background: rgba(19, 26, 43, .38);
}
.sheet__panel {
	width: 100%;
	max-height: 82vh;
	overflow-y: auto;
	padding: 18px 16px calc(24px + env(safe-area-inset-bottom, 0px));
	border-radius: 22px 22px 0 0;
	background: var(--surface);
}
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet__head h2 { margin: 0; font-size: 18px; }
.sheet__group { margin: 16px 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.sheet__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sheet__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 13px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--text);
	font-weight: 600;
	font-size: 15px;
}
.sheet__link:hover { text-decoration: none; border-color: var(--tone, var(--accent)); }
.sheet__link .icon { color: var(--tone, var(--accent)); }
.sheet__link.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ---------- sign in ---------- */

.login { min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login__card { width: 100%; max-width: 390px; padding: 28px 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-lift); }
.login__brand { text-align: center; margin-bottom: 22px; }
.login__brand h1 { margin: 14px 0 4px; font-size: 27px; }
.login__brand p { margin: 0; color: var(--muted); font-size: 15px; }
.login__mark { width: 46px; height: 46px; border-radius: 15px; font-size: 22px; }
body.apollo--login { padding-bottom: 0; }

/* ---------- desktop ---------- */

@media (min-width: 900px) {
	body.apollo { padding-bottom: 0; }
	.tabbar { display: none; }

	/* minmax(0, …): a wide board scrolls inside the column instead of stretching the page. */
	.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
	.nav {
		position: sticky;
		top: 53px;
		height: calc(100svh - 53px);
		overflow-y: auto;
		padding: 18px 14px;
		border-right: 1px solid var(--line);
	}
	.nav__group { margin-bottom: 18px; }
	.nav__title { margin: 0 0 8px 10px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
	.nav__item {
		display: flex;
		align-items: center;
		gap: 10px;
		margin-bottom: 4px;
		padding: 9px 12px;
		border-radius: 11px;
		color: var(--text);
		font-weight: 550;
	}
	.nav__item .icon { width: 19px; height: 19px; color: var(--tone, var(--muted)); }
	.nav__item:hover { text-decoration: none; background: var(--surface-2); }
	.nav__item.is-active { background: var(--accent-soft); color: var(--accent); }
	.nav__item.is-active .icon { color: var(--accent); }

	.main { padding: 30px 32px 64px; }
	.board-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.board-top { margin: -30px -32px 18px; padding: 16px 32px; }

	/* A board on a computer: the full width and the window's height. Lists
	 * scroll inside themselves, the sideways scrollbar sits at the bottom of
	 * the window, and the empty background can be dragged to scroll. The
	 * one-list-at-a-time snap is for phones only. */
	.main:has(.lanes) { max-width: none; padding-bottom: 0; }
	/* The date view keeps the board's full-width header, with its list at a readable width. */
	.main:has(.due-view) { max-width: none; }
	.due-view,
	.main:has(.due-view) .quick-task,
	.main:has(.due-view) .flash { max-width: 860px; }
	.lanes {
		height: calc(100svh - 150px);
		min-height: 360px;
		margin: 0 -32px;
		padding: 2px 32px 14px;
		overflow-y: hidden;
		scroll-snap-type: none;
		cursor: grab;
		scrollbar-width: auto;
		scrollbar-color: var(--line-strong) transparent;
	}
	.lanes::-webkit-scrollbar { height: 12px; }
	.lanes::-webkit-scrollbar-thumb { border: 3px solid var(--bg); border-radius: 999px; background: var(--line-strong); }
	.lanes::-webkit-scrollbar-track { background: transparent; }
	.lane { flex: 0 0 280px; max-height: 100%; cursor: default; }
	.lane__cards { flex: 1 1 auto; overflow-y: auto; margin-right: -4px; padding-right: 4px; }
	.lane--new { cursor: default; }
	.modal { align-items: center; padding: 24px; }
	.modal__panel { max-width: 760px; max-height: 86vh; border-radius: var(--radius); }
	.tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.grid-form .check,
	.grid-form .btn { grid-column: 1 / -1; }
}

@media (max-width: 899px) {
	.nav { display: none; }
}

/* Apollo stays light on purpose: colour carries the meaning here, and a dark
 * app felt heavy for something you open twenty times a day. */
.money-balance { font-size: 18px; margin-left: 4px; }
.money-balance.is-in { color: var(--good); }
.money-balance.is-over { color: var(--bad); }
.money-held { margin-left: 12px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.money-held b { color: var(--text); }

/* ---------- Pop-up ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.flash--error { background: var(--bad-soft); color: var(--bad); }
.list__row.popup-row { flex-wrap: nowrap; align-items: center; gap: 10px; }
.popup-row__main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; color: var(--text); }
.popup-row__main:hover { text-decoration: none; }
.popup-row__figures { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.list__row.popup-line { flex-wrap: nowrap; align-items: flex-start; gap: 8px; }
.popup-line__date { flex: 0 0 44px; padding-top: 2px; color: var(--muted); font-size: 13px; }
.popup-line__main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.popup-line .money-amount { margin-left: 0; white-space: nowrap; }
.popup-receipt { margin-top: 4px; }
.popup-receipt .btn { cursor: pointer; }
.list__row.popup-partner { display: block; }
.popup-partner__edit > summary { display: flex; flex-direction: column; cursor: pointer; list-style: none; }
.popup-partner__edit > summary::-webkit-details-marker { display: none; }
.popup-partner__edit[open] > summary { margin-bottom: 12px; }
.popup-preview table { font-size: 14px; }
.popup-preview { overflow-x: auto; }

/* ---------- Goals ---------- */
.goal { padding: 14px 0; border-top: 1px solid var(--line); }
.goal:first-of-type { border-top: 0; }
.goal__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.goal__title { font-weight: 700; color: var(--text); }
.goal__pct { font-weight: 700; font-size: 18px; color: var(--good); white-space: nowrap; }
.goal__bar { height: 10px; margin: 8px 0 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.goal__bar > span { display: block; height: 100%; border-radius: 99px; background: var(--good); }
.goal--debt .goal__bar > span { background: var(--accent); }
.goal--debt .goal__pct { color: var(--accent); }
.goal__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: flex-end; }
.goal__actions form { display: flex; gap: 6px; align-items: center; }
.goal__actions input[type="text"] { width: 96px; }
.stats--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid-form:not([data-kind="debt"]) .goal-field--debt { display: none; }
.grid-form[data-kind="debt"] .goal-field--target { display: none; }
.goal__more { margin-top: 8px; }
.goal__more > summary { cursor: pointer; }
.goal__more[open] > summary { margin-bottom: 8px; }
