/* Fristenwerk – Tokens und Layout nach Handoff „Fristenuhr“ (1440-px-Rahmen),
   ergänzt um Tablet- (≤ 1379 px) und Mobilstufe (≤ 759 px). */

:root, :root[data-theme="hell"] {
  --bg: #FBF8F3; --paper: #FFFDF9; --ink: #3F2A4F; --sub: #6E5A7C; --edge: #EDE5D8; --line: #DCD2C3;
  --hair: #F0EAE0; --track: #EFE7DA; --tint: #F4EEE4; --soft: #F7F1E8; --ter: #C8674B; --kt: #F3D9D0;
  --kte: #EBC9BC; --kcard: #FBEDE7; --shadow: #E4D9C7; --tick: #8E7F99; --scrim: rgba(251,248,243,.72); --onTer: #FFFDF9;
  --season-a: 1;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.25 0 0 0 0 0.16 0 0 0 0 0.31 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  --blue: #BFD7EA; --sage: #9DB89A; --butter: #F5E1A4; --apricot: #F3B48A; --plum: #3F2A4F;
  --serif: Spectral, Georgia, serif;
  --pad: 48px;
  color-scheme: light;
}
:root[data-theme="dunkel"] {
  --bg: #1C1524; --paper: #261D2F; --ink: #F1E9DD; --sub: #B5A6C0; --edge: #3A2E46; --line: #4A3C57;
  --hair: #30263A; --track: #3A2F45; --tint: #33293E; --soft: #2D2337; --ter: #E3866A; --kt: #4B2C30;
  --kte: #6A3B38; --kcard: #33222C; --shadow: #130E19; --tick: #9C8DA8; --scrim: rgba(18,13,24,.72); --onTer: #1C1524;
  --season-a: .88;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.95 0 0 0 0 0.9 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background-color: var(--bg); background-image: var(--grain); color: var(--ink);
  font-family: Manrope, system-ui, sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
button, select { font: inherit; color: inherit; }
select option { color: #3F2A4F; background: #FFFDF9; }
a { color: var(--ter); text-decoration: none; }
.serif { font-family: var(--serif); }
.it { font-family: var(--serif); font-style: italic; }
.sub { color: var(--sub); }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--sub); }
.clickable { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ter); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.page { max-width: 1440px; margin: 0 auto; padding-bottom: 64px; }
.sec { margin: 56px var(--pad) 0; }
.h2 { margin: 0; font-size: 22px; font-weight: 800; }
.h2.lg { font-size: 26px; }
.h2-sub { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--sub); }

/* Kopf */
.head { padding: 32px var(--pad) 0; display: grid; grid-template-columns: minmax(0,1fr) auto 460px; gap: 36px; align-items: center; }
.brand-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.brand-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand svg { width: 50px; height: 50px; flex: none; }
.wordmark { font-size: 28px; letter-spacing: .06em; line-height: 1; }
.wordmark b { font-weight: 800; } .wordmark span { font-weight: 400; }
.org { font-size: 13px; font-weight: 600; color: var(--sub); }
.controls { display: flex; gap: 10px; align-items: center; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 22px; background: var(--tint); }
.seg button { all: unset; cursor: pointer; height: 36px; padding: 0 18px; border-radius: 18px; display: flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--sub); }
.seg button[aria-selected="true"] { font-weight: 800; color: var(--ink); background: var(--paper); box-shadow: 0 1px 0 var(--shadow); }
.seg button:focus-visible, .theme-btn:focus-visible { outline: 2px solid var(--ter); }
.theme-btn { all: unset; cursor: pointer; height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); box-sizing: border-box; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.theme-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ink); background: #1C1524; }
:root[data-theme="dunkel"] .theme-dot { background: #FBF8F3; }
.heute { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.heute .d { font-size: 22px; font-weight: 700; }
.heute .kw { font-size: 14px; font-weight: 600; color: var(--sub); }
.lead { all: unset; box-sizing: border-box; background: var(--kt); border-radius: 24px; padding: 18px 24px; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 20px; align-items: center; cursor: pointer; box-shadow: 0 1px 0 var(--kte); }
.lead-num { display: flex; flex-direction: column; align-items: center; }
.lead-num b { font-size: 72px; font-weight: 800; line-height: 72px; height: 72px; letter-spacing: -.03em; }
.lead-num span { font-size: 13px; font-weight: 700; line-height: 16px; margin-top: 6px; }
.lead-txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lead-txt .eyebrow { color: var(--ink); }
.lead-title { font-size: 17px; font-weight: 700; line-height: 1.25; text-wrap: pretty; }
.lead-meta { font-size: 13px; font-weight: 500; }

/* Lagesatz */
.lage { margin: 26px var(--pad) 0; font-family: var(--serif); font-size: 22px; line-height: 1.45; max-width: 1100px; text-wrap: pretty; }
.lage strong { font-family: Manrope, sans-serif; font-weight: 800; }
.lage strong.ter { color: var(--ter); }

/* Filter */
.filters { margin: 22px var(--pad) 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; background: var(--paper); border: 1px solid var(--edge); border-radius: 28px; box-shadow: 0 1px 0 var(--shadow); }
.filters .eyebrow { padding: 0 8px; }
.sel { position: relative; display: flex; }
.sel select { appearance: none; -webkit-appearance: none; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); color: var(--ink); font-size: 13px; font-weight: 600; height: 38px; padding: 0 34px 0 16px; cursor: pointer; outline: none; max-width: 230px; text-overflow: ellipsis; }
.sel select.on { border-color: var(--ink); background: var(--tint); font-weight: 700; }
.sel select:focus-visible { outline: 2px solid var(--ter); }
.sel::after { content: "▾"; position: absolute; right: 14px; top: 10px; font-size: 10px; pointer-events: none; color: var(--sub); }
.reset { all: unset; cursor: pointer; height: 38px; padding: 0 16px; border-radius: 19px; display: flex; align-items: center; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 700; }
.count { margin-left: auto; font-size: 13px; color: var(--sub); padding-right: 8px; }
.filter-toggle { display: none; }
.short { display: none; }

/* Marker, Status, Etiketten */
.tm { display: inline-block; flex: none; box-sizing: border-box; border: 1.8px solid var(--ink); background: var(--paper); margin-top: 3px; }
.tm.aus { background: var(--ink); } .tm.krit { background: var(--ter); }
.tm.fix { width: 12px; height: 12px; border-radius: 50%; }
.tm.ereignis { width: 10px; height: 10px; transform: rotate(45deg); margin: 4px 1px 0; }
.tm.sperr { width: 18px; height: 10px; border-radius: 5px; }
.tm.ausland { width: 11px; height: 11px; border-radius: 2px; }
.tm.intern { width: 12px; height: 12px; border-radius: 50%; border-style: dashed; }
.tm.mini { border-width: 1.3px; margin: 0; }
.tm.mini.fix, .tm.mini.intern { width: 7.4px; height: 7.4px; }
.tm.mini.ereignis { width: 6.2px; height: 6.2px; margin: 0 1px; }
.tm.mini.sperr { width: 11.2px; height: 6.2px; border-radius: 3.1px; }
.tm.mini.ausland { width: 6.8px; height: 6.8px; border-radius: 1.2px; }
.sd { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; }
.sd.offen { border: 2px solid var(--ink); }
.sd.arbeit { background: var(--apricot); }
.sd.freigabe { background: var(--blue); border: 1.5px solid var(--ink); }
.sd.erledigt { background: var(--sage); }
.sd.kritisch { background: var(--ter); box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ter); }
.sd.none { width: 12px; height: 2px; border-radius: 1px; background: var(--line); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--tint); flex: none; }
.pill.krit { background: var(--kt); }
.cr { font-size: 11px; font-weight: 500; color: var(--sub); white-space: nowrap; flex: none; }
.cr.hoch { font-weight: 700; color: var(--ink); }
.cr.aus { font-weight: 800; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 10px; padding: 2px 8px; }

/* Fristkarte */
.card { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; width: 100%; background: var(--paper); border: 1px solid var(--edge); border-radius: 18px; padding: 12px 14px; cursor: pointer; box-shadow: 0 1px 0 var(--shadow); }
.card.krit { background: var(--kcard); border-color: var(--kte); }
.card:focus-visible { outline: 2px solid var(--ter); }
.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.row.c { align-items: center; }
.date-big { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.date-meta { font-size: 12px; font-weight: 600; color: var(--sub); }
.title-row { display: flex; gap: 9px; align-items: flex-start; }
.title { font-size: 14px; font-weight: 700; line-height: 1.3; text-wrap: pretty; }
.meta { font-size: 12px; color: var(--sub); }
.meta-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12px; color: var(--sub); }
.empty { padding: 18px; border-radius: 18px; border: 1px dashed var(--line); font-size: 13px; color: var(--sub); }

/* Ansicht Jahresuhr */
.uhr-grid { margin: 32px var(--pad) 0; display: grid; grid-template-columns: 316px 660px 316px; gap: 26px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.clock-col { display: flex; flex-direction: column; align-items: center; gap: 16px; min-width: 0; }
.clock { position: relative; width: 100%; max-width: 660px; aspect-ratio: 1; container-type: inline-size; }
.clock svg { display: block; width: 100%; height: 100%; }
.clock svg .hit { cursor: pointer; }
.clock svg .hit:focus { outline: none; }
.clock svg .hit:focus-visible .focus-ring { stroke: var(--ter); stroke-width: 2; }
.disc { position: absolute; left: 34.24%; top: 34.24%; width: 31.52%; height: 31.52%; border-radius: 50%; background: var(--paper); border: 1px solid var(--edge); box-shadow: 0 1px 0 var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.disc .k { font-size: max(8px, 1.52cqw); font-weight: 800; letter-spacing: .14em; color: var(--sub); }
.disc .dd { font-family: var(--serif); font-size: 6.67cqw; line-height: 1.05; font-weight: 500; }
.disc .y { font-size: max(10px, 1.97cqw); font-weight: 600; color: var(--sub); }
.disc .rule { width: 8.5cqw; height: 1px; background: var(--line); margin: 1.5cqw 0 1.2cqw; }
.disc .rest { font-size: max(10px, 1.97cqw); font-weight: 700; color: var(--ter); }
.disc .sh { font-size: max(9px, 1.82cqw); font-weight: 600; max-width: 85%; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-size: 12px; font-weight: 600; max-width: 640px; }
.legend > span { display: flex; align-items: center; gap: 6px; }
.legend.sub { color: var(--sub); }
.lg-bar { width: 18px; height: 5px; border-radius: 3px; }

.ctry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ctry { all: unset; box-sizing: border-box; background: var(--paper); border: 1px solid var(--edge); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; box-shadow: 0 1px 0 var(--shadow); }
.ctry:hover, .ctry:focus-visible { border-color: var(--ink); outline: none; }
.ctry .c { font-size: 16px; font-weight: 800; }
.ctry .city { font-size: 11px; font-weight: 600; color: var(--sub); }
.ctry .t { font-size: 12px; font-weight: 600; line-height: 1.3; }
.qst { background: var(--paper); border: 1px solid var(--edge); border-radius: 20px; padding: 16px 18px; box-shadow: 0 1px 0 var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.qst .sum { font-family: var(--serif); font-size: 44px; line-height: 1.05; font-weight: 500; }
.refund { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--edge); padding-top: 10px; cursor: pointer; }
.refund:focus-visible { outline: 2px solid var(--ter); }
.refund .amt { font-family: var(--serif); font-size: 20px; }
.bar { position: relative; height: 8px; border-radius: 4px; background: var(--track); }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.bar .app { position: absolute; top: -3px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--ink); border: 2px solid var(--paper); }
.small-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 600; color: var(--sub); }

/* Ansicht Jahreskalender */
.kal-grid { margin: 32px var(--pad) 0; display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 28px; align-items: start; }
.kal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.kal-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 16px; font-size: 12px; font-weight: 600; max-width: 560px; }
.kal-legend > span { display: flex; align-items: center; gap: 6px; }
.sw { width: 16px; height: 12px; border-radius: 4px; }
.months { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.month { background: var(--paper); border: 1px solid var(--edge); border-radius: 22px; padding: 14px 16px 12px; box-shadow: 0 1px 0 var(--shadow); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.strip { display: block; height: 6px; border-radius: 3px; opacity: var(--season-a); }
.m-name { font-family: var(--serif); font-size: 24px; font-weight: 500; }
.m-year { font-size: 12px; font-weight: 700; color: var(--sub); }
.m-cnt { font-size: 12px; font-weight: 600; color: var(--sub); white-space: nowrap; }
.m-cnt.strong { font-weight: 800; color: var(--ter); }
.wk { display: grid; grid-template-columns: 26px repeat(7, minmax(0,1fr)); gap: 3px; }
.wk.hd { font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--sub); text-align: center; }
.wk .kwn { font-size: 10px; font-weight: 700; color: var(--sub); display: flex; align-items: center; justify-content: center; }
.cell { all: unset; box-sizing: border-box; height: 42px; border-radius: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; min-width: 0; }
.cell.blank { cursor: default; }
.cell .n { font-size: 13px; font-weight: 500; line-height: 1; }
.cell.has .n, .cell.today .n { font-weight: 800; }
.cell.we { color: var(--sub); }
.cell.c1 { background: var(--tint); }
.cell.c2 { background: var(--kt); color: var(--ink); }
.cell.c4 { background: var(--ter); color: var(--onTer); }
.cell.c4 .tm { border-color: var(--onTer); }
.cell.today { background: var(--ink); color: var(--bg); }
.cell.past { opacity: .38; }
.cell.sel { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.cell:focus-visible { outline: 2px solid var(--ter); outline-offset: 1px; }
.marks { display: flex; gap: 2px; align-items: center; height: 7px; }
.marks .more { font-size: 8px; font-weight: 800; }
.rec-tick { width: 12px; height: 3px; border-radius: 2px; background: var(--tick); }
.kal-aside { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--paper); border: 1px solid var(--edge); border-radius: 24px; padding: 18px; box-shadow: 0 1px 0 var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.day-title { font-family: var(--serif); font-size: 30px; line-height: 1.1; }
.day-sub { font-size: 13px; font-weight: 600; color: var(--sub); }
.rec-row { display: flex; gap: 10px; align-items: center; font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 14px; background: var(--soft); }
.rec-row::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--tick); }
.peak { all: unset; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--hair); cursor: pointer; font-size: 13px; }
.peak:focus-visible { outline: 2px solid var(--ter); }
.peak .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--kt); flex: none; }
.peak .dot.s { background: var(--ter); }

/* Sperrfristen */
.radar { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.rcard { all: unset; box-sizing: border-box; background: var(--paper); border: 1px solid var(--edge); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 1px 0 var(--shadow); }
.rcard.st { background: var(--kcard); border-color: var(--kte); }
.rcard.link { cursor: pointer; }
.rcard.link:focus-visible { outline: 2px solid var(--ter); }
.gauge { width: 84px; height: 84px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.gauge > span { width: 62px; height: 62px; border-radius: 50%; background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.gauge b { font-size: 17px; font-weight: 800; }
.gauge small { font-size: 10px; font-weight: 700; color: var(--sub); margin-top: 2px; }
.rfoot { display: flex; flex-direction: column; gap: 3px; font-size: 12px; border-top: 1px solid var(--edge); padding-top: 10px; }

/* Gesellschaftsmatrix */
.matrix { background: var(--paper); border: 1px solid var(--edge); border-radius: 28px; padding: 24px 28px 16px; box-shadow: 0 1px 0 var(--shadow); }
.mx-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.st-legend { display: flex; gap: 16px; font-size: 12px; font-weight: 600; flex-wrap: wrap; }
.st-legend > span { display: flex; gap: 6px; align-items: center; }
.mx-row { display: grid; grid-template-columns: 340px repeat(6, minmax(0,1fr)); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hair); align-items: center; }
.mx-row.hd { padding: 12px 0; border-bottom-color: var(--line); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.mx-grp { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--sub); padding: 14px 0 2px; }
.mx-name { font-size: 14px; font-weight: 700; }
.mx-role { font-size: 12px; color: var(--sub); font-weight: 400; }
.mx-cell { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; }
.mx-cell.aus { font-weight: 800; }
.mx-cell.link { cursor: pointer; }
.mx-cell.link:focus-visible { outline: 2px solid var(--ter); }
.mx-cell .area { display: none; }

.foot { margin: 28px var(--pad) 0; display: flex; justify-content: space-between; gap: 16px; font-size: 12px; font-weight: 600; color: var(--sub); flex-wrap: wrap; }
.foot .it { font-size: 14px; }

/* Detailpanel */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 620px; max-width: 100%; overflow-y: auto; overscroll-behavior: contain; z-index: 21; background: var(--paper); border-left: 1px solid var(--edge); border-radius: 32px 0 0 32px; padding: 28px 40px 36px; display: flex; flex-direction: column; gap: 22px; }
.drawer:focus { outline: none; }
.dr-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.type-chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 14px; background: var(--tint); font-size: 12px; font-weight: 700; }
.type-chip .tm { margin-top: 0; }
.type-chip .tm.ereignis { margin: 0 1px; }
.close { all: unset; flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); box-sizing: border-box; display: flex; align-items: center; justify-content: center; font-size: 15px; cursor: pointer; }
.close:focus-visible { outline: 2px solid var(--ter); }
.dr-title { margin: 0; font-size: 28px; font-weight: 800; line-height: 1.18; text-wrap: balance; }
.dr-entity { font-size: 15px; font-weight: 500; color: var(--sub); }
.due { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px; align-items: center; background: var(--soft); border-radius: 24px; padding: 18px 22px; }
.due-l { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.due-date { font-size: 22px; font-weight: 700; }
.due-days { display: flex; align-items: baseline; gap: 8px; }
.due-days b { font-size: 72px; font-weight: 800; letter-spacing: -.03em; line-height: .95; }
.due-days span { font-size: 15px; font-weight: 700; }
.ring svg { display: block; width: 140px; height: 140px; }
.basis { font-family: var(--serif); font-size: 30px; line-height: 1.1; }
.folge { background: var(--kt); border-radius: 20px; padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.folge .eyebrow { color: var(--ink); }
.folge p { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.5; text-wrap: pretty; }
.blk { display: flex; flex-direction: column; gap: 6px; }
.people { display: flex; gap: 8px; flex-wrap: wrap; }
.person { display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 22px; border: 1px solid var(--edge); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex: none; }
.person b { font-size: 13px; font-weight: 700; line-height: 1.2; display: block; }
.person small { display: block; font-size: 11px; font-weight: 500; color: var(--sub); }
.doc { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.doc > span:first-child { font-weight: 600; }
.doc > span:last-child { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--sub); white-space: nowrap; }
.hist { display: grid; grid-template-columns: 96px 22px minmax(0,1fr); gap: 10px; min-height: 32px; align-items: center; }
.hist .hd { font-size: 12px; font-weight: 600; }
.hist .ht { font-size: 13px; font-weight: 500; }
.hist.future .hd, .hist.future .ht { color: var(--sub); }
.hist.now .hd, .hist.now .ht { font-weight: 800; }
.hist .track { position: relative; align-self: stretch; display: block; }
.hist .seg { position: absolute; left: 50%; margin-left: -1px; width: 2px; top: 0; bottom: 0; background: var(--line); }
.hist:first-of-type .seg { top: 50%; }
.hist:last-of-type .seg { bottom: 50%; }
.hist .dot { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--sage); }
.hist.now .dot { width: 18px; height: 18px; margin: -9px 0 0 -9px; background: var(--apricot); border: 2px solid var(--ink); }
.hist.future .dot { background: var(--paper); border: 2px solid var(--ink); }
.actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; position: relative; }
.btn { all: unset; box-sizing: border-box; height: 44px; padding: 0 18px; border-radius: 22px; display: flex; align-items: center; border: 1px solid var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; flex: none; }
.btn.fill { background: var(--ink); color: var(--bg); }
.btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--ter); outline-offset: 2px; }
.st-menu { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-radius: 18px; background: var(--soft); width: 100%; }
.st-menu button { all: unset; box-sizing: border-box; height: 36px; padding: 0 14px; border-radius: 18px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; background: var(--paper); border: 1px solid var(--edge); cursor: pointer; }
.st-menu button[aria-pressed="true"] { border-color: var(--ink); font-weight: 800; }
.st-menu button:focus-visible { outline: 2px solid var(--ter); }
.note { font-size: 12px; color: var(--sub); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 20px; font-size: 13px; font-weight: 700; box-shadow: 0 1px 0 var(--shadow); }
.handle { display: none; }

/* ——— Tablet ——— */
@media (max-width: 1379px) {
  :root { --pad: 32px; }
  .head { grid-template-columns: minmax(0,1fr) auto; gap: 20px 28px; }
  .head .lead { grid-column: 1 / -1; }
  .uhr-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 28px; }
  .uhr-grid .clock-col { grid-column: 1 / -1; order: -1; }
  .ctry-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kal-grid { grid-template-columns: minmax(0,1fr) 300px; }
  .months { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .radar { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .mx-scroll { overflow-x: auto; margin: 0 -28px; padding: 0 28px; }
  .mx-inner { min-width: 980px; }
  .mx-row { grid-template-columns: 260px repeat(6, minmax(0,1fr)); }
}
@media (max-width: 1023px) {
  .kal-grid { grid-template-columns: minmax(0,1fr); }
  .kal-aside { position: static; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .kal-head { flex-direction: column; align-items: flex-start; }
  .kal-legend { justify-content: flex-start; }
}

/* ——— Mobil ——— */
@media (max-width: 759px) {
  :root { --pad: 16px; }
  .page { padding-bottom: 40px; }
  .sec { margin-top: 40px; }
  .h2.lg { font-size: 22px; }
  .head { padding-top: 16px; grid-template-columns: minmax(0,1fr) auto; gap: 14px 12px; align-items: start; }
  .brand-col { display: contents; }
  .brand-row { grid-column: 1; grid-row: 1; gap: 4px 12px; }
  .brand svg { width: 36px; height: 36px; }
  .brand { gap: 10px; }
  .wordmark { font-size: 21px; }
  .org { font-size: 11.5px; flex-basis: 100%; }
  .controls { display: contents; }
  .theme-btn { grid-column: 2; grid-row: 1; height: 40px; padding: 0 12px; }
  .theme-btn .lbl { display: none; }
  .seg { grid-column: 1 / -1; grid-row: 2; }
  .seg button { flex: 1; justify-content: center; height: 38px; }
  .heute { grid-column: 1 / -1; grid-row: 3; flex-direction: row; align-items: baseline; gap: 8px; text-align: left; flex-wrap: wrap; }
  .heute .d { font-size: 15px; }
  .heute .kw { font-size: 13px; }
  .long { display: none; } .short { display: inline; }
  .clock .ml { font-size: 17px; letter-spacing: .4px; }
  .clock .pl { font-size: 18px; }
  .clock .yl { font-size: 14px; }
  .head .lead { grid-row: 4; grid-column: 1 / -1; padding: 14px 16px; gap: 14px; border-radius: 20px; }
  .lead-num b { font-size: 52px; line-height: 52px; height: 52px; }
  .lead-num span { margin-top: 2px; }
  .lead-title { font-size: 15px; }
  .lead-meta { font-size: 12px; }
  .lead-txt .eyebrow { font-size: 10px; }
  .lage { font-size: 17px; margin-top: 18px; }
  .filters { border-radius: 22px; padding: 10px; gap: 8px; }
  .filter-toggle { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; cursor: pointer; height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--line); font-size: 13px; font-weight: 700; }
  .filter-toggle .badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
  .filters .eyebrow { display: none; }
  .filters .sel { display: none; flex: 1 1 100%; }
  .filters.open .sel { display: flex; }
  .sel select { max-width: none; width: 100%; height: 42px; font-size: 15px; }
  .sel::after { top: 13px; }
  .filters .reset { height: 38px; }
  .count { margin-left: auto; font-size: 12px; text-align: right; padding-right: 4px; }
  .uhr-grid { grid-template-columns: minmax(0,1fr); gap: 32px; margin-top: 24px; }
  .uhr-grid .clock-col { grid-column: auto; }
  .legend { gap: 6px 12px; font-size: 11.5px; }
  .legend.sub { justify-content: center; }
  .qst .sum { font-size: 38px; }
  .kal-grid { margin-top: 24px; }
  .months { grid-template-columns: minmax(0,1fr); }
  .cell { height: 44px; }
  .kal-aside { grid-template-columns: minmax(0,1fr); }
  .kal-aside .day-panel { display: none; }
  .radar { grid-template-columns: minmax(0,1fr); }
  .matrix { padding: 18px 16px 12px; border-radius: 22px; }
  .mx-scroll { overflow: visible; margin: 0; padding: 0; }
  .mx-inner { min-width: 0; }
  .mx-row.hd { display: none; }
  .mx-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px 12px; padding: 12px 0; }
  .mx-row > :first-child { grid-column: 1 / -1; }
  .mx-cell.empty { display: none; }
  .mx-cell { flex-wrap: wrap; gap: 4px 8px; }
  .mx-cell .area { display: block; width: 100%; font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--sub); text-transform: uppercase; }
  .mx-none { grid-column: 1 / -1; font-size: 12px; color: var(--sub); }
  .foot { flex-direction: column; gap: 6px; }
  .drawer { top: auto; left: 0; width: 100%; max-height: 92vh; max-height: 92dvh; border-left: 0; border-top: 1px solid var(--edge); border-radius: 26px 26px 0 0; padding: 10px 18px calc(24px + env(safe-area-inset-bottom)); gap: 18px; }
  .handle { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto -6px; flex: none; }
  .dr-title { font-size: 22px; }
  .dr-entity { font-size: 14px; }
  .due { padding: 14px 16px; gap: 12px; border-radius: 20px; }
  .due-date { font-size: 17px; }
  .due-days b { font-size: 52px; }
  .ring svg { width: 104px; height: 104px; }
  .basis { font-size: 24px; }
  .folge p { font-size: 16px; }
  .hist { grid-template-columns: 78px 22px minmax(0,1fr); }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); }
}
@media (max-width: 759px) and (min-width: 0) {
  .mx-none { display: block; }
}
@media (min-width: 760px) { .mx-none { display: none; } }

@media (prefers-reduced-motion: no-preference) {
  body, .card, .month, .panel, .rcard, .matrix, .filters, .qst, .ctry { transition: background-color .15s, color .15s, border-color .15s; }
}
@media print {
  body { background-image: none; }
  .filters, .controls, .scrim, .drawer, .toast { display: none !important; }
}
