:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --canvas: #f0f3f7;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --surface-2: rgba(13, 18, 28, 0.045);
  --surface-3: rgba(255, 255, 255, 0.68);
  --text: #08090b;
  --muted: #687083;
  --soft-text: #394050;
  --line: rgba(16, 24, 40, 0.09);
  --line-strong: rgba(16, 24, 40, 0.16);
  --blue: #0099ff;
  --blue-dark: #0071e3;
  --accent-soft: rgba(0, 153, 255, 0.12);
  --green: #19a65a;
  --amber: #c98216;
  --red: #e0443e;
  --indigo: #725cff;
  --shadow: 0 14px 42px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 5px 18px rgba(16, 24, 40, 0.055);
  --radius: 8px;
  --focus: 0 0 0 3px rgba(0, 153, 255, 0.22);
  --sidebar-bg: rgba(255, 255, 255, 0.72);
  --topbar-bg: rgba(246, 247, 249, 0.82);
  --input-bg: rgba(255, 255, 255, 0.78);
  --active-bg: rgba(0, 153, 255, 0.12);
  --active-line: rgba(0, 153, 255, 0.24);
  --success-bg: rgba(25, 166, 90, 0.12);
  --warning-bg: rgba(201, 130, 22, 0.14);
  --danger-bg: rgba(224, 68, 62, 0.11);
  --grid-line: rgba(18, 24, 40, 0.024);
  --brand-gradient: linear-gradient(135deg, #0099ff, #725cff 58%, #00d4ff);
  --toast-bg: rgba(8, 9, 11, 0.92);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --canvas: #050608;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-solid: #0b0d12;
  --surface-2: rgba(255, 255, 255, 0.095);
  --surface-3: rgba(255, 255, 255, 0.055);
  --text: #ffffff;
  --muted: #a6adba;
  --soft-text: #d5dae4;
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.22);
  --blue: #0099ff;
  --blue-dark: #4db8ff;
  --accent-soft: rgba(0, 153, 255, 0.16);
  --green: #35d07f;
  --amber: #f4b740;
  --red: #ff6961;
  --indigo: #9b8cff;
  --shadow: 0 16px 52px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.24);
  --focus: 0 0 0 3px rgba(0, 153, 255, 0.28);
  --sidebar-bg: rgba(4, 5, 8, 0.78);
  --topbar-bg: rgba(0, 0, 0, 0.72);
  --input-bg: rgba(255, 255, 255, 0.07);
  --active-bg: rgba(0, 153, 255, 0.16);
  --active-line: rgba(0, 153, 255, 0.38);
  --success-bg: rgba(53, 208, 127, 0.14);
  --warning-bg: rgba(244, 183, 64, 0.14);
  --danger-bg: rgba(255, 105, 97, 0.13);
  --grid-line: rgba(255, 255, 255, 0.045);
  --brand-gradient: linear-gradient(135deg, #0099ff, #725cff 54%, #00f0ff);
  --toast-bg: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--canvas);
  background-size: 56px 56px, 56px 56px, auto;
  transition: background 220ms ease, color 220ms ease;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
select,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--text);
  color: white;
}

.skip-link:focus {
  top: 16px;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.login-screen {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  background: transparent;
}

.login-art {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--surface-solid);
}

.login-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.05), var(--canvas));
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--sidebar-bg);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(22px);
}

.login-card {
  width: min(100%, 360px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card h1,
.view-title h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.14;
  letter-spacing: 0;
  max-width: 980px;
  overflow-wrap: anywhere;
}

.login-card p,
.view-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  backdrop-filter: blur(22px);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  font-weight: 760;
  font-size: 14px;
}

.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--brand-gradient);
  box-shadow: 0 12px 30px rgba(0, 153, 255, 0.26);
}

.nav {
  display: grid;
  gap: 4px;
}

.nav-button,
.icon-button,
.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.compact-button,
.chip-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 11px;
  color: var(--text);
  background: transparent;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-button {
  width: 100%;
  justify-content: flex-start;
  color: var(--soft-text);
  font-size: 13px;
  font-weight: 560;
}

.nav-button:hover,
.ghost-button:hover,
.chip-button:hover {
  background: var(--surface-2);
}

.nav-button.active {
  background: var(--active-bg);
  color: var(--blue-dark);
  border-color: var(--active-line);
}

.nav-button svg,
.icon-button svg,
.primary-button svg,
.secondary-button svg,
.danger-button svg,
.ghost-button svg,
.compact-button svg,
.chip-button svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.user-pill {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: var(--radius);
  background: var(--surface-3);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--active-bg);
  color: var(--blue-dark);
  font-weight: 720;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(22px);
}

.topbar-left {
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.topbar-title {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  display: -webkit-box;
  max-width: min(720px, 58vw);
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.content {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 12px 16px;
}

.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.studio-head {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}

.studio-context {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.studio-context strong {
  max-width: min(680px, 50vw);
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 760;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-context span {
  max-width: min(680px, 50vw);
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.view-title h1 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.grid {
  display: grid;
  gap: 14px;
}

.metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric,
.panel,
.item-card,
.image-card,
.asset-chip,
.table-wrap,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(18px);
}

.metric {
  padding: 12px;
  min-height: 78px;
  box-shadow: var(--shadow-soft);
}

.metric strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.metric span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.panel {
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.panel.plain {
  box-shadow: none;
}

.panel h2,
.panel h3 {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.3;
}

.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title-row h2 {
  margin-bottom: 2px;
}

.panel-title-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.form-grid {
  display: grid;
  gap: 9px;
  min-width: 0;
  overflow: hidden;
}

.form-row {
  min-width: 0;
}

.form-row input[type="file"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-format-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.feature-card {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--blue), var(--line) 58%);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue), transparent 88%), transparent 58%),
    var(--surface-3);
}

.feature-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.feature-head h3 {
  margin: 3px 0 0;
  font-size: 15px;
  line-height: 1.25;
}

.feature-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--blue-dark);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 780;
}

.recognition-body {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.recognition-upload {
  min-height: 88px;
  border: 1px dashed color-mix(in srgb, var(--blue), var(--line-strong) 55%);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 10px;
  color: var(--soft-text);
  background: var(--surface);
  overflow: hidden;
}

.recognition-upload:hover {
  border-color: var(--blue);
  background: var(--surface-2);
}

.recognition-upload img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
}

.recognition-upload span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--blue-dark);
}

.recognition-upload svg {
  width: 24px;
  height: 24px;
}

.recognition-upload strong {
  font-size: 13px;
  font-weight: 760;
  text-align: center;
}

.recognition-meta {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 8px;
}

.recognition-file {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.recognition-result {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.recognition-result span {
  min-height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  color: var(--soft-text);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
}

.form-row {
  display: grid;
  gap: 6px;
}

.form-row label {
  color: var(--soft-text);
  font-weight: 650;
  font-size: 12px;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 10px;
  color: var(--text);
  background: var(--input-bg);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input::placeholder,
.textarea::placeholder {
  color: color-mix(in srgb, var(--muted), transparent 12%);
}

.textarea {
  min-height: 112px;
  resize: vertical;
}

.textarea.small {
  min-height: 64px;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--blue);
  box-shadow: var(--focus);
  outline: none;
}

.palette-field {
  position: relative;
}

.palette-input {
  padding-right: 116px;
}

.palette-field.open .palette-input {
  border-color: var(--blue);
  box-shadow: var(--focus);
}

.palette-preview {
  position: absolute;
  top: 12px;
  right: 12px;
  max-width: 96px;
  height: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  overflow: hidden;
  pointer-events: none;
}

.mini-swatch {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--swatch-color);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.palette-popover {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-solid), transparent 6%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.palette-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, auto);
  gap: 8px;
}

.color-source-button {
  position: relative;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.color-source-button:hover {
  background: var(--surface-2);
}

.color-source-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.native-color-dot {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--current-color);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.compact-button {
  padding: 8px 12px;
}

.compact-button:disabled {
  opacity: 0.48;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
}

.preset-color {
  min-width: 34px;
  min-height: 34px;
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--preset-color);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.preset-color:hover,
.preset-color:focus-visible {
  border-color: var(--blue);
  box-shadow: var(--focus);
  outline: none;
  transform: translateY(-1px);
}

.selected-colors {
  min-height: 38px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-color {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  color: var(--soft-text);
  background: var(--surface-2);
}

.selected-color:hover {
  border-color: color-mix(in srgb, var(--red), transparent 55%);
  color: var(--red);
}

.selected-color span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--selected-color);
}

.selected-color strong {
  font-size: 13px;
  font-weight: 700;
}

.palette-empty {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.segmented button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  background: transparent;
  color: var(--soft-text);
}

.segmented button.active {
  color: var(--blue-dark);
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  border-color: color-mix(in srgb, var(--blue), white 10%);
  box-shadow: 0 12px 30px rgba(0, 153, 255, 0.2);
}

.primary-button:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  transform: translateY(-1px);
}

.secondary-button {
  background: var(--surface);
  border-color: var(--line);
  backdrop-filter: blur(18px);
}

.secondary-button:hover {
  background: var(--surface-2);
}

.danger-button {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red), transparent 66%);
  background: var(--danger-bg);
}

.danger-button:hover {
  background: color-mix(in srgb, var(--danger-bg), var(--red) 10%);
}

.icon-button {
  width: 40px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface);
}

.theme-toggle {
  min-width: 94px;
}

.theme-toggle span:last-child {
  min-width: 44px;
  text-align: left;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 720;
  color: var(--soft-text);
  background: var(--surface-2);
}

.status.done,
.status.ready {
  color: var(--green);
  background: var(--success-bg);
}

.status.running,
.status.queued {
  color: var(--amber);
  background: var(--warning-bg);
}

.status.partial {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, var(--surface));
}

.status.canceled {
  color: var(--soft-text);
  background: var(--surface-2);
}

.status.error {
  color: var(--red);
  background: var(--danger-bg);
}

.progress {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--indigo), var(--green));
  transition: width 240ms ease;
}

.tz-generator-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: start;
}

.tz-steps,
.tz-preview-panel {
  position: sticky;
  top: 66px;
}

.tz-progress {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.tz-progress span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.tz-progress strong {
  font-size: 17px;
  line-height: 1.2;
}

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

.tz-step-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  color: var(--soft-text);
  background: var(--surface-3);
  text-align: left;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.tz-step-button:hover {
  background: var(--surface-2);
}

.tz-step-button.active {
  border-color: var(--active-line);
  color: var(--blue-dark);
  background: var(--active-bg);
}

.tz-step-button.done span {
  color: white;
  background: var(--green);
}

.tz-step-button span {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--soft-text);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 760;
}

.tz-step-button strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.tz-form-panel {
  min-height: 560px;
}

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

.tz-position-card {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  color: var(--text);
  background: var(--surface-3);
  text-align: left;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.tz-position-card:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
}

.tz-position-card.active {
  border-color: var(--active-line);
  background: var(--active-bg);
}

.tz-position-card strong {
  font-size: 17px;
  line-height: 1.2;
}

.tz-position-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.tz-actions {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.bonus-note {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--green), var(--line) 55%);
  border-radius: var(--radius);
  background: var(--success-bg);
}

.bonus-note.compact {
  margin-bottom: 10px;
}

.bonus-note strong {
  color: var(--green);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.bonus-note span {
  color: var(--soft-text);
  font-size: 13px;
  line-height: 1.35;
}

.tz-review {
  display: grid;
  gap: 12px;
}

.tz-review dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.tz-review dl > div,
.tz-preview-row {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
}

.tz-review dt,
.tz-preview-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.tz-review dd,
.tz-preview-row strong {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.tz-preview {
  display: grid;
  gap: 8px;
}

.job-progress-panel {
  gap: 12px;
}

.job-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.job-progress-head h2 {
  margin: 2px 0 0;
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.progress-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.timing-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timing-pills span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.timing-pills strong {
  color: var(--soft-text);
}

.process-timeline {
  --timeline-line: color-mix(in srgb, var(--line) 74%, transparent);
  --timeline-dot: var(--muted);
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 4px 0 0;
  padding: 0;
}

.process-timeline.compact {
  gap: 7px;
}

.process-step {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  color: var(--muted);
}

.process-step::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 20px;
  bottom: -10px;
  width: 1px;
  background: var(--timeline-line);
}

.process-step:last-child::before {
  display: none;
}

.process-dot {
  width: 9px;
  height: 9px;
  margin: 5px 0 0 4px;
  border-radius: 999px;
  background: var(--timeline-dot);
  box-shadow: 0 0 0 4px var(--surface-2);
}

.process-step.running .process-dot {
  background: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 14%, transparent);
}

.process-step.done .process-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--success-bg);
}

.process-step.partial .process-dot {
  background: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent);
}

.process-step.skipped .process-dot {
  background: var(--muted);
  box-shadow: 0 0 0 4px var(--surface-2);
}

.process-step.error .process-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--danger-bg);
}

.process-step.canceled .process-dot {
  background: var(--muted);
  box-shadow: 0 0 0 4px var(--surface-2);
}

.process-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.process-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.process-row strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.process-row span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  text-transform: uppercase;
}

.process-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.process-events {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

.process-events span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--surface-2);
  color: var(--soft-text);
  font-size: 11px;
  font-weight: 680;
}

.process-events span.done {
  color: var(--green);
  background: var(--success-bg);
}

.process-events span.running {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 11%, var(--surface));
}

.process-events span.partial {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 11%, var(--surface));
}

.process-events span.skipped {
  color: var(--muted);
  background: var(--surface-2);
}

.process-events span.error {
  color: var(--red);
  background: var(--danger-bg);
}

.process-events span.canceled {
  color: var(--soft-text);
  background: var(--surface-2);
}

.process-events small {
  min-width: 0;
  max-width: 280px;
  overflow: hidden;
  color: inherit;
  opacity: .72;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slide-progress-list {
  display: grid;
  gap: 7px;
  margin-top: 2px;
}

.slide-progress-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.slide-progress-row.done {
  border-color: color-mix(in srgb, var(--green) 22%, var(--line));
}

.slide-progress-row.error {
  border-color: color-mix(in srgb, var(--red) 26%, var(--line));
  background: color-mix(in srgb, var(--danger-bg) 55%, var(--surface));
}

.slide-progress-row.partial {
  border-color: color-mix(in srgb, var(--blue) 24%, var(--line));
}

.slide-progress-main {
  min-width: 0;
}

.slide-progress-meta {
  display: flex;
  min-width: 150px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.slide-retry-button {
  min-height: 34px;
  padding: 5px 9px;
  font-size: 12px;
  line-height: 1;
  border-radius: 9px;
}

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

.slide-index {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--soft-text);
  font-size: 11px;
  font-weight: 760;
}

.slide-progress-row strong,
.slide-progress-row p,
.slide-progress-meta span {
  overflow-wrap: anywhere;
}

.slide-progress-row strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
}

.slide-progress-row p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.slide-progress-row > span:last-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  text-align: right;
}

.project-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.item-card {
  padding: 12px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow-soft);
}

.item-card h3 {
  margin: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.assets-grid {
  display: grid;
  gap: 8px;
}

.asset-chip {
  min-height: 58px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px;
}

.project-asset-chip {
  grid-template-columns: 26px 48px minmax(0, 1fr) auto;
}

.project-asset-chip.selected {
  border-color: var(--blue);
  background: var(--active-bg);
}

.asset-bulkbar {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.asset-bulkbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.asset-select {
  width: 26px;
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.asset-select input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.asset-select span {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--surface);
}

.asset-select input:checked + span {
  border-color: var(--blue);
  background: var(--blue);
}

.compact-danger {
  min-height: 34px;
  padding: 6px 10px;
}

.asset-chip img {
  width: 48px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-2);
}

.asset-file-thumb {
  width: 48px;
  height: 44px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--blue-dark);
  background: var(--accent-soft);
}

.asset-file-thumb svg {
  width: 22px;
  height: 22px;
}

.asset-chip strong,
.asset-chip span {
  display: block;
  overflow-wrap: anywhere;
}

.asset-chip span {
  color: var(--muted);
  font-size: 13px;
}

.asset-delete {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red), transparent 72%);
  background: var(--danger-bg);
}

.asset-delete:hover {
  background: color-mix(in srgb, var(--danger-bg), var(--red) 10%);
}

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

.listing-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.image-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.image-button {
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: zoom-in;
}

.image-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.image-card.image-missing .image-button::before {
  content: "Файл недоступен";
  display: grid;
  width: 100%;
  aspect-ratio: 3 / 4;
  place-items: center;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 720;
}

.image-card.image-missing .image-button img {
  display: none;
}

.image-card figcaption {
  display: grid;
  gap: 7px;
  min-height: 112px;
  padding: 11px;
}

.image-card figcaption strong,
.image-card figcaption span {
  min-width: 0;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: normal;
}

.image-card figcaption strong {
  display: -webkit-box;
  font-size: 15px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.image-card figcaption span {
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-card figcaption small {
  min-width: 0;
  overflow: hidden;
  color: var(--blue);
  font-size: 11px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-package-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
}

.source-package-chip img {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
}

.source-package-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.retry-product-control {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2), transparent 12%);
}

.retry-product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.retry-product-head > span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.retry-image-button {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 760;
}

.retry-image-button svg {
  width: 14px;
  height: 14px;
}

.retry-product-options {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: thin;
}

.retry-product-option {
  display: grid;
  grid-template-columns: 28px;
  gap: 4px;
  width: 44px;
  min-width: 44px;
  min-height: 48px;
  justify-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.retry-product-option.selected {
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 14%, transparent);
}

.retry-product-option img,
.retry-product-option .asset-file-thumb {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
}

.retry-product-option span {
  max-width: 36px;
  overflow: hidden;
  font-size: 9px;
  font-weight: 720;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 7px;
  margin-top: 2px;
}

.image-actions .compact-button,
.image-actions .status {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
  font-weight: 720;
  gap: 5px;
  border-radius: 10px;
}

.image-actions .compact-button svg {
  width: 16px;
  height: 16px;
}

.image-actions .secondary-button {
  color: var(--soft-text);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}

.image-actions .secondary-button:hover {
  color: var(--text);
  background: var(--surface-2);
}

.image-actions .approve-button {
  color: #ffffff;
  background: linear-gradient(135deg, #0a84ff, #4f66ff);
  border-color: color-mix(in srgb, #0a84ff 70%, #ffffff);
  box-shadow: 0 8px 18px rgba(10, 132, 255, 0.18);
}

.image-actions .approve-button span,
.image-actions .approve-button svg {
  color: #ffffff;
}

.image-actions .approve-button:hover {
  background: linear-gradient(135deg, #0071e3, #3f5fff);
  transform: none;
  box-shadow: 0 10px 22px rgba(10, 132, 255, 0.2);
}

.image-actions .approve-button:disabled {
  opacity: 1;
  color: var(--muted);
  background: var(--surface-2);
  border-color: var(--line);
  box-shadow: none;
}

.image-actions .approve-button:disabled span,
.image-actions .approve-button:disabled svg {
  color: var(--muted);
}

.image-actions .approve-button.approve-ready {
  color: var(--green);
  background: var(--success-bg);
  border-color: color-mix(in srgb, var(--green) 20%, var(--line));
  box-shadow: none;
}

.image-actions .approve-button.approve-ready span,
.image-actions .approve-button.approve-ready svg {
  color: var(--green);
}

.image-actions .approve-button.approve-error {
  color: var(--red);
  background: var(--danger-bg);
  border-color: color-mix(in srgb, var(--red) 24%, var(--line));
  box-shadow: none;
}

.image-actions .approve-button.approve-error span,
.image-actions .approve-button.approve-error svg {
  color: var(--red);
}

.edit-reference-drop {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
}

.edit-reference-drop img,
.edit-reference-drop .asset-file-thumb {
  width: 48px;
  height: 44px;
  border-radius: 7px;
  object-fit: cover;
}

.edit-reference-drop strong,
.edit-reference-drop small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-reference-drop small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.image-download {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  min-height: 34px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-solid), transparent 12%);
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.12);
  backdrop-filter: blur(14px);
}

.image-delete {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 34px;
  min-height: 34px;
  color: var(--red);
  background: color-mix(in srgb, var(--surface-solid), transparent 10%);
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.12);
  backdrop-filter: blur(14px);
  opacity: 0.92;
}

.image-delete:hover {
  background: color-mix(in srgb, var(--red) 10%, var(--surface-solid));
  border-color: color-mix(in srgb, var(--red) 24%, var(--line));
}

.image-card.selected {
  border-color: var(--blue);
  box-shadow: var(--focus);
}

.listing-panel {
  border-color: color-mix(in srgb, var(--green) 20%, var(--line));
}

.brief-plan {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
}

.brief-mode-note {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--active-line);
  border-radius: var(--radius);
  color: var(--blue-dark);
  background: var(--accent-soft);
}

.brief-mode-note strong {
  font-size: 13px;
}

.brief-mode-note span {
  color: var(--soft-text);
  font-size: 12px;
  line-height: 1.35;
}

.brief-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brief-plan-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.brief-plan-head strong {
  font-size: 13px;
}

.brief-plan-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.brief-slide-add {
  min-height: 34px;
  padding: 0 9px;
  white-space: nowrap;
}

.brief-slide-list {
  display: grid;
  gap: 8px;
}

.brief-slide {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.brief-slide-index {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--blue-dark);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 760;
}

.brief-slide-fields {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.brief-slide-title {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 13px;
  font-weight: 720;
}

.brief-slide-body {
  min-height: 76px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.35;
}

.brief-slide-delete {
  width: 34px;
  min-height: 34px;
  color: var(--red);
  background: color-mix(in srgb, var(--red) 7%, var(--surface-solid));
}

.slide-source-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.slide-asset-pickers {
  display: grid;
  gap: 10px;
}

.studio-layout {
  display: grid;
  gap: 16px;
  align-items: start;
}

.studio-layout.is-settings {
  grid-template-columns: minmax(420px, 1fr) 240px;
}

.studio-layout.is-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}

.studio-main.hidden {
  display: none;
}

.process-strip {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.process-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.process-strip-head strong {
  font-size: 14px;
}

.process-strip-body {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  padding: 18px 6px;
}

.process-strip-illustration {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, transparent);
}

.process-strip-illustration svg {
  width: 26px;
  height: 26px;
}

.process-strip-body p {
  margin: 0;
  font-weight: 600;
}

.process-strip-body small {
  color: var(--muted);
}

.process-strip .progress {
  width: 100%;
}

.studio-panel {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}

.studio-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.studio-panel-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.studio-rail {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 10px 6px;
  border-radius: 16px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
}

.studio-rail-button {
  display: grid;
  gap: 3px;
  justify-items: center;
  width: 52px;
  padding: 8px 2px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.studio-rail-button:hover {
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  color: var(--blue);
}

.studio-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  overflow: hidden;
}

.studio-section + .studio-section {
  margin-top: 10px;
}

.studio-section summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.studio-section summary::-webkit-details-marker {
  display: none;
}

.studio-section-icon {
  display: inline-flex;
  color: var(--blue);
}

.studio-chevron {
  margin-left: auto;
  display: inline-flex;
  color: var(--muted);
  transition: transform 0.18s ease;
}

.studio-section[open] .studio-chevron {
  transform: rotate(90deg);
}

.studio-section-body {
  padding: 4px 14px 14px;
  display: grid;
  gap: 10px;
}

.studio-main-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.studio-generate {
  min-width: 220px;
}

.slide-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.slide-picker-head strong {
  color: var(--blue);
  font-size: 12px;
}

.slide-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slide-chip {
  position: relative;
  display: grid;
  gap: 4px;
  justify-items: center;
  width: 84px;
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.slide-chip:hover {
  border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
}

.slide-chip.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent);
}

.slide-chip-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--surface);
}

.slide-chip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-chip-name {
  font-size: 11px;
  color: var(--muted);
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slide-chip-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  display: none;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
}

.slide-chip-check svg {
  width: 12px;
  height: 12px;
}

.slide-chip.selected .slide-chip-check {
  display: grid;
}

@media (max-width: 1024px) {
  .studio-layout,
  .studio-layout.is-collapsed,
  .studio-layout.is-settings {
    grid-template-columns: minmax(0, 1fr);
  }
  .studio-panel,
  .studio-rail,
  .process-strip {
    position: static;
    max-height: none;
  }
  .studio-rail {
    grid-auto-flow: column;
    justify-content: start;
  }
}

.slide-picker {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.slide-picker small {
  font-weight: 400;
  opacity: 0.75;
}

.slide-picker select[multiple] {
  min-height: 68px;
}

.slide-source-current {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.slide-source-current img,
.slide-source-current .asset-file-thumb {
  width: 36px;
  height: 36px;
  border-radius: 7px;
}

.slide-source-current strong,
.slide-source-current a,
.slide-source-current span {
  display: block;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slide-source-current a,
.slide-source-current span {
  color: var(--muted);
}

.slide-source-upload {
  position: relative;
  min-height: 38px;
  padding: 0 10px;
}

.slide-source-upload.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.slide-source-copy {
  width: 30px;
  min-height: 30px;
  border-radius: 8px;
}

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

.result-markdown {
  color: var(--text);
}

.result-markdown h1,
.result-markdown h2,
.result-markdown h3 {
  margin: 12px 0 6px;
  font-size: 18px;
}

.result-markdown p,
.result-markdown li {
  color: var(--soft-text);
  font-size: 14px;
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  color: var(--soft-text);
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.brand-logo-preview {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: contain;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.empty-state {
  min-height: 140px;
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.modal-sheet {
  width: min(100%, 620px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-solid), transparent 4%);
  box-shadow: var(--shadow);
  padding: 16px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.close-button svg {
  transform: rotate(45deg);
}

.image-preview-backdrop {
  padding: 18px;
  place-items: stretch;
}

.image-preview-modal {
  width: min(100%, 1380px);
  max-height: calc(100dvh - 36px);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}

.image-preview-stage {
  min-height: min(78dvh, 900px);
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--surface-2);
}

.image-preview-stage img {
  max-width: 100%;
  max-height: calc(100dvh - 72px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.14);
}

.image-preview-side {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  border-left: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
}

.image-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.image-preview-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.image-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.image-preview-meta span {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.product-qa-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.product-qa-panel div {
  display: grid;
  gap: 2px;
}

.product-qa-panel span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  text-transform: uppercase;
}

.product-qa-panel strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.product-qa-panel p {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.35;
}

.image-preview-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.image-preview-actions > * {
  width: 100%;
}

.image-preview-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.inline-error {
  border: 1px solid color-mix(in srgb, var(--red) 24%, var(--line));
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--danger-bg);
  color: var(--red);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.brief-dropzone {
  min-height: 116px;
  border: 1px dashed color-mix(in srgb, var(--blue), var(--line-strong) 48%);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 18px;
  text-align: center;
  color: var(--soft-text);
  background: var(--surface-3);
  cursor: pointer;
}

.brief-dropzone:hover {
  border-color: var(--blue);
  background: var(--surface-2);
}

.brief-dropzone span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--blue-dark);
}

.brief-dropzone svg {
  width: 26px;
  height: 26px;
}

.brief-dropzone strong {
  font-size: 15px;
}

.brief-dropzone small {
  color: var(--muted);
  font-size: 12px;
}

.brief-recognition-progress {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--blue), var(--line) 72%);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue), transparent 90%), transparent 48%),
    var(--surface-3);
}

.brief-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.brief-progress-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.brief-progress-row span {
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.brief-recognition-progress p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: var(--radius);
  color: white;
  background: var(--toast-bg);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .metrics,
  .project-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tz-generator-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .tz-preview-panel {
    position: static;
    grid-column: 1 / -1;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  body {
    font-size: 16px;
  }

  .nav-button,
  .icon-button,
  .primary-button,
  .secondary-button,
  .danger-button,
  .ghost-button,
  .compact-button,
  .chip-button {
    min-height: 44px;
  }

  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-art {
    min-height: 240px;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-mark,
  .sidebar-footer {
    display: none;
  }

  .nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-button {
    width: auto;
    flex: 0 0 auto;
  }

  .topbar {
    position: static;
    padding: 12px 16px;
    align-items: flex-start;
  }

  .content {
    padding: 14px;
  }

  .view-title h1 {
    font-size: 24px;
  }

  .view-head {
    display: grid;
  }

  .studio-head {
    display: grid;
    align-items: start;
  }

  .studio-context strong,
  .studio-context span {
    max-width: 100%;
  }

  .metrics,
  .project-list {
    grid-template-columns: 1fr;
  }

  .image-grid,
  .listing-grid {
    grid-template-columns: 1fr;
  }

  .image-preview-backdrop {
    padding: 10px;
  }

  .image-preview-modal {
    max-height: calc(100dvh - 20px);
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .image-preview-stage {
    min-height: 52dvh;
  }

  .image-preview-stage img {
    max-height: 58dvh;
  }

  .image-preview-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .palette-popover {
    position: static;
    margin-top: 8px;
  }

  .tz-generator-layout {
    grid-template-columns: 1fr;
  }

  .tz-steps,
  .tz-preview-panel {
    position: static;
  }

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

  .tz-position-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .login-panel {
    padding: 22px 16px;
  }

  .topbar {
    display: grid;
  }

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

  .studio-head .button-row > * {
    flex: 0 0 auto;
  }

  .button-row {
    align-items: stretch;
  }

  .button-row > * {
    flex: 1 1 100%;
  }

  .feature-head,
  .recognition-body {
    grid-template-columns: 1fr;
  }

  .feature-head {
    display: grid;
  }

  .recognition-upload {
    min-height: 96px;
  }

  .asset-chip {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .asset-chip .icon-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }

  .image-actions,
  .image-preview-nav {
    grid-template-columns: 1fr;
  }

  .palette-input {
    padding-right: 12px;
  }

  .palette-preview {
    position: static;
    max-width: none;
    justify-content: flex-start;
    margin-top: 8px;
  }

  .palette-actions {
    grid-template-columns: 1fr;
  }

  .preset-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .tz-step-list {
    grid-template-columns: 1fr;
  }

  .tz-step-button {
    grid-template-columns: 30px minmax(0, 1fr);
  }
}

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