:root {
  --canvas: #f3f0e8;
  --surface: #fbfaf6;
  --surface-strong: #ffffff;
  --surface-muted: #ebe7de;
  --ink: #262a26;
  --ink-soft: #454b45;
  --muted: #747870;
  --faint: #9da098;
  --line: #dcd8ce;
  --line-strong: #c5c2b9;
  --accent: #b86146;
  --accent-dark: #974b36;
  --accent-soft: #f3e2da;
  --sage: #657469;
  --sage-soft: #e3e8e1;
  --success: #427057;
  --success-soft: #e3eee7;
  --warning: #976a2c;
  --warning-soft: #f4ead9;
  --danger: #9b463c;
  --danger-soft: #f6e3df;
  --dark: #282d29;
  --dark-soft: #343a35;
  --shadow-sm: 0 1px 2px rgba(35, 39, 35, 0.05), 0 5px 18px rgba(35, 39, 35, 0.04);
  --shadow-md: 0 16px 50px rgba(35, 39, 35, 0.13);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(184, 97, 70, 0.35);
  outline-offset: 3px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

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

.eyebrow,
.auth-eyebrow {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.button--primary {
  color: #fffaf5;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 7px 16px rgba(151, 75, 54, 0.16);
}

.button--primary:hover:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.button--primary .loader {
  border-color: rgba(255, 255, 255, 0.32);
  border-top-color: #fff;
}

.button--large {
  min-height: 48px;
  padding-inline: 20px;
}

.icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.icon-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.icon-button--light {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface);
}

.icon-button--light:hover {
  color: var(--ink);
  background: var(--surface-muted);
  border-color: var(--line-strong);
}

.text-button {
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  color: var(--accent-dark);
}

/* Authentication */

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(420px, 0.82fr) minmax(520px, 1.18fr);
  background: var(--surface);
}

.auth-panel {
  min-width: 0;
  padding: clamp(32px, 6vw, 88px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(56px, 9vh, 104px);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  color: #fffaf5;
  background: var(--accent);
}

.brand-mark .icon {
  width: 24px;
  height: 24px;
}

.brand-mark--large {
  width: 50px;
  height: 50px;
  border-radius: 16px;
}

.auth-copy h1 {
  max-width: 580px;
  margin: 0;
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 740;
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.auth-copy p {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.login-form {
  max-width: 530px;
  margin-top: 50px;
}

.login-form > label {
  display: block;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.pin-field {
  min-height: 58px;
  padding: 6px 6px 6px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.pin-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(184, 97, 70, 0.1);
}

.pin-field > .icon {
  color: var(--faint);
}

.pin-field input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 17px;
  letter-spacing: 0.08em;
}

.pin-field input::placeholder {
  color: var(--faint);
  font-family: var(--font-sans);
  letter-spacing: 0;
}

.login-submit {
  min-width: 94px;
  min-height: 44px;
}

.login-submit .icon {
  width: 17px;
  height: 17px;
}

.field-hint,
.form-error {
  margin: 9px 2px 0;
  font-size: 12px;
}

.field-hint {
  color: var(--muted);
}

.form-error {
  min-height: 19px;
  color: var(--danger);
  font-weight: 650;
}

.auth-footnote {
  margin-top: auto;
  padding-top: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.auth-footnote .icon {
  width: 18px;
  height: 18px;
  color: var(--sage);
}

.auth-visual {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #d9cfbf;
  isolation: isolate;
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px solid rgba(65, 67, 60, 0.13);
  border-radius: 44% 56% 52% 48% / 42% 46% 54% 58%;
}

.paper-ribbon {
  position: absolute;
  width: 84%;
  height: 27%;
  border: 1px solid rgba(88, 83, 72, 0.08);
  border-radius: 52% 48% 43% 57% / 52% 44% 56% 48%;
  background: #f7f3e9;
  box-shadow: 0 28px 60px rgba(66, 59, 48, 0.13), inset 0 -18px 28px rgba(181, 164, 141, 0.18);
}

.paper-ribbon--one {
  top: 25%;
  left: 8%;
  transform: rotate(-21deg);
}

.paper-ribbon--two {
  top: 47%;
  right: -3%;
  transform: rotate(22deg);
  background: #efe5d8;
}

.paper-orb {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(88, 83, 72, 0.09);
  background: #fbf8f0;
  box-shadow: inset -22px -20px 34px rgba(181, 164, 141, 0.23), 0 25px 45px rgba(69, 62, 51, 0.12);
}

.paper-orb--one {
  width: 18vw;
  max-width: 280px;
  min-width: 170px;
  aspect-ratio: 1;
  top: 12%;
  right: 5%;
}

.paper-orb--two {
  width: 11vw;
  max-width: 170px;
  min-width: 110px;
  aspect-ratio: 1;
  bottom: 14%;
  left: 14%;
  background: #dcc3b1;
}

.auth-visual-caption {
  position: absolute;
  right: 32px;
  bottom: 28px;
  left: 32px;
  padding-top: 14px;
  border-top: 1px solid rgba(65, 67, 60, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: rgba(38, 42, 38, 0.72);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

/* App frame */

.app-shell {
  min-height: 100vh;
}

.topbar {
  min-height: 76px;
  padding: 0 clamp(20px, 3.2vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #f7f5ee;
  background: var(--dark);
}

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

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.brand-copy span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}

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

.connection-pill {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 650;
}

.status-dot,
.readiness-signal {
  display: inline-block;
  border-radius: 50%;
  flex: 0 0 auto;
}

.status-dot {
  width: 7px;
  height: 7px;
}

.status-dot--checking {
  background: #c6aa76;
}

.status-dot--ready {
  background: #69a77e;
}

.status-dot--offline {
  background: #d27367;
}

.readiness-bar {
  min-height: 92px;
  padding: 15px clamp(20px, 3.2vw, 48px);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(170px, 0.72fr) minmax(420px, 2fr) auto;
  align-items: center;
  gap: clamp(18px, 3vw, 46px);
  background: var(--surface);
}

.readiness-intro {
  display: grid;
  gap: 6px;
}

.readiness-intro strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.readiness-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 1px;
  background: var(--line);
}

.readiness-item {
  min-width: 0;
  min-height: 50px;
  padding: 7px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
}

.readiness-item > div {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.readiness-item span:not(.readiness-signal) {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readiness-item strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readiness-signal {
  width: 9px;
  height: 9px;
  border: 2px solid transparent;
}

.readiness-signal--checking {
  border-color: #c6aa76;
  background: #f8f0dd;
}

.readiness-signal--ready {
  border-color: var(--success);
  background: var(--success-soft);
}

.readiness-signal--offline,
.readiness-signal--error {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.workspace {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: clamp(26px, 3vw, 46px) clamp(18px, 3.2vw, 48px) 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 366px);
  align-items: start;
  gap: clamp(26px, 3vw, 44px);
}

.library-pane {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h1 {
  margin: 9px 0 0;
  font-size: clamp(27px, 3vw, 42px);
  font-weight: 740;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.section-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.library-tabs {
  margin-top: 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: end;
  gap: 20px;
}

.library-tab {
  min-height: 42px;
  padding: 0 1px 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
}

.library-tab:hover {
  color: var(--ink);
}

.library-tab.is-active {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.library-tab small {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.library-tab:focus-visible {
  outline: 3px solid rgba(184, 97, 70, 0.3);
  outline-offset: 3px;
}

.catalog-count {
  min-width: 88px;
  padding-left: 20px;
  border-left: 1px solid var(--line-strong);
  display: grid;
  align-content: end;
  justify-items: end;
}

.catalog-count strong {
  font-family: var(--font-mono);
  font-size: 24px;
  line-height: 1;
}

.catalog-count span {
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.library-toolbar {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-box {
  min-width: min(360px, 100%);
  min-height: 46px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(184, 97, 70, 0.08);
}

.search-box .icon {
  width: 18px;
  height: 18px;
  color: var(--faint);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.search-box input::placeholder {
  color: var(--faint);
}

.search-box kbd {
  min-width: 23px;
  height: 23px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.family-filters {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.family-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.filter-chip:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.filter-chip.is-active {
  color: #fffaf5;
  border-color: var(--dark-soft);
  background: var(--dark-soft);
}

.safety-note {
  margin-top: 18px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  background: rgba(251, 250, 246, 0.65);
}

.safety-note-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--sage);
  background: var(--sage-soft);
}

.safety-note-icon .icon {
  width: 18px;
  height: 18px;
}

.safety-note > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.safety-note strong {
  font-size: 12px;
}

.safety-note span {
  color: var(--muted);
  font-size: 11px;
}

.safety-note button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: not-allowed;
}

.safety-note button .icon {
  width: 15px;
  height: 15px;
}

.local-upscale-progress {
  margin-top: 12px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.local-upscale-progress__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.local-upscale-progress__heading .eyebrow {
  color: var(--sage);
  font-size: 9px;
}

.local-upscale-progress h2 {
  margin: 3px 0 0;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.local-upscale-progress__heading strong {
  color: var(--sage);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.local-upscale-progress__bar {
  height: 7px;
  margin-top: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-muted);
}

.local-upscale-progress__bar > span {
  width: 0;
  height: 100%;
  border-radius: inherit;
  display: block;
  background: var(--sage);
  transition: width 260ms ease-out;
}

.local-upscale-progress p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.catalog-state {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.catalog-state.is-error {
  color: var(--danger);
}

.catalog-state button {
  min-height: 36px;
  margin-left: 6px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.loader {
  width: 17px;
  height: 17px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 720ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.concept-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.concept-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.concept-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 28px rgba(35, 39, 35, 0.09);
}

.concept-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #ddd7cb;
}

.concept-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.concept-card:hover .concept-media img {
  transform: scale(1.018);
}

.concept-media.is-vertical img {
  object-position: center 38%;
}

.concept-media-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(55, 59, 54, 0.55);
  background: #e6dfd3;
}

.concept-media-fallback::before,
.concept-media-fallback::after {
  content: "";
  position: absolute;
  border-radius: 52% 48% 56% 44%;
  background: #f7f2e8;
  box-shadow: inset -10px -8px 18px rgba(170, 145, 122, 0.15);
}

.concept-media-fallback::before {
  width: 58%;
  height: 34%;
  transform: rotate(-12deg);
}

.concept-media-fallback::after {
  width: 28%;
  aspect-ratio: 1;
  right: 12%;
  top: 12%;
  background: #d9bdab;
}

.concept-media-fallback .icon {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
}

.concept-media-tags {
  position: absolute;
  z-index: 2;
  top: 11px;
  left: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.media-tag {
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.94);
  background: rgba(38, 42, 38, 0.68);
  backdrop-filter: blur(7px);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.media-tag--master {
  color: #fff8f0;
  background: rgba(126, 87, 54, 0.78);
}

.media-tag--key {
  color: #f8fbf7;
  background: rgba(73, 92, 80, 0.78);
}

.concept-body {
  min-height: 208px;
  padding: 17px 17px 15px;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.concept-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.concept-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--success);
  letter-spacing: 0;
}

.concept-status--pending {
  color: var(--muted);
}

.concept-status--key-ready {
  color: var(--sage);
}

.concept-status--pending::before {
  background: var(--line-strong);
}

.concept-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.concept-title {
  margin: 9px 0 0;
  font-size: 18px;
  font-weight: 740;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.concept-prompt {
  margin: 10px 0 0;
  overflow: hidden;
  display: -webkit-box;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.concept-actions {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.concept-action-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.concept-body.has-completed-media .concept-format {
  display: none;
}

.concept-format {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.create-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--dark-soft);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fffaf5;
  background: var(--dark-soft);
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease;
}

.create-button--completed {
  border-color: var(--line-strong);
  color: var(--muted);
  background: var(--surface-muted);
  cursor: not-allowed;
}

.create-button--completed:hover {
  transform: none;
  background: var(--surface-muted);
}

.create-button--completed:disabled {
  opacity: 1;
}

.card-action-button {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.card-action-button:hover {
  border-color: var(--accent);
  color: var(--ink);
  background: #fffaf6;
}

.card-action-button .icon {
  width: 16px;
  height: 16px;
}

.card-action-button--more {
  width: 38px;
  padding: 0;
}

.card-action-button--compact {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.create-button:hover {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

.create-button .icon {
  width: 16px;
  height: 16px;
}

/* Queue */

.queue-panel {
  position: sticky;
  top: 22px;
  max-height: calc(100vh - 44px);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid #3f4640;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  color: #f5f3ed;
  background: var(--dark);
  box-shadow: var(--shadow-md);
}

.queue-header {
  padding: 24px 23px 0;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.queue-header .eyebrow {
  color: rgba(255, 255, 255, 0.42);
}

.queue-header h2 {
  margin: 7px 0 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.queue-count {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.queue-description {
  margin: 10px 23px 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  line-height: 1.6;
}

.queue-list {
  min-height: 250px;
  margin-top: 18px;
  padding: 0 12px 16px;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.queue-empty {
  min-height: 250px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  font-size: 12px;
}

.queue-empty .icon {
  width: 30px;
  height: 30px;
  margin-bottom: 4px;
}

.queue-empty strong {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.queue-empty p {
  max-width: 210px;
  margin: 0;
}

.queue-empty .loader {
  border-color: rgba(255, 255, 255, 0.15);
  border-top-color: #d9aa91;
}

.job-card {
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.job-card.is-running {
  border-color: rgba(217, 170, 145, 0.36);
  background: rgba(184, 97, 70, 0.09);
}

.job-card.is-completed {
  border-color: rgba(105, 167, 126, 0.3);
}

.job-card.is-failed {
  border-color: rgba(210, 115, 103, 0.34);
}

.job-card.is-needs-review {
  border-color: rgba(207, 169, 97, 0.4);
  background: rgba(151, 106, 44, 0.1);
}

.job-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.job-index {
  color: rgba(255, 255, 255, 0.38);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.job-status {
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.07);
  font-size: 9px;
  font-weight: 700;
}

.job-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.job-status--running {
  color: #e3b49a;
  background: rgba(184, 97, 70, 0.14);
}

.job-status--completed {
  color: #87bc98;
  background: rgba(66, 112, 87, 0.16);
}

.job-status--failed,
.job-status--cancelled {
  color: #df8b80;
  background: rgba(155, 70, 60, 0.15);
}

.job-status--needs-review {
  color: #e0bd7f;
  background: rgba(151, 106, 44, 0.17);
}

.job-title {
  margin: 10px 0 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.93);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-meta {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 9px;
  color: rgba(255, 255, 255, 0.44);
  font-family: var(--font-mono);
  font-size: 9px;
}

.job-meta span + span::before {
  content: "·";
  margin-right: 9px;
  color: rgba(255, 255, 255, 0.22);
}

.job-progress {
  height: 3px;
  margin-top: 13px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
}

.job-progress > span {
  display: block;
  width: var(--job-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: #d99d80;
  transition: width 320ms ease;
}

.job-progress.is-indeterminate > span {
  width: 36%;
  animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(300%);
  }
}

.job-detail {
  margin: 10px 0 0;
  color: #d9bd89;
  font-size: 10px;
  line-height: 1.45;
}

.job-detail.is-error {
  color: #df978e;
}

.job-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.job-action {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.66);
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.job-action:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.job-action--download {
  color: #fff8f3;
  border-color: rgba(217, 157, 128, 0.34);
  background: rgba(184, 97, 70, 0.2);
}

.job-action .icon {
  width: 14px;
  height: 14px;
}

.queue-footnote {
  margin-top: auto;
  padding: 15px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: rgba(255, 255, 255, 0.42);
  background: rgba(0, 0, 0, 0.08);
  font-size: 10px;
  line-height: 1.5;
}

.queue-footnote .icon {
  width: 16px;
  height: 16px;
  color: #d99d80;
}

/* Production dialog */

.production-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: min(880px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 32px 90px rgba(25, 29, 25, 0.26);
}

.production-dialog::backdrop {
  background: rgba(30, 34, 30, 0.62);
  backdrop-filter: blur(5px);
}

.production-dialog[open] {
  animation: dialog-in 180ms ease-out;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

.production-dialog form {
  margin: 0;
}

.playback-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(880px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 32px 90px rgba(25, 29, 25, 0.26);
}

.playback-dialog::backdrop {
  background: rgba(30, 34, 30, 0.62);
  backdrop-filter: blur(5px);
}

.playback-dialog[open] {
  animation: dialog-in 180ms ease-out;
}

.comparison-dialog {
  width: min(1120px, calc(100vw - 28px));
  max-height: min(900px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 32px 90px rgba(25, 29, 25, 0.26);
}

.comparison-dialog::backdrop {
  background: rgba(30, 34, 30, 0.62);
  backdrop-filter: blur(5px);
}

.comparison-dialog[open] {
  animation: dialog-in 180ms ease-out;
}

.comparison-dialog__body {
  max-height: calc(100vh - 160px);
  padding: 22px;
  overflow-y: auto;
}

.comparison-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--sage);
  border-radius: 0 8px 8px 0;
  color: var(--ink-soft);
  background: var(--sage-soft);
  font-size: 12px;
  line-height: 1.55;
}

.comparison-selectors {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.comparison-selectors label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 720;
}

.comparison-selectors select {
  min-width: 0;
  height: 38px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface-strong);
  font: inherit;
}

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

.comparison-stage figure {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #242823;
}

.comparison-stage video {
  width: 100%;
  max-height: min(48vh, 490px);
  display: block;
  background: #242823;
  object-fit: contain;
}

.comparison-stage figcaption {
  min-height: 45px;
  padding: 9px 11px;
  color: #e9e5de;
  background: #2b302b;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.45;
}

.comparison-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.comparison-actions .button {
  white-space: nowrap;
}

.comparison-actions > span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.playback-dialog__body {
  max-height: calc(100vh - 160px);
  padding: 22px;
  overflow-y: auto;
}

.playback-dialog__concept {
  display: grid;
  gap: 3px;
}

.playback-dialog__concept > span {
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.playback-dialog__concept strong {
  font-size: 17px;
  letter-spacing: -0.025em;
}

.video-stage {
  min-height: 236px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background: #e9e4d9;
}

.video-stage video {
  width: 100%;
  max-height: min(48vh, 430px);
  display: block;
  object-fit: contain;
  background: #242823;
}

.video-stage p {
  max-width: 250px;
  margin: 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
}

.playback-variants {
  margin-top: 20px;
}

.playback-variants__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.playback-variants__heading h3 {
  margin: 5px 0 0;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.playback-variants__heading > span {
  color: var(--faint);
  font-size: 10px;
}

.playback-variant-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.playback-variant {
  width: 100%;
  min-height: 62px;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink);
  background: var(--surface-strong);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.playback-variant:hover,
.playback-variant.is-selected {
  border-color: var(--accent);
  background: #fffaf6;
}

.playback-variant.is-selected {
  box-shadow: 0 0 0 3px rgba(184, 97, 70, 0.08);
}

.playback-variant__copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.playback-variant__copy strong {
  font-size: 12px;
}

.playback-variant__copy small {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playback-variant__play {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 720;
}

.playback-variant__play .icon {
  width: 15px;
  height: 15px;
}

.production-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(145, 105, 54, 0.18);
  border-radius: 14px;
  background: rgba(255, 249, 238, 0.88);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.production-notice .icon {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--accent-dark);
}

.production-notice p {
  margin: 0;
}

.production-notice strong {
  color: var(--ink);
}

.dialog-header {
  min-height: 84px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.dialog-header h2 {
  margin: 6px 0 0;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.dialog-body {
  max-height: calc(100vh - 220px);
  padding: 22px;
  overflow-y: auto;
}

.dialog-concept {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  background: var(--surface-strong);
}

.dialog-concept-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 9px;
  background: var(--surface-muted);
}

.dialog-concept-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialog-concept > div:last-child {
  min-width: 0;
  display: grid;
}

.dialog-concept > div:last-child > span {
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.dialog-concept strong {
  margin-top: 2px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-concept p {
  margin: 3px 0 0;
  overflow: hidden;
  display: -webkit-box;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.option-group {
  min-width: 0;
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}

.option-group legend {
  margin-bottom: 9px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 720;
}

.option-group legend .icon {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

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

.choice-card {
  position: relative;
  min-height: 80px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--surface-strong);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.choice-card:hover {
  border-color: var(--line-strong);
}

.choice-card:has(input:checked) {
  border-color: var(--accent);
  background: #fffaf6;
  box-shadow: 0 0 0 3px rgba(184, 97, 70, 0.08);
}

.choice-card:has(input:focus-visible) {
  outline: 3px solid rgba(184, 97, 70, 0.3);
  outline-offset: 2px;
}

.choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.choice-card strong {
  font-size: 13px;
}

.choice-card small {
  color: var(--muted);
  font-size: 10px;
}

.choice-visual {
  width: 48px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-muted);
}

.aspect-demo::before {
  content: "";
  display: block;
  border: 1.5px solid var(--sage);
  border-radius: 3px;
  background: var(--sage-soft);
}

.aspect-demo--wide::before {
  width: 30px;
  aspect-ratio: 16 / 9;
}

.aspect-demo--tall::before {
  height: 30px;
  aspect-ratio: 9 / 16;
}

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

.segmented-control {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--surface-muted);
}

.segmented-control label {
  position: relative;
  min-width: 0;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  min-height: 36px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.segmented-control input:checked + span {
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: 0 1px 5px rgba(35, 39, 35, 0.1);
}

.segmented-control label:has(input:focus-visible) {
  outline: 3px solid rgba(184, 97, 70, 0.3);
  outline-offset: 2px;
  border-radius: 8px;
}

.toggle-list {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-strong);
}

.toggle-row {
  min-height: 70px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.toggle-row + .toggle-row {
  border-top: 1px solid var(--line);
}

.toggle-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--sage);
  background: var(--sage-soft);
}

.toggle-row-icon .icon {
  width: 18px;
  height: 18px;
}

.toggle-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.toggle-copy strong {
  font-size: 12px;
}

.toggle-copy small {
  color: var(--muted);
  font-size: 10px;
}

.switch {
  position: relative;
  display: inline-flex;
}

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

.switch span {
  width: 43px;
  height: 25px;
  border-radius: 999px;
  display: block;
  background: var(--line-strong);
  transition: background-color 160ms ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(35, 39, 35, 0.2);
  transition: transform 160ms ease;
}

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

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

.toggle-row:has(input:focus-visible) {
  outline: 3px solid rgba(184, 97, 70, 0.3);
  outline-offset: -3px;
}

.dialog-footer {
  min-height: 82px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #f7f4ed;
}

.dialog-footer p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

/* Toast */

.toast-region {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  width: min(390px, calc(100vw - 40px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: rgba(255, 255, 255, 0.92);
  background: var(--dark-soft);
  box-shadow: 0 14px 36px rgba(35, 39, 35, 0.2);
  font-size: 12px;
  pointer-events: auto;
  animation: toast-in 180ms ease-out;
}

.toast.is-error {
  background: #743a34;
}

.toast .icon {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: #e3b49a;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* Responsive */

@media (max-width: 1120px) {
  .readiness-bar {
    grid-template-columns: minmax(150px, 0.55fr) minmax(390px, 1.8fr) auto;
  }

  .readiness-item {
    padding-inline: 12px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 24px;
  }
}

@media (max-width: 980px) {
  .auth-gate {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }

  .auth-panel {
    min-height: 100vh;
  }

  .readiness-bar {
    grid-template-columns: 1fr auto;
  }

  .readiness-intro {
    display: none;
  }

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

  .queue-panel {
    position: static;
    max-height: none;
    min-height: 0;
  }

  .queue-list {
    max-height: 520px;
  }

  .queue-empty {
    min-height: 180px;
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 68px;
    padding-inline: 16px;
  }

  .brand-copy span,
  .connection-pill span:last-child {
    display: none;
  }

  .connection-pill {
    width: 36px;
    min-height: 36px;
    padding: 0;
    justify-content: center;
  }

  .readiness-bar {
    min-height: 76px;
    padding: 10px 16px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    overflow: hidden;
  }

  .readiness-items {
    min-width: 420px;
    overflow: hidden;
  }

  .readiness-item {
    min-height: 46px;
    padding-inline: 9px;
  }

  .readiness-item span:not(.readiness-signal) {
    display: none;
  }

  .readiness-refresh span {
    display: none;
  }

  .readiness-refresh {
    width: 40px;
    justify-content: center;
  }

  .workspace {
    padding: 26px 14px 44px;
  }

  .section-heading {
    align-items: start;
  }

  .section-heading p {
    max-width: 290px;
  }

  .catalog-count {
    min-width: 58px;
    padding-left: 12px;
  }

  .library-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    min-width: 0;
  }

  .safety-note {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .safety-note button {
    display: none;
  }

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

  .concept-body {
    min-height: 205px;
    padding: 14px;
  }

  .concept-title {
    font-size: 15px;
  }

  .concept-prompt {
    font-size: 11px;
  }

  .concept-format {
    display: none;
  }

  .concept-actions {
    justify-content: flex-end;
  }

  .production-dialog {
    width: 100vw;
    max-width: none;
    max-height: calc(100vh - 10px);
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  .dialog-body {
    max-height: calc(100vh - 215px);
    padding: 17px;
  }

  .dialog-header,
  .dialog-footer {
    padding-inline: 17px;
  }

  .dialog-footer p {
    display: none;
  }

  .dialog-footer .button {
    width: 100%;
  }

  .dialog-concept {
    grid-template-columns: 94px minmax(0, 1fr);
  }
}

@media (max-width: 500px) {
  .auth-panel {
    padding: 26px 20px;
  }

  .auth-brand {
    margin-bottom: 54px;
  }

  .auth-copy h1 {
    font-size: 34px;
  }

  .login-form {
    margin-top: 38px;
  }

  .pin-field {
    grid-template-columns: auto minmax(0, 1fr);
    padding-right: 10px;
  }

  .login-submit {
    grid-column: 1 / -1;
    width: 100%;
    margin: 2px 0 4px;
  }

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

  .concept-body {
    min-height: 190px;
  }

  .comparison-dialog {
    width: 100vw;
    max-width: none;
    max-height: calc(100vh - 10px);
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  .comparison-dialog__body {
    max-height: calc(100vh - 130px);
    padding: 17px;
  }

  .comparison-selectors,
  .comparison-stage {
    grid-template-columns: 1fr;
  }

  .comparison-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .option-grid,
  .option-row {
    grid-template-columns: 1fr;
  }

  .option-row {
    gap: 0;
  }

  .toggle-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .toggle-row-icon {
    display: none;
  }

  .queue-panel {
    border-radius: 18px;
  }
}

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