:root {
  --ink: #16241d;
  --paper: #f6f4ee;
  --card: #ffffff;
  --line: #dfe3dd;
  --green-deep: #2f6f4f;
  --green-mid: #3f8a63;
  --green-soft: #e6efe7;
  --amber: #c9a24b;
  --muted: #5c6a62;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

.site-header {
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, var(--green-soft), var(--paper));
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green-deep), var(--amber));
}

.brand-name {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tagline {
  max-width: 46ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  gap: 1.5rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.panel h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.25rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.toggle-row {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.toggle-row input { width: auto; }

.result-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.result-tile {
  background: var(--green-soft);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.result-tile.highlight {
  background: linear-gradient(135deg, var(--green-deep), var(--green-mid));
  color: #fff;
}

.result-label {
  font-size: 0.8rem;
  opacity: 0.8;
}

.result-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.cost-bars {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.cost-bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 80px;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.cost-bar-track {
  background: var(--green-soft);
  border-radius: 6px;
  height: 12px;
  overflow: hidden;
}

.cost-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.2s ease;
}

.cost-bar-value {
  text-align: right;
  font-weight: 600;
}

.fine-print {
  font-size: 0.8rem;
  color: var(--muted);
}

.percentile-note {
  font-weight: 600;
  margin-bottom: 1rem;
}

.mandate-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  max-height: 320px;
  overflow-y: auto;
}

.mandate-list li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font-size: 0.88rem;
}

.mandate-outcome {
  color: var(--muted);
}

textarea {
  width: 100%;
  resize: vertical;
  margin-top: 1rem;
}

.ask-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

button {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  border: none;
  background: var(--green-deep);
  color: #fff;
  cursor: pointer;
}

button:hover { background: var(--green-mid); }

#copyStatus {
  font-size: 0.85rem;
  color: var(--green-deep);
  font-weight: 600;
}

.site-footer {
  max-width: 880px;
  margin: 0 auto;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 640px) {
  .cost-bar-row {
    grid-template-columns: 100px 1fr 60px;
    font-size: 0.78rem;
  }
}
