/* Schweizer Rechner / Calculateurs suisses — shared stylesheet */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1b1f24;
  --muted: #5b6470;
  --line: #e1e5ea;
  --accent: #c8102e;
  --accent-ink: #ffffff;
  --ok: #1d7a46;
  --ok-bg: #e7f5ec;
  --warn: #8a4b00;
  --warn-bg: #fff3df;
  --radius: 12px;
  --wrap: 760px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418; --card: #1a1f25; --text: #e8ebef; --muted: #a3acb8; --line: #2c333c;
    --accent: #ff5a6e; --accent-ink: #111418;
    --ok: #6fd49b; --ok-bg: #16301f; --warn: #ffc56b; --warn-bg: #36280f;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--card); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Header / footer */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); text-decoration: none; }
.brand svg { flex: none; }
.lang { display: flex; gap: .25rem; font-size: .9rem; }
.lang a, .lang span { padding: .2rem .55rem; border-radius: 999px; text-decoration: none; border: 1px solid var(--line); }
.lang span { background: var(--text); color: var(--bg); border-color: var(--text); }
.site-footer { margin-top: 3rem; padding: 2rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: .5rem; }

/* Content */
main { padding: 1.5rem 0 1rem; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.2; margin: .5rem 0 .5rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 .5rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 .3rem; }
.lead { color: var(--muted); font-size: 1.05rem; margin-top: 0; }
.stand { color: var(--muted); font-size: .9rem; }
.formula { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: .6rem .9rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95rem; overflow-x: auto; }
.crumbs { font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* Tool card */
.tool { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin: 1.2rem 0; box-shadow: 0 1px 2px rgb(0 0 0 / .04); }
.tool h2 { margin-top: 0; font-size: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; align-items: end; }
label, legend { font-weight: 600; font-size: .95rem; }
fieldset { border: 0; padding: 0; margin: 0 0 .9rem; }
.choice { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; font-weight: 400; }
.choice label { font-weight: 400; display: inline-flex; gap: .4rem; align-items: center; }
input[type=text], input[type=number], input[type=time], select {
  width: 100%; font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; min-height: 44px;
}
input:focus, select:focus { border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
button { font: inherit; cursor: pointer; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: .6rem 1rem; min-height: 44px; font-weight: 600; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link-btn { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; width: 44px; height: 44px; font-size: 1.2rem; }
.result { margin-top: .8rem; padding: .8rem 1rem; border-radius: 8px; background: var(--bg); min-height: 1.5rem; }
.result:empty { display: none; }
.res-grid { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: 0; }
.res-grid dt { color: var(--muted); }
.res-grid dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.res-grid .big { font-size: 1.35rem; font-weight: 700; }
.flag { display: block; font-size: .85rem; margin-top: .25rem; padding: .2rem .5rem; border-radius: 6px; }
.flag.ok { color: var(--ok); background: var(--ok-bg); }
.flag.warn { color: var(--warn); background: var(--warn-bg); }
.tag { font-size: .75rem; border: 1px solid var(--line); border-radius: 999px; padding: 0 .4rem; color: var(--muted); }
.subtools { display: grid; gap: 1rem; }
.subtools form { border-top: 1px solid var(--line); padding-top: 1rem; }
.subtools form:first-child { border-top: 0; padding-top: 0; }

/* Work-time table: cards on mobile */
.days { width: 100%; border-collapse: collapse; }
.days th { text-align: left; font-size: .85rem; color: var(--muted); font-weight: 600; padding: 0 .3rem .3rem; }
.days td { padding: .3rem; vertical-align: top; }
.days td:first-child { font-weight: 700; padding-top: .9rem; width: 2rem; }
.cell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.day-out { font-variant-numeric: tabular-nums; min-width: 9rem; padding-top: .8rem !important; }
@media (max-width: 620px) {
  .days thead { display: none; }
  .tool { padding: 1rem .8rem; }
  .days tr { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) minmax(0, 1fr); gap: .4rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
  .days td { padding: 0; min-width: 0; }
  .days td:first-child { padding-top: .7rem; grid-row: 1 / span 3; }
  .days td:nth-child(4) { grid-column: 2; grid-row: 2; }
  .days td:nth-child(6) { grid-column: 3; grid-row: 2; justify-self: end; }
  .days .day-out { grid-column: 2 / -1; grid-row: 3; padding-top: 0 !important; min-width: 0; }
  .days input { min-width: 0; }
  .cell-label { position: static; width: auto; height: auto; clip: auto; display: block; font-size: .8rem; font-weight: 600; color: var(--muted); }
}

/* Tool list on home */
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 1rem 0; padding: 0; list-style: none; }
.cards a { display: block; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; color: var(--text); text-decoration: none; }
.cards a:hover { border-color: var(--accent); }
.cards strong { display: block; color: var(--accent); margin-bottom: .3rem; }

/* FAQ */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .9rem; margin: .5rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: .5rem 0 .2rem; }

.sources { font-size: .9rem; color: var(--muted); }
.sources a { word-break: break-word; }

/* Advertising placeholders: empty today, reserved for later. Collapsed while empty. */
.ad-slot { margin: 1.5rem 0; }
.ad-slot:empty { display: none; }
.iban-out { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.15rem; letter-spacing: .03em; margin: 0 0 .4rem; word-break: break-all; }
.note { color: var(--muted); font-size: .85rem; margin: .4rem 0 0; }
#iban-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; }
input[type=date] { width: 100%; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; min-height: 44px; }
/* Result table (gross -> net salary) */
.res-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.res-table th, .res-table td { padding: .3rem .4rem; text-align: right; border-bottom: 1px solid var(--line); }
.res-table th[scope=row] { text-align: left; font-weight: 400; color: var(--muted); }
.res-table thead th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.res-table tr.strong td, .res-table tr.sum td { font-weight: 600; }
.res-table tr.big td { font-size: 1.2rem; font-weight: 700; border-bottom: 0; }
.res-table tr.big th { color: var(--text); font-weight: 700; }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: .3rem .5rem; border-bottom: 1px solid var(--line); text-align: left; }
.data-table caption { text-align: left; color: var(--muted); font-size: .9rem; padding-bottom: .3rem; }
input:disabled { opacity: .5; }
.row.top { align-items: start; }
