/* Polaris-Look (Shopify), aber mit Systemschrift: keine Webfont-Downloads, spart Daten. */
:root {
  --bg: #f1f1f1; --surface: #fff; --text: #303030; --sub: #616161; --muted: #8a8a8a; --border: #e3e3e3;
  --primary: #303030; --focus: #005bd3; --link: #005bd3;
  --info-bg: #e0f0ff; --info-fg: #00527c; --ok-bg: #cdfee1; --ok-fg: #0c5132;
  --warn-bg: #ffef9d; --warn-fg: #4f4700; --err-bg: #fedad9; --err-fg: #8e1f0b;
  --shadow: 0 1px 0 rgba(26,26,26,.07), 0 0 0 1px rgba(26,26,26,.07);
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a; --surface: #262626; --text: #e3e3e3; --sub: #b5b5b5; --muted: #8a8a8a; --border: #3a3a3a;
    --primary: #e3e3e3; --link: #6bb6ff;
    --info-bg: #003a5a; --info-fg: #c4e6ff; --ok-bg: #0c3f27; --ok-fg: #b4fed2;
    --warn-bg: #4a3c00; --warn-fg: #ffe880; --err-bg: #5c1a10; --err-fg: #ffc9c5;
    --shadow: 0 0 0 1px rgba(255,255,255,.08);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/20px -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 640px; margin: 0 auto; padding: 0 12px 32px; }
.boot { padding: 48px 0; text-align: center; color: var(--muted); }
h1 { font-size: 20px; line-height: 28px; font-weight: 650; margin: 0; letter-spacing: -.2px; }
h2 { font-size: 14px; line-height: 20px; font-weight: 650; margin: 0 0 6px; }
h3 { font-size: 14px; line-height: 20px; font-weight: 600; margin: 6px 0 0; overflow-wrap: anywhere; }
p { margin: 0 0 8px; }
a { color: var(--link); }

.top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0 10px; background: var(--bg); }
.actions { display: flex; gap: 8px; }

.btn { font: inherit; font-weight: 550; border: 0; border-radius: 8px; padding: 6px 12px; min-height: 32px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: pointer; }
.btn:active { transform: translateY(1px); }
.btn.icon { width: 36px; padding: 0; font-size: 17px; }
.btn.primary { background: var(--primary); color: var(--bg); box-shadow: none; }
.btn.plain { background: transparent; box-shadow: none; color: var(--link); padding: 6px 8px; }
.btn.danger { color: var(--err-fg); }
.btn[disabled] { opacity: .5; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-end { display: flex; justify-content: flex-end; margin: -4px 0 4px; }
.center { text-align: center; margin: 16px 0; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { font: inherit; font-size: 13px; white-space: nowrap; border: 0; border-radius: 999px; padding: 4px 12px;
  background: var(--surface); color: var(--sub); box-shadow: var(--shadow); }
.chip.on { background: var(--primary); color: var(--bg); box-shadow: none; }

.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.day { font-size: 12px; font-weight: 600; color: var(--sub); margin: 10px 4px 0; text-transform: uppercase; letter-spacing: .3px; }
.empty { text-align: center; color: var(--sub); padding: 28px 16px; }

.msg { position: relative; cursor: pointer; border-left: 3px solid transparent; }
.msg.lvl-error { border-left-color: var(--err-fg); }
.msg.lvl-warning { border-left-color: #b28400; }
.msg.unread h3::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--focus); margin-left: 6px; vertical-align: middle; }
.msg:not(.unread) h3 { font-weight: 500; }
.meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--sub); }
.src { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time { margin-left: auto; white-space: nowrap; color: var(--muted); }
.badge { font-size: 12px; line-height: 16px; font-weight: 550; padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.b-info { background: var(--info-bg); color: var(--info-fg); }
.b-success { background: var(--ok-bg); color: var(--ok-fg); }
.b-warning { background: var(--warn-bg); color: var(--warn-fg); }
.b-error { background: var(--err-bg); color: var(--err-fg); }
.body { margin: 4px 0 0; color: var(--sub); white-space: pre-wrap; overflow-wrap: anywhere; }
.body.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.hint { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.link { display: inline-block; margin-top: 8px; font-weight: 550; text-decoration: none; }

.banner { border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; font-size: 13px; }
.banner.off { background: var(--warn-bg); color: var(--warn-fg); }
.banner.err { background: var(--err-bg); color: var(--err-fg); }

.sub { color: var(--sub); font-size: 13px; }
input { font: inherit; font-size: 16px; width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid #8a8a8a;
  background: var(--surface); color: var(--text); }
input:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
form.inline { display: flex; gap: 8px; margin: 8px 0 4px; }
.src-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); }
.src-row.revoked strong { color: var(--muted); }
.src-row .btns { flex-shrink: 0; gap: 0; }
.new-token { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.snip { margin: 8px 0; }
.snip-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--sub); }
pre { margin: 2px 0 0; padding: 8px 10px; background: var(--surface); border-radius: 8px; font: 12px/16px ui-monospace, Menlo, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; -webkit-user-select: all; user-select: all; }

.auth-wrap { padding-top: 12vh; }
.auth { display: flex; flex-direction: column; gap: 10px; max-width: 380px; margin: 0 auto; padding: 24px; }
.error { color: var(--err-fg); margin: 0; min-height: 0; }
.error:empty { display: none; }

.segs { display: flex; background: var(--border); border-radius: 10px; padding: 2px; margin: 0 0 10px; }
.seg { flex: 1; font: inherit; font-weight: 550; border: 0; border-radius: 8px; padding: 6px 0; background: transparent; color: var(--sub); }
.seg.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.summary h2 { margin: 0; }
.summary p { margin: 2px 0 0; }
.summary.lvl-success { border-left: 3px solid var(--ok-fg); }
.summary.lvl-error { border-left: 3px solid var(--err-fg); }
.summary.lvl-warning { border-left: 3px solid #b28400; }
.proj-last { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; }
.proj-last h3 { margin: 0; font-weight: 500; }
.proj-last .badge { flex-shrink: 0; }
.count { font-size: 12px; font-weight: 600; color: var(--focus); }
