﻿:root {
  --ink: #eff7ff;
  --muted: #a9c0d6;
  --accent: #57c3ff;
  --accent-2: #ffb562;
  --panel: rgba(8, 24, 42, 0.92);
  --panel-soft: rgba(17, 37, 58, 0.84);
  --surface: #071827;
  --surface-2: #10263a;
  --stroke: rgba(169, 192, 214, 0.18);
  --stroke-strong: rgba(169, 192, 214, 0.34);
  --glow: rgba(87, 195, 255, 0.18);
  --heading: #ffffff;
  --heading-soft: #dce9f5;
  --focus: rgba(87, 195, 255, 0.32);
  --shadow: 0 22px 42px rgba(3, 10, 18, 0.34);
  --font-display: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --font-body: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.5;
  letter-spacing: 0.01em;
  background: var(--surface);
  color: var(--ink);
  transition: background 180ms ease, color 180ms ease;
}

body.theme-day {
  --ink: #10263a;
  --muted: #4f6780;
  --accent: #0f91d2;
  --accent-2: #ffb562;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-soft: rgba(244, 249, 253, 0.95);
  --surface: #eef6fb;
  --surface-2: #f6fbfe;
  --stroke: rgba(16, 38, 58, 0.12);
  --stroke-strong: rgba(16, 38, 58, 0.24);
  --glow: rgba(87, 195, 255, 0.18);
  --heading: #10263a;
  --heading-soft: #264560;
  --focus: rgba(15, 145, 210, 0.22);
  --shadow: 0 22px 48px rgba(16, 38, 58, 0.12);
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 181, 98, 0.22), transparent 42%),
    radial-gradient(circle at 86% 14%, rgba(87, 195, 255, 0.22), transparent 36%),
    radial-gradient(circle at 78% 80%, rgba(87, 195, 255, 0.14), transparent 40%),
    linear-gradient(145deg, #fcfeff 0%, var(--surface) 42%, var(--surface-2) 100%);
  z-index: -1;
}

body.theme-night .bg {
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 181, 98, 0.14), transparent 38%),
    radial-gradient(circle at 88% 14%, rgba(87, 195, 255, 0.18), transparent 34%),
    radial-gradient(circle at 76% 84%, rgba(87, 195, 255, 0.12), transparent 40%),
    linear-gradient(145deg, #04111d 0%, var(--surface) 44%, var(--surface-2) 100%);
}

.hero {
  padding: 2rem 6vw 1.15rem;
}

.hero-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 1.4rem 1.5rem 1.35rem;
  border-radius: 28px;
  border: 1px solid var(--stroke);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.12), var(--panel));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  animation: enter-up 320ms ease both;
}

.hero-inner::before,
.hero-inner::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero-inner::before {
  top: -6rem;
  left: -5rem;
  width: 18rem;
  height: 18rem;
  background: radial-gradient(circle, rgba(248, 187, 157, 0.34), transparent 68%);
}

.hero-inner::after {
  right: -3rem;
  bottom: -6rem;
  width: 22rem;
  height: 22rem;
  background: radial-gradient(circle, rgba(144, 187, 181, 0.22), transparent 70%);
}

.hero-inner > * {
  position: relative;
  z-index: 1;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 1.2rem;
  flex-wrap: wrap;
}

.hero-brand,
.hero-meta-actions,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.brand-logo {
  width: auto;
  height: 2.6rem;
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 16px;
  background: #10263a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.footer-logo {
  height: 2rem;
  padding: 0.35rem 0.58rem;
  border-radius: 12px;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.36rem 0.84rem;
  border: 1px solid rgba(15, 145, 210, 0.22);
  background: rgba(87, 195, 255, 0.12);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.signature {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0.62rem 0 0.25rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 3.8vw, 3.1rem);
  line-height: 1.06;
  font-weight: 700;
  color: var(--heading);
}

h2 {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--heading);
}

h3 {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--heading-soft);
}

p {
  margin: 0.35rem 0;
  color: var(--muted);
}

.hero-actions {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem 1rem;
  flex-wrap: wrap;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 145, 210, 0.26);
  background: linear-gradient(135deg, rgba(87, 195, 255, 0.22), rgba(255, 181, 98, 0.2));
  color: var(--heading);
  border-radius: 999px;
  padding: 0.72rem 1.2rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.16),
    0 0 0 1px rgba(15, 145, 210, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.primary-action:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.2),
    0 0 0 4px var(--glow);
}

.primary-action:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px var(--focus),
    0 14px 28px rgba(0, 0, 0, 0.2);
}

.hero-action-hint {
  max-width: 38rem;
  font-size: 0.88rem;
  color: var(--heading-soft);
}

.mode {
  margin-top: 1rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel-soft);
  padding: 0.4rem 0.95rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.pill:hover {
  border-color: var(--accent);
}

.pill input {
  accent-color: var(--accent);
}

.theme-toggle {
  margin-left: auto;
  border: 1px solid var(--stroke);
  background: var(--panel-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.38rem 0.85rem;
  font: inherit;
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.theme-toggle:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}

.layout {
  max-width: 1340px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(560px, 1.22fr) minmax(360px, 0.98fr);
  gap: 1.15rem;
  padding: 0 6vw 2.4rem;
  align-items: start;
}

.card {
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  padding: 1.2rem 1.25rem 1.3rem;
  box-shadow: var(--shadow);
  animation: enter-up 340ms ease both;
}

.card:nth-of-type(2) {
  animation-delay: 50ms;
}

.card:nth-of-type(3) {
  animation-delay: 95ms;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.95rem;
}

.card-head--aligned {
  align-items: flex-start;
}

.card-head--aligned > div {
  display: grid;
  gap: 0.18rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.primary {
  grid-column: 1;
}

.results {
  grid-column: 2;
  position: sticky;
  top: 1rem;
  z-index: 4;
  align-self: start;
  display: grid;
  gap: 0.95rem;
}

.solver {
  grid-column: 2;
  z-index: 1;
  align-self: start;
  border-color: rgba(81, 124, 118, 0.24);
}

.chip {
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(81, 124, 118, 0.24);
  background: rgba(144, 187, 181, 0.14);
  color: var(--accent);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
  margin-bottom: 0.8rem;
  min-width: 0;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--heading-soft);
}

.field.big input {
  font-size: 1.06rem;
  font-weight: 600;
  padding: 0.66rem 0.72rem;
}

input,
select,
textarea {
  min-height: 2.45rem;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--panel-soft);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.53rem 0.62rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(158, 177, 196, 0.82);
}

input[type="checkbox"],
input[type="radio"] {
  min-height: 1rem;
  width: 1rem;
  margin-top: 0.08rem;
}

input:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

input[readonly] {
  background: rgba(148, 169, 190, 0.12);
  border-style: dashed;
  cursor: default;
}

body.theme-day input[readonly] {
  background: rgba(84, 112, 136, 0.1);
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.7rem;
}

.row:last-child {
  margin-bottom: 0;
}

.row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.hint.compact {
  margin: 0.2rem 0 0.45rem;
}

.quick-read {
  margin-top: 0;
  font-size: 0.83rem;
}

.results-empty {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.results-support {
  display: grid;
  gap: 0.85rem;
}

.result-detail-card {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.result-detail-card > summary {
  font-size: 0.84rem;
  letter-spacing: 0.08em;
}

.calc-panel--embedded {
  margin-top: 0;
}

.solver-intro {
  margin: -0.2rem 0 0.15rem;
}

.details {
  margin-top: 0.85rem;
  border-top: 1px solid var(--stroke);
  padding-top: 0.85rem;
}

.details > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: rgba(144, 187, 181, 0.09);
  color: var(--heading-soft);
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.54rem 0.72rem;
}

#advanced_panel > summary {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.86rem;
  padding: 0.54rem 0.72rem;
  background:
    linear-gradient(140deg, rgba(144, 187, 181, 0.17), rgba(17, 29, 40, 0.55)),
    rgba(17, 29, 40, 0.58);
}

body.theme-day #advanced_panel > summary {
  background:
    linear-gradient(140deg, rgba(144, 187, 181, 0.18), rgba(244, 250, 255, 0.92)),
    rgba(244, 250, 255, 0.95);
}

#advanced_panel > summary::after {
  content: "▾";
  font-size: 0.82rem;
  color: var(--accent);
  transition: transform 140ms ease;
}

#advanced_panel[open] > summary::after {
  content: "▾";
  transform: rotate(180deg);
}

#advanced_panel[open] > summary {
  position: sticky;
  top: 0.6rem;
  z-index: 9;
  border-color: rgba(81, 124, 118, 0.36);
  background:
    linear-gradient(140deg, rgba(144, 187, 181, 0.26), rgba(17, 29, 40, 0.9)),
    rgba(17, 29, 40, 0.94);
  backdrop-filter: blur(5px);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(81, 124, 118, 0.14);
}

body.theme-day #advanced_panel[open] > summary {
  border-color: rgba(81, 124, 118, 0.32);
  background:
    linear-gradient(140deg, rgba(144, 187, 181, 0.24), rgba(244, 250, 255, 0.96)),
    rgba(244, 250, 255, 0.98);
  box-shadow:
    0 10px 20px rgba(35, 56, 75, 0.16),
    0 0 0 1px rgba(81, 124, 118, 0.12);
}

.summary-pill {
  border-radius: 999px;
  border: 1px solid rgba(81, 124, 118, 0.24);
  background: rgba(144, 187, 181, 0.14);
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.18rem 0.58rem;
}

.details > summary::-webkit-details-marker {
  display: none;
}

.details > summary::after {
  content: "+";
  color: var(--accent);
  font-size: 0.95rem;
  line-height: 1;
}

.details[open] > summary::after {
  content: "-";
}

.details-body {
  margin-top: 0.92rem;
  display: grid;
  gap: 0.85rem;
}

#advanced_panel .details-body {
  max-height: min(70vh, 760px);
  overflow: auto;
  padding-right: 0.2rem;
  scroll-behavior: smooth;
  scroll-padding-top: 3.2rem;
}

.advanced-overview {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.65rem 0.78rem;
  background: rgba(17, 29, 40, 0.52);
}

body.theme-day .advanced-overview {
  background: rgba(244, 250, 255, 0.88);
}

.advanced-meta {
  margin-top: 0.16rem;
  color: var(--heading-soft);
  font-size: 0.82rem;
}

.advanced-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.46rem;
}

#advanced_panel .advanced-nav {
  position: sticky;
  top: 0;
  z-index: 8;
  padding: 0.14rem 0 0.3rem;
  background:
    linear-gradient(to bottom, rgba(12, 20, 28, 0.96), rgba(12, 20, 28, 0.78), transparent);
}

body.theme-day #advanced_panel .advanced-nav {
  background:
    linear-gradient(to bottom, rgba(244, 250, 255, 0.98), rgba(244, 250, 255, 0.82), transparent);
}

#advanced_panel .advanced-nav.is-floating {
  border: 1px solid rgba(81, 124, 118, 0.2);
  border-radius: 10px;
  padding: 0.24rem 0.38rem;
  background: rgba(12, 20, 28, 0.94);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

body.theme-day #advanced_panel .advanced-nav.is-floating {
  border-color: rgba(81, 124, 118, 0.2);
  background: rgba(244, 250, 255, 0.96);
  box-shadow: 0 8px 16px rgba(35, 56, 75, 0.12);
}

.advanced-nav-btn {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  padding: 0.26rem 0.62rem;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.advanced-nav-btn:hover {
  border-color: var(--accent);
}

.advanced-nav-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}

.advanced-nav-btn.is-active {
  border-color: rgba(81, 124, 118, 0.34);
  background: rgba(144, 187, 181, 0.2);
  color: var(--heading);
}

.fold-section {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(14, 24, 34, 0.3);
  overflow: hidden;
  scroll-margin-top: 2.9rem;
}

body.theme-day .fold-section {
  background: rgba(244, 250, 255, 0.74);
}

.fold-section > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.64rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--heading-soft);
  border-bottom: 1px solid transparent;
  background: rgba(17, 29, 40, 0.72);
  border-radius: 10px;
}

#advanced_panel .fold-section > summary {
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  padding: 0.48rem 0.68rem;
  text-transform: none;
  letter-spacing: 0.01em;
}

.fold-section > summary::-webkit-details-marker {
  display: none;
}

.fold-section > summary::after {
  content: "+";
  color: var(--accent);
  font-size: 0.95rem;
  line-height: 1;
}

.fold-section[open] > summary {
  border-bottom-color: var(--stroke);
  background: rgba(144, 187, 181, 0.14);
  border-radius: 10px 10px 0 0;
}

.fold-section[open] > summary::after {
  content: "-";
}

.fold-section-body {
  padding: 0.78rem 0.82rem 0.84rem;
}

.fold-summary-main {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
}

.fold-summary-title {
  color: var(--heading-soft);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
}

.fold-summary-desc {
  display: none;
}

.fold-summary-badge {
  min-width: 1.45rem;
  margin-left: auto;
  text-align: center;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 700;
  padding: 0.06rem 0.34rem;
}

.fold-summary-badge.has-changes {
  border-color: rgba(81, 124, 118, 0.34);
  color: var(--accent);
  background: rgba(144, 187, 181, 0.15);
}

#advanced_panel .fold-section > summary::after {
  content: "▾";
  margin-left: 0.34rem;
  color: var(--muted);
  font-size: 0.8rem;
  transition: transform 140ms ease;
}

#advanced_panel .fold-section[open] > summary::after {
  content: "▾";
  transform: rotate(180deg);
  color: var(--accent);
}

body.theme-day .fold-section > summary {
  background: rgba(244, 250, 255, 0.97);
}

#advanced_panel .fold-section[open] > summary {
  position: static;
  box-shadow: none;
}

#advanced_panel .fold-summary-badge {
  display: none;
}

.subsection {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.82rem;
  background: rgba(14, 24, 34, 0.28);
}

body.theme-day .subsection {
  background: rgba(244, 250, 255, 0.72);
}

.subsection > h3 {
  margin-bottom: 0.68rem;
}

.switch {
  display: flex;
  align-items: flex-start;
  gap: 0.56rem;
}

.switch span {
  line-height: 1.32;
}

.advanced-block {
  margin-top: 0.2rem;
  padding: 0.76rem;
  border-radius: 12px;
  border: 1px dashed var(--stroke-strong);
  background: rgba(144, 187, 181, 0.09);
}

.bonus-details {
  background:
    linear-gradient(152deg, rgba(144, 187, 181, 0.14), rgba(14, 24, 34, 0.7)),
    rgba(14, 24, 34, 0.76);
  border: 1px solid rgba(81, 124, 118, 0.26);
}

body.theme-day .bonus-details {
  background:
    linear-gradient(152deg, rgba(144, 187, 181, 0.16), rgba(244, 250, 255, 0.96)),
    rgba(244, 250, 255, 0.92);
  border: 1px solid rgba(81, 124, 118, 0.24);
}

.bonus-details-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.8rem 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.72rem;
}

.bonus-kicker {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.bonus-table-field {
  margin-bottom: 0;
  min-width: min(320px, 100%);
  flex: 1 1 320px;
}

.bonus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.72rem;
}

.bonus-lane {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.75rem;
  background: var(--panel-soft);
}

.bonus-lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.58rem;
}

.bonus-lane-head h4 {
  margin: 0;
  font-size: 0.83rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--heading-soft);
}

.bonus-chip {
  border-radius: 999px;
  border: 1px solid rgba(248, 187, 157, 0.36);
  background: rgba(248, 187, 157, 0.14);
  color: #fff3ed;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.54rem;
}

body.theme-day .bonus-chip {
  border-color: rgba(174, 116, 90, 0.26);
  background: rgba(248, 187, 157, 0.2);
  color: #7b5340;
}

.bonus-lane .field:last-child {
  margin-bottom: 0;
}

.bonus-lane input[type="number"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#bonus_details .row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#bonus_details .row-2 > * {
  min-width: 0;
}

.employment-aid-scheme-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.72rem;
}

.employment-aid-empty {
  padding: 0.72rem 0.8rem;
  border-radius: 12px;
  border: 1px dashed var(--stroke);
  background: rgba(14, 24, 34, 0.18);
  color: var(--muted);
}

body.theme-day .employment-aid-empty {
  background: rgba(244, 250, 255, 0.66);
}

.employment-aid-card {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.78rem;
  background: var(--panel-soft);
  display: grid;
  gap: 0.48rem;
}

.employment-aid-card.is-selected {
  border-color: rgba(81, 124, 118, 0.34);
  box-shadow: 0 10px 20px rgba(81, 124, 118, 0.08);
}

.employment-aid-card.is-disabled {
  opacity: 0.76;
}

.employment-aid-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.7rem;
}

.employment-aid-card-title {
  margin: 0;
  color: var(--heading-soft);
  font-size: 0.92rem;
}

.employment-aid-card-title .switch {
  gap: 0.48rem;
}

.employment-aid-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.employment-aid-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.18rem 0.54rem;
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.employment-aid-pill.status-eligible_confirmed,
.employment-aid-pill.status-eligible_administrative_pending,
.employment-aid-pill.status-eligible_theoretical {
  border-color: rgba(81, 124, 118, 0.34);
  background: rgba(144, 187, 181, 0.15);
  color: var(--accent);
}

.employment-aid-pill.status-to_be_confirmed {
  border-color: rgba(243, 196, 104, 0.42);
  background: rgba(243, 196, 104, 0.14);
  color: #ffe6a8;
}

.employment-aid-pill.status-ineligible,
.employment-aid-pill.status-incomplete {
  border-color: rgba(248, 187, 157, 0.36);
  background: rgba(248, 187, 157, 0.14);
  color: #fff3ed;
}

body.theme-day .employment-aid-pill.status-ineligible,
body.theme-day .employment-aid-pill.status-incomplete {
  color: #8a5d49;
}

body.theme-day .employment-aid-pill.status-to_be_confirmed {
  color: #8a6a1d;
}

.employment-aid-card-amount {
  color: var(--heading);
  font-family: "Consolas", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.employment-aid-card-note {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.38;
}

.hidden {
  display: none;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.64rem;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
  justify-content: flex-start;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--panel-soft);
  padding: 0.72rem 0.78rem;
  min-height: 96px;
}

.kpi.primary {
  grid-column: span 2;
  background: linear-gradient(126deg, rgba(144, 187, 181, 0.28), var(--panel-soft));
  border-color: rgba(81, 124, 118, 0.3);
  box-shadow: 0 10px 20px rgba(81, 124, 118, 0.12);
}

.kpi-label {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.kpi-value {
  font-size: clamp(1.02rem, 1.6vw, 1.26rem);
  line-height: 1.18;
  font-weight: 650;
  color: var(--heading);
  font-family: "Consolas", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  margin-top: auto;
}

.result-grid {
  margin-top: 0.7rem;
  border: 1px solid var(--stroke);
  border-radius: 11px;
  overflow: hidden;
}

.result-sections {
  margin-top: 0.72rem;
  display: grid;
  gap: 0.64rem;
}

.result-section .fold-section-body {
  padding-top: 0.62rem;
}

.result-section .result-grid {
  margin-top: 0;
}

.result-item {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(140px, 0.9fr);
  gap: 0.44rem 0.9rem;
  align-items: start;
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--stroke);
  background: rgba(12, 20, 28, 0.25);
}

body.theme-day .result-item {
  background: rgba(244, 250, 255, 0.68);
}

.result-item:nth-child(even) {
  background: rgba(21, 34, 45, 0.34);
}

body.theme-day .result-item:nth-child(even) {
  background: rgba(235, 244, 252, 0.72);
}

.result-item:last-child {
  border-bottom: 0;
}

.result-item strong {
  color: var(--heading-soft);
  font-size: 0.83rem;
  line-height: 1.3;
}

.result-item span {
  text-align: right;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.33;
  font-variant-numeric: tabular-nums;
  font-family: "Consolas", "Courier New", monospace;
}

.result-item-notes {
  grid-template-columns: 1fr;
  gap: 0.44rem;
  border: 1px dashed rgba(81, 124, 118, 0.34);
  border-radius: 10px;
  margin: 0.45rem;
  padding: 0.62rem;
  background: rgba(144, 187, 181, 0.1);
}

.result-notes {
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.38;
}

.result-notes li + li {
  margin-top: 0.24rem;
}

.calc-panel .result-notes {
  margin-top: 0.65rem;
}

.calc-panel {
  margin-top: 1rem;
  padding: 0.8rem 0.86rem;
  border-radius: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--stroke);
}

.calc-panel--embedded {
  padding: 0.9rem 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.calc-steps {
  display: grid;
  gap: 0.48rem;
}

.step {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.88rem;
  border-bottom: 1px dashed var(--stroke);
  padding-bottom: 0.33rem;
}

.step span {
  font-family: "Consolas", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}

.annual-vacation-theory {
  margin-top: 0.36rem;
  padding: 0.6rem 0.72rem;
  border-radius: 10px;
  border: 1px dashed var(--stroke);
  background: var(--panel-soft);
}

.annual-vacation-theory strong {
  display: block;
  color: var(--heading-soft);
  margin-bottom: 0.34rem;
}

.annual-vacation-theory ul {
  margin: 0;
  padding-left: 1rem;
}

.annual-vacation-theory li + li {
  margin-top: 0.22rem;
}

.hint a {
  color: var(--accent);
}

#reduction_help {
  margin-top: 0.25rem;
}

.footer {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  width: min(1340px, calc(100% - 12vw));
  margin: 0 auto 2rem;
  margin-top: auto;
  padding: 0.9rem 1rem;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-link,
.back-link {
  color: var(--accent);
  text-decoration: none;
}

.footer-brand {
  color: var(--heading);
  font-weight: 700;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(81, 124, 118, 0.24);
  background: rgba(144, 187, 181, 0.14);
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0.38rem 0.82rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel-soft);
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.footer-link:hover,
.back-link:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.footer-link:focus-visible,
.back-link:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}

.standalone-page .hero {
  padding-bottom: 0.8rem;
}

.page-shell {
  width: min(980px, calc(100% - 12vw));
  margin: 0 auto;
}

.standalone-page .page-shell {
  max-width: 980px;
}

.disclaimer-layout {
  display: grid;
  gap: 1rem;
  padding-bottom: 1rem;
}

.disclaimer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.disclaimer-card h2 {
  margin-bottom: 0.6rem;
}

.disclaimer-card p + p {
  margin-top: 0.7rem;
}

.disclaimer-list {
  margin: 0.85rem 0 0;
  padding-left: 1.05rem;
  color: var(--muted);
}

.disclaimer-list li + li {
  margin-top: 0.38rem;
}

.notice-card {
  border-color: rgba(248, 187, 157, 0.3);
  background:
    linear-gradient(145deg, rgba(248, 187, 157, 0.12), rgba(24, 50, 46, 0.96)),
    var(--panel);
}

body.theme-day .notice-card {
  background:
    linear-gradient(145deg, rgba(248, 187, 157, 0.18), rgba(255, 255, 255, 0.96)),
    var(--panel);
}

@keyframes enter-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

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

  .results {
    position: sticky;
    top: 0.7rem;
    grid-column: 1;
  }

  .solver {
    grid-column: 1;
  }

  .bonus-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .hero {
    padding: 1.6rem 5vw 0.9rem;
  }

  .hero-inner {
    padding: 1.1rem 1rem 1.05rem;
    border-radius: 22px;
  }

  .hero-meta,
  .hero-meta-actions {
    align-items: stretch;
  }

  .hero-brand,
  .hero-meta-actions,
  .footer {
    width: 100%;
    justify-content: space-between;
  }

  .hero-actions {
    align-items: stretch;
  }

  .primary-action {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .layout {
    padding: 0 5vw 2rem;
    gap: 0.95rem;
  }

  #advanced_panel[open] > summary {
    top: 0.32rem;
  }

  #advanced_panel .details-body {
    max-height: min(74vh, 680px);
  }

  .advanced-nav {
    gap: 0.38rem;
  }

  .advanced-nav-btn {
    flex: 1 1 48%;
    text-align: center;
  }

  .card {
    padding: 1rem;
  }

  .results {
    position: static;
  }

  .theme-toggle {
    margin-left: 0;
  }

  .kpi.primary {
    grid-column: span 1;
  }

  .result-item {
    grid-template-columns: 1fr;
    gap: 0.24rem;
  }

  .result-item span {
    text-align: left;
  }

  .page-shell {
    width: min(980px, calc(100% - 10vw));
  }

  .footer {
    width: calc(100% - 10vw);
    padding: 0.9rem;
  }

  .disclaimer-grid {
    grid-template-columns: 1fr;
  }

  .bonus-lane .row-2,
  .row-2 {
    grid-template-columns: 1fr;
  }
}

.auth-account-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.auth-account-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0.38rem 0.82rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 145, 210, 0.2);
  background: rgba(87, 195, 255, 0.1);
  color: var(--heading);
  font-size: 0.84rem;
  font-weight: 600;
}

.auth-router {
  width: min(980px, calc(100% - 12vw));
  margin: 0 auto 1.35rem;
}

.auth-shell {
  display: grid;
}

.auth-card {
  display: grid;
  gap: 1rem;
  padding: 1.35rem 1.4rem;
}

.auth-inline-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.auth-inline-link {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.36rem 0.74rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel-soft);
  color: var(--muted);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.auth-inline-link:hover,
.auth-inline-link:focus-visible,
.back-link.is-current {
  color: var(--ink);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
  outline: none;
}

.auth-inline-link.is-active {
  color: var(--heading);
  border-color: rgba(15, 145, 210, 0.26);
  background: rgba(87, 195, 255, 0.12);
}

.auth-form {
  display: grid;
  gap: 0.9rem;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.auth-actions .primary-action {
  width: auto;
}

.auth-footnote,
.auth-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.field-error {
  min-height: 1.1rem;
  margin: 0;
  color: #c34848;
  font-size: 0.8rem;
}

body.theme-day .field-error {
  color: #b53b3b;
}

.auth-message,
.auth-form-message {
  padding: 0.8rem 0.92rem;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  font-size: 0.92rem;
  line-height: 1.4;
}

.auth-message--info,
.auth-form-message--success {
  border-color: rgba(15, 145, 210, 0.22);
  background: rgba(87, 195, 255, 0.12);
  color: var(--heading);
}

.auth-message--error,
.auth-form-message--error {
  border-color: rgba(195, 72, 72, 0.24);
  background: rgba(195, 72, 72, 0.12);
  color: #ffd8d8;
}

body.theme-day .auth-message--error,
body.theme-day .auth-form-message--error {
  color: #8d1f1f;
}

.auth-message--success {
  border-color: rgba(81, 124, 118, 0.26);
  background: rgba(144, 187, 181, 0.16);
  color: var(--heading);
}

.auth-logout-btn {
  cursor: pointer;
  font: inherit;
}

html.auth-pending body[data-page="app"] #auth_router,
html.auth-pending body[data-page="app"] #app_route {
  visibility: hidden;
}

html.auth-pending body[data-page="app"]::after {
  content: "Vérification de la session...";
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--heading);
  box-shadow: var(--shadow);
  z-index: 20;
}

@media (max-width: 780px) {
  .auth-router {
    width: calc(100% - 10vw);
  }

  .auth-actions,
  .auth-inline-nav,
  .auth-account-actions {
    align-items: stretch;
  }

  .auth-actions .primary-action,
  .auth-actions .back-link,
  .auth-inline-link,
  .auth-account-actions .back-link,
  .auth-account-pill {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}


