:root {
    --bg: #f6f5f3;
    --card: #ffffff;
    --ink: #2b2b2b;
    --muted: #6b6b6b;
    --accent: #b5651d;     /* warm terracotta — handmade feel */
    --accent-dark: #934f15;
    --border: #e3ded7;
    --good: #2e7d32;
    --bad: #c0392b;
    --radius: 10px;
    --btn-height: 2.5rem;       /* shared button height across all pages */
    --btn-height-small: 2rem;   /* compact inline actions */
    --btn-height-large: 3rem;   /* prominent CTAs */
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
}

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

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.topbar .brand {
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
}

.topbar .brand-logo {
    height: 38px;
    width: auto;
    display: block;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar nav a { text-decoration: none; color: var(--ink); }
.topbar nav a:hover { color: var(--accent); }
.topbar .who { color: var(--muted); font-size: 0.9rem; }

/* Free-tier usage counter */
.usage-counter {
    display: inline-flex;
    align-items: baseline;
    gap: 0.15rem;
    font-size: 0.85rem;
    color: var(--muted) !important;
    background: #f0ece6;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    text-decoration: none;
    white-space: nowrap;
}
.usage-counter strong { color: var(--ink); }
.usage-counter:hover { border-color: var(--accent); }
.usage-counter.is-full { background: #fdecea; border-color: #f5c6c0; }
.usage-counter.is-full strong { color: var(--bad); }

/* Hamburger dropdown menu */
.menu { position: relative; }
.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}
.menu-toggle:hover { border-color: var(--accent); }
.menu-bars, .menu-bars::before, .menu-bars::after {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    position: relative;
}
.menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; }
.menu-bars::before { top: -6px; }
.menu-bars::after  { top: 6px; }

.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 200px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
    padding: 0.4rem;
    display: none;
    z-index: 50;
}
.menu.open .menu-panel { display: block; }
.menu-panel a {
    display: block;
    padding: 0.55rem 0.7rem;
    border-radius: 6px;
    color: var(--ink) !important;
    text-decoration: none;
    font-size: 0.95rem;
}
.menu-panel a:hover { background: #f6f1ea; color: var(--accent) !important; }
.menu-sep { height: 1px; background: var(--border); margin: 0.4rem 0; }
.menu-who {
    display: block;
    padding: 0.2rem 0.7rem;
    color: var(--muted);
    font-size: 0.8rem;
    word-break: break-all;
}

/* Shared button geometry: a fixed height + vertical centering so every button
   renders at the same height regardless of padding, font-size or border width.
   Variants below only set colours, borders and horizontal padding. */
.btn-link, .btn, .btn-secondary, .btn-outline, .btn-downgrade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--btn-height);
}

.btn-link, .btn {
    background: var(--accent);
    color: #fff !important;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius);
    border: none;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
}
.btn-link:hover, .btn:hover { background: var(--accent-dark); }
.btn-block { display: flex; width: 100%; }
.btn-small { min-height: var(--btn-height-small); padding: 0.3rem 0.6rem; font-size: 0.85rem; }
.btn-danger { background: #b00020; }
.btn-danger:hover { background: #8a0019; }
/* Annual-upgrade upsell — solid "savings" green so it reads as a deal and stands
   out beside the neutral Manage-plan button. Used as `.btn .btn-annual`. */
.btn-annual { background: #2e7d5b; box-shadow: 0 1px 4px rgba(46,125,91,0.35); }
.btn-annual:hover { background: #276a4d; }
.btn:disabled, .btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

.container {
    max-width: 760px;
    margin: 2rem auto;
    padding: 0 1.25rem;
}

/* Wider shell for data-heavy pages (e.g. the pop-up planner's product grid). */
.container-wide {
    max-width: 1080px;
    margin: 2rem auto;
    padding: 0 1.25rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

h1 { font-size: 1.6rem; margin-top: 0; }
h2 { font-size: 1.2rem; }
.muted { color: var(--muted); }

label { display: block; font-weight: 600; margin: 0.9rem 0 0.3rem; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.85rem; }

/* Password strength meter on the sign-up form. */
.pw-strength { margin: 0.4rem 0 0.2rem; }
.pw-strength-bar {
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}
.pw-strength-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.2s ease, background-color 0.2s ease;
    background: var(--bad);
}
.pw-strength-text { margin: 0.25rem 0 0; color: var(--muted); }
.pw-strength.weak   .pw-strength-bar span { background: var(--bad); }
.pw-strength.fair   .pw-strength-bar span { background: #e0a106; }
.pw-strength.good   .pw-strength-bar span { background: #7aa53a; }
.pw-strength.strong .pw-strength-bar span { background: var(--good); }

/* Inline "ⓘ" help marker; the explanation lives in its title tooltip. */
.help-tip {
    display: inline-block;
    width: 1.1em; height: 1.1em; line-height: 1.1em;
    text-align: center;
    border-radius: 50%;
    background: var(--muted); color: #fff;
    font-size: 0.72rem; font-weight: 700; font-style: normal;
    cursor: help; vertical-align: middle;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    line-height: 1.5;
    min-height: 2.8rem;
    background: #fff;
}

/* Match selects to the text inputs: drop the native chrome and use a flat
   chevron so the dropdown reads like a textbox. */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.2rem;
    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 fill='none' stroke='%23736b5e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    cursor: pointer;
}

textarea { resize: vertical; min-height: 5rem; line-height: 1.5; }

/* Hide the native up/down spinner arrows on number inputs everywhere. */
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;
}

.input-group { display: flex; align-items: center; }
.input-group input { border-radius: var(--radius) 0 0 var(--radius); }
/* An input flanked by both a prefix and a suffix keeps square inner corners. */
.input-group .prefix + input { border-radius: 0; }
.input-group .suffix {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    background: #f0ece6;
    color: var(--muted);
}
.input-group .prefix {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    background: #f0ece6;
    color: var(--muted);
}

/* Money inputs: a muted currency symbol overlaid at the input's left edge.
   Wrap the <input> in <span class="money-input"> with a leading
   <span class="money-sym">SYMBOL</span>. The overlay doesn't affect layout,
   so it works in both form rows and the itemized-table cells. */
.money-input { position: relative; display: block; }
.money-input > input { padding-left: 1.7rem; }
.money-input > .money-sym {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    line-height: 1;
}

.section-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 1.75rem 0 0;
}

.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > .col { flex: 1 1 180px; }
/* Reserve a consistent label height so single- and double-line labels in the
   same row leave their inputs aligned. The tighter line-height keeps two lines
   comfortably inside the reserved space (avoids Safari sub-pixel overflow that
   would push an input below its row-mates). Harmless when columns stack on
   mobile. */
.row > .col > label { min-height: 3rem; line-height: 1.3; }

/* Manage stores / product types actions below the products filters. */
.manage-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

/* Card title row: heading left, a primary action button top-right. */
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.card-head h1, .card-head h2 { margin: 0; }
/* A group of buttons that sits together on the right of a .card-head. */
.card-head-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid transparent;
}
.alert-error   { background: #fdecea; color: var(--bad);  border-color: #f5c6c0; }
.alert-success { background: #e8f5e9; color: var(--good); border-color: #c3e6c5; }
.alert-info    { background: #eef4fb; color: #1f5d99;      border-color: #cfe0f1; }

table.breakdown { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
table.breakdown td { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
table.breakdown td.amount { text-align: right; font-variant-numeric: tabular-nums; }
table.breakdown tr.total td { font-weight: 700; border-bottom: none; }
table.breakdown tr.final td { font-size: 1.25rem; color: var(--accent-dark); font-weight: 700; }
/* Roll-up rows (e.g. "Product materials", "Base materials") that sum the
   itemized lines above them — tinted + bolder so the subtotal reads as a
   subtotal, not just another line item. */
table.breakdown tr.subtotal td { font-weight: 600; background: #fbf8f2; border-top: 1px solid var(--border); }
table.breakdown tr.subtotal td:first-child { padding-left: 0.5rem; }
table.breakdown tr.subtotal td.amount { padding-right: 0.5rem; }

/* Feedback submissions list on the profile page — a real data table that
   needs column separation, unlike the pricing breakdowns above. */
table.feedback-table th {
    text-align: left;
    padding: 0.5rem 1.5rem 0.5rem 0;
    border-bottom: 2px solid var(--border);
    color: var(--accent-dark);
    white-space: nowrap;
}
table.feedback-table td {
    padding: 0.75rem 1.5rem 0.75rem 0;
    vertical-align: top;
}
table.feedback-table th:last-child,
table.feedback-table td:last-child { padding-right: 0; }
table.feedback-table td.nowrap { white-space: nowrap; }
table.feedback-table td.feedback-col { width: 100%; }

/* Admin feedback: each submission spans two rows — meta (when/from/type)
   on top, then the message + action button below at full width, so nothing
   is squeezed into a narrow column. */
table.feedback-stacked { table-layout: fixed; }
table.feedback-stacked td { padding: 0.15rem 1.5rem 0.15rem 0; border-bottom: none; }
table.feedback-stacked tr.meta-row td { padding-top: 1.25rem; }
table.feedback-stacked tr.content-row td { padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
table.feedback-stacked tr:last-child td { border-bottom: none; }
table.feedback-stacked .col-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted, #667);
    margin-bottom: 0.15rem;
}
table.feedback-stacked td.action-cell { text-align: right; vertical-align: bottom; white-space: nowrap; }

/* Admin data grid — multi-column tables of accounts/records */
table.data-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
table.data-table th,
table.data-table td { padding: 0.6rem 0.75rem; text-align: left; vertical-align: middle; }
table.data-table th {
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--muted, #667);
    white-space: nowrap;
}
table.data-table td { border-bottom: 1px solid var(--border); }
table.data-table tbody tr:hover { background: rgba(0, 0, 0, 0.02); }
table.data-table th:first-child,
table.data-table td:first-child { padding-left: 0; }
table.data-table th:last-child,
table.data-table td:last-child { padding-right: 0; }
/* The tier picker must fit its label ("Business") plus the chevron, so it
   sizes to content instead of collapsing to the narrow Tier column width. */
table.data-table select { width: auto; min-width: 8.5rem; }

/* Itemized materials table */
table.items { width: 100%; border-collapse: collapse; margin-top: 0.4rem; }
table.items th {
    text-align: left;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
    padding: 0 0.4rem 0.3rem;
}
table.items th.num, table.items td.num { text-align: right; }
table.items td { padding: 0.25rem 0.4rem; vertical-align: middle; }
table.items td:first-child { padding-left: 0; }
table.items input,
table.items select { padding: 0.45rem 1.8rem 0.45rem 0.55rem; font-size: 0.95rem; min-height: 2.5rem; }
table.items td.num input { text-align: right; }
table.items .m-pack-price,
table.items .m-pack-qty,
table.items .m-used { max-width: 90px; }
/* Auto table layout would otherwise shrink the Billing column below its
   longest option ("per month") and clip the label behind the chevron. */
table.items select.fee-period { min-width: 7.2rem; }
table.items td.unit-cost,
table.items td.line-total { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.items tfoot td { padding-top: 0.6rem; border-top: 1px solid var(--border); }
table.items #materials-subtotal { font-variant-numeric: tabular-nums; }

.row-remove {
    border: none;
    background: transparent;
    color: var(--bad);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.3rem;
}
.row-remove:hover { color: #8c241a; }

.link-danger {
    border: none;
    background: transparent;
    color: var(--bad);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 0 0 0.6rem;
    text-decoration: underline;
}
.link-danger:hover { color: #8c241a; }

/* A <button> that reads like an inline text link (matches the "small" links). */
.link-button {
    border: none;
    background: transparent;
    color: var(--accent-dark);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 0 0 0.6rem;
    text-decoration: underline;
}
.link-button:hover { color: var(--accent); }

.btn-secondary {
    margin-top: 0.5rem;
    background: transparent;
    color: var(--accent-dark);
    border: 1px dashed var(--accent);
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
}
.btn-secondary:hover { background: #faf3ea; }

/* Cautionary-but-reversible action (e.g. Deactivate account): clearly visible
   with a solid neutral border, distinct from the red Delete and accent CTAs. */
.btn-outline {
    margin-top: 0.5rem;
    background: #fff;
    color: var(--ink);
    border: 1.5px solid var(--muted);
    border-radius: var(--radius);
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-outline:hover { background: #f2ede6; border-color: var(--ink); }

/* Back navigation (e.g. "← All products" above a page title) */
.back-link {
    display: inline-block;
    margin-bottom: 0.6rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}
.back-link:hover { color: var(--accent-dark); }

/* Page-title row with actions sitting beside the title */
.product-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.product-header h1 { margin: 0; }
.product-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Detailed pricing view */
.section-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin: 1.4rem 0 0.3rem;
}
table.breakdown tr.profit-row td {
    color: var(--good);
    font-weight: 700;
}
.price-highlight {
    margin: 1.25rem 0;
    padding: 1.1rem 1.25rem;
    background: #fbf3ea;
    border: 1px solid var(--accent);
    border-left-width: 5px;
    border-radius: var(--radius);
}
.price-highlight .ph-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent-dark);
    font-weight: 700;
}
.price-highlight .ph-amount {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--accent-dark);
    line-height: 1.1;
    margin: 0.1rem 0 0.4rem;
    font-variant-numeric: tabular-nums;
}
.price-highlight .ph-sub { margin-top: 0.2rem; }

.base-include {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f6f1ea;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin: 0;
}
.checkbox-row input[type="checkbox"],
.checkbox-row input[type="radio"] { width: auto; }
.base-include .hint { display: block; margin-top: 0.3rem; }
/* A checkbox row paired with a small "Manage" link, kept on one line. */
.checkbox-line { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

/* A horizontal radio group (e.g. a product type's poured material choice). */
.radio-row { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 0.45rem; }

/* A wrapping grid of checkbox labels (e.g. product categories). */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.4rem 1rem;
}
.checkbox-grid .checkbox-row { font-weight: 400; }

/* Small inline category tags shown on the products list / product page. */
.tag {
    display: inline-block;
    background: #f0ece6;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.05rem 0.55rem;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.5;
    white-space: nowrap;
}

/* Plan comparison cards */
.plans { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.5rem; }
.plan {
    flex: 1 1 180px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    background: #fff;
}
.plan-current { border-color: var(--accent); border-width: 2px; background: #fbf3ea; }
.plan-featured { border-color: var(--accent); border-width: 2px; box-shadow: var(--shadow, 0 2px 10px rgba(0,0,0,0.06)); }
.plan-chosen { border-color: var(--accent); border-width: 2px; box-shadow: 0 0 0 3px rgba(198,124,78,0.25); }
.plan-cta { display: block; text-align: center; margin-top: 0.7rem; }
.pricing-lede { max-width: 54ch; margin: 0 auto 1.2rem; }
.pricing-toggle { display: flex; justify-content: center; }
.plan-name { font-weight: 700; font-size: 1.05rem; }
.plan-price { font-size: 1.1rem; color: var(--accent); margin: 0.15rem 0 0.2rem; }
.plan-features { list-style: none; padding: 0; margin: 0.6rem 0; font-size: 0.9rem; }
.plan-features li { padding: 0.2rem 0; border-bottom: 1px solid var(--border); }
.plan-features li:last-child { border-bottom: none; }
.plan-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}
.plan-soon { font-style: italic; }
/* Downgrade-to-Free: a clearly-visible outlined button on the Free plan card,
   distinct from the solid Subscribe CTAs (it demotes, it doesn't upsell). */
.btn-downgrade {
    width: 100%;
    margin-top: 0.5rem;
    background: #fff;
    color: var(--accent-dark);
    border: 1.5px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-downgrade:hover { background: var(--accent); color: #fff; }
.plan-savings { color: #2e7d32; font-weight: 600; margin: 0 0 0.2rem; }

/* Monthly/Annual billing toggle */
.interval-toggle { display: inline-flex; gap: 1rem; margin: 0.25rem 0 1rem; flex-wrap: wrap; }
.interval-toggle label { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }

/* Paywall lead — opens an upgrade prompt with the loss, not the feature. */
.paywall-loss {
    margin: 0.25rem 0 1rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--accent);
    background: #fbf3ea;
    border-radius: var(--radius);
    color: var(--ink, #333);
}
.paywall-loss strong { color: var(--accent-dark, var(--accent)); }

/* Founding Maker rate-lock offer + badge. */
.founder-callout {
    margin: 0.25rem 0 1rem;
    padding: 0.9rem 1rem;
    border: 1.5px solid var(--accent);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fbf3ea 0%, #fff 100%);
}
.founder-callout p { margin: 0.4rem 0 0; }
.founder-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

/* Admin: Founding Maker spots gauge. */
.founder-stats { margin: 0.2rem 0; }
.founder-stats .pill {
    display: inline-block;
    margin-left: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    color: #fff;
    vertical-align: middle;
}
.founder-stats .pill-open { background: #2e7d32; }
.founder-stats .pill-closed { background: #8a6d3b; }
.founder-bar {
    height: 0.6rem;
    max-width: 420px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}
.founder-bar span { display: block; height: 100%; background: var(--accent); }

/* Free-tier lock affordances */
.lock-badge { font-weight: 700; }
.row-locked td { opacity: 0.7; }

/* In-app invoices (billing history) */
.invoices .inv-status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: #eee;
    color: #555;
}
.invoices .inv-paid { background: #e6f4ea; color: #1e7e34; }
.invoices .inv-open { background: #fff4e5; color: #a15c00; }
.invoices .inv-void, .invoices .inv-uncollectible { background: #fdecea; color: #b00020; }

.actions { margin-top: 1.25rem; }
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}
.pagination .is-disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}
.center { text-align: center; }
.small { font-size: 0.9rem; }

/* ------------------------------------------------------------------ *
 *  Landing page (signed-out home)                                     *
 * ------------------------------------------------------------------ */
.hero {
    background: linear-gradient(180deg, #fbf3ea 0%, var(--card) 100%);
    border-color: var(--accent);
    padding: 2.5rem 1.75rem;
}
.hero-eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-dark);
    background: #f4e7d6;
    border-radius: 999px;
    padding: 0.25rem 0.85rem;
    margin-bottom: 0.9rem;
}
.hero h1 { font-size: 2.1rem; line-height: 1.15; margin-bottom: 0.6rem; }
.hero-lede {
    max-width: 36rem;
    margin: 0 auto;
    font-size: 1.1rem;
    color: var(--muted);
}
.hero-actions { display: flex; align-items: center; justify-content: center; gap: 1.25rem; flex-wrap: wrap; }
.hero-login { font-weight: 600; }
.hero-reassure { margin-top: 0.9rem; }
.btn-lg { min-height: var(--btn-height-large); padding: 0.7rem 1.4rem; font-size: 1.05rem; font-weight: 600; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.feature {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem; height: 2.6rem;
    font-size: 1.4rem;
    background: #fbf3ea;
    border: 1px solid var(--border);
    border-radius: 50%;
    margin-bottom: 0.6rem;
}
.feature h3 { font-size: 1.05rem; margin: 0 0 0.35rem; }
.feature p { margin: 0; font-size: 0.92rem; }

.hero-cta { background: linear-gradient(180deg, var(--card) 0%, #fbf3ea 100%); }
.hero-cta h2 { margin-top: 0; }

/* Section headings between landing blocks */
.section-heading { font-size: 1.5rem; margin: 2rem 0 1.25rem; }

/* Product visual */
.hero-shot { text-align: center; margin: 0 0 1.75rem; }
.hero-shot img {
    width: 100%;
    max-width: 620px;
    height: auto;
    border-radius: var(--radius);
    box-shadow: 0 14px 34px rgba(80, 50, 20, 0.13);
}
.hero-shot figcaption { margin-top: 0.85rem; }

/* How it works */
.how { padding: 2rem 1.75rem; }
.how h2 { margin-top: 0; }
.how-sub { max-width: 34rem; margin: 0 auto 1.75rem; }
.how-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    text-align: left;
}
.how-step h3 { font-size: 1.05rem; margin: 0.75rem 0 0.35rem; }
.how-step p { margin: 0; font-size: 0.92rem; }
.how-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem; height: 2.4rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    border-radius: 50%;
}

/* Feature "Premium" tags */
.plan-tag {
    display: inline-block;
    vertical-align: middle;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-dark);
    background: #f4e7d6;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    margin-left: 0.35rem;
}

/* Testimonials */
.testimonials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.quote {
    margin: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.quote blockquote { margin: 0 0 0.75rem; font-size: 0.98rem; line-height: 1.5; }
.quote figcaption { font-size: 0.85rem; font-weight: 600; color: var(--muted); }

@media (max-width: 600px) {
    .hero { padding: 1.75rem 1.15rem; }
    .hero h1 { font-size: 1.7rem; }
    .hero-lede { font-size: 1rem; }
    .section-heading { font-size: 1.3rem; }
}

.site-footer { text-align: center; color: var(--muted); padding: 2rem 0; }
.site-footer-links { display: block; margin-top: 0.4rem; }
.site-footer-links a { color: var(--muted); }

/* ------------------------------------------------------------------ *
 *  Materials inventory                                                *
 * ------------------------------------------------------------------ */
.stock-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.stock-low { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.stock-out { background: #fdecea; color: var(--bad); border: 1px solid #f5c6c0; }
.text-low  { color: #856404; }
.text-out  { color: var(--bad); }

.unit-cost-display {
    display: flex;
    align-items: center;
    height: calc(2rem + 2px);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--accent-dark);
    padding: 0 0.2rem;
}

.inventory-stat {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.9rem;
    flex: 0 1 auto;
}
.inventory-stat strong { font-size: 1.4rem; }

/* Analytics / Reports page */
.report-stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    flex: 1 1 160px;
}
.report-stat-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.report-stat-value { font-size: 1.4rem; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ *
 *  Pop-up shop planner                                                *
 * ------------------------------------------------------------------ */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.popup-table { width: 100%; border-collapse: collapse; }
table.popup-table th {
    text-align: left;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
    padding: 0 0.5rem 0.3rem;
    white-space: nowrap;
}
table.popup-table th.num, table.popup-table td.num { text-align: right; }
table.popup-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
table.popup-table th:first-child, table.popup-table td:first-child { padding-left: 0; }
table.popup-table .pp-inv { width: 90px; text-align: right; padding: 0.4rem 0.5rem; min-height: 0; }
table.popup-table .pp-line { color: var(--good); font-weight: 600; }

/* Type-ahead product search */
.autocomplete { position: relative; max-width: 440px; }
.autocomplete-list {
    position: absolute;
    left: 0; right: 0;
    top: calc(100% + 2px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
    max-height: 260px;
    overflow-y: auto;
    z-index: 40;
    display: none;
}
.autocomplete-list.open { display: block; }
.autocomplete-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0.7rem;
    cursor: pointer;
}
.autocomplete-item:hover, .autocomplete-item.active { background: #f6f1ea; }
.autocomplete-item .ac-meta { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.autocomplete-empty { padding: 0.5rem 0.7rem; color: var(--muted); font-size: 0.9rem; }
/* Materials type-ahead: name on its own row, then pack price + units/pack. */
.autocomplete-item.mat-suggest { display: block; }
.mat-suggest .mat-name { display: block; }
.mat-suggest .mat-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ *
 *  Responsive / mobile                                                *
 * ------------------------------------------------------------------ */

/* Tablet & down: tighten the shell so content keeps breathing room. */
@media (max-width: 760px) {
    .container { margin: 1.25rem auto; padding: 0 1rem; }
    .card { padding: 1.15rem; }
    h1 { font-size: 1.4rem; }
    .topbar { padding: 0.75rem 1rem; gap: 0.6rem; }
    .topbar nav { gap: 0.6rem; }
    .price-highlight .ph-amount { font-size: 1.8rem; }
}

/* Phones */
@media (max-width: 600px) {
    /* Keep the brand from crowding the nav controls. */
    .topbar .brand { font-size: 1rem; }
    .topbar .brand-logo { height: 30px; }
    .usage-counter { font-size: 0.8rem; padding: 0.2rem 0.55rem; }

    .card { padding: 1rem; }
    .price-highlight { padding: 0.9rem 1rem; }

    /* Stack the two-column rows. */
    .row { gap: 0.5rem; }
    .row > .col { flex: 1 1 100%; }

    /* Plan cards stack to full width. */
    .plan { flex: 1 1 100%; }

    /* Avoid iOS zoom-on-focus (needs >=16px) for the smaller table inputs. */
    table.items input { font-size: 16px; }

    /* --- Itemized materials table -> stacked cards --- */
    table.items thead { display: none; }
    table.items, table.items tbody, table.items tfoot, table.items tr,
    table.items td { display: block; width: 100%; }

    table.items tr.material-row {
        position: relative;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 0.6rem 0.7rem;
        margin-bottom: 0.75rem;
        background: #fff;
    }

    table.items tr.material-row td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.3rem 0;
        border: none;
        text-align: right;
    }
    table.items tr.material-row td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--muted);
        text-align: left;
    }
    /* Inputs grow to fill the space the label leaves. */
    table.items tr.material-row td input {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        max-width: none;
    }
    /* Override the fixed desktop widths inside the stacked layout. */
    table.items .m-pack-price,
    table.items .m-pack-qty,
    table.items .m-used { max-width: none; }

    /* Computed (read-only) cells just show label + value. */
    table.items td.unit-cost,
    table.items td.line-total { font-weight: 600; }

    /* Remove button floats to the card's top-right corner. */
    table.items td.row-remove-cell {
        position: absolute;
        top: 0.2rem;
        right: 0.3rem;
        width: auto;
        padding: 0;
    }
    table.items td.row-remove-cell::before { content: none; }

    /* Subtotal footer reads as one labelled line. */
    table.items tfoot tr {
        display: flex;
        justify-content: space-between;
        padding-top: 0.6rem;
        border-top: 1px solid var(--border);
    }
    table.items tfoot td { padding: 0; border: none; width: auto; }
    table.items tfoot td:empty { display: none; }

    #add-material { width: 100%; text-align: center; }

    /* Generic data tables (products list, breakdowns) scroll instead of
       blowing out the viewport width. */
    .card > table.breakdown,
    .card > table.data-table { display: block; overflow-x: auto; }
}

/* Scope switcher for the Base materials page (All products + one tab per
   category). Pill tabs that wrap; the active scope is filled. */
.scope-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.75rem 0 0.25rem;
}
.scope-tab {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--ink);
    background: #fff;
}
.scope-tab:hover { border-color: var(--accent); color: var(--accent); }
.scope-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ----------------------------------------------------------------------
   Per-page help: "Need Help?" topbar link + quick start / FAQ modal
   ---------------------------------------------------------------------- */
.help-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: var(--btn-height-small);
    padding: 0 0.8rem;
    background: #f0ece6;
    border: 1px solid var(--border);
    border-radius: 999px;
    font: inherit;
    font-size: 0.85rem;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
}
.help-link:hover { border-color: var(--accent); color: var(--accent-dark); }
.help-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}
@media (max-width: 560px) {
    /* Tight topbars keep just the ? badge. */
    .help-link { padding: 0 0.55rem; }
    .help-link-text { display: none; }
}

.help-modal {
    width: min(620px, calc(100vw - 2rem));
    max-height: min(85vh, 56rem);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
    color: var(--ink);
    background: var(--card);
}
.help-modal::backdrop { background: rgba(43, 43, 43, 0.45); }
/* Head stays put; only the body scrolls. The [open] selector doubles as the
   no-<dialog> fallback (help.js toggles the attribute). */
.help-modal[open] {
    display: flex;
    flex-direction: column;
}
@supports not selector(dialog:modal) {
    .help-modal[open] {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 100;
    }
}
.help-modal-head {
    flex: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.help-kicker {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--accent);
}
.help-modal-head h2 { margin: 0.15rem 0 0; font-size: 1.15rem; }
.help-modal-close {
    flex: none;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: transparent;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
}
.help-modal-close:hover { border-color: var(--accent); color: var(--accent-dark); }
.help-modal-body {
    padding: 1rem 1.25rem 1.25rem;
    overflow-y: auto;
}
.help-intro { margin: 0 0 0.75rem; color: var(--muted); }
.help-section-title {
    margin: 1.25rem 0 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}
.help-modal-body > .help-section-title:first-child { margin-top: 0; }
.help-steps {
    margin: 0 0 0.5rem;
    padding-left: 1.4rem;
}
.help-steps li { margin-bottom: 0.5rem; }
.help-tips {
    margin: 0 0 0.5rem;
    padding-left: 1.4rem;
}
.help-tips li { margin-bottom: 0.4rem; }
.help-faq {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: #faf9f7;
}
.help-faq summary {
    padding: 0.6rem 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.help-faq summary:hover { color: var(--accent-dark); }
.help-faq[open] summary { border-bottom: 1px solid var(--border); }
.help-faq-a { padding: 0.6rem 0.8rem; }

/* First-run "Get started" guide — reuses the help-modal shell, adds a video and
   a couple of copy/CTA tweaks. */
.onboarding-modal { width: min(640px, calc(100vw - 2rem)); }
.onboarding-video {
    margin: 0 0 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
}
.onboarding-video video { display: block; width: 100%; height: 100%; }
.onboarding-lede { margin: 0 0 0.5rem; }
.onboarding-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.25rem;
}
/* .btn-secondary carries a standalone margin-top; drop it so it sits level with
   the primary CTA in this row. */
.onboarding-actions .btn-secondary { margin-top: 0; }

/* ------------------------------------------------------------------ *
 *  Release notes                                                      *
 * ------------------------------------------------------------------ */
/* Tiny footnote links (bottom of the User Profile page) */
.footnote-link {
    font-size: 0.78rem;
    color: var(--muted);
    text-decoration: none;
}
.footnote-link:hover { color: var(--accent-dark); text-decoration: underline; }
.footnote-sep {
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0 0.3rem;
}

/* One published entry: "1.0.01 - 06/10/26 - title", badges, then summary */
.release-entry { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.release-entry:last-child { border-bottom: none; padding-bottom: 0.25rem; }
.release-head { font-size: 1.02rem; margin: 0; }
.release-head .release-version { color: var(--accent-dark); }
.release-meta { margin: 0.3rem 0 0; }
.release-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    background: #eee;
    color: #555;
    margin-right: 0.25rem;
}
.rel-feature     { background: #e6f4ea; color: #1e7e34; }
.rel-enhancement { background: #e8f0fe; color: #1a56b0; }
.rel-bugfix      { background: #fff4e5; color: #a15c00; }
.rel-security    { background: #fdecea; color: #b00020; }
.rel-performance { background: #f1e8fd; color: #6a35a8; }
.rel-other       { background: #eee;    color: #555; }
.rel-level       { background: #f0ebe3; color: #6b5d4a; }
.release-summary { margin: 0.45rem 0 0; white-space: pre-wrap; }

/* ================================================================== *
 *  Marketing home (signed-out index.php)                              *
 *  Wider, more spacious layout that mirrors the pre-launch landing    *
 *  site (landing/). Everything is scoped to .home-main so the rest of *
 *  the app's narrow .container shell is untouched. Local token        *
 *  overrides (12px radius + a few landing-only colours) live here too.*
 * ================================================================== */
.home-main {
    --radius: 12px;
    --teal: #15514d;
    --tint: #fbf3ea;
    --shadow: 0 18px 48px rgba(43, 43, 43, 0.10);
}

/* Full-bleed shell: inner sections manage their own width + padding, and the
   tinted feature band runs edge to edge. */
.home-main { width: 100%; margin: 0; padding: 0; }
.home-main h1, .home-main h2, .home-main h3 { line-height: 1.15; }

/* ---- Buttons ---- */
.home-main .lp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--accent);
    color: #fff !important;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    padding: 0.6rem 1.1rem;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease;
}
.home-main .lp-btn:hover { background: var(--accent-dark); }
.home-main .lp-btn:active { transform: translateY(1px); }
.home-main .lp-btn-lg { padding: 0.85rem 1.6rem; font-size: 1.06rem; }
.home-main .lp-btn-block { width: 100%; }

/* ---- Hero ---- */
.home-main .lp-hero {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 2.5rem;
    align-items: center;
    max-width: 1080px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 3rem;
}
.home-main .lp-eyebrow {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent-dark);
    background: #f4e7d6;
    border-radius: 999px;
    padding: 0.3rem 0.9rem;
    margin-bottom: 1rem;
}
.home-main .lp-hero h1 {
    font-size: 2.6rem;
    margin: 0 0 0.8rem;
    letter-spacing: -0.01em;
}
.home-main .lp-lede {
    font-size: 1.16rem;
    color: var(--muted);
    margin: 0 0 1.6rem;
    max-width: 34rem;
}
.home-main .lp-hero-form { display: flex; flex-direction: column; align-items: flex-start; gap: 0.7rem; }
.home-main .lp-hero-reassure { font-size: 0.9rem; color: var(--muted); }
.home-main .hero-login { font-weight: 600; font-size: 0.95rem; }

/* ---- Hero demo frame (browser-chrome around the preview image) ---- */
.home-main .lp-hero-demo { width: 100%; }
.home-main .lp-demo-frame {
    margin: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.home-main .lp-demo-chrome {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.85rem;
    background: #f0ece6;
    border-bottom: 1px solid var(--border);
}
.home-main .lp-dot { width: 10px; height: 10px; border-radius: 50%; background: #d6cfc4; display: inline-block; }
.home-main .lp-demo-url {
    margin-left: 0.5rem;
    font-size: 0.78rem;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.12rem 0.7rem;
}
.home-main .lp-demo-video { display: block; width: 100%; height: auto; }

/* ---- Sections ---- */
.home-main .lp-section {
    max-width: 1080px;
    margin: 0 auto;
    padding: 3.2rem 1.5rem;
}
.home-main .lp-section-tint {
    max-width: none;
    background: var(--tint);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.home-main .lp-section-tint > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.home-main .lp-section-title {
    font-size: 1.85rem;
    margin: 0 auto 0.5rem;
    text-align: center;
}
.home-main .lp-section-sub {
    text-align: center;
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 40rem;
    margin: 0 auto 2rem;
}

/* ---- Benefits / "how it works" checklist ---- */
.home-main .lp-benefits {
    list-style: none;
    padding: 0;
    margin: 1.5rem auto 0;
    max-width: 880px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem 2.4rem;
}
.home-main .lp-benefits li { display: flex; gap: 0.8rem; align-items: flex-start; }
.home-main .lp-benefit-mark {
    flex: none;
    width: 1.7rem; height: 1.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 0.1rem;
}
.home-main .lp-benefits strong { display: block; margin-bottom: 0.15rem; }

/* ---- Feature cards ---- */
.home-main .lp-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
}
.home-main .lp-feature {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
}
.home-main .lp-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem; height: 2.8rem;
    font-size: 1.5rem;
    background: var(--tint);
    border: 1px solid var(--border);
    border-radius: 50%;
    margin-bottom: 0.7rem;
}
.home-main .lp-feature h3 { font-size: 1.08rem; margin: 0 0 0.35rem; }
.home-main .lp-feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---- Pricing cards ---- */
.home-main .lp-plans {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    align-items: stretch;
}
.home-main .lp-plan {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.2rem;
    display: flex;
    flex-direction: column;
}
.home-main .lp-plan-featured {
    border-color: var(--accent);
    border-width: 2px;
    box-shadow: var(--shadow);
}
.home-main .lp-plan-badge {
    position: absolute;
    top: -0.7rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    white-space: nowrap;
}
.home-main .lp-plan-name { font-weight: 700; font-size: 1.15rem; }
.home-main .lp-plan-price {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--accent-dark);
    margin: 0.2rem 0 0.1rem;
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}
.home-main .lp-plan-amount { line-height: 1; }
.home-main .lp-plan-cadence { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.home-main .lp-plan-savings { color: var(--good); font-weight: 700; font-size: 0.8rem; margin: 0 0 0.4rem; }
.home-main .lp-plan-features { list-style: none; padding: 0; margin: 0.6rem 0 1rem; font-size: 0.9rem; }
.home-main .lp-plan-features li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.home-main .lp-plan-features li:last-child { border-bottom: none; }
.home-main .lp-plan-features li::before { content: "✓ "; color: var(--good); font-weight: 700; }
.home-main .lp-plan-cta { margin-top: auto; }
.home-main .lp-plans-foot { text-align: center; color: var(--muted); font-size: 0.86rem; margin-top: 1.4rem; }

/* ---- Monthly/Annual toggle (defaults to Annual) ---- */
.home-main .lp-interval-toggle {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin: 0 0 1.6rem;
    flex-wrap: wrap;
}
.home-main .lp-interval-toggle label { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; font-weight: 600; }
.home-main .lp-interval-note {
    background: var(--good);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

/* ---- Testimonials (reuses .testimonials/.quote, just widens the grid) ---- */
.home-main .testimonials { margin-bottom: 0; }

/* ---- Closing CTA card ---- */
.home-main .lp-cta-section {
    background: radial-gradient(120% 120% at 50% 0%, var(--tint) 0%, var(--bg) 70%);
    max-width: none;
}
.home-main .lp-cta-card {
    max-width: 560px;
    margin: 0 auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 2.2rem 2rem;
    text-align: center;
}
.home-main .lp-cta-card h2 { font-size: 1.7rem; margin: 0.3rem 0 0.5rem; }
.home-main .lp-cta-sub { color: var(--muted); margin: 0 0 1.5rem; }
.home-main .lp-cta-card .lp-btn { margin-top: 0.2rem; }
.home-main .lp-cta-fine { text-align: center; color: var(--muted); font-size: 0.8rem; margin: 0.8rem 0 0; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .home-main .lp-hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 2.5rem; }
    .home-main .lp-hero h1 { font-size: 2.15rem; }
    .home-main .lp-features { grid-template-columns: repeat(2, 1fr); }
    .home-main .lp-plans { grid-template-columns: repeat(2, 1fr); }
    .home-main .lp-plan-featured { order: -1; }
}
@media (max-width: 560px) {
    .home-main .lp-hero { padding: 2rem 1.15rem; }
    .home-main .lp-hero h1 { font-size: 1.8rem; }
    .home-main .lp-lede { font-size: 1.05rem; }
    .home-main .lp-section { padding: 2.4rem 1.15rem; }
    .home-main .lp-section-title { font-size: 1.5rem; }
    .home-main .lp-benefits { grid-template-columns: 1fr; gap: 1.1rem; }
    .home-main .lp-features { grid-template-columns: 1fr; }
    .home-main .lp-plans { grid-template-columns: 1fr; }
    .home-main .lp-cta-card { padding: 1.6rem 1.2rem; }
}

/* ------------------------------------------------------------------ *
 *  Admin error log                                                    *
 *                                                                     *
 *  A stack trace is a block of long, unbreakable lines. In an          *
 *  auto-layout table the cell is sized to its widest content, so       *
 *  expanding <details> stretched the whole table past the card: the    *
 *  Page column collapsed to a few characters wide (breaking one        *
 *  character per line) and the Action column was pushed off-screen,    *
 *  clipping "Mark resolved". table-layout:fixed makes the columns      *
 *  honour the widths below regardless of content, which in turn lets   *
 *  the trace scroll inside its own box instead of the page.            *
 * ------------------------------------------------------------------ */
table.error-log { width: 100%; table-layout: fixed; border-collapse: collapse; }
table.error-log th,
table.error-log td { padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
table.error-log th:first-child,
table.error-log td:first-child { padding-left: 0; }
table.error-log th:last-child,
table.error-log td:last-child { padding-right: 0; }

table.error-log .col-when   { width: 7.5rem; }
table.error-log .col-page   { width: 22%; }
table.error-log .col-action { width: 8.5rem; }

/* Long paths and messages wrap at any point if they must, but only as a
   last resort — normal word boundaries are preferred. */
.error-log-page,
.error-log-message { overflow-wrap: anywhere; word-break: normal; }
.error-log-file { overflow-wrap: anywhere; margin-top: 0.15rem; }

.error-log-trace { margin-top: 0.4rem; }
.error-log-trace > summary { cursor: pointer; }
.error-log-trace pre {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: pre;
    margin: 0.4rem 0 0;
    background: #f6f6f6;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem;
    font-size: 0.75rem;
    line-height: 1.45;
}

table.error-log .btn { white-space: nowrap; }

/* Narrow screens: the fixed columns stop fitting, so let the table itself
   scroll sideways as one unit rather than crushing the columns. */
@media (max-width: 700px) {
    .error-log-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .error-log-scroll table.error-log { min-width: 44rem; }
}
