:root {
  --bg0: #070a12;
  --bg1: #0b1020;
  --card: rgba(255, 255, 255, 0.88);
  --text: #0b1220;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.12);

  --shadow: 0 18px 40px rgba(2, 6, 23, 0.20);
  --shadow-soft: 0 10px 26px rgba(2, 6, 23, 0.14);

  --radius: 18px;

  --brandA: #2563eb;
  --brandB: #8b5cf6;
  --brandC: #14b8a6;
  --brandD: #f97316;

  --danger: #b91c1c;
  --focus: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 15% 0%, rgba(37, 99, 235, 0.35), transparent 55%),
    radial-gradient(900px 600px at 90% 10%, rgba(139, 92, 246, 0.28), transparent 55%),
    radial-gradient(800px 600px at 60% 95%, rgba(20, 184, 166, 0.22), transparent 55%),
    linear-gradient(180deg, #f6f7fb 0%, #eef2ff 55%, #f8fafc 100%);
}

.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page {
  min-height: 100%;
  padding: 22px 18px;
  display: grid;
  gap: 14px;
  place-items: start center; /* centers the card horizontally */
}

/* Center the main card, constrain width */
.card {
  width: min(980px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.78));
  padding: 18px;
  backdrop-filter: blur(8px);
}

@media (min-width: 760px) {
  .card { padding: 24px; }
}

.headerCentered {
  text-align: center;
}

.header .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.8rem;
  background: linear-gradient(90deg, rgba(37,99,235,0.18), rgba(139,92,246,0.18));
  border: 1px solid rgba(37,99,235,0.20);
}

.header h1 {
  margin: 10px 0 6px;
  font-size: clamp(1.6rem, 2.8vw, 2.15rem);
}

.subhead {
  margin: 0 auto;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.45;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  background: rgba(2, 6, 23, 0.06);
  padding: 2px 6px;
  border-radius: 8px;
}

/* Form layout */
.grid {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px 18px;
  }
}

.field label {
  display: inline-block;
  font-weight: 700;
  margin: 0 0 6px;
}

.hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.25;
}

.hint.tiny { font-size: 0.86rem; }
.error {
  margin: 6px 0 0;
  color: var(--danger);
  font-weight: 650;
  font-size: 0.93rem;
  min-height: 1.15em;
}

/* Inputs */
.inputWrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 16px rgba(2, 6, 23, 0.06);
}

.inputWrap:focus-within {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 8px 16px rgba(2, 6, 23, 0.08);
  border-color: rgba(37, 99, 235, 0.40);
}

.prefix {
  font-weight: 800;
  opacity: 0.7;
}

input[type="number"],
input[type="date"],
input[type="month"],
select{
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 1rem;
  outline: none;
  box-shadow: 0 8px 16px rgba(2, 6, 23, 0.06);
}

input[type="number"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
select:focus{
  box-shadow: var(--focus), 0 8px 16px rgba(2, 6, 23, 0.08);
  border-color: rgba(37, 99, 235, 0.44);
}

input[aria-invalid="true"] {
  border-color: rgba(185, 28, 28, 0.55);
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.12);
}

.monthYearRow {
  display: flex;
  gap: 10px;
}

.monthYearSelect {
  flex: 1 1 0;
}

/* Buttons */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.actionsCentered {
  justify-content: center;
}

.btn {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255,255,255,0.78);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.btn:hover { transform: translateY(-1px); }

.btn.primary {
  background: linear-gradient(135deg, rgba(37,99,235,0.95), rgba(139,92,246,0.90));
  color: white;
  border-color: rgba(37, 99, 235, 0.35);
}

.btn.ghost {
  background: rgba(255,255,255,0.55);
}

.btn.tiny {
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.92rem;
}

.toggleRow {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.toggleLine {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.75), rgba(255,255,255,0.58));
  box-shadow: 0 8px 16px rgba(2, 6, 23, 0.06);
}

.toggleTitle {
  font-weight: 850;
}

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  flex: 0 0 auto;
}

.switch input { display: none; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 6, 23, 0.16);
  transition: .2s;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  top: 3px;
  background: white;
  transition: .2s;
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(2, 6, 23, 0.18);
}

.switch input:checked + .slider {
  background: linear-gradient(135deg, rgba(20,184,166,0.86), rgba(37,99,235,0.86));
}

.switch input:checked + .slider:before {
  transform: translateX(22px);
}

/* Results */
.results {
  margin-top: 16px;
  border-top: 1px dashed rgba(15, 23, 42, 0.20);
  padding-top: 14px;
  display: none;
}

.results.show { display: block; }

.resultsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resultsHeaderRight {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 850;
  font-size: 0.85rem;
  background: rgba(2, 6, 23, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.10);
}

.resultsGrid {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

@media (min-width: 900px) {
  .resultsGrid { grid-template-columns: 1fr 1fr; }
}

.resultItem {
  border-radius: 18px;
  padding: 14px 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255,255,255,0.72);
  box-shadow: var(--shadow-soft);
}

.resultItem .label {
  font-weight: 850;
  color: rgba(2,6,23,0.72);
}

.resultItem .value {
  font-size: 1.45rem;
  font-weight: 950;
  margin-top: 6px;
}

.resultItem .mini {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.accentA { border-color: rgba(37,99,235,0.22); }
.accentB { border-color: rgba(139,92,246,0.22); }
.accentC { border-color: rgba(20,184,166,0.22); }
.accentD { border-color: rgba(249,115,22,0.22); }

.note {
  margin-top: 12px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255,255,255,0.60);
  color: rgba(2,6,23,0.76);
}

/* Schedule table */
.scheduleSection {
  margin-top: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.66);
  box-shadow: var(--shadow-soft);
}

.scheduleHeader {
  padding: 12px 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.10);
}

.scheduleHeader h3 {
  margin: 0;
  font-size: 1.05rem;
}

.tableWrap {
  max-height: 320px;
  overflow: auto;
}

.scheduleTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.scheduleTable th,
.scheduleTable td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.scheduleTable th {
  position: sticky;
  top: 0;
  background: rgba(248,250,252,0.95);
  text-align: left;
  font-weight: 900;
}

.scheduleTable td.right,
.scheduleTable th.right {
  text-align: right;
}

/* Footer */
.footer {
  color: rgba(2,6,23,0.62);
  font-size: 0.95rem;
  max-width: 980px;
  margin: 0 auto;
}
