:root {
  color-scheme: light;
  --ink: #1d2524;
  --muted: #6a7471;
  --line: #dce3df;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: #ffffff;
  --accent: #2f7d6b;
  --accent-strong: #1f5d50;
  --warm: #d99d64;
  --danger: #a84d4d;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(145deg, #e9efe9 0%, #f6eee3 54%, #dce8e5 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(430px, 1fr) 320px;
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.sidebar,
.qa-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand-block,
.panel,
.stage-toolbar,
.action-dock,
.drop-zone {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--panel);
  box-shadow: 0 16px 42px rgba(45, 60, 56, 0.12);
  backdrop-filter: blur(18px);
}

.brand-block,
.panel {
  border-radius: 8px;
  padding: 18px;
}

.brand-block h1,
.stage-toolbar h2,
.panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand-block h1 {
  max-width: 10ch;
  font-size: 31px;
  line-height: 1.04;
}

.panel h2 {
  margin-bottom: 12px;
  font-size: 14px;
}

.stage-toolbar h2 {
  font-size: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lede {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.library-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 11px;
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 780;
  text-decoration: none;
}

.brand-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.brand-links .library-link {
  margin-top: 0;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.segment,
.action-button,
.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 8px;
  transition:
    transform 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.segment {
  background: #eef4f0;
  color: var(--muted);
  font-weight: 680;
}

.segment.active,
.primary-button {
  background: var(--accent);
  color: white;
}

.action-list {
  display: grid;
  gap: 10px;
}

.action-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 12px;
  background: #f3f6f2;
  color: var(--ink);
  text-align: left;
}

.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.action-button[aria-pressed="true"] small {
  color: var(--accent-strong);
}

.action-button.active {
  outline: 2px solid var(--accent);
  background: #e6f1eb;
}

.action-button small {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 780;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
}

input[type="range"] {
  accent-color: var(--accent);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wide-button {
  width: 100%;
  margin-top: 10px;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.secondary-button {
  background: #eef1ed;
  color: var(--ink);
}

.upload-card {
  display: grid;
  gap: 8px;
  min-height: 80px;
  border: 1px dashed #b9c8c1;
  border-radius: 8px;
  padding: 14px;
  background: #f8faf7;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.upload-card input {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
}

.pipeline-steps {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.28;
}

.pipeline-steps li.done {
  color: var(--accent-strong);
  font-weight: 760;
}

.pipeline-steps li.active {
  color: var(--ink);
  font-weight: 800;
}

.pipeline-steps li.error {
  color: var(--danger);
  font-weight: 800;
}

.stage-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  gap: 14px;
  min-width: 0;
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  padding: 16px 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f1f5ee;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 740;
}

.stage {
  position: relative;
  display: grid;
  place-items: end center;
  overflow: hidden;
  min-height: 520px;
  border-radius: 8px;
  border: 1px solid rgba(60, 70, 66, 0.16);
  box-shadow: 0 24px 80px rgba(44, 56, 52, 0.22);
}

.stage::before,
.stage::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.stage::after {
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(25, 29, 28, 0.12));
}

.living-room {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.36) 0 4px, transparent 4px 100%),
    linear-gradient(180deg, transparent 0 60%, rgba(140, 97, 66, 0.2) 60% 100%),
    linear-gradient(145deg, #d8b38b 0%, #f0d8b8 42%, #9fc3b8 43%, #e6eee5 100%);
  background-size:
    42px 42px,
    100% 100%,
    100% 100%;
}

.living-room::before {
  right: 7%;
  bottom: 31%;
  width: 24%;
  height: 30%;
  border-radius: 8px 8px 0 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.45) 0 48%, transparent 48% 52%, rgba(255, 255, 255, 0.45) 52% 100%),
    #547d73;
  box-shadow: 0 18px 0 #9a6947;
}

.garden {
  background:
    linear-gradient(180deg, #b8dcf0 0%, #dff2f2 44%, #93bd78 45%, #6f9e5d 100%);
}

.garden::before {
  left: 8%;
  bottom: 25%;
  width: 22%;
  height: 34%;
  border-radius: 50% 50% 8px 8px;
  background: #47774f;
  box-shadow:
    30px -22px 0 #5d8f61,
    54px 12px 0 #386840,
    34px 120px 0 -14px #765839;
}

.bedroom {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 45%),
    linear-gradient(145deg, #c5d3df 0%, #eef0ef 50%, #cfae93 51%, #e2c6ae 100%);
}

.bedroom::before {
  left: 8%;
  bottom: 32%;
  width: 34%;
  height: 18%;
  border-radius: 8px;
  background: #f7f4ee;
  box-shadow:
    0 24px 0 #a9776d,
    150px -20px 0 -28px #efe1d0;
}

#petCanvas {
  position: relative;
  z-index: 1;
  width: min(72vh, 72vw, 720px);
  max-width: 100%;
  aspect-ratio: 1;
}

.action-dock {
  border-radius: 8px;
  padding: 14px;
}

.action-dock-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.action-dock-heading h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.action-dock-heading > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  text-align: right;
}

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

.action-groups {
  display: grid;
  gap: 14px;
}

.action-group {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.action-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.action-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.action-group-label small {
  font-size: 11px;
  font-weight: 680;
}

.action-group.current .action-group-label {
  color: var(--accent-strong);
}

.transition-button {
  border: 1px solid #cbd8d2;
  background: #edf3ef;
}

.action-grid .action-button {
  min-width: 0;
  min-height: 48px;
  padding: 0 10px;
}

.action-grid .action-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-zone {
  position: relative;
  display: grid;
  gap: 4px;
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
}

.generated-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.generated-strip figure {
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(60, 70, 66, 0.16);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-strong);
}

.generated-strip figcaption {
  padding: 9px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.generated-strip img,
.generated-strip video {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: #eff3ef;
}

.drop-zone strong {
  color: var(--ink);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-zone.dragging {
  outline: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.94);
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.metric-grid div {
  min-height: 78px;
  border-radius: 8px;
  background: #f4f6f2;
  padding: 12px;
}

.metric-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.metric-grid dd {
  margin: 8px 0 0;
  font-size: 20px;
  font-weight: 800;
}

.check-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  margin: 11px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.32;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

textarea {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fbfcfa;
  line-height: 1.45;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 260px minmax(360px, 1fr);
  }

  .qa-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .stage {
    min-height: 440px;
  }

  .qa-panel {
    grid-template-columns: 1fr;
  }

  .generated-strip {
    grid-template-columns: 1fr;
  }

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

  .action-dock-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .action-dock-heading > span {
    text-align: left;
  }

  .stage-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}
