/* Platform layout; brand tokens and navigation come from the main stylesheet. */
[hidden] { display: none !important; }
button, textarea, input, select { font: inherit; }

.top-bar header { background: var(--surface-card); }

.shell, .login-shell { position: relative; z-index: 1; }
.shell {
  width: min(1180px, calc(100% - (2 * var(--edge))));
  margin: 0 auto;
  padding: clamp(170px, 18vw, 220px) 0 var(--section-y);
}
.login-shell {
  display: grid;
  min-height: 100vh;
  padding: clamp(180px, 20vw, 230px) var(--edge) 80px;
  place-items: center;
}

.login-card, .workspace, .job-card {
  border: 1px solid var(--border-card);
  background: color-mix(in srgb, var(--surface-card) 94%, transparent);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
}
.login-card {
  display: grid;
  width: min(460px, 100%);
  gap: 12px;
  padding: clamp(28px, 5vw, 46px);
  border-radius: var(--radius-lg);
}
.login-card h1 {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: var(--step-display);
  font-weight: var(--weight-black);
  line-height: 1;
  text-transform: uppercase;
}
.login-card label {
  margin-top: 8px;
  color: var(--text-strong);
  font-size: var(--step-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.login-card input, .model-field select, .option-field input, .option-field select {
  width: 100%;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface-warm);
  color: var(--text-strong);
}
.login-card input { padding: 13px 14px; }
.login-card input:focus, .model-field select:focus, .option-field input:focus,
.option-field select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.login-card .submit-button { margin-top: 20px; }
.login-error, .job-error {
  margin: 5px 0 0;
  color: var(--accent-strong);
  font-size: var(--step-xs);
}

.platform-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
  align-items: end;
  gap: 36px;
  margin-bottom: clamp(38px, 6vw, 64px);
}
.eyebrow {
  display: block;
  grid-column: 1 / -1;
  margin-bottom: -18px;
  color: var(--secondary-deep);
  font-size: var(--step-xs);
  font-weight: var(--weight-medium);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.platform-hero h1 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: var(--weight-black);
  line-height: .88;
  letter-spacing: -.045em;
  text-transform: uppercase;
}
.intro {
  max-width: 390px;
  margin: 0 0 16px;
  color: var(--text);
  font-size: var(--step-body);
  line-height: 1.7;
}
.logout-button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: var(--step-xs);
  font-weight: var(--weight-medium);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.workspace.is-image-generation { grid-template-columns: 1fr; }
.panel { min-width: 0; padding: clamp(22px, 3vw, 34px); }
.panel + .panel { border-left: 1px solid var(--border-card); }
.workspace.is-image-generation .panel + .panel { border-left: 0; }
.panel-heading, .result-heading, .job-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.panel-heading { margin-bottom: 22px; }
.panel-heading h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: var(--step-small);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.step {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: var(--weight-medium);
}

.drop-zone {
  position: relative;
  display: grid;
  min-height: 420px;
  overflow: hidden;
  place-items: center;
  border: 2px dashed var(--accent-soft);
  border-radius: var(--radius);
  background: var(--surface-warm);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-warm));
}
.panel.is-disabled .drop-zone {
  border-color: var(--border-card);
  background: var(--surface-warm);
  cursor: not-allowed;
  opacity: .48;
}
.panel.is-disabled .drop-zone:hover { border-color: var(--border-card); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-copy {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 24px;
  color: var(--text);
  text-align: center;
}
.drop-copy strong {
  margin: 16px 0 7px;
  color: var(--text-strong);
  font-size: var(--step-body);
}
.drop-copy small, .option-field small, .prompt-footer, .queue-note, .job-specification {
  color: var(--text-muted);
  font-size: 12px;
}
.plus {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font: 32px/1 Arial, sans-serif;
  box-shadow: var(--shadow-accent);
}
#image-preview {
  display: none;
  width: 100%;
  height: 100%;
  max-height: 540px;
  object-fit: contain;
}
.drop-zone.has-image #image-preview, .drop-zone.has-image .change-image { display: block; }
.drop-zone.has-image .drop-copy { display: none; }
.change-image {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: none;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: var(--weight-medium);
}

.prompt-panel { display: flex; flex-direction: column; }
.model-field, .option-field {
  display: grid;
  grid-template-columns: 1fr minmax(150px, auto);
  align-items: center;
  gap: 12px;
  color: var(--text-strong);
  font-size: 12px;
  font-weight: var(--weight-medium);
}
.model-field {
  margin-bottom: 14px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.model-note {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-warm));
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
}
.model-field select, .option-field input, .option-field select {
  min-width: 0;
  padding: 10px 12px;
}
.generation-options, .hedra-options, .image-generation-options {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface-warm);
}
.option-field { grid-template-columns: 120px 1fr; }
.option-field small { grid-column: 2; }
.prompt-guide { display: grid; gap: 10px; margin-bottom: 14px; }
.global-prompt-disclosure, .local-prompt-recommendation {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-card));
}
.global-prompt-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: var(--weight-medium);
  list-style: none;
  text-transform: uppercase;
}
.global-prompt-disclosure summary::-webkit-details-marker { display: none; }
.global-prompt-disclosure summary span { color: var(--accent); font-size: 10px; }
.global-prompt-disclosure[open] summary span { font-size: 0; }
.global-prompt-disclosure[open] summary span::after { content: "Hide prompt"; font-size: 10px; }
.global-prompt-disclosure pre {
  max-height: 310px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-top: 1px solid var(--border-card);
  color: var(--text);
  font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
}
.local-prompt-recommendation { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; }
.local-prompt-recommendation strong { color: var(--text-strong); font-size: 11px; text-transform: uppercase; }
.local-prompt-recommendation p { margin: 4px 0 0; color: var(--text); font-size: 11px; line-height: 1.45; }
.local-prompt-recommendation button {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 10px;
  font-weight: var(--weight-medium);
  text-transform: uppercase;
}
.style-reference-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.style-reference-fieldset legend {
  margin-bottom: 8px;
  color: var(--text-strong);
  font-size: 12px;
  font-weight: var(--weight-medium);
  text-transform: uppercase;
}
.style-reference-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.style-reference-slot {
  position: relative;
  display: grid;
  min-height: 150px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  cursor: pointer;
}
.style-reference-slot input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.style-reference-slot img { width: 100%; height: 150px; object-fit: cover; }
.style-reference-slot span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  left: 6px;
  overflow: hidden;
  padding: 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--text-strong) 78%, transparent);
  color: white;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.style-reference-slot.is-empty { border-style: dashed; }
.style-reference-slot.is-empty img { display: none; }
.style-reference-slot.is-empty span {
  position: static;
  background: transparent;
  color: var(--accent);
  text-align: center;
  white-space: normal;
}
.style-reference-fieldset > small { display: block; margin-top: 7px; color: var(--text-muted); }
.chroma-key-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-strong);
  cursor: pointer;
}
.chroma-key-option input { flex: 0 0 auto; margin-top: 3px; accent-color: var(--accent); }
.chroma-key-option span { display: grid; gap: 3px; }
.chroma-key-option strong { font-size: 12px; text-transform: uppercase; }
.chroma-key-option small { color: var(--text-muted); font-size: 11px; line-height: 1.4; }
textarea {
  width: 100%;
  min-height: 250px;
  flex: 1;
  padding: 18px;
  resize: vertical;
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  outline: none;
  background: var(--surface-warm);
  color: var(--text-strong);
  font-size: var(--step-body);
  line-height: 1.55;
}
textarea::placeholder { color: var(--text-muted); }
textarea:disabled {
  cursor: not-allowed;
  opacity: .48;
}
.prompt-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 10px 0 24px;
}
.submit-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  transition: transform var(--transition-fast), background var(--transition-fast);
}
.submit-button:hover:not(:disabled) {
  background: var(--accent-strong);
  transform: translateY(-2px);
}
.submit-button:disabled { cursor: wait; opacity: .62; }
.button-arrow { font-size: 22px; }

.status-card, .error-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-card));
}
.status-card p, .error-card p { margin: 5px 0 0; font-size: var(--step-xs); }
.spinner {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border: 3px solid var(--accent);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.jobs { margin-top: var(--section-y); }
.result-heading { align-items: end; margin-bottom: 22px; }
.result-heading h2 {
  margin: 0;
  color: var(--accent);
  font-size: var(--step-h2);
  font-weight: var(--weight-black);
  text-transform: uppercase;
}
.job-list { display: grid; gap: 18px; }
.job-card { padding: 22px; border-radius: var(--radius); }
.job-card[data-status="running"] { border-color: var(--accent-soft); }
.job-card[data-status="error"] {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-card));
}
.job-heading { align-items: start; }
.job-model {
  color: var(--accent);
  font-size: 11px;
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.job-prompt { margin: 7px 0 0; color: var(--text-strong); font-size: var(--step-body); }
.job-specification { display: block; margin-top: 8px; text-transform: uppercase; }
.job-state {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--text-strong);
  font-size: 10px;
  font-weight: var(--weight-medium);
  text-transform: uppercase;
}
.job-output:not(:empty) { margin-top: 18px; }
.job-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.job-output .download-link { display: inline-block; margin-bottom: 12px; }
.job-actions .download-link { margin-bottom: 0; }
.download-link { color: var(--accent); font-size: var(--step-small); font-weight: var(--weight-medium); }
.animate-image-button {
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: var(--weight-medium);
}
.animate-image-button:hover:not(:disabled) { background: var(--accent-strong); }
.animate-image-button:disabled { cursor: wait; opacity: .62; }
.job-output video {
  display: block;
  width: 100%;
  max-height: 74vh;
  border-radius: var(--radius);
  background: var(--text-strong);
  box-shadow: var(--shadow-card);
}
.job-output img {
  display: block;
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--surface-warm);
  box-shadow: var(--shadow-card);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .platform-hero, .workspace { grid-template-columns: 1fr; }
  .panel + .panel { border-top: 1px solid var(--border-card); border-left: 0; }
}
@media (max-width: 768px) {
  .shell { width: calc(100% - (2 * var(--edge))); padding-top: 210px; }
  .login-shell { padding-top: 210px; }
  .platform-hero h1 { font-size: clamp(42px, 13vw, 68px); }
  .panel { padding: 18px; }
  .drop-zone { min-height: 310px; }
  textarea { min-height: 220px; }
}
@media (max-width: 480px) {
  .shell, .login-shell { padding-top: 240px; }
  .model-field, .option-field { grid-template-columns: 1fr; }
  .option-field small { grid-column: 1; }
  .style-reference-grid { grid-template-columns: 1fr; }
  .local-prompt-recommendation { align-items: flex-start; flex-direction: column; }
  .prompt-footer, .result-heading, .job-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .job-actions { align-items: flex-start; flex-direction: column; }
}
