/* Production Line Downtime Cost Calculator
   Matches the /tools convention: dark hero, light page, inputs left with a
   sticky results panel right, .ld-outer capped at 1080px. Everything is
   prefixed .ld- so nothing can collide with the theme or another tool.

   Accent is amber rather than the site blue: this tool is about a line being
   stopped, and amber reads as "halted" where blue reads as "informational".
   Amber is used for state, not as a brand colour. */

.ld-wrap {
  --ld-ink:      #0f172a;
  --ld-ink-soft: #475569;
  --ld-ink-mute: #7c8b9c;
  --ld-line:     #e2e8f0;
  --ld-line-soft:#eef2f7;
  --ld-surface:  #ffffff;
  --ld-raised:   #f8fafc;
  --ld-amber:    #d97706;
  --ld-amber-lt: #fef3c7;
  --ld-blue:     #005598;
  --ld-brand:    #007dbd;
  --ld-azure:    #42afea;
  --ld-good:     #10714a;
  --ld-c1:       #d97706;   /* contribution */
  --ld-c2:       #f59e0b;   /* ramp */
  --ld-c3:       #0e7490;   /* labour */
  --ld-c4:       #9a3412;   /* scrap */
  font-family: inherit;
  color: var(--ld-ink);
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.ld-hero {
  background: linear-gradient(135deg, #0d1520 0%, #16222f 55%, #0d1520 100%);
  padding: 52px 24px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.ld-hero::before {
  content: ''; position: absolute;
  width: 420px; height: 420px; border-radius: 50%;
  background: rgba(217,119,6,.09);
  top: -130px; right: -80px; pointer-events: none;
}
.ld-hero::after {
  content: ''; position: absolute;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255,255,255,.03);
  bottom: -70px; left: -50px; pointer-events: none;
}
.ld-hero-inner { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.ld-hero-icon {
  width: 64px; height: 64px; margin: 0 auto 20px;
  filter: drop-shadow(0 4px 20px rgba(217,119,6,.45));
}
.ld-hero-icon svg { width: 100%; height: 100%; }
.ld-hero-title {
  margin: 0 0 14px; color: #fff;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800; line-height: 1.22; letter-spacing: -.5px;
  text-shadow: 0 2px 16px rgba(0,0,0,.35);
}
.ld-hero-sub { margin: 0; color: rgba(255,255,255,.76); font-size: 1rem; line-height: 1.65; }

/* ── Layout ───────────────────────────────────────────────────────── */
.ld-outer { max-width: 1080px; margin: 0 auto; padding: 0 20px 64px; }
.ld-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  margin-top: -28px;
  align-items: start;
}
@media (max-width: 900px) { .ld-layout { grid-template-columns: 1fr; margin-top: -20px; } }

/* ── Input cards ──────────────────────────────────────────────────── */
.ld-card {
  background: var(--ld-surface);
  border: 1px solid var(--ld-line);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
}
.ld-card-head {
  display: flex; align-items: center; gap: 9px;
  font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--ld-ink-soft);
  padding-bottom: 12px; margin-bottom: 16px;
  border-bottom: 1px solid var(--ld-line-soft);
}
.ld-card-head svg { flex: 0 0 auto; }

.ld-field { margin-bottom: 16px; }
.ld-field:last-child { margin-bottom: 0; }
.ld-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 560px) { .ld-row2 { grid-template-columns: 1fr; } }

.ld-label { display: block; font-size: 13px; font-weight: 650; color: var(--ld-ink); margin-bottom: 6px; }
.ld-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ld-label-row .ld-label { margin-bottom: 0; }

.ld-input, .ld-select {
  width: 100%; padding: 9px 12px;
  font: inherit; font-size: 15px;
  color: var(--ld-ink); background: var(--ld-surface);
  border: 1px solid #cbd5e1; border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.ld-input-sm { max-width: 180px; }
.ld-input:focus, .ld-select:focus {
  outline: none; border-color: var(--ld-brand);
  box-shadow: 0 0 0 3px rgba(0,125,189,.13);
}
.ld-select { cursor: pointer; }

.ld-help { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ld-ink-mute); }
.ld-help strong { color: var(--ld-ink-soft); }

.ld-check {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 14px; color: var(--ld-ink-soft); cursor: pointer; margin-top: 4px;
}
.ld-check input { margin: 3px 0 0; accent-color: var(--ld-brand); flex: 0 0 auto; }

/* Currency toggle */
.ld-ctgl-wrap { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 7px; overflow: hidden; }
.ld-ctgl {
  padding: 3px 9px; font: inherit; font-size: 11px; font-weight: 700;
  background: var(--ld-surface); color: var(--ld-ink-mute);
  border: 0; cursor: pointer; transition: background .12s, color .12s;
}
.ld-ctgl + .ld-ctgl { border-left: 1px solid #cbd5e1; }
.ld-ctgl--on { background: var(--ld-blue); color: #fff; }

/* ── Results panel ────────────────────────────────────────────────── */
.ld-col-results { position: sticky; top: 20px; }
@media (max-width: 900px) { .ld-col-results { position: static; } }

.ld-results {
  background: var(--ld-surface);
  border: 1px solid var(--ld-line);
  border-top: 3px solid var(--ld-amber);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 4px 18px rgba(15,23,42,.07);
}

.ld-headline { text-align: center; padding-bottom: 18px; border-bottom: 1px solid var(--ld-line-soft); }
.ld-headline-lab {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.3px;
  text-transform: uppercase; color: var(--ld-ink-mute);
}
.ld-headline-val {
  margin-top: 6px;
  font-size: clamp(2rem, 5vw, 2.7rem); font-weight: 800; line-height: 1.05;
  letter-spacing: -1.4px; color: var(--ld-amber);
  font-variant-numeric: tabular-nums;
}

.ld-figs { display: grid; gap: 0; }
.ld-fig { padding: 13px 0; border-bottom: 1px solid var(--ld-line-soft); }
.ld-fig-lab {
  display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--ld-ink-mute);
}
.ld-fig-val {
  display: block; margin-top: 3px;
  font-size: 1.45rem; font-weight: 800; letter-spacing: -.6px;
  color: var(--ld-ink); font-variant-numeric: tabular-nums;
}
.ld-fig-sub { display: block; font-size: 12px; color: var(--ld-ink-mute); margin-top: 2px; }
.ld-fig--year .ld-fig-val { color: var(--ld-c4); }

/* Composition bar */
.ld-bar {
  display: flex; height: 9px; margin: 18px 0 14px;
  border-radius: 5px; overflow: hidden; background: var(--ld-line-soft);
}
.ld-bar span { display: block; height: 100%; transition: width .18s ease; }
.ld-bar-c { background: var(--ld-c1); }
.ld-bar-r { background: var(--ld-c2); }
.ld-bar-l { background: var(--ld-c3); }
.ld-bar-s { background: var(--ld-c4); }

.ld-break-row {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 0; border-bottom: 1px solid var(--ld-line-soft);
  font-size: 13.5px;
}
.ld-break-row:last-child { border-bottom: 0; }
.ld-key { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 2px; margin-top: 5px; }
.ld-key-c { background: var(--ld-c1); }
.ld-key-r { background: var(--ld-c2); }
.ld-key-l { background: var(--ld-c3); }
.ld-key-s { background: var(--ld-c4); }
.ld-break-lab { flex: 1 1 auto; color: var(--ld-ink-soft); min-width: 0; }
.ld-break-lab em {
  display: block; font-style: normal; font-size: 12px; color: var(--ld-ink-mute);
}
.ld-break-val {
  flex: 0 0 auto; font-weight: 750; color: var(--ld-ink);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

.ld-note { margin: 14px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--ld-ink-mute); }

/* ── CTA ──────────────────────────────────────────────────────────── */
.ld-cta {
  margin-top: 16px;
  background: linear-gradient(135deg, #0d1520 0%, #16222f 100%);
  border-radius: 12px; padding: 20px 22px;
}
.ld-cta-h { color: #fff; font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.ld-cta-p { margin: 7px 0 0; color: rgba(255,255,255,.72); font-size: 13.5px; line-height: 1.6; }
.ld-cta-btn {
  display: block; margin-top: 15px; padding: 11px 16px;
  background: var(--ld-amber); color: #fff !important;
  border-radius: 8px; text-align: center;
  font-size: 14px; font-weight: 750; text-decoration: none !important;
  transition: background .15s;
}
.ld-cta-btn:hover { background: #b45309; }
.ld-cta-sub { margin: 11px 0 0; color: rgba(255,255,255,.5); font-size: 11.5px; line-height: 1.5; }

/* ── Method ───────────────────────────────────────────────────────── */
.ld-method { margin-top: 34px; }
.ld-method-h {
  margin: 0 0 16px; font-size: 1.15rem; font-weight: 800;
  letter-spacing: -.3px; color: var(--ld-ink);
}
.ld-method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .ld-method-grid { grid-template-columns: 1fr; } }
.ld-m {
  background: var(--ld-surface); border: 1px solid var(--ld-line);
  border-left: 3px solid var(--ld-azure);
  border-radius: 0 10px 10px 0; padding: 16px 18px;
}
.ld-m-h { font-weight: 750; font-size: 14.5px; color: var(--ld-ink); }
.ld-m p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.62; color: var(--ld-ink-soft); }

.ld-excl {
  margin-top: 16px; padding: 16px 18px;
  background: var(--ld-amber-lt); border: 1px solid #fcd34d;
  border-radius: 10px;
}
.ld-excl-h { font-weight: 800; font-size: 14px; color: #92400e; }
.ld-excl p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.62; color: #78350f; }

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