:root {
  color-scheme: dark;
  --bg: #080e12;
  --panel: rgba(18, 20, 24, 0.92);
  --panel-strong: #14161a;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eceff1;
  --muted: #8b949e;
  --accent: #c9a66b;
  --accent-strong: #efdbb1;
  --danger: #e08b88;
  --success: #6fbf93;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-family: var(--font-sans);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--text); background: #0b0c0e; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
button, input { font: inherit; }

.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; opacity: .28; }
.ambient span { position: absolute; border: 1px solid rgba(255, 255, 255, .05); border-radius: 50%; }
.ambient span:nth-child(1) { width: 62vw; height: 62vw; right: -31vw; top: -18vw; }
.ambient span:nth-child(2) { width: 38vw; height: 38vw; right: -14vw; top: -6vw; }
.ambient span:nth-child(3) { width: 18rem; height: 18rem; left: -9rem; bottom: 8%; }

.site-shell { position: relative; width: min(1180px, calc(100% - 36px)); min-height: 100vh; margin: 0 auto; display: grid; grid-template-rows: auto 1fr auto; }
.site-header, .site-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-header { padding: 28px 0; }
.site-footer { padding: 24px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: .83rem; }
.site-footer nav { display: flex; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--accent-strong); background: rgba(255, 255, 255, .04); font: 650 .68rem/1 var(--font-sans); letter-spacing: .08em; box-shadow: none; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -.01em; font-weight: 600; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .72rem; text-transform: none; letter-spacing: 0; }
.identity { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .9rem; }

main { display: grid; align-items: center; padding: 42px 0 72px; }
.auth-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(330px, .72fr); gap: clamp(44px, 8vw, 110px); align-items: center; }
.intro h1, .legal h1, .single-column h1, .admin-layout h1 { margin: 0; font-family: var(--font-serif); font-size: clamp(2.35rem, 5.4vw, 4.8rem); font-weight: 500; line-height: 1.02; letter-spacing: -.03em; }
.intro > p:not(.eyebrow) { max-width: 620px; margin: 28px 0; color: #b4bcc4; font-size: 1.08rem; line-height: 1.7; }
.eyebrow { margin: 0 0 14px; color: var(--muted); font: 600 .72rem/1.2 var(--font-sans); text-transform: uppercase; letter-spacing: .14em; }
.signal-card { display: inline-flex; align-items: center; gap: 13px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .03); }
.signal-card strong, .signal-card small { display: block; }
.signal-card small { margin-top: 3px; color: var(--muted); }
.signal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: none; }

.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 24px 60px rgba(0, 0, 0, .38); backdrop-filter: blur(20px); }
.auth-panel { width: 100%; max-width: 480px; padding: clamp(25px, 4vw, 42px); }
.auth-panel h2 { margin: 0; font-family: var(--font-serif); font-size: 2rem; font-weight: 500; letter-spacing: -.03em; }
.muted { color: var(--muted); line-height: 1.65; }
form { display: grid; gap: 18px; margin-top: 28px; }
.field { display: grid; gap: 8px; }
.field > span, .invite-result > label { color: #d7dce1; font-size: .88rem; font-weight: 600; }
.field small, .invite-result small { color: var(--muted); line-height: 1.45; }
input { width: 100%; min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--text); background: rgba(8, 9, 11, .72); transition: border-color .18s, box-shadow .18s; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(from var(--accent) r g b / 0.16); }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; text-decoration: none; font-weight: 600; transition: transform .15s, opacity .15s, border-color .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button-primary { color: #101214; background: var(--accent-strong); box-shadow: none; }
.button-secondary { color: var(--text); border-color: var(--line); background: rgba(255, 255, 255, .035); }
.button-quiet { min-height: 34px; padding: 7px 11px; color: var(--muted); border-color: var(--line); background: transparent; }
.form-message { min-height: 1.4em; margin: -3px 0; color: var(--danger); font-size: .88rem; line-height: 1.4; }
.form-message.success { color: var(--success); }
.fine-print { margin: 22px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.single-column { display: grid; place-items: center; }
.single-column .auth-panel h1 { font-size: clamp(2rem, 6vw, 3.4rem); }

.admin-layout { width: 100%; align-self: start; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.section-heading h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
.section-heading .muted { max-width: 650px; }
.admin-grid { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.admin-grid .panel { padding: 26px; }
.accounts-panel { grid-column: 1 / -1; }
.admin-grid h2 { margin: 0; letter-spacing: -.025em; }
.data-panel { min-height: 180px; }
.panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel-summary { margin: 6px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.count { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 20px; color: var(--accent); font-size: .8rem; }
.list { display: grid; gap: 2px; }
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 13px 0; border-top: 1px solid var(--line); }
.list-row-detailed { grid-template-columns: minmax(180px, 1fr) minmax(245px, .9fr) auto; padding: 16px 0; }
.list-row strong, .list-row small { display: block; overflow-wrap: anywhere; }
.list-row small { margin-top: 4px; color: var(--muted); }
.list-controls { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.role { color: var(--accent); font: .72rem/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .1em; }
.account-presence { min-width: 0; color: var(--muted); }
.presence-primary { display: flex; align-items: center; gap: 8px; color: inherit; font-size: .875rem; font-weight: 600; line-height: 1.35; }
.presence-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.account-presence small { margin: 5px 0 0 16px; font-size: .76rem; line-height: 1.4; }
.presence-active { color: var(--success); }
.presence-active .presence-dot { animation: presence-pulse 2.2s ease-out infinite; }
.presence-idle { color: var(--accent); }
.presence-unknown { color: #aeb6bd; }
.presence-away { color: var(--muted); }
@keyframes presence-pulse {
  0%, 45% { box-shadow: 0 0 0 0 rgb(from var(--success) r g b / .34); }
  80%, 100% { box-shadow: 0 0 0 6px rgb(from var(--success) r g b / 0); }
}
.button-list { min-height: 34px; padding: 7px 10px; color: var(--text); border-color: var(--line); background: rgba(255, 255, 255, .035); font-size: .75rem; }
.button-danger { color: #ffc0be; border-color: rgba(255, 145, 143, .28); }
.empty { margin: 22px 0 4px; color: var(--muted); }
.invite-result { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.invite-account { margin: 0 0 12px; color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 8px 0; }

.legal { width: min(760px, 100%); margin: 0 auto; padding: clamp(25px, 5vw, 54px); }
.legal h1 { margin-bottom: 42px; font-size: clamp(2.6rem, 7vw, 5.2rem); }
.legal h2 { margin: 32px 0 10px; font-size: 1.05rem; color: #d7dce1; }
.legal p, .legal address { color: #9aa3ab; font-style: normal; line-height: 1.72; }
.legal strong { color: var(--text); }
.legal-nav { display: flex; gap: 22px; margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--line); }
.updated { font-size: .84rem; }

@media (max-width: 820px) {
  .auth-grid { grid-template-columns: 1fr; }
  .intro h1 { font-size: clamp(2.7rem, 13vw, 4.8rem); }
  .auth-panel { max-width: none; }
  .admin-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
}

@media (max-width: 560px) {
  .site-shell { width: min(100% - 24px, 1180px); }
  .site-header { padding: 18px 0; }
  .brand small, .identity > span { display: none; }
  main { padding: 26px 0 48px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .copy-row { grid-template-columns: 1fr; }
  .button, .button-quiet { min-height: 44px; }
  .list-row { grid-template-columns: 1fr; }
  .list-row-detailed { grid-template-columns: 1fr; }
  .list-controls { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .presence-active .presence-dot { animation: none; }
}

/* Finanzen shares the sage palette of the household book. */
:root { --accent: #9fd89a; --accent-strong: #9fd89a; --panel: #141c18; --success: #9fd89a; --font-sans: ui-sans-serif, system-ui, sans-serif; --font-serif: Georgia, serif; }
body { background: #0b100e; }
.intro-leaf { display: block; width: 82px; height: 82px; margin-bottom: 32px; opacity: .85; }
.brand-mark img { width: 28px; height: 28px; }
.panel { border-radius: 22px; }
.intro h1 { font-size: clamp(2.6rem, 5vw, 4.5rem); }
.button-primary { min-height: 48px; border-radius: 12px; }
input { min-height: 48px; border-radius: 12px; }
