:root {
    --page: #f3efe7;
    --panel: #fbf8f1;
    --paper: #f5ddce;
    --ink: #28231f;
    --muted: #59524a;
    --faint: #dfd6c9;
    --line: #24201c;
    --copper: #ad5738;
    --copper-dark: #88412b;
    --green: #92bd7f;
    --green-soft: #cce2bf;
    --white: #ffffff;
}
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.public-home {
    min-height: 100vh;
    background: #f4efe6;
    color: var(--ink);
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

.public-shell {
    min-height: 100vh;
}

.public-nav {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 7px;
    position: fixed;
    top: 22px;
    right: max(16px, calc((100vw - 1180px) / 2));
    z-index: 5;
}

.public-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid rgba(40, 35, 31, 0.34);
    border-radius: 7px;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.public-nav a {
    flex: 0 0 auto;
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.34);
}

.public-login-link {
    padding: 0 16px;
}

.public-login-group {
    display: flex;
    gap: 6px;
}

.public-social-group {
    display: inline-flex;
    gap: 3px;
}

.public-social-link {
    width: 42px;
    padding: 0;
}

.public-social-link svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.public-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.96fr) minmax(340px, 0.74fr);
    gap: clamp(28px, 6vw, 74px);
    align-items: center;
    width: min(1180px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 72px 0 48px;
    scroll-snap-align: start;
}

.public-video-frame {
    aspect-ratio: 4 / 5;
    border: 1px solid rgba(40, 35, 31, 0.38);
    border-radius: 8px;
    overflow: hidden;
    background: #f4efe6;
    box-shadow: 0 20px 54px rgba(40, 35, 31, 0.18);
}

.public-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.public-copy {
    align-self: center;
    animation: publicFadeIn 900ms ease-out 180ms both;
    padding-top: 4vh;
}

.public-kicker {
    margin-bottom: 12px;
    color: var(--copper-dark);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.public-hero h1 {
    max-width: 650px;
    color: var(--ink);
    font-size: clamp(52px, 8vw, 96px);
}

.public-intro {
    max-width: 530px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 20px;
    line-height: 1.45;
}

.public-nav a:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--panel);
}

.public-scroll-cue {
    position: absolute;
    right: 20%;
    bottom: 96px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--ink);
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    animation: publicScrollCue 1.4s ease-in-out infinite;
}

.public-about-reel {
    display: grid;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 96px 32px 72px;
    background: #f4efe6;
    color: var(--ink);
    scroll-snap-align: start;
}

.public-about-copy {
    width: min(1180px, 100%);
    max-width: none;
    margin: 0 auto;
}

.public-about-copy h1 {
    max-width: 940px;
    font-size: clamp(58px, 8vw, 108px);
}

.public-about-copy blockquote {
    max-width: 980px;
    margin: 26px 0 0;
    color: var(--muted);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(28px, 3.6vw, 48px);
    line-height: 1.18;
}

.public-profile-notes {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.5fr);
    gap: clamp(48px, 11vw, 150px);
    margin-top: clamp(42px, 8vh, 84px);
    padding-top: 24px;
    border-top: 1px solid rgba(40, 35, 31, 0.24);
}

.public-profile-notes span {
    display: block;
    margin-bottom: 10px;
    color: var(--copper-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.public-profile-subhead {
    margin-top: 22px;
}

.public-profile-notes p {
    max-width: 500px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.45;
}

.public-profile-notes a {
    color: var(--ink);
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.public-contact-socials {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.public-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.public-contact-link svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

    .public-contact-link span {
        text-decoration: underline;
        text-decoration-thickness: 1px;
        text-underline-offset: 4px;
        overflow-wrap: anywhere;
    }

@keyframes publicFadeIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes publicScrollCue {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

@keyframes publicScrollCueMobile {
    0%,
    100% {
        transform: translate(-50%, 0);
    }
    50% {
        transform: translate(-50%, 8px);
    }
}

.brand-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 32px;
    min-height: 58px;
    padding: 12px max(24px, calc((100vw - 1200px) / 2));
    border-bottom: 1px solid var(--faint);
    background: var(--panel);
}

.brand-name,
h1,
h2,
h3,
p {
    margin: 0;
}

.brand-name {
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 21px;
    font-weight: 700;
    text-decoration: none;
}

.brand-name:hover {
    color: var(--accent);
}

.header-logout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid #b8ad9e;
    border-radius: 7px;
    background: transparent;
    color: var(--copper-dark);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.header-logout-link:hover {
    border-color: var(--copper);
    background: #ead9ce;
    color: var(--copper-dark);
}

.eyebrow {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

main {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.workbook-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
    padding: 28px 0 20px;
}

.distribution-hero {
    padding-bottom: 6px;
}

.distribution-hero + .sheet-section {
    padding-top: 0;
}

.finance-incomplete-note {
    max-width: 520px;
    margin-top: 10px;
    color: var(--copper-dark);
    font-weight: 700;
}

.finance-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    border: 1px solid var(--copper-dark);
    border-radius: 50%;
    color: var(--copper-dark);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
    cursor: help;
}

.finance-help::after {
    content: attr(aria-label);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    z-index: 30;
    width: min(280px, calc(100vw - 36px));
    padding: 8px 10px;
    border: 1px solid var(--faint);
    border-radius: 7px;
    background: var(--panel);
    box-shadow: 0 8px 20px rgba(40, 35, 31, 0.16);
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.finance-help:hover::after,
.finance-help:focus::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.finance-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 18px;
}

.finance-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 1px solid var(--faint);
    border-radius: 7px;
    background: var(--panel);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    padding: 0 12px;
    text-decoration: none;
    white-space: nowrap;
}

.finance-tab.is-active {
    border-color: var(--copper);
    background: var(--copper);
    color: var(--white);
}

.finance-tab.is-muted {
    opacity: 0.58;
}

.finance-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}

.finance-summary-card {
    display: block;
    border: 1px solid var(--faint);
    border-radius: 7px;
    background: var(--panel);
    color: var(--ink);
    padding: 14px;
    text-decoration: none;
}

.finance-overview-card:hover {
    border-color: var(--copper);
    background: #fffaf3;
}

.finance-summary-card span {
    color: var(--copper-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.finance-summary-card strong {
    display: block;
    margin-top: 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 25px;
}

.finance-summary-card p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.purchase-spend-grid {
    display: grid;
    grid-template-columns: minmax(220px, 360px);
    gap: 10px;
    margin: 0 0 16px;
}

.purchase-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.statistics-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finance-log-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.finance-log-panel {
    min-width: 0;
    border-top: 2px solid var(--ink);
    padding-top: 10px;
}

.finance-log-panel h3 {
    margin: 0 0 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 19px;
}

.finance-log-subhead {
    margin-top: 18px !important;
    padding-top: 12px;
    border-top: 1px solid var(--faint);
}

.finance-log-panel ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.finance-log-panel li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 4px 0;
    border-bottom: 1px solid var(--faint);
}

.finance-log-panel li span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.finance-log-panel li strong {
    flex: 0 0 auto;
    font-size: 14px;
}

.finance-log-panel li.scrap-usage-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr);
    gap: 6px;
    align-items: start;
}

.scrap-usage-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.scrap-usage-metrics strong {
    flex: 0 1 auto;
    display: grid;
    gap: 1px;
    padding: 5px 7px;
    border: 1px solid var(--faint);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.45);
    line-height: 1.2;
    white-space: nowrap;
}

.scrap-usage-metrics small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.finance-log-panel p {
    color: var(--muted);
    font-size: 13px;
}

.stock-hero {
    align-items: end;
}

.picture-board-page {
    width: min(1500px, calc(100% - 24px));
    margin: 0 auto;
    padding: 0 0 42px;
}

.picture-board-hero {
    padding-bottom: 14px;
}

.picture-board-shell {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 210px);
}

.picture-board-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 140px);
    width: auto;
    height: auto;
    border: 1px solid var(--faint);
    background: var(--panel);
}

.picture-board-empty {
    color: var(--muted);
    font-weight: 700;
}

.stock-hero p {
    max-width: 620px;
    color: var(--muted);
}

.stock-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--ink);
    border-radius: 6px;
    background: var(--ink);
    color: var(--paper);
    font-weight: 800;
    text-decoration: none;
}

.stock-attention-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 1fr));
    gap: 8px;
}

.stock-attention-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border: 1px solid var(--faint);
    border-left: 3px solid var(--ink);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.62);
}

.stock-attention-card.is-low {
    border-left-color: #a7331f;
}

.stock-attention-card.is-count {
    border-left-color: #b66a30;
}

.stock-attention-card span,
.stock-metrics span,
.stock-expected span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.stock-attention-card strong {
    font-size: 22px;
}

.stock-list {
    display: grid;
    gap: 0;
    border: 1px solid var(--faint);
    border-left: 3px solid var(--ink);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.56);
    overflow: hidden;
}

.stock-list-head,
.stock-card {
    grid-template-columns: minmax(210px, 1.8fr) minmax(115px, 1fr) repeat(4, minmax(78px, 0.72fr)) minmax(190px, 1.25fr);
    column-gap: 12px;
}

.stock-list-head {
    display: grid;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--faint);
    background: rgba(40, 35, 31, 0.055);
}

.stock-list-head span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.stock-list-head span:last-child {
    text-align: right;
}

.stock-card {
    display: grid;
    align-items: center;
    padding: 11px 12px;
    border-bottom: 1px solid var(--faint);
    background: transparent;
}

.stock-card:last-child {
    border-bottom: 0;
}

.stock-card.stock-status-low {
    box-shadow: inset 3px 0 0 #a7331f;
}

.stock-card.stock-status-needs_count,
.stock-card.stock-status-no_count {
    box-shadow: inset 3px 0 0 #b66a30;
}

.stock-card-main {
    display: contents;
}

.stock-card-title {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: baseline;
}

.stock-card-title h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
}

.stock-card-title strong {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.stock-card.stock-status-low .stock-card-title strong {
    color: #a7331f;
}

.stock-card.stock-status-needs_count .stock-card-title strong,
.stock-card.stock-status-no_count .stock-card-title strong {
    color: #b66a30;
}

.stock-card p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.stock-expected {
    min-width: 0;
    text-align: left;
}

.stock-expected strong {
    display: block;
    margin-top: 1px;
    font-size: 18px;
}

.stock-expected small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.stock-metrics {
    display: contents;
}

.stock-metrics div {
    min-width: 0;
    padding: 0;
}

.stock-metrics strong {
    display: block;
    font-size: 13px;
}

.stock-metrics span,
.stock-expected > span {
    display: none;
}

.stock-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    align-items: start;
}

.stock-action-panel {
    position: relative;
}

.stock-action-panel summary {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    border: 1px solid var(--faint);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.stock-action-panel summary::-webkit-details-marker {
    display: none;
}

.stock-action-panel[open] {
    flex: 1 1 100%;
}

.stock-action-panel[open] summary {
    width: max-content;
    margin-left: auto;
    border-color: var(--accent);
    color: var(--accent);
}

.stock-actions:has(.stock-action-panel[open]) {
    grid-column: 1 / -1;
    flex-wrap: wrap;
}

.stock-action-panel form {
    margin-top: 7px;
}

.stock-count-form,
.stock-low-form {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: end;
}

.stock-low-form {
    justify-content: flex-end;
}

.stock-count-form input,
.stock-count-form select,
.stock-low-form input {
    min-width: 0;
    padding: 8px;
}

.stock-count-form input[type="date"] {
    width: 138px;
}

.stock-count-form input[type="number"],
.stock-count-form select {
    width: 118px;
}

.stock-count-form input[name="notes"] {
    flex: 1 1 140px;
}

.stock-low-form label,
.stock-resource-card label {
    display: grid;
    flex: 1 1 130px;
    gap: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.stock-count-form button,
.stock-low-form button,
.stock-resource-card button {
    padding: 9px 12px;
}

.stock-resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.stock-search {
    display: grid;
    gap: 4px;
    min-width: min(280px, 100%);
}

.stock-search span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.stock-search input {
    min-height: 38px;
    border: 1px solid var(--faint);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.72);
    padding: 8px 10px;
}

.stock-search-empty {
    display: none;
    margin: 12px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.stock-search-empty.is-visible {
    display: block;
}

.stock-resource-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--faint);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.45);
}

.stock-resource-card.is-filtered-out {
    display: none;
}

.stock-resource-card span {
    color: var(--muted);
    font-size: 13px;
}

.stock-resource-card input {
    min-width: 0;
    padding: 7px 8px;
}

.expense-entry-section {
    display: grid;
    grid-template-columns: minmax(220px, 0.85fr) minmax(320px, 1.15fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 26px;
}

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

.expense-category-card {
    min-height: 82px;
    align-items: flex-start;
    justify-content: space-between;
    border-color: var(--faint);
    background: var(--panel);
    color: var(--ink);
    text-align: left;
    padding: 12px;
}

.expense-category-card span {
    color: var(--copper-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.expense-category-card strong {
    display: block;
    margin-top: 14px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
}

.expense-category-card.is-active {
    border-color: var(--copper);
    background: var(--copper);
    color: var(--white);
}

.expense-category-card.is-active span {
    color: var(--white);
}

.expense-form {
    margin: 0;
}

.history-search {
    width: min(260px, 100%);
    border: 1px solid #b8ad9e;
    border-radius: 7px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    min-height: 36px;
    padding: 0 10px;
}

.incomplete-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    text-align: center;
}

.incomplete-page h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(40px, 8vw, 72px);
    font-weight: 400;
    color: var(--muted);
}

.add-line-btn {
    justify-self: start;
    margin-top: 4px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    background: transparent;
    border: 1px dashed var(--copper-dark);
    color: var(--copper-dark);
    border-radius: 6px;
    cursor: pointer;
}

.add-line-btn:hover {
    background: var(--copper-dark);
    color: #fff;
}

.hero-actions {
    display: flex;
    gap: 10px;
}

.hero-actions form {
    display: contents;
}

.eyebrow {
    color: var(--copper-dark);
    margin-bottom: 12px;
}

h1 {
    max-width: 560px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(34px, 5vw, 52px);
    font-weight: 400;
    line-height: 0.95;
}

.recipe-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 1px solid #b8ad9e;
    border-radius: 50%;
    color: var(--copper-dark);
    font-size: 20px;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.back-arrow:hover {
    background: #ead9ce;
}

.date-form {
    display: flex;
    gap: 8px;
    padding-bottom: 4px;
}

input,
button {
    border: 1px solid #b8ad9e;
    border-radius: 7px;
    font: inherit;
    min-height: 36px;
}

.date-form input {
    background: var(--panel);
    color: var(--ink);
    padding: 0 10px;
}

.distribution-hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    grid-column: 1 / -1;
    width: 100%;
}

.distribution-toolbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    margin-top: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.distribution-actions {
    margin-left: auto;
    margin-top: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.distribution-table-actions {
    justify-content: flex-end;
    margin-bottom: 9px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--faint);
}

.distribution-summary {
    margin-right: auto;
    font-size: 14px;
    color: var(--muted);
}

.distribution-summary strong {
    font-weight: 500;
    color: var(--ink);
}

.distribution-table-actions button,
.distribution-table-actions .copy-from-date input[type="date"],
.distribution-table-actions .copy-from-date button {
    height: 32px;
    min-height: 32px;
    padding: 0 12px;
    border-width: 1px;
    font-size: 13px;
}

.distribution-date-picker {
    display: inline-grid;
    grid-template-columns: 22px auto 22px;
    align-items: baseline;
    gap: 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.distribution-date-arrow,
.distribution-date-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    text-decoration: none;
}

.distribution-date-arrow {
    min-height: 0;
    border: 0;
    color: var(--muted);
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
}

.distribution-date-arrow:last-child {
    border: 0;
}

.distribution-date-current {
    gap: 4px;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 15px;
}

.distribution-date-current span {
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    text-transform: none;
}

.distribution-date-current strong {
    margin-top: 0;
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.1;
}

.distribution-date-arrow:hover,
.distribution-date-current:hover {
    background: transparent;
    color: var(--copper-dark);
}

.distribution-date-arrow.is-disabled,
.distribution-date-arrow.is-disabled:hover {
    color: var(--line);
    cursor: default;
}

.date-jump-form {
    padding-bottom: 0;
}

.visually-hidden-date-form {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.date-jump-form input {
    min-height: 32px;
    min-width: 132px;
    font-size: 13px;
    opacity: 0.72;
}

.date-jump-form button {
    min-height: 32px;
    font-size: 13px;
}

.statement-form {
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.statement-form select {
    border: 1px solid #b8ad9e;
    border-radius: 7px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    min-height: 36px;
    padding: 0 10px;
}

.statement-caption {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin: 12px 0 8px;
}

button {
    background: var(--copper);
    color: var(--white);
    cursor: pointer;
    padding: 0 14px;
    font-weight: 700;
    transition: background-color 0.15s ease, color 0.15s ease;
}

button:hover {
    background: var(--copper-dark);
}

.tabs {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tab {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    text-decoration: none;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 700;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.tab:hover {
    color: var(--ink);
}

.tab.is-active {
    color: var(--ink);
    border-bottom-color: var(--copper);
}

.app-download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin-left: auto;
    border: 1px solid var(--copper);
    border-radius: 999px;
    background: var(--copper);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 0 14px;
    text-decoration: none;
    white-space: nowrap;
}

.app-download-link:hover {
    background: var(--copper-dark);
    border-color: var(--copper-dark);
}

.sheet-section,
.tickets-section {
    padding-top: 18px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40vh;
    text-align: center;
    color: var(--muted);
}

.empty-state h1 {
    max-width: none;
    font-size: clamp(26px, 4vw, 36px);
}

.section-bar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--faint);
    margin: 0 0 12px;
    padding-bottom: 8px;
}

.section-bar h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 21px;
    font-weight: 700;
}

.section-bar p {
    color: var(--muted);
    margin-top: 3px;
}

.receipt-recost-form {
    display: flex;
    justify-content: flex-end;
}

.receipt-recost-note {
    color: var(--copper-dark);
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 14px;
}

.section-toggle {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.collapsible-section.is-collapsed {
    padding-bottom: 18px;
}

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

.copy-from-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-from-date input[type="date"] {
    min-height: 36px;
    padding: 0 8px;
}

.save-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.save-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted);
}

.save-status.is-saved {
    color: #4b7d3a;
}

.distribution-actions .save-status.is-saved {
    display: none;
}

.save-status.is-saved::before {
    background: var(--green);
}

.save-status.is-error {
    color: #ba3f35;
}

.save-status.is-error::before {
    background: #ba3f35;
}

.save-status.is-pending::before {
    animation: pulse 1s ease-in-out infinite;
}

.save-status.is-dirty {
    color: var(--copper-dark);
}

.save-status.is-dirty::before {
    background: var(--copper);
}

.save-button:disabled {
    background: var(--panel);
    color: var(--muted);
    cursor: default;
}

.save-button:disabled:hover {
    background: var(--panel);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.secondary-button,
.print-button,
.export-link {
    background: transparent;
    color: var(--copper-dark);
}

.secondary-button:hover,
.print-button:hover,
.export-link:hover {
    background: #ead9ce;
}

.export-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid #b8ad9e;
    border-radius: 7px;
    font-weight: 700;
    text-decoration: none;
}

.sheet-wrap {
    overflow-x: auto;
    border-top: 2px solid var(--ink);
    background: transparent;
}

.distribution-requests-panel {
    margin: 0 0 18px;
    border-top: 2px solid var(--ink);
    background: var(--panel);
    box-shadow: 0 1px 3px rgba(40, 35, 31, 0.1);
}

.distribution-requests-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 800;
}

.distribution-requests-panel summary em {
    color: var(--copper-dark);
    font-size: 12px;
    font-style: normal;
    text-transform: uppercase;
}

.distribution-requests-table,
.branch-request-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.distribution-requests-table th,
.distribution-requests-table td,
.branch-request-table th,
.branch-request-table td {
    border-top: 1px solid var(--faint);
    padding: 8px 10px;
    text-align: left;
    vertical-align: middle;
}

.distribution-requests-table thead th,
.branch-request-table thead th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.distribution-request-group {
    border-top: 1px solid var(--faint);
    padding: 12px 14px 14px;
}

.distribution-request-group-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.distribution-request-group-heading strong {
    display: block;
    font-size: 16px;
}

.distribution-request-group-heading span {
    color: var(--copper-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.distribution-requests-table tr.is-changed td {
    background: #f8ebe8;
    color: #8a2f28;
    font-weight: 800;
}

.request-review-form {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.compact-button {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.distribution-table {
    width: 100%;
    min-width: 880px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.distribution-table th,
.distribution-table td {
    border: 0;
    border-bottom: 1px solid var(--faint);
    height: 34px;
    padding: 4px 8px;
    text-align: center;
    vertical-align: middle;
}

.allocation {
    color: var(--ink);
}

.quantity-value {
    width: min(56px, 100%);
    height: 28px;
    min-height: 28px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    padding: 2px;
}

.quantity-value:focus {
    border-color: var(--copper);
    outline: 0;
    background: var(--white);
}

.distribution-table thead th {
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.distribution-table .item-header {
    background: transparent;
    color: var(--ink);
    text-align: left;
}

.distribution-table tbody tr:nth-child(even) th,
.distribution-table tbody tr:nth-child(even) td {
    background: #ede6d8;
}

.add-row th,
.add-row td {
    background: transparent !important;
}

.distribution-table tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 180px;
    background: var(--page);
    border-bottom-color: #cfc5b7;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    font-weight: 700;
    text-align: left;
}

body.edit-mode .distribution-table {
    table-layout: auto;
}

body.edit-mode .distribution-table tbody th {
    position: static;
    width: auto;
    min-width: 420px;
}

body.edit-mode .distribution-table .item-header {
    min-width: 420px;
}

.item-edit-bar {
    display: none;
}

body.edit-mode .distribution-table tbody th .item-edit-bar {
    display: flex;
    align-items: center;
    gap: 14px;
}

.item-name {
    display: block;
}

.item-label-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.item-arabic-name {
    display: none;
    color: var(--muted);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
}

body.arabic-mode .distribution-table tbody th .item-arabic-name {
    display: block;
}

.distribution-table .table-label-ar {
  display: none;
}

.distribution-table .table-label-en {
  display: inline;
}

body.arabic-layout-mode .distribution-table {
  direction: rtl;
}

body.arabic-layout-mode .distribution-table th,
body.arabic-layout-mode .distribution-table td {
  direction: ltr;
}

body.arabic-layout-mode .distribution-table .item-header,
body.arabic-layout-mode .distribution-table tbody th {
  left: auto;
  right: 0;
  text-align: right;
  direction: rtl;
}

body.arabic-layout-mode .distribution-table tbody th .item-label-stack {
  align-items: flex-end;
}

body.arabic-layout-mode .distribution-table tbody th .item-arabic-name {
  display: block;
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  order: 1;
}

body.arabic-layout-mode .distribution-table tbody th .item-name {
  display: block;
  color: var(--muted);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 2px;
  order: 2;
}

body.arabic-layout-mode .distribution-table .branch-header,
body.arabic-layout-mode .distribution-table .total-header {
  direction: rtl;
}

body.arabic-layout-mode .distribution-table .table-label-ar {
  display: block;
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

body.arabic-layout-mode .distribution-table .table-label-en {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 2px;
}

.item-name-input,
.item-arabic-name-input {
    display: none;
    width: 100%;
    min-height: 30px;
    border: 1px solid #c8bbaa;
    border-radius: 6px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    padding: 4px 7px;
}

body.edit-mode .distribution-table tbody th .item-name-input,
body.edit-mode .distribution-table tbody th .item-arabic-name-input {
    width: 150px;
    min-height: 28px;
    flex: none;
}

#new-item-arabic-name {
    display: none;
    width: 100%;
    min-height: 30px;
    border: 1px solid #c8bbaa;
    border-radius: 6px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    margin-top: 5px;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-weight: 700;
    padding: 4px 7px;
}

body.edit-mode.arabic-mode #new-item-arabic-name {
    display: block;
}

body.edit-mode .distribution-table tbody th .item-name,
body.edit-mode .distribution-table tbody th .item-arabic-name {
    display: none;
}

body.edit-mode .distribution-table tbody th .item-name-input,
body.edit-mode .distribution-table tbody th .item-arabic-name-input {
    display: block;
}

body.edit-mode .distribution-table tbody th .item-arabic-name-input {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

.item-product-label {
    display: none;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    font-family: Arial, sans-serif;
    white-space: nowrap;
}

body.edit-mode .distribution-table tbody th .item-product-label {
    display: flex;
    flex: 1 1 auto;
    min-width: 160px;
}

.drag-handle {
    flex: none;
    cursor: grab;
    font-size: 18px;
    line-height: 1;
    color: var(--muted);
    user-select: none;
    padding: 2px 2px;
}

.drag-handle:active {
    cursor: grabbing;
}

.distribution-table tbody tr.dragging {
    opacity: 0.4;
}

.item-product-select {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 26px;
    border: 1px solid #c8bbaa;
    border-radius: 6px;
    background: #f8f3ea;
    padding: 2px 5px;
    font-size: 12px;
    font-weight: 400;
}

.cost-column {
    display: none;
    width: 90px;
}

body.edit-mode .cost-column {
    display: table-cell;
}

.source-cost {
    color: var(--copper-dark);
    font-size: 14px;
    font-weight: 700;
}

.distribution-table tbody tr:nth-child(even) th {
    background: #ede6d8;
}

.distribution-table tbody tr:hover th,
.distribution-table tbody tr:hover td {
    background: var(--paper);
}

.distribution-table .total-cell {
    padding: 3px 8px;
}

body.edit-mode .distribution-table .branch-header,
body.edit-mode .distribution-table .total-header,
body.edit-mode .distribution-table tbody tr:not(.add-row) .allocation,
body.edit-mode .distribution-table tbody tr:not(.add-row) .total-cell {
    display: none;
}

.distribution-actions .copy-from-date {
    display: none;
}

body.edit-mode .distribution-actions .copy-from-date {
    display: flex;
}

#new-item-name {
    width: min(70px, 100%);
    height: 28px;
    min-height: 28px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    text-align: center;
    padding: 2px;
}

.total-value {
    display: inline-block;
    color: var(--copper-dark);
    font-size: 19px;
    font-weight: 700;
}

#new-item-name {
    width: 100%;
    text-align: left;
    padding-left: 0;
    color: var(--ink);
}

#new-item-name:focus {
    border-color: var(--copper);
    outline: 0;
    background: var(--white);
}

.add-button {
    width: 34px;
    min-height: 28px;
    border: 0;
    border-radius: 999px;
    background: var(--copper);
    font-size: 20px;
    line-height: 1;
    padding: 0;
}

.edit-column {
    display: none;
    width: 88px;
}

body.edit-mode .edit-column {
    display: table-cell;
}

.delete-row {
    min-height: 28px;
    border: 0;
    border-radius: 6px;
    background: #ba3f35;
    color: #fff;
    font-size: 12px;
    padding: 0 10px;
}

.tickets-section {
    padding-bottom: 40px;
}

.receipt-list {
    display: grid;
    gap: 8px;
}

.ticket-row {
    border-top: 1px solid var(--faint);
    padding: 9px 0;
}

.ticket-row:last-child {
    border-bottom: 1px solid var(--faint);
}

.ticket-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 12px;
    align-items: center;
}

.receipt-row .ticket-line {
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
}

.ticket-branch {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    min-width: 0;
}

.view-ticket-button {
    min-height: 34px;
    padding: 0 12px;
    white-space: nowrap;
}

.ticket .print-ticket-button {
    min-height: 30px;
    padding: 0 10px;
    white-space: nowrap;
}

.ticket-actions {
    justify-content: flex-end;
}

.ticket-language-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.ticket-language-toggle input {
    min-height: 0;
}

.distribution-language-toggle {
    display: none;
}

body.edit-mode .distribution-language-toggle {
    display: inline-flex;
}

.ticket-panel {
    margin-top: 10px;
    max-width: 360px;
}

.ticket-print-frame {
    border: 0;
    height: 0;
    position: fixed;
    right: 0;
    top: 0;
    width: 0;
}

.tickets-grid,
.receipt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px 22px;
    align-items: start;
}

.receipt-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.ticket {
    position: relative;
    background: var(--panel);
    padding: 14px 16px 10px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(40, 35, 31, 0.12);
}

.ticket-logo {
    display: block;
    width: auto;
    max-width: 180px;
    max-height: 76px;
    margin: 4px auto 12px;
    filter: grayscale(1) contrast(1.35);
    object-fit: contain;
}

.ticket::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background-image: radial-gradient(circle at 6px 6px, var(--page) 6px, transparent 6.5px);
    background-size: 12px 12px;
    background-position: -6px -6px;
}

.ticket-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    border-bottom: 1px dashed var(--faint);
    padding-bottom: 8px;
    margin-bottom: 3px;
}

.ticket h3 {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    line-height: 1.2;
    text-align: left;
    flex: 1 1 auto;
}

.ticket-code {
    color: var(--copper-dark);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.ticket-code-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.ticket-state,
.receipt-state {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    border: 1px solid #c99786;
    border-radius: 999px;
    background: #f5e0d5;
    color: var(--copper-dark);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.7px;
    line-height: 1;
    padding: 0 7px;
    text-transform: uppercase;
    white-space: nowrap;
}

.receipt-state.is-superseded {
    border-color: #b8ad9e;
    background: #ede4d8;
    color: var(--muted);
}

.ticket-actor {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    padding: 0 7px;
    white-space: nowrap;
}

.ticket-actor,
.ticket-actor-baker {
    border: 1px solid #7aa3c7;
    background: #e2f0fb;
    color: #245f91;
}

.ticket-actor-staff {
    border-color: #78ad8a;
    background: #e1f3e6;
    color: #267143;
}

.ticket-state[hidden],
.ticket-actor[hidden] {
    display: none !important;
}

.ticket.is-changed {
    box-shadow: 0 0 0 1px #c99786, 0 1px 3px rgba(40, 35, 31, 0.12);
}

.ticket.total-ticket {
    background: #f2e9dc;
    box-shadow: 0 0 0 1px var(--copper), 0 1px 3px rgba(40, 35, 31, 0.12);
}

.ticket.total-ticket .ticket-heading h3 {
    color: var(--copper-dark);
}

.print-total-button {
    background: var(--copper-dark);
}

.print-total-button:hover {
    background: var(--copper);
}

.ticket-date {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.5px;
    margin: 0 0 3px;
    text-transform: uppercase;
}

.ticket table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.ticket td {
    border: 0;
    border-bottom: 1px dashed var(--faint);
    height: 27px;
    padding: 4px 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ticket td:first-child {
    width: 70%;
    text-align: left;
    font-variant-numeric: normal;
}

.ticket td:last-child {
    font-size: 16px;
    font-weight: 700;
    color: var(--copper-dark);
}

.ticket tr:last-child td {
    border-bottom: 0;
}

.empty-ticket td {
    color: var(--muted);
}

.ticket-signatures {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    border-top: 1px dashed var(--faint);
    margin-top: 9px;
    padding-top: 9px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ticket-total-pieces {
    color: #ba3f35;
    font-size: 16px;
    text-align: right;
}

.ticket-signatures span:nth-child(n + 3) {
    grid-column: 1 / -1;
}

.ticket.is-arabic {
    direction: rtl;
}

.ticket.is-arabic .ticket-heading {
    text-align: right;
}

.ticket.is-arabic h3 {
    text-align: right;
}

.ticket.is-arabic .ticket-code-wrap {
    align-items: flex-start;
}

.ticket.is-arabic td {
    text-align: left;
}

.ticket.is-arabic td:first-child {
    text-align: right;
}

.ticket.is-arabic .ticket-total-pieces {
    text-align: left;
}

.settings-section {
    max-width: 720px;
}

.settings-form {
    display: grid;
    gap: 16px;
    border-top: 2px solid var(--ink);
    padding-top: 18px;
}

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

.settings-form label,
.settings-upload label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.settings-form input {
    width: 100%;
    background: var(--panel);
    color: var(--ink);
    padding: 0 11px;
}

.settings-form input[type="file"],
.settings-form input[type="checkbox"] {
    min-height: 0;
}

.settings-form input[type="file"] {
    border: 1px dashed #b8ad9e;
    padding: 9px;
}

.settings-form input[type="checkbox"] {
    width: auto;
}

.settings-upload,
.receipt-logo-current {
    display: grid;
    gap: 10px;
}

.receipt-logo-current img,
.receipt-preview img {
    display: block;
    width: auto;
    max-width: 220px;
    max-height: 90px;
    filter: grayscale(1) contrast(1.35);
    object-fit: contain;
}

.checkbox-line,
.radio-line {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.yield-mode-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin-top: 4px;
}

.yield-mode-toggle .radio-line {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

.yield-mode-section {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px dashed var(--faint);
}

.yield-mode-section[hidden] {
    display: none;
}

.new-product-panel {
    margin: 0;
}

.new-product-panel details[open] {
    border: 1px solid var(--faint);
    border-radius: 8px;
    background: #ede6d8;
    padding: 16px;
    margin-bottom: 20px;
}

.new-product-panel summary {
    display: none;
}

.new-product-hint {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.new-product-panel small,
.empty-inline,
.resource-picker-hint {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.add-row-primary .resource-picker-hint {
    grid-column: 1 / -1;
    margin-top: -2px;
}

.products-workspace {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.products-workspace select,
.new-product-panel select {
    border: 1px solid #b8ad9e;
    border-radius: 7px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    min-height: 36px;
    padding: 0 8px;
}

.products-sidebar {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.product-search {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.product-picker-group,
.product-archive,
.product-identity-panel,
.composition-panel {
    min-width: 0;
}

.product-workbench {
    min-width: 0;
    border-top: 3px solid var(--ink);
    padding-top: 18px;
}

.product-picker-heading,
.product-archive summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--faint);
    padding-bottom: 8px;
}

.product-picker-heading h2,
.product-archive summary span {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    font-weight: 700;
}

.product-picker-heading span,
.product-archive summary em {
    border-radius: 999px;
    background: #ece4d9;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    min-width: 26px;
    padding: 4px 8px;
    text-align: center;
}

.product-archive summary {
    cursor: pointer;
    list-style: none;
}

.product-archive summary::-webkit-details-marker {
    display: none;
}

.product-picker-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.product-picker-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--faint);
    border-radius: 8px;
    color: var(--ink);
    padding: 10px;
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.product-picker-card:hover,
.product-picker-card.is-selected {
    border-color: var(--copper);
    background: #f4eadc;
}

.product-picker-card span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.product-picker-card strong,
.product-picker-card small {
    overflow-wrap: anywhere;
}

.product-picker-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.product-picker-card em {
    color: var(--copper-dark);
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
}

.product-picker-card em.is-unknown {
    color: #a73a31;
}

.inactive-product-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.compact-button {
    min-height: 30px;
    padding: 0 10px;
}

.selected-product-hero {
    margin-bottom: 16px;
}

.product-workbench .recipe-control-bar {
    margin-top: 0;
    margin-bottom: 20px;
}

.selected-product-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.selected-product-heading form {
    display: contents;
}

.selected-product-heading h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(30px, 4.5vw, 46px);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
}

.status-pill,
.scraps-badge,
.needs-editing-badge,
.removed-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--faint);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    min-height: auto;
    padding: 4px 10px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.scraps-badge {
    border-color: var(--green);
    color: #4b7d3a;
    font-style: normal;
    font-weight: 700;
    cursor: default;
    vertical-align: middle;
}

.needs-editing-badge {
    border-color: #ba3f35;
    color: #ba3f35;
    font-style: normal;
    font-weight: 700;
    cursor: default;
    vertical-align: middle;
}

.removed-badge {
    border-color: #ba3f35;
    background: #ba3f35;
    color: var(--white, #fff);
    font-style: normal;
    font-weight: 700;
    cursor: default;
    vertical-align: middle;
}

.status-pill:hover {
    background: #ead9ce;
}

.status-pill.is-active {
    border-color: var(--green);
    color: #4b7d3a;
}

.cost-summary .is-primary dd {
    font-size: 28px;
}

.cost-summary .is-primary.is-unknown dd {
    color: #a73a31;
}

.cost-summary dd.is-negative {
    color: #a73a31;
}

.cost-summary dd.is-positive {
    color: #4b7d3a;
}

.product-warning {
    border-left: 3px solid #a73a31;
    background: #f7e6df;
    color: #7a2b24;
    font-weight: 800;
    margin: 12px 0;
    padding: 10px 12px;
}

.product-details-editor {
    margin-top: 6px;
}

.product-details-editor summary {
    display: inline-block;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.product-details-editor summary:hover {
    color: var(--copper-dark);
}

.product-details-editor[open] summary {
    margin-bottom: 10px;
}

.product-identity-panel {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.product-title-fields {
    display: grid;
    grid-template-columns: minmax(180px, 1.1fr) minmax(140px, 0.8fr);
    gap: 10px;
}

.product-identity-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.product-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 18px;
}

.product-summary-strip div {
    border: 1px solid var(--faint);
    border-radius: 8px;
    padding: 10px;
}

.product-summary-strip span,
.component-cost span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.product-summary-strip strong,
.component-cost strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
    margin-top: 4px;
}

.formula-heading {
    margin-bottom: 16px;
}

.product-ingredient-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.product-ingredient-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    border-bottom: 1px solid var(--faint);
    padding: 9px 0;
}

.product-ingredient-list li:last-child {
    border-bottom: 0;
}

.product-ingredient-list li.has-warning {
    color: #a73a31;
}

.ingredient-line-text {
    flex: 1 1 260px;
}

.ingredient-line-text small {
    color: var(--muted);
    font-weight: 700;
}

.ingredient-line-cost {
    color: var(--copper-dark);
    font-weight: 800;
}

.ingredient-line-cost.is-unknown {
    color: #a73a31;
}

.ingredient-byproduct-note {
    flex-basis: 100%;
    color: var(--muted);
    font-size: 13px;
}

.ingredient-byproduct-note.is-unknown {
    color: #a73a31;
}

.product-ingredient-list li.empty-line {
    border-bottom: 0;
    color: var(--muted);
}

.component-list {
    display: grid;
    gap: 14px;
}

.component-card,
.add-component-bar {
    display: grid;
    gap: 12px;
    border: 1px solid var(--faint);
    border-radius: 8px;
    padding: 12px;
}

.add-component-bar {
    border-style: dashed;
}

/* Each card is two stacked rows -- the primary controls (amount, resource, cost, actions),
   then the byproduct controls as their own full-width row below. Cramming both into one
   row of fixed-minimum-width columns overflowed the card on real screen widths (the
   byproduct group alone needs ~320px minimum for its 4 fields), so it's split instead of
   trying to shrink everything to fit shoulder-to-shoulder. */
.component-row-primary {
    display: grid;
    gap: 10px;
    align-items: end;
}

.formula-row-primary {
    grid-template-columns: 24px minmax(140px, 0.9fr) minmax(180px, 1.3fr) auto minmax(86px, 0.5fr) auto;
    gap: 16px;
    align-items: center;
}

.add-row-primary {
    grid-template-columns: minmax(200px, 1fr) 170px auto auto;
}

.field-caption {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.formula-card.has-warning {
    border-color: #d9a199;
    background: #fff8f3;
}

.formula-plus {
    align-self: center;
    color: var(--copper-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
}

.component-amount-group {
    display: grid;
    grid-template-columns: minmax(74px, 1fr) minmax(70px, 0.8fr);
    gap: 6px;
}

.component-amount-wrap {
    display: grid;
    gap: 6px;
}

.piece-count-field {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
}

.piece-count-field input {
    width: 60px;
    min-height: 26px;
    padding: 0 6px;
}

.piece-count-field[hidden] {
    display: none;
}

.component-resource-name {
    display: grid;
    gap: 3px;
    align-self: center;
    min-width: 0;
}

.component-resource-name strong {
    overflow-wrap: anywhere;
}

.component-resource-name span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.component-resource-name small {
    color: #a73a31;
    font-size: 12px;
    font-weight: 800;
}

.component-resource-edit {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.resource-name-input {
    flex: 1 1 auto;
    min-width: 120px;
    border: 1px solid transparent;
    background: transparent;
    padding: 2px 4px;
    margin: -2px -4px;
    font: inherit;
    font-weight: 800;
    color: var(--ink);
    min-height: auto;
}

.resource-name-input:hover {
    border-color: var(--faint);
}

.resource-name-input:focus {
    outline: 0;
    border-color: var(--copper);
    background: var(--panel);
}

.component-resource-name .resource-picker-hint {
    color: var(--muted);
    font-weight: 700;
}

.byproduct-toggle {
    justify-self: start;
    min-height: auto;
    border: 0;
    background: transparent;
    color: var(--copper-dark);
    font-size: 12px;
    font-weight: 800;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.byproduct-toggle:hover {
    background: transparent;
    color: var(--copper);
}

.byproduct-toggle[hidden] {
    display: none;
}

.component-byproduct-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    border-top: 1px dashed var(--faint);
    padding-top: 14px;
}

.component-byproduct-group.is-collapsed {
    display: none;
}

.add-byproduct-group {
    border-top-color: #d8c9b4;
}

.component-byproduct-group label {
    min-width: 0;
}

.component-byproduct-group label:has(.component-amount-group) {
    width: 200px;
}

.component-byproduct-group label:has(select[name="byproduct_type"]) {
    width: 150px;
}


.byproduct-value {
    align-self: center;
}

.byproduct-value span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.byproduct-value strong {
    display: block;
    color: var(--copper-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
}

.byproduct-value small {
    color: var(--muted);
    display: block;
    font-size: 11px;
    font-weight: 800;
}

.byproduct-value.is-unknown strong,
.byproduct-value.is-unknown small {
    color: #a73a31;
}

.component-byproduct-group.is-disabled input,
.component-byproduct-group.is-disabled select[name="byproduct_unit"] {
    opacity: 0.45;
}

.cost-switch {
    display: inline-flex !important;
    align-items: center;
    align-self: center;
    gap: 8px;
    cursor: pointer;
    min-height: 38px;
}

.cost-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.cost-switch-track {
    position: relative;
    width: 34px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 999px;
    background: #d9cfc0;
    transition: background-color 0.15s ease;
}

.cost-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 1px 2px rgba(40, 35, 31, 0.3);
    transition: transform 0.15s ease;
}

.cost-switch input:checked + .cost-switch-track {
    background: var(--green);
}

.cost-switch input:checked + .cost-switch-track .cost-switch-thumb {
    transform: translateX(14px);
}

.cost-switch input:focus-visible + .cost-switch-track {
    box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--copper);
}

.cost-switch-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.byproduct-remove {
    flex-basis: 100%;
    justify-self: start;
    min-height: auto;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.byproduct-remove:hover {
    background: transparent;
    color: #ba3f35;
}

.component-cost.is-unknown strong,
.resource-picker-hint.is-warning {
    color: #a73a31;
}

.component-actions {
    display: flex;
    gap: 6px;
}

.empty-component-card {
    border: 1px dashed #c8bbaa;
    border-radius: 8px;
    color: var(--muted);
    padding: 18px;
    text-align: center;
}

.empty-component-card h2 {
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 21px;
}

.add-component-bar {
    margin-top: 12px;
}

.resource-search-field {
    display: grid;
    gap: 4px;
}

@media (max-width: 1050px) {
    .products-workspace,
    .formula-row-primary,
    .add-row-primary {
        grid-template-columns: 1fr;
    }

    .product-summary-strip,
    .product-title-fields {
        grid-template-columns: 1fr;
    }

    .component-amount-group {
        grid-template-columns: minmax(0, 1fr) minmax(90px, auto);
    }

    .component-byproduct-group label {
        width: auto;
        flex: 1 1 90px;
    }

    .byproduct-value {
        margin-left: 0;
        flex-basis: 100%;
    }

    .component-actions,
    .product-identity-actions {
        justify-content: start;
    }
}

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

.settings-session-actions {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--faint);
}

.settings-session-actions form {
    margin: 0;
}

.settings-logout-button {
    min-width: 140px;
}

.settings-form button {
    justify-self: start;
    min-width: 140px;
    background: var(--copper);
    border-color: var(--copper);
    color: #fff;
    font-weight: 700;
    padding: 0 16px;
}

.form-error {
    border: 1px solid #d9a199;
    background: #f5e0d5;
    color: #8f2f28;
    font-weight: 700;
    margin: 0 0 12px;
    padding: 10px 12px;
}

.receipt-preview {
    display: grid;
    gap: 4px;
    border: 1px dashed var(--faint);
    background: var(--panel);
    padding: 14px;
}

.receipt-preview strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 21px;
}

.receipt-preview span {
    color: var(--muted);
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-shell {
    width: min(420px, calc(100% - 32px));
}

.login-card {
    border-top: 2px solid var(--ink);
    background: var(--panel);
    padding: 28px;
    box-shadow: 0 1px 3px rgba(40, 35, 31, 0.1);
}

.login-card h1 {
    margin-bottom: 24px;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.login-form input {
    width: 100%;
    background: var(--white);
    color: var(--ink);
    padding: 0 11px;
}

.login-back-link {
    display: inline-block;
    margin-top: 18px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.login-back-link:hover {
    color: var(--copper-dark);
}

.staff-login-page {
    background: #f4efe6;
}

.staff-login-shell {
    display: grid;
    grid-template-columns: minmax(360px, 0.9fr) minmax(340px, 0.62fr);
    align-items: center;
    gap: clamp(30px, 6vw, 74px);
    width: min(1180px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 54px 0;
}

.staff-login-intro {
    display: grid;
    align-items: start;
    position: relative;
    min-height: min(780px, calc(100vh - 108px));
    overflow: hidden;
    border: 1px solid rgba(40, 35, 31, 0.38);
    border-radius: 8px;
    background: #f4efe6;
    box-shadow: 0 20px 54px rgba(40, 35, 31, 0.18);
    color: #fffaf1;
}

.staff-login-photo-frame {
    position: absolute;
    inset: 0;
}

.staff-login-photo-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-login-photo-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(23, 20, 18, 0.62) 0%, rgba(23, 20, 18, 0.18) 36%, rgba(23, 20, 18, 0.18) 100%),
        linear-gradient(90deg, rgba(23, 20, 18, 0.56) 0%, rgba(23, 20, 18, 0.02) 58%);
    pointer-events: none;
}

.staff-login-copy {
    position: relative;
    z-index: 1;
    align-self: start;
    justify-self: start;
    max-width: 510px;
    padding: clamp(24px, 5vw, 48px);
    text-shadow: 0 1px 18px rgba(0, 0, 0, 0.36);
}

.staff-login-copy .eyebrow {
    color: #f3c4a9;
}

.staff-login-copy h1 {
    max-width: 460px;
    margin: 10px 0 0;
    color: #fffaf1;
    font-size: clamp(42px, 5.8vw, 72px);
    line-height: 0.95;
}

.staff-login-copy h1 a {
    color: inherit;
    text-decoration: none;
}

.staff-login-copy h1 a:hover {
    color: #f3c4a9;
}

.staff-login-card {
    position: relative;
    border: 1px solid rgba(255, 253, 247, 0.42);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.76);
    padding: 30px 32px 32px;
    box-shadow: 0 18px 44px rgba(40, 35, 31, 0.18);
    backdrop-filter: blur(12px);
}

.staff-login-card h1 {
    margin-top: 10px;
    margin-bottom: 20px;
}

.branch-login-page {
    min-height: 100vh;
    background: #f4efe6;
    color: #17120f;
}

.branch-login-shell {
    display: grid;
    grid-template-columns: minmax(360px, 0.9fr) minmax(340px, 0.62fr);
    align-items: center;
    gap: clamp(30px, 6vw, 74px);
    width: min(1180px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 54px 0;
}

.branch-login-intro {
    display: grid;
    align-items: end;
    position: relative;
    min-height: min(780px, calc(100vh - 108px));
    overflow: hidden;
    border: 1px solid rgba(40, 35, 31, 0.38);
    border-radius: 8px;
    background: #f4efe6;
    box-shadow: 0 20px 54px rgba(40, 35, 31, 0.18);
    color: #fffaf1;
}

.branch-login-photo-frame {
    position: absolute;
    inset: 0;
}

.branch-login-photo-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.branch-login-photo-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(23, 20, 18, 0.04) 0%, rgba(23, 20, 18, 0.08) 42%, rgba(23, 20, 18, 0.76) 100%),
        linear-gradient(90deg, rgba(23, 20, 18, 0.52) 0%, rgba(23, 20, 18, 0.02) 54%);
    pointer-events: none;
}

.branch-login-copy {
    position: relative;
    z-index: 1;
    max-width: 510px;
    padding: clamp(24px, 5vw, 48px);
    text-shadow: 0 1px 18px rgba(0, 0, 0, 0.36);
}

.branch-login-intro .eyebrow {
    color: #f3c4a9;
}

.branch-login-intro h1 {
    max-width: 520px;
    margin: 10px 0 18px;
    color: #fffaf1;
    font-size: clamp(52px, 7vw, 86px);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: 0;
}

.branch-login-intro p:not(.eyebrow) {
    max-width: 420px;
    color: rgba(255, 250, 241, 0.88);
    font-size: 18px;
    line-height: 1.45;
}

.branch-login-card {
    border-top: 2px solid #17120f;
    border-radius: 0;
    background: rgba(255, 253, 247, 0.84);
    padding: 32px;
    box-shadow: 0 12px 34px rgba(40, 35, 31, 0.12);
    backdrop-filter: blur(12px);
}

.branch-card-heading {
    margin-bottom: 26px;
}

.branch-card-heading h2 {
    color: #17120f;
    font-size: 32px;
    font-weight: 900;
}

.branch-login-page .eyebrow {
    color: #087280;
    letter-spacing: 1.1px;
}

.branch-login-page .login-form label {
    color: #6c5a48;
}

.branch-login-page .login-form input {
    min-height: 48px;
    border: 1px solid #ddcfbd;
    border-radius: 8px;
    background: #fffdf7;
    color: #17120f;
    box-shadow: inset 0 1px 0 rgba(23, 18, 15, 0.04);
}

.branch-login-page .login-form button {
    border: 0;
    border-radius: 8px;
    background: #c69952;
    color: #17120f;
    box-shadow: 0 12px 24px rgba(198, 153, 82, 0.28);
    font-weight: 900;
}

.branch-login-page .login-form button:hover {
    background: #087280;
    color: #ffffff;
}

.branch-login-page .login-form button:disabled {
    background: #ddd2c2;
    color: #786958;
    box-shadow: none;
}

.branch-login-page .login-back-link {
    color: #17120f;
}

.branch-portal-page {
    --branch-bg: #686d71;
    --branch-panel: #f7f6f2;
    --branch-panel-soft: #eceae4;
    --branch-ink: #24272a;
    --branch-muted: #6a7074;
    --branch-line: #9da1a3;
    --branch-soft-line: #d5d3cd;
    --branch-slate: #4f565b;
    --branch-accent: #c46824;
    --branch-accent-dark: #8d481c;
    --branch-green: #5f8e6b;
    --branch-red: #a4645d;
    background:
        linear-gradient(180deg, #5f6468 0%, var(--branch-bg) 260px),
        var(--branch-bg);
    color: var(--branch-panel);
}

.branch-portal-page main {
    width: min(980px, calc(100% - 28px));
}

.branch-portal-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px 28px;
    padding: 54px 0 24px;
}

.branch-portal-hero .eyebrow {
    color: #ffffff;
    margin-bottom: 8px;
}

.branch-portal-hero h1 {
    color: #ffffff;
    max-width: none;
    font-size: clamp(42px, 7vw, 74px);
    letter-spacing: 0;
}

.branch-save-bar span {
    color: var(--branch-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.branch-stat-section,
.branch-updates-panel {
    color: var(--branch-ink);
}

.branch-stat-section {
    background: var(--branch-panel);
    border: 1px solid rgba(36, 39, 42, 0.12);
    box-shadow: 0 22px 55px rgba(36, 39, 42, 0.18);
}

.branch-utility-bar {
    justify-content: stretch;
}

.branch-utility-bar .actions {
    width: 100%;
    justify-content: space-between;
}

.quantity-readonly {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 36px;
    color: var(--branch-slate);
    font-size: 21px;
    font-weight: 900;
}

.branch-compare-wrap {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    border-top: 2px solid var(--branch-slate);
    background: transparent;
    padding-top: 8px;
}

.branch-stat-table {
    width: 100%;
    min-width: 620px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.branch-stat-table th,
.branch-stat-table td {
    border-bottom: 1px solid var(--branch-soft-line);
    height: 58px;
    padding: 7px 10px;
    vertical-align: middle;
}

.branch-stat-table thead th {
    color: var(--branch-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.branch-stat-table tbody tr:nth-child(even) th,
.branch-stat-table tbody tr:nth-child(even) td {
    background: var(--branch-panel-soft);
}

.branch-stat-table tbody tr:hover th,
.branch-stat-table tbody tr:hover td {
    background: #ffffff;
}

.branch-stat-table tbody tr.is-changed th,
.branch-stat-table tbody tr.is-changed td {
    background: #f4eadf;
}

.branch-stat-table tbody tr.is-increase th {
    box-shadow: inset 4px 0 0 var(--branch-green);
}

.branch-stat-table tbody tr.is-decrease th {
    box-shadow: inset 4px 0 0 var(--branch-red);
}

.branch-stat-table tbody th {
    color: var(--branch-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    text-align: left;
}

.branch-stat-table .item-header {
    width: 44%;
    text-align: left;
}

.branch-stat-table .branch-header,
.branch-stat-table .allocation,
.branch-stat-table .branch-delta-cell {
    text-align: center;
}

.branch-stat-table .branch-delta-cell {
    width: 112px;
}

.branch-request-control {
    display: grid;
    grid-template-columns: 42px 58px 42px;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    overflow: visible;
    gap: 6px;
}

.branch-request-control .quantity-value {
    width: 58px;
    min-height: 42px;
    border-color: var(--branch-line);
    background: #ffffff;
    color: var(--branch-ink);
    padding: 0 4px;
    text-align: center;
    font-size: 20px;
    font-weight: 900;
}

.branch-step-button {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border: 1px solid var(--branch-line);
    border-radius: 8px;
    background: var(--branch-slate) !important;
    color: #ffffff;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
    appearance: none;
}

.branch-step-button:hover {
    background: var(--branch-accent) !important;
    color: #ffffff;
}

.branch-step-button:active {
    background: var(--branch-accent-dark) !important;
    transform: translateY(1px);
}

.branch-step-button:disabled {
    color: var(--branch-muted);
    cursor: default;
    opacity: 0.55;
}

.branch-request-control .quantity-value.is-increase {
    border-color: var(--branch-green);
    background: #eef5ef;
    color: #315d3c;
}

.branch-request-control .quantity-value.is-decrease {
    border-color: var(--branch-red);
    background: #f5e9e6;
    color: #7f403a;
}

.branch-change-indicator {
    display: inline-grid;
    place-items: center;
    min-width: 54px;
    min-height: 32px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--branch-muted);
    font-size: 15px;
    font-weight: 900;
    white-space: nowrap;
    transition: transform 0.12s ease, background-color 0.12s ease;
}

.branch-change-indicator.is-increase {
    border-color: #b4c9b8;
    background: #e3eee3;
    color: #315d3c;
    transform: scale(1.04);
}

.branch-change-indicator.is-decrease {
    border-color: #d9b9b3;
    background: #efe2df;
    color: #7f403a;
    transform: scale(1.04);
}

.branch-change-indicator.is-same {
    color: var(--branch-muted);
}

.branch-date-label {
    margin-top: 4px;
    color: var(--branch-muted);
    font-weight: 700;
}

.branch-date-tools {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    margin-right: auto;
}

.branch-date-tools .distribution-date-arrow,
.branch-date-tools .distribution-date-current {
    color: var(--branch-ink);
}

.branch-date-tools .distribution-date-current {
    border-color: var(--branch-line);
    background: #ffffff;
}

.branch-date-tools .distribution-date-current:hover,
.branch-date-tools .distribution-date-arrow:hover {
    color: var(--branch-accent-dark);
}

.branch-date-tools .date-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.branch-request-table {
    margin-bottom: 14px;
    min-width: 520px;
}

.branch-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.branch-request-submit {
    display: flex;
    min-height: 42px;
    margin: 0;
    width: auto;
    border-color: var(--branch-accent);
    background: var(--branch-accent);
    color: #ffffff;
    padding: 0 18px;
}

.branch-request-submit:hover {
    background: var(--branch-accent-dark);
}

.branch-request-submit:disabled {
    border-color: var(--branch-soft-line);
    background: #d5d3cd;
    color: var(--branch-muted);
    cursor: default;
}

.branch-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-width: 620px;
    margin-top: 14px;
    border-top: 2px solid var(--branch-slate);
    background: rgba(247, 246, 242, 0.96);
    backdrop-filter: blur(8px);
    padding: 12px 0;
}

.branch-portal-message {
    border-left: 3px solid var(--branch-green);
    background: #e3eee3;
    margin: 0 0 12px;
    padding: 10px 12px;
    color: #315d3c;
    font-weight: 800;
}

.branch-portal-message.is-locked {
    border-left-color: var(--branch-red);
    background: #efe2df;
    color: #7f403a;
}

.branch-updates-panel {
    border-top: 1px solid rgba(255, 255, 255, 0.55);
    margin: 22px 0 42px;
    padding-top: 10px;
}

.branch-updates-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
    padding: 4px 0 12px;
}

.branch-updates-panel summary::-webkit-details-marker {
    display: none;
}

.branch-updates-panel summary span {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.branch-updates-panel summary em {
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.request-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 7px;
    background: var(--branch-panel-soft);
    color: var(--branch-ink);
    font-size: 12px;
    font-weight: 800;
}

.request-status.is-approved {
    background: #e3eee3;
    color: #315d3c;
}

.request-status.is-rejected {
    background: #efe2df;
    color: #7f403a;
}

@media (max-width: 760px) {
    .staff-login-shell {
        grid-template-columns: 1fr;
        align-content: start;
        gap: 18px;
        width: calc(100% - 24px);
        min-height: 100svh;
        padding: 14px 0 28px;
    }

    .staff-login-intro {
        min-height: 44svh;
    }

    .staff-login-copy {
        padding: 22px;
    }

    .staff-login-copy h1 {
        font-size: 46px;
    }

    .staff-login-card {
        padding: 24px;
    }

    .branch-login-shell {
        grid-template-columns: 1fr;
        align-content: start;
        gap: 18px;
        width: calc(100% - 24px);
        min-height: 100svh;
        padding: 14px 0 28px;
    }

    .branch-login-intro {
        min-height: 44svh;
    }

    .branch-login-intro h1 {
        font-size: 46px;
    }

    .branch-login-intro p:not(.eyebrow) {
        font-size: 16px;
    }

    .branch-login-copy {
        padding: 22px;
    }

    .branch-login-card {
        padding: 24px;
    }

    .branch-date-tools {
        justify-content: flex-start;
    }

    .branch-utility-bar .actions {
        align-items: center;
        flex-wrap: wrap;
    }

    .branch-portal-page main {
        width: calc(100% - 18px);
    }

    .branch-portal-hero {
        grid-template-columns: 1fr;
        gap: 14px;
        padding-top: 42px;
    }

    .branch-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .branch-action-row .save-button,
    .branch-action-row .secondary-button {
        width: 100%;
    }

    .branch-request-submit {
        flex: 0 0 auto;
    }

    .branch-save-bar {
        min-width: 620px;
    }
}

@media (max-width: 760px) {
    .staff-login-shell {
        position: relative;
        display: grid;
        grid-template: 1fr / 1fr;
        place-content: center;
        place-items: center;
        width: 100vw;
        height: 100svh;
        min-height: 100svh;
        padding: 0;
        overflow: hidden;
    }

    .staff-login-intro {
        position: absolute;
        inset: 0;
        width: 100vw;
        min-height: 100svh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .staff-login-photo-frame {
        inset: -4px;
    }

    .staff-login-photo-frame img {
        min-width: calc(100vw + 8px);
        min-height: calc(100svh + 8px);
    }

    .staff-login-photo-frame::after {
        background:
            linear-gradient(180deg, rgba(23, 20, 18, 0.62) 0%, rgba(23, 20, 18, 0.12) 34%, rgba(23, 20, 18, 0.54) 100%),
            linear-gradient(90deg, rgba(23, 20, 18, 0.5) 0%, rgba(23, 20, 18, 0) 58%);
    }

    .staff-login-copy {
        position: absolute;
        top: max(18px, env(safe-area-inset-top));
        left: 18px;
        max-width: 280px;
        padding: 0;
    }

    .staff-login-copy h1 {
        max-width: 250px;
        font-size: clamp(34px, 10vw, 46px);
    }

    .staff-login-card {
        position: relative;
        z-index: 2;
        width: min(310px, calc(100% - 44px));
        border-color: rgba(255, 253, 247, 0.44);
        border-radius: 8px;
        padding: 20px;
        background: rgba(255, 253, 247, 0.74);
        box-shadow: 0 16px 44px rgba(23, 20, 18, 0.28);
        backdrop-filter: blur(10px);
    }

    .staff-login-card h1 {
        margin-bottom: 16px;
        font-size: 34px;
    }

    .staff-login-card .eyebrow {
        margin-bottom: 8px;
    }

    .staff-login-card .login-form {
        gap: 10px;
    }

    .staff-login-card .login-form input {
        min-height: 42px;
    }

    .staff-login-card .login-form button {
        min-height: 42px;
    }

}

@media (max-width: 760px) and (max-height: 560px) {
    .staff-login-copy {
        top: max(12px, env(safe-area-inset-top));
        left: 16px;
        max-width: none;
    }

    .staff-login-copy .eyebrow {
        font-size: 9px;
    }

    .staff-login-copy h1 {
        max-width: none;
        margin-top: 4px;
        font-size: 32px;
        line-height: 1;
    }

    .staff-login-card {
        width: min(300px, calc(100% - 32px));
        padding: 16px 18px 18px;
    }

    .staff-login-card h1 {
        margin-top: 0;
        margin-bottom: 10px;
        font-size: 30px;
    }

    .staff-login-card .login-form {
        gap: 8px;
    }
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 26px;
}

.resource-search {
    margin: 0 0 22px;
    max-width: 520px;
}

.add-recipe-row {
    margin: 0 0 26px;
    max-width: 420px;
}

.log-purchase-row {
    margin: 0 0 32px;
    max-width: 620px;
}

.resource-search label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.resource-search input {
    width: 100%;
    border: 0;
    border-bottom: 2px solid var(--ink);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-size: 18px;
    min-height: 42px;
    padding: 4px 0;
}

.resource-search input:focus {
    outline: 0;
    border-bottom-color: var(--copper);
}

.resource-tabs {
    margin-bottom: 26px;
}

.local-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--faint);
    margin-bottom: 14px;
    overflow-x: auto;
}

.local-tab {
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    min-height: 38px;
    padding: 0 2px;
}

.local-tab:hover,
.local-tab.is-active {
    background: transparent;
    color: var(--ink);
    border-bottom-color: var(--copper);
}

.tab-panel {
    display: none;
    max-width: 620px;
}

.tab-panel.is-active {
    display: block;
}

.work-form,
.recipe-card {
    border-top: 2px solid var(--ink);
    padding-top: 12px;
}

.stacked-panel {
    display: grid;
    gap: 18px;
}

.work-form {
    display: grid;
    gap: 11px;
}

.work-form[hidden] {
    display: none;
}

.work-form h2,
.recipe-card h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 21px;
}

.work-form p,
.recipe-head p {
    color: var(--muted);
    margin-top: 3px;
}

.work-form label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.work-form label[hidden] {
    display: none;
}

.work-form input,
.work-form select,
.work-form textarea,
.inline-form input,
.inline-form select {
    width: 100%;
    border: 1px solid #c8bbaa;
    border-radius: 7px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    min-height: 36px;
    padding: 7px 9px;
}

.work-form input[type="checkbox"],
.work-form input[type="radio"] {
    width: 16px;
    min-height: 0;
    padding: 0;
}

.work-form .checkbox-line,
.work-form .radio-line {
    text-transform: none;
}

.work-form textarea {
    resize: vertical;
}

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

.form-grid[hidden] {
    display: none;
}

.compact-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.data-section,
.recipe-list {
    padding-bottom: 40px;
}

.simple-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.simple-table th,
.simple-table td {
    border-bottom: 1px solid var(--faint);
    padding: 10px 8px;
    text-align: left;
}

.simple-table thead th {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.simple-table tbody th {
    font-family: Georgia, "Times New Roman", serif;
}

.finance-total-row th,
.finance-total-row td {
    border-bottom: none;
    border-top: 2px solid var(--ink);
    font-weight: 700;
    font-size: 1.05em;
}

.link-button {
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    padding: 0;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
}

.link-button:hover {
    background: transparent;
    color: var(--copper-dark);
    text-decoration-color: var(--copper-dark);
}

.inline-edit-table {
    min-width: 720px;
}

.inline-field,
.inline-save,
.inline-delete {
    display: none;
}

.inline-value {
    display: inline;
}

.price-as-of {
    display: block;
    font-size: 0.75rem;
    color: var(--muted, #8a7a68);
}

.price-as-of-fallback {
    font-style: italic;
}

.editable-row.is-editing .inline-edit-trigger,
.editable-row.is-editing .inline-value,
.editable-row.is-editing .price-as-of {
    display: none;
}

.editable-row.is-editing .inline-field {
    display: block;
}

.editable-row.is-editing .inline-save,
.editable-row.is-editing .inline-delete {
    display: inline-grid;
    place-items: center;
}

.inline-edit-table .inline-field {
    width: 100%;
    min-height: 30px;
    border: 1px solid #c8bbaa;
    border-radius: 6px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    padding: 4px 7px;
}

.inline-save {
    min-height: 28px;
    border: 1px solid var(--copper);
    border-radius: 6px;
    background: var(--copper);
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 0 10px;
}

.inline-delete-form {
    margin: 0;
}

.inline-delete {
    min-height: 28px;
    border: 1px solid #ba3f35;
    border-radius: 6px;
    background: transparent;
    color: #ba3f35;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 0 10px;
}

.inline-delete:hover {
    background: #ba3f35;
    color: #fff;
}

.editable-row.is-editing th,
.editable-row.is-editing td {
    background: var(--paper);
}

.note-button {
    display: block;
    width: min(240px, 100%);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    padding: 0;
    text-align: left;
    text-decoration: none;
    text-underline-offset: 3px;
}

.note-button:hover {
    background: transparent;
    color: var(--copper-dark);
}

.note-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    background: rgba(40, 35, 31, 0.38);
    padding: 18px;
}

.note-modal[hidden] {
    display: none;
}

.note-dialog {
    width: min(520px, 100%);
    max-height: min(420px, calc(100vh - 48px));
    overflow: auto;
    border-top: 3px solid var(--ink);
    background: var(--panel);
    box-shadow: 0 16px 44px rgba(40, 35, 31, 0.28);
    padding: 18px;
}

.note-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--faint);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.note-head h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
}

.resource-detail-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--faint);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    width: 28px;
    height: 28px;
    min-height: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.icon-button:hover {
    border-color: var(--copper);
    color: var(--copper-dark);
}

#note-body {
    color: var(--ink);
    line-height: 1.5;
    white-space: pre-wrap;
}

.resource-detail-dialog {
    width: min(720px, 100%);
    max-height: min(720px, calc(100vh - 48px));
}

.resource-detail-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px 20px;
    margin: 0 0 16px;
}

.resource-detail-facts dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
}

.resource-detail-facts dd {
    margin: 2px 0 0;
    color: var(--ink);
    font-weight: 600;
}

#resource-detail-notes-row {
    grid-column: 1 / -1;
}

.resource-detail-chart-wrap {
    border: 1px solid var(--faint);
    border-radius: 8px;
    background: var(--cream, #fbf6ee);
    padding: 8px;
    margin-bottom: 16px;
}

#resource-detail-chart {
    width: 100%;
    height: 160px;
    display: block;
}

.chart-axis {
    stroke: var(--faint);
    stroke-width: 1;
}

.chart-line {
    fill: none;
    stroke: var(--copper);
    stroke-width: 2;
}

.chart-point {
    fill: var(--copper);
}

.chart-point-created {
    fill: var(--muted);
}

.chart-label {
    font-size: 10px;
    fill: var(--muted);
}

.chart-label-end {
    text-anchor: end;
}

.resource-detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.simple-table.compact th,
.simple-table.compact td {
    padding: 7px 6px;
}

.recipe-list {
    display: grid;
    gap: 24px;
}

.recipe-card {
    display: grid;
    gap: 12px;
}

.recipe-page {
    max-width: 760px;
    background: var(--panel);
    border-top: 3px solid var(--ink);
    padding: 18px 20px 20px;
    box-shadow: 0 1px 3px rgba(40, 35, 31, 0.1);
}

.recipe-title {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
}

.recipe-title h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 31px;
    line-height: 1.1;
}

.recipe-title p,
.muted-line {
    color: var(--muted);
    margin-top: 5px;
}

.recipe-section {
    display: grid;
    gap: 8px;
}

.recipe-section h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
}

.ingredient-list {
    margin: 0;
    padding-left: 24px;
    line-height: 1.45;
}

.ingredient-list span {
    color: var(--muted);
    font-size: 12px;
}

.method-preview {
    border-left: 2px solid var(--ink);
    color: var(--ink);
    line-height: 1.5;
    padding: 2px 0 2px 12px;
    white-space: normal;
}

.method-preview span {
    color: var(--muted);
}

.recipe-add-ingredient,
.recipe-method-form {
    display: grid;
    gap: 8px;
}

.recipe-add-ingredient {
    grid-template-columns: minmax(180px, 1fr) 120px 110px auto;
    align-items: center;
    margin-top: 6px;
}

.recipe-add-ingredient select,
.recipe-add-ingredient input,
.recipe-method-form input,
.recipe-method-form textarea {
    width: 100%;
    border: 1px solid #c8bbaa;
    border-radius: 7px;
    background: var(--page);
    color: var(--ink);
    font: inherit;
    min-height: 36px;
    padding: 7px 9px;
}

.recipe-method-form label {
    display: grid;
    max-width: 180px;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.recipe-method-form textarea {
    resize: vertical;
    line-height: 1.45;
}

.recipe-method-form button {
    justify-self: start;
}

.recipe-summary-card .recipe-title h2 a {
    color: var(--ink);
    text-decoration: none;
}

.recipe-summary-card .recipe-title h2 a:hover {
    color: var(--copper-dark);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.recipe-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 24px;
    align-items: start;
    padding-bottom: 40px;
}

.recipe-workspace.is-viewing {
    grid-template-columns: minmax(0, 760px);
}

.recipe-pdf-preview {
    min-height: 760px;
    background: #fffdfa;
    border: 1px solid #dfd6c9;
    box-shadow: 0 10px 28px rgba(40, 35, 31, 0.12);
    padding: 34px 36px;
}

.recipe-pdf-preview h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    line-height: 1.1;
    margin-bottom: 46px;
}

.recipe-pdf-preview section {
    margin-bottom: 22px;
}

.recipe-pdf-preview h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    margin-bottom: 8px;
}

.recipe-pdf-preview ul {
    margin: 0;
    padding-left: 24px;
    line-height: 1.5;
}

.preview-ingredient-list li {
    display: list-item;
    margin-bottom: 4px;
}

.preview-ingredient-list.is-editable {
    list-style: none;
    padding-left: 0;
}

.preview-ingredient-list.is-editable li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 6px;
}

.preview-ingredient-list.is-editable li[draggable="true"] {
    cursor: grab;
}

.preview-ingredient-list.is-editable li.is-dragging {
    opacity: 0.4;
    background: #ead9ce;
}

.drag-handle {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 13px;
    user-select: none;
}

.ingredient-menu {
    position: relative;
    flex-shrink: 0;
    margin-left: auto;
}

.kebab-button {
    min-height: 26px;
    width: 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
}

.kebab-button:hover {
    background: #ead9ce;
    color: var(--ink);
}

.ingredient-menu-popover {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 10;
    display: grid;
    min-width: 110px;
    margin-top: 2px;
    background: var(--panel);
    border: 1px solid var(--faint);
    border-radius: 7px;
    box-shadow: 0 8px 20px rgba(40, 35, 31, 0.18);
    overflow: hidden;
}

.ingredient-menu-popover[hidden] {
    display: none;
}

.ingredient-menu-popover button {
    min-height: 34px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    padding: 0 12px;
}

.ingredient-menu-popover button:hover {
    background: #ead9ce;
}

.ingredient-menu-popover .ingredient-menu-delete {
    color: #ba3f35;
}

.ingredient-menu-popover .inline-delete-form {
    display: contents;
}

.ingredient-text {
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    padding: 0;
    text-align: left;
}

.ingredient-text span {
    color: var(--muted);
    font-size: 12px;
    margin-left: 6px;
}

.scraps-tag {
    font-style: italic;
}

.ingredient-text:hover {
    background: transparent;
    color: var(--copper-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mini-delete {
    min-height: 24px;
    margin-left: 8px;
    border-color: #ba3f35;
    background: transparent;
    color: #ba3f35;
    font-size: 11px;
    padding: 0 8px;
}

.mini-edit {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.simple-table .inline-delete-form {
    display: inline-block;
}

.mini-delete:hover {
    background: #ba3f35;
    color: #fff;
}

.recipe-pdf-preview p {
    line-height: 1.55;
    white-space: normal;
}

.quick-add-row {
    display: grid;
    gap: 8px;
    align-items: center;
}

.recipe-scale-line {
    color: var(--muted);
    margin: -36px 0 40px;
}

.recipe-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    padding: 14px 18px;
    background: #ede6d8;
    border: 1px solid var(--faint);
    border-radius: 8px;
}

.cost-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0;
}

.cost-summary div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cost-summary dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.cost-summary dd {
    margin: 0;
    color: var(--copper-dark);
    font-size: 19px;
    font-weight: 700;
}

.scale-form {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: auto;
}

.scale-form label {
    display: grid;
    gap: 4px;
}

.scale-form .field-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.scale-form .field-with-suffix {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scale-form .field-suffix {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.scale-form input {
    width: 90px;
    min-height: 36px;
    border: 1px solid #c8bbaa;
    border-radius: 7px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    padding: 0 8px;
}

.scale-form button {
    min-height: 36px;
}

.reset-scale-link {
    align-self: center;
    color: var(--copper-dark);
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
}

.quick-add-row input,
.quick-add-row select {
    width: 100%;
    border: 1px solid #c8bbaa;
    border-radius: 7px;
    background: var(--page);
    color: var(--ink);
    font: inherit;
    min-height: 32px;
    padding: 5px 8px;
}

.no-cost-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.quick-add-row .no-cost-toggle input,
.inline-ingredient-form .no-cost-toggle input {
    width: auto;
    min-height: 0;
    padding: 0;
}

.quick-add-row {
    grid-template-columns: 34px minmax(180px, 1fr) 100px 92px auto;
    margin-top: 12px;
}

.recipe-editor {
    display: grid;
    gap: 18px;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 110px 110px auto;
    gap: 8px;
    align-items: center;
}

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

    .purchase-overview-grid {
        grid-template-columns: 1fr;
    }

    .stock-hero,
    .stock-card,
    .stock-card-main {
        grid-template-columns: 1fr;
    }

    .stock-list {
        gap: 7px;
        border: 0;
        background: transparent;
        overflow: visible;
    }

    .stock-list-head {
        display: none;
    }

    .stock-card {
        gap: 9px;
        border: 1px solid var(--faint);
        border-left: 3px solid var(--ink);
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.56);
    }

    .stock-card.stock-status-low {
        border-left-color: #a7331f;
        box-shadow: none;
    }

    .stock-card.stock-status-needs_count,
    .stock-card.stock-status-no_count {
        border-left-color: #b66a30;
        box-shadow: none;
    }

    .stock-card-main {
        display: grid;
        gap: 8px;
    }

    .stock-hero-actions {
        justify-content: flex-start;
    }

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

    .stock-attention-strip {
        display: flex;
    }

    .stock-attention-card {
        flex: 1 1 0;
    }

    .stock-attention-card span {
        font-size: 9px;
    }

    .stock-metrics {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px 0;
    }

    .stock-metrics span,
    .stock-expected > span {
        display: block;
    }

    .stock-metrics div {
        padding: 2px 10px;
        border-left: 1px solid var(--faint);
    }

    .stock-metrics div:first-child {
        padding-left: 0;
        border-left: 0;
    }

    .stock-metrics div:nth-child(3) {
        padding-left: 0;
        border-left: 0;
    }

    .stock-actions {
        justify-content: flex-start;
    }

    .stock-action-panel[open] summary {
        margin-left: 0;
    }

    .stock-expected {
        text-align: left;
    }

    .stock-count-form input[type="date"],
    .stock-count-form input[type="number"],
    .stock-count-form select,
    .stock-low-form input {
        width: 100%;
    }

    .stock-count-form button,
    .stock-low-form button {
        width: 100%;
    }

    .finance-log-grid {
        grid-template-columns: 1fr;
    }

    .expense-entry-section {
        grid-template-columns: 1fr;
    }

    .public-home {
        background: #f4efe6;
        scroll-snap-type: none;
        overflow-x: hidden;
    }

    .public-shell {
        display: block;
        width: 100vw;
        min-height: 100svh;
        padding: 0;
        overflow-x: hidden;
    }

    .public-nav {
        position: fixed;
        top: max(4px, env(safe-area-inset-top));
        right: max(8px, env(safe-area-inset-right));
        z-index: 5;
        gap: 6px;
        justify-content: flex-end;
    }

    .public-nav a {
        min-height: 26px;
        border-color: rgba(40, 35, 31, 0.22);
        background: rgba(244, 239, 230, 0.76);
        color: var(--ink);
        font-size: 13px;
        backdrop-filter: blur(10px);
    }

    .public-login-link {
        padding: 0 9px;
    }

    .public-social-link {
        width: 28px;
    }

    .public-social-group {
        gap: 3px;
    }

    .public-social-link svg {
        width: 14px;
        height: 14px;
        stroke-width: 2;
    }

    .public-hero {
        position: relative;
        display: grid;
        grid-template-columns: 1fr;
        align-items: end;
        left: auto;
        width: 100vw;
        height: var(--public-reel-height, 100dvh);
        min-height: var(--public-reel-height, 100dvh);
        margin: 0;
        padding: max(82px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
        overflow: hidden;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        touch-action: none;
    }

    .public-video-frame {
        position: absolute;
        inset: -4px;
        width: calc(100% + 8px);
        height: calc(100% + 8px);
        transform: none;
        aspect-ratio: auto;
        border: 0;
        border-radius: 0;
        background: #f4efe6;
        box-shadow: none;
    }

    .public-video {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 100%;
        height: 100%;
        min-width: calc(100vw + 8px);
        min-height: calc(var(--public-reel-height, 100dvh) + 8px);
        transform: translate(-50%, -50%);
        object-fit: cover;
    }

    .public-video-frame::after {
        content: "";
        position: absolute;
        inset: 0;
        background:
            linear-gradient(180deg, rgba(23, 20, 18, 0.28) 0%, rgba(23, 20, 18, 0.08) 38%, rgba(23, 20, 18, 0.78) 100%),
            linear-gradient(90deg, rgba(23, 20, 18, 0.2) 0%, rgba(23, 20, 18, 0) 44%);
        pointer-events: none;
    }

    .public-copy {
        position: relative;
        z-index: 2;
        max-width: 420px;
        padding-top: 0;
        text-align: left;
        text-shadow: 0 1px 18px rgba(0, 0, 0, 0.42);
    }

    .public-kicker {
        color: #f3c4a9;
    }

    .public-hero h1 {
        max-width: 360px;
        color: #fffaf1;
        font-size: clamp(48px, 15vw, 76px);
        line-height: 0.9;
    }

    .public-intro {
        max-width: 330px;
        margin-right: 0;
        margin-left: 0;
        color: rgba(255, 250, 241, 0.88);
        font-size: 16px;
        line-height: 1.42;
    }

    .public-scroll-cue {
        right: auto;
        left: 50%;
        bottom: max(64px, calc(env(safe-area-inset-bottom) + 46px));
        z-index: 3;
        width: 34px;
        height: 34px;
        color: #fffaf1;
        font-size: 34px;
        animation-name: publicScrollCueMobile;
        text-shadow: none;
    }

    .public-about-reel {
        align-items: start;
        height: var(--public-reel-height, 100dvh);
        min-height: var(--public-reel-height, 100dvh);
        padding: max(38px, calc(env(safe-area-inset-top) + 34px)) 14px max(22px, env(safe-area-inset-bottom));
        background: #f4efe6;
        overflow: hidden;
        scroll-snap-stop: always;
        touch-action: none;
    }

    .public-about-reel .public-kicker {
        color: var(--copper-dark);
        margin-bottom: 8px;
        font-size: 13px;
        letter-spacing: 1px;
    }

    .public-about-copy h1 {
        max-width: 315px;
        font-size: clamp(44px, 13.7vw, 56px);
        line-height: 0.93;
    }

    .public-about-copy blockquote {
        width: 100%;
        max-width: none;
        margin-top: 16px;
        font-size: 29px;
        line-height: 1.12;
    }

    .public-profile-notes {
        grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
        gap: 14px;
        margin-top: 22px;
        padding-top: 16px;
    }

    .public-profile-notes span {
        margin-bottom: 7px;
        font-size: 15px;
        letter-spacing: 1px;
    }

    .public-profile-notes p {
        font-size: 15px;
        line-height: 1.42;
    }

    .public-profile-notes > div:first-child p {
        font-size: 16px;
    }

    .public-contact-socials {
        gap: 5px;
        margin-top: 8px;
    }

    .public-contact-link {
        gap: 5px;
    }

    .public-contact-link span {
        font-size: 12px;
        letter-spacing: 0;
        overflow-wrap: normal;
        white-space: nowrap;
    }

    .public-contact-link svg {
        width: 13px;
        height: 13px;
    }

    .public-profile-subhead {
        margin-top: 11px;
    }

    @media (max-width: 430px) {
        .public-hero h1 {
            font-size: clamp(42px, 14vw, 58px);
        }

    }

    @media (max-width: 460px) {
        .public-about-reel {
            padding-right: 12px;
            padding-left: 12px;
        }

        .public-about-copy h1 {
            font-size: clamp(42px, 13vw, 54px);
        }

        .public-about-copy blockquote {
            font-size: 28px;
            line-height: 1.08;
        }

        .public-profile-notes {
            gap: 10px;
            margin-top: 16px;
            padding-top: 12px;
        }

        .public-profile-notes span {
            margin-bottom: 5px;
            font-size: 14px;
        }

        .public-profile-notes p,
        .public-profile-notes > div:first-child p {
            font-size: 14px;
            line-height: 1.24;
        }
    }

    @media (min-width: 354px) and (max-width: 410px) {
        .public-about-copy h1 {
            font-size: clamp(40px, 12.7vw, 52px);
        }

        .public-about-copy blockquote {
            margin-top: 13px;
            font-size: 26px;
            line-height: 1.06;
        }

        .public-profile-notes {
            gap: 8px;
            margin-top: 13px;
            padding-top: 10px;
        }

        .public-profile-notes > div {
            min-width: 0;
        }

        .public-profile-notes span {
            font-size: 13px;
        }

        .public-profile-notes p,
        .public-profile-notes > div:first-child p {
            font-size: 13px;
            line-height: 1.22;
        }
    }

    @media (max-width: 360px) {
        .public-about-reel {
            padding-right: 10px;
            padding-left: 10px;
        }

        .public-about-copy h1 {
            font-size: clamp(38px, 12.4vw, 48px);
        }

        .public-about-copy blockquote {
            margin-top: 12px;
            font-size: 25px;
            line-height: 1.04;
        }

        .public-profile-notes {
            gap: 8px;
            margin-top: 12px;
            padding-top: 10px;
        }

        .public-profile-notes span {
            margin-bottom: 4px;
            font-size: 13px;
        }

        .public-profile-notes p,
        .public-profile-notes > div:first-child p {
            font-size: 13px;
            line-height: 1.2;
        }

        .public-contact-socials {
            gap: 4px;
            margin-top: 5px;
        }

        .public-profile-subhead {
            margin-top: 6px;
        }
    }

    @media (max-height: 850px) {
        .public-about-reel {
            padding-top: max(34px, calc(env(safe-area-inset-top) + 30px));
            padding-bottom: max(16px, env(safe-area-inset-bottom));
        }

        .public-about-copy blockquote {
            margin-top: 14px;
            line-height: 1.08;
        }

        .public-profile-notes {
            gap: 12px;
            margin-top: 16px;
            padding-top: 13px;
        }

        .public-profile-notes span {
            margin-bottom: 5px;
            font-size: 14px;
        }

        .public-profile-notes p,
        .public-profile-notes > div:first-child p {
            font-size: 14px;
            line-height: 1.28;
        }

        .public-profile-subhead {
            margin-top: 8px;
        }
    }

    @media (max-height: 720px) {
        .public-about-reel {
            padding-top: max(28px, calc(env(safe-area-inset-top) + 24px));
            padding-bottom: max(12px, env(safe-area-inset-bottom));
        }

        .public-about-reel .public-kicker {
            margin-bottom: 5px;
        }

        .public-about-copy h1 {
            font-size: clamp(40px, 12.6vw, 52px);
        }

        .public-about-copy blockquote {
            margin-top: 11px;
            font-size: 27px;
            line-height: 1.04;
        }

        .public-profile-notes {
            gap: 10px;
            margin-top: 12px;
            padding-top: 10px;
        }

        .public-profile-notes span {
            margin-bottom: 4px;
            font-size: 13px;
        }

        .public-profile-notes p,
        .public-profile-notes > div:first-child p {
            font-size: 13px;
            line-height: 1.22;
        }

        .public-contact-socials {
            gap: 4px;
            margin-top: 6px;
        }

        .public-profile-subhead {
            margin-top: 6px;
        }
    }

    .brand-bar {
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px 0;
        position: sticky;
        top: 0;
        z-index: 20;
        box-shadow: 0 1px 0 var(--faint);
    }

    .brand-name {
        font-size: 19px;
        line-height: 1.15;
        padding: 0 2px;
        text-align: center;
        width: 100%;
    }

    .tabs {
        display: flex;
        gap: 4px;
        margin: 0 -12px;
        overflow-x: auto;
        padding: 0 12px;
        scrollbar-width: none;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        flex: 0 0 auto;
        min-height: 40px;
        padding: 11px 9px 9px;
        border-bottom-width: 2px;
        font-size: 13px;
    }

    main {
        width: calc(100% - 20px);
    }

    .workbook-hero {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 28px 0 20px;
    }

    h1 {
        font-size: 40px;
        line-height: 1;
    }

    .work-form {
        padding-top: 12px;
    }

    .work-form h2,
    .recipe-card h2,
    .section-bar h2 {
        font-size: 25px;
        line-height: 1.05;
    }

    .date-form {
        padding-bottom: 0;
    }

    .date-form input {
        flex: 1;
        min-width: 0;
    }

    .distribution-toolbar {
        align-items: baseline;
        flex-direction: row;
        gap: 14px;
    }

    .distribution-date-picker {
        grid-template-columns: 22px minmax(0, auto) 22px;
        width: auto;
    }

    .distribution-date-current {
        min-width: 0;
    }

    .distribution-actions {
        margin-left: 0;
        width: 100%;
    }

    .section-bar {
        align-items: start;
        display: block;
    }

    .actions {
        margin-top: 10px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        justify-content: stretch;
    }

    .actions .export-link,
    .actions > button,
    .actions > label > button,
    .work-form button {
        width: 100%;
        min-width: 0;
        text-align: center;
    }

    .distribution-table-actions {
        display: flex;
        justify-content: flex-end;
        margin-top: 0;
    }

    .distribution-table-actions > button,
    .distribution-table-actions > label > button {
        width: auto;
    }

    .sheet-wrap {
        margin: 0 -10px;
        padding: 0 10px 6px;
    }

    .recipe-list .sheet-wrap {
        overflow: visible;
    }

    .recipe-list .simple-table,
    .recipe-list .simple-table thead,
    .recipe-list .simple-table tbody,
    .recipe-list .simple-table tr,
    .recipe-list .simple-table th,
    .recipe-list .simple-table td {
        display: block;
        width: 100%;
    }

    .recipe-list .simple-table thead {
        display: none;
    }

    .recipe-list .simple-table tr {
        border-top: 2px solid var(--ink);
        padding: 12px 0;
    }

    .recipe-list .simple-table th,
    .recipe-list .simple-table td {
        border-bottom: 0;
        padding: 4px 0;
    }

    .recipe-list .simple-table tbody th {
        font-size: 23px;
        line-height: 1.05;
    }

    .recipe-list .simple-table td[data-label] {
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 10px;
        align-items: start;
    }

    .recipe-list .simple-table td[data-label]::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }

    .recipe-list .simple-table td[data-label="Open"],
    .recipe-list .simple-table td[data-label="PDF"],
    .recipe-list .simple-table td[data-label="Delete"] {
        display: inline-flex;
        width: auto;
        margin: 8px 8px 0 0;
    }

    .recipe-list .simple-table td[data-label="Open"]::before,
    .recipe-list .simple-table td[data-label="PDF"]::before,
    .recipe-list .simple-table td[data-label="Delete"]::before {
        content: "";
        display: none;
    }

    .recipe-list .simple-table .export-link,
    .recipe-list .simple-table .mini-delete {
        min-height: 34px;
        padding: 7px 12px;
    }

    .scraps-badge,
    .needs-editing-badge {
        margin-top: 6px;
        width: max-content;
    }

    .ticket-line,
    .receipt-row .ticket-line {
        grid-template-columns: minmax(0, 1fr) auto auto;
    }

    .ticket-line .ticket-code,
    .ticket-line .ticket-code-wrap {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .ticket-line .ticket-code-wrap {
        align-items: flex-start;
    }

    .tickets-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .split-layout,
    .form-grid,
    .settings-grid,
    .inline-form,
    .recipe-add-ingredient,
    .recipe-workspace,
    .recipe-workspace.is-viewing,
    .quick-add-row {
        grid-template-columns: 1fr;
    }

    .recipe-pdf-preview {
        min-height: 0;
        padding: 24px 18px;
    }

    .recipe-scale-line {
        margin: -24px 0 28px;
    }

    .recipe-control-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .scale-form {
        margin-left: 0;
    }
}

@media print {
    @page {
        margin: 4mm;
        size: 58mm auto;
    }

    body {
        background: #fff;
    }

    .ticket {
        box-shadow: none;
    }

    .ticket::before {
        background-image: radial-gradient(circle at 6px 6px, #fff 6px, transparent 6.5px);
    }

    .brand-bar,
    .workbook-hero,
    .sheet-section,
    .recipe-control-bar,
    .print-button,
    .print-ticket-button,
    .ticket-actor {
        display: none;
    }

    main {
        width: 100%;
    }

    .tickets-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }

    body.is-printing-ticket * {
        visibility: hidden;
    }

    body.is-printing-ticket .print-target,
    body.is-printing-ticket .print-target * {
        visibility: visible;
    }

    body.is-printing-ticket .print-target {
        box-shadow: none;
        left: 0;
        position: absolute;
        top: 0;
        width: 50mm;
    }
}
