.th-order-document, .th-order-body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
.th-order-body { background: var(--cream, #f8f8f0); }
.th-order {
    --order-line: #dce3d9;
    --order-tint: #edf3ed;
    box-sizing: border-box;
    position: fixed;
    inset: var(--th-visible-top, 0px) 0 auto;
    height: 100vh;
    height: 100dvh;
    height: var(--th-visible-height, 100dvh);
    max-width: 74rem;
    margin: auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: .75rem;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
.th-order-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-bottom: 1px solid var(--order-line); padding-bottom: .35rem; }
.th-order-close { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .8rem; border: 1px solid var(--order-line); border-radius: 999px; color: var(--green); background: #fff; white-space: nowrap; font-size: .875rem; font-weight: 650; }
.th-order-close span { font-size: 1.45em; line-height: 1; }
.th-order-grid { min-height: 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: .75rem; }
.th-order-panel { min-width: 0; min-height: 0; background: #fff; color: var(--ink); border: 1px solid var(--order-line); border-radius: 1rem; padding: 1rem; }
.th-order-search-panel, .th-order-cart-panel { display: flex; flex-direction: column; overflow: hidden; }
.th-order-search-panel > label, .th-order-search-panel > input, .th-order-cart-panel > h2, .th-order-checkout { flex: none; }
.th-order-scroll { flex: 1 1 0; min-height: 0; overflow: auto; overflow-anchor: none; overscroll-behavior: contain; scrollbar-gutter: stable; }
.th-order-step { overflow: auto; overscroll-behavior: contain; align-self: start; width: min(100%, 36rem); justify-self: center; max-height: 100%; }
.th-order [hidden] { display: none !important; }
.th-order h1 { font-size: clamp(1.4rem, 3.7vw, 2rem); font-weight: 750; line-height: 1.15; margin: 0; color: var(--ink); }
.th-order h2 { font-size: 1.125rem; font-weight: 750; margin: 0 0 .35rem; }
.th-order-step h2 { margin-top: .65rem; }
.th-order ul { list-style: none; padding: 0; margin: 0; }
.th-order li { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: .5rem 0; border-bottom: 1px solid var(--order-line); line-height: 1.3; }
.th-order li > span:first-child { min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.th-order li > :last-child { flex-shrink: 0; }
.th-order small { display: block; margin-top: .12rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.th-order label { display: block; margin-bottom: .35rem; font-weight: 750; }
.th-order input, .th-order textarea { width: 100%; box-sizing: border-box; border: 1px solid #a0ada3; border-radius: .7rem; padding: .65rem .75rem; color: var(--ink); font: inherit; font-size: 1rem; margin-bottom: .65rem; }
.th-order button, .th-order-primary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid var(--order-line); border-radius: 999px; padding: .45rem .85rem; font: inherit; font-weight: 650; color: var(--green); background: var(--order-tint); cursor: pointer; text-decoration: none; }
.th-order .th-order-primary { background: var(--green); color: #fff; border-color: var(--green); font-weight: 750; }
.th-order :is(a, button, input, textarea, .th-order-scroll):focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.th-order :is(input, textarea, .th-order-scroll):focus-visible { outline-offset: -2px; }
.th-order button:disabled { opacity: .55; cursor: default; }
.th-order-actions, .th-order-qty { display: flex; align-items: center; gap: .35rem; }
.th-order-actions { flex-wrap: wrap; }
.th-order #th-order-catalog button, .th-order .th-order-qty button {
    min-height: 34px;
    min-width: 34px;
    padding: .25rem .6rem;
    font-size: .85rem;
}
.th-order .th-order-qty { gap: .4rem; }
.th-order .th-order-qty button:last-child { margin-inline-start: .15rem; }
.th-order-checkout { display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--order-line); padding-top: .45rem; }
.th-order-checkout button { min-width: 7rem; }
.th-order-total { display: grid; gap: .1rem; margin: 0; font-size: .8rem; color: var(--muted); }
.th-order-total strong { font-size: 1.12rem; color: var(--ink); font-variant-numeric: tabular-nums; }
#th-order-count { color: var(--muted); font-size: .76em; font-weight: 600; }
#th-order-empty, #th-order-catalog-status { margin: .3rem 0; }
#th-order-catalog-status:empty, #th-order-error:empty { display: none; }
.th-order form { margin-top: 1rem; }
#th-order-more { margin-top: .75rem; }
#th-order-error { color: #a01818; }
#th-order-result { display: flex; flex-direction: column; align-self: stretch; max-height: min(100%, 38rem); gap: .65rem; padding: 0; border: 0; background: transparent; }
#th-order-result > :not(textarea, .th-order-receipt) { flex: none; }
#th-order-saved { margin: 0; padding-bottom: .55rem; border-bottom: 1px solid var(--order-line); font-size: clamp(1.2rem, 3.3vw, 1.55rem); }
#th-order-result > p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.4; }
#th-order-copy-status:empty { display: none; }
.th-order-receipt { flex: 1 1 auto; min-height: 6rem; overflow: auto; overscroll-behavior: contain; }
.th-order-receipt > p { margin: 0 0 .35rem; white-space: pre-line; overflow-wrap: anywhere; }
.th-order-receipt li { align-items: start; }
.th-order-receipt strong { font-variant-numeric: tabular-nums; }
.th-order-receipt li strong { white-space: nowrap; }
.th-order-receipt .th-order-checkout { margin: .4rem 0 0; border-top: 0; }
#th-order-message { flex: 1 1 auto; min-height: 8rem; resize: none; margin: 0; background: var(--cream); line-height: 1.55; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#th-order-result .th-order-actions { border-top: 1px solid var(--order-line); padding-top: .65rem; }
#th-order-result > a { align-self: start; }
#th-order-result > a:hover { filter: brightness(.9); }
@media (max-width: 767px) {
    .th-order { gap: .4rem; padding-inline: max(.6rem, env(safe-area-inset-left)) max(.6rem, env(safe-area-inset-right)); padding-top: max(.25rem, env(safe-area-inset-top)); padding-bottom: max(.45rem, env(safe-area-inset-bottom)); }
    .th-order-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: .4rem; }
    .th-order-panel { padding: .55rem; }
    .th-order li { padding-block: .3rem; gap: .35rem; font-size: .88rem; }
    .th-order li small { font-size: .78rem; }
    .th-order #th-order-catalog button, .th-order .th-order-qty button { min-height: 40px; }
    .th-order .th-order-qty button { padding-inline: .38rem; }
    .th-order-search-panel input { margin-bottom: .25rem; padding-block: .45rem; }
    .th-order[data-search-keyboard] .th-order-grid { grid-template-rows: minmax(0, 1fr) minmax(0, .36fr); }
    .th-order[data-search-keyboard] .th-order-checkout { display: none; }
    #th-order-result .th-order-actions > * { flex: 1 1 8rem; font-size: .85rem; }
    #th-order-message { font-size: .9rem; }
}
.th-order dialog {
    position: fixed;
    inset: calc(var(--th-visible-top, 0px) + var(--th-phone-offset, 4rem) + .5rem) 0 auto;
    margin: 0 auto;
    width: min(28rem, calc(100% - 2rem));
    max-height: calc(var(--th-visible-height, 100dvh) - var(--th-phone-offset, 4rem) - 1rem);
    box-sizing: border-box;
    border: 1px solid var(--order-line);
    border-radius: 1rem;
    padding: 1rem;
    color: var(--ink);
}
.th-order #th-order-phone-form { margin: 0; }
.th-order dialog::backdrop { background: rgb(13 37 30 / .48); }
#th-order-phone-error, #th-order-error { color: #a32222; margin: .35rem 0; }
#th-order-phone-error:empty, #th-order-error:empty { display: none; }
.th-order-contact-line { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .65rem; font-size: .875rem; margin: .3rem 0; }
.th-order-contact-line button { min-height: 32px; padding: .2rem .6rem; }
.th-order-contact-line details[open] { flex-basis: 100%; }
.th-order-contact-line summary { cursor: pointer; }
.th-order-contact-line input { margin: .3rem 0 0; }
.th-order-cart-panel .th-order-checkout { display: grid; gap: .3rem; }
.th-order-cart-panel .th-order-total { display: flex; justify-content: space-between; gap: .5rem; margin: 0; }
.th-order-cart-panel #th-order-contact { display: flex; width: 100%; box-sizing: border-box; }
.th-order[data-search-keyboard] .th-order-cart-panel .th-order-checkout { display: none; }
