/* Shop app shell layout. Desktop: side navigation. Phone (≤ 820px): bottom tab bar. */
.boot { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.brand > div { min-width: 0; }
.brand strong { display: block; line-height: 1.35; font-size: .98rem; overflow-wrap: anywhere; } .brand .hint { display: block; font-size: .72rem; letter-spacing: .04em; line-height: 1.5; }
/* needle and a running stitch */
.brand-mark { width: 40px; height: 40px; flex: none; border-radius: 12px; background-color: var(--deep); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke-linecap='round'%3E%3Cpath d='M7 30c8-1 6-19 14-19s6 11 12 10' stroke='%23d8b06a' stroke-width='2' stroke-dasharray='3 3.4'/%3E%3Cpath d='M30 8 12 31' stroke='%23fff' stroke-width='2.2'/%3E%3Cpath d='m28.9 9.4-1.3 1.7' stroke='%23111a2c' stroke-width='1'/%3E%3C/svg%3E"); background-size: 100%; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ── sign-in and other single-card screens ── */
.signin { min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(900px 420px at 50% -8%, color-mix(in srgb, var(--brass-50) 70%, transparent), transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(20,27,43,.016) 5px 6px),
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(20,27,43,.016) 5px 6px),
    var(--paper); }
.signin .card { width: min(420px, 100%); padding: 32px 28px 26px; border-radius: var(--radius-lg); box-shadow: var(--shadow-2); position: relative; }
.signin .card::before { content: ""; position: absolute; inset-inline: 28px; top: 12px; border-top: 1.5px dashed color-mix(in srgb, var(--brass) 55%, transparent); }
.signin-card { display: grid; gap: 16px; }
.signin .card h1 { font-size: 1.3rem; }
.signin .btn { width: 100%; min-height: 48px; }
.signin details { font-size: .9rem; color: var(--ink-2); }
.signin details summary { font-weight: 600; padding: 6px 0; }
.signin details p { margin-top: 4px; }

/* ── frame ── */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 16px; padding: 20px 14px 14px; background: var(--deep); color: var(--on-deep);
  background-image: linear-gradient(180deg, rgba(255,255,255,.035), transparent 220px); border-inline-end: 1px solid rgba(255,255,255,.06); }
.side .brand { padding: 0 6px 16px; border-bottom: 1px dashed rgba(216,176,106,.34); }
.side .hint { color: var(--on-deep-2); }
.side .brand-mark { background-color: rgba(255,255,255,.07); }
.side .lbl { color: var(--on-deep-2); font-size: .76rem; margin: 0 6px -10px; }
.side .field { min-height: 40px; background-color: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); color: #fff; box-shadow: none; }
.side select.field { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23fff' stroke-opacity='.7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.side select.field option { color: #141b2b; background: #fff; }
.side .field:focus { border-color: var(--brass-lit); box-shadow: 0 0 0 3px rgba(216,176,106,.25); }
.side nav { display: grid; gap: 2px; overflow: auto; flex: 0 1 auto; min-height: 0; align-content: start; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.side nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 7px 12px; border-radius: 10px; color: rgba(255,255,255,.74); text-decoration: none; font-weight: 500; font-size: .94rem; }
.side nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side nav a[aria-current] { background: rgba(255,255,255,.11); color: #fff; font-weight: 600; }
.side nav a[aria-current]::before { content: ""; position: absolute; inset-inline-start: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brass-lit); }
[dir="rtl"] .side nav a[aria-current]::before { border-radius: 3px 0 0 3px; }
.side nav a[aria-current] .ico { color: var(--brass-lit); }
.side a:focus-visible, .side .btn:focus-visible { outline-color: var(--brass-lit); }
.nav-ico { width: 20px; height: 20px; display: inline-grid; place-items: center; text-align: center; flex: none; }
.side-links { display: grid; gap: 2px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.09); }
.side-links a, .side-links a.btn, .side-links a.text-link { display: flex; justify-content: flex-start; align-items: center; gap: 12px; min-height: 38px; padding: 6px 12px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: rgba(255,255,255,.66); font-size: .88rem; font-weight: 500; text-decoration: none; }
.side-links a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding: 12px 6px 0; border-top: 1px solid rgba(255,255,255,.09); }
.side-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.side-user strong { display: block; font-size: .92rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .hint { display: block; font-size: .76rem; }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .95rem; background: rgba(216,176,106,.16); color: var(--brass-lit); border: 1px solid rgba(216,176,106,.3); }
.side-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.side-foot .btn { background: rgba(255,255,255,.05); color: rgba(255,255,255,.86); border-color: rgba(255,255,255,.14); box-shadow: none; font-weight: 500; }
.side-foot .btn:hover { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.24); }
.side-foot .btn.busy::after { border-color: #fff transparent #fff transparent; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; gap: 12px; align-items: center; min-height: 64px; padding: 10px 32px; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.5) blur(12px); -webkit-backdrop-filter: saturate(1.5) blur(12px); border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1; max-width: 520px; }
.search .field { background-color: var(--surface); border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.search-results { position: absolute; inset-inline: 0; top: calc(100% + 8px); padding: 6px; display: grid; gap: 2px; max-height: 60dvh; overflow: auto; z-index: 30; box-shadow: var(--shadow-2); border-radius: var(--radius); }
.search-results a { display: flex; gap: 8px; align-items: center; min-height: var(--tap); padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a:focus { background: var(--primary-50); }
.search-results .empty { padding: 18px 12px; font-size: .9rem; }
.top .conn { margin-inline-start: auto; }
.top .conn.ok { background: transparent; color: var(--ink-3); font-weight: 500; }
.top .conn.ok::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-50); }
/* automatic-backup status: quiet when healthy, a normal notice when not */
#backup-health { width: calc(100% - 64px); max-width: 1176px; margin: 16px auto 0; font-size: .86rem; }
#backup-health.ok { background: transparent; border-color: transparent; color: var(--ink-3); padding: 0 2px; margin-top: 12px; font-size: .8rem; }
#backup-health.ok::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-end: 8px; border-radius: 50%; background: var(--ok); vertical-align: middle; }
#view { width: 100%; padding: 28px 32px 56px; max-width: 1240px; margin: 0 auto; outline: none; }
#view > .empty { padding-block: 72px; }
.tabbar { display: none; }

/* ── "more" (phone) ── */
.more-list { padding: 0; display: grid; overflow: hidden; }
.more-item { display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 8px 16px; color: var(--ink); text-decoration: none; font-weight: 600; }
.more-item + .more-item { border-top: 1px solid var(--line); }
.more-item:focus-visible { outline-offset: -3px; }
.more-item:hover { background: var(--surface-3); }
.more-ico { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--primary-50); color: var(--primary); }
.more-chev { margin-inline-start: auto; color: var(--ink-3); font-size: 1.3rem; line-height: 1; }
.more-account { display: grid; gap: 14px; }
.more-account .side-user strong { white-space: normal; }
.more-account .avatar { background: var(--brass-50); color: var(--brass-ink); border-color: color-mix(in srgb, var(--brass) 30%, transparent); }
.more-account .side-actions .btn { width: 100%; }

@media (max-width: 1080px) and (min-width: 821px) {
  .shell { grid-template-columns: 224px minmax(0, 1fr); }
  .top { padding-inline: 22px; } #view { padding-inline: 22px; } #backup-health { width: calc(100% - 44px); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { min-height: 58px; padding: 8px 12px; gap: 8px; } .top .conn { display: none; } .top kbd { display: none; }
  .top .btn { padding: 0 14px; }
  .shell:has(.tabbar [data-nav="new-order"]) .top #new-order-btn { display: none; }
  .search { max-width: none; }
  .top .conn.bad { display: inline-flex; position: absolute; top: calc(100% + 4px); inset-inline: 12px; justify-content: center; box-shadow: var(--shadow); margin: 0; }
  #backup-health { width: calc(100% - 24px); margin-top: 10px; }
  #view { padding: 16px 12px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 25; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px); border-top: 1px solid var(--line); padding: 0 4px env(safe-area-inset-bottom); }
  .tabbar a { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 58px; padding: 6px 2px; font-size: .68rem; font-weight: 600; line-height: 1.2; color: var(--ink-3); text-decoration: none; -webkit-tap-highlight-color: transparent; }
  .tabbar a span { font-size: 1.15rem; line-height: 1; display: grid; place-items: center; height: 24px; }
  .tabbar a .ico { width: 23px; height: 23px; }
  .tabbar a[aria-current] { color: var(--primary); }
  .tabbar a[aria-current]::before { content: ""; position: absolute; top: 0; width: 22px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brass); }
  .tabbar a[data-nav="new-order"] span { width: 40px; height: 28px; border-radius: 10px; background: var(--primary); color: #fff; }
  .tabbar a[data-nav="new-order"] .ico { width: 19px; height: 19px; stroke-width: 2; }
  .tabbar a:focus-visible { outline-offset: -3px; border-radius: 10px; }
  .toasts { bottom: calc(74px + env(safe-area-inset-bottom)); }
}
@media print { .shell { display: block; } #view { padding: 0; max-width: none; } }
