:root {
  color-scheme: light;
  --ink: #171512;
  --muted: #686760;
  --soft: #8d8980;
  --line: #dedad1;
  --paper: #f7f6f2;
  --panel: #ffffff;
  --panel-alt: #f0f2ef;
  --charcoal: #252525;
  --gold: #b99a5f;
  --gold-soft: #e4d6b7;
  --sage: #617267;
  --blueprint: #40566b;
  --danger: #9b4937;
  --shadow: 0 18px 54px rgba(23, 21, 18, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd {
  margin: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  min-height: 100vh;
}

.side-panel {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.brand span {
  display: grid;
  gap: 4px;
}

.brand strong {
  font-size: 17px;
  line-height: 1.05;
}

.brand small,
.global-search span,
.quick-stock p,
.kicker,
.card-kind {
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.global-search {
  display: grid;
  gap: 8px;
}

.global-search input,
.hero-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.global-search input:focus,
.hero-search input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(185, 154, 95, 0.18);
}

.main-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  text-align: left;
}

.nav-item span {
  color: var(--gold);
  font-weight: 900;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: rgba(185, 154, 95, 0.42);
  color: var(--ink);
  background: var(--panel-alt);
}

.quick-stock {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf9;
}

.quick-stock a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: 9px;
  padding: 0 12px;
  border-radius: 6px;
  color: #fff;
  background: var(--charcoal);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.workspace {
  min-width: 0;
  padding: 20px clamp(18px, 3vw, 44px) 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
}

.topbar h1 {
  margin-top: 5px;
  font-size: clamp(28px, 3.1vw, 46px);
  line-height: 1.02;
  letter-spacing: 0;
}

.top-actions,
.button-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.icon-button,
.primary-button,
.secondary-button,
.round-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-decoration: none;
  font-weight: 900;
}

.icon-button {
  gap: 8px;
  min-width: 64px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

.icon-button:hover,
.secondary-button:hover {
  border-color: var(--gold);
}

.primary-button {
  padding: 0 16px;
  border-color: var(--charcoal);
  color: #fff;
  background: var(--charcoal);
}

.primary-button:hover {
  background: #000;
}

.secondary-button {
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
}

.round-button {
  width: 40px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  font-size: 22px;
}

.hero-band {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 22px;
  align-items: end;
  min-height: 318px;
  margin-top: 10px;
  padding: clamp(24px, 4vw, 48px);
  border-radius: 8px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(15, 15, 14, 0.82), rgba(15, 15, 14, 0.45) 52%, rgba(15, 15, 14, 0.2)),
    url("/assets/hero-stone.jpg") center / cover;
}

.hero-copy {
  max-width: 760px;
}

.hero-copy .kicker {
  color: var(--gold-soft);
}

.hero-copy h2 {
  max-width: 760px;
  margin-top: 10px;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p:not(.kicker) {
  max-width: 620px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 16px;
  line-height: 1.55;
}

.hero-search {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  max-width: 100%;
  margin-top: 0;
}

.hero-search span {
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-search input {
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.hero-search input::placeholder {
  color: rgba(255, 255, 255, 0.78);
}

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

.profile-chip {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  font-weight: 900;
}

.profile-chip:hover,
.profile-chip.is-active {
  border-color: var(--gold-soft);
  color: var(--ink);
  background: var(--gold-soft);
}

.search-results {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.search-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

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

.search-list {
  display: grid;
}

.search-list button {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.search-list button:hover {
  background: var(--panel-alt);
}

.search-list span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.search-list small {
  color: var(--muted);
  line-height: 1.45;
}

#view-root {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

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

.metric {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric strong {
  font-size: clamp(23px, 2.5vw, 34px);
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.profile-path,
.split-band,
.content-band {
  padding: clamp(22px, 3vw, 34px) 0;
}

.profile-path {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-path h2,
.section-heading h2,
.split-band h2,
.tool-panel h2,
.assistant-result h2,
.entry-hero h2 {
  margin-top: 6px;
  font-size: clamp(24px, 2.5vw, 36px);
  line-height: 1.08;
  letter-spacing: 0;
}

.profile-path ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.profile-path li {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.profile-path li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  color: var(--gold);
  font-size: 12px;
}

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

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

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

.card-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hub-card,
.resource-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.hub-card {
  display: grid;
  gap: 12px;
  min-height: 174px;
  padding: 18px;
  color: var(--ink);
}

.hub-card span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  font-weight: 900;
}

.hub-card strong,
.resource-card h3 {
  font-size: 19px;
  line-height: 1.18;
}

.hub-card small,
.resource-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.hub-card:hover,
.resource-card:hover {
  border-color: rgba(185, 154, 95, 0.72);
  box-shadow: 0 14px 34px rgba(23, 21, 18, 0.08);
}

.resource-card {
  display: grid;
  grid-template-rows: minmax(150px, 1fr) auto;
  gap: 18px;
  min-height: 236px;
  padding: 18px;
}

.resource-card.large {
  min-height: 280px;
}

.resource-card > div:first-child {
  display: grid;
  align-content: start;
  gap: 10px;
}

.card-kind {
  color: var(--gold);
}

.card-actions {
  justify-content: space-between;
}

.card-actions button,
.card-actions a {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.card-actions a {
  color: #fff;
  border-color: var(--sage);
  background: var(--sage);
}

.split-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  align-items: stretch;
  border-top: 1px solid var(--line);
}

.split-band p {
  max-width: 780px;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.split-band .button-row {
  margin-top: 18px;
}

.source-panel {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.source-panel h3 {
  font-size: 22px;
  line-height: 1.15;
}

.text-link {
  color: var(--blueprint);
  font-weight: 900;
}

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

.glossary-grid article,
.guide-sections article,
.info-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.glossary-grid h3,
.guide-sections h3,
.info-panel h3 {
  font-size: 17px;
  line-height: 1.2;
}

.glossary-grid p,
.guide-sections p,
.info-panel p,
.info-panel li {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.info-panel ul {
  padding-left: 18px;
}

.entry-layout {
  display: grid;
  gap: 24px;
}

.entry-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 24px;
  align-items: stretch;
  padding: clamp(22px, 3.4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.entry-hero p:not(.kicker) {
  max-width: 760px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.58;
}

.entry-hero .button-row {
  margin-top: 20px;
}

.entry-aside {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
}

.stock-status {
  display: grid;
  gap: 8px;
}

.stock-status strong {
  font-size: 22px;
  line-height: 1.15;
}

.stock-status span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.stock-status a {
  color: var(--blueprint);
  font-weight: 900;
}

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

.spec-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.spec-table div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.spec-table div:last-child {
  border-bottom: 0;
}

.spec-table dt,
.spec-table dd {
  padding: 14px 16px;
}

.spec-table dt {
  color: var(--muted);
  font-weight: 900;
  background: var(--panel-alt);
}

.spec-table dd {
  line-height: 1.45;
}

.faq-band {
  border-top: 1px solid var(--line);
}

.faq-band details {
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.faq-band summary {
  padding: 18px 0;
  font-weight: 900;
  cursor: pointer;
}

.faq-band p {
  max-width: 780px;
  padding: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.tools-layout,
.assistant-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-panel,
.assistant-result {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tool-panel.full {
  grid-column: 1 / -1;
}

.tool-form,
.compare-selectors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tool-form label,
.compare-selectors label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tool-form input,
.tool-form select,
.compare-selectors select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

.tool-form .primary-button {
  align-self: end;
}

.tool-result,
#compare-result {
  margin-top: 18px;
}

.compare-table-wrap {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14px;
}

.compare-table th,
.compare-table td {
  padding: 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.compare-table th {
  background: var(--panel-alt);
}

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

.note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.stock-link-grid a {
  display: grid;
  gap: 5px;
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
  text-decoration: none;
}

.stock-link-grid span {
  font-weight: 900;
}

.stock-link-grid small {
  color: var(--muted);
}

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

.recommendation-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
}

.recommendation-list h3 {
  margin-top: 5px;
  font-size: 20px;
}

.recommendation-list p {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.5;
}

.compatibility {
  color: var(--sage);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.moodboard-dialog {
  width: min(860px, calc(100vw - 28px));
  max-height: min(780px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.moodboard-dialog::backdrop {
  background: rgba(23, 21, 18, 0.42);
}

.moodboard-dialog form {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.moodboard-dialog header,
.moodboard-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.moodboard-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  overflow-y: auto;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

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

  .side-panel {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .quick-stock {
    margin-top: 0;
  }

  .hero-band,
  .profile-path,
  .split-band,
  .entry-hero,
  .assistant-layout {
    grid-template-columns: 1fr;
  }

  .profile-path ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hub-grid,
  .card-grid,
  .card-grid.compact,
  .detail-grid,
  .glossary-grid,
  .guide-sections,
  .stock-link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 16px 14px 34px;
  }

  .topbar,
  .section-heading,
  .moodboard-dialog header,
  .moodboard-dialog footer {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .icon-button {
    flex: 1;
  }

  .main-nav,
  .profile-switcher,
  .metrics-strip,
  .profile-path ol,
  .hub-grid,
  .card-grid,
  .card-grid.compact,
  .detail-grid,
  .glossary-grid,
  .guide-sections,
  .tools-layout,
  .tool-form,
  .compare-selectors,
  .calc-grid,
  .stock-link-grid,
  .moodboard-items {
    grid-template-columns: 1fr;
  }

  .hero-band {
    min-height: 420px;
    padding: 22px;
  }

  .hero-search {
    order: 2;
  }

  .profile-switcher {
    order: 3;
  }

  .spec-table div {
    grid-template-columns: 1fr;
  }

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

  .resource-card,
  .resource-card.large {
    min-height: auto;
  }
}

@media print {
  .side-panel,
  .top-actions,
  .hero-band,
  .search-results,
  .button-row,
  .card-actions,
  .moodboard-dialog footer {
    display: none !important;
  }

  .app-shell,
  .workspace,
  #view-root {
    display: block;
    padding: 0;
  }

  body {
    background: #fff;
  }

  .entry-hero,
  .content-band,
  .detail-grid,
  .info-panel,
  .spec-table {
    break-inside: avoid;
  }
}
