:root {
  --bg: #fafafa;
  --panel: #ffffff;
  --border: #1b1b1b;
  --soft-border: #cfcfcf;
  --muted: #666666;
  --text: #111111;
  --accent-bg: #f4f4f4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
}

code {
  font: inherit;
}

input {
  font: inherit;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.panel {
  width: min(720px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  margin-bottom: 8px;
}

h2 {
  font-size: 14px;
}

.eyebrow,
.subtitle,
.section-label {
  color: var(--muted);
  font-size: 12px;
}

.subtitle {
  margin-bottom: 16px;
  line-height: 1.4;
}

.formula-card,
.check-card,
.guide-row {
  border: 1px solid var(--border);
  background: var(--accent-bg);
  padding: 14px;
}

.formula-card {
  margin-bottom: 12px;
}

.formula {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.guide {
  display: grid;
  gap: 12px;
}

.check-card {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  background: var(--panel);
}

.check-header {
  display: grid;
  gap: 4px;
}

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

.quote-field {
  display: grid;
  gap: 6px;
  border: 1px solid var(--soft-border);
  background: #ffffff;
  padding: 8px;
}

.quote-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 6px;
}

.form-input.is-invalid {
  background: #f3f3f3;
  border-style: dashed;
}

.check-formula,
.check-trade {
  font-size: 13px;
  line-height: 1.4;
}

.check-formula {
  color: var(--muted);
}

.check-trade {
  border: 1px solid var(--soft-border);
  background: #ffffff;
  padding: 10px;
  font-weight: 700;
}

.check-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.check-rich {
  color: #a22424;
}

.check-cheap {
  color: #1d6a3a;
}

.guide-row {
  display: grid;
  gap: 8px;
  background: var(--panel);
}

.guide-row p {
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .panel {
    padding: 12px;
  }

  .formula {
    font-size: 20px;
  }

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

@media (max-width: 420px) {
  .quote-grid {
    grid-template-columns: 1fr;
  }
}
