:root {
  --bg: #0b1026;
  --bg-2: #121a3d;
  --card: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef1ff;
  --muted: #9aa5d1;
  --accent: #ffb86b;
  --accent-2: #8fb8ff;
  --danger: #ff6b81;
  --ok: #6be3a8;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: radial-gradient(1200px 600px at 80% -10%, #24317a 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #3a1d5e 0%, transparent 55%), var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.stars {
  position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 20%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 40% 80%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 65%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 10% 70%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 50%, #cfe0ff 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 90%, #fff 50%, transparent 51%);
  background-size: 400px 400px;
}
a { color: var(--accent-2); }
button, input, select, textarea { font: inherit; color: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: rgba(11, 16, 38, 0.75); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 10px; font-size: 15px; }
.topnav a.active { color: var(--text); background: var(--card-strong); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; border: 0; margin-left: 4px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #ff7a8a); color: #1a1030; font-weight: 700; font-size: 14px;
}

.view { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(env(safe-area-inset-bottom) + 96px); }
.loading, .empty { color: var(--muted); text-align: center; padding: 40px 12px; }

h1 { font-size: 26px; margin: 8px 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 24px 0 10px; }
.sub { color: var(--muted); margin: 0 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stack { display: grid; gap: 10px; }

.hero { display: grid; gap: 10px; margin: 8px 0 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card-strong); border-radius: 12px;
  padding: 10px 14px; cursor: pointer; text-decoration: none; color: var(--text); min-height: 44px;
}
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: linear-gradient(135deg, #ffcf7a, #ff8f6b); color: #1a1030; border: 0; font-weight: 700;
}
.btn.big { font-size: 18px; padding: 16px; border-radius: 16px; width: 100%; }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.addr-card { display: grid; gap: 6px; text-decoration: none; color: inherit; }
.addr-card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.addr { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 15px; overflow-wrap: anywhere; }
.addr-big {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 20px; font-weight: 600;
  overflow-wrap: anywhere; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: var(--text);
}
.badge {
  background: var(--accent); color: #1a1030; font-weight: 700; font-size: 12px;
  border-radius: 999px; padding: 2px 8px; flex: none;
}
.timer { font-variant-numeric: tabular-nums; color: var(--accent-2); font-size: 14px; }
.timer.soon { color: var(--danger); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }

.progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); width: 100%; transition: width 1s linear; }

.msg-list { display: grid; gap: 8px; }
.msg { display: grid; gap: 2px; text-decoration: none; color: inherit; }
.msg .row { display: flex; justify-content: space-between; gap: 8px; }
.msg .from { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.unread .from::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.msg .subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .preview { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.waiting { display: flex; align-items: center; gap: 12px; justify-content: center; color: var(--muted); padding: 28px 12px; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--accent-2); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(143, 184, 255, 0.6); } 100% { box-shadow: 0 0 0 16px rgba(143, 184, 255, 0); } }

.mail-head { display: grid; gap: 4px; margin-bottom: 12px; }
.mail-head .subject { font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.mail-frame { width: 100%; height: 70vh; border: 0; border-radius: 12px; background: #fff; resize: vertical; }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; margin: 0; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 8px 12px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--card-strong); color: var(--text); }

.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; margin-bottom: 8px; }

/* Bottom-Sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 90dvh; overflow: auto;
  background: var(--bg-2); border-top: 1px solid var(--line); border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 18px); box-shadow: var(--shadow);
  max-width: 760px; margin: 0 auto;
}
.sheet h2 { margin-top: 0; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .field .label { font-size: 14px; color: var(--muted); }
.input {
  width: 100%; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; min-height: 44px;
}
.input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 12px 0 0 12px; }
.input-group .suffix {
  display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-left: 0;
  border-radius: 0 12px 12px 0; color: var(--muted); background: rgba(255, 255, 255, 0.04); font-size: 14px; white-space: nowrap;
}
.input-group select.suffix { appearance: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 14px; cursor: pointer; min-height: 40px; }
.chip.on { background: var(--accent); color: #1a1030; border-color: var(--accent); font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
textarea.input { min-height: 120px; resize: vertical; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 20px);
  background: #f3f5ff; color: #12193d; padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); z-index: 30;
  max-width: calc(100% - 32px); font-weight: 600;
}
.toast.error { background: var(--danger); color: #fff; }

/* Verwaltung */
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 8px 0 16px; padding-bottom: 2px; }
.tabs button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 14px; cursor: pointer; white-space: nowrap; color: var(--muted); }
.tabs button.on { background: var(--card-strong); color: var(--text); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: grid; gap: 2px; }
.tile .num { font-size: 26px; font-weight: 700; }
.tile .lbl { color: var(--muted); font-size: 13px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.list-row .grow { min-width: 0; flex: 1; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
code { background: rgba(0, 0, 0, 0.3); padding: 1px 6px; border-radius: 6px; font-size: 14px; overflow-wrap: anywhere; }

.login { text-align: center; padding: 48px 8px; display: grid; gap: 16px; justify-items: center; }
.login img { width: 96px; height: 96px; }

@media (min-width: 640px) {
  .hero { grid-template-columns: 2fr 1fr; }
}
.spaced { margin-bottom: 14px; }
.brand span { white-space: nowrap; }
@media (max-width: 420px) {
  .brand span { display: none; }
}

/* Domains */
.notice { border-color: rgba(255, 184, 107, 0.45); background: rgba(255, 184, 107, 0.08); }
.hero.disabled { opacity: 0.45; pointer-events: none; }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line); background: var(--card-strong); white-space: nowrap;
}
.pill.ok { color: var(--ok); border-color: rgba(107, 227, 168, 0.4); }
.pill.warn { color: var(--accent); border-color: rgba(255, 184, 107, 0.4); }
.pill.error { color: var(--danger); border-color: rgba(255, 107, 129, 0.4); }
.pill.off { color: var(--muted); }
.checks { display: grid; gap: 8px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; }
.check-row > div { min-width: 0; overflow-wrap: anywhere; }
details summary { cursor: pointer; color: var(--accent-2); padding: 4px 0; }
.records { display: grid; gap: 10px; margin-top: 8px; }
.record { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, 0.2); }
.copyable {
  text-align: left; background: rgba(0, 0, 0, 0.3); border: 1px dashed var(--line); border-radius: 8px; padding: 6px 10px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; cursor: pointer; overflow-wrap: anywhere;
}
.copyable::after { content: "  ⧉"; color: var(--muted); }
.access { display: grid; gap: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.small-gap { margin-top: 8px; }
.btn-suffix { cursor: pointer; }
.spaced-top { margin-top: 14px; }

/* Suche, Codes, Konto */
.avatar { overflow: hidden; padding: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.search { margin: 0 0 14px; }
mark { background: rgba(255, 184, 107, 0.35); color: inherit; border-radius: 3px; padding: 0 2px; }
.code-chip {
  justify-self: start; margin-top: 4px; border: 1px dashed var(--accent); background: rgba(255, 184, 107, 0.12);
  color: var(--accent); border-radius: 10px; padding: 4px 10px; cursor: pointer;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 15px; letter-spacing: 0.06em;
}
.action-box {
  display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 12px; border-radius: 14px;
  background: rgba(143, 184, 255, 0.08); border: 1px solid rgba(143, 184, 255, 0.3);
}
.code-big {
  border: 0; background: none; color: var(--text); cursor: pointer; padding: 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 30px; font-weight: 700; letter-spacing: 0.12em;
}
.code-big::after { content: " ⧉"; font-size: 16px; color: var(--muted); }
.badge.warn { background: transparent; padding: 0 2px; }
.toast.tappable { cursor: pointer; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
