/* Shared tokens copied from the operational Desktop presentation contract.
   Source hash recorded in output/desktop-foundation-reference.json. */
:root{
 --gh-ui-font:"Inter","Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,Arial,sans-serif;
 --gh-ui-bg:#f2f5fa;--gh-ui-surface:#fff;--gh-ui-soft:#f7f9fc;
 --gh-ui-ink:#14263d;--gh-ui-muted:#52647b;--gh-ui-line:#dce4ef;
 --gh-ui-accent:#2569c5;--gh-ui-accent-hover:#1b55a4;
 --gh-ui-blue:#205fae;--gh-ui-blue-bg:#edf4ff;--gh-ui-blue-line:#bbd5f8;
 --gh-ui-green:#14734b;--gh-ui-green-bg:#e9f7ef;--gh-ui-green-line:#b6dfc8;
 --gh-ui-amber:#895b06;--gh-ui-amber-bg:#fff6e1;--gh-ui-amber-line:#ecd097;
 --gh-ui-red:#b22c3d;--gh-ui-red-bg:#fff0f2;--gh-ui-red-line:#efbec7;
 --gh-ui-violet:#7041a6;--gh-ui-violet-bg:#f4eeff;--gh-ui-violet-line:#d7c4ef;
 --gh-ui-cyan:#116e7d;--gh-ui-cyan-bg:#e8f7fa;--gh-ui-cyan-line:#a6dbe3;
 --gh-ui-gray:#536176;--gh-ui-gray-bg:#f1f5f9;--gh-ui-gray-line:#d8e0ea;
 --gh-ui-radius:16px;--gh-ui-radius-sm:10px;
 --gh-ui-shadow:0 4px 18px rgba(22,44,72,.045);
 --gh-ui-focus:0 0 0 3px rgba(37,105,197,.2);
}

/* Dark changes tokens, never the DOM, positions or available operations. */
:root[data-theme=dark]{
 color-scheme:dark;
 --gh-ui-bg:#091320;--gh-ui-surface:#111f31;--gh-ui-soft:#17283d;
 --gh-ui-ink:#e8f0fb;--gh-ui-muted:#b1c2d8;--gh-ui-line:#344c68;
 --gh-ui-accent:#3278d2;--gh-ui-accent-hover:#438be8;
 --gh-ui-blue:#a8ceff;--gh-ui-blue-bg:#183351;--gh-ui-blue-line:#4973a2;
 --gh-ui-green:#a3eac4;--gh-ui-green-bg:#16372d;--gh-ui-green-line:#3c8063;
 --gh-ui-amber:#f6d389;--gh-ui-amber-bg:#392f1c;--gh-ui-amber-line:#8b733f;
 --gh-ui-red:#ffb7c2;--gh-ui-red-bg:#3c222e;--gh-ui-red-line:#925164;
 --gh-ui-violet:#d7beff;--gh-ui-violet-bg:#302642;--gh-ui-violet-line:#796294;
 --gh-ui-cyan:#a4e7ef;--gh-ui-cyan-bg:#17363e;--gh-ui-cyan-line:#427d88;
 --gh-ui-gray:#c3d0e1;--gh-ui-gray-bg:#233347;--gh-ui-gray-line:#52677f;
 --gh-ui-shadow:0 4px 18px #0003;--gh-ui-focus:0 0 0 3px #80b6ff66;
}
:root:not([data-theme=dark]){color-scheme:light}
:root{--tower-line:var(--gh-ui-line);--tower-muted:var(--gh-ui-muted);--tower-blue:var(--gh-ui-accent)}
html body{font-family:var(--gh-ui-font);font-size:17px;line-height:1.45;color:var(--gh-ui-ink);background:var(--gh-ui-bg);font-synthesis:none}
body button,body input,body select,body textarea{font-family:var(--gh-ui-font)}
body[data-authenticated=true] main{background:var(--gh-ui-bg);padding:22px 24px 30px;margin-left:276px;min-width:0}
body .tower-sidebar{width:276px;background:linear-gradient(180deg,#08162a,#10243e 55%,#09182b);padding:22px 12px 18px;border-right:1px solid #1b3653;scrollbar-width:none}
.tower-sidebar::-webkit-scrollbar{display:none}
.tower-brand{padding:0 11px 20px;margin-bottom:8px;border-bottom:1px solid #ffffff17}
.tower-wordmark{font-size:22px;line-height:1.17;font-weight:780;color:#fff;letter-spacing:-.02em}
.tower-brand small{font-size:14px;color:#c2d4e8;line-height:1.4}
.tower-environment{font-size:13px;line-height:1.3;background:#1a3351;color:#deebfa;border:1px solid #304b6b;border-radius:6px}
.tower-nav{gap:4px;padding-top:0}
.tower-nav-label{font-size:13px;line-height:1.4;letter-spacing:.12em;font-weight:750;color:#9eb6d0;margin:20px 12px 8px;padding:0}
.tower-nav-label:first-child{margin-top:8px}
.tower-nav :is(button,summary){font-size:16.5px;line-height:1.3;font-weight:620;min-height:42px;padding:10px 12px;border:0;border-radius:10px;color:#e8f0fb;transition:background-color .15s,box-shadow .15s}
.tower-nav :is(button,summary):hover{background:#1e3e64;color:#fff;box-shadow:inset 0 0 0 1px #3a5b80}
.tower-nav button[aria-current=page]{background:linear-gradient(110deg,#2566bd,#3277d2);color:#fff;box-shadow:inset 3px 0 0 #a8d0ff,0 4px 12px #020d1f26}
.tower-nav .tower-subnav button{font-size:15.5px;min-height:36px;font-weight:570;padding:8px 10px}
.tower-nav .tower-subnav button[aria-current=page]{background:#234670;color:#fff;box-shadow:inset 2px 0 0 #7cbbff}
.tower-nav button[data-pending]{color:#e8f0fb}.tower-nav button[data-pending]:after{display:none}
.tower-count{font-size:14px;line-height:1.4;font-weight:700;background:#304d70;color:#fff;min-width:22px;border-radius:7px;margin-left:auto;text-align:center;padding:1px 5px}
.tower-count[hidden]{display:none}
.tower-nav details>summary:after{content:'';width:7px;height:7px;flex:0 0 7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin-left:auto;transition:transform .16s}
.tower-nav details[open]>summary:after{transform:rotate(225deg)}
.tower-nav details[open]>.tower-subnav{animation:gh-submenu-enter .26s cubic-bezier(.2,.7,.2,1)}
@keyframes gh-submenu-enter{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}
body[data-authenticated=true] :is(.card,.tower-topbar,.gh-ui-panel){background:var(--gh-ui-surface);border-color:var(--gh-ui-line);border-radius:var(--gh-ui-radius);box-shadow:var(--gh-ui-shadow)}
.tower-topbar h1{font-size:28px;font-weight:750;line-height:1.2;letter-spacing:-.025em;color:var(--gh-ui-ink)}
.tower-topbar p,.tower-topbar .company-bar label{color:var(--gh-ui-muted);font-size:15px;line-height:1.45}
body[data-authenticated=true] :is(input:not([type=checkbox]):not([type=radio]),select,textarea){color:var(--gh-ui-ink);background:var(--gh-ui-surface);border-color:var(--gh-ui-line);border-radius:var(--gh-ui-radius-sm)}
body[data-authenticated=true] .secondary{color:var(--gh-ui-blue);background:var(--gh-ui-surface);border-color:var(--gh-ui-blue-line)}
body[data-authenticated=true] .secondary:hover:enabled{background:var(--gh-ui-green-bg);color:var(--gh-ui-green);border-color:var(--gh-ui-green-line)}
body :is(button,input,select,textarea,summary,a):focus-visible{outline:3px solid #88b6f280;outline-offset:2px}
.gh-ui-dialog{width:min(720px,calc(100vw - 28px));max-height:90vh;overflow:auto;background:var(--gh-ui-surface);color:var(--gh-ui-ink);border:1px solid var(--gh-ui-line);border-radius:18px;padding:24px;box-shadow:0 20px 70px #0b25464d}
.gh-ui-dialog::backdrop{background:#10233c80}
.gh-ui-dialog>header{display:flex;justify-content:space-between;align-items:center;gap:16px;position:static;margin:0;padding:0 0 20px;background:none;border-bottom:1px solid var(--gh-ui-line);max-width:none;box-shadow:none}
.gh-ui-dialog>header h2{font-size:25px;margin:5px 0}.gh-ui-dialog>header small{font-size:11px;letter-spacing:.08em;color:var(--gh-ui-muted)}
.gh-ui-dialog p{font-size:15px;line-height:1.6}.gh-ui-dialog button{font-size:15px;min-height:42px}
.appearance-options{border:0;padding:0;margin:20px 0;display:grid;gap:10px;min-width:0}.appearance-options legend{font-weight:700;padding-bottom:10px}
.appearance-options label{display:flex;align-items:center;gap:14px;padding:16px;margin:0;border:1px solid var(--gh-ui-line);border-radius:12px;background:var(--gh-ui-surface);cursor:pointer}
.appearance-options label:has(input:checked){border-color:var(--gh-ui-blue-line);background:var(--gh-ui-blue-bg);box-shadow:inset 0 0 0 1px var(--gh-ui-blue-line)}
.appearance-options label:has(input:disabled){cursor:wait}.appearance-options input[type=radio]{width:19px;height:19px;min-height:19px;padding:0;margin:0;flex:none;accent-color:var(--gh-ui-accent)}
.appearance-options strong{font-size:17px;display:block}.appearance-options small{display:block;font-size:14px;color:var(--gh-ui-muted);margin-top:5px;line-height:1.5}
#appearance-status{min-height:24px;color:var(--gh-ui-muted)}
/* Foundation coverage for existing modules; their detailed layouts are aligned
   module by module, using these same tokens rather than a second dark interface. */
html[data-theme=dark] :is(.customer-order-section,.customer-order-dialog,.customer-order-recovery,.customer-order-preview,.ship-dialog,.ship-card,.ship-panel,.ship-details,.care-dialog,.care-entry,.care-message,.care-replies article,.care-reply-candidate,.care-reply-text,.co-detail-card,.care-recovery,.care-status,.tower-migration,.tower-pending,.record,.customer-order-note){color:var(--gh-ui-ink);background:var(--gh-ui-surface);border-color:var(--gh-ui-line)}
html[data-theme=dark] :is(.customer-order-dialog>header,.customer-order-desktop>header.co-detail-head,.co-detail-card h3,.co-detail-card footer,.co-detail-customer,.ship-dialog>header,.care-dialog>header,.customer-order-summary-cards button){color:var(--gh-ui-ink);background:var(--gh-ui-soft);border-color:var(--gh-ui-line)}
html[data-theme=dark] :is(h1,h2,h3,h4,label,td,th){color:var(--gh-ui-ink)}
html[data-theme=dark] :is(p,small,.hint,.care-preview,.co-detail-card dt,.co-detail-customer small,.co-detail-card>small,.co-detail-timeline small){color:var(--gh-ui-muted)}
html[data-theme=dark] :is(.customer-order-market,.care-market,.co-detail-card dd,.care-message p,.customer-order-section p){color:var(--gh-ui-ink)}
html[data-theme=dark] :is(table,table td,table th){border-color:var(--gh-ui-line)}
html[data-theme=dark] table :is(td,th){background:transparent;color:var(--gh-ui-ink)}
html[data-theme=dark] table th,html[data-theme=dark] tbody tr:nth-child(odd){background:var(--gh-ui-soft)}
html[data-theme=dark] tbody tr:nth-child(even){background:var(--gh-ui-surface)}
html[data-theme=dark] :is(pre,.care-message.customer,.care-message.received,.care-entry.active,.care-entry[aria-selected=true],.co-detail-customer>span,.co-detail-note-list .customer-order-note){background:var(--gh-ui-soft);color:var(--gh-ui-ink);border-color:var(--gh-ui-line)}
html[data-theme=dark] :is(.care-client,.care-composer,.care-thread,.care-list,.care-detail .card,.customer-order-products,.co-detail-quick>.customer-order-actions>button){background:var(--gh-ui-surface);color:var(--gh-ui-ink);border-color:var(--gh-ui-line)}
html[data-theme=dark] .co-detail-quick>.customer-order-actions>button:hover{background:var(--gh-ui-green-bg)}
html[data-theme=dark] .co-detail-status{color:var(--gh-ui-gray);background:var(--gh-ui-gray-bg);border-color:var(--gh-ui-gray-line)}
html[data-theme=dark] :is(.ship-badge.good,.co-detail-status.delivered,.order-status-delivered){color:var(--gh-ui-green);background:var(--gh-ui-green-bg);border-color:var(--gh-ui-green-line)}
html[data-theme=dark] :is(.ship-badge.warn,.order-status-in_progress){color:var(--gh-ui-amber);background:var(--gh-ui-amber-bg);border-color:var(--gh-ui-amber-line)}
html[data-theme=dark] :is(.ship-badge.bad,.co-detail-status.delayed){color:var(--gh-ui-red);background:var(--gh-ui-red-bg);border-color:var(--gh-ui-red-line)}
html[data-theme=dark] .co-detail-luna{background:linear-gradient(140deg,#302642,#17363e);border-color:var(--gh-ui-violet-line)}
html[data-theme=dark] .co-detail-luna h3{color:var(--gh-ui-violet)}
html[data-theme=dark] #workspace .notice{background:var(--gh-ui-soft);color:var(--gh-ui-muted);border-color:var(--gh-ui-line)}
@media(max-width:850px){body[data-authenticated=true] main{margin:0;padding:14px 12px 28px}body .tower-sidebar{width:min(290px,85vw);transform:translateX(-100%);visibility:hidden}body.tower-menu-open .tower-sidebar{transform:translateX(0);visibility:visible}body.tower-menu-open .tower-backdrop{display:block;position:fixed;inset:0;background:#08162d80;z-index:29;border-radius:0;width:100%;height:100%;padding:0}#tower-menu{display:flex}.gh-ui-dialog{padding:18px}.gh-ui-dialog>header h2{font-size:21px}.tower-topbar .company-bar{width:100%;min-width:0}.tower-topbar .company-bar>div{min-width:0;flex:1}.tower-topbar select{width:100%;max-width:100%}}
@media(prefers-reduced-motion:reduce){.tower-nav details[open]>.tower-subnav{animation:none}.tower-nav :is(button,summary),.tower-sidebar{transition:none}}
@media print{.tower-sidebar,.tower-topbar,#appearance-dialog{display:none!important}html[data-theme=dark] body{background:white!important;color:#14263d!important}}

/* Printed operational documents always use the original Light palette. */
@media print{:root[data-theme=dark]{color-scheme:light;
 --gh-ui-font:"Inter","Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,Arial,sans-serif;
 --gh-ui-bg:#f2f5fa;--gh-ui-surface:#fff;--gh-ui-soft:#f7f9fc;
 --gh-ui-ink:#14263d;--gh-ui-muted:#52647b;--gh-ui-line:#dce4ef;
 --gh-ui-accent:#2569c5;--gh-ui-accent-hover:#1b55a4;
 --gh-ui-blue:#205fae;--gh-ui-blue-bg:#edf4ff;--gh-ui-blue-line:#bbd5f8;
 --gh-ui-green:#14734b;--gh-ui-green-bg:#e9f7ef;--gh-ui-green-line:#b6dfc8;
 --gh-ui-amber:#895b06;--gh-ui-amber-bg:#fff6e1;--gh-ui-amber-line:#ecd097;
 --gh-ui-red:#b22c3d;--gh-ui-red-bg:#fff0f2;--gh-ui-red-line:#efbec7;
 --gh-ui-violet:#7041a6;--gh-ui-violet-bg:#f4eeff;--gh-ui-violet-line:#d7c4ef;
 --gh-ui-cyan:#116e7d;--gh-ui-cyan-bg:#e8f7fa;--gh-ui-cyan-line:#a6dbe3;
 --gh-ui-gray:#536176;--gh-ui-gray-bg:#f1f5f9;--gh-ui-gray-line:#d8e0ea;
 --gh-ui-radius:16px;--gh-ui-radius-sm:10px;
 --gh-ui-shadow:0 4px 18px rgba(22,44,72,.045);
 --gh-ui-focus:0 0 0 3px rgba(37,105,197,.2);
}}
