:root {
  --ink: #16201d;
  --muted: #68756f;
  --line: #d9dfdb;
  --paper: #f6f2e9;
  --surface: #fffdf8;
  --green: #236c59;
  --green-dark: #15493d;
  --blue: #315f98;
  --coral: #d86145;
  --yellow: #c99731;
  --shadow: 0 18px 46px rgba(22, 32, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(246, 242, 233, 0.96), rgba(239, 245, 241, 0.96)),
    repeating-linear-gradient(90deg, rgba(22, 32, 29, 0.035) 0 1px, transparent 1px 84px);
  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 {
  border: 0;
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 3vw, 32px);
  border-bottom: 1px solid rgba(217, 223, 219, 0.9);
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

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

.brand span {
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.primary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.primary-button {
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 18px rgba(35, 108, 89, 0.22);
}

.primary-button:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 0.92fr) minmax(390px, 1.1fr) minmax(300px, 0.8fr);
  gap: 16px;
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 16px clamp(16px, 3vw, 32px) 32px;
}

.surface {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
}

.input-panel,
.result-panel,
.side-panel .surface {
  padding: 18px;
}

.side-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.section-title {
  margin-bottom: 16px;
}

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

.section-title p {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 21px;
}

h3 {
  font-size: 17px;
}

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

label,
fieldset {
  min-width: 0;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

input,
select {
  height: 40px;
  padding: 0 10px;
}

textarea {
  resize: vertical;
  padding: 10px;
  line-height: 1.55;
}

.wide {
  grid-column: 1 / -1;
}

.checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.checklist legend {
  width: 100%;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.checklist label {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.checklist input {
  width: 14px;
  height: 14px;
}

.confidence {
  display: inline-flex;
  min-width: 88px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(49, 95, 152, 0.1);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.price-hero {
  padding: clamp(18px, 4vw, 28px);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(35, 108, 89, 0.12), rgba(216, 97, 69, 0.09)),
    #fff;
}

.price-hero span,
.price-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.price-hero strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(36px, 7vw, 58px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.range-track {
  height: 12px;
  margin: 22px 0 10px;
  border-radius: 999px;
  background: rgba(22, 32, 29, 0.1);
  overflow: hidden;
}

.range-track span {
  display: block;
  width: 60%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--yellow), var(--green));
}

.price-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.price-grid div {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.price-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.score-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.score-ring {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 54%, transparent 56%),
    conic-gradient(var(--green) 0deg, var(--green) 180deg, rgba(22, 32, 29, 0.12) 180deg);
}

.score-ring strong {
  font-size: 30px;
  line-height: 1;
}

.score-ring span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.score-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.factor-list,
.todo-list {
  display: grid;
  gap: 10px;
}

.factor,
.todo {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.factor-icon,
.todo-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: rgba(35, 108, 89, 0.1);
  color: var(--green);
  font-weight: 900;
}

.factor.negative .factor-icon,
.todo.high .todo-icon {
  background: rgba(216, 97, 69, 0.11);
  color: var(--coral);
}

.factor.neutral .factor-icon,
.todo.medium .todo-icon {
  background: rgba(201, 151, 49, 0.14);
  color: #8a6119;
}

.factor strong,
.todo strong {
  display: block;
  overflow-wrap: anywhere;
}

.factor span,
.todo span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.copy-box + .copy-box {
  margin-top: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  font-weight: 800;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(330px, 0.95fr) minmax(420px, 1.2fr);
  }

  .side-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .top-actions {
    width: 100%;
  }

  .top-actions button {
    flex: 1;
  }

  .workspace,
  .side-panel,
  .value-form,
  .price-grid,
  .score-card {
    grid-template-columns: 1fr;
  }

  .price-grid div {
    min-height: 76px;
  }

  h1 {
    font-size: 22px;
  }
}
