/*
 * Prestige Yard — application styles.
 *
 * Mobile-first. Breakpoints: 640px (large phone / small tablet), 960px (desktop shell with sidebar).
 * No external fonts or frameworks. Colours are defined once as tokens below.
 */

/* ---------- Tokens ---------- */
:root {
	--bg: #f6f3ec;
	--surface: #fffdf9;
	--surface-2: #f1ede3;
	--line: #e5dfd2;
	--line-strong: #d6cebd;
	--ink: #1f2a26;
	--ink-soft: #4d5a54;
	--muted: #7d877f;
	--brand: #1d3a2f;
	--brand-2: #2a4f41;
	--brand-tint: #e6eee9;
	--accent: #a8864f;
	--accent-tint: #f3ecdf;
	--owes: #9b3d2c;
	--owes-tint: #f7e9e4;
	--credit: #2c6a4c;
	--credit-tint: #e3f0e8;
	--warn: #94600f;
	--warn-tint: #f7eedb;
	--bad: #9b2c2c;
	--bad-tint: #f7e4e4;

	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	--radius: 16px;
	--radius-sm: 10px;
	--shadow: 0 1px 2px rgba(31, 42, 38, .04), 0 2px 8px rgba(31, 42, 38, .04);
	--tap: 48px;
	--gutter: 16px;
	--tabbar-h: 64px;
	--safe-b: env(safe-area-inset-bottom, 0px);
	--safe-t: env(safe-area-inset-top, 0px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.yard {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; }
p { margin: 0 0 .75em; }
img, svg { display: block; }
.icon { width: 22px; height: 22px; flex: none; }
button { font: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; }
.main { min-width: 0; }
.sidebar { display: none; }

.topbar {
	position: sticky; top: 0; z-index: 20;
	display: grid; grid-template-columns: 72px 1fr 72px; align-items: center;
	min-height: 56px; padding: var(--safe-t) 8px 0;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
	border-bottom: 1px solid transparent;
}
.topbar__title { text-align: center; min-width: 0; }
.topbar__title h1 { font-family: var(--serif); font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__subtitle { margin: 0; font-size: 13px; color: var(--muted); }
.topbar__back, .topbar__settings {
	display: inline-flex; align-items: center; gap: 2px; min-height: var(--tap); padding: 0 8px;
	color: var(--brand); text-decoration: none; font-weight: 500; font-size: 15px;
}
.topbar__settings { justify-self: end; flex-direction: column; gap: 0; font-size: 11px; justify-content: center; }
.topbar__settings .icon { width: 20px; height: 20px; }
.topbar__brand { display: inline-flex; padding: 8px; text-decoration: none; }
.topbar__trail { justify-self: end; }

.brand__mark {
	display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
	background: var(--brand); color: #f6f3ec; font-family: var(--serif); font-size: 20px; font-weight: 600;
	box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), inset 0 -2px 0 rgba(0,0,0,.15);
}
.brand__name { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; }
.brand__app { font-family: var(--serif); color: var(--accent); font-style: italic; }

.content {
	padding: 12px var(--gutter) calc(var(--tabbar-h) + var(--safe-b) + 28px);
	max-width: 1180px; margin: 0 auto; outline: none;
}

/* Mobile tab bar */
.tabbar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
	display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
	height: calc(var(--tabbar-h) + var(--safe-b)); padding: 0 4px var(--safe-b);
	background: rgba(255, 253, 249, .96);
	backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
	border-top: 1px solid var(--line);
}
.tabbar__item {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
	height: var(--tabbar-h); color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 500;
}
.tabbar__item.is-active { color: var(--brand); }
.tabbar__item.is-active .tabbar__label { font-weight: 650; }
.tabbar__icon .icon { width: 24px; height: 24px; }
.tabbar__item--add .tabbar__icon {
	display: grid; place-items: center; width: 52px; height: 52px; margin-top: -22px; border-radius: 18px;
	background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(29, 58, 47, .28), inset 0 -2px 0 rgba(0,0,0,.18);
}
.tabbar__item--add .tabbar__icon .icon { width: 26px; height: 26px; stroke-width: 2.1; }
.tabbar__item--add { color: var(--brand); }

/* ---------- Buttons ---------- */
.button {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: var(--tap); padding: 0 18px; border-radius: 12px;
	border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
	font-weight: 600; font-size: 15.5px; text-decoration: none; cursor: pointer; white-space: nowrap;
	transition: background-color .15s ease, border-color .15s ease;
}
.button:hover { border-color: var(--brand); }
.button .icon { width: 20px; height: 20px; }
.button--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.button--primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.button--ghost { background: transparent; border-color: var(--line); color: var(--brand); }
.button--danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.button--large { min-height: 54px; font-size: 17px; padding: 0 24px; }
.button--block { display: flex; width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.link-button { background: none; border: 0; padding: 6px 4px; color: var(--brand); font-weight: 600; cursor: pointer; font-size: 14px; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--ink-soft); }
.icon-button:hover { background: var(--surface-2); }
.icon-button .icon { width: 20px; height: 20px; }
.inline-form { display: inline; margin: 0; }

/* ---------- Cards & layout ---------- */
.card {
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
	padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; min-height: 28px; }
.card__title { font-family: var(--serif); font-size: 18px; display: flex; align-items: center; gap: 8px; }
.card__title .icon { width: 20px; height: 20px; color: var(--accent); }
.card__link { font-size: 14.5px; font-weight: 600; text-decoration: none; padding: 8px 0 8px 8px; }
.card__footnote { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.card--placeholder { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 12px, #fbf8f2 12px, #fbf8f2 24px); }
.card--danger { border-color: #ecd3d0; }
.columns { display: grid; gap: 0 16px; }
.stack { min-width: 0; }

/* ---------- Dashboard ---------- */
.hello { padding: 6px 2px 14px; }
.hello__date { margin: 0 0 2px; color: var(--muted); font-size: 14px; }
.hello__title { font-family: var(--serif); font-size: 27px; letter-spacing: -.005em; }

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.quick:empty { display: none; }
.quick__action {
	display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 88px; padding: 14px 12px;
	border-radius: var(--radius); background: var(--brand); color: #fff; text-decoration: none; font-weight: 600; font-size: 14.5px; line-height: 1.2;
	box-shadow: inset 0 -2px 0 rgba(0,0,0,.15);
}
.quick__action + .quick__action { background: var(--surface); color: var(--brand); border: 1px solid var(--line); box-shadow: var(--shadow); }
.quick__action .icon { width: 24px; height: 24px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat {
	display: flex; flex-direction: column; gap: 4px; padding: 14px; min-height: 104px;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
	color: inherit; text-decoration: none;
}
.stat__label { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.stat__value { font-family: var(--serif); font-size: 26px; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em; }
.stat__meta { font-size: 12.5px; color: var(--muted); margin-top: auto; }
.stat--emphasis { background: var(--accent-tint); border-color: #eadcc2; }

/* ---------- Lists ---------- */
.list, .feed, .ledger, .cards, .horse-grid, .notes, .contacts, .agreements, .action-list { list-style: none; margin: 0; padding: 0; }
.list__row {
	display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 0;
	color: inherit; text-decoration: none; border-top: 1px solid var(--line);
}
.list li:first-child .list__row { border-top: 0; }
.list__main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.list__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__meta { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list__amount small { color: var(--muted); font-weight: 400; }
.list__chevron { width: 18px; height: 18px; color: var(--line-strong); }

.feed__item { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.feed__item:first-child { border-top: 0; padding-top: 2px; }
.feed__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--ink-soft); flex: none; }
.feed__icon .icon { width: 17px; height: 17px; }
.feed__icon--plus { background: var(--brand-tint); color: var(--brand); }
.feed__icon--payment { background: var(--credit-tint); color: var(--credit); }
.feed__icon--void { background: var(--bad-tint); color: var(--bad); }
.feed__icon--adjust { background: var(--accent-tint); color: var(--accent); }
.feed__body { display: flex; flex-direction: column; min-width: 0; }
.feed__text { color: var(--ink); text-decoration: none; font-size: 15px; }
a.feed__text:hover { text-decoration: underline; }
.feed__time { font-size: 12.5px; color: var(--muted); }

/* Balances & pills */
.balance { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.15; white-space: nowrap; }
.balance__label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.balance__amount { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 16px; }
.balance--owes { color: var(--owes); }
.balance--credit { color: var(--credit); }
.balance--settled { color: var(--muted); }
.balance--unknown { color: var(--muted); }
.balance--unknown .balance__amount { font-weight: 600; font-size: 14px; }
.balance--large.balance--unknown .balance__amount { font-family: var(--sans, inherit); font-size: 20px; }
.balance--partial { color: var(--ink, inherit); }
.account-card__balance { max-width: 48%; min-width: 0; }
.account-card__balance .balance--unknown, .account-card__balance .balance--partial { white-space: normal; text-align: right; }
.pick__aside .balance--unknown, .pick__aside .balance--partial { white-space: normal; text-align: right; max-width: 14ch; }
.balance--large { align-items: flex-start; }
.balance--large .balance__amount { font-family: var(--serif); font-size: 34px; }

.pill {
	display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
	background: var(--surface-2); color: var(--ink-soft); white-space: nowrap; vertical-align: middle;
}
.pill--good { background: var(--credit-tint); color: var(--credit); }
.pill--warn { background: var(--warn-tint); color: var(--warn); }
.pill--bad { background: var(--bad-tint); color: var(--bad); }
.pill--muted { background: var(--surface-2); color: var(--muted); }

.avatar {
	display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
	background: var(--brand-tint); color: var(--brand); font-weight: 650; font-size: 13.5px; letter-spacing: .02em;
}
.avatar--lg { width: 44px; height: 44px; font-size: 15px; }
.avatar--xl { width: 58px; height: 58px; font-size: 20px; font-family: var(--serif); }

/* ---------- Search / toolbar ---------- */
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.search { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.search__box {
	display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 14px;
	background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--muted);
}
.search__box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.search__box--inline { margin-bottom: 10px; }
.search__input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 17px; color: var(--ink); outline: none; padding: 12px 0; }
.segmented { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.segmented::-webkit-scrollbar { display: none; }
.segmented__item {
	flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
	background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); font-size: 14.5px; font-weight: 550; text-decoration: none;
}
.segmented__item.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.segmented--wide { margin-bottom: 14px; }
.toolbar__action { align-self: stretch; }

/* Account cards */
.cards { display: grid; gap: 10px; }
.account-card {
	display: flex; align-items: flex-start; gap: 12px; padding: 14px; min-height: 76px;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
	color: inherit; text-decoration: none;
}
.account-card:active, .horse-card:active, .action-card:active { transform: scale(.995); }
.account-card__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-card__name { font-weight: 650; font-size: 16.5px; }
.account-card__meta { font-size: 13.5px; color: var(--muted); }
.account-card__balance { padding-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chip {
	display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 7px; border-radius: 999px;
	background: var(--surface-2); font-size: 12.5px; color: var(--ink-soft); font-weight: 500;
}
.chip .icon { width: 14px; height: 14px; }

/* Horse cards */
.horse-grid { display: grid; gap: 10px; }
.horse-card {
	display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 72px;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
	color: inherit; text-decoration: none;
}
.horse-card__badge {
	display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; flex: none;
	background: var(--accent-tint); color: var(--accent); font-family: var(--serif); font-size: 21px; font-weight: 600;
}
.horse-card__badge--xl { width: 58px; height: 58px; font-size: 26px; border-radius: 16px; }
.horse-card__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.horse-card__name { font-weight: 650; font-size: 16.5px; }
.horse-card__stable { font-size: 13.5px; color: var(--ink-soft); font-style: italic; }
.horse-card__meta { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.horse-dot { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--accent-tint); color: var(--accent); flex: none; }
.horse-dot .icon { width: 20px; height: 20px; }

/* Hero (detail headers) */
.hero {
	display: flex; flex-direction: column; gap: 14px; padding: 18px 16px; margin-bottom: 14px;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.hero__identity { display: flex; align-items: center; gap: 14px; }
.hero__title { font-family: var(--serif); font-size: 26px; }
.hero__title.is-void { text-decoration: line-through; color: var(--muted); }
.hero__eyebrow { margin: 0 0 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
.hero__meta { margin: 4px 0 0; color: var(--ink-soft); font-size: 14.5px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hero__balance { padding: 12px 14px; background: var(--bg); border-radius: 12px; display: flex; flex-direction: column; gap: 2px; }
.hero__balance-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.hero__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hero__actions .button { padding: 0 10px; }
.hero__actions .button--primary:only-child { grid-column: 1 / -1; }

/* Ledger rows */
.ledger__row {
	display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 0;
	border-top: 1px solid var(--line); color: inherit; text-decoration: none;
}
.ledger li:first-child .ledger__row { border-top: 0; }
.ledger__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ledger__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger__meta { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger__amount { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger__amount.is-credit { color: var(--credit); }
.ledger__row.is-void .ledger__title, .ledger__row.is-void .ledger__amount { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.ledger__row.is-void .pill { text-decoration: none; }

/* Transaction lines table (small, fits phones) */
.lines { width: 100%; border-collapse: collapse; font-size: 15px; }
.lines th, .lines td { padding: 10px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.lines thead th { border-top: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.lines .num { text-align: right; padding-left: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines__sub { display: block; font-size: 13px; color: var(--muted); }
.lines tfoot th { text-align: right; font-weight: 600; }

/* Details lists */
.details { margin: 0; display: grid; gap: 0; }
.details > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.details > div:first-child { border-top: 0; }
.details dt { color: var(--muted); font-size: 14px; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.details__notes { margin: 12px 0 0; padding: 12px; background: var(--bg); border-radius: 12px; font-size: 15px; }

/* Contacts */
.contact { padding: 10px 0; border-top: 1px solid var(--line); }
.contact:first-child { border-top: 0; padding-top: 0; }
.contact.is-inactive { opacity: .6; }
.contact__head { display: flex; align-items: center; gap: 12px; }
.contact__name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.contact__role { font-size: 13px; color: var(--muted); }
.contact__links { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0 48px; }
.contact__link {
	display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 10px;
	background: var(--bg); text-decoration: none; font-size: 14px; font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.contact__link .icon { width: 16px; height: 16px; }

/* Agreements */
.agreement { padding: 10px 0; border-top: 1px solid var(--line); }
.agreement:first-child { border-top: 0; padding-top: 0; }
.agreement.is-ended { opacity: .65; }
.agreement__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.agreement__title { display: block; font-weight: 650; }
.agreement__horse { font-size: 13.5px; color: var(--muted); }
.agreement__rate { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.agreement__rate small { font-weight: 400; color: var(--muted); }
.agreement__meta { margin: 4px 0; font-size: 13.5px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.agreement__notes { margin: 4px 0; font-size: 14px; padding: 8px 10px; background: var(--bg); border-radius: 10px; }

/* Notes */
.note { padding: 10px 0; border-top: 1px solid var(--line); }
.note:first-child { border-top: 0; padding-top: 0; }
.note--pinned { background: var(--accent-tint); margin: 0 -10px; padding: 10px; border-radius: 12px; border-top: 0; }
.note__text { margin: 0 0 4px; white-space: normal; }
.note__meta { margin: 0; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.note__meta .link-button { font-size: 12.5px; padding: 4px; }

/* Disclosure */
.disclosure { margin-top: 12px; }
.disclosure > summary { list-style: none; cursor: pointer; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure[open] > summary.button { display: none; }
.disclosure__summary { color: var(--brand); font-weight: 600; font-size: 14.5px; padding: 10px 0; }
.disclosure__summary::before { content: "+ "; }
.disclosure[open] > .disclosure__summary::before { content: "− "; }

/* Empty states */
.empty { text-align: center; padding: 32px 20px; }
.empty__code { font-family: var(--serif); font-size: 42px; color: var(--accent); margin: 0; }
.empty__title { font-family: var(--serif); font-size: 21px; margin-bottom: 6px; }
.empty__text { color: var(--ink-soft); max-width: 42ch; margin: 0 auto 14px; }
.empty .button { margin-top: 4px; }
.filter-empty { text-align: center; padding: 18px; }

/* Notices */
.notice {
	display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px;
	font-weight: 500; font-size: 15px;
}
.notice .icon { width: 20px; height: 20px; margin-top: 1px; }
.notice--success { background: var(--credit-tint); color: #1e4d36; }
.notice--error { background: var(--bad-tint); color: #7a2222; }

/* Action lists (Quick Add menu, Settings) */
.action-list { display: grid; gap: 10px; margin-bottom: 14px; }
.action-card {
	display: flex; align-items: center; gap: 14px; padding: 16px; min-height: 80px;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
	color: inherit; text-decoration: none;
}
.action-card__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--brand-tint); color: var(--brand); flex: none; }
.action-card__icon .icon { width: 24px; height: 24px; }
.action-card__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.action-card__title { font-weight: 650; font-size: 17px; }
.action-card__hint { font-size: 14px; color: var(--muted); }
.action-card__chevron { color: var(--line-strong); }

/* ---------- Forms ---------- */
.form { margin: 0; }
.form__section { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.form__legend { font-family: var(--serif); font-size: 18px; font-weight: 600; padding: 0; margin-bottom: 10px; }
.form__intro { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 12px; }
.form__row { display: grid; gap: 0 12px; }
.form__row--tight { grid-template-columns: auto 1fr; align-items: start; }
.form__actions { margin-top: 8px; display: flex; gap: 10px; }
.form__actions .button { flex: 1; }
.form--compact { margin-top: 10px; }
.field { margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field__label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; color: var(--ink); padding: 0; }
.field__optional { font-weight: 400; color: var(--muted); font-size: 13px; }
.field__hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.field__error { margin: 6px 0 0; font-size: 13.5px; color: var(--bad); font-weight: 550; }
.field--error .input { border-color: var(--bad); background: #fffafa; }
.input {
	display: block; width: 100%; min-height: 50px; padding: 12px 14px;
	border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; color: var(--ink);
	font: inherit; font-size: 17px; /* ≥16px prevents iOS zoom */
	-webkit-appearance: none; appearance: none;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.input--textarea { min-height: 84px; resize: vertical; line-height: 1.4; }
.input--select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234d5a54' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
input[type="date"].input { min-height: 50px; }
.input-affix { display: flex; align-items: stretch; }
.input-affix__prefix {
	display: grid; place-items: center; padding: 0 12px 0 14px; border: 1px solid var(--line-strong); border-right: 0;
	border-radius: 12px 0 0 12px; background: var(--surface-2); color: var(--ink-soft); font-weight: 600;
}
.input-affix .input { border-radius: 0 12px 12px 0; }
.checks { display: grid; gap: 8px; margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 12px; min-height: var(--tap); cursor: pointer; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: #fff; flex: none; color: transparent; }
.check__box .icon { width: 18px; height: 18px; stroke-width: 2.4; }
.check input:checked + .check__box { background: var(--brand); border-color: var(--brand); color: #fff; }
.check input:focus-visible + .check__box { outline: 3px solid var(--accent); outline-offset: 2px; }
.check__text { display: flex; flex-direction: column; font-weight: 500; }
.check__text small { color: var(--muted); font-weight: 400; font-size: 13px; }

/* Choice chips & cards (radio groups) */
.chips-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input, .choice-card input, .pick__input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
	display: inline-flex; align-items: center; min-height: 46px; padding: 0 16px; border-radius: 12px;
	border: 1px solid var(--line-strong); background: #fff; font-weight: 550; cursor: pointer;
}
.choice input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice-cards { display: grid; gap: 8px; }
.choice-card { display: flex; flex-direction: column; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); background: var(--brand-tint); }
.choice-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice-card__title { font-weight: 650; }
.choice-card__hint { font-size: 13.5px; color: var(--muted); }

/* ---------- Quick Add ---------- */
.quick-form { padding-bottom: 8px; }
.step { padding: 14px; }
.step__header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.step__num {
	display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none;
	background: var(--brand); color: #fff; font-size: 14px; font-weight: 700;
}
.step__title { font-family: var(--serif); font-size: 19px; flex: 1; }
.step--error { border-color: #e7c3c3; }
.step.is-done .step__header { margin-bottom: 0; }
.step.is-done .step__num { background: var(--credit); }
.step__summary { margin: 8px 0 0 38px; font-weight: 600; font-size: 16px; }

.picks { display: grid; gap: 8px; max-height: min(52vh, 440px); overflow-y: auto; overscroll-behavior: contain; padding: 2px; margin: -2px; }
.picks--grid { max-height: none; overflow: visible; }
.picks__group { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 8px; font-weight: 650; }
.picks__group:first-of-type { margin-top: 2px; }
.pick {
	display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px;
	border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; cursor: pointer;
}
.pick.is-disabled { opacity: .5; cursor: not-allowed; }
.pick__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pick__title { font-weight: 650; }
.pick__meta { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick__aside { flex: none; }
.pick__aside .balance__amount { font-size: 14px; }
.pick__tick { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-strong); color: transparent; flex: none; }
.pick__tick .icon { width: 16px; height: 16px; stroke-width: 2.6; }
.pick:has(.pick__input:checked) { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 1px var(--brand); }
.pick:has(.pick__input:checked) .pick__tick { background: var(--brand); border-color: var(--brand); color: #fff; }
.pick:has(.pick__input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

.stepper { display: flex; align-items: stretch; }
.stepper__btn {
	width: 50px; min-height: 50px; border: 1px solid var(--line-strong); background: var(--surface-2);
	font-size: 22px; font-weight: 600; color: var(--brand); cursor: pointer;
}
.stepper__btn:first-child { border-radius: 12px 0 0 12px; border-right: 0; }
.stepper__btn:last-child { border-radius: 0 12px 12px 0; border-left: 0; }
.stepper__input { width: 64px; text-align: center; border-radius: 0; font-weight: 650; }
.price-readout { min-height: 50px; display: flex; align-items: center; margin: 0; font-size: 18px; font-weight: 650; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; margin: 0 0 14px; border-radius: 12px; background: var(--bg); font-size: 15px; color: var(--ink-soft); }
.total strong { font-family: var(--serif); font-size: 24px; color: var(--ink); font-variant-numeric: tabular-nums; }

.sticky-save {
	position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); z-index: 10;
	padding: 10px 0 0;
}
.sticky-save .button { box-shadow: 0 8px 20px rgba(29, 58, 47, .25); }

.pager { display: flex; justify-content: space-between; gap: 10px; }

/* Bare pages */
.yard--bare { display: grid; min-height: 100vh; place-items: center; }
.bare { width: 100%; max-width: 440px; padding: 24px var(--gutter); }
.bare__brand { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 22px; margin-bottom: 18px; }

/* ---------- Sign-in screens (0.2.0) ---------- */
body.yard--auth {
	min-height: 100vh;
	background: #1d3a2f radial-gradient(130% 70% at 50% -10%, #2f5646 0%, #1d3a2f 55%, #152b22 100%) fixed;
}
.auth {
	min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
	padding: calc(var(--safe-t) + 36px) var(--gutter) calc(var(--safe-b) + 18px);
}
.auth__brand { text-align: center; margin: 8px 0 28px; }
.auth__brand-link { display: inline-flex; flex-direction: column; align-items: center; gap: 12px; text-decoration: none; color: #f6f3ec; }
.auth__org { font-size: 12px; font-weight: 600; letter-spacing: .34em; padding-left: .34em; text-transform: uppercase; color: #d9d0bf; }
.auth__rule { width: 40px; height: 1px; background: #d5bd8e; }
.auth__app { font-family: var(--serif); font-size: 46px; font-weight: 500; line-height: 1; letter-spacing: .3em; padding-left: .3em; text-transform: uppercase; color: #f6f3ec; }
.auth__panel {
	width: 100%; max-width: 420px; padding: 26px 20px 22px;
	background: var(--surface); border-radius: 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}
.auth__title { font-family: var(--serif); font-size: 25px; margin-bottom: 14px; }
.auth__text { color: var(--ink-soft); }
.auth__form { margin-top: 6px; }
.auth__form .check { margin: -2px 0 12px; }
.auth__alt { text-align: center; margin: 14px 0 0; }
.auth__alt a { display: inline-block; padding: 10px 12px; font-weight: 600; text-decoration: none; }
.auth__foot { margin: auto 0 0; padding-top: 28px; font-size: 12.5px; letter-spacing: .04em; color: rgba(246, 243, 236, .5); }
.password { position: relative; }
.password__input { padding-right: 78px; }
.password__toggle {
	position: absolute; right: 5px; top: 50%; transform: translateY(-50%); min-height: 40px; padding: 0 12px;
	border: 0; border-radius: 8px; background: transparent; color: var(--brand); font-weight: 600; font-size: 14px; cursor: pointer;
}
.notice--info { background: var(--brand-tint); color: var(--brand); }
.notice a { color: inherit; font-weight: 650; }

/* ---------- People & Access (0.2.0) ---------- */
.people-intro { font-size: 14px; margin: -2px 2px 12px; }
.person-card { align-items: center; }
.person-card__email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-hint { margin: -6px 0 4px; }
.level-picker { display: grid; gap: 8px; }
.level-card { gap: 2px; }
.hero__you { font-size: 16px; font-family: var(--sans); font-weight: 500; }
.notice--warn { background: var(--warn-tint); color: #6d4708; }

/* ---------- Horse record tabs (0.2.0) ---------- */
.tabs {
	position: sticky; top: calc(56px + var(--safe-t)); z-index: 15;
	display: flex; gap: 2px; margin: -4px calc(var(--gutter) * -1) 14px; padding: 6px calc(var(--gutter) - 4px);
	overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
	background: color-mix(in srgb, var(--bg) 92%, transparent);
	backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 639px) { .tabs { justify-content: space-between; } }
.tabs__item {
	flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 999px;
	color: var(--ink-soft); font-weight: 600; font-size: 14.5px; text-decoration: none; border: 1px solid transparent;
}
.tabs__item.is-active { background: var(--brand); color: #fff; }
.tabs__item:not(.is-active):hover { border-color: var(--line-strong); }
.hero--slim { padding: 12px 14px; }
.hero--slim .horse-card__badge--xl { width: 44px; height: 44px; font-size: 21px; border-radius: 13px; }
.hero--slim .hero__title { font-size: 21px; }
.hero__text { min-width: 0; }

/* ---------- Care (0.2.0) ---------- */
.card__aside { font-size: 13px; color: var(--muted); }
.card__action { margin-top: 12px; }
.card--notice { border-color: #e7d6b4; background: #fffaf0; }
.card--meds { border-left: 4px solid var(--accent); background: linear-gradient(to right, var(--accent-tint), var(--surface) 60%); }
.restriction {
	margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: 15px;
	background: var(--warn-tint); color: #5f3f07; border: 1px solid #efdcb4;
}
.restriction strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }

.feed { margin: 0; display: grid; gap: 0; }
.feed__slot { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.feed__slot:first-child { border-top: 0; padding-top: 2px; }
.feed__when { font-weight: 650; color: var(--brand); font-size: 15px; }
.feed__items { margin: 0; }
.feed__items ul, .feed__forage ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.feed__item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 16px; }
.feed__what { font-weight: 600; }
.feed__prep { flex-basis: 100%; font-size: 13.5px; color: var(--ink-soft); }
.feed__tag { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.feed__forage { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.feed__heading { margin: 0 0 6px; font-weight: 650; color: var(--brand); font-size: 15px; }
.turnout__arrangement { font-family: var(--serif); font-size: 19px; font-weight: 600; margin: 0 0 10px; }
.details--compact > div { grid-template-columns: 100px 1fr; padding: 7px 0; }

.meds { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.med { padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid #eadcc2; }
.med--upcoming { border-style: dashed; }
.med--past { background: transparent; border-color: var(--line); }
.med__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.med__name { font-weight: 700; font-size: 17px; }
.med__dose { font-weight: 650; font-variant-numeric: tabular-nums; }
.med__when { margin: 2px 0 0; font-weight: 550; color: var(--ink); }
.med__instructions { margin: 6px 0 0; font-size: 14.5px; color: var(--ink-soft); }
.med__meta { margin: 6px 0 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.med__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.med-chip { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-tint); color: var(--accent); flex: none; }
.med-chip .icon { width: 18px; height: 18px; }

.due { list-style: none; margin: 0 0 8px; padding: 0; }
.due__row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 0; color: inherit; text-decoration: none; border-top: 1px solid var(--line); }
.due li:first-child .due__row { border-top: 0; }
.due__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); color: var(--ink-soft); flex: none; }
.due__icon .icon { width: 18px; height: 18px; }
.due__label { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.events { list-style: none; margin: 0; padding: 0; }
.events > li { padding: 10px 0; border-top: 1px solid var(--line); }
.events > li:first-child { border-top: 0; padding-top: 2px; }
.event__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.event__title { font-weight: 650; }
.event__meta { margin: 2px 0 0; font-size: 14px; color: var(--ink-soft); }
.event__detail { margin: 4px 0 0; font-size: 15px; }
.event__notes { margin: 8px 0 0; padding: 10px 12px; background: var(--bg); border-radius: 10px; font-size: 15px; }
.event__by { margin: 8px 0 8px; font-size: 12.5px; color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { position: relative; padding-left: 18px; }
.timeline__item::before { content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.timeline__item::after { content: ""; position: absolute; left: 0; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong); box-shadow: 0 0 0 3px var(--bg); }
.timeline__item.is-current::after { background: var(--credit); }
.timeline__item:first-child::before { top: 22px; }
.timeline__item:last-child::before { bottom: auto; height: 22px; }
.timeline__meta { font-size: 13.5px; color: var(--muted); margin: -4px 0 8px; }
.timeline__note { font-style: italic; color: var(--ink-soft); }

.page-action { margin-bottom: 14px; }
.button--compact { min-height: 44px; padding: 0 14px; font-size: 14.5px; }
.choice-cards--2 { grid-template-columns: 1fr 1fr; }

/* Feeding editor */
.feed-form .card { padding: 14px; }
.feed-slot__title { font-family: var(--serif); font-size: 18px; margin: 0 0 10px; }
details.feed-slot > .feed-slot__title { margin-top: 12px; }
.feed-slot__add { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--brand); font-weight: 650; }
.feed-slot__add::-webkit-details-marker { display: none; }
details.feed-slot[open] > .feed-slot__add { display: none; }
details.feed-slot[open] > .feed-slot__title { margin-top: 0; }
.item-rows { display: grid; gap: 10px; margin-bottom: 10px; }
.item-row { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.item-row--error { border-color: var(--bad); }
.item-row__name { font-weight: 600; }
.item-row__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.item-row__pair .input--select { padding-left: 10px; padding-right: 30px; background-position: right 10px center; }
.item-row .check { min-height: 40px; }
.form__row--pair { grid-template-columns: 1fr 1fr; }

/* ---------- Data import (0.2.1) ---------- */
.dataset { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child .dataset { border-top: 0; padding-top: 0; }
.dataset__main { flex: 1; min-width: 0; }
.dataset__title { margin: 0; font-weight: 650; }
.import-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.import-summary__card { margin: 0; padding: 12px 14px; }
.import-summary__title { font-family: var(--serif); font-size: 16px; margin: 0 0 6px; }
.import-summary__list { list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--ink-soft); display: grid; gap: 2px; }
.import-summary__n { display: inline-block; min-width: 28px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.import-summary__n--good { color: var(--credit); }
.import-summary__n--bad { color: var(--bad); }
.import-summary__n--warn { color: var(--warn); }
.import-summary__n--muted { color: var(--muted); }
.import-section > summary { list-style: none; cursor: pointer; }
.import-section > summary::-webkit-details-marker { display: none; }
.import-section__summary { font-family: var(--serif); font-size: 18px; font-weight: 600; min-height: 32px; display: flex; align-items: center; gap: 6px; }
.import-section__summary::before { content: "+"; font-family: var(--sans); color: var(--brand); width: 16px; }
.import-section[open] > .import-section__summary::before { content: "−"; }
.import-items { list-style: none; margin: 10px 0 0; padding: 0; }
.import-item { padding: 10px 0; border-top: 1px solid var(--line); }
.import-item__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.import-item__label { font-weight: 650; }
.import-item__detail { margin: 3px 0 0; font-size: 14px; color: var(--ink-soft); }
.import-item__reason { margin: 3px 0 0; font-size: 14px; }
.import-item--conflict .import-item__reason { color: var(--bad); }
.import-item__ref { margin: 4px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.import-errors { margin: 0; padding-left: 18px; font-size: 14.5px; display: grid; gap: 4px; }
.import-confirm .check { margin-bottom: 10px; }

/* ---------- ≥ 640px ---------- */
@media (min-width: 640px) {
	:root { --gutter: 24px; }
	.stats { grid-template-columns: repeat(2, 1fr); }
	.form__row { grid-template-columns: 1fr 1fr; }
	.form__row--tight { grid-template-columns: auto 1fr; }
	.cards, .horse-grid { grid-template-columns: 1fr 1fr; }
	.hero__actions { display: flex; flex-wrap: wrap; }
	.picks--grid { grid-template-columns: 1fr 1fr; }
	.choice-cards { grid-template-columns: repeat(3, 1fr); }
	.choice-cards--2 { grid-template-columns: repeat(2, 1fr); }
	.level-picker { grid-template-columns: 1fr 1fr; }
	.search { flex-direction: row; align-items: center; flex-wrap: wrap; }
	.search__box { flex: 1 1 320px; }
	.form.card, .quick-form { max-width: 720px; }
	.quick { grid-template-columns: repeat(3, minmax(0, 200px)); }
}

/* ---------- ≥ 960px: desktop shell ---------- */
@media (min-width: 960px) {
	:root { --gutter: 32px; }
	.shell { display: grid; grid-template-columns: 248px 1fr; background: linear-gradient(to right, var(--brand) 248px, transparent 248px); }
	.sidebar {
		position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
		padding: 22px 16px; background: var(--brand); color: #e8efe9;
	}
	.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 21px; padding: 0 8px; }
	.sidebar .brand__mark { background: #f6f3ec; color: var(--brand); }
	.sidebar .brand__app { color: #d5bd8e; }
	.sidebar__add { background: #f6f3ec; border-color: #f6f3ec; color: var(--brand); }
	.sidebar__add:hover { background: #fff; border-color: #fff; }
	.sidenav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
	.sidenav__link {
		display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 10px;
		color: #d9e4dc; text-decoration: none; font-weight: 550;
	}
	.sidenav__link:hover { background: rgba(255,255,255,.07); color: #fff; }
	.sidenav__link.is-active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 #d5bd8e; }
	.sidebar__user { margin-top: auto; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.12); }
	.sidebar__user .avatar { grid-row: span 2; background: rgba(255,255,255,.12); color: #fff; }
	.sidebar__username { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.sidebar__logout { color: #b9c9be; font-size: 13px; }

	.tabbar { display: none; }
	.topbar { grid-template-columns: auto 1fr auto; padding: 0 var(--gutter); min-height: 72px; gap: 16px; }
	.topbar__title { text-align: left; }
	.topbar__title h1 { font-size: 26px; }
	.topbar__brand, .topbar__settings { display: none; }
	.topbar__lead:empty { display: none; }
	.content { padding: 8px var(--gutter) 48px; }

	.stats { grid-template-columns: repeat(4, 1fr); }
	.quick { display: none; } /* Sidebar Quick Add replaces the mobile quick actions. */
	.columns { grid-template-columns: 1fr 1fr; align-items: start; }
	.columns--detail { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
	.cards, .horse-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
	.toolbar { flex-direction: row; align-items: flex-start; }
	.toolbar .search { flex: 1; }
	.toolbar__action { align-self: flex-start; }
	.hero { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 22px 24px; }
	.hero__identity { flex: 1 1 320px; }
	.hero__actions { flex: 1 1 100%; }
	.sticky-save { bottom: 16px; }
	.sticky-save .button { max-width: 720px; }
	.picks { max-height: 360px; }
	.action-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
	.tabs { top: 72px; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
	.feed__slot { grid-template-columns: 110px 1fr; }
}

/* ---------- Delete / close / retire (0.2.2) ---------- */
.delete-confirm p, .delete-refused p, .delete-alternative p { margin: 0 0 10px; }
.delete-list { margin: 0 0 12px; padding-left: 20px; }
.delete-list li { margin: 2px 0; }
.delete-confirm .button, .delete-alternative .button { margin-top: 8px; }
.delete-alternative .stack--tight form + form { margin-top: 0; }
.danger-link { display: flex; justify-content: center; margin-top: 18px; }
.danger-link a { color: var(--bad); font-weight: 600; text-decoration: none; padding: 10px 12px; }
.danger-link a:hover { text-decoration: underline; }

/* ---------- Quick Add service search (0.2.3) ---------- */
.picks__none { margin: 8px 0 4px; }
.picks__section[hidden] { display: none; }

/* Account cards never wider than the screen (0.2.3) */
.cards > li { min-width: 0; }
.account-card { min-width: 0; max-width: 100%; }
.account-card__balance { flex: 0 1 auto; max-width: 46%; min-width: 0; text-align: right; }
.account-card__balance .balance { max-width: 100%; }
.account-card__balance .balance--unknown .balance__amount { white-space: normal; }

/* ---------- Statement & financial position (0.2.2) ---------- */
.card__intro { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.statement { list-style: none; margin: 0; padding: 0; }
.statement li + li { border-top: 1px solid var(--line); }
.statement__row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "date figures" "main figures"; gap: 2px 12px; padding: 11px 2px; color: inherit; text-decoration: none; }
.statement__row:hover { background: var(--bg); }
.statement__date { grid-area: date; font-size: 12.5px; color: var(--muted); }
.statement__main { grid-area: main; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.statement__title { font-weight: 600; overflow-wrap: anywhere; }
.statement__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.statement__figures { grid-area: figures; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; text-align: right; gap: 2px; white-space: nowrap; }
.statement__amount { font-weight: 650; font-variant-numeric: tabular-nums; }
.statement__amount.is-credit { color: var(--credit); }
.statement__running { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.statement__row.is-void .statement__title, .statement__row.is-void .statement__amount { text-decoration: line-through; color: var(--muted); }
@media (min-width: 720px) {
	.statement__row { grid-template-columns: 110px 1fr auto; grid-template-areas: "date main figures"; align-items: center; }
}
.position-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); max-width: 42ch; }
.position-note a { font-weight: 600; }
.stat--muted .stat__value { color: var(--muted); }

/* Financial import preview */
.fin-account { display: flex; flex-direction: column; gap: 10px; }
.fin-account__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.fin-figures { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; margin: 0; font-size: 14.5px; }
.fin-figures dt { color: var(--muted); }
.fin-figures dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.fin-figures .fin-figures__sep { grid-column: 1 / -1; border-top: 1px solid var(--line); margin: 2px 0; }
.fin-figures dd.is-zero { color: var(--credit); }
.fin-figures dd.is-off { color: var(--bad); }
.fin-rows { list-style: none; margin: 0; padding: 0; }
.fin-rows li { padding: 9px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.fin-rows__main { min-width: 0; }
.fin-rows__title { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.fin-rows__meta { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.fin-rows__amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.fin-rows__amount.is-credit { color: var(--credit); }
.fin-rows li.is-held .fin-rows__title, .fin-rows li.is-held .fin-rows__amount { color: var(--muted); }
.fin-select .check { margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}
