:root {
  color-scheme: light;

  /* ── Lotus Garden palette ── */
  --mint:          #ADEBB3;
  --mint-dark:     #3a8050;
  --mint-deeper:   #245235;
  --mint-faint:    #edf8ef;

  --coral:         #FF857A;
  --coral-dark:    #d4564a;
  --coral-deeper:  #a03830;
  --coral-faint:   #fff1f0;

  --lilac:         #EBAEE6;
  --lilac-dark:    #8a4a85;
  --lilac-deeper:  #5c2e58;
  --lilac-faint:   #faf0fb;

  --brown:         #6B403C;
  --brown-dark:    #4a2a28;
  --brown-faint:   #f7f0ef;

  /* Surfaces */
  --bg:            #faf8f8;
  --surface:       #ffffff;

  /* Text */
  --text:          #2e1a18;
  --muted:         #7a5a58;

  /* Borders */
  --border:        #e8d8d6;
  --border-focus:  var(--lilac-dark);

  /* Semantic */
  --warning-bg:    #fff1f0;
  --warning-border: var(--coral-dark);
  --error:         #c0392b;
  --success:       var(--mint-dark);
  --success-bg:    var(--mint-faint);
  --success-border: var(--mint);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(60,20,18,0.07), 0 1px 2px rgba(60,20,18,0.04);
  --shadow-md: 0 4px 14px rgba(60,20,18,0.10), 0 2px 4px rgba(60,20,18,0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

/* ── Layout ── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

/* ── Typography ── */
h1, h2 { line-height: 1.2; }

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: var(--brown-dark);
  letter-spacing: -0.5px;
}

h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brown);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

p { margin: 0.5rem 0; }

/* ── Header ── */
.site-header {
  margin-bottom: 1.25rem;
  padding: 1.4rem 1.4rem 1.2rem;
  background: var(--lilac);
  border-radius: 4px;
  box-shadow: var(--shadow-md);
}

.site-header h1 { color: var(--brown-dark); }

.tagline {
  margin: 0.3rem 0 0;
  color: var(--lilac-deeper);
  font-size: 0.97rem;
}

/* ── Panels ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

/* ── Form fields ── */
.field { margin-bottom: 1.1rem; }

label, legend {
  display: block;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brown);
  margin-bottom: 0.45rem;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1.1rem;
}

input[type="number"],
select {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 3px;
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: auto;
}

input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--lilac-dark);
  box-shadow: 0 0 0 3px rgba(235,174,230,0.4);
}

/* ── Unit toggle ── */
.toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.toggle-option {
  border: 1.5px solid var(--border);
  border-radius: 3px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--surface);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.toggle-option:has(input:checked) {
  border-color: var(--lilac-dark);
  background: var(--lilac-faint);
  color: var(--lilac-deeper);
}

.toggle-option input {
  width: auto;
  min-height: auto;
  accent-color: var(--lilac-dark);
}

/* ── Buttons ── */
button {
  width: 100%;
  min-height: 48px;
  border: 1.5px solid transparent;
  border-radius: 3px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.65rem 0.75rem;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}

button:active { transform: scale(0.98); }

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

/* Primary — coral CTA */
button[type="submit"] {
  background: var(--coral);
  border-color: var(--coral);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,133,122,0.35);
}

button[type="submit"]:hover {
  background: var(--coral-dark);
  border-color: var(--coral-dark);
  box-shadow: 0 4px 12px rgba(255,133,122,0.45);
}

/* Secondary */
.button-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.button-secondary:hover {
  background: var(--brown-faint);
  border-color: #c8b0ae;
}

/* ── Errors ── */
.error-text {
  min-height: 1.2rem;
  margin-top: 0.3rem;
  color: var(--error);
  font-size: 0.88rem;
}

/* ── Result panel ── */
.result-panel {
  border: none;
  background: var(--mint);
  box-shadow: var(--shadow-md);
}

.result-panel h2 { color: var(--mint-deeper); }

.result-amount {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--mint-deeper);
  margin: 0 0 0.75rem;
  letter-spacing: -0.5px;
}

/* Inline buy button in result */
.result-buy-btn {
  display: inline-block;
  margin-bottom: 0.85rem;
  padding: 0.6rem 1.25rem;
  background: var(--coral);
  color: #fff;
  font-weight: 700;
  font-size: 0.97rem;
  border-radius: 3px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(255,133,122,0.32);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.result-buy-btn:hover {
  background: var(--coral-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255,133,122,0.42);
  transform: translateY(-1px);
}

.result-buy-btn--todo {
  background: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Copy link button */
.button-copy-link {
  width: auto;
  min-height: 34px;
  padding: 0.3rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--lilac-dark);
  border: 1.5px solid var(--lilac);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: background 0.15s, border-color 0.15s;
  box-shadow: none;
}

.button-copy-link:hover {
  background: var(--lilac-faint);
  border-color: var(--lilac-dark);
}

.button-copy-link.copied {
  background: var(--mint-faint);
  color: var(--mint-dark);
  border-color: var(--mint);
}

/* Result data list */
.result-list { margin: 0; }

.result-list div {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--mint-dark);
  opacity: 0.9;
}

.result-list div:last-child { border-bottom: 0; }

.result-list dt {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.result-list dd {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

/* ── Warning / disclaimer panel ── */
.warning-panel {
  background: var(--coral-faint);
  border-color: var(--coral);
  border-left: 5px solid var(--coral);
}

.warning-panel h2 { color: var(--coral-dark); }

/* ── Country bar (above calculator) ── */
.country-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--mint);
  border: none;
  border-radius: 3px;
  font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
}

.country-bar-label {
  font-weight: 600;
  color: var(--mint-deeper);
  white-space: nowrap;
}

.geo-label {
  font-weight: 700;
  color: var(--mint-deeper);
  white-space: nowrap;
}

.geo-select {
  width: auto;
  min-height: 34px;
  padding: 0.3rem 0.6rem;
  font-size: 0.88rem;
  border-radius: 2px;
  margin-left: auto;
}

/* visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ── Store cards ── */
.store-card {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--surface);
}

.store-card:last-child { margin-bottom: 0; }

.store-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.6rem;
}

.store-name {
  font-size: 1rem;
  color: var(--brown-dark);
}

.store-commission {
  font-size: 0.85rem;
  color: var(--muted);
}

.store-commission a { font-size: 0.85rem; }

.store-cookie {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--lilac-faint);
  color: var(--lilac-deeper);
  border: 1px solid var(--lilac);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.store-note {
  font-size: 0.85rem;
  color: var(--lilac-deeper);
  background: var(--lilac-faint);
  border-radius: 2px;
  padding: 0.35rem 0.6rem;
  margin: 0 0 0.5rem;
}

/* ── Affiliate links ── */
.link-list {
  margin: 0;
  padding-left: 1.2rem;
}

.link-list li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.todo-note {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--coral-deeper);
  background: var(--coral-faint);
  border: 1px solid var(--coral);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  margin-left: 0.3rem;
  vertical-align: middle;
}

/* ── Links ── */
a {
  color: var(--brown);
  font-weight: 500;
}

a:hover { color: var(--coral-dark); }

/* ── Ad slots ── */
.ad-slot--inline {
  margin-bottom: 1rem;
  overflow: hidden;
}

.ad-slot--sticky {
  display: none;
}

@media (max-width: 640px) {
  .ad-slot--sticky {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 8px rgba(60,20,18,0.10);
    min-height: 60px;
  }

  /* push footer content above sticky banner */
  .site-footer {
    padding-bottom: 80px;
  }
}

/* ── Buy me a coffee ── */
.bmc-btn {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.5rem 1.25rem;
  background: var(--coral);
  color: var(--brown-dark) !important;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 2rem;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.bmc-btn:hover {
  background: var(--coral-dark);
  color: #fff !important;
  transform: translateY(-1px);
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 1rem 1.25rem 1.5rem;
  font-size: 0.88rem;
  background: var(--brown);
  color: rgba(255,255,255,0.85);
  border-radius: 3px;
  margin-bottom: 1rem;
}

.site-footer a { color: var(--mint); }
.site-footer .muted { color: rgba(255,255,255,0.55); }

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

/* ── Responsive ── */
@media (max-width: 560px) {
  .container { padding: 0.75rem; }
  .button-row { grid-template-columns: 1fr; }
  .result-list div { grid-template-columns: 1fr; }
  .result-list dt { margin-bottom: 0.1rem; }
}
