:root {
    --bg-primary: #f6f1ea;
    --bg-secondary: #fffdf9;
    --bg-card: #ffffff;
    --text-primary: #2a2420;
    --text-secondary: rgba(42, 36, 32, 0.64);
    --accent: #8c6239;
    --accent-light: #a67c4e;
    --accent-dark: #6e4c2b;
}
.header.scrolled {
    background: rgba(246, 241, 234, 0.94);
    box-shadow: 0 1px 0 rgba(42, 36, 32, 0.06);
}
.book-page { padding: 7.5rem 0 4rem; }
.book-step { margin-bottom: 0; padding-bottom: 0.9rem; }
.book-wrap { max-width: 720px; margin: 0 auto; }
.book-kicker {
    color: var(--accent);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}
.book-page h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); margin-bottom: 0.6rem; }
.book-lead { color: var(--text-secondary); margin-bottom: 1.5rem; max-width: 38rem; }
.book-summary {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}
.book-summary strong { color: var(--text-primary); font-weight: 500; }
.book-back {
    background: none;
    border: 0;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    padding: 0;
    margin-bottom: 1rem;
}
.book-grid { display: grid; gap: 0.75rem; }
.book-card, .book-day, .book-time {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid rgba(212, 165, 116, 0.28);
    border-radius: 16px;
    cursor: pointer;
    font: inherit;
    text-align: left;
}
.book-card { padding: 1rem 1.15rem; width: 100%; }
.book-card strong, .choice-title {
    display: block;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
}
.book-card span, .book-note, .choice-meta { color: var(--text-secondary); font-size: 0.92rem; }
.book-card small { display: block; margin-top: 0.35rem; color: var(--accent-light); }
.book-card:hover, .book-day:hover, .book-time:hover,
.book-card.active, .book-day.active, .book-time.active { border-color: var(--accent); }
.place-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    border-left: 4px solid var(--loc, var(--accent));
}
.place-card:hover, .place-card.active {
    border-color: var(--accent);
    border-left-color: var(--loc, var(--accent));
}
.place-card .addr-pill {
    color: #fffdf9;
    font-size: 0.86rem;
    padding: 0.22rem 0.7rem;
}
.book-block { margin-top: 0.4rem; }
.book-block h3 {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 0.7rem;
}
.detail-card {
    display: grid;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.08);
    border-left: 4px solid var(--loc, var(--accent));
    border-radius: 16px;
    padding: 1rem 1.05rem;
    margin-bottom: 1.35rem;
}
.detail-service {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
}
.detail-service strong { display: block; font-weight: 500; }
.detail-service span { color: var(--text-secondary); font-size: 0.92rem; }
.detail-card .addr-pill { justify-self: start; }
.book-channels { border: 0; margin: 0 0 0.95rem; padding: 0; }
.book-channels legend { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.channel-row { display: flex; flex-wrap: wrap; gap: 0.35rem 1.15rem; margin-bottom: 0.15rem; }
.channel-row .book-check { margin: 0; }
.book-cat {
    margin: 1.35rem 0 0.7rem;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
}
.book-cat:first-of-type { margin-top: 1.15rem; }
.book-datebar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid rgba(212, 165, 116, 0.35);
    border-radius: 16px;
    padding: 0.95rem 1.1rem;
    font: inherit;
    cursor: pointer;
    text-align: left;
}
.book-datebar span { color: var(--text-secondary); }
.book-datebar strong { font-weight: 500; }
.book-cal { margin-top: 0.8rem; }
.book-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.7rem;
}
.book-cal-head strong { font-weight: 500; text-transform: capitalize; }
.book-cal-head button {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    border: 1px solid rgba(212, 165, 116, 0.35);
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 1.3rem;
    cursor: pointer;
}
.book-cal-head button:disabled { opacity: 0.3; cursor: default; }
.book-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem; }
.book-cal-dow { text-align: center; color: var(--text-secondary); font-size: 0.75rem; padding-bottom: 0.2rem; }
.book-cal-cell {
    min-height: 2.7rem;
    border-radius: 12px;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
}
.book-cal-cell.is-on { background: var(--bg-card); cursor: pointer; }
.book-cal-cell.is-off { color: rgba(42, 36, 32, 0.28); }
.book-cal-cell.is-picked,
.book-cal-cell.is-mine { background: var(--accent); color: #fffdf9; }
.book-cal-cell.is-other { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.book-cal-cell.is-both { box-shadow: inset 0 0 0 3px #fffdf9, inset 0 0 0 5px var(--accent-dark); }
.book-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; color: var(--text-secondary); font-size: 0.88rem; margin: 0.2rem 0 0.8rem; }
.book-legend.is-places { flex-direction: column; align-items: flex-start; gap: 0.28rem; }
.legend-place { display: inline-flex; align-items: center; gap: 0.45rem; }
.book-legend .swatch { width: 0.9rem; height: 0.9rem; border-radius: 4px; display: inline-block; }
.book-legend .swatch.is-mine { background: var(--accent); }
.book-legend .swatch.is-other,
.book-legend .swatch.is-both { margin-left: 0.7rem; }
.book-legend .swatch.is-other { box-shadow: inset 0 0 0 1.5px var(--accent); }
.book-legend .swatch.is-both { background: var(--accent); box-shadow: inset 0 0 0 2px #fffdf9, inset 0 0 0 3.5px var(--accent-dark); }
.book-phone-row { display: flex; gap: 0.6rem; align-items: stretch; flex-wrap: wrap; }
.book-phone-row input { flex: 1 1 12rem; }
.book-code-btn { padding: 0.75rem 1rem; letter-spacing: 0.04em; }
.is-hidden { display: none; }
.book-cal-cell.is-empty { visibility: hidden; }
.book-period { margin-top: 1.15rem; }
.book-period h3 {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.55rem;
}
.book-period h3 span {
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}
.book-times { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.book-time { padding: 0.7rem 0.95rem; }
.book-field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.9rem; }
.book-field span { font-size: 0.85rem; color: var(--text-secondary); }
.book-field input, .book-field textarea, .book-field select {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid rgba(42, 36, 32, 0.14);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font: inherit;
    width: 100%;
}
.book-check { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.4rem 0 1rem; font-size: 0.92rem; }
.book-check input { margin-top: 0.3rem; }
.book-error { color: #9c3b3b; min-height: 1.4rem; margin-bottom: 0.6rem; }
.book-success {
    background: var(--bg-card);
    border: 1px solid rgba(212, 165, 116, 0.35);
    border-radius: 18px;
    padding: 1.4rem 1.3rem;
}
.book-success h2 { margin-bottom: 0.4rem; }
.book-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.2rem; }
.book-tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 1rem 0 1.2rem; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; margin: 0.2rem 0 0.8rem; }
.stat-card {
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.08);
    border-radius: 14px;
    padding: 0.75rem 0.85rem;
}
.stat-card span, .stat-line span { color: var(--text-secondary); }
.stat-line span { min-width: 0; }
.stat-card span { display: block; font-size: 0.78rem; }
.stat-card b { display: block; margin-top: 0.2rem; font-size: 1.15rem; font-weight: 500; }
.stat-card small, .stat-line small { font-size: 0.82rem; font-weight: 400; color: var(--text-secondary); }
.stat-block { margin: 1.15rem 0; }
.stat-block h3 { font-size: 1.05rem; font-weight: 500; margin: 0 0 0.15rem; }
.stat-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.8rem;
    padding: 0.48rem 0;
    border-top: 1px solid rgba(42, 36, 32, 0.08);
}
.stat-line b { font-weight: 500; text-align: right; }
.stat-line em { font-style: normal; color: var(--text-secondary); }
.book-tabs button {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(42, 36, 32, 0.14);
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font: inherit;
    cursor: pointer;
}
.book-tabs button.active { color: var(--bg-primary); background: var(--accent); border-color: var(--accent); }
.book-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(42, 36, 32, 0.08);
}
.book-row p { color: var(--text-secondary); font-size: 0.9rem; }
.book-muted { color: var(--text-secondary); }
.book-form-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1rem;
    margin: 1rem 0;
}
.days-edit { display: grid; gap: 0.55rem; }
.day-edit { display: grid; grid-template-columns: 4.5rem 1.4rem 1fr 1fr; gap: 0.5rem; align-items: center; }
.agenda-grid { gap: 0.2rem; }
.agenda-day {
    position: relative;
    aspect-ratio: 1;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    cursor: pointer;
    padding: 0;
}
.agenda-day svg { width: 100%; height: calc(100% - 0.52rem); display: block; }
.agenda-day > span {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0.52rem;
    display: grid;
    place-items: center;
    font-size: 0.92rem;
}
.agenda-day.is-closed > span { color: rgba(42, 36, 32, 0.38); }
.agenda-day.is-selected { background: rgba(140, 98, 57, 0.1); }
.agenda-day.is-today > span { font-weight: 500; }
.agenda-day.needs-supplies::after {
    content: "";
    position: absolute;
    top: 0.22rem;
    right: 0.22rem;
    width: 0.34rem;
    height: 0.34rem;
    border-radius: 99px;
    background: #f0741a;
    box-shadow: 0 0 0 1.5px #fff;
}
.agenda-track { stroke: rgba(42, 36, 32, 0.14); }
.agenda-day.is-closed .agenda-track { stroke: rgba(42, 36, 32, 0.08); }
.agenda-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.06rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.18rem;
    height: 0.38rem;
    font-style: normal;
}
.agenda-dots b { width: 0.32rem; height: 0.32rem; border-radius: 99px; display: block; }
.agenda-feed { margin-top: 1.4rem; }
.agenda-feed h2 { font-size: 1.45rem; margin-bottom: 0.25rem; text-transform: capitalize; }
.agenda-feed h3 { margin: 1.2rem 0 0.4rem; font-size: 1rem; }
.day-feed { list-style: none; display: grid; gap: 0.55rem; margin-top: 0.9rem; }
.day-gap { color: var(--text-secondary); font-size: 0.88rem; padding: 0.15rem 0 0.15rem 4.4rem; }
.day-gap span { font-variant-numeric: tabular-nums; }
.day-appt {
    display: grid;
    grid-template-columns: 3.4rem minmax(0, 1fr) auto;
    gap: 0.55rem 0.75rem;
    align-items: stretch;
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.08);
    border-left: 4px solid var(--loc, var(--accent));
    border-radius: 14px;
    padding: 0.75rem 0.8rem;
}
.appt-when {
    display: flex;
    flex-direction: column;
    align-self: start;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
    color: var(--text-secondary);
}
.client-phone { white-space: nowrap; }
.appt-body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; align-self: stretch; }
.appt-body > strong, .appt-body > .client-line, .appt-body > .appt-marks { align-self: stretch; }
.appt-body .appt-marks { margin-top: auto; padding-top: 0.45rem; }
.day-appt strong { display: block; font-weight: 500; margin-top: 0.35rem; }
.day-appt p { color: var(--text-secondary); font-size: 0.9rem; }
.client-name {
    padding: 0;
    border: 0;
    background: none;
    color: #2f6b74;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.16em;
}
.client-pop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: end center;
    padding: 1rem;
    background: rgba(42, 36, 32, 0.42);
}
.client-pop[hidden] { display: none; }
.client-pop-card {
    position: relative;
    width: min(100%, 28rem);
    max-height: min(82vh, 38rem);
    overflow: auto;
    background: #fffdf9;
    border-radius: 18px;
    padding: 1.15rem 1.15rem 1.3rem;
    box-shadow: 0 18px 50px rgba(42, 36, 32, 0.18);
}
.client-pop-x {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: #f3eee7;
    color: #6e4c2b;
    font: inherit;
    cursor: pointer;
}
.client-pop-name { margin: 0 2rem 0.25rem 0; font-size: 1.55rem; }
.client-pop-phone { color: #2f6b74; text-decoration: none; }
.client-pop-meta { white-space: pre-line; color: var(--text-secondary); margin: 0.45rem 0 0; }
.client-pop-body h3 { margin: 1rem 0 0.35rem; font-size: 1rem; }
@media (min-width: 700px) {
    .client-pop { place-items: center; }
}
.visit-count { margin: 0; color: var(--text-secondary); font-size: 0.82rem; }
.visit-list { list-style: none; margin: 0.2rem 0 0; padding: 0; }
.visit-list li {
    display: grid;
    gap: 0.05rem;
    padding: 0.45rem 0;
    border-top: 1px solid rgba(42, 36, 32, 0.08);
}
.visit-list time, .visit-list span { color: var(--text-secondary); font-size: 0.84rem; }
.visit-list strong { margin: 0; font-weight: 500; }
.appt-marks { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: 0.45rem; }
.supply-mark {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    margin: 0;
    white-space: nowrap;
    padding: 0.28rem 0.65rem;
    background: #f3e4cf;
    border-radius: 999px;
    color: #6a4324;
    font-size: 0.88rem;
    font-weight: 500;
}
.svc-price {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
    background: #f6f1ea;
    color: #8a735c;
    font-style: normal;
    font-weight: 500;
    font-size: 0.82rem;
    vertical-align: 0.08em;
}
.svc-price.is-paid { background: #f3e4cf; color: #6a4324; }
.supply-mark b { font-weight: 500; font-variant-numeric: tabular-nums; }
.supply-mark.is-pending { background: transparent; padding: 0; color: #9a9188; font-weight: 400; }
.supply-form { display: none; grid-column: 1 / -1; gap: 0.45rem; padding-top: 0.35rem; }
.supply-form.is-open { display: grid; }
.supply-form .book-error:empty { display: none; }
.supply-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 5.4rem 4.6rem 1.9rem;
    gap: 0.35rem 0.45rem;
    align-items: center;
}
.supply-line[hidden] { display: none; }
.supply-line span { display: grid; gap: 0.05rem; min-width: 0; }
.supply-line b { font-weight: 500; }
.supply-line small { color: var(--text-secondary); font-size: 0.78rem; }
.supply-line .cost {
    font-style: normal;
    font-weight: 500;
    text-align: right;
    color: #9a9188;
    font-size: 0.84rem;
    font-variant-numeric: tabular-nums;
}
.supply-line .cost.is-set { color: #6a4324; }
.supply-line input {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    text-align: right;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.16);
    border-radius: 10px;
    padding: 0.4rem 0.5rem;
}
.supply-sum {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    margin: 0.1rem 0 0;
    padding: 0.55rem 0.75rem;
    background: #f3e4cf;
    border-radius: 12px;
    color: #5c4632;
    font-weight: 500;
}
.supply-sum b {
    margin-left: auto;
    font-size: 1.2rem;
    font-weight: 500;
    color: #6a4324;
    font-variant-numeric: tabular-nums;
}
.supply-status { font-style: normal; font-size: 0.78rem; color: #2f6b74; }
.supply-pending {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem 0.55rem;
    margin: 0;
    padding: 0.5rem 0.7rem;
    background: #f8eeeb;
    border: 1px solid #e4b7b1;
    border-radius: 12px;
    color: #8f3d36;
    font-size: 0.84rem;
}
.supply-pending[hidden] { display: none; }
.supply-pending b, .price-warn b { font-weight: 500; }
.price-warn {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem 0.4rem;
    margin: 0;
    padding: 0.28rem 0.65rem;
    background: #f8eeeb;
    border: 1px solid #e4b7b1;
    border-radius: 12px;
    color: #8f3d36;
    font-size: 0.82rem;
}
.form-alert:empty { display: none; }
.form-alert:not(:empty) {
    display: block;
    grid-column: 1 / -1;
    margin: 0;
    padding: 0.55rem 0.7rem;
    background: #f8eeeb;
    border: 1px solid #e4b7b1;
    border-radius: 12px;
    color: #8f3d36;
    font-size: 0.88rem;
}
.past-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    align-items: end;
    margin: 0.85rem 0 0.2rem;
    padding: 0.85rem;
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.08);
    border-radius: 14px;
}
.past-form[hidden] { display: none; }
.past-form label { display: grid; gap: 0.25rem; min-width: 0; font-size: 0.82rem; color: var(--text-secondary); }
.past-form input, .past-form select {
    font: inherit;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.16);
    border-radius: 10px;
    padding: 0.45rem 0.55rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.past-form .span-2, .past-form .form-alert { grid-column: 1 / -1; }
.past-open { margin: 0.75rem 0 0.2rem; }
.appt-move input.is-invalid,
.appt-move select.is-invalid,
.appt-ack input.is-invalid,
.past-form input.is-invalid,
.past-form select.is-invalid,
.supply-line input.is-invalid,
.supply-row input.is-invalid {
    border-color: #c56a60;
    background: #fff6f4;
    box-shadow: 0 0 0 3px rgba(197, 106, 96, 0.16);
}
.supply-sheet {
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.08);
    border-radius: 14px;
    padding: 0.2rem 0.7rem 0.45rem;
    margin: 0.35rem 0 0.4rem;
}
.supply-head, .supply-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 6.2rem 5.4rem 2rem;
    gap: 0.28rem 0.45rem;
    align-items: center;
}
.supply-head {
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.45rem 0 0.2rem;
}
.supply-row { padding: 0.32rem 0; border-top: 1px solid rgba(42, 36, 32, 0.08); }
.supply-row input {
    font: inherit;
    font-size: 0.92rem;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.16);
    border-radius: 10px;
    padding: 0.4rem 0.5rem;
    width: 100%;
    min-width: 0;
}
.supply-row .supply-status, .supply-row .form-alert, .supply-add .btn { grid-column: 1 / -1; }
.supply-status { margin: 0; font-size: 0.75rem; color: #2f6b74; }
.supply-status:empty { display: none; }
.supply-add .btn { justify-self: start; margin-top: 0.15rem; }
.supply-x {
    width: 1.9rem;
    height: 1.9rem;
    justify-self: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8f3d36;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.supply-x:hover { background: #f8eeeb; }
.supply-line small.stock-rest { color: var(--text-secondary); }
.supply-line small.stock-rest.is-short { color: #8f3d36; }
.stock-block { margin-top: 1.2rem; }
.stock-title { margin: 0 0 0.2rem; font-size: 1.2rem; font-weight: 500; }
.stock-block .book-note { margin: 0 0 0.55rem; }
.stock-groups { display: grid; gap: 1.05rem; }
.stock-group-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.4rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.stock-group-title::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--stock-dot, #8c6239);
    flex: none;
}
.stock-group[data-cat="color"] { --stock-dot: #8c6239; }
.stock-group[data-cat="care"] { --stock-dot: #2f6b74; }
.stock-group[data-cat="wash"] { --stock-dot: #9a4e68; }
.stock-sheet {
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.08);
    border-radius: 14px;
    padding: 0.15rem 0.85rem 0.35rem;
}
.stock-titleline,
.stock-facts { display: contents; }
.stock-head, .stock-row {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(3.2rem, 0.45fr) 5.4rem 5.4rem 5.8rem;
    gap: 0.35rem 0.9rem;
    align-items: center;
}
.stock-head {
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.5rem 0 0.25rem;
}
.stock-head span:nth-child(n+3) { text-align: right; }
.stock-row { padding: 0.48rem 0; border-top: 1px solid rgba(42, 36, 32, 0.08); }
.stock-row b { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.stock-shade { color: var(--text-secondary); }
.stock-pack, .stock-price {
    text-align: right;
    justify-self: end;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.stock-left {
    justify-self: end;
    text-align: center;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-weight: 600;
    color: #6b4524;
    background: #f4ece3;
    border-radius: 999px;
    padding: 0.18rem 0.65rem;
}
.stock-left.is-short,
.stock-left.is-low { color: #8f3d36; background: #f8eeeb; }
.stock-left.is-mid { color: #8a6410; background: #fff4d6; }
.stock-left.is-ok { color: #2f6b3a; background: #e7f3e4; }
.stock-add {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) 4.6rem 3.4rem auto;
}
.stock-row select, .stock-row input, .stock-pick select, .stock-pick input {
    font: inherit;
    font-size: 0.92rem;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.16);
    border-radius: 10px;
    padding: 0.4rem 0.5rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.stock-add .form-alert { grid-column: 1 / -1; }
.stock-add .btn { justify-self: start; margin: 0; }
.receipt-form {
    display: grid;
    gap: 0.55rem;
    margin: 0.7rem 0 0.4rem;
    padding: 0.85rem;
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.08);
    border-radius: 14px;
}
.receipt-form[hidden] { display: none; }
.receipt-form label { display: grid; gap: 0.25rem; font-size: 0.82rem; color: var(--text-secondary); }
.receipt-meta { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); gap: 0.6rem; align-items: end; }
.receipt-form input[type="date"],
.receipt-comment input {
    font: inherit;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.16);
    border-radius: 10px;
    padding: 0.4rem 0.5rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.receipt-line {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.6fr) 4rem 3.1rem 4.2rem 1.9rem;
    gap: 0.28rem 0.35rem;
    align-items: center;
}
.receipt-line select { grid-column: 1 / -1; }
.receipt-line input,
.receipt-line select {
    font: inherit;
    font-size: 0.92rem;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.16);
    border-radius: 10px;
    padding: 0.4rem 0.5rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.receipt-form .form-alert { margin: 0; }
.receipt-card {
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.08);
    border-radius: 14px;
    padding: 0.55rem 0.85rem 0.4rem;
    margin: 0.4rem 0;
}
.receipt-card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    cursor: pointer;
    list-style: none;
}
.receipt-card summary::-webkit-details-marker { display: none; }
.receipt-when { display: grid; gap: 0.12rem; min-width: 0; }
.receipt-when b { font-weight: 600; }
.receipt-note { color: var(--text-secondary); font-size: 0.86rem; }
.receipt-group {
    margin: 0.7rem 0 0.2rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.receipt-sheet { margin: 0.35rem 0 0.25rem; }
.receipt-row .stock-titleline { display: contents; }
.receipt-head, .receipt-row {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(3rem, 0.45fr) 6.2rem 5.2rem;
    gap: 0.3rem 0.75rem;
    align-items: center;
}
.receipt-head { color: var(--text-secondary); font-size: 0.75rem; padding-top: 0.15rem; }
.receipt-head span:nth-child(n+3),
.receipt-grams,
.receipt-price { text-align: right; justify-self: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.receipt-row { padding: 0.38rem 0; border-top: 1px solid rgba(42, 36, 32, 0.08); }
.receipt-row b { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.stock-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.85rem; }
.stock-actions .btn,
.stock-pick .btn,
.receipt-form .btn {
    margin: 0;
    padding: 0.55rem 0.9rem;
    font-size: 0.86rem;
    letter-spacing: 0.03em;
    text-transform: none;
    white-space: nowrap;
}
.stock-pick {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 4.6rem auto;
    gap: 0.4rem;
    align-items: center;
}
.day-appt .stock-pick .btn { grid-column: auto; width: auto; }
.stock-choose { min-width: 0; }
.stock-choose-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0.42rem 0.55rem;
    font: inherit;
    font-size: 0.92rem;
    text-align: left;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.16);
    border-radius: 10px;
    cursor: pointer;
}
.stock-choose-btn.is-empty { color: rgba(42, 36, 32, 0.45); }
.stock-choose-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-choose-shade {
    flex: none;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    color: #6d4c2e;
    background: #f3ebe2;
    border-radius: 999px;
    padding: 0.08rem 0.4rem;
}
.stock-choose-shade[hidden] { display: none; }
.stock-choose-btn.is-low { border-color: #c56a60; background: #fff6f4; }
.stock-choose-btn.is-mid { border-color: #c9a04a; background: #fff8eb; }
.stock-choose-btn.is-ok { border-color: #6d9a62; background: #f3f8f1; }
.stock-choose-btn.is-low::before,
.stock-choose-btn.is-mid::before,
.stock-choose-btn.is-ok::before {
    content: "";
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    flex: none;
}
.stock-choose-btn.is-low::before { background: #c56a60; }
.stock-choose-btn.is-mid::before { background: #c9a04a; }
.stock-choose-btn.is-ok::before { background: #3f7a45; }
.stock-choose-btn.is-invalid {
    border-color: #c56a60;
    box-shadow: 0 0 0 3px rgba(197, 106, 96, 0.16);
}
.stock-menu {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 0.28rem);
    max-height: 16rem;
    overflow: auto;
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(42, 36, 32, 0.12);
    padding: 0.25rem;
}
.stock-menu[hidden] { display: none; }
.stock-option {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.65rem;
    width: 100%;
    margin: 0;
    padding: 0.46rem 0.5rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    font-size: 0.92rem;
    text-align: left;
    color: var(--text-primary);
    cursor: pointer;
}
.stock-option:hover { background: #f6f1ea; }
.stock-option-name { min-width: 0; }
.stock-option-rest { flex: none; color: var(--text-secondary); font-size: 0.84rem; white-space: nowrap; }
.stock-option-rest b { font-weight: 600; }
.stock-option-rest b.is-low { color: #8f3d36; }
.stock-option-rest b.is-mid { color: #8a6410; }
.stock-option-rest b.is-ok { color: #2f6b3a; }
.writeoff-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 5.2rem 1.9rem;
    gap: 0.35rem;
    align-items: center;
}
.writeoff-line select,
.writeoff-line input {
    font: inherit;
    font-size: 0.92rem;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.16);
    border-radius: 10px;
    padding: 0.4rem 0.5rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.writeoff-sheet .receipt-head,
.writeoff-sheet .receipt-row {
    grid-template-columns: minmax(0, 1.5fr) minmax(3rem, 0.45fr) 6rem;
}
.stock-row select.is-invalid,
.stock-row input.is-invalid,
.stock-pick select.is-invalid,
.stock-pick input.is-invalid,
.receipt-line select.is-invalid,
.receipt-line input.is-invalid,
.receipt-form input.is-invalid,
.writeoff-line select.is-invalid,
.writeoff-line input.is-invalid {
    border-color: #c56a60;
    background: #fff6f4;
    box-shadow: 0 0 0 3px rgba(197, 106, 96, 0.16);
}
.addr-pill {
    display: inline-block;
    color: #fffdf9;
    border-radius: 999px;
    padding: 0.12rem 0.55rem;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}
.day-appt.is-cancelled { opacity: 0.55; }
.appt-ack-mark {
    display: inline-flex;
    align-items: center;
    margin: 0;
    white-space: nowrap;
    padding: 0.28rem 0.65rem;
    background: #e7f2f3;
    border-radius: 999px;
    color: #245e66;
    font-size: 0.88rem;
    font-weight: 500;
}
.appt-actions {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-self: stretch;
    gap: 0.35rem;
    min-width: 9.4rem;
}
.act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    min-height: 2.35rem;
    padding: 0.4rem 0.55rem;
    border-radius: 10px;
    font: inherit;
    font-size: 0.84rem;
    line-height: 1.15;
    cursor: pointer;
    text-align: center;
}
.act span { font-size: 0.95rem; line-height: 1; }
.act-ack { color: #245e66; background: #e7f2f3; border: 1px solid #9ec5ca; }
.act-edit { color: #6e4c2b; background: #fff; border: 1px solid #d4b896; }
.act-supply { color: #6a4324; background: #f6efe4; border: 1px solid #e0c9a8; }
.act-cancel { color: #8f3d36; background: #f8eeeb; border: 1px solid #e4b7b1; }
.act-ack:hover { background: #d7e8ea; }
.act-edit:hover { background: #f6efe6; }
.act-supply:hover { background: #efe2d0; }
.act-cancel:hover { background: #f3e0dc; }
.act.is-done, .act.is-done:hover {
    color: #9a9188;
    border-color: rgba(42, 36, 32, 0.16);
    background: #efeae3;
    cursor: default;
    pointer-events: none;
}
.appt-edit { display: none; grid-column: 1 / -1; gap: 0.85rem; }
.appt-edit.is-open { display: grid; }
.appt-edit.is-open .appt-move,
.appt-edit.is-open .appt-ack { display: grid; }
.appt-move, .appt-ack {
    display: none;
    grid-column: 1 / -1;
    gap: 0.55rem;
    align-items: end;
    padding-top: 0.35rem;
    width: 100%;
}
.appt-move { grid-template-columns: 1fr 1fr; }
.appt-ack { grid-template-columns: 1fr; }
.appt-move.is-open, .appt-ack.is-open { display: grid; }
.appt-move label, .appt-ack label { min-width: 0; }
.appt-move .appt-place { grid-column: auto; }
.appt-move .appt-price { grid-column: 1 / -1; }
.appt-move select, .appt-move input, .appt-ack input { width: 100%; min-width: 0; box-sizing: border-box; }
.ack-when { display: flex; gap: 0.45rem; align-items: end; }
.ack-when label { flex: 1; min-width: 0; }
.ack-x {
    flex: 0 0 auto;
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 10px;
    border: 1px solid #e4b7b1;
    background: #f8eeeb;
    color: #8f3d36;
    font: inherit;
    cursor: pointer;
}
.appt-save {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
    padding: 0.62rem 1rem;
    min-height: 0;
}
.appt-ack .book-note { max-width: none; }
.appt-move label, .appt-ack label { display: grid; gap: 0.25rem; font-size: 0.82rem; color: var(--text-secondary); }
.appt-move input, .appt-move select, .appt-ack input {
    font: inherit;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid rgba(42, 36, 32, 0.16);
    border-radius: 10px;
    padding: 0.45rem 0.55rem;
}
.appt-move .book-note, .appt-ack .book-note { grid-column: 1 / -1; margin: 0; }
@media (max-width: 640px) {
    .book-tabs { flex-wrap: wrap; gap: 0.3rem; }
    .book-tabs button {
        flex: 1 1 calc(50% - 0.3rem);
        min-width: 0;
        padding: 0.42rem 0.15rem;
        font-size: clamp(0.68rem, 2.9vw, 0.86rem);
        white-space: nowrap;
        text-align: center;
    }
    .book-row { flex-direction: column; align-items: flex-start; }
    .day-edit { grid-template-columns: 3.2rem 1.2rem 1fr 1fr; }
    .day-gap { padding-left: 0.15rem; }
    .day-appt { grid-template-columns: minmax(0, 1fr); }
    .appt-when { flex-direction: row; align-items: baseline; gap: 0; }
    .appt-when span + span::before { content: "\00a0–\00a0"; }
    .day-appt .btn { grid-column: 2; }
    .day-appt .appt-save { grid-column: 1 / -1; width: 100%; }
    .appt-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        justify-content: stretch;
        min-width: 0;
    }
    .day-appt { padding: 0.65rem 0.6rem; }
    .appt-marks { gap: 0.28rem; }
    .day-appt .supply-mark, .day-appt .appt-ack-mark { font-size: 0.8rem; padding: 0.18rem 0.4rem; }
    .price-warn { flex-basis: 100%; }
    .supply-line {
        grid-template-columns: minmax(0, 1fr) 3.4rem minmax(2.2rem, auto) 1.5rem;
        gap: 0.25rem 0.35rem;
    }
    .stock-head { display: none; }
    .stock-sheet { padding: 0.2rem 0.8rem 0.15rem; }
    .stock-titleline,
    .stock-facts,
    .receipt-row .stock-titleline { display: flex; }
    .stock-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "title left" "facts facts";
        gap: 0.28rem 0.65rem;
        padding: 0.72rem 0;
        align-items: center;
    }
    .stock-titleline { grid-area: title; align-items: center; gap: 0.4rem; min-width: 0; }
    .stock-row b { font-size: 1.02rem; line-height: 1.25; overflow-wrap: break-word; }
    .stock-shade {
        flex: none;
        font-size: 0.78rem;
        font-weight: 600;
        line-height: 1.2;
        color: #6d4c2e;
        background: #f3ebe2;
        border-radius: 999px;
        padding: 0.12rem 0.48rem;
    }
    .stock-shade.is-empty { display: none; }
    .stock-facts {
        grid-area: facts;
        align-items: baseline;
        gap: 0.15rem;
        font-size: 0.95rem;
        color: #2a2420;
    }
    .stock-pack, .stock-price {
        justify-self: start;
        text-align: left;
        font-size: inherit;
        color: inherit;
        font-weight: 400;
    }
    .stock-pack::after { content: "·"; margin-left: 0.4rem; color: rgba(42, 36, 32, 0.35); }
    .stock-left {
        grid-area: left;
        align-self: center;
        font-size: 1rem;
        padding: 0.28rem 0.72rem;
    }
    .receipt-meta { grid-template-columns: 1fr; }
    .receipt-line { grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr) 3.2rem 1.7rem; }
    .receipt-line select,
    .receipt-line [name="name"] { grid-column: 1 / -1; }
    .receipt-line .supply-x { grid-column: 4; justify-self: end; }
    .receipt-head { display: none; }
    .receipt-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "title title" "grams price";
        gap: 0.22rem 0.75rem;
        padding: 0.7rem 0;
        align-items: center;
    }
    .receipt-row .stock-titleline { grid-area: title; align-items: center; gap: 0.4rem; min-width: 0; }
    .receipt-row b { font-size: 1.02rem; line-height: 1.25; }
    .receipt-grams {
        grid-area: grams;
        justify-self: start;
        text-align: left;
        font-size: 0.95rem;
        font-weight: 500;
        color: #2a2420;
    }
    .receipt-price { grid-area: price; font-size: 0.95rem; font-weight: 600; }
    .stock-add { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); }
    .stock-add .btn { grid-column: 1 / -1; }
    .stock-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .stock-actions .btn,
    .receipt-form .btn { width: 100%; justify-content: center; }
    .stock-pick { grid-template-columns: minmax(0, 1fr) 3.2rem auto; }
    .stock-pick .btn { padding: 0.45rem 0.55rem; font-size: 0.82rem; }
    .stock-choose-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .day-appt .stock-pick .btn { grid-column: auto; width: auto; }
    .writeoff-line { grid-template-columns: minmax(0, 1fr) 1.9rem; }
    .writeoff-line select { grid-column: 1 / -1; }
    .writeoff-sheet .receipt-row {
        grid-template-areas: "title title" "grams grams";
    }
    .supply-line input { padding: 0.38rem 0.4rem; }
    .supply-head, .supply-row { grid-template-columns: minmax(0, 1fr) 4.6rem 4.2rem 1.7rem; gap: 0.22rem 0.3rem; }
    .supply-head { font-size: 0.68rem; }
    .supply-row input { padding: 0.38rem 0.35rem; font-size: 0.86rem; }
}
