[hidden]{display:none !important;}
/* ==========================================================================
   H3 Studio — styles.css
   Neo-brutalist, warm palette. Mobile-first. 8px spacing grid.
   ========================================================================== */

/* ---- Tokens -------------------------------------------------------- */
:root{
  color-scheme: light;

  --bg: #1C1A1A;
  --panel: #FFF9F2;
  --panel-soft: #FFF3E4;
  --text: #161414;
  --muted: #6B6360;

  --lilac: #B9A5FF;
  --peach: #FFC4A3;
  --mint: #A8E6E1;
  --coral: #FF8A7A;
  --butter: #FFE58A;

  --border: #161414;
  --border-w: 2px;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;

  --shadow-y: 3px;
  --shadow: 0 var(--shadow-y) 0 var(--border);
  --shadow-sm: 0 2px 0 var(--border);
  --shadow-lg: 0 4px 0 var(--border);

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 40px;

  --frame-gap: 4px;

  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --dur: 170ms;
  --ease: cubic-bezier(.2,.7,.3,1);
}

/* ---- Reset ----------------------------------------------------------- */
*, *::before, *::after{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video{ max-width: 100%; display: block; }
button{ font-family: inherit; }
input, textarea, select{ font-family: inherit; font-size: inherit; color: inherit; }
ul{ margin: 0; padding: 0; list-style: none; }
p{ margin: 0; }
a{ color: inherit; }
::selection{ background: var(--lilac); color: var(--text); }

button, [role="button"]{ cursor: pointer; }
button:disabled{ cursor: not-allowed; }

:focus{ outline: none; }
:focus-visible{
  outline: 3px solid var(--lilac);
  outline-offset: 2px;
  border-radius: 4px;
}

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

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

/* ---- Typography -------------------------------------------------------- */
.headline{
  margin: 0 0 var(--sp-4);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-size: 26px;
}
.headline mark{
  background: var(--lilac);
  color: var(--text);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0 6px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.section-title{
  margin: 0 0 var(--sp-3);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  font-size: 15px;
  color: #FFF9F2;
}
.field-label{
  display: block;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: var(--sp-2);
}

/* ---- Panels / frame layout --------------------------------------------- */
.panel{
  background: var(--panel);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.noscript-panel{
  margin: var(--sp-5);
  padding: var(--sp-4);
  background: var(--butter);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 700;
}

.initial-loader{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 500;
}
.initial-loader-spinner{
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 4px solid rgba(185,165,255,0.25);
  border-top-color: var(--lilac);
  animation: spin 800ms linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* ---- Login screen -------------------------------------------------- */
.login-screen{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}
.login-panel{
  width: 100%;
  max-width: 380px;
  padding: var(--sp-6) var(--sp-5);
}
.login-subtitle{
  color: var(--muted);
  font-weight: 500;
  margin: var(--sp-2) 0 var(--sp-5);
}
.login-form{
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.logo{
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  font-size: 18px;
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.logo-lg{ font-size: 24px; }
.logo-accent{ color: var(--muted); font-weight: 800; }

.form-error{
  background: var(--coral);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-xs);
  padding: var(--sp-2) var(--sp-3);
  font-weight: 700;
  font-size: 14px;
}

/* ---- Form fields ----------------------------------------------------- */
.field{ display: flex; flex-direction: column; gap: var(--sp-2); }
.text-input{
  height: 48px;
  padding: 0 var(--sp-3);
  background: #fff;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.text-input:focus-visible{
  box-shadow: var(--shadow-sm);
}

/* ---- Buttons ----------------------------------------------------------- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 48px;
  padding: 0 var(--sp-4);
  background: #fff;
  color: var(--text);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease), opacity var(--dur) var(--ease);
  white-space: nowrap;
  user-select: none;
}
.btn:hover{ filter: brightness(1.03); }
.btn:active, .btn.is-pressed{
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--border);
}
.btn:disabled{
  opacity: 0.5;
  box-shadow: var(--shadow);
  transform: none;
  filter: none;
}
.btn-primary{ background: var(--lilac); }
.btn-secondary{ background: var(--peach); }
.btn-mint{ background: var(--mint); }
.btn-ghost{
  background: transparent;
  box-shadow: none;
  border-color: var(--border);
}
.btn-ghost:active{ transform: translateY(1px); }
.btn-danger{ background: var(--coral); }
.btn-block{ width: 100%; }
.btn-lg{ height: 54px; font-size: 16px; }
.btn-sm{
  height: 38px;
  padding: 0 var(--sp-3);
  font-size: 12.5px;
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-sm);
}
.btn-sm:active{ box-shadow: 0 1px 0 var(--border); }
.btn-chip{
  background: var(--panel-soft);
}
.link-btn{
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover{ color: var(--text); }

/* ---- Header ------------------------------------------------------------ */
.app-shell{
  min-height: 100vh;
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.header{
  position: sticky;
  top: var(--sp-3);
  z-index: 40;
  padding: var(--sp-3) var(--sp-4);
}
.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.header-right{
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.username-label{
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
}

.status-pill{
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px var(--sp-3);
  border-radius: 999px;
  border: var(--border-w) solid var(--border);
  background: #fff;
  font-weight: 700;
  font-size: 12.5px;
}
.status-pill[data-level="ok"]{ background: var(--mint); }
.status-pill[data-level="busy"]{ background: var(--butter); }
.status-pill[data-level="off"]{ background: var(--coral); }
.status-dot{
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ---- Layout -------------------------------------------------------- */
.layout{
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  flex: 1;
}

.create-panel{
  padding: var(--sp-4);
}
.field-group{ margin-bottom: var(--sp-4); }
.field-group:last-child{ margin-bottom: 0; }

.gallery-section{
  padding: var(--sp-1) 0 var(--sp-7);
}

/* Desktop layout */
@media (min-width: 1024px){
  .app-shell{ padding: var(--sp-5); gap: var(--sp-4); max-width: 1440px; margin: 0 auto; }
  .header{ top: var(--sp-5); }
  .layout{
    flex-direction: row;
    align-items: flex-start;
    gap: var(--sp-5);
  }
  .create-panel{
    width: 440px;
    flex: 0 0 440px;
    position: sticky;
    top: calc(var(--sp-5) + 72px);
    padding: var(--sp-5);
    max-height: calc(100vh - var(--sp-5) - 72px - var(--sp-5));
    overflow-y: auto;
  }
  .gallery-section{ flex: 1; min-width: 0; padding-top: var(--sp-2); }
  .mobile-submit-bar{ display: none; }
}

@media (min-width: 768px) and (max-width: 1023.98px){
  .app-shell{ padding: var(--sp-4); }
}

/* ---- Mobile sticky submit bar ---------------------------------------- */
.mobile-submit-bar{
  position: sticky;
  bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2);
  background: var(--panel);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  margin-top: var(--sp-1);
  z-index: 30;
}
.mobile-submit-bar .eta-label{ flex-shrink: 0; max-width: 40%; }
.create-panel .submit-row{
  display: none;
}
@media (min-width: 1024px){
  .create-panel .submit-row{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
    flex-wrap: wrap;
  }
}

.eta-label{
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  font-feature-settings: "tnum" 1;
}
.eta-label:empty{ display: none; }

/* ---- Mode grid ----------------------------------------------------- */
.mode-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2);
}
.mode-tile{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: #fff;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
  min-height: 108px;
}
.mode-tile:active{ transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }
.mode-tile[aria-pressed="true"]{
  background: var(--lilac);
}
.mode-tile-icon{
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--panel-soft);
  flex-shrink: 0;
}
.mode-tile[aria-pressed="true"] .mode-tile-icon{ background: #fff; }
.mode-tile-title{
  font-weight: 800;
  font-size: 14px;
  line-height: 1.15;
}
.mode-tile-desc{
  font-weight: 500;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.3;
}
.mode-tile[aria-pressed="true"] .mode-tile-desc{ color: var(--text); }

/* ---- Upload zone ------------------------------------------------------ */
.upload-zone{
  position: relative;
  border: var(--border-w) dashed var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.upload-zone.is-dragover{
  background: var(--panel-soft);
  border-color: var(--lilac);
}
.upload-empty{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-2);
  color: var(--muted);
}
.upload-icon{ color: var(--text); }
.upload-text{ font-weight: 700; font-size: 13px; color: var(--text); line-height: 1.4; }
.upload-hint{ font-size: 11.5px; color: var(--muted); }

.upload-progress-wrap{
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.upload-progress-track{
  flex: 1;
  height: 10px;
  background: #fff;
  border: var(--border-w) solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.upload-progress-fill{
  height: 100%;
  width: 0%;
  background: var(--lilac);
  transition: width 150ms linear;
}
.upload-progress-text{
  font-weight: 700;
  font-size: 12px;
  font-feature-settings: "tnum" 1;
  flex-shrink: 0;
}

.upload-preview{
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}
.upload-preview img{
  max-height: 180px;
  border-radius: var(--radius-sm);
  border: var(--border-w) solid var(--border);
}
.upload-remove{
  position: absolute;
  top: -10px; right: calc(50% - 90px - 10px);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--coral);
  border: var(--border-w) solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
}
.upload-remove:active{ transform: translateY(1px); box-shadow: none; }

.chip-suggest{
  margin-top: var(--sp-2);
}

/* ---- Prompt ------------------------------------------------------------ */
.prompt-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}
.prompt-header .field-label{ margin-bottom: 0; }
.prompt-textarea{
  width: 100%;
  resize: none;
  min-height: 88px;
  max-height: 320px;
  overflow-y: auto;
  padding: var(--sp-3);
  background: #fff;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 500;
  line-height: 1.45;
  transition: box-shadow var(--dur) var(--ease);
}
.prompt-textarea:focus-visible{ box-shadow: var(--shadow-sm); }
.prompt-footer{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-2);
}
.prompt-counter{
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-feature-settings: "tnum" 1;
}
.prompt-counter.is-near-limit{ color: var(--text); }
.prompt-counter.is-over{ color: var(--coral); }
.prompt-help{
  margin-top: var(--sp-2);
  padding: var(--sp-3);
  background: var(--panel-soft);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ---- Option groups / chips ------------------------------------------- */
.option-group{ margin-bottom: var(--sp-4); }
.option-group:last-child{ margin-bottom: 0; }
.chip-row{
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.chip{
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px var(--sp-3);
  background: #fff;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.chip:active{ transform: translateY(1px); box-shadow: none; }
.chip[aria-pressed="true"]{
  background: var(--lilac);
}
.chip-text{ display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.chip-hint{ font-weight: 500; font-size: 10.5px; color: var(--muted); }
.chip[aria-pressed="true"] .chip-hint{ color: var(--text); }
.chip-format-icon{
  border: 1.6px solid currentColor;
  border-radius: 2px;
  flex-shrink: 0;
}

.chip-suggest{
  background: var(--butter);
}

.toggle-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--panel-soft);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-sm);
}
.toggle-row-text{ display: flex; flex-direction: column; gap: 2px; }
.toggle-row-title{ font-weight: 800; font-size: 13px; text-transform: uppercase; }
.toggle-row-hint{ font-size: 11.5px; color: var(--muted); }
.switch{
  position: relative;
  width: 46px; height: 28px;
  flex-shrink: 0;
  background: #fff;
  border: var(--border-w) solid var(--border);
  border-radius: 999px;
  transition: background-color var(--dur) var(--ease);
}
.switch::after{
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: var(--text);
  border-radius: 50%;
  transition: transform var(--dur) var(--ease);
}
.switch[aria-checked="true"]{ background: var(--lilac); }
.switch[aria-checked="true"]::after{ transform: translateX(18px); background: var(--text); }

.cinema-note{
  margin-top: var(--sp-2);
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

/* ---- Estimate notes ---------------------------------------------------- */
.estimate-notes{
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.estimate-notes:empty{ margin-top: 0; }
.note{
  padding: var(--sp-2) var(--sp-3);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}
.note-info{ background: #EDE7FF; }
.note-warn{ background: var(--butter); }
.note-danger{ background: var(--coral); }

/* ---- Gallery grid -------------------------------------------------- */
.gallery-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
}
@media (min-width: 560px) and (max-width: 1023.98px){
  .gallery-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px){
  .gallery-grid{ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

.gallery-empty{
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

/* ---- Card ------------------------------------------------------------ */
.card{
  background: var(--panel);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: card-in 220ms var(--ease);
}
@keyframes card-in{
  from{ opacity: 0; transform: translateY(6px); }
  to{ opacity: 1; transform: translateY(0); }
}
.card.is-removing{
  animation: card-out 160ms var(--ease) forwards;
}
@keyframes card-out{
  to{ opacity: 0; transform: scale(.97); }
}

.card-media{
  position: relative;
  width: 100%;
  background: #12100F;
  border-bottom: var(--border-w) solid var(--border);
  overflow: hidden;
}
.card-media-inner{
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-media img, .card-media video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}
.card-media video{ cursor: default; }

.card-media-skeleton{
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #2A2724 30%, #38342F 50%, #2A2724 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer{
  from{ background-position: 150% 0; }
  to{ background-position: -50% 0; }
}
.card-state{
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-4);
  text-align: center;
  color: #FFF9F2;
}
.card-state-icon{ opacity: 0.9; }
.card-state-title{ font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 0.02em; }
.card-state-sub{ font-size: 12px; color: rgba(255,249,242,0.7); font-feature-settings: "tnum" 1; }

.card-progress{
  width: 100%;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.card-progress-track{
  height: 10px;
  background: rgba(255,249,242,0.15);
  border: var(--border-w) solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.card-progress-fill{
  height: 100%;
  width: 0%;
  background: var(--lilac);
  transition: width 400ms var(--ease);
}
.card-progress-meta{
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: rgba(255,249,242,0.75);
  font-feature-settings: "tnum" 1;
}

.card-state.is-waiting{ color: #161414; }
.card-media-inner[data-state="waiting"]{ background: var(--butter); }
.card-state.is-waiting .card-state-sub{ color: rgba(22,20,20,0.65); }

.card-error-panel{
  color: var(--text);
}
.card-media-inner[data-state="error"], .card-media-inner[data-state="canceled"]{ background: var(--coral); }
.card-media-inner[data-state="canceled"]{ background: var(--panel-soft); }

.card-body{
  padding: var(--sp-3) var(--sp-3) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.card-meta{
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.badge{
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1.6px solid var(--border);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: var(--peach);
}
.params-label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.card-prompt{
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
  cursor: pointer;
}
.card-prompt.clamp-2{
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-notice{
  padding: 6px var(--sp-2);
  background: var(--butter);
  border: 1.6px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 600;
}
.card-actions{
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-1);
}
.card-actions .btn{ flex: 1; min-width: 90px; }

.confirm-bar{
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  padding: var(--sp-2);
  background: #fff;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: var(--sp-1);
}
.confirm-bar-text{ font-weight: 700; font-size: 12.5px; flex: 1 1 100%; }
.confirm-bar .btn{ flex: 1; }

/* ---- Toasts ------------------------------------------------------------ */
.toasts{
  position: fixed;
  left: 50%;
  bottom: var(--sp-4);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  z-index: 800;
  width: min(92vw, 420px);
  align-items: center;
}
.toast{
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--panel);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-weight: 700;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  animation: toast-in 200ms var(--ease);
}
.toast.is-leaving{ animation: toast-out 160ms var(--ease) forwards; }
@keyframes toast-in{ from{ opacity: 0; transform: translateY(10px); } to{ opacity: 1; transform: translateY(0); } }
@keyframes toast-out{ to{ opacity: 0; transform: translateY(6px); } }
.toast[data-type="success"]{ background: var(--mint); }
.toast[data-type="danger"]{ background: var(--coral); }
.toast[data-type="warn"]{ background: var(--butter); }
.toast-close{
  background: none; border: none; padding: 0;
  font-weight: 900; font-size: 16px; line-height: 1;
  flex-shrink: 0;
  color: var(--text);
}

/* ---- Lightbox ----------------------------------------------------------- */
.lightbox{
  position: fixed;
  inset: 0;
  background: rgba(10,9,9,0.9);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
}
.lightbox img{
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  border: var(--border-w) solid var(--border);
}
.lightbox-close{
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--panel);
  border: var(--border-w) solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:active{ transform: translateY(2px); box-shadow: none; }

/* ---- Small screens tightening ------------------------------------------- */
@media (max-width: 359.98px){
  .headline{ font-size: 22px; }
  .mode-tile{ min-height: 96px; padding: var(--sp-2); }
}

@media (min-width: 1024px){ .mobile-submit-bar{ display: none !important; } }

/* ---- Enhance prompt ----------------------------------------------------- */
.prompt-actions{ display: flex; gap: var(--sp-2); align-items: center; }
#enhanceBtn{ display: inline-flex; align-items: center; gap: 6px; }
#enhanceBtn .btn-icon{ flex-shrink: 0; }
#enhanceBtn.is-loading .btn-icon{ animation: enhance-spin 1s linear infinite; }
#enhanceBtn:disabled{ opacity: .55; cursor: not-allowed; }
.prompt-textarea.is-enhancing{ background-image: linear-gradient(90deg, transparent, rgba(185,165,255,.18), transparent); background-size: 200% 100%; animation: enhance-shimmer 1.2s linear infinite; }
.enhance-undo{
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap;
  margin-top: var(--sp-2); padding: 8px 12px; font-size: 13px;
  background: rgba(185,165,255,.22); border: 2px solid var(--border); border-radius: 10px;
}
@keyframes enhance-spin{ to{ transform: rotate(360deg); } }
@keyframes enhance-shimmer{ from{ background-position: 200% 0; } to{ background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce){
  #enhanceBtn.is-loading .btn-icon, .prompt-textarea.is-enhancing{ animation: none; }
}
#enhanceBtn.is-unavailable{ opacity: .55; }

/* ---- PWA / вырез экрана iPhone ------------------------------------------- */
body{
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
.mobile-submit-bar{ margin-bottom: env(safe-area-inset-bottom); }
.prompt-textarea, .text-input{ font-size: max(16px, 1em); } /* iOS не зумит поле при фокусе */
