:root {
    --paper: #f4f0e8;
    --paper-deep: #e9e3d7;
    --ink: #18342d;
    --ink-soft: #607069;
    --pine: #1f594b;
    --pine-dark: #154338;
    --mint: #dce9df;
    --coral: #d46b4e;
    --white: #fffdf8;
    --line: rgba(24, 52, 45, .13);
    --shadow: 0 18px 55px rgba(39, 54, 47, .10);
    --radius: 22px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: var(--white); background: var(--pine); font-family: Georgia, serif; font-size: 21px; }
.eyebrow { margin: 0 0 10px; color: var(--coral); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.muted { color: var(--ink-soft); }

.auth-page { background: linear-gradient(135deg, var(--paper) 0%, #ebe6dc 100%); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); align-items: center; max-width: 1240px; margin: 0 auto; padding: 56px; gap: 72px; }
.auth-intro { max-width: 650px; }
.auth-intro .brand { margin-bottom: clamp(70px, 12vh, 140px); }
.auth-intro h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: clamp(50px, 6vw, 82px); line-height: .98; letter-spacing: -.045em; }
.auth-intro h1 em { color: var(--pine); font-weight: 400; }
.auth-intro .lead { max-width: 570px; margin: 28px 0; color: var(--ink-soft); font-size: 20px; line-height: 1.6; }
.privacy-note { display: inline-flex; gap: 10px; align-items: center; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 253, 248, .55); color: var(--ink-soft); font-size: 13px; }
.lock-dot { color: var(--pine); font-size: 9px; }
.mobile-brand { display: none; }
.auth-card { width: 100%; padding: 42px; border: 1px solid rgba(255,255,255,.7); border-radius: 30px; background: rgba(255, 253, 248, .88); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.auth-card h1, .auth-card h2 { margin: 0 0 28px; font-family: Georgia, serif; font-size: 34px; font-weight: 500; letter-spacing: -.025em; }
.setup-card { max-width: 560px; margin: auto; }
.setup-card .brand { margin-bottom: 50px; }
.setup-card code { font-size: .9em; }

.stack-form { display: grid; gap: 18px; }
.stack-form label { display: grid; gap: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 13px; background: var(--white); color: var(--ink); outline: none; transition: border-color .18s, box-shadow .18s; }
input, select { min-height: 48px; padding: 0 14px; }
textarea { resize: vertical; padding: 18px; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: var(--pine); box-shadow: 0 0 0 4px rgba(31, 89, 75, .1); }
.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 13px; min-height: 48px; padding: 0 20px; font-weight: 750; text-decoration: none; transition: transform .18s, background .18s, opacity .18s; }
.primary-button { background: var(--pine); color: white; }
.primary-button:hover { background: var(--pine-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.secondary-button { border: 1px solid var(--line); background: var(--white); color: var(--ink); }
.danger-button { background: #a83d32; color: #fff; }
.switch-auth { margin: 25px 0 0; text-align: center; color: var(--ink-soft); font-size: 14px; }
.switch-auth a { color: var(--pine); font-weight: 750; }
.alert { padding: 13px 15px; margin: 0 0 18px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.alert.error { background: #f8e4df; color: #7a3027; }
.alert.success { background: var(--mint); color: var(--pine-dark); }

.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; max-width: 1240px; margin: 0 auto; padding: 0 32px; border-bottom: 1px solid var(--line); }
.topnav { display: flex; align-items: center; gap: 24px; }
.topnav a { color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 650; }
.topnav a.active, .topnav a:hover { color: var(--ink); }
.account-link { display: grid !important; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--mint); color: var(--pine-dark) !important; }
.app-shell { max-width: 1180px; margin: 0 auto; padding: 42px 32px 80px; }
.global-alert { max-width: 760px; margin: 0 auto 20px; }

.capture-panel { position: relative; overflow: hidden; padding: 40px; border-radius: 28px; background: var(--ink); color: var(--white); box-shadow: var(--shadow); }
.capture-panel::after { content: ""; position: absolute; right: -120px; top: -150px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(104,162,141,.26), rgba(104,162,141,0) 70%); pointer-events: none; }
.capture-copy { position: relative; z-index: 1; max-width: 760px; }
.capture-copy h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(34px, 5vw, 52px); font-weight: 500; letter-spacing: -.035em; }
.capture-copy > p:last-child { margin: 12px 0 26px; color: #c4d2cd; line-height: 1.55; }
.capture-form { position: relative; z-index: 1; padding: 8px; border-radius: 18px; background: var(--white); }
.capture-form textarea { min-height: 116px; border: 0; box-shadow: none; background: transparent; font-size: 17px; }
.capture-form textarea:focus { box-shadow: none; }
.capture-actions { display: flex; align-items: center; gap: 12px; padding: 0 8px 8px; }
.record-button { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font-weight: 700; }
.record-button.recording { color: #9f3329; background: #f8e4df; border-color: #e6a99f; }
.mic-icon { width: 12px; height: 18px; border: 2px solid currentColor; border-radius: 8px; position: relative; }
.mic-icon::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 8px; border: 2px solid currentColor; border-top: 0; border-radius: 0 0 9px 9px; transform: translateX(-50%); }
.record-time { color: var(--ink-soft); font-size: 13px; }
.save-button { margin-left: auto; }
.capture-result { position: relative; z-index: 1; margin-top: 16px; padding: 16px 18px; border: 1px solid rgba(220, 233, 223, .24); border-radius: 14px; background: rgba(220, 233, 223, .10); color: #e5f0e9; line-height: 1.5; }
.capture-result.error { color: #ffd5ca; background: rgba(212,107,78,.14); }

.memory-section { margin-top: 54px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.section-head h2, .settings-head h1 { margin: 0; font-family: Georgia, serif; font-size: 34px; font-weight: 500; letter-spacing: -.025em; }
.search-form { width: min(320px, 100%); }
.search-form input { background: rgba(255,253,248,.7); }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 24px 0; scrollbar-width: none; }
.filter-chip { white-space: nowrap; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); text-decoration: none; font-size: 13px; font-weight: 700; }
.filter-chip.active { border-color: var(--ink); background: var(--ink); color: white; }
.entry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.entry-card { display: flex; flex-direction: column; min-height: 240px; padding: 22px; border: 1px solid rgba(24, 52, 45, .09); border-radius: 18px; background: rgba(255,253,248,.82); box-shadow: 0 8px 25px rgba(45,55,49,.045); transition: transform .18s, box-shadow .18s; }
.entry-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(45,55,49,.08); }
.entry-card.completed { opacity: .58; }
.entry-card.completed h3, .entry-card.completed > p { text-decoration: line-through; }
.entry-meta { display: flex; gap: 8px; align-items: center; }
.kind-badge, .priority-badge { display: inline-flex; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.kind-badge.notiz { color: #49635a; background: #e7ebe5; }
.kind-badge.aufgabe { color: #8a4c35; background: #f4dfd2; }
.kind-badge.erinnerung { color: #4a557f; background: #e2e6f4; }
.kind-badge.termin { color: #6a4d77; background: #eee2f1; }
.kind-badge.einkauf { color: #6e632b; background: #f2ebc9; }
.kind-badge.idee { color: #32695a; background: #dcece4; }
.kind-badge.kontakt, .kind-badge.projekt { color: #4c5b70; background: #e2e8ee; }
.priority-badge { color: #9b392f; background: #fae2dd; }
.entry-menu { margin-left: auto; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: #8a9691; font-size: 21px; line-height: 1; }
.entry-menu:hover { background: #f3e5e1; color: #9b392f; }
.entry-card h3 { margin: 19px 0 9px; font-family: Georgia, serif; font-size: 23px; font-weight: 500; letter-spacing: -.015em; }
.entry-card > p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 17px 0; }
.tag-row span { color: var(--pine); font-size: 12px; font-weight: 700; }
.entry-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); color: #82908a; font-size: 12px; }
.complete-button { border: 0; background: transparent; color: var(--pine); font-size: 12px; font-weight: 800; }
.clarification { margin-top: 12px; padding: 10px; border-radius: 9px; background: #fff1d9; color: #72521d; font-size: 12px; line-height: 1.4; }
.reminder-delivery { margin-top: 12px; padding: 9px 10px; border-radius: 9px; font-size: 12px; font-weight: 750; line-height: 1.4; }
.reminder-delivery.pending { background: #e8eef7; color: #465b7a; }
.reminder-delivery.sent { background: var(--mint); color: var(--pine-dark); }
.reminder-delivery.failed { background: #f8e4df; color: #7a3027; }
.empty-state { padding: 68px 24px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--ink-soft); }
.empty-symbol { display: block; margin-bottom: 12px; color: var(--coral); font-size: 28px; }
.empty-state h3 { margin: 0; color: var(--ink); font-family: Georgia, serif; font-size: 26px; font-weight: 500; }
.empty-state p { margin: 10px 0; }

.settings-shell { max-width: 840px; margin: 0 auto; padding: 60px 32px 90px; }
.settings-head { margin-bottom: 36px; }
.settings-head p:last-child { color: var(--ink-soft); }
.settings-card { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 12px; padding: 25px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,253,248,.75); }
.settings-card h2 { margin: 0 0 7px; font-size: 17px; }
.settings-card p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.email-settings-card { display: block; }
.settings-card-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.address-counter { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: var(--mint); color: var(--pine-dark); font-size: 12px; font-weight: 800; }
.recipient-list { display: grid; gap: 12px; margin-top: 22px; }
.recipient-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.recipient-summary strong { overflow-wrap: anywhere; }
.recipient-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.recipient-tag, .verification-badge, .primary-badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.recipient-tag { background: #e8eef7; color: #465b7a; }
.verification-badge.verified { background: var(--mint); color: var(--pine-dark); }
.verification-badge.pending { background: #fff1d9; color: #72521d; }
.primary-badge { background: var(--ink); color: #fff; }
.recipient-edit-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; margin-top: 16px; }
.recipient-edit-form label, .add-recipient-form label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.compact-button { min-height: 48px; }
.recipient-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 13px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--pine); font-size: 12px; font-weight: 800; }
.danger-text { color: #8c342b; }
.add-recipient-form { display: grid; grid-template-columns: minmax(210px, 1.4fr) 1fr 1fr auto; align-items: end; gap: 10px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.settings-hint { margin-top: 18px !important; padding: 12px 14px; border-radius: 11px; background: var(--paper); }
.single-card-shell { display: flex; max-width: 620px; }
.inline-form { display: flex; gap: 9px; min-width: 330px; }
.danger-zone { margin-top: 38px; border: 1px solid rgba(168,61,50,.22); border-radius: 17px; background: rgba(255,253,248,.55); }
.danger-zone summary { padding: 20px 24px; color: #8c342b; font-weight: 750; cursor: pointer; }
.danger-content { padding: 0 24px 24px; color: var(--ink-soft); }
.danger-content form { max-width: 480px; }

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; max-width: 560px; padding: 30px 22px; }
    .auth-intro { display: none; }
    .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 55px; font-weight: 750; }
    .entry-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
    .topbar { height: 66px; padding: 0 18px; }
    .topnav { gap: 14px; }
    .topnav > a:not(.account-link):nth-child(2) { display: none; }
    .app-shell { padding: 22px 14px 60px; }
    .capture-panel { padding: 25px 18px 18px; border-radius: 21px; }
    .capture-copy h1 { font-size: 34px; }
    .capture-copy > p:last-child { font-size: 14px; }
    .capture-form { padding: 4px; }
    .capture-form textarea { min-height: 125px; padding: 14px; font-size: 16px; }
    .capture-actions { flex-wrap: wrap; }
    .save-button { width: 100%; margin: 7px 0 0; }
    .memory-section { margin-top: 40px; }
    .section-head { display: grid; }
    .section-head h2 { font-size: 30px; }
    .search-form { width: 100%; }
    .entry-grid { grid-template-columns: 1fr; }
    .entry-card { min-height: 215px; }
    .auth-card { padding: 30px 22px; border-radius: 23px; }
    .auth-card h2 { font-size: 29px; }
    .settings-shell { padding: 38px 16px 70px; }
    .settings-card { align-items: stretch; flex-direction: column; }
    .inline-form { min-width: 0; flex-direction: column; }
    .settings-card .secondary-button { width: 100%; }
    .settings-card-head { align-items: start; }
    .recipient-edit-form, .add-recipient-form { grid-template-columns: 1fr; }
    .recipient-edit-form .secondary-button, .add-recipient-form .primary-button { width: 100%; }
}

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

