:root {
  --accent: #2563eb;
  --accent-2: #f59e0b;
  --surface: #f8fafc;
  --border: #d9e3ef;
  --muted: #475569;
  --card-soft: #eef2ff;
  --result-bg: linear-gradient(180deg, #eef2ff 0%, #ecfdf3 70%, #fff 100%);
  --result-border: #c7d2fe;
  --shadow: 0 16px 32px rgba(37, 99, 235, 0.16);
}

:root.dark {
  --surface: #0f172a;
  --border: #1f2937;
  --muted: #cbd5e1;
  --card-soft: #111827;
  --result-bg: linear-gradient(180deg, #0f172a 0%, #0b1220 70%, #0b1321 100%);
  --result-border: #1f2a44;
  --shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
}

.eyebrow { margin-bottom: 4px; color: var(--accent-2); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.badge { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 999px; background: linear-gradient(120deg, var(--accent), #22c55e 60%, var(--accent-2)); color: #ecfeff; font-weight: 800; letter-spacing: .02em; }
.layout { display: grid; gap: 16px; min-width: 0; }
.two-col { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.two-col > *, .result-shell, .stat, .detail { min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.field.has-error .input { border-color: #b91c1c; background: #fef2f2; }
.error-text { min-height: 1.1em; color: #b91c1c; }
.note, .hint { color: var(--muted); }
.hint { font-size: .95rem; }
.section-title { margin: 0 0 8px; font-weight: 800; }
.choice-row { display: flex; flex-wrap: wrap; gap: 12px; min-width: 0; }
.choice-row > .input { min-width: 0; max-width: 100%; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; overflow-wrap: anywhere; cursor: pointer; }
.pill input { accent-color: var(--accent); }
.result-shell { padding: 16px; border: 1px solid var(--result-border); border-radius: 16px; background: var(--result-bg); box-shadow: var(--shadow); }
.result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.primary-value { margin: 4px 0; font-size: clamp(1.75rem, 7vw, 2.3rem); font-weight: 800; }
.range { color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 10px; margin-top: 12px; }
.stat { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255, 255, 255, .9); }
:root.dark .stat { background: rgba(15, 23, 42, .85); }
.stat .label { color: var(--muted); font-weight: 700; }
.stat .value { font-size: 1.2rem; font-weight: 800; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.detail { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
:root.dark .detail { background: rgba(15, 23, 42, .6); }
.detail h3 { margin: 0 0 6px; font-size: 1.05rem; }
.detail ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.detail li { display: flex; justify-content: space-between; gap: 10px; min-width: 0; }
.detail .label { color: var(--muted); }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ad-slot { display: grid; min-height: 200px; border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); place-items: center; }
.is-hidden { display: none !important; }
#how-section, #faq, #related { border-color: var(--border); background: var(--card-soft); }
.result-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 0; }
.chip { display: inline-flex; align-items: center; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255, 255, 255, .9); font-weight: 800; }
.chip.muted { color: var(--muted); font-weight: 700; }
:root.dark .chip { background: rgba(15, 23, 42, .85); }
.fy-preset-group { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.fy-preset-group [data-fy-start-preset][aria-pressed="true"] { border-color: var(--accent); background: var(--card-soft); box-shadow: 0 0 0 2px rgba(37, 99, 235, .25); }
.machine-output { display: inline-block; max-width: 100%; direction: ltr; overflow-wrap: anywhere; unicode-bidi: isolate; }
.detail li > *, .range, .primary-value, .chip, #result-summary-text, #results-status { min-width: 0; overflow-wrap: anywhere; }
.chip, .fy-preset-group .button { max-width: 100%; white-space: normal; }
body[data-calculator-slug="week-quarter-fiscal-year"] header.container h1,
body[data-calculator-slug="week-quarter-fiscal-year"] .global-nav-drawer-panel,
body[data-calculator-slug="week-quarter-fiscal-year"] .global-nav-menu,
body[data-calculator-slug="week-quarter-fiscal-year"] .global-nav-panel,
body[data-calculator-slug="week-quarter-fiscal-year"] .global-nav-panel a,
body[data-calculator-slug="week-quarter-fiscal-year"] .global-nav-menu summary {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (min-width: 1080px) {
  .two-col { grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); }
}
