:root {
  color-scheme: light;
  --background: #f3ead7;
  --ink: #17221f;
  --muted: #66706a;
  --line: #d9cdb4;
  --panel: #fffaf0;
  --panel-strong: #f8edd9;
  --accent: #123c35;
  --accent-strong: #0b2924;
  --focus: #bd5c2f;
  --gold: #d69d32;
  --green: #2f7d55;
  --red: #a33b2c;
  --shadow: 0 24px 70px rgba(35, 26, 12, 0.13);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 4%, rgba(214, 157, 50, 0.24), transparent 28rem),
    radial-gradient(circle at 94% 0%, rgba(18, 60, 53, 0.18), transparent 26rem),
    linear-gradient(90deg, rgba(23, 34, 31, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(23, 34, 31, 0.035) 1px, transparent 1px),
    var(--background);
  background-size: auto, auto, 58px 58px, 58px 58px, auto;
  color: var(--ink);
  font-family: Avenir Next, Trebuchet MS, Verdana, sans-serif;
}

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

button {
  touch-action: manipulation;
}

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

.workspace {
  display: grid;
  gap: 22px;
  margin: 0 auto;
  max-width: 1180px;
  min-height: 100dvh;
  padding: 28px 18px 86px;
  position: relative;
}

.hero,
.panel,
.advice-card,
.store-card {
  background: color-mix(in srgb, var(--panel) 92%, white);
  border: 1px solid rgba(23, 34, 31, 0.12);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  align-items: end;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 34px;
  position: relative;
}

.hero::after {
  background: linear-gradient(135deg, rgba(18, 60, 53, 0.12), rgba(214, 157, 50, 0.16));
  border-radius: 999px;
  content: "";
  height: 220px;
  position: absolute;
  right: -80px;
  top: -120px;
  width: 220px;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-family: Georgia, Cambria, serif;
  font-size: clamp(2.25rem, 7vw, 5.2rem);
  letter-spacing: -0.065em;
  line-height: 0.92;
  margin-bottom: 18px;
  max-width: 850px;
}

h2 {
  font-family: Georgia, Cambria, serif;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}

h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
  margin-bottom: 0;
  max-width: 680px;
}

.hero-actions {
  align-items: end;
  display: grid;
  gap: 12px;
  justify-items: end;
  min-width: 230px;
  position: relative;
  z-index: 1;
}

.build-pill,
.inline-status {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0;
}

.inline-status[data-tone="error"] {
  color: var(--red);
}

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

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

.advice-card,
.panel {
  padding: 24px;
}

.advice-card.emphasis {
  background: linear-gradient(145deg, #123c35, #245f4c);
  color: #fffaf0;
}

.advice-card.warning {
  background: linear-gradient(145deg, #fff7df, #f4dfbb);
}

.big-number {
  font-family: Georgia, Cambria, serif;
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  letter-spacing: -0.055em;
  line-height: 1;
  margin-bottom: 10px;
}

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

.plain-list span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
}

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

.section-heading.compact {
  margin-bottom: 14px;
}

.section-heading p:last-child {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0;
  max-width: 470px;
}

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

.store-card {
  box-shadow: none;
  padding: 18px;
}

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

.store-card-head p,
.watch-item p,
.log-entry p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  margin-bottom: 0;
}

.store-total {
  font-family: Georgia, Cambria, serif;
  font-size: 2rem;
  letter-spacing: -0.04em;
  margin: 18px 0;
}

.store-total span {
  color: var(--muted);
  display: block;
  font-family: Avenir Next, Trebuchet MS, Verdana, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0;
}

table {
  border-collapse: collapse;
  font-size: 0.86rem;
  width: 100%;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 9px 6px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.confidence {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  padding: 5px 8px;
  text-transform: uppercase;
}

.confidence.high,
.confidence.manual-high {
  background: rgba(47, 125, 85, 0.15);
  color: var(--green);
}

.confidence.medium {
  background: rgba(214, 157, 50, 0.18);
  color: #8b5b08;
}

.confidence.low,
.confidence.unknown {
  background: rgba(163, 59, 44, 0.12);
  color: var(--red);
}

.caution {
  color: var(--red);
  font-size: 0.86rem;
  line-height: 1.35;
  margin-bottom: 0;
}

.stacked-form {
  display: grid;
  gap: 14px;
}

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

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select,
textarea {
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  line-height: 1.4;
  padding: 11px 12px;
  width: 100%;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  outline: 3px solid rgba(189, 92, 47, 0.16);
}

.feedback-trigger,
.icon-button,
.primary-button,
.secondary-button,
.danger-button {
  align-items: center;
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  text-decoration: none;
}

.primary-button,
.secondary-button,
.danger-button {
  border-radius: 999px;
  min-height: 42px;
  padding: 0 17px;
}

.primary-button {
  background: var(--accent);
  color: #fffaf0;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--accent-strong);
  outline: none;
}

.secondary-button {
  background: rgba(255, 250, 240, 0.7);
  border-color: var(--line);
  color: var(--accent);
}

.danger-button {
  background: rgba(163, 59, 44, 0.08);
  border-color: rgba(163, 59, 44, 0.2);
  color: var(--red);
}

.small {
  font-size: 0.78rem;
  min-height: 34px;
  padding: 0 12px;
}

.secondary-button:hover,
.secondary-button:focus-visible,
.danger-button:hover,
.danger-button:focus-visible,
.icon-button:hover,
.icon-button:focus-visible,
.feedback-trigger:hover,
.feedback-trigger:focus-visible {
  border-color: var(--focus);
  color: var(--focus);
  outline: none;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.actions.stretch {
  justify-content: stretch;
}

.actions.stretch button {
  flex: 1;
}

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

.candidate-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.candidate-summary span {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 8px 11px;
}

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

.candidate-card {
  align-items: start;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  padding: 16px;
}

.candidate-card h3 {
  margin-bottom: 8px;
}

.candidate-card p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  margin-bottom: 8px;
}

.candidate-source {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.candidate-actions {
  display: grid;
  gap: 8px;
}

.watch-item,
.log-entry {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 16px;
}

.watch-actions {
  display: grid;
  gap: 8px;
  align-content: start;
}

.item-note {
  margin-top: 8px;
}

.refresh-log {
  display: grid;
  gap: 12px;
}

.log-entry {
  display: grid;
}

.log-entry ul {
  color: var(--muted);
  margin: 8px 0 0;
  padding-left: 18px;
}

.feedback-trigger,
.icon-button {
  background: var(--panel);
  border-color: var(--line);
  color: var(--accent);
  padding: 0;
}

.feedback-trigger {
  border-radius: 999px;
  bottom: 22px;
  box-shadow: 0 10px 28px rgba(24, 32, 30, 0.16);
  height: 48px;
  position: fixed;
  right: 22px;
  width: 48px;
  z-index: 5;
}

.feedback-modal {
  background: transparent;
  border: 0;
  color: var(--ink);
  max-width: min(540px, calc(100vw - 28px));
  padding: 0;
  width: 100%;
}

.feedback-modal::backdrop {
  background: rgba(11, 20, 18, 0.48);
}

.feedback-panel {
  background: var(--panel);
  border: 1px solid rgba(24, 32, 30, 0.14);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(11, 20, 18, 0.24);
  display: grid;
  gap: 16px;
  padding: 24px;
  position: relative;
}

.close-button {
  border-radius: 999px;
  height: 34px;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 34px;
}

.form-status {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  margin: 0;
  min-height: 1.2em;
}

.form-status[data-tone="error"] {
  color: var(--red);
}

@media (max-width: 900px) {
  .hero,
  .advice-grid,
  .editor-grid,
  .store-grid,
  .candidate-card,
  .watchlist {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    justify-items: start;
  }

  .section-heading {
    display: grid;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 12px 10px 78px;
  }

  .hero,
  .panel,
  .advice-card {
    border-radius: 18px;
    padding: 18px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .store-card-head,
  .watch-item {
    display: grid;
  }

  table {
    font-size: 0.78rem;
  }

  th,
  td {
    padding: 8px 4px;
  }
}
