:root {
    --bg: #f3f2ee;
    --lift: #faf9f6;
    --inset: #eceae6;
    --surface: #ffffff;
    --ink: #131312;
    --muted: #686560;
    --line: rgba(19, 19, 18, 0.055);
    --accent: #0e6b51;
    --accent-hover: #0b5a43;
    --accent-soft: #e8f2ed;
    --danger: #a83232;
    --danger-soft: #f9ecec;
    --warn-soft: #f8f2e8;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --wrap: min(1080px, 100%);
    --pad: clamp(20px, 4vw, 28px);
    --radius: 18px;
    --header-h: 68px;
    --header-h-mobile: 60px;
    --bp-sm: 480px;
    --bp-md: 768px;
    --bp-lg: 900px;
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236d6a64' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(20, 20, 19, 0.14) var(--bg);
}

html::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html::-webkit-scrollbar-thumb {
    background: rgba(20, 20, 19, 0.14);
    border-radius: 999px;
}

html::-webkit-scrollbar-track {
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.6 var(--sans);
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

::selection {
    background: var(--accent-soft);
    color: var(--ink);
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover { color: var(--accent); }

.brand,
.nav a,
.nav button,
.btn,
.foot-nav a,
.foot-brand {
    text-decoration: none;
}

.wrap {
    width: var(--wrap);
    margin: 0 auto;
    padding-inline: max(var(--pad), env(safe-area-inset-left), env(safe-area-inset-right));
}

.brand:hover,
.foot-brand:hover {
    color: inherit;
}

/* Scrollbars */
.board,
.table-wrap,
.nav-main {
    scrollbar-width: thin;
    scrollbar-color: rgba(20, 20, 19, 0.18) transparent;
}

.board::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.nav-main::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.board::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.nav-main::-webkit-scrollbar-thumb {
    background: rgba(20, 20, 19, 0.16);
    border-radius: 999px;
}

.board::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.nav-main::-webkit-scrollbar-track {
    background: transparent;
}

/* Header */
.top {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.top-inner {
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    font-family: var(--serif);
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1;
    flex-shrink: 0;
}

.brand b { color: var(--accent); font-weight: 700; }

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
}

body.is-app .nav {
    flex: 1;
    gap: 10px;
    justify-content: flex-end;
}

.nav-main {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
}

.nav-meta {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    padding-left: 8px;
    margin-left: 8px;
}

.nav a,
.nav button {
    border: 0;
    background: transparent;
    color: #3f3d39;
    font: inherit;
    font-size: 0.94rem;
    padding: 10px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}

.nav a:hover,
.nav button:hover {
    color: var(--ink);
    background: rgba(20, 20, 19, 0.05);
}

.nav a.is-active {
    color: var(--accent);
    font-weight: 600;
    background: var(--accent-soft);
    border-radius: 999px;
}

.nav a.is-active:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.nav a.nav-cta {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    padding: 10px 16px;
    box-shadow: none;
    border-radius: 999px;
}

.nav a.nav-cta:hover {
    background: var(--accent-hover);
    color: #fff;
}

.nav a.nav-cta.is-active {
    color: #fff;
    box-shadow: none;
    border-radius: 999px;
    background: var(--accent-hover);
}

body.is-app .nav a,
body.is-app .nav button {
    font-size: 0.9rem;
    padding: 9px 11px;
}

body.is-app .nav-meta a,
body.is-app .nav-meta button {
    font-size: 0.84rem;
    padding: 8px 9px;
}

.nav-meta a,
.nav-meta button {
    color: var(--muted);
}

.nav-meta a.is-active {
    color: var(--ink);
}

.nav-meta button:hover {
    background: transparent;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.nav form { margin: 0; }

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

.nav-burger,
.nav-backdrop {
    display: none;
}

.nav-burger {
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: var(--lift);
    color: var(--ink);
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-burger-box {
    display: grid;
    gap: 5px;
    width: 18px;
}

.nav-burger-box span {
    display: block;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

body.nav-open .nav-burger-box span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

body.nav-open .nav-burger-box span:nth-child(2) {
    opacity: 0;
}

body.nav-open .nav-burger-box span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-main--guest {
    gap: 4px;
}

/* Main */
main {
    flex: 1;
    padding: clamp(32px, 5vw, 56px) 0 clamp(48px, 7vw, 72px);
}

body.is-app main {
    padding-top: clamp(22px, 4vw, 40px);
}

.page-head {
    margin-bottom: clamp(24px, 4vw, 36px);
    max-width: 42rem;
}

.page-head .lead {
    margin-top: 16px;
}

.page-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.eyebrow {
    display: inline-block;
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
.hero-title {
    margin: 0 0 12px;
    font-family: var(--serif);
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    font-weight: 600;
    text-wrap: balance;
}

.page-head h1::after,
.hero-title::after,
.auth-aside h1::after {
    content: "";
    display: block;
    width: 28px;
    height: 1px;
    background: var(--accent);
    margin-top: 14px;
    opacity: 0.45;
}

body.is-app .page-head {
    max-width: none;
}

body.is-app .page-head .lead {
    max-width: 42rem;
}

h2 {
    margin: 0 0 16px;
    font-family: var(--serif);
    font-size: 1.25rem;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.02em;
}

body.is-app h2 {
    font-size: 1.15rem;
}

.lead {
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.grid { display: grid; gap: clamp(16px, 3vw, 24px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.panel,
.card,
.record {
    background: var(--lift);
    border-radius: var(--radius);
    padding: clamp(18px, 3vw, 24px);
}

.panel .record,
.record-list .record {
    background: var(--inset);
}

/* App interior — editorial sections without card boxes */
body.is-app .panel {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

body.is-app .board,
body.is-app .stat-strip,
body.is-guest .auth-layout .panel,
.prose.panel {
    background: var(--lift);
    padding: clamp(18px, 3vw, 24px);
    border-radius: var(--radius);
}

body.is-app .section {
    margin-top: 40px;
    padding-top: 0;
    border-top: 0;
}

body.is-app .page-head + .grid,
body.is-app .page-head + .stat-strip,
body.is-app .page-head + .board,
body.is-app .page-head + .section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

body.is-app .stat-strip + .board {
    margin-top: 20px;
}

body.is-app .grid.mt-lg,
body.is-app .section.mt-lg {
    margin-top: 40px;
}

body.is-app .grid.mt-lg {
    padding-top: 0;
    border-top: 0;
}

@media (min-width: 901px) {
    body.is-app .grid.grid-2 {
        gap: clamp(36px, 5vw, 56px);
    }

    body.is-app .grid.grid-2 > *:first-child {
        padding-right: 0;
        border-right: 0;
    }

    body.is-app .grid.grid-2 > *:last-child {
        padding-left: 0;
    }

    body.is-app .nav-main {
        flex-wrap: nowrap;
    }
}

@media (min-width: 901px) and (max-width: 1120px) {
    body.is-app .nav-main {
        overflow-x: auto;
        max-width: min(54vw, 540px);
        mask-image: linear-gradient(90deg, #000 94%, transparent);
        -webkit-mask-image: linear-gradient(90deg, #000 94%, transparent);
        scrollbar-width: none;
    }

    body.is-app .nav-main::-webkit-scrollbar {
        display: none;
    }
}

body.is-app .record input,
body.is-app .record select,
body.is-app .record textarea {
    background: var(--bg);
}

body.is-app .record input:focus,
body.is-app .record select:focus,
body.is-app .record textarea:focus {
    background-color: #e8e7e3;
}

.mt-lg { margin-top: 24px; }
.mt-md { margin-top: 18px; }

.stack { display: grid; gap: 14px; }
.stack p { margin: 0; }

/* Metrics */
.stat-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    background: transparent;
    border-radius: 0;
    overflow: visible;
}

.stat {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    min-height: 92px;
    padding: 20px 22px;
    background: var(--lift);
    border-radius: var(--radius);
}

.stat + .stat {
    border-left: 0;
}

.stat--warn .stat-label,
.stat--warn .stat-value {
    color: #8a5a12;
}

.stat-label {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    font-family: var(--serif);
    font-size: clamp(1.65rem, 3vw, 1.9rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.tabular {
    font-variant-numeric: tabular-nums;
}

.warn-text {
    color: #8a5a12;
    font-weight: 600;
}

.muted { color: var(--muted); }

.flash {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: #145a42;
}

.flash.error {
    background: var(--danger-soft);
    color: #7f2323;
}

/* Forms */
label {
    display: block;
    margin: 0 0 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #4a4843;
}

input,
select,
textarea {
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: var(--inset);
    color: var(--ink);
    font: inherit;
    padding: 12px 14px;
    transition: background 0.15s ease, outline-color 0.15s ease;
}

select {
    appearance: none;
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    background-color: #e6e5e1;
    box-shadow: inset 0 0 0 1px rgba(14, 107, 81, 0.16);
}

select:focus {
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: right 14px center;
}

textarea { min-height: 96px; resize: vertical; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.form-grid p { margin: 0; }
.full { grid-column: 1 / -1; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
    touch-action: manipulation;
}

.btn:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn.secondary {
    background: #2a2927;
}

.btn.secondary:hover { background: #1f1e1c; color: #fff; }

.btn.ghost {
    background: color-mix(in srgb, var(--ink) 5%, transparent);
    color: var(--ink);
}

.btn.ghost:hover {
    background: color-mix(in srgb, var(--ink) 8%, transparent);
    color: var(--ink);
}

.btn.red {
    background: var(--danger);
}

.btn.red:hover { background: #8f2828; color: #fff; }

.btn:focus-visible,
.nav a:focus-visible,
.nav button:focus-visible,
.brand:focus-visible,
.foot-brand:focus-visible,
a.slot.busy:focus-visible {
    outline: 2px solid rgba(15, 107, 82, 0.35);
    outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(15, 107, 82, 0.25);
    outline-offset: 0;
}

.btn.sm {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.88rem;
}

.actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

/* Tables */
.table-wrap {
    overflow: auto;
    margin: 0 -4px;
}

.panel .table-wrap {
    margin: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 16px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 0;
}

th {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    background: transparent;
}

tbody tr + tr td,
tbody tr + tr th {
    border-top: 1px solid var(--line);
}

body.is-app tbody tr:hover td,
body.is-app tbody tr:hover th {
    background: rgba(20, 20, 19, 0.02);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(20, 20, 19, 0.06);
    color: #4a4843;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge.green {
    background: var(--accent-soft);
    color: #145a42;
}

.badge.amber {
    background: var(--warn-soft);
    color: #8a5a12;
}

/* Board */
.board-wrap {
    position: relative;
}

.board-hint {
    display: none;
    margin: 0 0 10px;
    font-size: 0.82rem;
    color: var(--muted);
}

.board {
    overflow: auto;
    border-radius: var(--radius);
    background: var(--lift);
    padding: 12px 10px 14px;
    scrollbar-gutter: stable;
}

.board table { min-width: 940px; }

.board th,
.board td {
    border: 0;
    padding: 8px 6px;
    text-transform: none;
    letter-spacing: 0;
    font-size: inherit;
}

.board thead th:not(:first-child),
.board tbody td {
    text-align: center;
    vertical-align: middle;
}

.board thead th:first-child {
    text-align: left;
    vertical-align: bottom;
    padding-left: 8px;
    min-width: 156px;
}

.board thead th {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--lift);
}

.board thead th:first-child,
.board tbody th {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--lift);
}

.board thead th:first-child {
    z-index: 4;
}

.board tbody th {
    font-weight: 600;
    font-size: 0.92rem;
    min-width: 156px;
    color: var(--ink);
    line-height: 1.4;
    text-align: left;
    vertical-align: middle;
    padding-left: 8px;
}

.board tbody th .muted {
    font-size: 0.82rem;
    font-weight: 500;
}

.board th.is-today {
    color: var(--ink);
}

.board th.is-today .day {
    color: var(--accent);
    font-weight: 650;
}

.board th.is-weekend {
    opacity: 0.78;
}

.day {
    font-size: 0.75rem;
    color: var(--muted);
}

.slot {
    min-width: 62px;
    min-height: 46px;
    border-radius: 10px;
    background: var(--inset);
}

.slot.busy {
    padding: 7px 6px;
    background: var(--accent-soft);
    color: #145a42;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
}

a.slot.busy {
    display: block;
    text-decoration: none;
    transition: background 0.15s ease;
}

a.slot.busy:hover {
    background: #dceee6;
    color: #0f4f3c;
}

/* Landing */
.home {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(24px, 5vw, 48px);
    align-items: center;
    min-height: calc(100dvh - var(--header-h) - 180px);
}

.home .lead {
    margin-top: 18px;
}

.home .actions {
    margin-top: 28px;
}

.hero-panel {
    background: #181816;
    color: #f5f4f1;
    border-radius: var(--radius);
    padding: clamp(28px, 4vw, 36px);
}

.hero-panel h2 {
    color: #fff;
    margin-bottom: 12px;
}

.hero-panel .muted { color: #b8b4ad; }

.hero-stat b {
    display: block;
    font-family: var(--serif);
    font-size: 1.5rem;
    margin-bottom: 4px;
    color: #fff;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 24px;
    padding-top: 24px;
}

/* Record lists */
.record-list { display: grid; gap: 12px; }

.record:target {
    outline: 2px solid rgba(15, 107, 82, 0.22);
    outline-offset: 3px;
    scroll-margin-top: calc(var(--header-h) + 20px);
}

.record-actions,
.record-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    align-items: center;
}

.record-meta {
    margin: 0 0 12px;
    font-size: 0.92rem;
}

.task-line {
    margin: 0 0 12px;
    padding-bottom: 12px;
}

.task-line:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.empty-hint,
.empty-state {
    padding: 28px 12px;
    text-align: center;
}

.empty-state {
    padding: clamp(32px, 5vw, 44px) 24px;
    border-radius: var(--radius);
    background: var(--lift);
}

.empty-state-mark {
    width: 44px;
    height: 44px;
    margin: 0 auto 16px;
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1;
}

.empty-state h3,
.empty-hint h3 {
    margin: 0 0 8px;
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 600;
}

.empty-hint p,
.empty-state p {
    margin: 0 0 14px;
    color: var(--muted);
    max-width: 28rem;
    margin-inline: auto;
}

.empty-hint .btn,
.empty-state .btn {
    margin-top: 4px;
}

.empty-state--compact {
    padding-block: 24px;
}

.table-actions {
    white-space: nowrap;
    text-align: right;
}

.table-actions form {
    display: inline-flex;
    margin: 0;
}

.table-actions .btn + form,
.table-actions form + .btn,
.table-actions form + form {
    margin-left: 6px;
}

td.table-actions {
    vertical-align: middle;
}

/* Auth */
.auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(20px, 4vw, 40px);
    align-items: start;
}

body.is-guest .auth-layout {
    max-width: 52rem;
    margin-inline: auto;
}

.auth-aside { max-width: 28rem; }

.auth-aside .lead {
    margin-top: 16px;
}

.text-link {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.text-link:hover { color: var(--accent); }

/* Footer */
.foot {
    padding: 40px 0 max(48px, calc(40px + env(safe-area-inset-bottom)));
    background: transparent;
}

.foot-inner { display: grid; gap: 28px; }

.foot-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.foot-brand-block {
    display: grid;
    gap: 4px;
}

.foot-brand {
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 600;
}

.foot-tagline {
    margin: 0;
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0;
}

.foot-brand b { color: var(--accent); }

.foot-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
}

.foot-nav a {
    color: var(--muted);
    font-size: 0.92rem;
}

.foot-nav a:hover { color: var(--accent); }

.foot-legal {
    display: grid;
    gap: 8px;
}

.foot-legal p {
    margin: 0;
    max-width: 44rem;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.65;
}

.foot-legal a {
    color: #4a4843;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Legal pages */
.prose p {
    margin: 0 0 14px;
    line-height: 1.65;
}

.prose h2 {
    margin-top: 22px;
}

.prose h2:first-child { margin-top: 0; }

.plan-banner {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--warn-soft);
    color: #6d4c12;
    font-size: 0.92rem;
}

.plan-banner p {
    margin: 0;
}

.plan-banner a {
    color: #8a5a12;
    font-weight: 600;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(16px, 3vw, 24px);
    margin-bottom: 8px;
}

.plan-card {
    background: var(--lift);
    border-radius: var(--radius);
    padding: clamp(20px, 3vw, 28px);
    display: grid;
    gap: 14px;
    align-content: start;
}

.plan-card--featured {
    background: #181816;
    color: #f5f4f1;
}

.plan-card-label {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 600;
}

.plan-card-price {
    margin: 0;
    font-size: 1.05rem;
    color: var(--muted);
}

.plan-card--featured .plan-card-price {
    color: #b8b4ad;
}

.plan-card-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
    font-size: 0.95rem;
}

.plan-card-list li::before {
    content: "";
    display: inline-block;
    width: 0.42rem;
    height: 0.72rem;
    margin: 0 0.55rem 0 0.12rem;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(45deg) translateY(-0.08rem);
}

.plan-card--featured .plan-card-list li::before {
    border-color: #7fd4b3;
}

.plan-current p {
    margin: 0 0 10px;
}

.plan-usage {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.94rem;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

@media (max-width: 900px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .stat-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .stat:nth-child(odd),
    .stat:nth-child(even),
    .stat:nth-child(n + 3),
    .stat + .stat {
        border-left: 0;
        border-top: 0;
    }

    .home,
    .auth-layout,
    .grid-2,
    .grid-3,
    .form-grid { grid-template-columns: 1fr; }

    .home {
        min-height: auto;
    }

    body.is-app .grid.grid-2 > * + * {
        margin-top: 32px;
        padding-top: 0;
        border-top: 0;
    }

    body.is-app .grid.grid-2 > *:first-child,
    body.is-app .grid.grid-2 > *:last-child {
        padding-left: 0;
        padding-right: 0;
        border-right: 0;
    }

    :root {
        --header-h: var(--header-h-mobile);
    }

    .top-inner {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "brand burger"
            "nav nav";
        align-items: center;
        gap: 0;
        min-height: var(--header-h-mobile);
        padding-block: 8px;
    }

    .brand {
        grid-area: brand;
    }

    .nav-burger {
        display: inline-flex;
        grid-area: burger;
        justify-self: end;
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 59;
        border: 0;
        background: rgba(20, 20, 19, 0.28);
        backdrop-filter: blur(6px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease;
        cursor: pointer;
    }

    body.nav-open .nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    html,
    body {
        overflow-x: clip;
    }

    body.nav-open {
        overflow: hidden;
    }

    .nav {
        grid-area: nav;
        position: fixed;
        top: calc(var(--header-h-mobile) + max(10px, env(safe-area-inset-top)));
        left: max(var(--pad), env(safe-area-inset-left));
        right: max(var(--pad), env(safe-area-inset-right));
        z-index: 60;
        width: auto;
        max-height: calc(100dvh - var(--header-h-mobile) - 28px);
        margin: 0;
        padding: 12px;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 10px;
        background: color-mix(in srgb, var(--lift) 94%, transparent);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-radius: var(--radius);
        overflow-y: auto;
        opacity: 0;
        transform: translate3d(0, -10px, 0) scale(0.98);
        transform-origin: top center;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
        -webkit-overflow-scrolling: touch;
    }

    body.nav-open .nav {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s;
    }

    body.is-app .nav,
    body.is-guest .nav {
        flex: none;
        justify-content: flex-start;
    }

    .nav-main,
    .nav-main--guest {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        width: 100%;
        overflow: visible;
        mask-image: none;
        -webkit-mask-image: none;
        max-width: none;
        flex-wrap: nowrap;
    }

    .nav-meta {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        width: 100%;
        margin: 8px 0 0;
        padding: 12px 0 0;
        border-top: 0;
        border-left: 0;
        flex-shrink: 1;
    }

    .nav a,
    .nav button,
    body.is-app .nav a,
    body.is-app .nav button,
    body.is-app .nav-meta a,
    body.is-app .nav-meta button {
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 48px;
        padding: 12px 14px;
        font-size: 1rem;
        white-space: normal;
        border-radius: 12px;
        box-shadow: none;
    }

    .nav a.is-active {
        background: var(--accent-soft);
        color: #145a42;
        font-weight: 600;
        box-shadow: none;
        border-radius: 12px;
    }

    .nav a.nav-cta {
        justify-content: center;
        margin-top: 4px;
    }

    .nav-meta form {
        width: 100%;
    }

    .nav-meta button {
        justify-content: flex-start;
        color: var(--muted);
    }

    .board-hint {
        display: block;
    }

    .board-wrap::after {
        content: "";
        position: absolute;
        top: 28px;
        right: 0;
        bottom: 12px;
        width: 28px;
        pointer-events: none;
        background: linear-gradient(90deg, transparent, var(--lift));
    }

    .board {
        -webkit-overflow-scrolling: touch;
    }

    .actions .btn,
    .form-actions .btn,
    .page-tools .btn {
        flex: 1 1 calc(50% - 5px);
        min-width: 9.5rem;
    }

    .actions .btn:only-child,
    .form-actions .btn:only-child,
    .page-tools .btn:only-child {
        flex-basis: 100%;
    }

    .record-actions-row .btn {
        flex: 1 1 auto;
    }

    .foot-top {
        flex-direction: column;
        gap: 16px;
    }

    .foot-nav ul {
        gap: 10px 14px;
    }
}

@media (max-width: 768px) {
    input,
    select,
    textarea {
        font-size: 16px;
    }

    h1,
    .hero-title {
        font-size: clamp(1.75rem, 7vw, 2.35rem);
    }

    .lead {
        font-size: 1rem;
    }

    .page-head {
        margin-bottom: 22px;
    }

    .stat {
        min-height: 76px;
        padding: 16px;
    }

    .stat-value {
        font-size: clamp(1.45rem, 6vw, 1.75rem);
    }

    th,
    td {
        padding: 12px 10px;
    }

    .board table {
        min-width: 720px;
    }

    .board thead th:first-child,
    .board tbody th {
        min-width: 128px;
    }

    .slot {
        min-width: 54px;
        min-height: 42px;
    }

    a.slot.busy {
        font-size: 0.72rem;
    }

    .plan-banner {
        font-size: 0.88rem;
    }

    .landing-cta .actions .btn,
    .home .actions .btn {
        flex: 1 1 100%;
    }
}

@media (max-width: 560px) {
    :root {
        --pad: 16px;
    }

    .grid-4 { grid-template-columns: 1fr; }

    .stat-strip { grid-template-columns: 1fr; }

    .stat,
    .stat:nth-child(even) {
        border-left: 0;
    }

    .stat + .stat {
        border-top: 0;
    }

    .hero-grid { grid-template-columns: 1fr; }

    .pricing-grid { grid-template-columns: 1fr; }

    .feature-grid { grid-template-columns: 1fr; }

    .actions,
    .form-actions,
    .page-tools,
    .record-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .actions .btn,
    .form-actions .btn,
    .page-tools .btn,
    .record-actions-row .btn {
        width: 100%;
        flex: 1 1 auto;
    }

    .table-actions {
        white-space: normal;
    }

    .table-actions .btn {
        width: 100%;
        margin: 0 0 8px !important;
    }

    .faq-item summary {
        padding: 14px 0;
    }

    .faq-item h3 {
        font-size: 0.95rem;
        line-height: 1.45;
    }

    .board table {
        min-width: 640px;
    }

    .panel,
    .card,
    .record,
    body.is-app .board,
    body.is-app .stat-strip,
    body.is-guest .auth-layout .panel,
    .prose.panel {
        padding: 16px;
    }

    .board {
        padding: 10px 8px 12px;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .nav {
        width: min(72vw, 300px);
        padding-top: calc(var(--header-h-mobile) + 8px);
    }
}

@media (min-width: 901px) {
    .nav-burger,
    .nav-backdrop {
        display: none;
    }

    .top-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        min-height: var(--header-h);
        padding-block: 0;
    }
}

.breadcrumbs {
    margin: 0 0 18px;
    font-size: 0.92rem;
    color: var(--muted);
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumbs li:not(:last-child)::after {
    content: "›";
    margin-left: 8px;
    color: var(--muted);
}

.landing-section {
    margin-top: clamp(36px, 6vw, 56px);
}

.section-lead {
    max-width: 52ch;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.feature-card {
    padding: 24px;
    border-radius: var(--radius);
    background: var(--lift);
}

.feature-card h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.feature-card p {
    margin: 0;
    color: var(--muted);
}

.landing-list {
    margin: 0 0 16px;
    padding-left: 1.2rem;
}

.landing-list li + li {
    margin-top: 8px;
}

.faq-list {
    display: grid;
    gap: 12px;
}

.faq-item {
    border-radius: var(--radius);
    background: var(--lift);
    padding: 0 20px;
}

.faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 0;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item h3 {
    display: inline;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.faq-item p {
    margin: 0 0 16px;
    color: var(--muted);
}

.landing-cta {
    margin-top: clamp(40px, 6vw, 64px);
    padding: clamp(28px, 5vw, 40px);
    border-radius: var(--radius);
    background: var(--lift);
}

.landing-cta h2 {
    margin-top: 0;
}

@media (min-width: 901px) {
    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mobile-dock,
    body.is-app.has-mobile-dock .mobile-dock {
        display: none !important;
    }

    .install-banner {
        display: none !important;
    }
}

/* PWA */
.network-banner,
.install-banner {
    margin-bottom: 16px;
    border-radius: 12px;
    padding: 12px 14px;
}

.network-banner {
    background: var(--warn-soft);
    color: #6d4c12;
}

.network-banner p,
.install-banner p {
    margin: 0;
}

.install-banner {
    background: var(--accent-soft);
    color: #145a42;
}

.install-banner-inner {
    display: grid;
    gap: 12px;
}

.install-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

body.is-app {
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-dock {
    display: none;
}

.mobile-dock-link,
.mobile-dock-cta,
.mobile-dock-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 52px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    padding: 6px 4px;
    cursor: pointer;
}

.mobile-dock-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
}

.mobile-dock-icon svg {
    display: block;
    width: 22px;
    height: 22px;
}

.mobile-dock-link.is-active {
    color: var(--accent);
}

.mobile-dock-link.is-active .mobile-dock-icon {
    background: var(--accent-soft);
    border-radius: 8px;
}

.mobile-dock-cta {
    width: 52px;
    height: 52px;
    margin: 0 auto;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    transform: translateY(-8px);
}

.mobile-dock-cta svg {
    width: 24px;
    height: 24px;
    display: block;
}

.mobile-dock-cta:hover {
    color: #fff;
    background: var(--accent-hover);
}

.offline-snapshot-note {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--warn-soft);
    color: #6d4c12;
    font-size: 0.9rem;
}

.offline-page .offline-shell {
    width: min(32rem, 100%);
    margin: 0 auto;
    padding: clamp(28px, 6vw, 48px) 0;
}

.offline-preview {
    margin-top: 24px;
    padding: 18px;
    border-radius: var(--radius);
    background: var(--lift);
}

@media (max-width: 900px) {
    body.is-app.has-mobile-dock {
        padding-bottom: 0;
    }

    body.is-app.has-mobile-dock main {
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }

    body.is-app.has-mobile-dock .foot {
        padding-bottom: calc(88px + env(safe-area-inset-bottom));
    }

    body.is-app.has-mobile-dock .mobile-dock {
        display: grid;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 55;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
        align-items: end;
        padding: 8px max(var(--pad), env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-right));
        background: color-mix(in srgb, var(--bg) 92%, transparent);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }
}

@media (display-mode: standalone) {
    body.is-app .top {
        padding-top: env(safe-area-inset-top);
    }

    .install-banner {
        display: none !important;
    }
}
