:root {
  color-scheme: light;
  --ground: #fff;
  --surface: #f6f6f4;
  --line: #deded9;
  --text: #151515;
  --muted: #62625d;
  --accent: #ff7900;
  --accent-ink: #9a3c00;
  --orange-wash: #fff4e8;
  font-family: Manrope, sans-serif;
  color: var(--text);
  background: var(--ground);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
body.editing-order { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button, .secondary { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: not-allowed; opacity: .45; }
input, textarea { caret-color: var(--accent-ink); }
::selection { background: #ffd2a6; color: #151515; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #adada7; border-radius: 5px; border: 2px solid #fff; }
.ico { width: 20px; height: 20px; flex: none; vertical-align: middle; }
a { color: inherit; text-underline-offset: 3px; }
button, .secondary, input, select { min-height: 44px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.primary, .secondary { display: inline-flex; gap: 9px; align-items: center; justify-content: center; padding: 12px 18px; border-radius: 8px; font-weight: 800; font-size: 14px; text-decoration: none; }
.primary { background: var(--accent); border: 1px solid var(--accent); color: #111; }
.primary:hover:not(:disabled) { background: #ff912d; border-color: #ff912d; }
.secondary { background: #fff; border: 1px solid #222; color: #151515; }
.secondary:hover:not(:disabled) { background: #f2f2ef; }
.entry { min-height: 100svh; max-width: 510px; margin: auto; padding: 48px 24px; display: flex; flex-direction: column; justify-content: center; }
.entry-brand img { width: 180px; height: auto; }
.entry-form h1 { font: 700 clamp(37px, 7vw, 52px)/1.04 Barlow, sans-serif; letter-spacing: -.025em; margin: 35px 0 14px; }
.entry-form > p { color: var(--muted); line-height: 1.6; }
.entry-form label { display: block; font-weight: 750; margin: 27px 0 8px; font-size: 14px; }
.entry-form input { width: 100%; min-height: 60px; font-size: 23px; padding: 11px 16px; background: #fff; border: 1px solid #a5a5a0; border-radius: 9px; }
.entry-form input::placeholder { color: #70706b; }
.entry-form .field-help { font-size: 13px; margin: 12px 0 24px; }
.entry-form .primary { width: 100%; justify-content: space-between; min-height: 50px; }
.entry-form .error, .error { color: #b63218; }
.desk-header { display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); padding: 18px max(24px, calc((100vw - 1120px)/2)); }
.brand img { display: block; width: 135px; height: auto; }
.account { display: grid; flex: 1; min-width: 0; gap: 2px; }
.account strong { font-size: 17px; overflow-wrap: anywhere; }
.account button { background: transparent; border: 0; color: var(--muted); text-align: left; padding: 0; font-size: 12px; min-height: 28px; width: fit-content; text-decoration: underline; text-underline-offset: 3px; }
.alerts-toggle { display:flex; align-items:center; gap:12px; flex-shrink:0; background:var(--ground); border:1px solid var(--line); padding:9px 12px; border-radius:8px; text-align:left; }
.alerts-copy { display:grid; gap:3px; }
.alerts-copy strong { font-size:13px; }
.alerts-copy small { font-size:11px; color:var(--muted); }
.alerts-track { width:42px; height:24px; padding:3px; border-radius:20px; background:#77736e; flex-shrink:0; }
.alerts-track::after { content:''; display:block; width:18px; height:18px; border-radius:50%; background:#fff; }
.alerts-toggle[aria-checked="true"] .alerts-track { background:var(--accent-ink); }
.alerts-toggle[aria-checked="true"] .alerts-track::after { margin-left:18px; }
.alerts-toggle:hover { border-color:var(--accent-ink); }
.workspace { max-width: 1168px; margin: auto; padding: 0 24px 36px; }
.seller-label { color:var(--muted); font-size:12px; }
.seller-links { display:flex; flex-wrap:wrap; gap:4px 24px; padding:8px 0 0; font-size:13px; color:var(--accent-ink); }
.seller-links a { min-height:44px; display:inline-flex; align-items:center; }
.entry-manual { display:block; text-align:center; padding:14px 0; font-size:14px; color:var(--accent-ink); }
.connection { display: flex; align-items: center; gap: 8px; min-height: 58px; font-size: 12px; }
.connection p { margin: 0; color: var(--muted); flex: 1; }
.connection time { color: var(--muted); white-space: nowrap; }
#connection-dot { width: 7px; height: 7px; border-radius: 50%; background: #9a9a91; flex: none; }
#connection-dot[data-state="live"] { background: var(--accent); }
.desk-columns { border: 1px solid var(--line); border-radius: 12px; overflow: clip; }
.sales-panel { min-width: 0; }
.list-heading { padding: 24px 24px 15px; display: flex; align-items: baseline; gap: 10px; justify-content: space-between; }
.list-heading h1 { font: 700 32px/1 Barlow, sans-serif; margin: 0; }
.list-heading h1 span { color: var(--muted); font-size: 22px; margin-left: 5px; font-variant-numeric: tabular-nums; }
#pending-count { color: var(--accent-ink); font-size: 12px; }
.list-tools { padding: 0 24px 20px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.day-tabs { display: flex; gap: 4px; }
.day-tabs button { min-height: 40px; padding: 7px 14px; border-radius: 6px; background: transparent; border: 1px solid transparent; font-size: 13px; }
.day-tabs button[aria-pressed="true"] { background: #171717; color: #fff; border-color: #171717; }
.search { display: flex; gap: 8px; align-items: center; border-bottom: 1px solid #a5a5a0; flex: 1; min-width: 170px; max-width: 400px; margin-left: auto; color: var(--muted); }
.search input { width: 100%; min-width: 0; background: transparent; border: 0; color: var(--text); font-size: 13px; padding: 5px 0; }
.search input::placeholder { color: var(--muted); }
.orders { max-height: 62svh; overflow: auto; }
.order-row { background: #fff; border: 0; border-top: 1px solid var(--line); padding: 18px 24px; width: 100%; text-align: left; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); column-gap: 36px; row-gap: 8px; }
.order-row:hover { background: #fff8f0; }
.order-row[aria-current="true"] { background: var(--orange-wash); }
.row-top { display: flex; gap: 12px; align-items: center; }
.buyer { font-weight: 800; overflow-wrap: anywhere; font-size: 15px; }
.status { font-size: 11px; padding: 5px 8px; background: #ffe3c5; border-radius: 4px; flex: none; color: #863600; font-weight: 650; }
.status.done { color: #545450; background: #ededeb; }
.row-product, .row-meta { color: var(--muted); font-size: 12px; line-height: 1.6; }
.row-product { grid-column: 1; grid-row: 2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-meta { display: flex; justify-content: space-between; gap: 12px; min-width: 0; }
.row-meta:nth-child(3) { grid-column: 2; grid-row: 1; align-items: center; }
.row-meta:last-child { grid-column: 2; grid-row: 2; }
.row-meta b { color: #151515; font-weight: 750; white-space: nowrap; }
.row-meta span { overflow-wrap: anywhere; }
.row-meta time { white-space: nowrap; }
.empty { color: var(--muted); padding: 26px 24px; line-height: 1.65; font-size: 14px; }
.empty button { margin-top: 14px; display: block; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 24px; border-top: 1px solid var(--line); font-size: 12px; }
.pagination button, .text-button { background: transparent; border: 0; padding: 8px 0; color: var(--accent-ink); }
.output-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding-top: 26px; }
.output-actions > div:first-child { flex: 1; }
.output-actions strong { font-size: 14px; }
.output-actions p { font-size: 12px; color: var(--muted); margin: 5px 0 0; line-height: 1.6; }
.output-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.output-buttons .secondary { background: #171717; color: #fff; }
.output-buttons .secondary:hover { background: #333; }
.output-actions #copy-help { flex-basis: 100%; margin-top: -10px; }
.detail-panel { width: min(900px, calc(100vw - 32px)); max-width: none; max-height: none; height: min(1000px, calc(100dvh - 32px)); margin: auto; padding: 0; border: 0; border-radius: 18px; color: var(--text); background: #fff; overflow: hidden; box-shadow: 0 24px 80px #0003; }
.detail-panel[open] { display: flex; flex-direction: column; }
.detail-panel::backdrop { background: #10101080; }
.detail-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 30px 16px; flex: none; }
.detail-header h2 { margin: 0; font: 800 29px/1.2 Manrope, sans-serif; letter-spacing: -.025em; }
.close-button { display: grid; place-items: center; width: 48px; height: 48px; flex: none; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; }
.close-button:hover:not(:disabled) { background: #f3f3f0; }
.close-button .ico { width: 23px; height: 23px; }
#detail-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.editor-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 30px 26px; flex: 1; scroll-padding-block: 12px; }
.order-summary { padding: 22px 24px 18px; background: #f4f4f1; border-radius: 14px; }
.detail-person { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.summary-label { display: block; font-size: 11px; text-transform: uppercase; color: #60605b; letter-spacing: .06em; margin-bottom: 5px; }
.detail-person strong { font-size: 23px; line-height: 1.25; font-weight: 800; overflow-wrap: anywhere; }
.summary-status { align-self: end; justify-self: end; }
.sale-account { margin: 18px 0 0; font-size: 14px; color: #62625d; overflow-wrap: anywhere; }
.sale-account b { color: var(--accent-ink); }
.purchase-lines { margin-top: 14px; padding-top: 12px; border-top: 1px solid #dcdcd6; }
.purchase-line { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; line-height: 1.65; }
.purchase-line b { white-space: nowrap; }
.summary-bottom { display: flex; gap: 16px; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 12px; }
.order-number { overflow-wrap: anywhere; }
.text-button { margin-top: 4px; font-size: 13px; }
.field { display: grid; gap: 9px; font-size: 16px; font-weight: 750; margin-bottom: 20px; }
.field input, .field select, .field textarea { min-width: 0; width: 100%; border: 1px solid #cecec8; border-radius: 10px; background: #fff; color: var(--text); padding: 14px 16px; font-size: 16px; font-weight: 450; min-height: 56px; }
.field textarea { resize: vertical; line-height: 1.6; min-height: 116px; }
.field input::placeholder, .field textarea::placeholder { color: #74746e; }
.box-entry { padding: 0; border: 0; margin: 25px 0; min-width: 0; }
.box-entry legend { font-size: 21px; font-weight: 800; padding: 0 0 14px; }
.certificate-name { margin-bottom: 24px; font-size: 19px; }
.caps-and-gifts { padding: 20px; border: 1px solid var(--line); border-radius: 14px; }
.gift-block { background: #fff5ea; border-radius: 12px; padding: 0 18px; margin-top: 22px; }
.gift-field { padding: 20px 0; border-top: 1px solid #ebd4bb; }
.gift-field:first-child { border-top: 0; }
.gift-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gift-heading h3 { font-size: 16px; margin: 0; font-weight: 800; }
.gift-modes { display: flex; gap: 8px; }
.choice { min-height: 48px; padding: 10px 15px; border: 1px solid #d6d1cb; border-radius: 9px; background: #fff; color: #34302c; font-size: 14px; }
.gift-modes .choice { min-width: 76px; }
.choice:hover:not(:disabled) { border-color: #c85600; background: #fffaf4; }
.choice[aria-pressed="true"], .choice[aria-pressed="true"]:hover { background: var(--accent); border-color: #db6700; color: #111; font-weight: 800; }
.gift-extra { margin-top: 17px; font-size: 13px; }
.gift-extra > span { display: block; margin-bottom: 8px; }
.choice-options { display: flex; flex-wrap: wrap; gap: 8px; }
.size-options { display: grid; grid-template-columns: repeat(3, 1fr); }
.custom-gift { margin: 18px 0 0; font-size: 13px; font-weight: 550; }
.custom-gift textarea { min-height: 90px; }
.notes-field { margin: 26px 0 0; font-size: 13px; font-weight: 500; }
.form-footer { padding: 18px 30px 16px; border-top: 1px solid var(--line); flex: none; background: #fff; }
.form-actions { display: grid; gap: 10px; }
.form-actions > button { width: 100%; min-height: 52px; font-size: 15px; }
.form-actions .primary:disabled { background: #ddddda; border-color: #ddddda; color: #666660; opacity: 1; }
.form-actions .secondary:disabled { border-color: #d0d0ca; color: #83837d; opacity: 1; }
.form-message { color: #9a3c00; font-size: 13px; line-height: 1.5; margin: 0 0 10px; }
.form-message:empty { display: none; }
.form-help { margin: 10px 0 0; text-align: center; font-size: 11px; color: var(--muted); line-height: 1.5; }
.saved-assembly { padding: 8px 0 24px; }
.saved-assembly h3 { margin: 20px 0 14px; font-size: 23px; }
.saved-assembly p { color: #474742; font-size: 15px; line-height: 1.6; margin: 8px 0; }
.saved-note { white-space: pre-wrap; overflow-wrap: anywhere; }
#live-alert { position: fixed; z-index: 20; width: min(620px, 92vw); top: 14%; left: 50%; transform: translateX(-50%); pointer-events: none; }
#alert-scene { aspect-ratio: 1.95; background: #211d17f7; border-radius: 12px; box-shadow: 0 15px 50px #0009; }
#alert-queue { display: block; width: fit-content; margin: 8px auto; padding: 5px 10px; background: #171717; color: #fff; border-radius: 5px; font-size: 12px; }
#toast { position: fixed; z-index: 40; bottom: 24px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); background: #171717; color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 13px; box-shadow: 0 8px 26px #0003; pointer-events: none; }
@media (max-width: 800px) {
  .desk-header { padding: 14px 18px; gap: 16px; }
  .workspace { padding: 0 16px 30px; }
  .order-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .row-product, .row-meta:nth-child(3), .row-meta:last-child { grid-column: auto; grid-row: auto; }
  .row-top { justify-content: space-between; }
  .list-heading { padding: 20px 16px 14px; }
  .list-tools, .order-row { padding-left: 16px; padding-right: 16px; }
  .list-tools { gap: 12px; }
  .output-actions { gap: 14px; }
  .output-buttons { width: 100%; }
  .output-buttons > * { flex: 1; font-size: 12px; padding: 11px 12px; }
  .detail-panel { width: calc(100vw - 20px); height: calc(100dvh - 20px); border-radius: 15px; }
  .detail-header { padding: 18px 22px 12px; }
  .editor-scroll { padding: 0 22px 22px; }
  .form-footer { padding: 14px 22px 12px; }
}
@media (max-width: 580px) {
  .brand img { width: 86px; }
  .desk-header { gap: 12px; flex-wrap: wrap; }
  .account strong { font-size: 14px; }
  #desk .desk-header .account { flex-basis:calc(100% - 110px); }
  .alerts-toggle { width:100%; justify-content:space-between; }
  .output-buttons #copy-overlay { flex-basis:100%; }
  .connection time { display: none; }
  .list-tools .search { flex-basis: 100%; max-width: none; }
  .entry { padding: 32px 22px; }
  .detail-panel { width: 100vw; height: 100dvh; border-radius: 0; }
  .detail-header { padding: 14px 18px 12px; }
  .detail-header h2 { font-size: 25px; }
  .close-button { width: 44px; height: 44px; }
  .editor-scroll { padding: 0 16px 20px; }
  .order-summary { padding: 18px 16px; }
  .detail-person { gap: 16px; }
  .detail-person strong { font-size: 18px; }
  .summary-label { font-size: 10px; letter-spacing: .04em; }
  .summary-bottom { flex-wrap: wrap; gap: 4px; }
  .purchase-line { font-size: 12px; }
  .sale-account { font-size: 12px; }
  .certificate-name { font-size: 17px; }
  .field input, .field select, .field textarea { padding: 12px; min-height: 52px; }
  .caps-and-gifts { padding: 16px 12px 12px; }
  .gift-block { padding: 0 12px; margin-top: 18px; }
  .gift-heading { display: block; }
  .gift-heading h3 { margin-bottom: 12px; }
  .gift-modes { display: grid; grid-template-columns: .75fr .85fr 1.4fr; gap: 5px; }
  .gift-modes .choice { min-width: 0; padding: 9px 5px; font-size: 12px; }
  .choice-options { gap: 6px; }
  .choice-options .choice { padding: 10px 12px; font-size: 13px; }
  .form-footer { padding: 12px 16px max(10px, env(safe-area-inset-bottom)); }
  .form-actions { gap: 8px; }
  .form-actions > button { min-height: 46px; font-size: 13px; padding: 10px; }
  .form-help { font-size: 10px; margin-top: 7px; }
  .form-message { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
.test-sale-controls { display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin-top:18px; }
.test-sale-controls label { display:grid;gap:6px;font-size:13px;font-weight:700; }
.test-sale-controls select { min-height:44px;font:inherit;color:var(--text);background:#fff;border:1px solid var(--line);border-radius:8px;padding:10px 12px; }
#test-sale-status { margin:10px 0 0;max-width:75ch;font-size:13px;line-height:1.6;color:var(--muted); }
@media(max-width:580px){.test-sale-controls{align-items:stretch;flex-direction:column}.test-sale-controls select{width:100%}.test-sale-controls button{width:100%;justify-content:center}}
.live-comments { border-top: 1px solid #dedbd7; padding: 22px 0 26px; }
.assistant-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.chat-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.chat-actions .text-button { font-size: 13px; margin: 0; }
.assistant-order > a.text-button { display: inline-block; margin: 10px 0; font-size: 13px; }
.assistant-heading h2, .assistant-order h3 { font: 700 24px 'Barlow Condensed', sans-serif; margin: 0 0 6px; }
.assistant-heading p, .assistant-help { font-size: 13px; line-height: 1.6; color: #57514a; margin: 6px 0 12px; max-width: 75ch; }
.assistant-heading [data-state="connected"] { color: #236236; }
.live-comments details { border-bottom: 1px solid #e5e0d9; }
.live-comments summary { cursor: pointer; padding: 14px 0; font-size: 14px; font-weight: 700; }
.live-comments summary span, .assistant-order h3 span { margin-left: 8px; font-variant-numeric: tabular-nums; }
.alias-fields { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.alias-fields .field { flex: 1 1 240px; font-size: 13px; margin: 0; }
.alias-fields input, .alias-fields select { font-size: 14px; min-width: 0; width: 100%; }
#alias-list { list-style: none; padding: 0; font-size: 13px; color: #57514a; }
#alias-list li { display: flex; justify-content: space-between; gap: 18px; border-top: 1px solid #eee9e3; padding: 10px 0; align-items: center; overflow-wrap: anywhere; }
.assistant-order { margin: 26px 0; padding: 0 0 20px; border-bottom: 1px solid #dedbd7; }
.comment-proposal, .unassigned-comment { padding: 15px 0; border-top: 1px solid #e5e0d9; }
.comment-meta { display: flex; flex-wrap: wrap; gap: 5px 16px; font-size: 12px; color: #57514a; align-items: baseline; font-variant-numeric: tabular-nums; }
.comment-meta strong { color: #211c16; font-size: 14px; }
.comment-proposal blockquote { margin: 9px 0; color: #211c16; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.proposal-content { font-weight: 700; font-size: 14px; line-height: 1.5; margin: 8px 0; }
.assistant-warning { color: #8c3c03; font-size: 13px; line-height: 1.5; margin: 8px 0; overflow-wrap: anywhere; }
.assistant-warning:empty { display: none; }
.proposal-actions { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 12px; }
.proposal-actions button { font-size: 13px; min-height: 44px; }
.comment-count { display: block; color: #8c3c03; font-size: 11px; margin-top: 5px; }
#chat-pending-list { max-height: 360px; overflow: auto; }
.unassigned-comment p { font-size: 13px; overflow-wrap: anywhere; }
.assistant-order button:disabled { opacity: .5; cursor: default; }
@media (max-width:580px) {
  .assistant-heading { align-items: stretch; flex-direction: column; gap: 6px; }
  .assistant-heading button { align-self: flex-start; min-height: 44px; }
  .alias-fields { flex-direction: column; align-items: stretch; }
  .alias-fields .field { flex: auto; }
  .proposal-actions { align-items: stretch; flex-direction: column; }
  .proposal-actions .text-button { text-align: left; }
}
