:root {
  --ink: #1a1a1a;
  --ink-soft: #3d3d3d;
  --muted: #6b6b6b;
  --line: #d8d4ce;
  --paper: #f7f6f3;
  --panel: #ffffff;
  --accent: #2c4a3e;
  --accent-hover: #1f362d;
  --danger: #8b2e2e;
  --shadow: 0 14px 40px rgba(26, 26, 26, 0.07);
  /* Softer CMS radii (inspired by luciddreamer.com polish, not a clone) */
  --radius: 0.85rem;
  --radius-sm: 0.55rem;
  --radius-pill: 999px;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: "Segoe UI", Candara, "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(26, 26, 26, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 26, 26, 0.035) 1px, transparent 1px),
    radial-gradient(1200px 600px at 10% -10%, rgba(44, 74, 62, 0.07), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(26, 26, 26, 0.04), transparent 50%),
    linear-gradient(180deg, #f0efe9 0%, var(--paper) 45%, #ebe8e2 100%);
  background-size:
    28px 28px,
    28px 28px,
    auto,
    auto,
    auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 2.5rem 2.25rem 2.25rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  line-height: 1.1;
}

.tagline {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.45rem;
}

.field {
  margin-bottom: 1.1rem;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfaf8;
  color: var(--ink);
  font: inherit;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius);
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: 2px solid rgba(44, 74, 62, 0.35);
  border-color: var(--accent);
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  text-decoration: none;
}

a.btn:hover {
  text-decoration: none;
  color: #fff;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  width: auto;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.55rem 1rem;
  font-weight: 500;
}

.btn-secondary:hover {
  background: #f3f1ec;
  color: var(--ink);
}

.error {
  background: #f8ecec;
  color: var(--danger);
  border: 1px solid #e5c8c8;
  border-radius: var(--radius-pill);
  padding: 0.7rem 1rem;
  margin: 0 0 1.1rem;
  font-size: 0.92rem;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.35rem;
  border-bottom: 1px solid rgba(216, 212, 206, 0.9);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
}

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

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  cursor: pointer;
}

.btn-icon:hover {
  background: #f6f3ee;
}

.settings-menu {
  position: relative;
}

.settings-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 40;
  width: min(18.5rem, calc(100vw - 2rem));
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 14px 36px rgba(30, 24, 16, 0.12);
}

.settings-panel-title {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.settings-toggle {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.92rem;
  color: var(--ink);
}

.settings-toggle input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
}

.settings-toggle strong {
  display: block;
  font-weight: 600;
}

.settings-toggle small {
  display: block;
  margin-top: 0.15rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.35;
}

.settings-status {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.topbar .brand {
  font-size: 1.35rem;
  margin: 0;
}

.user {
  color: var(--muted);
  font-size: 0.92rem;
}

.main {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

.hero-copy {
  margin: 0 0 2rem;
  max-width: 38ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.55;
}

.panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 1.55rem 1.5rem;
}

.panel h2 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
}

.panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.footer-note {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.topbar .brand a {
  color: inherit;
  text-decoration: none;
}

.main-wide {
  width: min(820px, 100%);
}

@media (min-width: 960px) {
  .main-wide {
    width: min(1180px, 100%);
  }
}

.topbar-actions .btn.is-active {
  border-color: var(--ink);
  background: #f3f1ec;
  font-weight: 600;
}

.main-library {
  width: min(1480px, 100%);
  padding-top: 2rem;
}

.library-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
}

.library-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.library-head .hero-title,
.library-head .hero-copy {
  margin-bottom: 0;
}

.library-head .hero-copy {
  margin-top: 0.45rem;
  max-width: 48ch;
}

.library-count {
  margin: 0;
  white-space: nowrap;
}

.library-filter {
  margin: 0 0 1rem;
}

.library-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem 0.85rem;
  align-items: end;
  margin: 0 0 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.library-filters .field {
  margin: 0;
}

.library-filters label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.library-filters select {
  width: 100%;
}

.library-filters-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.library-hover-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.35rem 0.15rem 0;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.library-hover-toggle input {
  margin: 0;
  accent-color: var(--accent);
}

.library-hover-toggle:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

.settings-notify-actions {
  margin: 0.35rem 0 0;
  padding: 0 0.15rem;
}

body.library-hover-off .library-hover-overlay {
  display: none !important;
}

.library-facets {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.library-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}

.library-remove-form {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 3;
  margin: 0;
}

.library-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border: 1px solid rgba(139, 46, 46, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--danger);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.library-remove-btn:hover {
  background: rgba(139, 46, 46, 0.08);
}

.library-card.is-good {
  border-color: rgba(46, 125, 70, 0.45);
}

.library-card.is-reject {
  border-color: rgba(160, 70, 70, 0.4);
  opacity: 0.88;
}

.library-thumb {
  position: relative;
  display: block;
  background: #f3f1ec;
}

.library-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.library-chip {
  position: absolute;
  left: 0.45rem;
  top: 0.45rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.library-meta {
  display: grid;
  gap: 0.2rem;
  padding: 0.55rem 0.65rem 0.7rem;
}

.library-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  min-width: 0;
}

.library-meta-top strong {
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-job {
  margin: 0;
  display: grid;
  gap: 0.05rem;
  font-size: 0.78rem;
  line-height: 1.3;
  min-width: 0;
}

.library-job a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-job-id {
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-card .result-engine {
  margin: 0;
  padding: 0;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-model-history {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-duration {
  margin: 0;
  font-size: 0.7rem;
  color: var(--muted);
}

.library-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-top: 0.25rem;
  font-size: 0.72rem;
}

.library-actions a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.library-mark-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
}

.library-mark-form .btn {
  min-height: 1.7rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
}

.library-flash {
  margin: 0 0 0.85rem;
}

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

.main-plan {
  width: min(920px, 100%);
}

.plan-chat-panel {
  display: grid;
  gap: 0.85rem;
}

.plan-messages {
  display: grid;
  gap: 0.75rem;
  max-height: min(52vh, 520px);
  overflow: auto;
  padding: 0.85rem;
  border: 1px solid var(--line);
  background: #f7f5f1;
}

.plan-msg {
  display: grid;
  gap: 0.2rem;
  max-width: 85%;
}

.plan-msg-user {
  justify-self: end;
  text-align: right;
}

.plan-msg-assistant {
  justify-self: start;
}

.plan-msg-who {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan-msg p {
  margin: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  background: #fff;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 0.95rem;
}

.plan-msg-user p {
  background: #eef3f0;
}

.plan-compose {
  display: grid;
  gap: 0.55rem;
}

.plan-compose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.plan-result-panel .cta-row {
  margin-top: 0.75rem;
}

.train-upload-panel,
.train-upload-form {
  display: grid;
  gap: 0.75rem;
}

.train-tools-panel > summary {
  cursor: pointer;
  list-style: none;
  font-size: 1rem;
}

.train-tools-panel > summary::-webkit-details-marker {
  display: none;
}

.train-tools-panel[open] > summary {
  margin-bottom: 0.75rem;
}

.train-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: end;
  margin: 0.35rem 0 0.85rem;
}

.train-filter-q {
  flex: 1 1 16rem;
  margin: 0;
}

.train-filter-selected {
  margin-bottom: 0.35rem;
}

.train-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: 0.35rem 0 0.85rem;
}

.train-grid-compact .library-meta-top strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.train-caption-details {
  margin: 0.35rem 0;
}

.train-caption-details > summary {
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.train-caption-details[open] > summary {
  margin-bottom: 0.35rem;
}

.train-catalogs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.65rem 0 0.85rem;
}

.train-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.train-catalog-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  background: #f7f5f1;
  min-width: 0;
}

.train-catalog-card strong {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.train-card.is-selected {
  border-color: rgba(46, 125, 70, 0.5);
}

.train-caption-label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.train-caption {
  width: 100%;
  min-height: 4.2rem;
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
}

.train-thumb-empty {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  color: var(--muted);
  font-size: 0.85rem;
  background: #efece6;
}

.step-cache-block {
  margin-top: 1.15rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.step-cache-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.step-cache-summary::-webkit-details-marker {
  display: none;
}

.step-cache-summary::before {
  content: '▸';
  display: inline-block;
  width: 0.9rem;
  color: var(--muted);
  transition: transform 0.12s ease;
}

.step-cache-block[open] > .step-cache-summary::before {
  transform: rotate(90deg);
}

.step-cache-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.step-cache-block[open] .step-cache-grid {
  margin-top: 0.65rem;
}

.step-cache-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.step-cache-card .btn {
  margin: 0 0.55rem 0.55rem;
}

.library-hover-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  pointer-events: none;
  background: rgba(26, 26, 26, 0.42);
}

.library-hover-overlay[hidden] {
  display: none !important;
}

.library-hover-frame {
  margin: 0;
  width: min(1100px, 92vw);
  max-height: min(88vh, 100%);
  display: grid;
  gap: 0.55rem;
  justify-items: center;
}

.library-hover-frame img {
  display: block;
  max-width: 100%;
  max-height: min(80vh, 100%);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #f3f1ec;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.library-hover-frame figcaption {
  max-width: 52ch;
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.88rem;
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

@media (hover: hover) and (pointer: fine) {
  .library-thumb {
    cursor: zoom-in;
  }
}

@media (max-width: 720px) {
  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }
}

@media (min-width: 1280px) {
  .library-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

.job-topbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.job-topbar .cta-row {
  margin: 0.35rem 0 0;
}

.job-topbar .footer-note {
  margin-top: 0.65rem;
}

.job-panel-actions {
  background: #eef3f0;
  border-color: #c9d5ce;
}

.job-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.job-panel {
  padding: 1.5rem 1.4rem 1.65rem;
}

.job-panel-status {
  background: #eef3f0;
  border-color: #c9d5ce;
}

@media (min-width: 720px) {
  .job-topbar {
    flex-direction: row;
    align-items: stretch;
    gap: 1.25rem;
  }

  .job-topbar .job-panel-actions,
  .job-topbar .job-panel-status {
    flex: 1 1 0;
    min-width: 0;
  }
}

.job-panel-info {
  background: var(--panel);
}

.job-panel-beelden {
  background: #faf9f6;
  border-color: #d8d4ce;
}

.job-panel-furnish {
  grid-column: 1 / -1;
  background: #f3f0ea;
  border-color: #d4cfc4;
}

.job-panel-furnish .help {
  margin: 0 0 0.75rem;
}

.job-panel-layers {
  grid-column: 1 / -1;
  background: #f0f2f4;
  border-color: #c5ccd4;
}

.job-panel-layers .help {
  margin: 0 0 0.75rem;
}

.fl-base-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
}

.fl-base-choice {
  display: flex;
  flex-direction: column;
  width: 7.5rem;
  padding: 0;
  border: 1px solid #c5ccd4;
  background: #fff;
  color: #2c3a42;
  cursor: pointer;
  text-align: left;
}

.fl-base-choice img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #ddd;
}

.fl-base-choice-label {
  display: block;
  padding: 0.3rem 0.4rem 0.4rem;
  font-size: 0.72rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fl-base-choice-label em {
  font-style: normal;
  margin-left: 0.25rem;
  color: #1f6b3a;
  font-weight: 600;
}

.fl-base-choice:hover {
  border-color: #9aa5ae;
}

.fl-base-choice.is-active {
  outline: 2px solid #2c3a42;
  outline-offset: 0;
  border-color: #2c3a42;
}

.fl-workspace {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  width: min(100%, 1008px);
  margin: 0 0 0.85rem;
}

.fl-object-rail {
  flex: 0 0 11.5rem;
  width: 11.5rem;
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem;
  border: 1px solid #c5ccd4;
  background: #eef1f3;
  box-sizing: border-box;
}

.fl-object-rail[hidden] {
  display: none !important;
}

.fl-object-rail.is-collapsed .fl-object-rail-hint,
.fl-object-rail.is-collapsed .fl-object-list,
.fl-object-rail.is-collapsed .fl-object-rail-actions {
  display: none !important;
}

.fl-object-rail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.fl-submit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.35rem;
}

.fl-object-rail.is-collapsed {
  flex-basis: auto;
  width: auto;
  max-height: none;
}

.fl-object-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.fl-object-rail-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 650;
}

.fl-object-rail-hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.3;
}

.fl-object-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.fl-object-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  margin: 0;
  padding: 0.3rem 0.35rem;
  border: 1px solid #c5ccd4;
  background: #fff;
  color: #2c3a42;
  text-align: left;
  cursor: pointer;
  font-size: 0.78rem;
  line-height: 1.25;
}

.fl-object-item:hover {
  border-color: #9aa5ae;
  background: #f5f7f8;
}

.fl-object-item.is-selected {
  outline: 2px solid #2c3a42;
  outline-offset: 0;
  border-color: #2c3a42;
  background: #e4e9ec;
  font-weight: 650;
}

.fl-object-swatch {
  flex: 0 0 0.7rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
}

.fl-object-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-panel-layers.is-fl-fullscreen .fl-object-rail {
  background: #1f2529;
  border-color: #3d474e;
  color: #e8ecef;
  max-height: 100%;
  align-self: stretch;
}

.job-panel-layers.is-fl-fullscreen .fl-object-rail-title,
.job-panel-layers.is-fl-fullscreen .fl-object-rail-hint {
  color: #c5ccd4;
}

.job-panel-layers.is-fl-fullscreen .fl-object-item {
  background: #2f383e;
  border-color: #4a555c;
  color: #e8ecef;
}

.job-panel-layers.is-fl-fullscreen .fl-object-item:hover {
  background: #3a444b;
}

.job-panel-layers.is-fl-fullscreen .fl-object-item.is-selected {
  outline-color: #e8ecef;
  border-color: #e8ecef;
  background: #455058;
}

.job-panel-layers .panel-head-row {
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.job-panel-layers .fl-fullscreen-btn {
  margin-left: auto;
}

body.fl-layers-fullscreen {
  overflow: hidden;
}

/* Mask-edit focus: only image + tools (+ thin chrome / status). */
.job-panel-layers.is-fl-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 50;
  margin: 0;
  border: none;
  border-radius: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  padding: 0.45rem 0.55rem 0.55rem;
  background: #2a3136;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.job-panel-layers.is-fl-fullscreen > .help,
.job-panel-layers.is-fl-fullscreen > .field,
.job-panel-layers.is-fl-fullscreen > .btn,
.job-panel-layers.is-fl-fullscreen > .fl-list-title,
.job-panel-layers.is-fl-fullscreen > .fl-layer-list,
.job-panel-layers.is-fl-fullscreen > .footer-note:not([data-fl-status]) {
  display: none !important;
}

/* Keep Beelden base picker visible in mask-fullscreen so Versie 1 / Tweaks stay selectable. */
.job-panel-layers.is-fl-fullscreen > .fl-base-picker {
  display: flex !important;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 0.4rem;
  margin: 0 0 0.4rem;
  padding: 0 0.15rem;
  overflow-x: auto;
  max-width: 100%;
}

.job-panel-layers.is-fl-fullscreen .fl-base-choice {
  width: 6.25rem;
  background: #1f2529;
  border-color: #4a555c;
  color: #e8ecef;
  flex: 0 0 auto;
}

.job-panel-layers.is-fl-fullscreen .fl-base-choice-label {
  color: #e8ecef;
}

.job-panel-layers.is-fl-fullscreen .fl-base-choice.is-active {
  outline-color: #e8ecef;
  border-color: #e8ecef;
}

.job-panel-layers.is-fl-fullscreen > .panel-head-row {
  flex: 0 0 auto;
  margin: 0 0 0.35rem;
  padding: 0;
  min-height: 0;
}

.job-panel-layers.is-fl-fullscreen > .panel-head-row h2,
.job-panel-layers.is-fl-fullscreen > .panel-head-row .panel-head-note {
  display: none;
}

.job-panel-layers.is-fl-fullscreen .fl-fullscreen-btn {
  margin-left: 0;
}

.job-panel-layers.is-fl-fullscreen .fl-workspace {
  width: 100%;
  max-width: none;
  flex: 1 1 auto;
  min-height: 0;
  align-items: center;
  justify-content: center;
  margin: 0;
  gap: 0.4rem;
}

.job-panel-layers.is-fl-fullscreen .fl-toolbar {
  position: static;
  align-self: center;
  max-height: 100%;
  overflow: auto;
  background: #1f2529;
  border-color: #3d474e;
}

.job-panel-layers.is-fl-fullscreen .fl-tool-btn {
  background: #2f383e;
  border-color: #4a555c;
  color: #e8ecef;
}

.job-panel-layers.is-fl-fullscreen .fl-tool-btn:hover {
  background: #3a444b;
  border-color: #6a757c;
}

.job-panel-layers.is-fl-fullscreen .fl-tool-btn.is-active {
  outline-color: #e8ecef;
  background: #455058;
}

.job-panel-layers.is-fl-fullscreen .fl-tool-btn:disabled {
  opacity: 0.3;
}

.job-panel-layers.is-fl-fullscreen .fl-toolbar-sep {
  background: #4a555c;
}

/* Stage must match the image box (not letterbox). Mask/overlay are absolute
   inset:0 on .fl-stage — centering only the base canvas desyncs Objecten. */
.job-panel-layers.is-fl-fullscreen .fl-stage {
  display: block;
  position: relative;
  flex: 0 1 auto;
  box-sizing: border-box;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-width: calc(100% - 3.25rem);
  max-height: 100%;
  /* aspect-ratio set inline from JS — sizes the stage; layers fill it 1:1 */
  overflow: hidden;
  background: #1a1f23;
  border-color: #3d474e;
}

.job-panel-layers.is-fl-fullscreen .fl-stage .fl-base {
  display: block;
  width: 100%;
  height: 100%;
}

.job-panel-layers.is-fl-fullscreen .fl-stage .fl-stamp,
.job-panel-layers.is-fl-fullscreen .fl-stage .fl-mask,
.job-panel-layers.is-fl-fullscreen .fl-stage .fl-overlay {
  width: 100%;
  height: 100%;
}

.job-panel-layers.is-fl-fullscreen > [data-fl-status] {
  flex: 0 0 auto;
  margin: 0.35rem 0 0;
  min-height: 1.15em;
  color: #c5ccd4;
  font-size: 0.85rem;
}

.fl-toolbar {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 0.3rem;
  align-items: center;
  padding: 0.3rem;
  border: 1px solid #c5ccd4;
  background: #eef1f3;
  position: sticky;
  top: 0.5rem;
}

.fl-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid #c5ccd4;
  background: #fff;
  color: #2c3a42;
  cursor: pointer;
  line-height: 0;
}

.fl-tool-btn svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fl-tool-btn:hover {
  background: #f5f7f8;
  border-color: #9aa5ae;
}

.fl-tool-btn.is-active {
  outline: 2px solid #2c3a42;
  outline-offset: 0;
  background: #e4e9ec;
}

.fl-tool-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.fl-tool-btn-labeled {
  flex-direction: column;
  height: auto;
  min-height: 2.35rem;
  padding: 0.2rem 0.15rem 0.25rem;
  gap: 0.05rem;
}

.fl-tool-btn-labeled svg {
  width: 1.05rem;
  height: 1.05rem;
}

.fl-tool-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  color: inherit;
}

.fl-toolbar-sep {
  width: 1.6rem;
  height: 1px;
  background: #c5ccd4;
  margin: 0.1rem 0;
}

.detect-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0;
}

.detect-chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border: 1px solid #c5ccd4;
  background: #eef1f3;
  color: #2c3a42;
  font-size: 0.85rem;
  line-height: 1.35;
}

.fl-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  width: min(100%, 960px);
  border: 1px solid #c5ccd4;
  background: #ddd;
  touch-action: none;
}

@media (max-width: 640px) {
  .fl-workspace {
    flex-direction: column;
  }

  .fl-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    position: static;
    justify-content: flex-start;
  }

  .fl-toolbar-sep {
    width: 1px;
    height: 1.4rem;
    margin: 0 0.1rem;
  }
}

.fl-stage canvas {
  display: block;
  width: 100%;
  height: auto;
}

.fl-stage .fl-stamp,
.fl-stage .fl-mask,
.fl-stage .fl-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fl-stage .fl-stamp {
  pointer-events: none;
  z-index: 1;
}

.fl-stage .fl-mask {
  cursor: crosshair;
  z-index: 2;
  opacity: 0.01;
}

.fl-stage .fl-overlay {
  pointer-events: none;
  z-index: 3;
  opacity: 0.55;
}

.fl-list-title {
  margin: 1rem 0 0.4rem;
  font-size: 1rem;
}

.fl-layer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.fl-layer-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.45rem 0.5rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid #d0d6dc;
}

.fl-layer-item.is-hidden {
  opacity: 0.55;
}

.fl-layer-thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  background: #e4e8ec;
}

.fl-layer-thumb-empty {
  display: inline-block;
}

.fl-layer-meta p {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
}

.fl-layer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 5.5rem;
}

.fl-layer-actions [data-act="redo"] {
  font-weight: 600;
}

.job-panel-itemlock {
  background: #eef2f0;
  border-color: #c9d5ce;
}

.job-panel-tweaks {
  background: #f1f4f2;
  border-color: #c9d5ce;
}

.job-panel-depth {
  background: #eef3f0;
  border-color: #c9d5ce;
}

.panel-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.35rem;
}

.panel-head-row h2 {
  margin: 0;
}

.panel-head-note {
  margin: 0;
  flex: 1 1 12rem;
  text-align: right;
}

.itemlock-form-wide {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem 1rem;
  align-items: end;
  margin-top: 0.5rem;
}

.itemlock-form-wide .field {
  margin: 0;
  min-width: 0;
}

.itemlock-form-wide textarea {
  min-height: 3.6rem;
  resize: vertical;
}

.itemlock-form-wide .btn {
  width: auto;
  min-width: 10rem;
  align-self: end;
}

.job-panel-history {
  background: #f7f4ef;
  border-color: #d4cfc6;
}

.job-panel-prompt {
  background: #f3f1ec;
  border-color: #d4cfc6;
}

.job-panel-prompt .compiled-prompt {
  color: var(--ink-soft);
  line-height: 1.55;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.job-panel-beelden .section-head {
  margin-bottom: 0.35rem;
}

.job-panel-tweaks .stack-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.job-panel-itemlock .footer-note,
.job-panel-tweaks .footer-note,
.job-panel-depth .footer-note {
  margin-top: 0.25rem;
}

.job-panel p {
  color: var(--ink-soft);
}

@media (min-width: 960px) {
  .job-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "info info"
      "beelden beelden"
      "itemlock itemlock"
      "tweaks depth"
      "history history"
      "prompt prompt";
    gap: 1.15rem;
    align-items: start;
  }

  .job-panel-info {
    grid-area: info;
  }

  .job-panel-beelden {
    grid-area: beelden;
  }

  .job-panel-itemlock {
    grid-area: itemlock;
    padding-top: 1.15rem;
    padding-bottom: 1.15rem;
  }

  .job-panel-itemlock textarea {
    min-height: 3.4rem;
  }

  .job-panel-tweaks #tweak-submit {
    min-height: 2.75rem;
  }

  .job-panel-tweaks {
    grid-area: tweaks;
    min-height: 0;
  }

  .job-panel-depth {
    grid-area: depth;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .job-panel-depth .depth-viewer-mount {
    flex: 1;
    min-height: 0;
  }

  .job-panel-depth .depth-viewer-canvas {
    height: min(38vh, 320px);
  }

  .job-panel-history {
    grid-area: history;
  }

  .job-panel-prompt {
    grid-area: prompt;
  }

  .job-panel-tweaks-solo,
  .job-layout:not(:has(.job-panel-depth)) .job-panel-tweaks {
    grid-column: 1 / -1;
  }

  .job-layout:not(:has(.job-panel-itemlock)) .job-panel-tweaks {
    grid-column: 1 / -1;
  }

  .job-panel {
    padding: 1.35rem 1.45rem 1.45rem;
  }
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.cta-row {
  margin: 0 0 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.inline-form {
  display: inline;
  margin: 0;
}

.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.btn-tiny {
  width: auto;
  min-width: 0;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
}

.btn-inline {
  width: auto;
  min-width: 12rem;
}

.form-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 1.55rem 1.5rem 1.8rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfaf8;
  color: var(--ink);
  font: inherit;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius);
}

select:focus,
textarea:focus {
  outline: 2px solid rgba(44, 74, 62, 0.35);
  border-color: var(--accent);
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 6rem;
}

.job-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.job-list li + li {
  border-top: 1px solid var(--line);
}

.job-list a {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 0;
  color: inherit;
  text-decoration: none;
}

.job-list a:hover strong {
  color: var(--accent);
}

.job-list span {
  color: var(--muted);
  font-size: 0.9rem;
}

.job-list .job-eta {
  color: var(--accent);
  font-weight: 600;
}

.job-list li.is-active {
  background: rgba(44, 74, 62, 0.06);
  margin: 0 -0.75rem;
  padding: 0 0.75rem;
  border-radius: var(--radius);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.badge {
  display: inline-block;
  border: 1px solid var(--line);
  background: #f3f1ec;
  padding: 0.25rem 0.55rem;
  font-size: 0.88rem;
}

.badge-live,
.badge-running,
.badge-queued,
.badge-captioning,
.badge-caption_wait,
.badge-caption_running {
  border-color: rgba(44, 74, 62, 0.35);
  background: rgba(44, 74, 62, 0.1);
  color: var(--accent);
  font-weight: 600;
}

.panel.active-jobs {
  margin: 0 0 1.35rem;
  border-color: rgba(44, 74, 62, 0.28);
  background: linear-gradient(180deg, rgba(44, 74, 62, 0.08), var(--panel) 42%);
  box-shadow: var(--shadow);
}

.active-jobs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.active-jobs-head h2 {
  margin: 0;
}

.active-jobs-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}

.active-job-tile {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 9.5rem;
  padding: 1rem 1.05rem 0.9rem;
  border: 1px solid rgba(44, 74, 62, 0.22);
  border-radius: var(--radius);
  background: #fff;
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.active-job-tile:hover {
  border-color: var(--accent);
  background: #fbfaf8;
}

.active-job-tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.active-job-tile-top strong {
  font-size: 1.02rem;
  line-height: 1.3;
}

.active-job-tile .job-eta {
  margin: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.active-jobs-detail {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.4;
  flex: 1;
}

.active-job-bar {
  height: 4px;
  margin-top: 0.25rem;
  background: rgba(44, 74, 62, 0.12);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.active-job-bar > span {
  display: block;
  height: 100%;
  min-width: 2%;
  background: var(--accent);
}

.active-job-tile-cta {
  margin-top: 0.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

.active-jobs .footer-note {
  margin: 0.85rem 0 0;
}

.job-panel-depth .help {
  margin-top: 0.15rem;
}

.depth-advanced {
  margin: 0.45rem 0 0.25rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.depth-advanced summary {
  cursor: pointer;
  user-select: none;
}

.depth-view-uploads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin: 0.55rem 0 0.35rem;
}

@media (max-width: 720px) {
  .depth-view-uploads {
    grid-template-columns: 1fr;
  }
}

.depth-view-upload label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: 0;
}

.depth-view-upload input[type="file"] {
  display: block;
  max-width: 100%;
  font-size: 0.85rem;
}

.depth-view-upload .footer-note {
  margin: 0.35rem 0 0;
}

.depth-viewer-mount {
  margin-top: 0.55rem;
}

.depth-viewer-shell {
  border: 1px solid var(--line);
  background: #f3f1ec;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.depth-viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: flex-end;
  margin-bottom: 0.65rem;
}

.depth-viewer-toolbar label {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.depth-viewer-toolbar select,
.depth-viewer-toolbar input[type="range"] {
  display: block;
  margin-top: 0.25rem;
  min-width: 10rem;
}

.depth-viewer-canvas {
  width: 100%;
  height: min(52vh, 420px);
  background: #e8e4dc;
  border: 1px solid var(--line);
}

.stack > div + div {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.panel.stack p {
  color: var(--ink-soft);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.section-head h2 {
  margin: 0;
}

.section-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.result-card {
  display: block;
  position: relative;
  border: 1px solid var(--line);
  background: #f3f1ec;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.result-card img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.help {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

/* Compact “i” tips at crucial UI spots */
.rc-info {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 0.35rem;
}

.rc-info-btn {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #faf8f4;
  color: var(--ink-soft);
  font: 650 0.72rem/1 var(--font-ui, inherit);
  user-select: none;
}

.rc-info-btn::-webkit-details-marker {
  display: none;
}

.rc-info-btn::marker {
  content: '';
}

.rc-info[open] > .rc-info-btn,
.rc-info-btn:hover {
  background: #efeae2;
  border-color: #c9c0b4;
  color: var(--ink);
}

.rc-info-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.4rem);
  left: 0;
  width: min(22rem, calc(100vw - 2rem));
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  background: #fffdf9;
  box-shadow: 0 10px 28px rgba(40, 32, 24, 0.12);
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}

.rc-info-panel .rc-info-title {
  margin: 0 0 0.4rem;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.rc-info-panel p,
.rc-info-panel ol {
  margin: 0 0 0.55rem;
}

.rc-info-panel ol {
  padding-left: 1.15rem;
}

.rc-info-panel p:last-child,
.rc-info-panel ol:last-child {
  margin-bottom: 0;
}

.rc-info-inline-label {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.hero-title .rc-info,
.section-head .rc-info,
.panel-head-row .rc-info,
.prop-picks-head .rc-info {
  margin-left: 0.45rem;
}

/* Prefer opening toward the right edge when tip sits far right */
.rc-info.rc-info-end .rc-info-panel {
  left: auto;
  right: 0;
}

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

input[type="file"] {
  width: 100%;
  font: inherit;
  color: var(--ink-soft);
}

.sketch-preview {
  margin-top: 0.85rem;
  border: 1px solid var(--line);
  background: #f3f1ec;
  padding: 0.5rem;
  max-width: 320px;
}

.sketch-preview img,
.sketch-thumb img {
  display: block;
  width: 100%;
  height: auto;
}

.sketch-thumb {
  max-width: 280px;
  margin-top: 0.5rem;
}

.result-label {
  display: block;
  padding: 0.4rem 0.55rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #faf9f7;
}

.result-engine,
.result-duration {
  display: block;
  padding: 0 0.55rem 0.2rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: #faf9f7;
  line-height: 1.35;
}

.result-duration {
  padding-bottom: 0.45rem;
}

.result-engine {
  font-weight: 600;
  color: var(--accent);
}

.gallery-card .result-engine {
  padding: 0.35rem 0.65rem 0.55rem;
  background: #f3f1ec;
}

.processing-card {
  cursor: default;
}

.processing-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background:
    linear-gradient(145deg, #e8e4dc 0%, #f4f1ea 42%, #ddd7cc 100%);
}

.processing-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.55) 48%,
    transparent 66%
  );
  transform: translateX(-60%);
  animation: processing-sheen 2.4s ease-in-out infinite;
}

.processing-room {
  position: absolute;
  inset: 18% 16% 22%;
  opacity: 0.55;
  animation: processing-breathe 2.8s ease-in-out infinite;
}

.pr-wall,
.pr-floor,
.pr-window,
.pr-bed {
  position: absolute;
  display: block;
  background: rgba(44, 74, 62, 0.18);
}

.pr-wall {
  inset: 0 0 28% 0;
  border: 1px solid rgba(44, 74, 62, 0.22);
  background: rgba(255, 255, 255, 0.35);
}

.pr-floor {
  left: 0;
  right: 0;
  bottom: 0;
  height: 28%;
  background: rgba(44, 74, 62, 0.14);
  border-top: 1px solid rgba(44, 74, 62, 0.18);
}

.pr-window {
  top: 12%;
  right: 10%;
  width: 22%;
  height: 28%;
  background: rgba(120, 150, 140, 0.28);
  border: 1px solid rgba(44, 74, 62, 0.2);
}

.pr-bed {
  left: 18%;
  right: 28%;
  bottom: 30%;
  height: 18%;
  background: rgba(44, 74, 62, 0.28);
  border-radius: 2px 2px 0 0;
}

.processing-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2.35rem;
  margin: 0;
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-soft);
  z-index: 1;
}

.processing-dots::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: processing-dots 1.4s steps(4, end) infinite;
}

.processing-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  background: #ddd7cc;
}

.processing-eta {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.65rem;
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--accent);
  z-index: 1;
}

.processing-frame.has-preview .processing-copy,
.processing-frame.has-preview .processing-eta {
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
  background: rgba(247, 244, 239, 0.72);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}


.eta-box {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, #f3f1eb 0%, #ebe7df 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.eta-headline {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.35;
}

.eta-track {
  height: 8px;
  background: rgba(26, 26, 26, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.eta-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent) 0%, #4a7a66 100%);
  border-radius: inherit;
  transition: width 0.6s ease;
}

.eta-detail {
  margin: 0.55rem 0 0.25rem;
}

.eta-stop-form {
  margin: 0.65rem 0 0.25rem;
}

.btn-stop-job {
  color: var(--danger);
  border-color: rgba(139, 46, 46, 0.35);
}

.eta-stopping {
  color: var(--danger);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .eta-fill {
    transition: none;
  }
}

@keyframes processing-sheen {
  0% { transform: translateX(-70%); }
  55% { transform: translateX(70%); }
  100% { transform: translateX(70%); }
}

@keyframes processing-breathe {
  0%, 100% { opacity: 0.42; transform: scale(0.98); }
  50% { opacity: 0.7; transform: scale(1); }
}

@keyframes processing-dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

@media (prefers-reduced-motion: reduce) {
  .processing-sheen,
  .processing-room,
  .processing-dots::after {
    animation: none;
  }

  .processing-sheen {
    opacity: 0.25;
    transform: none;
  }
}

body.gallery-open {
  overflow: hidden;
}

.gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(26, 26, 26, 0.55);
}

.gallery-overlay[hidden] {
  display: none !important;
}

.gallery-dialog {
  width: min(1400px, 100%);
  max-height: min(92vh, 100%);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem 1.25rem;
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  position: sticky;
  top: 0;
  background: var(--panel);
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
  z-index: 1;
}

.gallery-toolbar h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.gallery-card {
  display: block;
  border: 1px solid var(--line);
  background: #f3f1ec;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.gallery-card img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 720px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-overlay {
    padding: 0.65rem;
  }
}

.tweak-box {
  margin-top: 0.25rem;
}

.tweak-box .stack-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.65rem;
}

.tweak-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.tweak-list li + li {
  margin-top: 0.35rem;
}

.tweak-overlay .tweak-dialog {
  width: min(640px, 100%);
}

.tweak-thought {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent, #8b7355);
  background: rgba(139, 115, 85, 0.08);
  color: var(--ink);
  line-height: 1.45;
  font-size: 0.98rem;
}

.tweak-mode-fieldset {
  border: 1px solid var(--line);
  padding: 0.75rem 0.9rem;
  margin: 0 0 0.85rem;
  display: grid;
  gap: 0.55rem;
}

.tweak-mode-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.tweak-confirm-actions {
  margin-top: 0.5rem;
  justify-content: flex-end;
  gap: 0.65rem;
}

.tweak-change-field {
  margin: 0 0 0.85rem;
}

.tweak-change-field input[type="range"] {
  width: 100%;
  margin-top: 0.4rem;
}

.tweak-change-scale {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.prompt-dialog {
  max-width: 42rem;
}

.prompt-dialog textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.45;
  min-height: 12rem;
}

.inline-form {
  display: inline;
}

.rerun-form {
  gap: 0.65rem;
}

.rerun-form .field {
  margin-bottom: 0;
}

.rerun-form .cta-row {
  margin-top: 0.25rem;
}

.check-field {
  margin-top: 0.35rem;
}

.check-field.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.result-card-wrap {
  display: flex;
  flex-direction: column;
}

.result-card-wrap > a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.result-card-wrap.is-good {
  outline: 2px solid rgba(44, 74, 62, 0.45);
}

.result-card-wrap.is-reject {
  outline: 2px solid rgba(139, 46, 46, 0.35);
}

.mark-form {
  display: grid;
  gap: 0.4rem;
  padding: 0.55rem 0.6rem 0.7rem;
  border-top: 1px solid var(--line);
  background: #faf9f7;
}

.mark-note-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
}

.mark-note {
  width: 100%;
  font: inherit;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  background: #fff;
}

.mark-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.mark-actions .btn.is-active {
  outline: 2px solid var(--accent);
}

.remove-result-form {
  margin-top: 0.45rem;
}

.btn-remove-result {
  color: var(--danger);
  border-color: rgba(139, 46, 46, 0.35);
}

.btn-remove-result:hover {
  background: rgba(139, 46, 46, 0.06);
}

.finalize-standpunt-form {
  margin-top: 0.4rem;
}

.btn-finalize-hr {
  width: 100%;
}

.room-camera-field {
  margin-top: 0.5rem;
}

.room-camera {
  margin-top: 0.55rem;
  border: 1px solid var(--line);
  background: #f7f4ef;
  padding: 0.65rem;
}

.room-camera.is-cleared {
  opacity: 0.72;
}

.pose-compass {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.pose-hub {
  min-height: 2.75rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.pose-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.25;
  padding: 0.55rem 0.35rem;
  cursor: pointer;
}

.pose-btn:hover {
  background: #f3efe8;
}

.pose-btn.is-selected {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.pose-btn:disabled,
.pose-btn.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f0ece6;
}

.pose-btn[hidden] {
  display: none !important;
}

.room-camera:not(.is-advanced) .pose-btn-advanced {
  display: none !important;
}

.room-camera-yaw-warn {
  margin: 0.35rem 0 0;
  color: #8a4b1f;
}

.pose-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.pose-row .pose-btn {
  flex: 1 1 5.5rem;
}

.room-camera-hint {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--muted, #6a635a);
}

.room-camera-angles {
  margin: 0.35rem 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.room-camera-readout {
  margin: 0.45rem 0 0.45rem;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.4;
}

.room-camera-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* Voice notes (browser speech → textarea) */
.voice-notes {
  margin-bottom: 0.45rem;
}

.voice-notes-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}

.voice-notes-label {
  margin: 0;
  flex: 1;
}

.voice-notes-btn.is-listening {
  background: #f8ecec;
  border-color: #e5c8c8;
  color: var(--danger);
}

.voice-notes-status {
  margin-top: 0.25rem;
}

/* Editor sticky memos — float over the full page */
.rc-memos {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}

.rc-memos-bar {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 47;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  pointer-events: auto;
  padding: 0.35rem 0.45rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #c5ccd4;
  box-shadow: 0 2px 10px rgba(40, 50, 60, 0.12);
}

.rc-memos-status {
  margin: 0;
  font-size: 0.75rem;
  opacity: 0.75;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rc-memos-board {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 46;
  border: 0;
  background: transparent;
  overflow: visible;
  pointer-events: none;
}

.rc-memos.is-open .rc-memos-board {
  display: block;
}

.rc-memo-empty {
  display: none;
}

.rc-memo-note {
  position: absolute;
  width: 12rem;
  min-height: 8.5rem;
  padding: 0.35rem 0.4rem 0.5rem;
  box-shadow: 0 4px 16px rgba(40, 50, 60, 0.22);
  border: 1px solid rgba(0, 0, 0, 0.08);
  pointer-events: auto;
  z-index: 46;
}

.rc-memo-note.is-dragging {
  z-index: 50;
  opacity: 0.95;
  cursor: grabbing;
}

.rc-memo-note.is-yellow {
  background: #fff3a1;
}

.rc-memo-note.is-mint {
  background: #c8efd6;
}

.rc-memo-note.is-sky {
  background: #cfe6f7;
}

.rc-memo-note.is-rose {
  background: #f7d4d8;
}

.rc-memo-note-head {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: grab;
  margin-bottom: 0.25rem;
  user-select: none;
}

.rc-memo-drag-hint {
  opacity: 0.45;
  font-size: 0.7rem;
  letter-spacing: -0.05em;
}

.rc-memo-colors {
  display: flex;
  gap: 0.2rem;
  flex: 1;
}

.rc-memo-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 0;
  cursor: pointer;
}

.rc-memo-swatch.is-yellow {
  background: #ffe56a;
}

.rc-memo-swatch.is-mint {
  background: #8fd9ad;
}

.rc-memo-swatch.is-sky {
  background: #8ec4e8;
}

.rc-memo-swatch.is-rose {
  background: #e8a8b0;
}

.rc-memo-swatch.is-active {
  outline: 2px solid #2c3a42;
  outline-offset: 1px;
}

.rc-memo-delete {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.55;
  padding: 0 0.15rem;
}

.rc-memo-delete:hover {
  opacity: 1;
}

.rc-memo-text {
  width: 100%;
  min-height: 6.5rem;
  border: 0;
  background: transparent;
  resize: vertical;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #243038;
}

.rc-memo-text:focus {
  outline: none;
}

/* Mobile: bottom sheet instead of free-floating stickies */
@media (max-width: 720px) {
  .rc-memos-bar {
    right: 0.5rem;
    bottom: max(0.5rem, env(safe-area-inset-bottom));
    left: 0.5rem;
    justify-content: flex-end;
  }

  .rc-memos-status {
    max-width: none;
    flex: 1;
    text-align: left;
  }

  .rc-memos.is-mobile.is-open .rc-memos-board {
    display: block;
    pointer-events: auto;
    background: rgba(20, 28, 34, 0.35);
  }

  .rc-memo-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(72vh, 34rem);
    display: flex;
    flex-direction: column;
    background: #f4f6f7;
    border-top: 1px solid #c5ccd4;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -8px 28px rgba(20, 28, 34, 0.2);
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    pointer-events: auto;
  }

  .rc-memo-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem 0.4rem;
    border-bottom: 1px solid #d5dbe0;
  }

  .rc-memo-sheet-list {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.65rem 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }

  .rc-memo-sheet-empty {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #5a6570;
  }

  .rc-memo-note.is-sheet-item {
    position: relative;
    left: auto !important;
    top: auto !important;
    width: 100%;
    min-height: 0;
    box-shadow: 0 1px 4px rgba(40, 50, 60, 0.12);
  }

  .rc-memo-note.is-sheet-item .rc-memo-text {
    min-height: 4.5rem;
    font-size: 1rem;
  }

  .rc-memo-note.is-sheet-item .rc-memo-note-head {
    cursor: default;
  }
}

/* Prop / styling picks (generate + furniture layers) */
.prop-picks {
  display: grid;
  gap: 0.55rem;
}

.prop-picks-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.prop-picks-head label {
  margin: 0;
}

.prop-picks-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.prop-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.4rem;
  align-items: center;
  max-height: 14rem;
  overflow: auto;
  padding: 0.15rem 0;
}

.prop-group-label {
  flex: 1 0 100%;
  margin: 0.45rem 0 0.1rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.prop-group-label:first-child {
  margin-top: 0;
}

.prop-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.2;
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.prop-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.prop-chip.is-on {
  border-color: var(--accent);
  background: rgba(44, 74, 62, 0.08);
  color: var(--accent);
  font-weight: 600;
}

.prop-picks-compact {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.prop-picks-compact .prop-list {
  max-height: 9rem;
}

.prop-picks [data-prop-filter] {
  color: var(--accent);
  font-weight: 650;
}

/* Bibliotheek-refs on generate form */
.train-refs-field {
  display: grid;
  gap: 0.55rem;
}

.train-refs-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.train-ref-card {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  width: min(100%, 36rem);
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.train-ref-thumb {
  flex: 0 0 auto;
  display: block;
  line-height: 0;
}

.train-ref-thumb img,
.train-ref-pick img {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--line);
}

.train-ref-meta {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
}

.train-ref-meta p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.train-ref-caption {
  width: 100%;
  min-height: 4.2rem;
  resize: vertical;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem;
  background: #fff;
}

.train-ref-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.train-refs-picker {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.55rem;
}

.train-refs-picker > summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

.train-refs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.45rem;
  margin-top: 0.55rem;
  max-height: 16rem;
  overflow: auto;
}

.train-ref-pick {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 0.35rem;
  cursor: pointer;
  text-align: left;
  display: grid;
  gap: 0.3rem;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.25;
}

.train-ref-pick:hover {
  border-color: var(--accent);
}

.train-ref-pick.is-on {
  border-color: var(--accent);
  background: rgba(44, 74, 62, 0.08);
  color: var(--accent);
  font-weight: 600;
}

.train-ref-pick img {
  width: 100%;
  height: 88px;
}

.share-users-fieldset {
  display: grid;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  margin: 0.55rem 0;
}

.share-users-fieldset legend {
  padding: 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 650;
}

.result-share-note {
  display: block;
  margin-top: 0.25rem;
}

/* Refs shown with compiled prompt (overlay + job) */
.prompt-refs {
  display: grid;
  gap: 0.45rem;
  margin: 0.35rem 0 0.75rem;
}

.prompt-refs-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 650;
}

.prompt-refs-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.prompt-ref-card {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  width: min(100%, 18rem);
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
}

.prompt-ref-card:hover {
  border-color: var(--accent);
}

.prompt-ref-card img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--line);
  flex: 0 0 auto;
}

.prompt-ref-card span {
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
}

.settings-panel-wide {
  width: min(24rem, calc(100vw - 2rem));
  max-height: min(70vh, 36rem);
  overflow: auto;
}
.settings-rules-help {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}
.settings-rules-list {
  list-style: none;
  margin: 0 0 0.55rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.settings-rules-empty {
  font-size: 0.8rem;
  color: var(--muted);
}
.settings-rules-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: flex-start;
  font-size: 0.84rem;
  line-height: 1.35;
}
.settings-rules-text {
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}
.settings-rules-add {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.settings-rules-add input[type="text"] {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  padding: 0.35rem 0.5rem;
}

.settings-page {
  width: min(760px, 100%);
}
.settings-section {
  margin-bottom: 1.25rem;
}
.settings-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.settings-section-title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.settings-section-head .settings-section-title {
  margin-bottom: 0;
}
.settings-rules-count {
  margin: 0;
  white-space: nowrap;
}
.settings-toggle-page {
  margin-bottom: 0.85rem;
}
.settings-rules-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #faf9f6;
  padding: 0.65rem;
  margin-bottom: 0.85rem;
  min-height: 8rem;
  max-height: none;
  overflow: visible;
}
.settings-rules-list-page {
  margin: 0;
  max-height: none;
  overflow: visible;
}
.settings-rules-list-page .settings-rules-item {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  background: #fff;
}
.settings-rules-list-page .settings-rules-empty {
  padding: 1.25rem 0.5rem;
  text-align: center;
  font-size: 0.9rem;
}
.topbar-actions .btn.is-active {
  border-color: var(--ink);
  background: rgba(30, 24, 16, 0.06);
}
