/* ════════════════════════════════════════════════════════════
   tools/split-bill/style.css
   Theme: Happy — playful orange · friends, dining, casual
   Primary: --f-orange #FF8C42
   ════════════════════════════════════════════════════════════ */

body.tool-split-bill {
  --primary:       #FF8C42;
  --primary-dark:  #E5732B;
  --primary-deep:  #B85614;
  --primary-bg:    #FFF1E4;
  --primary-mid:   #FFE0C7;
  --primary-tint:  rgba(255, 140, 66, 0.14);
  --primary-soft:  #FFD4B0;

  --page-bg:       #FFF8F1;
  --card-bg:       #FFFFFF;
  --card-soft:     #FFF4E8;

  --ink:           #1F1611;
  --text:          #3A2A1F;
  --muted:         #8C7A6A;
  --faint:         #C9B7A4;
  --hairline:      #F2E0CC;
  --hairline-2:    #E3CDB0;

  --accent-mint:   #4ECDC4;
  --accent-pink:   #FF85B3;

  --r-card:        18px;
  --r-input:       12px;
  --r-pill:        999px;
  --shadow-soft:   0 1px 2px rgba(180,90,30,.04), 0 12px 30px -18px rgba(180,90,30,.14);

  background: var(--page-bg);
  color: var(--text);
}

body.tool-split-bill .container {
  max-width: 1080px;
  padding: 1.25rem 1.25rem 3rem;
}

/* ─── Back link ──────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 1.5rem;
  padding: 8px 16px;
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  transition: color .15s, border-color .15s;
}
.back-link:hover { color: var(--primary-dark); border-color: var(--primary); }

/* ─── HERO ───────────────────────────────────────────────── */
.hero-banner {
  position: relative;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(255,140,66,.18), transparent 55%),
    radial-gradient(80% 80% at 0% 100%, rgba(78,205,196,.12), transparent 50%),
    var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: 24px;
  padding: clamp(28px, 4vw, 44px);
  margin-bottom: clamp(28px, 4vw, 40px);
  overflow: hidden;
}
.hero-inner {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.hero-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary), #FFB47A);
  color: #fff;
  border-radius: 22px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 10px 24px -8px rgba(255,140,66,.55);
  transform: rotate(-6deg);
}
.hero-body { flex: 1; min-width: 280px; }
.hero-title {
  font-size: clamp(1.85rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: -.025em;
  line-height: 1.1;
}
.hero-platform {
  font-size: .5em;
  color: var(--primary-deep);
  background: var(--primary-bg);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  vertical-align: middle;
  font-weight: 600;
  margin-left: 6px;
}
.hero-tagline {
  font-size: 16px;
  color: var(--text);
  margin: 0;
  line-height: 1.55;
}
.hero-tagline strong { color: var(--primary-deep); font-weight: 700; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 24px;
}
@media (max-width: 880px) { .calc-layout { grid-template-columns: 1fr; } }

/* ─── FORM ───────────────────────────────────────────────── */
.calc-form {
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  padding: clamp(20px, 3vw, 32px);
}
.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
  letter-spacing: -.015em;
}
.page-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.55;
}

.form-card { display: flex; flex-direction: column; gap: 20px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.005em;
}
.lbl-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
}
.field-input {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px;
  background: var(--card-soft);
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-input);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.field-input:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px var(--primary-tint);
}
.field-prefix, .field-suffix {
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
}
.field-input input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.field-input input::placeholder { color: var(--faint); }

/* People stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  background: var(--card-soft);
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-input);
  transition: border-color .15s, box-shadow .15s;
}
.stepper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-tint);
}
.stepper-btn {
  width: 38px;
  height: 38px;
  border: 0;
  background: var(--card-bg);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
  cursor: pointer;
  transition: background .15s, color .15s;
  display: grid;
  place-items: center;
  line-height: 1;
}
.stepper-btn:hover { background: var(--primary); color: #fff; }
.stepper-btn:disabled { color: var(--faint); cursor: not-allowed; }
.stepper-btn:disabled:hover { background: var(--card-bg); color: var(--faint); }
.stepper-input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  width: 100%;
}

/* Pill toggle groups */
.toggle-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.toggle-pill {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border: 1px solid var(--hairline);
  background: #fff;
  color: var(--muted);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all .15s;
}
.toggle-pill:hover { border-color: var(--primary); color: var(--primary-dark); }
.toggle-pill.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 10px -4px rgba(255,140,66,.5);
}

/* Round-up switch */
.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--card-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--r-input);
  gap: 12px;
}
.option-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.option-hint {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}
.switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
  margin: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  background: #DDD3C7;
  border-radius: 999px;
  transition: background .2s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

.btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: -.005em;
  cursor: pointer;
  margin-top: 8px;
  transition: background .15s, transform .05s, box-shadow .15s;
  box-shadow: 0 6px 18px -6px rgba(255,140,66,.55);
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }

/* ─── RESULT ─────────────────────────────────────────────── */
.calc-result { display: flex; flex-direction: column; gap: 16px; }
.result-empty {
  background: var(--card-bg);
  border: 1px dashed var(--hairline-2);
  border-radius: var(--r-card);
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-icon { font-size: 40px; margin-bottom: 12px; }

/* Hero per-person card */
.per-person-card {
  background: linear-gradient(135deg, var(--primary) 0%, #FFA866 100%);
  color: #fff;
  border-radius: var(--r-card);
  padding: clamp(24px, 4vw, 36px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 32px -14px rgba(255,140,66,.6);
}
.per-person-card::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,.18) 0%, transparent 70%);
  pointer-events: none;
}
.per-person-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.85);
  margin: 0 0 6px;
}
.per-person-headline {
  font-size: 16px;
  color: rgba(255,255,255,.95);
  margin: 0 0 10px;
  font-weight: 500;
}
.per-person-headline strong { font-weight: 700; }
.per-person-amount {
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 700;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  margin: 0;
  position: relative;
  z-index: 1;
}
.per-person-amount .currency {
  font-size: .55em;
  font-weight: 500;
  opacity: .8;
  margin-right: 4px;
}
.per-person-sub {
  font-size: 13.5px;
  color: rgba(255,255,255,.9);
  margin: 8px 0 0;
  position: relative;
  z-index: 1;
}
.per-person-sub strong { color: #fff; font-weight: 700; }

/* Breakdown */
.detail-card {
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  padding: clamp(20px, 3vw, 28px);
}
.detail-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 16px;
  letter-spacing: -.005em;
}
.detail-title svg { color: var(--primary); }

.breakdown { display: flex; flex-direction: column; }
.break-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px dashed var(--hairline);
}
.break-row:last-child { border-bottom: 0; }
.break-label { color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.break-value {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.rate-badge {
  background: var(--primary-bg);
  color: var(--primary-deep);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
}
.break-row-subtotal {
  margin-top: 4px;
  padding: 12px 14px;
  background: var(--primary-bg);
  border-radius: 10px;
  border-bottom: 0;
}
.break-row-subtotal .break-value { color: var(--primary-deep); font-weight: 700; }
.break-row-final {
  border-top: 2px solid var(--primary);
  border-bottom: 0;
  margin-top: 8px;
  padding-top: 14px;
}
.break-row-final .break-label { color: var(--ink); font-weight: 600; font-size: 15px; }
.break-row-final .break-value { color: var(--ink); font-size: 17px; font-weight: 700; }

/* Round-up callout */
.roundup-callout {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--primary-bg);
  border: 1px dashed var(--primary-soft);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13.5px;
  color: var(--text);
}
.roundup-callout strong { color: var(--primary-deep); font-weight: 700; }

/* Result actions */
.result-actions {
  display: flex;
  gap: 10px;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 16px;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all .15s;
}
.action-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.action-btn.is-success { background: #4ECDC4; color: #fff; border-color: #4ECDC4; }

/* ─── INFO ACCORDION ─────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: clamp(40px, 5vw, 64px);
}
@media (max-width: 880px) { .info-grid { grid-template-columns: 1fr; gap: 24px; } }
.info-accordion-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
  letter-spacing: -.005em;
  display: inline-block;
}
.info-acc {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline);
}
.info-acc summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 28px 18px 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  position: relative;
  transition: color .15s;
}
.info-acc summary::-webkit-details-marker { display: none; }
.info-acc summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--muted);
  transition: transform .2s, color .2s;
}
.info-acc[open] summary { color: var(--primary-deep); font-weight: 600; }
.info-acc[open] summary::after { transform: translateY(-50%) rotate(45deg); color: var(--primary); }
.info-acc-body {
  padding: 0 4px 20px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
}
.info-acc-body p { margin: 0 0 12px; }
.info-acc-body p:last-child { margin-bottom: 0; }
.info-acc-body strong { color: var(--primary-deep); font-weight: 700; }

.rate-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rate-list li {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  align-items: baseline;
  font-size: 14px;
}
.rate-pct {
  flex-shrink: 0;
  min-width: 64px;
  padding: 3px 10px;
  background: var(--primary-bg);
  color: var(--primary-deep);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.formula {
  background: var(--primary-bg);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 8px 0 12px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.formula-row { font-variant-numeric: tabular-nums; }
.formula-row strong { color: var(--primary-deep); }

.glossary { margin: 0; }
.glossary dt {
  font-weight: 700;
  color: var(--ink);
  font-size: 14px;
  margin-top: 14px;
  padding-bottom: 4px;
}
.glossary dt:first-child { margin-top: 0; }
.glossary dd {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
}

.related-tools { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.related-tools a { color: var(--primary-deep); text-decoration: none; font-weight: 600; }
.related-tools a:hover { text-decoration: underline; }

.faq-grid { display: flex; flex-direction: column; }

@media (max-width: 560px) {
  .hero-title { font-size: 1.6rem; }
}
