/* ── 45 Day Calculator ──────────────────────────────────────────────────── */

.dc-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 880px;
  margin: 2rem auto;
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(14,165,233,0.13);
  color: #0c2151;
  box-sizing: border-box;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.dc__header {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 45%, #0369a1 100%);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  position: relative;
  overflow: hidden;
}

.dc__header::before {
  content: '📅';
  position: absolute;
  right: 1.5rem; top: 50%;
  transform: translateY(-50%);
  font-size: 7rem;
  opacity: 0.09;
  pointer-events: none;
}

.dc__header h2 {
  font-size: clamp(1.4rem, 4vw, 1.95rem);
  font-weight: 900;
  color: #fff;
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}

.dc__header p { font-size: 0.93rem; color: #bae6fd; margin: 0; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */

.dc__tabs {
  display: flex;
  background: #fff;
  border-bottom: 2px solid #e0f2fe;
  overflow-x: auto;
}

.dc__tab {
  flex: 1;
  min-width: 110px;
  padding: 0.85rem 0.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.dc__tab:hover  { color: #1d4ed8; }
.dc__tab.active { color: #1d4ed8; border-bottom-color: #1d4ed8; }

/* ── Panel ────────────────────────────────────────────────────────────────── */

.dc__panel { padding: clamp(1rem, 3vw, 1.75rem); }

/* ── Presets row ─────────────────────────────────────────────────────────── */

.dc__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.dc__preset {
  padding: 0.38rem 0.9rem;
  border-radius: 20px;
  border: none;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  transition: filter 0.15s, transform 0.1s;
}

.dc__preset:hover  { filter: brightness(1.1); }
.dc__preset:active { transform: scale(0.97); }
.dc__preset.active { box-shadow: 0 0 0 3px rgba(0,0,0,0.2) inset; }

/* Preset colors */
.dc__preset[data-d="7"]   { background: #6366f1; }
.dc__preset[data-d="14"]  { background: #8b5cf6; }
.dc__preset[data-d="30"]  { background: #0ea5e9; }
.dc__preset[data-d="45"]  { background: #1d4ed8; }
.dc__preset[data-d="60"]  { background: #0891b2; }
.dc__preset[data-d="90"]  { background: #059669; }
.dc__preset[data-d="180"] { background: #d97706; }
.dc__preset[data-d="365"] { background: #dc2626; }

/* ── Form box ────────────────────────────────────────────────────────────── */

.dc__form-box {
  background: #fff;
  border: 1.5px solid #bae6fd;
  border-radius: 14px;
  padding: 1.35rem;
  margin-bottom: 1.4rem;
}

.dc__form-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 0.85rem;
  align-items: end;
}

@media (max-width: 580px) {
  .dc__form-grid { grid-template-columns: 1fr 1fr; }
  .dc__dir-group { grid-column: 1 / -1; }
}

.dc__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  color: #1d4ed8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.dc__input {
  width: 100%;
  padding: 0.72rem 0.9rem;
  border: 1.5px solid #bae6fd;
  border-radius: 9px;
  font-size: 1rem;
  color: #0c2151;
  background: #f0f9ff;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dc__input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
  background: #fff;
}

/* Direction toggle */
.dc__dir-group { display: flex; flex-direction: column; }
.dc__dir-btns  { display: flex; gap: 0.35rem; margin-top: 0.35rem; }

.dc__dir-btn {
  flex: 1;
  padding: 0.72rem 0.6rem;
  border: 1.5px solid #bae6fd;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  background: #f0f9ff;
  color: #0ea5e9;
  transition: all 0.2s;
}

.dc__dir-btn.active {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

/* Calculate button */
.dc__calc-btn {
  width: 100%;
  margin-top: 1rem;
  padding: 0.88rem;
  background: linear-gradient(135deg, #1d4ed8 0%, #0369a1 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(29,78,216,0.28);
  transition: filter 0.15s, transform 0.1s;
}

.dc__calc-btn:hover  { filter: brightness(1.07); }
.dc__calc-btn:active { transform: scale(0.99); }

/* ── Result layout ───────────────────────────────────────────────────────── */

.dc__result-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 620px) { .dc__result-layout { grid-template-columns: 1fr; } }

/* ── Result card ─────────────────────────────────────────────────────────── */

.dc__result-card {
  background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
  border: 1.5px solid #93c5fd;
  border-radius: 14px;
  padding: 1.5rem;
}

.dc__result-eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  color: #1d4ed8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.dc__result-date {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 900;
  color: #1e3a8a;
  line-height: 1.1;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.dc__result-dow {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 1.1rem;
}

/* Stat chips */
.dc__stat-chips { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 1.1rem; }

.dc__stat-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.5rem 0.85rem;
  background: #fff;
  border: 1.5px solid #93c5fd;
  border-radius: 9px;
}

.dc__stat-chip .sc-val  { font-size: 1.1rem; font-weight: 900; color: #1e3a8a; line-height: 1; }
.dc__stat-chip .sc-lbl  { font-size: 0.68rem; font-weight: 700; color: #1d4ed8; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.15rem; }

/* Timeline */
.dc__timeline {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1.5px solid #93c5fd;
  border-radius: 10px;
}

.dc__timeline-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 0.5rem;
}

.dc__timeline-bar {
  height: 8px;
  background: #e0f2fe;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.dc__timeline-fill {
  height: 100%;
  background: linear-gradient(90deg, #1d4ed8, #0ea5e9);
  border-radius: 999px;
  transition: width 0.5s ease;
}

.dc__timeline-today {
  position: absolute;
  top: -3px;
  width: 14px;
  height: 14px;
  background: #fbbf24;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transform: translateX(-50%);
}

.dc__timeline-dates {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 0.4rem;
}

/* Copy button */
.dc__copy-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  padding: 0.48rem 0.9rem;
  background: #1d4ed8;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s;
}

.dc__copy-btn:hover { filter: brightness(1.1); }

/* ── Mini Calendar ───────────────────────────────────────────────────────── */

.dc__mini-cal {
  background: #fff;
  border: 1.5px solid #bae6fd;
  border-radius: 12px;
  padding: 0.9rem;
  min-width: 200px;
}

.dc__cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.dc__cal-month {
  font-size: 0.9rem;
  font-weight: 900;
  color: #1e3a8a;
}

.dc__cal-nav {
  background: none;
  border: none;
  color: #0ea5e9;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  transition: background 0.15s;
}

.dc__cal-nav:hover { background: #e0f2fe; }

.dc__cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.dc__cal-dow {
  font-size: 0.62rem;
  font-weight: 800;
  color: #94a3b8;
  text-align: center;
  text-transform: uppercase;
  padding: 0.3rem 0;
}

.dc__cal-cell {
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  padding: 0.3rem 0.1rem;
  border-radius: 6px;
  color: #374151;
  cursor: default;
  transition: background 0.1s;
}

.dc__cal-cell.empty    { color: transparent; }
.dc__cal-cell.weekend  { color: #94a3b8; }
.dc__cal-cell.today-m  { background: #fef9c3; color: #92400e; font-weight: 900; }
.dc__cal-cell.start-d  { background: #dbeafe; color: #1d4ed8; font-weight: 900; border-radius: 6px; }
.dc__cal-cell.result-d {
  background: #1d4ed8;
  color: #fff;
  font-weight: 900;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.dc__cal-cell.in-range { background: #dbeafe; color: #1e3a8a; }

/* ── Days Between ────────────────────────────────────────────────────────── */

.dc__between-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}

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

.dc__between-arrow {
  font-size: 1.4rem;
  color: #0ea5e9;
  padding-bottom: 0.7rem;
  text-align: center;
}

.dc__between-result {
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  border: 1.5px solid #93c5fd;
  border-radius: 14px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.dc__big-number {
  font-size: 3.5rem;
  font-weight: 900;
  color: #1e3a8a;
  line-height: 1;
  letter-spacing: -0.02em;
}

.dc__big-unit {
  font-size: 1rem;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 1.25rem;
}

.dc__breakdown-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.dc__breakdown-chip {
  background: #fff;
  border: 1.5px solid #93c5fd;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  text-align: center;
}

.dc__breakdown-chip .bval { display: block; font-size: 1.2rem; font-weight: 900; color: #1e3a8a; }
.dc__breakdown-chip .blbl { display: block; font-size: 0.7rem; font-weight: 700; color: #1d4ed8; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.1rem; }

/* ── Business Days ───────────────────────────────────────────────────────── */

.dc__biz-result {
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  border: 1.5px solid #93c5fd;
  border-radius: 14px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.dc__skip-info {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 9px;
  font-size: 0.85rem;
  color: #92400e;
  font-weight: 600;
  margin-top: 1rem;
}

/* ── Multi-view table ────────────────────────────────────────────────────── */

.dc__multi-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1.5px solid #bae6fd;
  margin-top: 1rem;
}

.dc__multi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: #fff;
  min-width: 520px;
}

.dc__multi-table th {
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, #1d4ed8, #0369a1);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dc__multi-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #e0f2fe;
  color: #374151;
  font-weight: 600;
  vertical-align: middle;
}

.dc__multi-table tr:last-child td { border-bottom: none; }
.dc__multi-table tr:hover td { background: #f0f9ff; }
.dc__multi-table tr.highlight-45 td { background: #dbeafe; color: #1e3a8a; font-weight: 800; }

.dc__dot-badge {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
  flex-shrink: 0;
}

.dc__from-today-chip {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
}

.dc__from-today-chip.past   { background: #fef2f2; color: #dc2626; }
.dc__from-today-chip.future { background: #f0f9ff; color: #0369a1; }
.dc__from-today-chip.today  { background: #fef9c3; color: #92400e; }

/* ── Shared ──────────────────────────────────────────────────────────────── */

.dc__section-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #1d4ed8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.dc__btn-ghost {
  padding: 0.48rem 0.9rem;
  border: 1.5px solid #bae6fd;
  border-radius: 8px;
  background: transparent;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.dc__btn-ghost:hover { background: #e0f2fe; }

.dc__empty {
  text-align: center;
  padding: 2rem;
  color: #94a3b8;
  font-size: 0.93rem;
}

.dc__tip {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  border-radius: 9px;
  font-size: 0.83rem;
  color: #0369a1;
  font-weight: 600;
  margin-top: 0.85rem;
}
