:root {
  --bg: #f4f1ea;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #ffffff;
  --line: #ddd6ca;
  --line-strong: #c8bdad;
  --ink: #1f1b16;
  --muted: #6c6458;
  --accent-color: #6b8f61;
  --shadow: 0 12px 40px rgba(24, 18, 10, 0.08);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 8px 4px 24px;
}

.topbar h1,
.style-overview h2,
.section-header h3,
.panel-heading h3 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-weight: 600;
}

.topbar h1 {
  font-size: 34px;
  line-height: 1.2;
}

.topbar-meta {
  max-width: 520px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(221, 214, 202, 0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.style-rail {
  position: sticky;
  top: 20px;
  align-self: start;
  padding: 20px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(221, 214, 202, 0.9);
  border-radius: 22px;
  max-height: calc(100vh - 52px);
  overflow-y: auto;
}

.rail-head {
  padding-bottom: 16px;
}

.rail-head h2 {
  margin: 0;
  font-size: 18px;
}

.rail-head p,
.muted-copy {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.style-list {
  display: grid;
  gap: 12px;
}

.style-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.style-card:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 27, 22, 0.12);
  background: rgba(255, 255, 255, 0.64);
}

.style-card.active {
  background: rgba(255, 255, 255, 0.88);
  border-color: color-mix(in srgb, var(--style-accent) 36%, white);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.style-card img {
  width: 76px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
}

.style-card-copy {
  min-width: 0;
}

.style-card-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.style-card-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.content-pane {
  display: grid;
  gap: 20px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 360px;
  gap: 20px;
}

.style-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  padding: 24px;
}

.overview-copy {
  display: grid;
  align-content: start;
  gap: 16px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
}

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

.meta-tag,
.palette-chip,
.priority-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.meta-tag {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
}

.palette-chip {
  color: color-mix(in srgb, var(--accent-color) 52%, black);
  background: color-mix(in srgb, var(--accent-color) 14%, white);
  border: 1px solid color-mix(in srgb, var(--accent-color) 26%, white);
}

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

.facts-grid div {
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.facts-grid dt {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.facts-grid dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.overview-image-wrap {
  min-width: 0;
}

.overview-image {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  border-radius: 14px;
}

.budget-panel {
  padding: 24px;
}

.panel-heading,
.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.panel-heading.compact {
  margin-bottom: 16px;
}

.ghost-button {
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  cursor: pointer;
}

.ghost-button:hover {
  background: #fff;
}

.budget-amount {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 18px 0 8px;
}

.budget-amount span {
  color: var(--muted);
  font-size: 14px;
}

.budget-amount strong {
  font-size: 34px;
  font-weight: 700;
}

.budget-breakdown {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.budget-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.budget-line strong,
.product-meta strong {
  font-size: 15px;
}

.budget-line span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.bundle-note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.bundle-note p:last-child {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.6;
}

.controls {
  padding: 20px 24px 24px;
}

.control-row {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.control-field {
  display: grid;
  gap: 8px;
}

.control-field span {
  font-size: 13px;
  color: var(--muted);
}

.control-field input,
.control-field select {
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel-strong);
  color: var(--ink);
}

.products-section {
  display: grid;
  gap: 16px;
}

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

.product-card {
  overflow: hidden;
}

.product-image-wrap {
  aspect-ratio: 1.45;
  overflow: hidden;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-copy {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.product-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.product-category {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.product-head h4,
.empty-state h4 {
  margin: 0;
  font-size: 18px;
}

.priority-badge {
  color: color-mix(in srgb, var(--accent-color) 55%, black);
  background: color-mix(in srgb, var(--accent-color) 14%, white);
  border: 1px solid color-mix(in srgb, var(--accent-color) 28%, white);
  flex: none;
}

.product-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.product-actions {
  display: grid;
  gap: 12px;
}

.select-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.select-toggle input {
  margin: 0;
}

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

.link-row a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.link-row a:hover {
  border-color: color-mix(in srgb, var(--accent-color) 36%, white);
  color: color-mix(in srgb, var(--accent-color) 52%, black);
}

.empty-state {
  padding: 28px;
}

@media (max-width: 1180px) {
  .workspace,
  .overview-grid,
  .style-overview {
    grid-template-columns: 1fr;
  }

  .style-rail {
    position: static;
    max-height: none;
    overflow-y: visible;
  }

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

  .control-row,
  .facts-grid,
  .product-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    padding-bottom: 18px;
    flex-direction: column;
    align-items: start;
  }

  .topbar h1 {
    font-size: 28px;
  }

  .style-list {
    grid-template-columns: 1fr;
  }

  .style-card {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .panel,
  .style-rail {
    border-radius: 18px;
  }
}
