/*! AmpleTrails Attendance Loss Calculator v1.0.0 — every rule is scoped to .atlc */

.atlc {
  --atlc-accent: #1d4ed8;
  --atlc-ink: #0f172a;
  --atlc-text: #334155;
  --atlc-muted: #64748b;
  --atlc-line: #e2e8f0;
  --atlc-soft: #f8fafc;
  --atlc-late: #d97706;
  --atlc-late-soft: #fffbeb;
  --atlc-late-line: #fcd34d;
  --atlc-early: #e11d48;
  --atlc-early-soft: #fff1f2;
  --atlc-early-line: #fda4af;
  --atlc-good: #047857;
  --atlc-good-soft: #ecfdf5;
  --atlc-good-line: #6ee7b7;
  --atlc-radius: 14px;

  container-type: inline-size;
  color-scheme: light;
  box-sizing: border-box;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  color: var(--atlc-text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
}

.atlc *,
.atlc *::before,
.atlc *::after {
  box-sizing: border-box;
}

.atlc [hidden] {
  display: none !important;
}

/* ---------- Header ---------- */

.atlc .atlc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 24px;
  margin: 0 0 22px;
}

.atlc .atlc-head__text {
  flex: 1 1 320px;
  min-width: 0;
}

.atlc .atlc-title {
  margin: 0 0 6px;
  padding: 0;
  color: var(--atlc-ink);
  font-size: clamp(24px, 3.2cqi, 32px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.atlc .atlc-subtitle {
  margin: 0;
  color: var(--atlc-muted);
  font-size: 16px;
}

.atlc .atlc-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Buttons ---------- */

.atlc .atlc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 0;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

.atlc .atlc-btn:focus-visible,
.atlc .atlc-input:focus-visible,
.atlc .atlc-range:focus-visible,
.atlc .atlc-method summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--atlc-accent) 45%, transparent);
  outline-offset: 2px;
}

.atlc .atlc-btn--primary {
  background: var(--atlc-accent);
  color: #fff;
}

.atlc .atlc-btn--primary:hover {
  filter: brightness(0.9);
  color: #fff;
}

.atlc .atlc-btn--ghost {
  border-color: var(--atlc-line);
  background: #fff;
  color: var(--atlc-ink);
}

.atlc .atlc-btn--ghost:hover {
  background: var(--atlc-soft);
  color: var(--atlc-ink);
}

.atlc .atlc-btn--whatsapp {
  background: #1faa59;
  color: #fff;
}

.atlc .atlc-btn--whatsapp:hover {
  filter: brightness(0.92);
  color: #fff;
}

.atlc .atlc-btn--light {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.atlc .atlc-btn--light:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ---------- Layout ---------- */

.atlc .atlc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

@container (min-width: 920px) {
  .atlc .atlc-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 28px;
  }
}

.atlc .atlc-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
}

.atlc .atlc-panel {
  padding: 22px;
  border: 1px solid var(--atlc-line);
  border-radius: var(--atlc-radius);
  background: #fff;
}

.atlc .atlc-panel__title {
  margin: 0 0 4px;
  padding: 0;
  color: var(--atlc-ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: none;
  letter-spacing: 0;
}

.atlc .atlc-panel__title--sub {
  margin: 24px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--atlc-line);
  font-size: 16px;
}

.atlc .atlc-panel__hint {
  margin: 0 0 18px;
  color: var(--atlc-muted);
  font-size: 14px;
}

/* ---------- Fields ---------- */

.atlc .atlc-field {
  margin: 0 0 20px;
}

.atlc .atlc-field__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.atlc .atlc-label {
  display: block;
  margin: 0;
  padding: 0;
  color: var(--atlc-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.atlc .atlc-label__unit {
  color: var(--atlc-muted);
  font-size: 13px;
  font-weight: 500;
}

.atlc .atlc-num {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.atlc .atlc-num__affix {
  position: absolute;
  left: 11px;
  color: var(--atlc-muted);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}

.atlc .atlc-num__affix--end {
  right: 11px;
  left: auto;
}

.atlc .atlc-input {
  width: 118px;
  height: 40px;
  min-height: 0;
  margin: 0;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--atlc-accent) 35%, #fff);
  border-radius: 10px;
  background: color-mix(in srgb, var(--atlc-accent) 6%, #fff);
  box-shadow: none;
  color: var(--atlc-accent);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-align: right;
  appearance: textfield;
  -moz-appearance: textfield;
}

.atlc .atlc-input::-webkit-outer-spin-button,
.atlc .atlc-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.atlc .atlc-num--prefix .atlc-input {
  width: 140px;
  padding-left: 26px;
}

.atlc .atlc-num__affix--end ~ .atlc-input,
.atlc .atlc-field--recovery .atlc-input {
  padding-right: 28px;
}

.atlc .atlc-input--wide {
  width: 100%;
  margin-top: 8px;
  border-color: #cbd5e1;
  background: #fff;
  color: var(--atlc-ink);
  text-align: left;
}

.atlc .atlc-range {
  display: block;
  width: 100%;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--atlc-accent);
  cursor: pointer;
}

.atlc .atlc-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  color: var(--atlc-muted);
  font-size: 13px;
}

.atlc .atlc-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.atlc .atlc-mini {
  padding: 14px;
  border: 1px solid var(--atlc-line);
  border-radius: 12px;
  background: var(--atlc-soft);
}

.atlc .atlc-mini .atlc-label {
  font-size: 14px;
}

.atlc .atlc-field--late,
.atlc .atlc-field--early {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid;
  border-radius: 12px;
}

.atlc .atlc-field--late {
  border-color: var(--atlc-late-line);
  background: var(--atlc-late-soft);
}

.atlc .atlc-field--early {
  border-color: var(--atlc-early-line);
  background: var(--atlc-early-soft);
}

.atlc .atlc-field--late .atlc-input {
  border-color: var(--atlc-late-line);
  background: #fff;
  color: #92400e;
}

.atlc .atlc-field--early .atlc-input {
  border-color: var(--atlc-early-line);
  background: #fff;
  color: #9f1239;
}

.atlc .atlc-field--late .atlc-range {
  accent-color: #b45309;
}

.atlc .atlc-field--early .atlc-range {
  accent-color: var(--atlc-early);
}

.atlc .atlc-field--late .atlc-input,
.atlc .atlc-field--early .atlc-input {
  width: 92px;
}

.atlc .atlc-combined {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--atlc-ink);
  color: #cbd5e1;
  font-size: 14px;
}

.atlc .atlc-combined strong {
  color: #fcd34d;
  font-size: 16px;
  font-weight: 700;
}

/* ---------- Tiles ---------- */

.atlc .atlc-row {
  display: grid;
  gap: 14px;
}

.atlc .atlc-row--tiles,
.atlc .atlc-row--losses {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.atlc .atlc-tile,
.atlc .atlc-loss {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--atlc-line);
  border-radius: var(--atlc-radius);
  background: #fff;
}

.atlc .atlc-tile__label,
.atlc .atlc-loss__label {
  color: var(--atlc-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.atlc .atlc-tile__value {
  margin-top: 6px;
  color: var(--atlc-ink);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.atlc .atlc-tile__note {
  margin-top: 4px;
  color: var(--atlc-muted);
  font-size: 13px;
}

.atlc .atlc-loss__value {
  margin-top: 8px;
  color: var(--atlc-ink);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.atlc .atlc-loss__time {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--atlc-line);
  color: var(--atlc-muted);
  font-size: 14px;
}

.atlc .atlc-loss__time b {
  color: var(--atlc-ink);
  font-weight: 700;
}

.atlc .atlc-loss--monthly {
  border: 2px solid var(--atlc-late-line);
}

.atlc .atlc-loss--monthly .atlc-loss__label,
.atlc .atlc-loss--monthly .atlc-loss__value {
  color: #b45309;
}

.atlc .atlc-loss--annual {
  border-color: #b91c1c;
  background: #b91c1c;
}

.atlc .atlc-loss--annual .atlc-loss__label,
.atlc .atlc-loss--annual .atlc-loss__time {
  color: #fecaca;
}

.atlc .atlc-loss--annual .atlc-loss__value,
.atlc .atlc-loss--annual .atlc-loss__time b {
  color: #fff;
}

.atlc .atlc-loss--annual .atlc-loss__time {
  border-top-color: rgba(255, 255, 255, 0.25);
}

/* ---------- Breakdown ---------- */

.atlc .atlc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 16px;
}

.atlc .atlc-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--atlc-text);
  font-size: 14px;
}

.atlc .atlc-chip b {
  color: #be123c;
  font-weight: 700;
}

.atlc .atlc-bar {
  display: flex;
  gap: 2px;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1f5f9;
}

.atlc .atlc-bar span {
  display: block;
  height: 100%;
  transition: width 0.25s ease;
}

.atlc .atlc-bar__late {
  background: var(--atlc-late);
}

.atlc .atlc-bar__early {
  background: var(--atlc-early);
}

.atlc .atlc-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.atlc .atlc-split__card {
  padding: 16px;
  border: 1px solid;
  border-radius: 12px;
}

.atlc .atlc-split__card--late {
  border-color: var(--atlc-late-line);
  background: var(--atlc-late-soft);
}

.atlc .atlc-split__card--early {
  border-color: var(--atlc-early-line);
  background: var(--atlc-early-soft);
}

.atlc .atlc-split__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
}

.atlc .atlc-split__card--late .atlc-split__head {
  color: #92400e;
}

.atlc .atlc-split__card--early .atlc-split__head {
  color: #9f1239;
}

.atlc .atlc-split__name::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: currentColor;
}

.atlc .atlc-dl {
  margin: 0;
  padding: 0;
}

.atlc .atlc-dl > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
}

.atlc .atlc-dl dt {
  margin: 0;
  color: var(--atlc-muted);
  font-size: 14px;
  font-weight: 500;
}

.atlc .atlc-dl dd {
  margin: 0;
  color: var(--atlc-ink);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.atlc .atlc-dl dd.atlc-dl__strong {
  font-size: 19px;
  font-weight: 800;
}

/* ---------- Recovery ---------- */

.atlc .atlc-recovery {
  border-color: var(--atlc-good-line);
  background: var(--atlc-good-soft);
}

.atlc .atlc-recovery .atlc-panel__hint {
  color: #065f46;
}

.atlc .atlc-field--recovery {
  margin-bottom: 16px;
}

.atlc .atlc-field--recovery .atlc-input {
  width: 96px;
  border-color: var(--atlc-good-line);
  background: #fff;
  color: var(--atlc-good);
}

.atlc .atlc-field--recovery .atlc-range {
  accent-color: var(--atlc-good);
}

.atlc .atlc-recovery__result {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.atlc .atlc-recovery__result > div {
  padding: 14px 16px;
  border: 1px solid var(--atlc-good-line);
  border-radius: 12px;
  background: #fff;
}

.atlc .atlc-recovery__label {
  display: block;
  color: #065f46;
  font-size: 14px;
  font-weight: 600;
}

.atlc .atlc-recovery__value {
  display: block;
  margin-top: 2px;
  color: var(--atlc-good);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* ---------- CTA ---------- */

.atlc .atlc-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 24px;
  padding: 24px;
  border-radius: var(--atlc-radius);
  background: var(--atlc-ink);
  color: #cbd5e1;
}

.atlc .atlc-cta__text {
  flex: 1 1 320px;
  min-width: 0;
}

.atlc .atlc-cta__title {
  margin: 0 0 6px;
  padding: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: none;
  letter-spacing: 0;
}

.atlc .atlc-cta p {
  margin: 0;
  color: #cbd5e1;
  font-size: 15px;
}

.atlc .atlc-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Method ---------- */

.atlc .atlc-method {
  padding: 0 4px;
  color: var(--atlc-muted);
  font-size: 14px;
}

.atlc .atlc-method summary {
  color: var(--atlc-text);
  font-weight: 600;
  cursor: pointer;
}

.atlc .atlc-method p {
  margin: 8px 0 0;
}

/* ---------- Toast ---------- */

.atlc .atlc-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  max-width: calc(100vw - 40px);
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--atlc-ink);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

/* ---------- Small screens ---------- */

@container (max-width: 480px) {
  .atlc .atlc-panel {
    padding: 16px;
  }

  .atlc .atlc-head__actions,
  .atlc .atlc-cta__actions {
    width: 100%;
  }

  .atlc .atlc-head__actions .atlc-btn,
  .atlc .atlc-cta__actions .atlc-btn {
    flex: 1 1 auto;
  }

  .atlc .atlc-input {
    width: 104px;
  }

  .atlc .atlc-num--prefix .atlc-input {
    width: 124px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atlc .atlc-bar span,
  .atlc .atlc-btn {
    transition: none;
  }
}

@media print {
  .atlc .atlc-head__actions,
  .atlc .atlc-cta__actions,
  .atlc .atlc-toast {
    display: none !important;
  }
}

/* 1.1.0: loss vs recoverable savings, visible assumptions */
.atlc .atlc-section-head { margin: 4px 0 -4px; }
.atlc .atlc-section-head .atlc-panel__hint { margin-bottom: 0; }
.atlc .atlc-compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.atlc .atlc-compare__item { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--atlc-line); background: #fff; }
.atlc .atlc-compare__item--loss { border-color: var(--atlc-early-line); background: var(--atlc-early-soft); }
.atlc .atlc-compare__item--save { border-color: var(--atlc-good-line); background: var(--atlc-good-soft); }
.atlc .atlc-compare__item--rest { background: var(--atlc-soft); }
.atlc .atlc-compare__label { font-size: 13px; color: var(--atlc-muted); line-height: 1.3; }
.atlc .atlc-compare__value { font-size: 20px; font-weight: 700; color: var(--atlc-ink); font-variant-numeric: tabular-nums; }
.atlc .atlc-compare__item--save .atlc-compare__value { color: var(--atlc-good); }
.atlc .atlc-recovery__hours { margin: 10px 0 0; font-size: 14px; color: var(--atlc-text); }
.atlc .atlc-assume__list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; line-height: 1.5; color: var(--atlc-text); }
.atlc .atlc-assume__list b { color: var(--atlc-ink); }
@media (max-width: 640px) { .atlc .atlc-compare { grid-template-columns: 1fr; } }
