@font-face { font-family: Jost; font-weight: 300; src: url(fonts/jost-300.woff2) format("woff2"); }
@font-face { font-family: Jost; font-weight: 400; src: url(fonts/jost-400.woff2) format("woff2"); }
@font-face { font-family: Jost; font-weight: 500; src: url(fonts/jost-500.woff2) format("woff2"); }
@font-face { font-family: Jost; font-weight: 600; src: url(fonts/jost-600.woff2) format("woff2"); }

:root {
  --bg: #F7F6F3; --ink: #1B1B1B; --muted: #7D7A73; --soft: #ECEAE5; --line: #E4E1DB; --outline: #CFCCC5;
  --red: #C5483E; --lunch: rgba(27,27,27,.045); --off: rgba(27,27,27,.03); --card: #FFFFFF;
  --hour: 52px;
}
:root.dark {
  --bg: #141414; --ink: #F2F2F2; --muted: #9A9A9E; --soft: #242426; --line: #2A2A2C; --outline: #3A3A3D;
  --red: #E07A70; --lunch: rgba(242,242,242,.05); --off: rgba(242,242,242,.03); --card: #1C1C1E;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: Jost, system-ui, sans-serif; font-size: 15px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
input, select { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; outline: none; }
input:focus, select:focus { border-color: var(--ink); }
.muted { color: var(--muted); }
.label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.pill { border-radius: 999px; padding: 9px 18px; background: var(--soft); white-space: nowrap; }
.pill.dark { background: var(--ink); color: var(--bg); }
.pill.small { padding: 6px 13px; font-size: 13px; }
.pill:disabled { opacity: .35; cursor: default; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 3px; }
.seg button { padding: 6px 14px; border-radius: 999px; color: var(--muted); }
.seg button.on { background: var(--ink); color: var(--bg); }
.bar { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.bar > div { height: 100%; background: var(--ink); border-radius: 3px; }

/* Login */
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; }
.login form { width: 300px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { font-weight: 300; font-size: 40px; margin: 0 0 8px; }

/* Layout */
.app { max-width: 1280px; margin: 0 auto; padding: 18px 24px 40px; }
.top { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.top h1 { font-weight: 300; font-size: 26px; margin: 0; }
.tabs button { padding: 8px 14px; color: var(--muted); font-weight: 500; }
.tabs button.on { color: var(--ink); }
.tabs button.on::after { content: ""; display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--ink); margin: 3px auto 0; }

/* Timer-Leiste */
.timer { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: 24px; background: var(--soft); margin-bottom: 14px; }
.timer .clock { font-weight: 300; font-size: 30px; font-variant-numeric: tabular-nums; min-width: 128px; }
.cats { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cat { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 8px 14px; background: var(--card); }
.cat.grp { font-weight: 600; }
.cat.on { outline: 1.5px solid var(--ink); }

/* Soll-Leiste */
.soll { display: grid; grid-template-columns: 1fr 1fr auto; gap: 18px; align-items: end; padding: 14px 16px; border: 1px solid var(--line); border-radius: 20px; margin-bottom: 18px; }
.soll .v { font-size: 17px; font-weight: 500; }
.soll .bar { margin-top: 8px; }

/* Kalender */
.calhead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.calhead h2 { font-weight: 400; font-size: 22px; margin: 0 8px; }
.cal { border-top: 1px solid var(--line); }
.days { display: grid; }
.dayhead { text-align: center; padding: 8px 4px 10px; cursor: pointer; }
.dayhead .n { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 50%; font-size: 17px; }
.dayhead.today .n { background: var(--ink); color: var(--bg); }
.dayhead .hol { color: var(--red); font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dayhead .bar { margin: 4px 14px 0; height: 4px; }
.scroll { height: calc(100vh - 330px); min-height: 380px; overflow-y: auto; position: relative; border-top: 1px solid var(--line); }
.grid { position: relative; display: grid; }
.hours { position: relative; }
.hours div { position: absolute; right: 8px; font-size: 11px; color: var(--muted); transform: translateY(-7px); }
.col { position: relative; border-left: 1px solid var(--line); }
.col.off { background: var(--off); }
.hline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); pointer-events: none; }
.lunch { position: absolute; left: 0; right: 0; background: var(--lunch); pointer-events: none; }
.now { position: absolute; left: -4px; right: 0; height: 2px; background: #E5483B; pointer-events: none; z-index: 3; }
.now::before { content: ""; position: absolute; left: 0; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #E5483B; }
.ev { position: absolute; border-radius: 7px; overflow: hidden; padding: 4px 6px 4px 9px; font-size: 12px; cursor: pointer; user-select: none; z-index: 1; }
.ev::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.ev b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; }
.ev span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .8; }
.ev .rs { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; cursor: ns-resize; }
.ev .rt { position: absolute; left: 0; right: 0; top: 0; height: 7px; cursor: ns-resize; }
.ev.drag { opacity: .85; z-index: 4; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.ghost { position: absolute; left: 2px; right: 2px; border-radius: 7px; border: 1.5px solid var(--ink); background: rgba(127,127,127,.12); font-size: 12px; padding: 4px 6px; pointer-events: none; z-index: 2; }

/* Monat */
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th { font-weight: 500; color: var(--muted); font-size: 13px; text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); }
td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
tr.done td { opacity: .38; }
tr.foot td { font-weight: 600; border-bottom: 0; border-top: 1.5px solid var(--ink); }
td.red, .red { color: var(--red); }
.check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--outline); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.check.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0 22px; }
.box { background: var(--soft); border-radius: 16px; padding: 14px 16px; }
.box .v { font-size: 22px; font-weight: 500; margin-top: 4px; }
.proj { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.proj > div { background: var(--soft); border-radius: 16px; padding: 12px 14px; }

/* Einstellungen */
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 24px; }
.card { border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; }
.card h3 { margin: 0 0 10px; font-weight: 500; font-size: 15px; }
.li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.code { font-size: 30px; letter-spacing: .2em; font-weight: 500; margin: 8px 0; }

/* Dialog */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; z-index: 10; }
.dialog { background: var(--bg); border-radius: 24px; padding: 22px; width: min(460px, 94vw); max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.dialog h2 { margin: 0; font-weight: 400; font-size: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border-radius: 999px; padding: 7px 13px; background: var(--soft); display: inline-flex; align-items: center; gap: 7px; }
.chip.on { outline: 1.5px solid var(--ink); }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid transparent; }
.swatch.on { border-color: var(--ink); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; z-index: 20; }

/* Druck (PDF) */
.print-only { display: none; }
@media print {
  :root, :root.dark { --bg: #fff; --ink: #1B1B1B; --muted: #7D7A73; --soft: #F1F0EC; --line: #E4E1DB; --red: #B24E46; }
  @page { size: A4; margin: 14mm; }
  body { font-size: 10.5pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print { display: none !important; }
  .print-only { display: block; }
  .app { padding: 0; max-width: none; }
  td, th { padding: 4px 5px; }
  .boxes { margin: 8px 0 14px; }
  .box .v { font-size: 15pt; }
  tr { break-inside: avoid; }
  .proj > div { break-inside: avoid; }
}
@media (max-width: 760px) {
  .app { padding: 12px; }
  .soll { grid-template-columns: 1fr; }
  .boxes { grid-template-columns: repeat(2, 1fr); }
}
.card .row input, .dialog .row input { flex: 1 1 0; min-width: 0; }
.dialog .row { flex-wrap: wrap; }

.ic { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; display: block; }
.top .icon { width: 38px; height: 38px; border-radius: 50%; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.top .icon:hover { background: var(--soft); color: var(--ink); }
.top .icon:disabled { color: var(--outline); background: transparent; cursor: default; }
.ai-list { display: flex; flex-direction: column; gap: 6px; }
.ai-row { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 14px; background: var(--soft); cursor: pointer; flex-wrap: wrap; }
.ai-row.off { opacity: .45; }
.dialog textarea { font: inherit; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); outline: none; resize: vertical; }
.ai-input { display: flex; gap: 8px; align-items: flex-start; }
.ai-input textarea { flex: 1; }
.mic { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--bg); flex: none; display: inline-flex; align-items: center; justify-content: center; }
.mic line { transform-box: fill-box; transform-origin: center; }
.mic.on line { animation: bar .9s ease-in-out infinite; }
.mic.on line:nth-child(2) { animation-delay: .15s; }
.mic.on line:nth-child(3) { animation-delay: .3s; }
@keyframes bar { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.45); } }
.timer .chip.note { padding: 5px 9px; font-size: 13px; color: var(--muted); max-width: 320px; gap: 6px; }
.timer .chip.note span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer .chip.note.has { background: var(--ink); color: var(--bg); padding: 5px 12px 5px 10px; }
.seg button:disabled { opacity: .35; cursor: default; }
.icon-x { width: 28px; height: 28px; border-radius: 50%; color: var(--muted); font-size: 18px; flex: none; }
.icon-x:hover { background: var(--soft); color: var(--ink); }
.ai-btns { display: flex; flex-direction: column; gap: 8px; }
.mic.send { background: var(--soft); color: var(--ink); }
.mic.send:not(:disabled):hover { background: var(--ink); color: var(--bg); }
.mic.send.busy { animation: pulse-bg 1s ease-in-out infinite; }
@keyframes pulse-bg { 50% { opacity: .4; } }
.mic { background: var(--soft); color: var(--ink); }
.mic.on { background: var(--ink); color: var(--bg); }
