:root {
  color-scheme: light;
  --ink: #151716;
  --muted: #66706b;
  --paper: #f5f7f6;
  --panel: #ffffff;
  --line: #dbe2de;
  --charcoal: #252826;
  --teal: #006d77;
  --teal-soft: #d9f0ee;
  --coral: #c8504a;
  --gold: #b7791f;
  --plum: #623b5a;
  --sky: #e8f2ff;
  --shadow: 0 24px 70px rgba(21, 23, 22, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(135deg, rgba(0, 109, 119, 0.08), transparent 28%),
    linear-gradient(315deg, rgba(200, 80, 74, 0.08), transparent 34%),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 46px);
  color: #fff;
  background: rgba(21, 23, 22, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--plum));
  font-size: 0.88rem;
  font-weight: 950;
}

.topbar h1,
.panel-heading h2,
.lookbook-copy h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.05;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-pill,
.weather-badge,
.summary-bar span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}

.status-pill {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.icon-button,
.small-button,
.primary-button,
.shop-link,
.chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  text-decoration: none;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.icon-button:hover,
.small-button:hover,
.primary-button:hover,
.shop-link:hover,
.chip-button:hover {
  transform: translateY(-1px);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 450px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 32px);
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
}

.brief-panel,
.results-panel {
  min-width: 0;
}

.brief-panel {
  position: sticky;
  top: 86px;
  align-self: start;
  max-height: calc(100vh - 106px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.panel-heading {
  padding: 22px 22px 0;
}

.panel-heading h2,
.lookbook-copy h2 {
  font-size: clamp(1.35rem, 2vw, 2.25rem);
  line-height: 1.08;
}

.stylist-form {
  display: grid;
  gap: 14px;
  padding: 18px 22px 22px;
}

.form-section {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

label,
.choice-group legend {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.choice-group {
  margin: 0;
  border: 0;
  padding: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fbfcfb;
  outline: none;
  text-transform: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 109, 119, 0.14);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.segment-option {
  display: block;
  text-transform: none;
}

.segment-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segment-option span {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 850;
}

.segment-option input:checked + span {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.segment-option input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(0, 109, 119, 0.18);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-button {
  min-height: 34px;
  border: 1px solid var(--line);
  padding: 0 10px;
  color: var(--charcoal);
  background: var(--sky);
  font-size: 0.82rem;
  font-weight: 800;
}

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

.small-button {
  min-height: 44px;
  border: 0;
  padding: 0 13px;
  color: #fff;
  background: var(--charcoal);
}

.primary-button {
  width: 100%;
  min-height: 54px;
  border: 0;
  padding: 0 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--plum));
  font-weight: 950;
}

.primary-button:disabled,
.small-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.imported-list {
  display: grid;
  gap: 8px;
}

.imported-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 9px 10px;
  background: #f8fbf9;
  color: var(--ink);
  font-size: 0.88rem;
  text-transform: none;
}

.results-panel {
  display: grid;
  gap: 18px;
}

.lookbook-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(320px, 1.25fr);
  gap: 18px;
  align-items: stretch;
}

.lookbook-copy {
  display: grid;
  align-content: end;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 28px);
  background: #fff;
  box-shadow: var(--shadow);
}

.hero-media {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-media img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  display: block;
  filter: saturate(0.94) contrast(1.02);
}

.hero-overlay {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.weather-badge {
  color: #fff;
  background: rgba(21, 23, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
}

.summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.summary-bar span {
  color: var(--charcoal);
  background: var(--teal-soft);
  border: 1px solid rgba(0, 109, 119, 0.14);
  font-size: 0.82rem;
  font-weight: 850;
}

.outfit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.empty-state,
.outfit-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-state p {
  margin-top: 8px;
  color: var(--muted);
}

.outfit-card {
  display: grid;
  overflow: hidden;
}

.outfit-visual {
  position: relative;
  min-height: 210px;
}

.outfit-image {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #dfe5e2;
}

.score {
  position: absolute;
  left: 12px;
  top: 12px;
  border-radius: 999px;
  padding: 6px 10px;
  color: #fff;
  background: var(--coral);
  font-size: 0.76rem;
  font-weight: 950;
}

.outfit-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.outfit-label {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.outfit-card h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.22;
}

.outfit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.outfit-meta span {
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--charcoal);
  background: #eef3f1;
  font-size: 0.75rem;
  font-weight: 850;
}

.item-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.item-list li {
  display: grid;
  gap: 2px;
  border-top: 1px solid #edf0ef;
  padding-top: 8px;
}

.item-name {
  color: var(--ink);
  font-weight: 900;
}

.item-detail {
  color: var(--muted);
  font-size: 0.83rem;
}

.rationale {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
}

.shop-link {
  min-height: 40px;
  border: 0;
  padding: 0 12px;
  color: #fff;
  background: var(--charcoal);
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  background: var(--charcoal);
  box-shadow: var(--shadow);
}

@media (max-width: 1120px) {
  .workspace,
  .lookbook-hero {
    grid-template-columns: 1fr;
  }

  .brief-panel {
    position: static;
    max-height: none;
  }

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

@media (max-width: 720px) {
  .topbar,
  .topbar-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .status-pill {
    width: 100%;
  }

  .status-pill {
    justify-content: center;
    min-width: 0;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }

  .field-row,
  .inline-action,
  .outfit-grid,
  .segmented-grid {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 14px;
  }

  .lookbook-copy,
  .hero-media,
  .hero-media img {
    min-height: 220px;
  }
}
