/* Investment Reminder – eine Datei, kein Build-Schritt (Spezifikation 13.4) */

:root {
  color-scheme: light dark;
  --bg: #f2f4f7;
  --surface: #ffffff;
  --fg: #16191d;
  --muted: #5d6671;
  --line: #dde1e6;
  --accent: #0a5fb4;
  --accent-fg: #ffffff;
  --ok: #17803a;
  --ok-bg: #e6f4ea;
  --warn: #9a5b00;
  --warn-bg: #fff4e0;
  --err: #b3261e;
  --err-bg: #fce8e6;
  --radius: 14px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1215;
    --surface: #1a1e23;
    --fg: #e9ecef;
    --muted: #9aa4ae;
    --line: #2b3138;
    --accent: #4d9bf0;
    --accent-fg: #0b1320;
    --ok: #57c77a;
    --ok-bg: #16301f;
    --warn: #f0b34a;
    --warn-bg: #33270f;
    --err: #ff8a80;
    --err-bg: #3a1a18;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  /* Home-Bildschirm-App: nicht unter Statusleiste und Home-Balken rutschen */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow-x: hidden;
}

header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.bar {
  max-width: 40rem;
  margin: 0 auto;
  padding: 12px var(--gutter) 0;
}

.bar h1 { font-size: 1.15rem; margin: 0 0 8px; letter-spacing: -0.01em; }

nav { display: flex; gap: 4px; }

nav a {
  flex: 1;
  text-align: center;
  padding: 10px 4px 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
}

nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: var(--gutter);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--gutter);
  margin-bottom: 12px;
}

.card h2 { font-size: 1.05rem; margin: 0 0 8px; }

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

.status { border: 0; }
.status.ok   { background: var(--ok-bg);   color: var(--ok); }
.status.warn { background: var(--warn-bg); color: var(--warn); }
.status.err  { background: var(--err-bg);  color: var(--err); }
.status strong { display: block; font-size: 1.05rem; }

.row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.row + .row { margin-top: 6px; }

label { display: block; font-weight: 600; margin: 0 0 6px; }

select, input {
  width: 100%;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin: 0 0 14px;
}

button {
  width: 100%;
  min-height: 50px;
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--accent);
  color: var(--accent-fg);
  cursor: pointer;
}

button.secondary { background: transparent; color: var(--err); border: 1px solid var(--line); }
button:disabled { opacity: 0.55; cursor: default; }
button + button { margin-top: 10px; }

.message { margin-top: 12px; }
.message:empty { display: none; }
.message.err { color: var(--err); }
.message.ok { color: var(--ok); }

ol.steps { margin: 0; padding-left: 1.3em; }
ol.steps li { margin-bottom: 6px; }

.toggle { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.toggle button { min-height: 40px; background: transparent; color: var(--muted); border-radius: 9px; padding: 6px; }
.toggle button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }
.toggle button + button { margin-top: 0; }

.group-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 18px 4px 8px; }
.group-title:first-child { margin-top: 4px; }

.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.item.flagged { border-color: var(--warn); }
.item.inactive { opacity: 0.6; }
.item .title { font-weight: 600; }
.item .meta { color: var(--muted); font-size: 0.9rem; }
.item .next { margin-top: 6px; font-size: 0.95rem; }
.item .issue { margin-top: 6px; font-size: 0.88rem; color: var(--warn); }

.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  white-space: nowrap;
}
.badge.soon { background: var(--accent); color: var(--accent-fg); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.err { background: var(--err-bg); color: var(--err); }

.empty { text-align: center; color: var(--muted); padding: 24px 8px; }

.link-card { display: flex; justify-content: space-between; align-items: center; color: var(--fg); text-decoration: none; font-weight: 600; }

label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; margin-bottom: 14px; }
label.check input { width: auto; margin: 0; transform: scale(1.3); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.actions button { width: auto; min-height: 40px; padding: 8px 12px; font-size: 0.9rem; background: var(--bg); color: var(--fg); border: 1px solid var(--line); }
.actions button.danger { color: var(--err); }
.actions button + button { margin-top: 0; }
.inline { display: flex; gap: 8px; margin-top: 10px; }
.inline input { margin: 0; }
.inline button { width: auto; min-height: 44px; }

[hidden] { display: none !important; }
