/* Baumappe – Handy-App. Hell/Dunkel nach Systemeinstellung, Daumen-Bedienung, untere Leiste mit Safe-Area. */
:root {
  --bg: #f2f2f4; --card: #fff; --ink: #1d1d1f; --muted: #6e6e73; --line: #e2e2e6; --accent: #e8642c; --accent-ink: #fff;
  --accent-soft: #fde9df; --green: #1e9e5a; --red: #c8382c; --bubble: #fff; --mine: #e8642c; --mine-ink: #fff;
  --nav: rgba(255,255,255,.94);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111214; --card: #1f2023; --ink: #f2f2f2; --muted: #9a9ba0; --line: #303136; --accent-soft: #3a2418;
          --bubble: #2a2b2f; --nav: rgba(28,29,32,.94); }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
       padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: var(--accent); }
header.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
             display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
header.top h1 { font-size: 19px; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header.top .back { text-decoration: none; font-size: 17px; white-space: nowrap; }
header.top .sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }
main { padding: 14px 16px; max-width: 720px; margin: 0 auto; }
.card { background: var(--card); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.muted { color: var(--muted); } .small { font-size: 13.5px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.flash { border-radius: 12px; padding: 11px 14px; margin-bottom: 14px; background: var(--card); border-left: 4px solid var(--green); }
.flash.error { border-color: var(--red); color: var(--red); }
.btn, button { font: inherit; font-weight: 600; border: 0; border-radius: 12px; padding: 13px 18px; cursor: pointer;
               background: var(--accent-soft); color: var(--accent); text-decoration: none; display: inline-flex;
               align-items: center; justify-content: center; gap: 8px; }
.btn.primary, button.primary { background: var(--accent); color: var(--accent-ink); }
.btn.block, button.block { width: 100%; }
button.big { font-size: 20px; padding: 18px; border-radius: 16px; }
button.stop { background: var(--red); color: #fff; }
button.ghost { background: none; color: var(--muted); padding: 8px; }
button:disabled { opacity: .55; }
label.f { display: block; margin: 0 0 12px; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { font: inherit; font-size: 16px; width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
                          background: var(--bg); color: var(--ink); }
textarea { min-height: 44px; resize: none; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; min-width: 0; }

/* Stempeluhr */
.clock { text-align: center; }
.clock .time { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.clock .proj { font-weight: 600; }
.today { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; margin-top: 10px; }

/* Projektliste */
.proj-list a { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line);
               color: var(--ink); text-decoration: none; }
.proj-list a:last-child { border-bottom: 0; }
.proj-list .bar { width: 5px; align-self: stretch; border-radius: 3px; flex: none; }
.proj-list .t { flex: 1; min-width: 0; } .proj-list .t b { display: block; }
.proj-list .t span { font-size: 13px; color: var(--muted); }
.chev { color: var(--muted); font-size: 22px; }

/* Verlauf als Chat */
.feed { display: flex; flex-direction: column; gap: 10px; padding-bottom: 150px; }
.msg { max-width: 86%; background: var(--bubble); border-radius: 16px 16px 16px 4px; padding: 9px 12px; align-self: flex-start; }
.msg.mine { background: var(--mine); color: var(--mine-ink); border-radius: 16px 16px 4px 16px; align-self: flex-end; }
.msg.pinned { outline: 2px solid var(--accent); }
.msg .who { font-size: 12.5px; font-weight: 600; opacity: .8; }
.msg .text { white-space: pre-wrap; word-wrap: break-word; }
.msg .meta { font-size: 11.5px; opacity: .75; text-align: right; margin-top: 2px; }
.msg .tag { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 99px; padding: 0 8px; background: rgba(0,0,0,.12); }
.msg .photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin: 4px 0; }
.msg .photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: rgba(0,0,0,.1); }
.msg .photos.one { grid-template-columns: 1fr; } .msg .photos.one img { aspect-ratio: auto; max-height: 360px; }
.msg.failed { background: var(--red); }
.day { align-self: center; font-size: 12px; color: var(--muted); background: var(--card); border-radius: 99px; padding: 2px 10px; }
.sys { align-self: center; font-size: 12.5px; color: var(--muted); }

/* Eingabezeile über der unteren Leiste */
.composer { position: fixed; left: 0; right: 0; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 6; background: var(--nav);
            backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 8px 10px; }
.composer .line { display: flex; gap: 8px; align-items: flex-end; max-width: 720px; margin: 0 auto; }
.composer textarea { flex: 1; border-radius: 20px; padding: 10px 14px; max-height: 120px; }
.composer .ico { flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 20px; }
.composer .extra { display: flex; gap: 8px; align-items: center; max-width: 720px; margin: 6px auto 0; flex-wrap: wrap; }
.composer .extra select { width: auto; padding: 6px 10px; font-size: 14px; border-radius: 99px; }
.composer .thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.composer .thumbs img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.composer[hidden] { display: none; }

/* Zeiten */
.day-card { background: var(--card); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.day-card .h { display: flex; justify-content: space-between; padding: 10px 14px; background: var(--line); font-weight: 600; }
.day-card .i { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line);
               color: var(--ink); text-decoration: none; }
.day-card .i span { font-size: 13.5px; color: var(--muted); }
.konto { display: flex; justify-content: space-between; align-items: center; font-size: 18px; font-weight: 700; }
.month { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.month a { font-size: 26px; text-decoration: none; padding: 0 10px; }

.fab { position: fixed; right: 18px; bottom: calc(80px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%;
       background: var(--accent); color: #fff; font-size: 30px; display: grid; place-items: center; text-decoration: none;
       box-shadow: 0 4px 14px rgba(0,0,0,.25); z-index: 4; }

/* Untere Leiste */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; background: var(--nav);
           backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
           padding-bottom: env(safe-area-inset-bottom); }
nav.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: 11.5px;
             color: var(--muted); text-decoration: none; }
nav.tabs a svg { width: 25px; height: 25px; }
nav.tabs a.on { color: var(--accent); }
.queue-note { position: fixed; top: calc(60px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 8;
              background: var(--ink); color: var(--bg); border-radius: 99px; padding: 6px 14px; font-size: 13px; }
.queue-note[hidden] { display: none; }
