/* oQueo corporate identity (source: Ablage/00 Zentrale/Marken/oQueo, Styleguide 1.0) */

@font-face { font-family: "Made Tommy Soft"; src: url("/fonts/tommy-soft-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Elms Sans"; src: url("/fonts/elms-sans-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Elms Sans"; src: url("/fonts/elms-sans-bold.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }

:root {
  --bg: #F8F6F2;
  --bg2: #EDEAE3;
  --card: #FFFFFF;
  --text: #0E0C0A;
  --muted: #6F685E;
  --accent: #C8491A;
  --accent-ink: #AE4015;
  --accent-dim: #F2E2D6;
  --border: rgba(14, 12, 10, 0.10);
  --bad: #A8281D;
  --ok: #2E6B3E;
  --logo-braun: #4F380E;
  --on-braun: #FFFFFF;
  --shadow: 0 1px 3px rgba(14, 12, 10, 0.06), 0 4px 12px rgba(14, 12, 10, 0.05);
  --r: 10px;
  --r-btn: 8px;
  --r-panel: 12px;
  --bar: 64px;
  --font-head: "Made Tommy Soft", "Elms Sans", system-ui, sans-serif;
  --font-body: "Elms Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dunkel"] {
  --bg: #100E0C;
  --bg2: #1C1916;
  --card: #242119;
  --text: #EDE9E3;
  --muted: #948B80;
  --accent: #BE4F27;
  --accent-ink: #E26A3F;
  --accent-dim: #3A1E0E;
  --border: rgba(237, 233, 227, 0.09);
  --bad: #FF8A7A;
  --ok: #7FCF98;
  --logo-braun: #EDE9E3;
  --on-braun: #100E0C;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) {
    --bg: #100E0C;
    --bg2: #1C1916;
    --card: #242119;
    --text: #EDE9E3;
    --muted: #948B80;
    --accent: #BE4F27;
    --accent-ink: #E26A3F;
    --accent-dim: #3A1E0E;
    --border: rgba(237, 233, 227, 0.09);
    --bad: #FF8A7A;
    --ok: #7FCF98;
    --logo-braun: #EDE9E3;
    --on-braun: #100E0C;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-family: var(--font-head); font-weight: 400; line-height: 1.15; }
p { margin: 0 0 0.75em; }
a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: 13.6px; }
.error { color: var(--bad); margin: 0.5rem 0; }

/* logo: one img per theme, the matching one is shown */
.logo { display: block; height: 30px; width: auto; }
.logo.dunkel { display: none; }
:root[data-theme="dunkel"] .logo.hell { display: none; }
:root[data-theme="dunkel"] .logo.dunkel { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) .logo.hell { display: none; }
  :root:not([data-theme="hell"]) .logo.dunkel { display: block; }
}

/* eyebrow: small uppercase label with an accent line before it */
.eyebrow {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 10px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-ink);
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--accent); flex: none; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* shell */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-actions { display: flex; gap: 2px; }

#view {
  max-width: 760px; margin: 0 auto;
  padding: 24px 16px calc(var(--bar) + env(safe-area-inset-bottom) + 32px);
  outline: none;
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card);
  border-top: 1px solid var(--border);
}
.tabbar a {
  position: relative;
  flex: 1; min-height: var(--bar);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 12.5px; font-weight: 700;
}
.tabbar a[aria-current="page"] { color: var(--accent-ink); }
.tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; background: var(--accent); }
.badge {
  position: absolute; top: 8px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center;
}
a:focus-visible, .btn:focus-visible, summary:focus-visible, .row:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--r-btn);
}

/* page head and hero */
.page-head { margin: 4px 0 22px; }
.page-head h1 { font-size: 26px; }
.lead { font-size: 18px; color: var(--muted); margin: 10px 0 0; }
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  margin: 0 0 20px; padding: 28px 20px 26px; min-height: 230px;
  display: flex; flex-direction: column; justify-content: center;
  background: var(--bg2); border-radius: var(--r-panel);
}
.hero > :not(canvas) { position: relative; z-index: 1; }
.hero h1 { font-size: 34px; }
.hero .lead { margin-top: 12px; }
.network { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0.58; }

/* cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 { font-size: 19px; margin-bottom: 10px; }
.section-title { margin: 28px 0 10px; }

/* Eckdaten tiles */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.fact {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 14px 12px;
}
.fact::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--accent); }
.fact .value { display: block; font-family: var(--font-head); font-size: 35px; line-height: 1.1; }
.fact .label { display: block; margin-top: 4px; font-size: 13.6px; color: var(--muted); line-height: 1.35; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 22px;
  border-radius: var(--r-btn); border: 1.5px solid var(--border);
  background: transparent; color: var(--text);
  font: 700 16px/1.2 var(--font-body); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn.primary:not(.noarrow)::after { content: "→"; font-weight: 700; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn.round { min-width: 44px; min-height: 44px; padding: 0; border-color: transparent; color: var(--muted); }
.btn.round:hover { border-color: var(--border); color: var(--accent-ink); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* list rows */
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 56px; padding: 12px 0;
  background: none; border: 0; border-bottom: 1px solid var(--border);
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.row:last-child { border-bottom: 0; }
.row .main { min-width: 0; flex: 1; }
.row .title { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { display: block; color: var(--muted); font-size: 13.6px; line-height: 1.45; overflow-wrap: anywhere; }
div.row { align-items: flex-start; cursor: default; }
div.row .title { white-space: normal; }
.row.unread .title::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
details > summary.row { list-style: none; }
details > summary.row::-webkit-details-marker { display: none; }
details > summary.row::after { content: ""; width: 8px; height: 8px; margin-left: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); flex: none; }
details[open] > summary.row::after { transform: rotate(-135deg); }
details > summary.row { padding-top: 0; padding-bottom: 0; border-bottom: 0; min-height: 40px; }
details[open] > summary.row { border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.count { font-family: var(--font-head); font-size: 19px; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.count.error-text { font: 700 13.6px var(--font-body); color: var(--bad); }

/* Etiketten */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 700; line-height: 1.4; white-space: nowrap;
  background: var(--accent-dim); color: var(--accent-ink);
}
.tag.braun { background: var(--logo-braun); color: var(--on-braun); }
.tag.bad { background: transparent; color: var(--bad); border: 1.5px solid var(--bad); }

.preview-body, .mail-body {
  white-space: pre-wrap; overflow-wrap: anywhere;
  font: inherit; margin: 12px 0 0; padding: 14px;
  background: var(--bg); border-radius: var(--r); border: 1px solid var(--border);
  max-height: 50vh; overflow: auto;
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.notice { background: var(--accent-dim); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--r-btn); margin: 0 0 10px; }
.empty { text-align: center; color: var(--muted); padding: 40px 8px; }

/* login */
.login { position: relative; min-height: 100dvh; display: grid; place-items: center; padding: 16px; overflow: hidden; isolation: isolate; background: var(--bg2); }
.login-card { position: relative; z-index: 1; width: min(440px, 100%); padding: 28px 24px 24px; }
.login-card .logo { height: 36px; margin-bottom: 26px; }
.login-card h1 { font-size: 26px; margin-bottom: 10px; }
.login-card label { display: block; font-weight: 700; margin: 18px 0 6px; }
.login-card .btn { width: 100%; margin-top: 10px; }
.login-claim { margin: 22px 0 0; font-size: 13.6px; color: var(--muted); }
input[type="password"], input[type="text"] {
  width: 100%; min-height: 48px; padding: 0 14px; margin-bottom: 8px;
  border-radius: var(--r-btn); border: 1.5px solid var(--border);
  background: var(--card); color: var(--text); font: inherit;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

dialog { width: min(640px, calc(100vw - 24px)); max-height: 90dvh; padding: 0; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--card); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(14, 12, 10, 0.55); }
.dialog-body { padding: 22px; }
.dialog-body h2 { font-size: 26px; overflow-wrap: anywhere; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bar) + env(safe-area-inset-bottom) + 16px);
  width: max-content; max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px; border-radius: var(--r-btn); z-index: 20;
  background: var(--text); color: var(--bg); font-weight: 700; box-shadow: var(--shadow);
}
.toast.bad { background: var(--bad); color: #fff; }
:root[data-theme="dunkel"] .toast.bad { color: #100E0C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="hell"]) .toast.bad { color: #100E0C; } }

@media (min-width: 720px) {
  #view { padding-top: 36px; }
  .page-head h1 { font-size: 35px; }
  .hero { padding: 40px 36px 36px; min-height: 300px; }
  .hero h1 { font-size: 51px; }
  .card { padding: 24px; }
  .login-card { padding: 36px 36px 30px; }
  .login-card h1 { font-size: 35px; }
  .dialog-body h2 { font-size: 35px; }
}
@media (max-width: 420px) {
  .facts { gap: 8px; }
  .fact { padding: 12px 10px 10px; }
  .fact .value { font-size: 30px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .tabbar a, .row { transition: color 0.2s, background-color 0.2s, border-color 0.2s, opacity 0.2s; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
