/* DO NOT EDIT — copied from packages/shared/src/storehub/ui/storehub.css
   by `npm run tokens`. Edit the source there, regenerate, commit both.
   A vitest in packages/shared fails if this file drifts from the source. */
/* Store Hub — shell + shared components (W4 Phase 2). Copied verbatim to
 * apps/server/public/shared/storehub/storehub.css by npm run tokens.
 *
 * Colours and type come ONLY from tokens.css (var(--...)); no hex, no new tokens (decision D8).
 * /m gets no alpha tints: every fill below is a solid colour-mix of two tokens. The only alpha
 * wash lives under .tdtt-sh--app / .tdtt-sh--desktop.
 *
 * Page writers: reuse these, do not re-invent them. All classes are prefixed .tdtt-sh-.
 *
 * LAYOUT
 *   .tdtt-sh                 root (+ --app | --desktop | --mobile, and --narrow under 900px or on mobile)
 *   .tdtt-sh-main            the page column; a page mounts into a .tdtt-sh-page inside it
 *   .tdtt-sh-head            page title row: .tdtt-sh-h1, .tdtt-sh-mut, .tdtt-sh-head__act (actions)
 *   .tdtt-sh-h1 / -h2        Montserrat headings (white)
 *   .tdtt-sh-mut             secondary text
 *   .tdtt-sh-grid            auto-fit card grid; --2 / --3 / --4 fix the column count (collapse when narrow)
 *   .tdtt-sh-row             flex row, gap, wraps; .tdtt-sh-row--between spreads its ends
 *   .tdtt-sh-stack           vertical flex, gap
 * COMPONENTS
 *   .tdtt-sh-card            12px radius, 1px border; __head / __act inside (kit.card builds it)
 *   .tdtt-sh-btn             button/link; --primary (gold), --accent (cyan outline), --sm, --off
 *   .tdtt-sh-pill            status pill; --online (green), --live (magenta), --warn (gold), --off (red)
 *   .tdtt-sh-tabs / -tab     sub-tabs (.on = active); .tdtt-sh-tab__n a count
 *   .tdtt-sh-chip(.on)       filter chip
 *   .tdtt-sh-table           data table (wrap in .tdtt-sh-scroll when it may overflow)
 *   .tdtt-sh-input           text input / select / textarea;  .tdtt-sh-label a field label
 *   .tdtt-sh-field           label + input stack
 *   .tdtt-sh-switch          <label class="tdtt-sh-switch"><input type="checkbox"><span></span></label>
 *   .tdtt-sh-stage           16:9 box for an engine preview (--portrait for 9:16); JS scales the inner
 *   .tdtt-sh-empty           empty-state block;  .tdtt-sh-skeleton animated placeholder
 *   .tdtt-sh-reason          the gate card: why this page is unavailable
 *   .tdtt-sh-notice          shop status band (--badge | --banner)
 *   .tdtt-sh-toast           the live region (the shell fills it)
 */

.tdtt-sh {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 560px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.45;
  position: relative;
  box-sizing: border-box;
}
.tdtt-sh *, .tdtt-sh *::before, .tdtt-sh *::after { box-sizing: border-box; }
.tdtt-sh--app,
.tdtt-sh--desktop {
  background-image: radial-gradient(ellipse 50% 30% at 80% 0%, color-mix(in srgb, var(--cyan) 7%, transparent), transparent 60%);
}
.tdtt-sh a { color: var(--cyan); text-decoration: none; }
.tdtt-sh a:hover { color: var(--text); }

/* ── side column ───────────────────────────────────────────────────── */
.tdtt-sh-side {
  background: var(--input);
  border-right: 1px solid var(--surface-2);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tdtt-sh-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; min-width: 0; }
.tdtt-sh-brand__txt { display: flex; flex-direction: column; min-width: 0; }
.tdtt-sh-brand__txt b { font-family: var(--head); font-weight: 800; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdtt-sh-brand__txt small { color: var(--text-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdtt-sh-logo {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--head);
  font-weight: 800;
  font-size: 13px;
  color: var(--bg);
  background: linear-gradient(135deg, var(--gold), var(--magenta));
}
.tdtt-sh-logo__img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; background: var(--surface); }
.tdtt-sh-picker { margin: 0 4px 10px; width: calc(100% - 8px); min-height: 36px; }
.tdtt-sh-nav { display: flex; flex-direction: column; gap: 2px; }
.tdtt-sh-nav__it {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.tdtt-sh .tdtt-sh-nav__it { color: var(--text-dim); }
.tdtt-sh-nav__it:hover { color: var(--text); background: var(--surface); }
.tdtt-sh-nav__it.on,
.tdtt-sh .tdtt-sh-nav__it.on { background: color-mix(in srgb, var(--cyan) 10%, var(--surface)); color: var(--cyan); font-weight: 600; }
.tdtt-sh-ico { flex: none; }

/* ── main column ───────────────────────────────────────────────────── */
.tdtt-sh-col { min-width: 0; display: flex; flex-direction: column; }
.tdtt-sh-top { display: none; }
.tdtt-sh-bottom { display: none; }
.tdtt-sh-main { flex: 1; min-width: 0; padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 18px; max-width: 1200px; width: 100%; outline: none; }
.tdtt-sh-page { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.tdtt-sh-state { display: flex; flex-direction: column; gap: 14px; }

.tdtt-sh-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tdtt-sh-head__txt { min-width: 0; }
.tdtt-sh-head__act { display: flex; gap: 8px; flex-wrap: wrap; }
.tdtt-sh-h1 { font-family: var(--head); font-weight: 800; font-size: 24px; margin: 0; color: var(--text); letter-spacing: 0; }
.tdtt-sh-h2 { font-family: var(--head); font-weight: 700; font-size: 15px; margin: 0; color: var(--text); letter-spacing: 0; }
.tdtt-sh-mut { color: var(--text-dim); font-size: 13px; margin: 2px 0 0; }

.tdtt-sh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.tdtt-sh-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tdtt-sh-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tdtt-sh-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tdtt-sh-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tdtt-sh-row--between { justify-content: space-between; }
.tdtt-sh-stack { display: flex; flex-direction: column; gap: 10px; }

/* ── card ──────────────────────────────────────────────────────────── */
.tdtt-sh-card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.tdtt-sh-card p { margin: 0; }
.tdtt-sh-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tdtt-sh-card__act { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── buttons ───────────────────────────────────────────────────────── */
.tdtt-sh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--text-dim) 22%, var(--surface));
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.tdtt-sh .tdtt-sh-btn { color: var(--text); }
.tdtt-sh-btn:hover { border-color: var(--text-dim); }
.tdtt-sh-btn .tdtt-sh-ico { width: 16px; height: 16px; }
.tdtt-sh-btn--primary,
.tdtt-sh .tdtt-sh-btn--primary { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 700; }
.tdtt-sh-btn--accent,
.tdtt-sh .tdtt-sh-btn--accent { border-color: var(--cyan); color: var(--cyan); background: color-mix(in srgb, var(--cyan) 8%, var(--surface)); }
.tdtt-sh-btn--sm { min-height: 32px; padding: 0 10px; font-size: 12.5px; }
.tdtt-sh-btn--off, .tdtt-sh-btn:disabled { opacity: .5; cursor: not-allowed; }
.tdtt-sh-btn:focus-visible, .tdtt-sh-nav__it:focus-visible, .tdtt-sh-tab:focus-visible, .tdtt-sh-chip:focus-visible,
.tdtt-sh-tab-it:focus-visible, .tdtt-sh-input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ── pills, chips, tabs ────────────────────────────────────────────── */
.tdtt-sh-pill {
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--text-dim);
  background: var(--surface-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tdtt-sh-pill--online { color: var(--green); background: color-mix(in srgb, var(--green) 12%, var(--surface)); }
.tdtt-sh-pill--live { color: var(--magenta); background: color-mix(in srgb, var(--magenta) 14%, var(--surface)); }
.tdtt-sh-pill--warn { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.tdtt-sh-pill--off { color: var(--red); background: color-mix(in srgb, var(--red) 12%, var(--surface)); }

.tdtt-sh-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--text-dim) 22%, var(--surface));
  background: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
}
.tdtt-sh-chip.on { border-color: var(--cyan); color: var(--cyan); background: color-mix(in srgb, var(--cyan) 10%, var(--surface)); }

.tdtt-sh-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--surface-2); flex-wrap: wrap; }
.tdtt-sh-tab {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
}
.tdtt-sh-tab.on { color: var(--cyan); border-bottom-color: var(--cyan); font-weight: 600; }
.tdtt-sh-tab__n { font-size: 11px; color: var(--text-dim); }

/* ── table, forms ──────────────────────────────────────────────────── */
.tdtt-sh-scroll { overflow-x: auto; }
.tdtt-sh-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tdtt-sh-table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); padding: 8px 10px; border-bottom: 1px solid var(--surface-2); }
.tdtt-sh-table td { padding: 12px 10px; border-bottom: 1px solid var(--surface-2); }

.tdtt-sh-field { display: flex; flex-direction: column; gap: 6px; }
.tdtt-sh-label { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.tdtt-sh-input {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--text-dim) 22%, var(--surface));
  background: var(--input);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-size: 13.5px;
  width: 100%;
}
textarea.tdtt-sh-input { padding: 10px 12px; min-height: 88px; resize: vertical; }

.tdtt-sh-switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.tdtt-sh-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.tdtt-sh-switch span { position: absolute; inset: 0; border-radius: 10px; background: color-mix(in srgb, var(--text-dim) 22%, var(--surface)); }
.tdtt-sh-switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-dim); }
.tdtt-sh-switch input:checked + span { background: var(--cyan); }
.tdtt-sh-switch input:checked + span::after { left: auto; right: 3px; background: var(--bg); }
.tdtt-sh-switch input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ── display preview stage ─────────────────────────────────────────── */
.tdtt-sh-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--surface-2);
  background: var(--input);
}
/* every thumbnail box stays 16:9; a portrait stage is fitted by height inside it (JS), letterboxed */
.tdtt-sh-stage--portrait { background: var(--bg); }
.tdtt-sh-stage__in { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 0 0; transform: scale(.2); pointer-events: none; }
.tdtt-sh-stage--portrait .tdtt-sh-stage__in { width: 900px; height: 1600px; }
.tdtt-sh-stage--ph { display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 12px; }

/* ── empty, skeleton, reason, notice, toast ────────────────────────── */
.tdtt-sh-empty { border: 1px dashed color-mix(in srgb, var(--text-dim) 22%, var(--surface)); border-radius: 12px; padding: 24px 16px; text-align: center; color: var(--text-dim); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.tdtt-sh-empty p { margin: 0; }
.tdtt-sh-skeleton { display: flex; flex-direction: column; gap: 10px; }
.tdtt-sh-skeleton i { display: block; height: 14px; border-radius: 6px; background: var(--surface-2); animation: tdtt-sh-pulse 1.4s ease-in-out infinite; }
.tdtt-sh-skeleton i:nth-child(2n) { width: 70%; }
.tdtt-sh-skeleton--page i { height: 72px; border-radius: 12px; }
@keyframes tdtt-sh-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tdtt-sh-skeleton i { animation: none; } }

.tdtt-sh-reason { background: var(--surface); border: 1px solid var(--surface-2); border-radius: 12px; padding: 28px 20px; max-width: 520px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.tdtt-sh-reason p { margin: 0; color: var(--text-dim); }
.tdtt-sh-reason__ic { color: var(--gold); }
.tdtt-sh-reason__ic .tdtt-sh-ico { width: 24px; height: 24px; }

.tdtt-sh-notice { display: flex; align-items: center; gap: 8px; padding: 10px 28px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--gold) 12%, var(--surface)); color: var(--gold); border-bottom: 1px solid var(--surface-2); }
.tdtt-sh-notice--banner { background: color-mix(in srgb, var(--magenta) 12%, var(--surface)); color: var(--magenta); }
.tdtt-sh-notice .tdtt-sh-ico { width: 16px; height: 16px; }

.tdtt-sh-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; pointer-events: none; max-width: calc(100vw - 32px); }
.tdtt-sh-toast__msg { background: var(--surface-2); color: var(--text); border: 1px solid color-mix(in srgb, var(--text-dim) 22%, var(--surface)); border-radius: 10px; padding: 10px 16px; font-size: 13px; font-weight: 600; }
.tdtt-sh-toast__msg--ok { border-color: var(--green); }
.tdtt-sh-toast__msg--error { border-color: var(--red); }

/* ── More list (phone) ─────────────────────────────────────────────── */
.tdtt-sh-more { padding: 6px; gap: 2px; }
.tdtt-sh-more__it { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; width: 100%; }
.tdtt-sh .tdtt-sh-more__it { color: var(--text); }
.tdtt-sh-more__it span { flex: 1; }
.tdtt-sh-more__it:hover { background: var(--surface-2); }
.tdtt-sh-more__it > .tdtt-sh-ico:last-child { color: var(--text-dim); }

/* ── narrow: top bar + bottom tabs (under 900px, and always on /m) ─── */
.tdtt-sh--compact { grid-template-columns: 200px minmax(0, 1fr); }
.tdtt-sh--compact .tdtt-sh-side { padding: 14px 8px; }
.tdtt-sh--compact .tdtt-sh-nav__it { gap: 8px; padding: 0 8px; font-size: 13px; }
.tdtt-sh--compact .tdtt-sh-main { padding: 20px 18px 32px; }
.tdtt-sh--stack { grid-template-columns: minmax(0, 1fr); background-image: none; }
.tdtt-sh--stack .tdtt-sh-side { border-right: 0; border-bottom: 1px solid var(--surface-2); padding: 10px 12px 0; }
.tdtt-sh--stack .tdtt-sh-nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 8px; }
.tdtt-sh--stack .tdtt-sh-nav__it { white-space: nowrap; flex: none; }
.tdtt-sh--stack .tdtt-sh-main { padding: 16px 14px 28px; }
.tdtt-sh--stack .tdtt-sh-grid--2,
.tdtt-sh--stack .tdtt-sh-grid--3,
.tdtt-sh--stack .tdtt-sh-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tdtt-sh--narrow { grid-template-columns: minmax(0, 1fr); background-image: none; }
.tdtt-sh--narrow .tdtt-sh-side { display: none; }
.tdtt-sh--narrow .tdtt-sh-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: var(--input);
  border-bottom: 1px solid var(--surface-2);
}
.tdtt-sh--narrow .tdtt-sh-top .tdtt-sh-brand { padding: 0; flex: 1; }
.tdtt-sh--narrow .tdtt-sh-top .tdtt-sh-picker { margin: 0; width: 44%; max-width: 200px; }
.tdtt-sh--narrow .tdtt-sh-main { padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); }
.tdtt-sh--narrow .tdtt-sh-notice { padding: 10px 16px; }
.tdtt-sh--narrow .tdtt-sh-h1 { font-size: 20px; }
.tdtt-sh--narrow .tdtt-sh-grid--2,
.tdtt-sh--narrow .tdtt-sh-grid--3,
.tdtt-sh--narrow .tdtt-sh-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tdtt-sh--narrow .tdtt-sh-bottom {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--input);
  border-top: 1px solid var(--surface-2);
  padding-bottom: env(safe-area-inset-bottom);
}
.tdtt-sh-tab-it { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--text-dim); cursor: pointer; }
.tdtt-sh .tdtt-sh-tab-it { color: var(--text-dim); }
.tdtt-sh-tab-it.on, .tdtt-sh .tdtt-sh-tab-it.on { color: var(--cyan); }
.tdtt-sh-tab-it .tdtt-sh-ico { width: 20px; height: 20px; }

/* no shop loaded: no tab bar */
.tdtt-sh--narrow .tdtt-sh-bottom:empty { display: none; }

/* /m page: the Store Hub tabs replace the global bottom dock */
body.tdtt-sh-m-page .bf-dock { display: none; }
