:root {
  --bg: #f5f4f1;
  --surface: #ffffff;
  --surface-soft: #fbfaf8;
  --ink: #171717;
  --muted: #6f6a63;
  --line: #e5e0d8;
  --accent: #b98570;
  --accent-dark: #7e5140;
  --success: #147a4f;
  --warning: #9a6513;
  --danger: #a13a2a;
  --shadow: 0 20px 50px rgba(38, 29, 20, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.auth-locked .app-shell,
body.auth-locked .tenant-shell {
  display: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.tenant-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  background: #191715;
  color: #fff;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 6px;
}

.brand-lockup strong,
.brand-lockup span {
  display: block;
}

.brand-lockup span {
  color: #bdb7ae;
  font-size: 13px;
  margin-top: 3px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  color: #d8d2c8;
  background: transparent;
  text-align: left;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(185, 133, 112, 0.2);
  color: #fff;
}

.tenant-switcher {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
}

.tenant-switcher span {
  color: #bdb7ae;
  font-size: 12px;
}

.tenant-switcher select,
.sidebar-action {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  padding: 10px;
  color: #fff;
  background: #24201d;
}

.sidebar-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sidebar-action svg {
  width: 16px;
  height: 16px;
}

.workspace {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 15px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.icon-button,
.primary-action,
.secondary-action {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.icon-button {
  position: relative;
  width: 40px;
  display: grid;
  place-items: center;
}

.icon-button svg,
.primary-action svg,
.secondary-action svg {
  width: 18px;
  height: 18px;
}

.dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.secondary-action {
  background: transparent;
}

.compact-action {
  min-height: 38px;
  padding-inline: 11px;
}

.auth-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 22px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span,
.metric small {
  color: var(--muted);
}

.metric span {
  display: block;
  font-size: 13px;
}

.metric strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 30px;
  line-height: 1;
}

.panel {
  padding: 18px;
}

.overview-layout,
.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.75fr);
  gap: 22px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading p {
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
}

.page-section-heading {
  margin-bottom: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.status.online {
  background: #e7f5ee;
  color: var(--success);
}

.status.staging {
  background: #edf0ff;
  color: #4054a8;
}

.status.warning {
  background: #fff2d8;
  color: var(--warning);
}

.display-preview {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border-radius: 8px;
  background: #120f0d;
}

.preview-hero {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.34;
}

.screen-board {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 360px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 22px;
  color: #fff;
}

.screen-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.screen-head span,
.ounce span {
  color: #d8c8ba;
  font-size: 13px;
}

.screen-head strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.ounce {
  align-self: center;
  justify-self: center;
  text-align: center;
}

.ounce strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1;
}

.karat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.karat-grid div {
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
}

.karat-grid span,
.karat-grid strong {
  display: block;
}

.karat-grid strong {
  margin-top: 5px;
  font-size: 20px;
}

.priority-list {
  display: grid;
  gap: 14px;
}

.priority {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
}

.priority > span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 2px;
  background: #dad4ca;
}

.priority.done > span {
  background: var(--success);
}

.priority.active > span {
  background: var(--accent);
}

.priority p {
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.45;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.link-cell {
  min-width: 220px;
  white-space: normal;
}

.link-cell a,
.route-card a {
  color: var(--accent-dark);
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.mini-action {
  min-height: 28px;
  margin-left: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.background-control {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.background-control.full-span {
  grid-column: 1 / -1;
}

.background-control > span,
.background-control label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.background-preview {
  min-height: 132px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #171513;
  background-image: linear-gradient(135deg, #2d261e, #13110f);
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.background-actions {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.background-actions .file-drop {
  min-height: 40px;
}

.background-control label {
  display: grid;
  gap: 7px;
}

.background-control input[type="text"] {
  width: 100%;
}

.route-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.route-card div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.route-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

select,
input[type="color"],
input[type="range"] {
  width: 100%;
}

select,
input[type="text"],
input[type="number"],
input[type="search"],
input[type="color"],
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
}

input[type="range"] {
  accent-color: var(--accent);
}

.button-row,
.panel-head-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wide-studio {
  grid-template-columns: minmax(280px, 0.55fr) minmax(0, 1.45fr);
}

.screen-list-panel,
.settings-panel {
  align-content: start;
}

.autosave {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #e7f5ee;
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.tabs,
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.tab,
.segmented button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
}

.tab.active,
.segmented button.active {
  background: var(--accent);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-card {
  min-height: 86px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
}

.quick-card svg {
  width: 20px;
  height: 20px;
  color: var(--accent-dark);
}

.activity-log {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.activity-log p {
  color: var(--muted);
  font-size: 13px;
}

.slideshow-stage {
  align-self: center;
  justify-self: center;
  width: min(42%, 240px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--screen-accent, #d4af37) 50%, transparent);
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 40px color-mix(in srgb, var(--screen-glow, #f3e5ab) 20%, transparent);
}

.slideshow-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation-duration: 700ms;
  animation-fill-mode: both;
}

.slideshow-stage.fade img {
  animation-name: fadeIn;
}

.slideshow-stage.zoom img {
  animation-name: zoomIn;
}

.slideshow-stage.slide img {
  animation-name: slideIn;
}

.empty-slide {
  height: 100%;
  display: grid;
  place-items: center;
  color: #d8c8ba;
  font-size: 13px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(1.08); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.screen-board {
  transform-origin: center;
  transition: transform 0.2s ease, border-radius 0.2s ease;
}

.screen-board[data-template="wide"] {
  min-height: 300px;
}

.screen-board[data-template="wide"] .karat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.screen-board[data-template="profile"] .karat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.slide-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.file-drop {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  background: #fff7f2;
  color: var(--accent-dark);
}

.file-drop input {
  display: none;
}

.slide-strip {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.slide-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.slide-item img {
  width: 72px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
}

.slide-item span,
.empty-copy {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.slide-buttons {
  display: flex;
  gap: 4px;
}

.slide-buttons button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.slide-buttons svg {
  width: 15px;
  height: 15px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
  min-width: min(100%, 260px);
}

.modal {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(18, 15, 13, 0.62);
}

.modal-card {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-card .primary-action {
  width: fit-content;
}

.login-modal {
  width: min(460px, calc(100vw - 28px));
}

.login-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-soft);
  color: var(--muted);
  line-height: 1.45;
}

.toggle-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

.switch input {
  display: none;
}

.switch span {
  position: relative;
  display: block;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #d7d0c8;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.screen-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.screen-row {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
  text-align: left;
}

.screen-row.active {
  border-color: var(--accent);
  background: #fff7f2;
}

.screen-row small {
  color: var(--muted);
}

.product-grid,
.asset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.product-tile,
.asset,
.kanban section,
.timeline div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
}

.product-tile img,
.asset img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #eee9e2;
}

.product-tile strong,
.product-tile span,
.asset span {
  display: block;
}

.product-tile strong {
  margin-top: 12px;
}

.product-tile span,
.asset span {
  color: var(--muted);
  margin-top: 4px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.kanban section h3 {
  margin-bottom: 12px;
}

.order {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
  margin-top: 10px;
}

.asset.quota {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 180px;
}

.asset.quota strong {
  font-size: 42px;
}

.ai-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.ai-upload {
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  background: #fff7f2;
  color: var(--accent-dark);
  font-weight: 800;
  text-align: center;
}

.ai-upload input {
  display: none;
}

.ai-preview {
  min-height: 240px;
  display: grid;
  place-items: center;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

.ai-preview img {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: contain;
}

.ai-fit-tool {
  display: grid;
  grid-template-columns: minmax(170px, 0.72fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: stretch;
  margin: 14px 0;
}

.ai-fit-preview {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ede8df;
}

.ai-fit-model {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  display: block;
}

.ai-fit-jewelry {
  position: absolute;
  left: var(--fit-left, 50%);
  top: var(--fit-top, 48%);
  width: var(--fit-width, 28%);
  height: auto;
  transform: translate(-50%, -50%) scaleY(var(--fit-height, 1));
  transform-origin: center;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.22));
  mix-blend-mode: multiply;
}

.ai-fit-preview > span {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 1px solid rgba(255,255,255,0.34);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(20,18,16,0.72);
  color: #fff;
  text-align: center;
  font-weight: 800;
}

.ai-fit-controls {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.ai-fit-controls label {
  display: grid;
  grid-template-columns: minmax(82px, auto) 48px minmax(100px, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.ai-fit-controls output {
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.prompt-helper-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
  margin: 12px 0;
}

.compact-head {
  gap: 8px;
}

.compact-head h3 {
  margin: 0;
}

.prompt-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.prompt-chip.active {
  border-color: var(--accent);
  background: #fff7f2;
  color: var(--accent-dark);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 800;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.ai-hijab-toggle {
  margin-bottom: 12px;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.model-card {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-soft);
  text-align: left;
}

.model-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
  background: #eee9e2;
}

.model-card.active {
  border-color: var(--accent);
  background: #fff7f2;
}

.model-card strong,
.ai-output-card strong {
  display: block;
}

.model-card span,
.ai-output-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.ai-output-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ai-output-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.ai-output-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  background: #eee9e2;
}

.ai-output-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tryon-body {
  min-height: 100vh;
  background: #171513;
  color: #f7f3ec;
}

.tryon-page {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.tryon-hero {
  display: grid;
  grid-template-columns: minmax(220px, 0.5fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 22px;
}

.tryon-brand {
  min-height: 220px;
  align-items: flex-start;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(160deg, rgba(185,133,112,0.18), rgba(255,255,255,0.04));
}

.tryon-lock-panel,
.tryon-workspace {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 22px;
  background: #f5f4f1;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(0,0,0,0.28);
}

.tryon-lock-panel {
  display: grid;
  gap: 16px;
}

.eyebrow-label {
  display: block;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tryon-lock-panel h1 {
  max-width: 720px;
  margin: 8px 0 10px;
  font-size: clamp(30px, 4.8vw, 56px);
  line-height: 1.02;
  letter-spacing: 0;
}

.tryon-lock-panel p,
.tryon-status {
  color: var(--muted);
}

.tryon-code-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
}

.tryon-code-form input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0;
}

.tryon-workspace[hidden] {
  display: none;
}

.tryon-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(280px, 0.8fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.tryon-grid .ai-fit-tool {
  grid-template-columns: 1fr;
}

.tryon-result {
  min-height: 520px;
  display: grid;
  gap: 14px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  overflow: hidden;
  text-align: center;
}

.tryon-result img {
  width: 100%;
  height: 100%;
  max-height: 620px;
  object-fit: cover;
}

.tryon-result .primary-action {
  margin-bottom: 14px;
}

.tenant-body {
  background: var(--bg);
}

.tenant-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 18px;
}

.code-form {
  margin-top: 6px;
}

.code-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-soft);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.code-list {
  display: grid;
  gap: 10px;
}

.code-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.code-card strong,
.code-card span {
  display: block;
}

.code-card span {
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
}

.code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.timeline span {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1f1c19;
  color: #fff;
  font-weight: 800;
}

.timeline strong {
  display: block;
  margin: 14px 0 6px;
}

.timeline p {
  color: var(--muted);
  line-height: 1.5;
}

.screen-viewer-body {
  min-height: 100vh;
  background: #11100e;
  color: #fff;
  overflow-x: hidden;
}

.viewer-toolbar {
  position: fixed;
  z-index: 10;
  top: 14px;
  left: 50%;
  width: min(920px, calc(100vw - 28px));
  min-height: 52px;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(18, 16, 14, 0.82);
  backdrop-filter: blur(16px);
}

.viewer-brand,
.viewer-dashboard-link {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.viewer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.viewer-brand img {
  width: 28px;
  height: 28px;
}

.viewer-toolbar select {
  min-height: 36px;
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.viewer-toolbar option {
  color: #111;
}

.public-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 90px 28px 28px;
}

.public-board {
  position: relative;
  width: min(1180px, 100%);
  min-height: min(720px, calc(100vh - 130px));
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--screen-accent, #d4af37) 54%, transparent);
  border-radius: 18px;
  background: #17130f;
  box-shadow: 0 28px 80px rgba(0,0,0,0.42), 0 0 70px color-mix(in srgb, var(--screen-glow, #f3e5ab) 20%, transparent);
}

.public-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.34;
  filter: saturate(0.9);
}

.public-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(17,13,10,0.92), rgba(17,13,10,0.45));
}

.public-content {
  position: relative;
  min-height: inherit;
  display: grid;
  grid-template-rows: auto minmax(240px, 1fr) auto auto auto;
  gap: 24px;
  padding: clamp(24px, 4vw, 56px);
}

.public-content .screen-head {
  color: #fff;
}

.public-content .screen-head span {
  color: #d9cfc4;
}

.public-content .screen-head strong {
  font-size: clamp(28px, 5vw, 72px);
  line-height: 1;
  letter-spacing: 0;
}

.public-slideshow {
  width: min(520px, 72%);
  min-height: 260px;
}

.public-ounce strong {
  font-size: clamp(36px, 6vw, 84px);
}

.public-karats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.public-route {
  color: rgba(255,255,255,0.54);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.public-board[data-template="vertical"] {
  width: min(620px, 100%);
}

.public-board[data-template="vertical"] .public-karats,
.public-board[data-template="profile"] .public-karats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.public-board[data-template="profile"] .public-content {
  grid-template-rows: auto minmax(280px, 1fr) auto auto auto;
}

@media (max-width: 1120px) {
  .app-shell,
  .tenant-shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .brand-lockup div,
  .nav-item span,
  .tenant-switcher {
    display: none;
  }

  .tryon-brand div {
    display: block;
  }

  .sidebar {
    padding: 20px 12px;
  }

  .nav-item {
    justify-content: center;
  }

  .metric-grid,
  .product-grid,
  .asset-grid,
  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-layout,
  .studio-layout,
  .kanban,
  .ai-layout,
  .ai-fit-tool,
  .tryon-grid,
  .tryon-hero,
  .tenant-grid {
    grid-template-columns: 1fr;
  }

  .quick-actions,
  .slide-controls,
  .background-actions,
  .route-card,
  .tryon-code-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell,
  .tenant-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .product-grid,
  .asset-grid,
  .ai-output-grid,
  .model-grid,
  .timeline,
  .form-grid,
  .karat-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .slide-item {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .slide-buttons {
    grid-column: 1 / -1;
  }

  .viewer-toolbar {
    position: static;
    width: auto;
    transform: none;
    margin: 12px;
    grid-template-columns: 1fr;
  }

  .public-screen {
    min-height: auto;
    padding: 0 12px 12px;
  }

  .public-board {
    min-height: calc(100vh - 128px);
  }

  .public-slideshow {
    width: 100%;
    min-height: 210px;
  }

  .public-karats,
  .public-board[data-template="vertical"] .public-karats,
  .public-board[data-template="profile"] .public-karats {
    grid-template-columns: 1fr;
  }

  .tryon-page {
    width: min(100% - 24px, 1180px);
    padding-top: 12px;
  }

  .ai-fit-controls label {
    grid-template-columns: 1fr 48px;
  }

  .ai-fit-controls input {
    grid-column: 1 / -1;
  }

  .tryon-brand {
    min-height: 120px;
  }

  .code-card {
    display: grid;
  }

  .code-actions {
    justify-content: flex-start;
  }
}
