/* Desktop shell (above 900px): the sidebar on every signed-in page and the top row over the stage — title, search
   (orders, or the catalog on store pages), bell, new order (view_shell.php, view_topbar.php). Phones keep their own
   bars: everything here is hidden or scoped below 901px. Also the --w-* surface tokens the desktop page styles use. */
:root { --w-card: #141416; --w-card-2: #17171a; --w-card-3: #1f1f23; --w-sep: #17171a; --w-faint: #8b8b94; --w-soft: #c4c4cc; --w-max: 1480px;
  --w-hero: #0e0e10; --w-hover: #18181b; --w-mark: #1b1b1f; --w-row: #1e1e22; --w-btn: #232327; --w-line2: #26262b; --w-ring: #2e2e33;
  --w-dim: #a1a1aa; --w-faint2: #8b8b94; --w-soft2: #d6d6db; --w-info: #7dd3fc; --w-info-rgb: 125 211 252; --w-warn: #f5c542; --w-warn-rgb: 245 197 66; }
:root[data-theme="light"] { --w-card: var(--panel-2); --w-card-2: var(--panel-3); --w-card-3: var(--line); --w-sep: var(--line); --w-faint: var(--muted); --w-soft: var(--text-2);
  --w-hero: var(--panel-2); --w-hover: var(--panel-3); --w-mark: #e2e8f0; --w-row: var(--line); --w-btn: var(--panel-3); --w-line2: var(--line-2); --w-ring: var(--line-2);
  --w-dim: #475569; --w-faint2: #64748b; --w-soft2: var(--text-2); --w-info: #0369a1; --w-info-rgb: 3 105 161; --w-warn: #b45309; --w-warn-rgb: 180 83 9; }
/* The framed shell's washes and hairlines (web-frame.css sets them on body.app-shell); guests' desktop pages use these */
:root { --wash: rgb(var(--ink-rgb) / .04); --wash-2: rgb(var(--ink-rgb) / .07); --line-3: rgb(var(--ink-rgb) / .18); --faint: #8a8a93; --mono: ui-monospace, "Cascadia Mono", Consolas, monospace; }
:root[data-theme="light"] { --faint: #6b6b74; }

.tb-web, .sb-me, .sb-desk-only { display: none; }

@media (min-width: 901px) {
  /* —— Account sidebar —— */
  .app-shell { --sb-w: 264px; --sb-line: var(--w-sep); }
  .app-shell .sb { border-inline-end-color: var(--w-sep); }
  .app-shell .sb-head { min-height: 76px; padding: 0 20px; }
  .sb-brand { gap: 10px; font-size: 19px; }
  .sb-brand .site-logo { width: 44px; height: 44px; }
  .sb-brand .site-logo .logo-tile { fill: transparent; }
  .sb-brand .wm-sub { font-weight: 600; opacity: 1; }
  .sb-nav { gap: 2px; padding: 16px 10px 12px; }
  .sb-label { margin: 18px 12px 6px; color: var(--w-faint2); font-size: 11.5px; font-weight: 800; letter-spacing: .04em; }
  html[dir="rtl"] .sb-label { font-size: 11.5px; }
  .sb-link.sb-desk-only { display: flex; }
  .sb-link { gap: 12px; min-height: 42px; padding: 0 12px; border: 0; border-radius: 11px; color: var(--w-soft); font-size: 15px; font-weight: 700; }
  .sb-link > .ic:first-child { color: var(--w-faint); }
  .sb-link:hover { background: var(--w-card); }
  .sb-link.is-active { background: var(--w-hover); box-shadow: inset 0 0 0 1px var(--w-line2); color: var(--text); font-weight: 800; }
  [data-theme="light"] .sb-link.is-active { background: var(--panel-3); box-shadow: inset 0 0 0 1px var(--line-2); }
  .sb-nav > .sb-label:has(+ .sb-group), .sb-nav > .sb-group { display: none; } /* brands live under Sections in the store header */
  .sb-prefs { order: 2; display: flex; flex: none; align-items: center; gap: 2px; padding: 8px 12px; border-top: 1px solid var(--w-sep); }
  .sb-prefs .dd-btn, .sb-prefs .theme-toggle { height: 36px; min-height: 36px; border: 0; border-radius: 10px; background: none; box-shadow: none; color: var(--w-faint); font-size: .86rem; }
  .sb-prefs .dd-btn:hover, .sb-prefs .theme-toggle:hover { background: var(--w-card); color: var(--text); }
  .sb-prefs .dd-currency .dd-btn > .ic:first-child { display: none; }
  .sb-prefs .theme-toggle { width: 36px; margin-inline-start: auto; }
  .sb-prefs .dd-menu { top: auto; bottom: calc(100% + 8px); inset-inline: 0 auto; }
  .sb-foot { order: 3; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--w-sep); }
  .sb-me { display: flex; flex: 1 1 auto; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
  .sb-me .avatar { width: 38px; height: 38px; flex: none; overflow: hidden; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font: 800 15px var(--font); }
  .sb-me .avatar img { width: 100%; height: 100%; object-fit: cover; }
  .sb-me > span { display: grid; min-width: 0; line-height: 1.35; }
  .sb-me strong { overflow: hidden; font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; }
  .sb-me small { overflow: hidden; color: var(--w-faint); font: 500 12px var(--font); text-overflow: ellipsis; white-space: nowrap; }
  .sb-foot .sb-logout { display: grid; flex: none; place-items: center; width: 36px; min-height: 36px; height: 36px; padding: 0; border-radius: 10px; color: var(--w-faint); }
  .sb-foot .sb-logout > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sb-foot .sb-logout .ic { color: inherit; }

  /* —— Account top row: title, search, bell, new order —— */
  .app-shell.web-app .shell-stage { --stage-pad: 40px; }
  .app-shell.web-narrow { --w-max: 960px; } /* settings-style lists read better narrow */
  .order-page .oh-x { display: none; } /* the sidebar navigates; the × sat on the order number */
  .app-shell.web-app .shell-stage > * { max-width: var(--w-max); }
  .app-shell.web-app .shell-stage > .stage-top { position: static; max-width: var(--w-max); margin: 0 auto 28px; padding: 32px 0 0; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .app-shell.web-app .stage-top-inner { display: none; }
  .tb-web { display: flex; align-items: center; gap: 12px; }
  .tb-search { display: flex; align-items: center; gap: 10px; width: 300px; height: 44px; margin-inline-start: auto; padding: 0 14px; border-radius: 14px; background: var(--w-card); color: var(--w-faint); }
  .tb-search:focus-within { box-shadow: inset 0 0 0 1px var(--line-2); }
  .tb-search input { flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; border: 0; background: none; color: var(--text); font-size: 14px; outline: none; }
  .tb-search input::placeholder { color: var(--w-faint); }
  .tb-search input::-webkit-search-cancel-button { display: none; }
  .tb-search kbd { flex: none; padding: 2px 7px; border-radius: 6px; background: var(--w-card-3); color: var(--w-faint); font: 600 11.5px var(--font); }
  .tb-notif-web .notif-btn { width: 44px; height: 44px; border-radius: 14px; background: var(--w-card); color: var(--w-soft2); }
  [data-theme="light"] .tb-notif-web .notif-btn { color: var(--text-2); }
  .tb-notif-web .notif-count { top: 8px; inset-inline-end: 9px; min-width: 9px; height: 9px; padding: 0; border: 0; box-shadow: 0 0 0 2px var(--w-card); font-size: 0; }
  .tb-new { display: flex; flex: none; align-items: center; gap: 6px; height: 44px; padding: 0 18px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 14.5px; font-weight: 800;
    transition: transform .15s var(--ease); }
  .tb-new:hover { transform: translateY(-1px); }
  .stage-top.has-head ~ .ap-head { display: none; } /* the row carries the title */
  .app-shell.web-app .ap-head h1 { font-size: 30px; }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .tb-search { width: 220px; }
  .tb-search kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tb-new { transition: none; }
}
