/* Local throwaway prototype. Exact Vivat Design System V3 tokens are imported separately. */
:root {
  font-family: var(--ds-font-sans, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { background: var(--ds-color-background); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ds-color-text);
  background: var(--ds-color-background);
  transition: color var(--ds-motion-normal) var(--ds-motion-easing), background var(--ds-motion-normal) var(--ds-motion-easing);
}

button, input, select { font: inherit; }
a { color: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible {
  outline: var(--ds-focus-ring-width) solid var(--ds-color-focus-ring);
  outline-offset: var(--ds-focus-ring-offset);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-controls {
  position: absolute;
  z-index: 40;
  top: 18px;
  right: clamp(18px, 2.35vw, 56px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 56px;
}
.control-group { display: flex; align-items: center; gap: 6px; }
.control-select, .edit-order {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--ds-color-border-strong);
  border-radius: var(--ds-radius-full);
  color: var(--ds-color-text);
  background: color-mix(in srgb, var(--ds-color-surface) 92%, transparent);
  font-size: var(--ds-font-size-sm);
  font-weight: var(--ds-font-weight-semibold);
}
.control-select { padding-right: 34px; }
.edit-order:hover, .control-select:hover { background: var(--ds-color-surface-elevated); }
.control-status { display: inline-flex; align-items: center; gap: 7px; color: var(--ds-color-text-muted); font-size: 10px; letter-spacing: .12em; }
.control-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ds-color-success); }
.portal-controls .mode-control { display: flex; padding: 3px; border-radius: var(--ds-radius-full); background: var(--ds-color-surface-elevated); }
.portal-controls .mode-button { min-width: 40px; min-height: 38px; }

html[data-prototype-variant="D"] .portal-controls {
  --p-surface: #111318;
  --p-line-strong: rgba(243, 240, 232, .28);
  --p-text: #f3f0e8;
  --p-muted: #a6a7aa;
  --p-accent: #caff62;
  --p-accent-ink: #172006;
}
html[data-prototype-variant="D"][data-atelier="day"] .portal-controls {
  --p-surface: #f8f5ed;
  --p-line-strong: rgba(23, 25, 20, .28);
  --p-text: #171914;
  --p-muted: #5b6056;
  --p-accent: #667619;
  --p-accent-ink: #fffef7;
}
html[data-prototype-variant="D"] .control-select,
html[data-prototype-variant="D"] .edit-order { border-color: var(--p-line-strong); color: var(--p-text); background: color-mix(in srgb, var(--p-surface) 88%, transparent); }
html[data-prototype-variant="D"] .control-select:hover,
html[data-prototype-variant="D"] .edit-order:hover { background: var(--p-surface); }
html[data-prototype-variant="D"] .control-status { color: var(--p-muted); }
html[data-prototype-variant="D"] .control-status::before { background: var(--p-accent); }

.apps { counter-reset: portal-card; }
.app { counter-increment: portal-card; }
.premium-number::before { content: counter(portal-card, decimal-leading-zero); }

.shell {
  width: min(100% - 32px, 1420px);
  margin: 0 auto;
  padding: 22px 0 108px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: var(--ds-radius-md);
  color: var(--ds-color-action-secondary-text);
  background: var(--ds-color-action-secondary);
  font-weight: var(--ds-font-weight-bold);
  letter-spacing: -.04em;
}

.brand-name { display: block; font-weight: var(--ds-font-weight-bold); font-size: var(--ds-font-size-lg); }
.brand-caption { display: block; margin-top: 2px; color: var(--ds-color-text-muted); font-size: var(--ds-font-size-xs); }

.top-actions { display: flex; align-items: center; gap: 8px; }
.server-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--ds-size-control-sm);
  padding: 0 12px;
  border-radius: var(--ds-radius-full);
  color: var(--ds-color-success-text);
  background: var(--ds-color-success-surface);
  font-size: var(--ds-font-size-sm);
  white-space: nowrap;
}
.server-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ds-color-success); }

.icon-button, .select-control, .mode-button, .chip {
  min-height: var(--ds-target-minimum);
  border: 0;
  border-radius: var(--ds-radius-md);
  color: var(--ds-color-text-secondary);
  background: var(--ds-color-surface-elevated);
}

.icon-button { width: var(--ds-target-minimum); padding: 0; font-size: 19px; }
.select-control { max-width: 170px; padding: 0 34px 0 12px; }
.mode-control { display: flex; padding: 3px; border-radius: var(--ds-radius-md); background: var(--ds-color-surface-elevated); }
.mode-button { min-width: 44px; min-height: 38px; padding: 0 10px; background: transparent; }
.mode-button[aria-pressed="true"] { color: var(--ds-color-action-secondary-text); background: var(--ds-color-action-secondary); }

.hero {
  position: relative;
  overflow: hidden;
  margin-top: 20px;
  border-radius: var(--ds-radius-xl);
  color: var(--ds-color-feature-text);
  background: var(--ds-color-feature-surface);
}

.hero::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -90px;
  bottom: -230px;
  border-radius: 50%;
  background: var(--ds-color-feature-surface-alt);
  opacity: .48;
}

.hero-content { position: relative; z-index: 1; padding: clamp(28px, 5vw, 64px); }
.eyebrow { margin: 0 0 12px; font-size: var(--ds-font-size-xs); font-weight: var(--ds-font-weight-bold); letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { max-width: 850px; margin: 0; font-size: clamp(34px, 5.1vw, 68px); line-height: 1.02; letter-spacing: -.045em; }
.hero p { max-width: 720px; margin: 18px 0 0; color: var(--ds-color-feature-text-muted); font-size: clamp(16px, 1.5vw, 20px); line-height: var(--ds-line-height-relaxed); }
.hero-meta { display: flex; gap: 24px; margin-top: 28px; font-size: var(--ds-font-size-sm); font-weight: var(--ds-font-weight-semibold); }

.toolbar {
  position: sticky;
  z-index: 8;
  top: 10px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin: 22px 0;
  padding: 12px;
  border-radius: var(--ds-radius-lg);
  background: color-mix(in srgb, var(--ds-color-surface) 92%, transparent);
  box-shadow: var(--ds-shadow-md);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.search-wrap { position: relative; }
.search-icon { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); color: var(--ds-color-text-muted); pointer-events: none; }
.search {
  width: 100%;
  min-height: var(--ds-size-control-lg);
  padding: 0 42px;
  border: 1px solid var(--ds-color-field-border);
  border-radius: var(--ds-radius-md);
  color: var(--ds-color-text);
  background: var(--ds-color-field-surface);
}
.search::placeholder { color: var(--ds-color-field-placeholder); }
.clear-search { position: absolute; top: 50%; right: 5px; width: 38px; min-height: 38px; transform: translateY(-50%); border: 0; border-radius: 10px; color: var(--ds-color-text-muted); background: transparent; }
.filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; min-width: 0; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 0 14px; font-weight: var(--ds-font-weight-semibold); }
.chip[aria-pressed="true"] { color: var(--ds-color-action-secondary-text); background: var(--ds-color-action-secondary); }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 30px 0 14px; }
.section-heading h2 { margin: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.025em; }
.section-heading p { margin: 6px 0 0; color: var(--ds-color-text-secondary); }
.result-count { flex: 0 0 auto; color: var(--ds-color-text-muted); font-size: var(--ds-font-size-sm); }

.app-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: var(--ds-radius-md);
  color: var(--ds-color-action-secondary-text);
  background: var(--ds-color-action-secondary);
  font-size: var(--ds-font-size-sm);
  font-weight: var(--ds-font-weight-bold);
  letter-spacing: -.03em;
}
.app-icon[data-tone="feature"] { color: var(--ds-color-feature-text); background: var(--ds-color-feature-surface-alt); }
.app-icon[data-tone="accent"] { color: var(--ds-color-action-primary-text); background: var(--ds-color-action-primary); }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: var(--ds-radius-full);
  color: var(--ds-color-text-secondary);
  background: var(--ds-color-surface-muted);
  font-size: var(--ds-font-size-xs);
  font-weight: var(--ds-font-weight-bold);
}
.badge--game { color: var(--ds-color-feature-text); background: var(--ds-color-feature-surface); }
.badge--development { color: var(--ds-color-action-primary); background: var(--ds-color-surface-elevated); box-shadow: inset 0 0 0 1px var(--ds-color-action-primary); }
.badge--archive { color: var(--ds-color-text-muted); background: transparent; box-shadow: inset 0 0 0 1px var(--ds-color-border); }
.semantic-tags { display: flex; max-width: 72%; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }

.open-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ds-color-action-secondary); font-weight: var(--ds-font-weight-bold); text-decoration: none; }
.open-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.open-link--disabled { color: var(--ds-color-text-muted); cursor: default; }
.open-link--disabled:hover { text-decoration: none; }
.chip[data-category="games"] { border-color: var(--ds-color-feature-border); }
.chip[data-category="development"], .chip[data-category="archive"] { border-style: dashed; }

/* Variant A: a calm, balanced working studio. */
.studio-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.studio-card {
  display: flex;
  min-width: 0;
  min-height: 244px;
  flex-direction: column;
  padding: 20px;
  border-radius: var(--ds-radius-lg);
  background: var(--ds-color-surface);
  box-shadow: var(--ds-shadow-sm);
  transition: transform var(--ds-motion-normal) var(--ds-motion-easing), box-shadow var(--ds-motion-normal) var(--ds-motion-easing);
}
.studio-card:hover { transform: translateY(-3px); box-shadow: var(--ds-shadow-md); }
.card-top { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.studio-card h3 { margin: 20px 0 0; font-size: var(--ds-font-size-xl); line-height: var(--ds-line-height-tight); letter-spacing: -.02em; }
.studio-card p { margin: 10px 0 20px; color: var(--ds-color-text-secondary); line-height: var(--ds-line-height-normal); }
.studio-card .open-link { margin-top: auto; }

/* Variant B: an editorial product gallery with featured shelves. */
.gallery-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); }
.gallery-hero .hero-content { align-self: center; }
.gallery-feature {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 20px;
  scrollbar-width: none;
}
.gallery-feature::-webkit-scrollbar { display: none; }
.feature-tile { display: flex; min-height: 150px; flex-direction: column; padding: 18px; border-radius: var(--ds-radius-lg); color: var(--ds-color-text); background: var(--ds-color-surface); box-shadow: var(--ds-shadow-sm); }
.feature-tile h3 { margin: 18px 0 4px; font-size: var(--ds-font-size-lg); }
.feature-tile small { color: var(--ds-color-text-muted); }
.gallery-section { margin-top: 30px; }
.gallery-shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 30%); gap: 14px; padding: 4px 4px 18px; overflow-x: auto; scroll-snap-type: x proximity; }
.gallery-card { display: grid; grid-template-rows: 140px 1fr; min-height: 300px; overflow: hidden; border-radius: var(--ds-radius-lg); background: var(--ds-color-surface); box-shadow: var(--ds-shadow-sm); scroll-snap-align: start; }
.gallery-art { position: relative; display: grid; place-items: center; background: var(--ds-color-surface-muted); }
.gallery-art::before, .gallery-art::after { content: ""; position: absolute; border-radius: 50%; background: var(--ds-color-feature-surface); opacity: .7; }
.gallery-art::before { width: 120px; height: 120px; left: -26px; bottom: -52px; }
.gallery-art::after { width: 86px; height: 86px; right: -16px; top: -30px; background: var(--ds-color-action-primary); opacity: .45; }
.gallery-art .app-icon { position: relative; z-index: 1; width: 58px; height: 58px; }
.gallery-body { display: flex; flex-direction: column; padding: 18px; }
.gallery-body h3 { margin: 0; font-size: var(--ds-font-size-xl); }
.gallery-body p { margin: 9px 0 18px; color: var(--ds-color-text-secondary); line-height: 1.48; }
.gallery-body .open-link { margin-top: auto; }

/* Variant C: a dense command center with fixed navigation and rows. */
.command-shell { width: min(100% - 24px, 1540px); padding-top: 12px; }
.command-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.sidebar { position: sticky; top: 12px; display: flex; height: calc(100vh - 36px); min-height: 560px; flex-direction: column; padding: 18px; border-radius: var(--ds-radius-xl); color: var(--ds-color-feature-text); background: var(--ds-color-feature-surface); }
.sidebar .brand-caption { color: var(--ds-color-feature-text-muted); }
.sidebar-nav { display: grid; gap: 5px; margin-top: 32px; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }
.sidebar-nav .chip { display: flex; justify-content: space-between; width: 100%; padding-inline: 12px; color: var(--ds-color-feature-text); background: transparent; }
.sidebar-nav .chip[aria-pressed="true"] { color: var(--ds-color-action-secondary-text); background: var(--ds-color-action-secondary); }
.nav-count { margin-left: 8px; opacity: .72; font-size: var(--ds-font-size-xs); }
.sidebar-foot { margin-top: auto; padding: 14px; border-radius: var(--ds-radius-md); background: color-mix(in srgb, var(--ds-color-surface) 52%, transparent); }
.sidebar-foot strong, .sidebar-foot span { display: block; }
.sidebar-foot span { margin-top: 4px; color: var(--ds-color-feature-text-muted); font-size: var(--ds-font-size-sm); }
.command-main { min-width: 0; }
.command-header { display: flex; justify-content: space-between; gap: 24px; padding: 16px 4px 10px; }
.command-header h1 { margin: 0; font-size: clamp(30px, 4vw, 52px); letter-spacing: -.04em; }
.command-header p { margin: 8px 0 0; color: var(--ds-color-text-secondary); }
.command-toolbar { position: static; margin: 14px 0; grid-template-columns: minmax(220px, 1fr) auto; }
.command-list { overflow: hidden; border-radius: var(--ds-radius-lg); background: var(--ds-color-surface); box-shadow: var(--ds-shadow-sm); }
.command-row { display: grid; grid-template-columns: auto auto minmax(190px, 1.25fr) minmax(200px, 1fr) auto auto; gap: 16px; align-items: center; min-height: 78px; padding: 12px 16px; border-bottom: 1px solid var(--ds-color-border); }
.command-row:last-child { border-bottom: 0; }
.command-row:hover { background: var(--ds-color-surface-elevated); }
.command-title strong, .command-title small { display: block; }
.command-title small { margin-top: 4px; color: var(--ds-color-text-muted); }
.command-description { color: var(--ds-color-text-secondary); font-size: var(--ds-font-size-sm); line-height: 1.4; }
.command-position { color: var(--ds-color-text-muted); font-size: var(--ds-font-size-sm); font-variant-numeric: tabular-nums; }
.command-position::before { content: counter(portal-card, decimal-leading-zero); }

/* Variant D: an independent premium direction. It intentionally does not consume Vivat DS V3 tokens. */
html[data-prototype-variant="D"] { color-scheme: dark; background: #08090b; }
html[data-prototype-variant="D"] body {
  color: #f3f0e8;
  background:
    radial-gradient(circle at 86% 3%, rgba(189, 255, 91, .12), transparent 24rem),
    radial-gradient(circle at 5% 38%, rgba(99, 82, 255, .10), transparent 30rem),
    #08090b;
  font-family: "Aptos", "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", sans-serif;
}

html[data-prototype-variant="D"][data-atelier="day"] { color-scheme: light; background: #eeeade; }
html[data-prototype-variant="D"][data-atelier="day"] body {
  color: #171914;
  background:
    radial-gradient(circle at 86% 3%, rgba(120, 139, 35, .14), transparent 25rem),
    radial-gradient(circle at 5% 38%, rgba(113, 95, 189, .08), transparent 31rem),
    #eeeade;
}

.premium-shell {
  --p-bg: #08090b;
  --p-surface: #111318;
  --p-surface-2: #171a20;
  --p-line: rgba(243, 240, 232, .14);
  --p-line-strong: rgba(243, 240, 232, .28);
  --p-text: #f3f0e8;
  --p-muted: #a6a7aa;
  --p-accent: #caff62;
  --p-accent-ink: #172006;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  padding: 0 clamp(18px, 2.35vw, 56px) 110px;
}

html[data-prototype-variant="D"][data-atelier="day"] .premium-shell {
  --p-bg: #eeeade;
  --p-surface: #f8f5ed;
  --p-surface-2: #e4dfd3;
  --p-line: rgba(23, 25, 20, .14);
  --p-line-strong: rgba(23, 25, 20, .28);
  --p-text: #171914;
  --p-muted: #5b6056;
  --p-accent: #667619;
  --p-accent-ink: #fffef7;
}

.premium-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  border-bottom: 1px solid var(--p-line);
}
.premium-brand { display: inline-flex; align-items: center; gap: 13px; color: var(--p-text); text-decoration: none; }
.premium-brand > span:last-child { display: grid; gap: 2px; }
.premium-brand strong { font-size: 15px; letter-spacing: .24em; }
.premium-brand small { color: var(--p-muted); font-size: 9px; letter-spacing: .16em; }
.premium-monogram { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--p-line-strong); border-radius: 50%; font-size: 13px; font-weight: 800; }
.atelier-switch { display: flex; padding: 3px; border: 1px solid var(--p-line-strong); border-radius: 999px; background: color-mix(in srgb, var(--p-surface) 74%, transparent); }
.atelier-mode { min-width: 62px; min-height: 40px; padding: 0 13px; border: 0; border-radius: 999px; color: var(--p-muted); background: transparent; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.atelier-mode:hover { color: var(--p-text); background: color-mix(in srgb, var(--p-text) 7%, transparent); }
.atelier-mode[aria-pressed="true"] { color: var(--p-accent-ink); background: var(--p-accent); }

.premium-hero { position: relative; display: grid; min-height: clamp(360px, 44vh, 440px); grid-template-columns: minmax(0, 2fr) minmax(190px, .35fr); align-items: center; border-bottom: 1px solid var(--p-line); }
.premium-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(var(--p-line) 1px, transparent 1px), linear-gradient(90deg, var(--p-line) 1px, transparent 1px); background-size: min(12vw, 170px) min(12vw, 170px); mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,.34), transparent); opacity: .22; }
.premium-hero-copy { position: relative; z-index: 1; padding: 32px 0 46px; }
.premium-kicker { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; color: var(--p-muted); font-size: 10px; font-weight: 700; letter-spacing: .2em; }
.premium-kicker span { color: var(--p-accent); }
.premium-hero h1 { max-width: 820px; margin: 0; font-family: "Aptos Display", "SF Pro Display", "Segoe UI Variable Display", sans-serif; font-size: clamp(42px, 4vw, 76px); font-weight: 650; line-height: .94; letter-spacing: -.06em; }
.premium-hero h1 em { color: var(--p-accent); font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.premium-hero-copy > p:last-of-type { max-width: 720px; margin: 20px 0 0; color: var(--p-muted); font-size: clamp(15px, 1vw, 18px); line-height: 1.45; }
.premium-hero-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.premium-hero-stats span { padding: 7px 10px; border: 1px solid var(--p-line); border-radius: 999px; color: var(--p-muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.premium-orbit { position: relative; width: min(17vw, 230px); aspect-ratio: 1; justify-self: end; }
.premium-orbit::before, .premium-orbit::after, .premium-orbit i { content: ""; position: absolute; inset: 0; border: 1px solid var(--p-line); border-radius: 50%; }
.premium-orbit::after { inset: 16%; border-color: var(--p-line-strong); }
.premium-orbit i:nth-of-type(1) { inset: 32%; border-color: rgba(202, 255, 98, .35); }
.premium-orbit i:nth-of-type(2) { width: 12px; height: 12px; inset: 7% auto auto 48%; border: 0; background: var(--p-accent); box-shadow: 0 0 24px rgba(202,255,98,.8); }
.premium-orbit i:nth-of-type(3) { width: 6px; height: 6px; inset: auto 12% 25% auto; border: 0; background: #887aff; }
html[data-prototype-variant="D"][data-atelier="day"] .premium-orbit i:nth-of-type(1) { border-color: rgba(102, 118, 25, .38); }
html[data-prototype-variant="D"][data-atelier="day"] .premium-orbit i:nth-of-type(2) { box-shadow: 0 0 21px rgba(102, 118, 25, .46); }
html[data-prototype-variant="D"][data-atelier="day"] .premium-orbit i:nth-of-type(3) { background: #7469b4; }
.orbit-core { position: absolute; z-index: 2; inset: 43%; display: grid; place-items: center; border-radius: 50%; color: var(--p-accent-ink); background: var(--p-accent); font-size: 12px; font-weight: 900; }
.premium-catalog { padding: 36px 0 80px; }
.premium-catalog-head { display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.premium-catalog-head h2 { margin: 0; font-family: "Aptos Display", "SF Pro Display", "Segoe UI Variable Display", sans-serif; font-size: clamp(48px, 4.2vw, 76px); line-height: .88; letter-spacing: -.06em; }
.premium-catalog-head > p { max-width: 480px; margin: 0 0 8px; color: var(--p-muted); font-size: 15px; line-height: 1.65; }
.premium-toolbar { display: grid; grid-template-columns: minmax(300px, .55fr) minmax(0, 1fr); gap: 20px; align-items: start; margin: 26px 0 28px; padding-bottom: 18px; border-bottom: 1px solid var(--p-line-strong); }
.premium-toolbar .search { min-height: 56px; padding-inline: 46px; border: 1px solid var(--p-line); border-radius: 0; color: var(--p-text); background: rgba(255,255,255,.025); }
.premium-toolbar .search::placeholder { color: #777a80; }
.premium-toolbar .search-icon { color: var(--p-accent); }
.premium-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; min-width: 0; }
.premium-filters::-webkit-scrollbar { display: none; }
.premium-filters .chip { flex: 0 0 auto; min-height: 42px; padding: 0 15px; border: 1px solid var(--p-line); border-radius: 999px; color: var(--p-muted); background: transparent; font-size: 12px; }
.premium-filters .chip[aria-pressed="true"] { border-color: var(--p-accent); color: var(--p-accent-ink); background: var(--p-accent); }
.premium-result { display: flex; justify-content: space-between; margin-bottom: 16px; color: var(--p-muted); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }

.premium-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--p-line); border-left: 1px solid var(--p-line); }
.premium-card { position: relative; display: flex; min-width: 0; min-height: 340px; flex-direction: column; padding: clamp(20px, 2vw, 34px); border-right: 1px solid var(--p-line); border-bottom: 1px solid var(--p-line); background: linear-gradient(145deg, rgba(255,255,255,.035), transparent 56%); transition: background .22s ease, transform .22s ease; }
.premium-card:hover { z-index: 2; background: linear-gradient(145deg, hsla(var(--card-hue), 80%, 58%, .13), rgba(255,255,255,.04)); }
.premium-card::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; transform: scaleX(0); transform-origin: left; background: var(--p-accent); transition: transform .22s ease; }
.premium-card:hover::after { transform: scaleX(1); }
.premium-card-top { display: flex; align-items: start; justify-content: space-between; }
.premium-number { color: #6f7176; font-size: 10px; letter-spacing: .16em; }
.premium-card-corner { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.premium-label { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; border: 1px solid var(--p-line); border-radius: 999px; color: var(--p-muted); font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.premium-label--game { border-color: var(--p-accent); color: var(--p-accent); }
.premium-label--development { border-style: dashed; color: #9b91ff; }
.premium-label--archive { border-style: dashed; color: var(--p-muted); }
.premium-icon { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid hsla(var(--card-hue), 80%, 72%, .28); border-radius: 50%; color: hsl(var(--card-hue) 82% 76%); background: hsla(var(--card-hue), 70%, 50%, .10); font-size: 12px; font-weight: 800; }
.premium-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 42px; }
.premium-tags span { padding: 6px 9px; border: 1px solid var(--p-line); border-radius: 999px; color: var(--p-muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.premium-card h3 { margin: 18px 0 0; font-family: "Aptos Display", "SF Pro Display", "Segoe UI Variable Display", sans-serif; font-size: clamp(24px, 1.75vw, 36px); line-height: 1.02; letter-spacing: -.045em; }
.premium-card > p { margin: 15px 0 28px; color: var(--p-muted); font-size: 14px; line-height: 1.55; }
.premium-card footer { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-top: auto; }
.premium-card footer > span { color: #6f7176; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.premium-card .open-link { color: var(--p-text); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.premium-card .open-link span { color: var(--p-accent); }
html[data-prototype-variant="D"][data-atelier="day"] .premium-toolbar .search { background: rgba(255, 254, 247, .55); }
html[data-prototype-variant="D"][data-atelier="day"] .premium-toolbar .search::placeholder { color: #74786f; }
html[data-prototype-variant="D"][data-atelier="day"] .premium-card { background: linear-gradient(145deg, rgba(255,255,255,.52), rgba(248,245,237,.12) 58%); }
html[data-prototype-variant="D"][data-atelier="day"] .premium-card:hover { background: linear-gradient(145deg, hsla(var(--card-hue), 45%, 45%, .11), rgba(255,255,255,.64)); }
html[data-prototype-variant="D"][data-atelier="day"] .premium-number,
html[data-prototype-variant="D"][data-atelier="day"] .premium-card footer > span { color: #6b7066; }
html[data-prototype-variant="D"][data-atelier="day"] .premium-icon { border-color: hsla(var(--card-hue), 48%, 34%, .27); color: hsl(var(--card-hue) 45% 27%); background: hsla(var(--card-hue), 48%, 38%, .10); }
html[data-prototype-variant="D"][data-atelier="day"] .premium-label--development { color: #6659a8; }
.premium-shell .empty { border: 1px solid var(--p-line); color: var(--p-text); background: var(--p-surface); }
.premium-shell .empty p { color: var(--p-muted); }
.premium-shell .empty button { color: var(--p-accent-ink); background: var(--p-accent); }
.premium-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 30px 0; border-top: 1px solid var(--p-line); color: var(--p-muted); font-size: 9px; letter-spacing: .16em; }
.premium-footer p { margin: 0; text-align: center; text-transform: uppercase; }
.premium-footer > span:last-child { justify-self: end; }

/* Shared order editor: stable across every catalog view. */
.order-editor {
  width: min(760px, calc(100% - 28px));
  max-height: min(88vh, 900px);
  padding: 0;
  overflow: hidden;
  border: 1px solid #d8dedb;
  border-radius: 22px;
  color: #18201d;
  background: #fff;
  box-shadow: 0 28px 90px rgba(20, 31, 27, .24);
}
.order-editor::backdrop { background: rgba(12, 17, 15, .58); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.order-editor-fallback { position: fixed; z-index: 80; inset: 6vh auto auto 50%; transform: translateX(-50%); }
.order-editor__layout { display: grid; max-height: min(88vh, 900px); grid-template-rows: auto auto minmax(220px, 1fr) auto; }
.order-editor__header, .order-editor__footer { display: flex; align-items: center; gap: 12px; padding: 18px 22px; }
.order-editor__header { justify-content: space-between; border-bottom: 1px solid #e3e9e6; }
.order-editor__header h2 { margin: 0; font-size: 24px; }
.order-editor__header p { margin: 5px 0 0; color: #5d6a65; line-height: 1.4; }
.icon-button { flex: 0 0 auto; width: 44px; min-height: 44px; border: 0; border-radius: 12px; color: #33413b; background: #eef2f0; font-size: 24px; }
.legacy-order { margin: 14px 22px 0; padding: 12px 14px; border: 1px solid #cfe2d6; border-radius: 12px; color: #31533f; background: #eff8f2; }
.legacy-order button { margin-left: 8px; border: 0; color: #0a542b; background: transparent; font-weight: 800; text-decoration: underline; }
.sort-list { min-height: 0; margin: 0; padding: 14px 22px 20px; overflow-y: auto; list-style: none; overscroll-behavior: contain; }
.sort-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 64px; margin: 0 0 8px; padding: 8px 10px; border: 1px solid #e1e7e4; border-radius: 14px; background: #fff; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.sort-item.is-dragging { opacity: .32; border: 2px solid #2c7be5; }
.sort-item.is-flashing { animation: moved-card-flash .7s ease; }
@keyframes moved-card-flash { 35% { background: #e8f6ec; border-color: #68a77b; } }
.sort-grip, .sort-action { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #dce4e0; border-radius: 11px; color: #51605a; background: #f7f9f8; touch-action: none; }
.sort-grip { cursor: grab; }
.sort-grip:active { cursor: grabbing; }
.sort-action:disabled { opacity: .3; cursor: not-allowed; }
.sort-item__name { min-width: 0; font-weight: 750; }
.sort-item__position { display: block; margin-top: 3px; color: #728079; font-size: 12px; font-weight: 500; }
.sort-actions { display: flex; gap: 6px; }
.drag-preview { position: fixed; z-index: 100; pointer-events: none; opacity: .94; border-color: rgba(10,84,43,.45); box-shadow: 0 20px 50px rgba(22,38,31,.22); }
.order-editor__footer { justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid #e3e9e6; }
.editor-status { flex: 1 1 250px; margin: 0; color: #5d6a65; font-size: 13px; }
.secondary-button, .primary-button { min-height: 44px; padding: 0 15px; border-radius: 11px; font-weight: 750; }
.secondary-button { border: 1px solid #dce4e0; color: #33413b; background: #fff; }
.primary-button { border: 1px solid #0a542b; color: #fff; background: #0a542b; }
.primary-button:disabled, .secondary-button:disabled { opacity: .55; }

.empty { padding: 68px 24px; border-radius: var(--ds-radius-lg); text-align: center; background: var(--ds-color-surface); }
.empty h2 { margin: 0; }
.empty p { color: var(--ds-color-text-secondary); }
.empty button { min-height: var(--ds-target-minimum); padding: 0 16px; border: 0; border-radius: var(--ds-radius-md); color: var(--ds-color-action-secondary-text); background: var(--ds-color-action-secondary); font-weight: var(--ds-font-weight-semibold); }

@media (max-width: 1050px) {
  .studio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-hero { grid-template-columns: 1fr; }
  .gallery-feature { grid-template-columns: repeat(4, minmax(150px, 1fr)); overflow-x: auto; }
  .command-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .command-row { grid-template-columns: auto auto minmax(180px, 1fr) auto auto; }
  .command-description { display: none; }
  .premium-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .premium-hero { grid-template-columns: 1fr minmax(220px, .38fr); }
  .premium-toolbar { grid-template-columns: 1fr; }
  .premium-filters { justify-content: flex-start; }
}

@media (min-width: 1700px) { .premium-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 2200px) { .premium-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

@media (max-width: 820px) {
  .premium-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .premium-hero { grid-template-columns: 1fr; min-height: 460px; }
  .premium-orbit { position: absolute; width: 220px; right: -70px; bottom: 20px; opacity: .55; }
  .premium-hero-copy { padding-right: 70px; }
}

@media (max-width: 760px) {
  .portal-controls { position: relative; top: auto; right: auto; flex-wrap: wrap; margin: 10px 10px 0; }
  .control-status { display: none; }
  .control-select, .edit-order { min-height: 40px; padding-inline: 11px; font-size: 12px; }
  .shell, .command-shell { width: min(100% - 20px, 1420px); padding-top: 10px; }
  .topbar { align-items: flex-start; }
  .brand-caption, .server-status span, .top-actions .select-control { display: none; }
  .hero { margin-top: 12px; }
  .hero-content { padding: 28px 22px; }
  .hero-meta { flex-wrap: wrap; gap: 8px 18px; }
  .toolbar, .command-toolbar { position: static; grid-template-columns: 1fr; padding: 9px; }
  .filters { justify-content: flex-start; }
  .studio-grid { grid-template-columns: 1fr; }
  .studio-card { min-height: 220px; }
  .gallery-feature { grid-template-columns: repeat(4, 180px); }
  .gallery-shelf { grid-auto-flow: row; grid-template-columns: 1fr; overflow-x: visible; }
  .command-layout { display: block; }
  .sidebar { position: static; height: auto; min-height: 0; padding: 14px; border-radius: var(--ds-radius-lg); }
  .sidebar > .brand, .sidebar-foot { display: none; }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0; overflow: visible; }
  .sidebar-nav .chip { width: auto; }
  .command-header { padding: 22px 3px 6px; }
  .command-header .server-status { display: none; }
  .command-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; min-height: 82px; padding: 12px; }
  .command-row .app-icon { grid-column: 1; grid-row: 1; }
  .command-row .command-title { grid-column: 2; grid-row: 1; }
  .command-row .open-link { grid-column: 3; grid-row: 1; }
  .command-row .semantic-tags { grid-column: 2 / 4; grid-row: 2; max-width: 100%; justify-content: flex-start; }
  .command-position { display: none; }
  .premium-grid { grid-template-columns: 1fr; }
  .semantic-tags { max-width: 76%; }
  .order-editor__header, .order-editor__footer { padding: 15px 16px; }
  .sort-list { padding-inline: 16px; }
  .legacy-order { margin-inline: 16px; }
}

@media (max-width: 430px) {
  .portal-controls { justify-content: stretch; }
  .portal-controls > .control-group:first-child { flex: 1 1 auto; }
  .portal-controls #view-select { width: 100%; }
  .portal-controls .edit-order { margin-left: auto; }
  #v3-controls { order: 3; width: 100%; justify-content: flex-end; }
  .top-actions .mode-button:nth-child(2) { display: none; }
  .section-heading { align-items: start; flex-direction: column; gap: 5px; }
  .gallery-feature { grid-template-columns: repeat(4, 158px); }
  .premium-shell { padding-inline: 14px; }
  .premium-topbar { min-height: 64px; }
  .premium-brand small { display: none; }
  .atelier-mode { min-width: 51px; min-height: 38px; padding-inline: 9px; }
  .premium-hero { min-height: 340px; }
  .premium-hero-copy { padding: 28px 0 34px; }
  .premium-hero h1 { max-width: 100%; font-size: clamp(34px, 9.8vw, 40px); }
  .premium-hero h1 em { display: block; }
  .premium-hero-copy > p:last-of-type { max-width: none; margin-top: 16px; font-size: 14px; }
  .premium-hero-stats { margin-top: 14px; }
  .premium-hero-stats span { padding: 5px 7px; font-size: 8px; }
  .premium-orbit { display: none; }
  .premium-catalog { padding-top: 30px; }
  .premium-catalog-head { align-items: start; flex-direction: column; gap: 18px; }
  .premium-catalog-head > p { font-size: 13px; }
  .premium-toolbar { margin-top: 22px; }
  .premium-filters { margin-inline: -2px; }
  .premium-grid { grid-template-columns: 1fr; }
  .premium-card { min-height: 310px; }
  .premium-card h3 { font-size: 29px; }
  .premium-footer { grid-template-columns: 1fr auto; }
  .premium-footer p { display: none; }
  .sort-actions { gap: 3px; }
  .sort-grip, .sort-action { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
