/* RE-IN Corporate Design: Inter, radius 0 (Identitaetsmerkmal),
   Cyan #48C1E9 nur als Flaeche/Linie, Text-Cyan abgedunkelt #0c7797.
   Vorlage: docs/design/ (Canvas „Wochenplan – Design"). */
:root {
    --primary: #48C1E9;
    --primary-text: #0c7797;
    --primary-hover: #31b5e2;
    --tint: #e6f7fc;
    --tint-soft: #f7fcfe;
    --secondary: #86bc24;
    --dark: #0E1010;
    --text-2: #3c4040;
    --muted: #5c6060;          /* Sekundaertext, 4.5:1 auf Weiss */
    --light-gray: #eeeeee;
    --global-border: #f0f0f0;
    --line: #eeeeee;
    --medium-gray: #cacaca;
    --dark-gray: #8a8a8a;
    --surface: #fbfbfb;
    --alert: #F83B3B;
    --alert-bg: #ffc6c6;
    --alert-text: #9a0000;
    --success-bg: #c9e8c1;
    --success-text: #2a5020;
    --warn: #F2930C;
    --warn-bg: #f7dfbe;
    --warn-soft: #fdf3dd;
    --warn-text: #864f00;
    --header-h: 60px;
    --bottomnav-h: 60px;
    color-scheme: light;
}
* { box-sizing: border-box; border-radius: 0 !important; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: Inter, Helvetica, Roboto, Arial, sans-serif;
    font-size: 14px; line-height: 20px;
    color: var(--dark); background: #ffffff;
}
a { color: var(--primary-text); text-decoration: none; }
a:hover { color: #0a5f78; text-decoration: underline; }
button, input, select, textarea { font-family: inherit; }
.sr-only {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- Kopfzeile ---------------------------------------------- */
header.app { border-bottom: 3px solid var(--primary); background: #ffffff; position: sticky; top: 0; z-index: 20; }
header.app .inner {
    display: flex; align-items: center; gap: 24px;
    min-height: var(--header-h); padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .signet { height: 28px; width: 28px; display: block; }
.brand i { width: 1px; height: 22px; background: var(--medium-gray); }
.brand b { font-size: 16px; font-weight: 700; color: var(--primary-text); }
nav.main { display: flex; gap: 4px; }
nav.main a {
    color: var(--dark); font-weight: 600; font-size: 14px;
    padding: 19px 12px 17px; border-bottom: 3px solid transparent; margin-bottom: -3px;
    display: inline-flex; align-items: center; gap: 6px;
}
nav.main a:hover { color: var(--primary-text); text-decoration: none; }
nav.main a.active { border-bottom-color: var(--primary); color: var(--primary-text); }
.badge {
    display: inline-block; min-width: 20px; padding: 0 6px; font-size: 11px; line-height: 18px;
    text-align: center; background: var(--dark); color: #ffffff; font-weight: 600;
}
.badge.soft { background: var(--tint); color: var(--primary-text); }
.spacer { flex: 1; }

/* Timer in der Kopfzeile (ab Phase 3 mit Leben) */
.timer {
    display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 0 0 14px;
    background: var(--dark); color: #ffffff; white-space: nowrap;
}
.timer .dot { width: 8px; height: 8px; background: var(--secondary); box-shadow: 0 0 0 4px rgba(134,188,36,.25); }
.timer .time { font-weight: 700; font-variant-numeric: tabular-nums; }
.timer .what { color: #cfd3d3; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.timer .what b { color: #74d2f2; }
.timer button {
    height: 40px; width: 44px; border: 0; background: var(--primary); color: var(--dark);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.timer button[disabled] { background: var(--light-gray); cursor: default; }
.timer.idle { background: #ffffff; color: var(--dark); border: 1px solid var(--medium-gray); padding-left: 12px; }
.timer.idle .dot { background: var(--medium-gray); box-shadow: none; }
.timer.idle .what { color: var(--muted); }

.syncstate { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.syncstate .ico { stroke: var(--success-text); }
.syncstate.offline { color: var(--warn-text); }
.syncstate.offline .ico { stroke: var(--warn-text); }

.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar {
    width: 32px; height: 32px; flex: none; background: var(--tint); color: var(--primary-text);
    font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
/* Google-Profilbild liegt ueber den Initialen; laedt es nicht, bleiben die Initialen */
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.usermenu .menu {
    position: absolute; right: 0; top: 42px; min-width: 220px; background: #ffffff;
    border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.08); padding: 6px 0; z-index: 30;
}
.usermenu .menu .who { padding: 8px 14px 10px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.usermenu .menu .who b { display: block; color: var(--dark); font-size: 14px; }
.usermenu .menu a, .usermenu .menu button {
    display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; background: none;
    color: var(--dark); font-size: 14px; cursor: pointer; text-decoration: none;
}
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--surface); text-decoration: none; }

/* --- Seitenrahmen --------------------------------------------- */
main { padding: 24px 24px 56px; }
main.narrow { max-width: 1040px; margin: 0 auto; }
h1 { font-weight: 700; font-size: 26px; line-height: 32px; margin: 0; letter-spacing: -.01em; }
h2 { font-weight: 700; font-size: 17px; line-height: 24px; margin: 32px 0 12px; }
h2:first-child { margin-top: 0; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.muted { color: var(--muted); }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* --- Bausteine ------------------------------------------------ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--primary); border: 1px solid var(--primary); color: var(--dark);
    font-weight: 700; padding: 0 16px; height: 40px; font-size: 14px;
    text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--dark); text-decoration: none; }
.btn.ghost { background: #ffffff; color: var(--primary-text); }
.btn.ghost:hover { background: var(--tint); color: var(--primary-text); }
.btn.plain { background: #ffffff; border-color: var(--medium-gray); color: var(--dark); font-weight: 600; }
.btn.plain:hover { background: var(--surface); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { background: var(--light-gray); border-color: var(--light-gray); color: var(--dark-gray); cursor: default; }
.btn-plain {
    border: none; background: none; color: var(--primary-text); font-weight: 600; cursor: pointer;
    font-size: 14px; padding: 0; text-decoration: underline;
}
.btn-plain.danger { color: var(--alert-text); }

.error { background: var(--alert-bg); color: var(--alert-text); padding: 12px 16px; margin: 0 0 20px; }
.flash { background: var(--success-bg); color: var(--success-text); padding: 12px 16px; margin: 0 0 20px; }
.hint { background: var(--warn-soft); color: #4a2c00; padding: 10px 14px; font-size: 13px; }

.panel { border: 1px solid var(--line); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel h2 { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel .sub { margin-bottom: 14px; }

.chip {
    display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
    font-weight: 600; padding: 1px 8px; line-height: 18px; white-space: nowrap;
}
.chip.ok { background: var(--success-bg); color: var(--success-text); }
.chip.warn { background: var(--warn-bg); color: var(--warn-text); }
.chip.cyan { background: var(--tint); color: var(--primary-text); }
.chip.grau { background: var(--light-gray); color: var(--text-2); }

.codeline { display: block; background: var(--dark); color: #d7f6ff; padding: 10px 12px; font-size: 13px; overflow-x: auto; white-space: nowrap; user-select: all; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--global-border); }
.checklist li:last-child { border-bottom: 0; }
.checklist .state { width: 22px; height: 22px; flex: none; display: flex; align-items: center; justify-content: center; }
.checklist .txt { flex: 1; min-width: 0; }
.checklist .txt b { display: block; }

.ico { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex: none; }
.ico.lg { width: 20px; height: 20px; }

/* --- Formulare ------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: 5px; margin: 0 0 14px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12px; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.field-row .field { margin-bottom: 0; }
.field.grow { flex: 1 1 260px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=time], input[type=search], select, textarea {
    font-size: 14px; padding: 8px 10px; height: 40px; width: 100%;
    border: 1px solid var(--medium-gray); background: #fff; color: var(--dark);
}
textarea { height: auto; line-height: 20px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, button:focus-visible {
    outline: 2px solid var(--primary); outline-offset: -1px;
}
form { margin: 0; }
.inline-form { display: inline; }

/* --- Woche (Phase 1: Rahmen) ----------------------------------- */
.weekhead { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); }
.weekhead .day { padding: 10px 12px; border-left: 1px solid var(--line); }
.weekhead .day:first-child { border-left: 0; }
.weekhead .day.today { background: var(--tint); box-shadow: inset 0 3px 0 var(--primary); }
.weekhead .day b { font-weight: 700; }
.empty {
    border: 1px dashed var(--medium-gray); padding: 32px 20px; text-align: center; color: var(--muted);
    margin-top: 16px;
}
.grid-side { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; margin-top: 24px; }

/* --- Anmeldung -------------------------------------------------- */
.login { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card {
    width: 440px; max-width: 100%; border: 1px solid var(--line);
    border-top: 3px solid var(--primary); padding: 44px 40px 36px; text-align: center;
}
.login-card .signet { width: 64px; height: 64px; }
.login-card svg.rein_logo { height: 32px; width: auto; }
.login-card h1 { font-size: 26px; line-height: 32px; margin: 18px 0 0; }
.login-card .error { text-align: left; margin-top: 20px; }
.login-foot {
    margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line);
    font-size: 13px; line-height: 19px; color: var(--muted);
}
.btn-google {
    margin-top: 30px; width: 100%; height: 48px; display: flex; align-items: center;
    justify-content: center; gap: 12px; background: #ffffff; border: 1px solid var(--medium-gray);
    font-size: 15px; font-weight: 600; color: var(--dark); cursor: pointer; text-decoration: none;
}
.btn-google:hover { background: var(--surface); color: var(--dark); text-decoration: none; }

/* --- Woche ------------------------------------------------------ */
main.full { padding: 16px 0 40px; }
.week-head { padding: 0 24px; margin-bottom: 12px; }
.week-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.seg { display: flex; }
.seg button {
    height: 40px; padding: 0 14px; border: 1px solid var(--medium-gray); border-left-width: 0;
    background: #ffffff; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--dark); min-width: 40px;
}
.seg button:first-child { border-left-width: 1px; }
.seg button[aria-pressed="true"] { background: var(--dark); border-color: var(--dark); color: #ffffff; }
.seg button:hover:not([aria-pressed="true"]) { background: var(--surface); }
.mobile-only { display: none; }
.totals { display: flex; border: 1px solid var(--line); }
.totals > div { padding: 8px 18px; border-right: 1px solid var(--line); }
.totals > div:last-child { border-right: 0; }
.totals .k { font-size: 12px; color: var(--muted); }
.totals .v { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.totals .v.ok { color: var(--success-text); }
.totals .v.cyan { color: var(--primary-text); }
.totals .v.muted { color: var(--muted); }
.hint.timer-warning { margin: 0 24px 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hint.timer-warning span { flex: 1; min-width: 200px; font-weight: 600; }
.hint.soft { margin: 0 24px 12px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }

.weekwrap { display: grid; grid-template-columns: 300px minmax(0, 1fr); border-top: 1px solid var(--line); }
.weekwrap:has(.detail:not([hidden])) { grid-template-columns: 300px minmax(0, 1fr) 380px; }
.todos { border-right: 1px solid var(--line); padding: 14px 16px 24px; min-width: 0; }
.timeline { min-width: 0; padding-bottom: 16px; user-select: none; }
.detail { border-left: 1px solid var(--line); background: var(--surface); padding: 16px 20px 24px; min-width: 0; }

/* Zeitachse */
.tl-head, .tl-allday, .tl-body { display: grid; }
.tl-head { border-bottom: 1px solid var(--line); position: sticky; top: var(--header-h); background: #ffffff; z-index: 5; }
.tl-day { padding: 8px 10px; border-left: 1px solid var(--line); min-width: 0; }
.tl-day.today { background: var(--tint); box-shadow: inset 0 3px 0 var(--primary); }
.tl-dayname b { font-weight: 700; }
.tl-dayname span { color: var(--muted); margin-left: 4px; }
.tl-daysum { font-size: 12px; color: var(--muted); display: flex; gap: 8px; }
.tl-daysum b { color: var(--dark); font-variant-numeric: tabular-nums; }
.tl-corner { font-size: 11px; color: var(--muted); text-align: right; padding: 4px 6px 0 0; }
.tl-allday { border-bottom: 1px solid var(--line); padding: 4px 0; }
.tl-allday-cell { border-left: 1px solid var(--line); padding: 0 2px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.allday {
    display: block; background: #f5f5f5; color: var(--text-2); font-size: 12px; padding: 2px 8px;
    border: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none;
}
.tl-body { position: relative; max-height: calc(100vh - var(--header-h) - 230px); overflow-y: auto; }
.tl-gutter { position: relative; }
.tl-hour { position: absolute; right: 8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-col { position: relative; border-left: 1px solid var(--line); touch-action: pan-y; }
.tl-col.today { background: var(--tint-soft); }
.tl-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--global-border); pointer-events: none; }
.tl-line.half { border-top-style: dotted; opacity: .7; }
.tl-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--alert); pointer-events: none; z-index: 3; }
.tl-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; background: var(--alert); }

.blk {
    position: absolute; overflow: hidden; padding: 2px 5px; cursor: pointer; font-size: 12px; line-height: 15px;
    background: #ffffff; border: 1px solid var(--primary); color: var(--dark); box-sizing: border-box; z-index: 2;
}
.blk:hover { z-index: 4; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.blk.selected { outline: 2px solid var(--dark); outline-offset: 1px; z-index: 4; }
.blk.dragging { opacity: .85; box-shadow: 0 4px 14px rgba(0,0,0,.18); z-index: 6; }
.blk.ghost { background: var(--tint); border: 1px dashed var(--primary-text); color: var(--primary-text); pointer-events: none; font-weight: 600; z-index: 6; }
.blk-time { font-size: 11px; line-height: 14px; opacity: .85; font-variant-numeric: tabular-nums; white-space: nowrap; }
.blk-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 18px; }
.blk-sub { font-size: 11px; line-height: 14px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk-icons { position: absolute; top: 3px; right: 4px; display: flex; gap: 3px; }
.blk .rz { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.blk.st-booked { background: var(--tint); }
.blk.st-ready { background: #ffffff; }
.blk.st-note { border-style: dashed; border-color: var(--dark-gray); color: var(--text-2); }
.blk.st-cal { border-color: var(--medium-gray); background: #ffffff; color: var(--text-2); }
.blk.st-changed { background: var(--warn-bg); border-color: var(--warn); color: #4a2c00; }
.blk.st-running { background: var(--primary); border-color: var(--primary-text); animation: pulse 2s ease-in-out infinite; }
.blk.st-event { background: #f5f5f5; border-color: #dddddd; color: var(--text-2); cursor: pointer; }
.blk.st-ignored { background: repeating-linear-gradient(135deg, #f3f3f3 0 4px, #ffffff 4px 8px); border-color: #e4e4e4; color: var(--muted); }
.blk.st-ignored .blk-title { font-weight: 400; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(72,193,233,.45); } 50% { box-shadow: 0 0 0 5px rgba(72,193,233,0); } }
svg.st { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.4; flex: none; }
svg.st.sm { width: 12px; height: 12px; }
.st-booked svg.st, .alloc-booked svg.st, .detail-status.st-booked svg.st { stroke: var(--success-text); color: var(--success-text); }
.st-ready svg.st, .detail-status.st-ready svg.st { stroke: var(--primary-text); color: var(--primary-text); }
.st-changed svg.st, .detail-status.st-changed svg.st { stroke: var(--warn-text); color: var(--warn-text); }
.st-note svg.st, .st-cal svg.st, .st-event svg.st, .detail-status.st-note svg.st, .detail-status.st-cal svg.st { stroke: var(--muted); color: var(--muted); }
.tl-legend { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 16px 0 68px; font-size: 12px; color: var(--muted); }
.tl-legend span { display: inline-flex; gap: 6px; align-items: center; }
.tl-legend svg.st:nth-of-type(1) { stroke: var(--success-text); }
.tl-legend .sw { width: 14px; height: 10px; border: 1px solid var(--medium-gray); display: inline-block; }
.tl-legend .sw.ign { background: repeating-linear-gradient(135deg, #eeeeee 0 3px, #ffffff 3px 6px); }
.tl-legend .sw.run { background: var(--primary); border-color: var(--primary); }

/* To-Dos */
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button {
    flex: 1; height: 40px; border: 0; border-bottom: 3px solid transparent; background: none; font-weight: 600;
    cursor: pointer; color: var(--dark); font-size: 14px;
}
.tabs button span { color: var(--muted); font-weight: 400; margin-left: 2px; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--primary); color: var(--primary-text); font-weight: 700; }
.todo-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.todo-heading { margin: 4px 0 4px; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--global-border); cursor: grab; }
.todo input[type=checkbox] { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--dark); flex: none; cursor: pointer; }
.todo-body { flex: 1; min-width: 0; }
.todo-title b { color: var(--primary-text); }
.todo.done .todo-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--medium-gray); }
.todo-meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.todo-meta svg.st { stroke: var(--muted); }
.tag.claude { background: #f0ebe3; color: #6b3f1d; font-weight: 600; padding: 0 5px; font-size: 11px; }
.todo-play, .todo-menu summary {
    width: 28px; height: 28px; border: 1px solid var(--line); background: #ffffff; cursor: pointer; flex: none;
    display: flex; align-items: center; justify-content: center; color: var(--dark); list-style: none; font-size: 16px; line-height: 1;
}
.todo-play:hover, .todo-menu summary:hover { background: var(--surface); }
.todo-menu { position: relative; }
.todo-menu summary::-webkit-details-marker { display: none; }
.todo-menu .menu { position: absolute; right: 0; top: 32px; min-width: 200px; background: #ffffff; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.08); padding: 4px 0; z-index: 10; }
.todo-menu .menu button { display: block; width: 100%; text-align: left; padding: 8px 14px; border: 0; background: none; font-size: 14px; cursor: pointer; color: var(--dark); }
.todo-menu .menu button:hover { background: var(--surface); }
.todo-menu .menu button.danger { color: var(--alert-text); }
.todo-group { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; }
.todo-empty, .todo-hint { font-size: 12px; color: var(--muted); padding: 10px 0; }
.recur-form { border: 1px solid var(--line); padding: 12px; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.recur-form label { display: flex; gap: 8px; align-items: center; }
.recur-days { display: flex; gap: 10px; padding-left: 24px; }
.recur-time { flex-direction: column; align-items: flex-start !important; }
.recur-time input { width: 130px; }

/* Detailpanel */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail-head h2 { margin: 6px 0 2px; font-size: 18px; line-height: 24px; }
.detail-head .kicker { display: flex; gap: 6px; align-items: center; }
.detail-title { font-size: 18px; line-height: 24px; font-weight: 700; border: 0; border-bottom: 1px solid transparent; background: transparent; padding: 4px 0; height: auto; margin: 4px 0 0; }
.detail-title:hover, .detail-title:focus { border-bottom-color: var(--medium-gray); outline: none; }
.icon-btn { width: 32px; height: 32px; border: 0; background: none; cursor: pointer; font-size: 18px; color: var(--dark); flex: none; }
.icon-btn:hover { background: var(--light-gray); }
.icon-btn[disabled] { color: var(--medium-gray); cursor: default; }
.detail-times { display: flex; gap: 8px; margin-top: 14px; }
.detail-times label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); flex: 1; }
.detail-times input { height: 36px; padding: 0 8px; font-size: 13px; }
.detail .field { margin-top: 14px; }
.detail .field > span { display: flex; gap: 6px; align-items: baseline; }
.detail .field small { font-weight: 400; }
.detail-section { margin-top: 16px; }
.detail-sechead { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.detail-sechead .ok { color: var(--success-text); font-size: 12px; }
.detail-sechead .warn { color: var(--warn-text); font-size: 12px; }
.alloc { background: #ffffff; border: 1px solid var(--line); padding: 10px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.alloc-row { display: flex; gap: 6px; align-items: center; }
.alloc-ticket { display: flex; align-items: center; gap: 2px; font-weight: 700; color: var(--primary-text); }
.alloc-ticket input { width: 92px; height: 34px; padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--primary-text); }
.alloc-row select { flex: 1; height: 34px; padding: 0 6px; font-size: 13px; min-width: 0; }
.alloc-min { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.alloc-min input { width: 64px; height: 34px; padding: 0 6px; font-size: 13px; text-align: right; }
.alloc input[type=text] { height: 32px; font-size: 13px; border-color: var(--line); }
.alloc-mr, .alloc-booked { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.alloc-booked { color: var(--success-text); }
.detail-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.detail-actions.main { margin-top: 18px; }
.detail-actions.main .btn { flex: 1; }
.detail-remind { flex-direction: row !important; align-items: center; gap: 10px; }
.detail-remind select { flex: 1; height: 34px; font-size: 13px; }
.detail-status { margin-top: 16px; display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 10px 12px; background: #ffffff; border: 1px solid var(--line); }
.detail-status a { margin-left: auto; font-weight: 600; }
.detail-foot { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.detail-foot .btn-plain { text-decoration: none; }
.detail p.muted { font-size: 13px; margin: 14px 0 0; }

/* --- Tabellen ----------------------------------------------------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); }
table.data { border-collapse: collapse; width: 100%; min-width: 860px; }
table.data th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); padding: 10px 12px; text-align: left; white-space: nowrap; }
table.data td { border-top: 1px solid var(--global-border); padding: 8px 12px; vertical-align: middle; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.daysep th { padding: 14px 12px 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dark); background: #ffffff; border-top: 1px solid var(--line); }
table.data tr.daysep th .muted { font-weight: 600; letter-spacing: 0; text-transform: none; }
table.data td input[type=text], table.data td select { height: 32px; font-size: 13px; padding: 0 8px; }
table.data td input[type=text] { border-color: var(--line); min-width: 180px; }
table.data td input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--dark); }
.small { font-size: 12px; }
.semi { font-weight: 600; }
.nowrap { white-space: nowrap; }
.seg-link { height: 40px; padding: 0 14px; border: 1px solid var(--medium-gray); border-left-width: 0; display: inline-flex; align-items: center; font-weight: 600; color: var(--dark); text-decoration: none; }
.seg-link:first-child { border-left-width: 1px; }
.seg-link[aria-current="page"] { background: var(--dark); border-color: var(--dark); color: #ffffff; }
.seg-link:hover { text-decoration: none; }

/* --- Buchen --------------------------------------------------------- */
.booking { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.booking-main { flex: 999 1 640px; min-width: 0; }
.booking-side { flex: 1 1 280px; max-width: 360px; position: sticky; top: calc(var(--header-h) + 16px); }
.booking-sum { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.booking-sum span { font-size: 40px; line-height: 44px; font-weight: 900; font-variant-numeric: tabular-nums; }
.booking-sum small { font-weight: 600; font-size: 14px; }
.booking-byact { border-top: 1px solid var(--line); margin: 14px 0; padding-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13px; }
.booking-byact .k { color: var(--muted); }
.booking-byact .v { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.booking-booked { display: flex; gap: 8px; align-items: center; margin-top: 16px; padding: 10px 12px; background: var(--success-bg); color: var(--success-text); font-size: 13px; }
.booking-booked svg.st { stroke: var(--success-text); }
.booking-table tr.state-changed td { background: var(--warn-soft); }
.booking-table tr.state-booked td { color: var(--text-2); }
.booking-table .ticket-cell a b { color: var(--primary-text); }
.chip svg.st { width: 13px; height: 13px; }

/* --- Meine Tickets (Board) ------------------------------------------ */
.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding: 0 24px 12px; min-height: 200px; }
.board-col { width: 250px; flex: none; background: var(--surface); border: 1px solid var(--line); }
.board-col h2 { margin: 0; padding: 10px 12px; font-size: 13px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); background: #ffffff; }
.board-col h2 span { color: var(--muted); font-weight: 600; }
.board-cards { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.card { background: #ffffff; border: 1px solid var(--line); padding: 10px; }
.card.old { border-color: var(--warn); }
.card-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.card-head a b { color: var(--primary-text); }
.card-title { font-size: 13px; line-height: 18px; margin: 4px 0 6px; }
.card .translation { font-size: 13px; line-height: 18px; color: var(--primary-text); margin: -2px 0 6px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card .age { font-size: 12px; font-weight: 600; color: var(--text-2); }
.card .age.old { color: var(--warn-text); }
.card .age.fresh { color: var(--success-text); }
.card-actions { display: flex; gap: 4px; align-items: center; }
.icon-btn.sm { width: 28px; height: 28px; border: 1px solid var(--line); background: #ffffff; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn.sm .ico { width: 14px; height: 14px; }
.btn-plain.small { font-size: 12px; }
.card[hidden] { display: none; }

/* --- Merge Requests ------------------------------------------------- */
.mr-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); margin-bottom: 8px; }
.mr-counts > div { padding: 12px 16px; border-right: 1px solid var(--line); }
.mr-counts > div:last-child { border-right: 0; }
.mr-counts .k { font-size: 12px; color: var(--muted); }
.mr-counts .v { font-size: 26px; line-height: 32px; font-weight: 900; }
.mr-counts .warn { background: var(--warn-soft); }
.mr-counts .warn .k, .mr-counts .warn .v { color: #4a2c00; }
.mr-counts .ok { background: #eef7e9; }
.mr-counts .ok .k, .mr-counts .ok .v { color: var(--success-text); }
.mr-bucket { margin-top: 28px; }
.mr-bucket h2 { margin: 0 0 10px; }
.mr-project { border: 1px solid var(--line); margin-bottom: 10px; }
.mr-project-head { padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--text-2); display: flex; justify-content: space-between; gap: 12px; }
.mr-row { display: flex; gap: 14px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--global-border); flex-wrap: wrap; }
.mr-row:first-of-type { border-top: 0; }
.mr-main { flex: 1 1 380px; min-width: 0; }
.mr-main a b { color: var(--primary-text); }
.mr-meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.mr-meta .chip { padding: 0 6px; }
.mr-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mr-actions form { display: flex; gap: 6px; }
.btn.dark { background: var(--dark); border-color: var(--dark); color: #ffffff; }
.btn.dark:hover { background: #2a2e2e; border-color: #2a2e2e; color: #ffffff; }
.btn.dark .ico { stroke: #ffffff; }

/* --- Ticketauswahl (Detailpanel) ------------------------------------- */
.picker { position: relative; flex: 1; min-width: 0; }
.picker input { width: 100%; height: 34px; padding: 0 8px; font-size: 13px; }
.picker-list { position: absolute; left: 0; right: -120px; top: 36px; z-index: 30; background: #ffffff; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.1); max-height: 300px; overflow-y: auto; }
.picker-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; cursor: pointer; font-size: 13px; line-height: 17px; }
.picker-list button:hover, .picker-list button.active { background: var(--tint-soft); }
.picker-list button b { color: var(--primary-text); }
.picker-list button small { display: block; color: var(--muted); font-size: 11px; }
.picker-list .picker-group { padding: 6px 10px 2px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.picker-list .picker-empty { padding: 8px 10px; color: var(--muted); font-size: 12px; }
.alloc-subject { font-size: 12px; color: var(--text-2); line-height: 16px; }
.alloc-mrline { display: flex; gap: 8px; align-items: center; font-size: 12px; position: relative; flex-wrap: wrap; }
.alloc-mrline .picker-list { position: static; right: auto; width: 100%; margin-top: 4px; }

/* --- Bottom-Navigation (nur Handy) ------------------------------ */
nav.bottom { display: none; }

/* --- Handy ------------------------------------------------------ */
@media (max-width: 760px) {
    :root { --header-h: 52px; }
    header.app .inner { gap: 12px; padding: 0 12px; }
    .brand b, .brand i, nav.main, .syncstate .lbl { display: none; }
    .timer { flex: 1; min-width: 0; }
    .timer .what { flex: 1; max-width: none; }
    main { padding: 16px 16px calc(var(--bottomnav-h) + 24px + env(safe-area-inset-bottom)); }
    h1 { font-size: 22px; line-height: 28px; }
    .grid-side { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .weekhead { grid-template-columns: minmax(0, 1fr); }
    .weekhead .day { display: none; border-left: 0; }
    .weekhead .day.today { display: block; }
    .btn { min-height: 44px; }
    .panel { padding: 16px; }

    /* Woche wird zur Tagesansicht: ein Bereich zur Zeit, Details als Bottom-Sheet */
    main.full { padding-top: 12px; }
    .week-head { padding: 0 12px; margin-bottom: 8px; }
    .week-nav { gap: 10px; }
    .week-nav h1 { font-size: 20px; line-height: 26px; }
    .desktop-only { display: none; }
    .mobile-only { display: flex; margin-left: auto; }
    .seg button { height: 40px; padding: 0 12px; }
    .totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 8px; }
    .totals > div { padding: 6px 8px; }
    .totals .v { font-size: 15px; }
    .hint.timer-warning, .hint.soft { margin: 0 12px 8px; }
    .weekwrap, .weekwrap:has(.detail:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
    .weekwrap[data-pane="timeline"] .todos { display: none; }
    .weekwrap[data-pane="todos"] .timeline { display: none; }
    .todos { border-right: 0; padding: 12px; }
    .tl-head { top: var(--header-h); }
    .tl-body { max-height: none; overflow: visible; }
    .tl-legend { display: none; }
    .blk { font-size: 13px; line-height: 16px; }
    .blk .rz { display: none; }
    .detail {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; max-height: 82vh; overflow-y: auto;
        border-left: 0; border-top: 3px solid var(--primary); box-shadow: 0 -8px 30px rgba(0,0,0,.18);
        padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); background: #ffffff;
    }
    .detail-times { flex-wrap: wrap; }
    .detail-times label { flex: 1 1 100px; }
    .alloc-row { flex-wrap: wrap; }
    .alloc-row select { flex: 1 1 100%; order: 3; }

    nav.bottom {
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
        background: #ffffff; border-top: 1px solid var(--line);
        padding-bottom: env(safe-area-inset-bottom);
    }
    nav.bottom a {
        height: var(--bottomnav-h); display: flex; flex-direction: column; align-items: center;
        justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600;
        text-decoration: none; border-top: 3px solid transparent;
    }
    nav.bottom a .ico { width: 22px; height: 22px; }
    nav.bottom a.active { color: var(--primary-text); border-top-color: var(--primary); }
}
