@font-face { font-family: "DM Sans"; src: local("DM Sans"), local("DM Sans Regular"); font-weight: 400; }
@font-face { font-family: "Manrope"; src: local("Manrope"), local("Manrope Regular"); font-weight: 400 800; }

:root {
  color-scheme: light;
  --ink: #17221f;
  --muted: #66736f;
  --line: #dce2dc;
  --paper: #f4f5f0;
  --white: #ffffff;
  --green: #1e6652;
  --green-dark: #154a3b;
  --lime: #d7e8b2;
  --orange: #df7048;
  --yellow: #f0c45c;
  --blue: #9fc7ca;
  --red-pale: #f8e8e1;
  --shadow: 0 18px 48px rgba(28, 47, 39, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", "Segoe UI", sans-serif; font-size: 15px; }
button, input, select { font: inherit; }
a { color: inherit; }
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 28px 18px 22px; background: #e9eee7; border-right: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; text-decoration: none; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px 11px 11px 3px; color: white; background: var(--green); font-family: "Manrope", sans-serif; font-weight: 800; font-size: 20px; }
.brand-name { font-family: "Manrope", sans-serif; font-weight: 800; font-size: 18px; line-height: 1.1; }
.brand-name span { display: block; margin-top: 5px; color: var(--muted); font-family: "DM Sans", sans-serif; font-size: 11px; font-weight: 500; }
.main-nav { display: grid; gap: 6px; margin-top: 58px; }
.main-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; color: #41504a; border-radius: 6px; text-decoration: none; font-weight: 600; }
.main-nav a:hover, .main-nav a.active { color: var(--green-dark); background: #d9e5dc; }
.nav-mark { color: #8b9991; font-family: "Manrope", sans-serif; font-size: 10px; font-weight: 700; }
.sidebar-bottom { display: grid; gap: 6px; margin-top: auto; padding: 16px 12px 0; border-top: 1px solid #d4ddd4; }
.muted-label { color: var(--muted); font-size: 12px; }
.sidebar-bottom strong { font-size: 14px; }
.sidebar-bottom form { margin-top: 5px; }
.text-button { padding: 0; color: var(--green); border: 0; background: none; cursor: pointer; font-weight: 600; }
.main-content { width: min(100%, 1500px); padding: 27px clamp(22px, 4vw, 64px) 30px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 20px 0 31px; }
.page-heading h1, .auth-panel h1 { margin: 4px 0 0; font-family: "Manrope", sans-serif; font-size: 34px; line-height: 1.15; font-weight: 700; }
.eyebrow { margin: 0; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: 1.2px; }
.date-stamp { margin: 0 0 5px; color: var(--muted); font-size: 13px; }
.entry-section { padding: 18px 0 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-heading, .toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-heading h2, .toolbar-row h2 { margin: 0; font-family: "Manrope", sans-serif; font-size: 18px; font-weight: 700; }
.section-index { color: #9ca9a1; font-family: "Manrope", sans-serif; font-size: 12px; font-weight: 700; }
.entry-form { display: grid; grid-template-columns: minmax(170px, 1.5fr) repeat(2, minmax(130px, 1fr)) minmax(145px, 1fr) auto; align-items: end; gap: 12px; margin-top: 17px; }
.event-entry { grid-template-columns: minmax(160px, 1.3fr) minmax(120px, .8fr) minmax(190px, 1fr) minmax(150px, 1fr) minmax(130px, 1fr) auto; }
.contact-entry { grid-template-columns: minmax(150px, 1.2fr) minmax(120px, .7fr) minmax(160px, 1fr) minmax(140px, .8fr) minmax(150px, .9fr); }
.field { display: grid; gap: 7px; color: #46534e; font-size: 12px; font-weight: 700; }
.field input, .field select { width: 100%; min-width: 0; height: 42px; padding: 0 11px; color: var(--ink); border: 1px solid #d5ddd5; border-radius: 4px; outline: none; background: #fff; font-size: 14px; font-weight: 400; }
.field input:focus, .field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(30, 102, 82, .12); }
.field input::placeholder { color: #9aa49e; }
.field-hint { color: var(--muted); font-size: 11px; font-weight: 400; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 13px; min-height: 42px; padding: 0 15px; border: 1px solid transparent; border-radius: 4px; text-decoration: none; cursor: pointer; font-size: 13px; font-weight: 700; white-space: nowrap; }
.button-primary { color: white; background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-outline { color: var(--green-dark); border-color: #bdcbc2; background: transparent; }
.button-outline:hover { background: #e5ebe4; }
.add-button { min-width: 120px; }
.toolbar-row { margin: 29px 0 15px; }
.toolbar-row > div { display: grid; gap: 6px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid #d5ddd5; border-radius: 5px; background: #eaede7; }
.segmented a { min-height: 31px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 3px; color: #5e6b65; text-decoration: none; font-size: 12px; font-weight: 600; }
.segmented a.selected { color: var(--green-dark); background: white; box-shadow: 0 1px 3px rgba(20, 38, 28, .1); }
.matrix-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.quadrant { min-width: 0; padding: 17px 17px 9px; border: 1px solid var(--line); border-top: 3px solid var(--green); border-radius: 5px; background: rgba(255,255,255,.66); }
.quadrant-plan { border-top-color: #9cad56; }
.quadrant-delegate { border-top-color: var(--orange); }
.quadrant-drop { border-top-color: #9aa7a0; }
.quadrant-heading { display: flex; align-items: flex-start; gap: 10px; }
.quadrant-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--green); }
.quadrant-plan .quadrant-dot { background: #9cad56; }
.quadrant-delegate .quadrant-dot { background: var(--orange); }
.quadrant-drop .quadrant-dot { background: #9aa7a0; }
.quadrant-heading h3 { margin: 0; font-family: "Manrope", sans-serif; font-size: 16px; }
.quadrant-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.quadrant-count { margin-left: auto; color: #74817a; font-size: 12px; font-weight: 700; }
.task-list { margin-top: 12px; }
.task-row { display: flex; align-items: center; gap: 10px; min-height: 49px; border-top: 1px solid #e8ece7; }
.task-row > form:first-child { display: flex; }
.task-check { display: grid; width: 21px; height: 21px; padding: 0; place-items: center; border: 1px solid #a9b7ad; border-radius: 50%; color: white; background: transparent; cursor: pointer; font-size: 12px; }
.task-complete .task-check { border-color: var(--green); background: var(--green); }
.task-copy { display: grid; min-width: 0; gap: 3px; }
.task-copy strong { overflow-wrap: anywhere; font-size: 13px; font-weight: 600; }
.task-copy span { color: var(--muted); font-size: 11px; }
.task-complete .task-copy strong { color: #89948d; text-decoration: line-through; }
.task-row form:last-child { margin-left: auto; }
.quiet-action { display: grid; width: 30px; height: 30px; padding: 0; place-items: center; border: 0; border-radius: 4px; color: #8a9690; background: transparent; cursor: pointer; font-size: 21px; line-height: 1; }
.quiet-action:hover { color: #a44431; background: var(--red-pale); }
.empty-note { margin: 14px 0 9px; color: #89958e; font-size: 12px; }
.page-footer { margin-top: 35px; padding-top: 13px; color: #849088; border-top: 1px solid var(--line); font-size: 11px; }
.event-list, .contact-list { border-top: 1px solid var(--line); }
.event-row, .contact-row { display: flex; align-items: center; gap: 18px; min-height: 88px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.event-date { display: grid; flex: 0 0 64px; justify-items: center; gap: 1px; padding: 7px 4px; border-right: 1px solid var(--line); }
.event-date strong { font-family: "Manrope", sans-serif; font-size: 21px; line-height: 1; }
.event-date span, .event-date small { color: var(--muted); font-size: 10px; }
.event-body, .contact-body { flex: 1; min-width: 0; }
.event-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.event-title-row h3 { margin: 0; font-family: "Manrope", sans-serif; font-size: 15px; }
.event-body p { margin: 5px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.area-badge { display: inline-flex; align-items: center; min-height: 21px; padding: 0 7px; border-radius: 3px; font-size: 10px; font-weight: 700; }
.area-private { color: #326251; background: #e0eee3; }
.area-work { color: #875525; background: #f5e9d0; }
.area-family { color: #365f71; background: #dcebee; }
.inline-link { color: var(--green); font-weight: 600; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.empty-panel { padding: 23px 0; color: var(--muted); font-size: 13px; }
.calendar-toolbar { margin-top: 31px; }
.birthday-section { margin-top: 38px; padding-top: 17px; border-top: 1px solid var(--line); }
.birthday-section .section-heading { margin-bottom: 12px; }
.birthday-row { display: flex; align-items: center; gap: 10px; min-height: 42px; border-top: 1px solid #e2e7e1; }
.birthday-row strong { font-size: 13px; }
.birthday-row > span:nth-of-type(2) { margin-left: auto; color: var(--muted); font-size: 12px; }
.birthday-row small { width: 70px; color: var(--muted); text-align: right; }
.birthday-mark { color: var(--orange); }
.contact-row { align-items: flex-start; }
.contact-initial, .member-avatar { display: grid; flex: 0 0 auto; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: var(--green-dark); background: var(--lime); font-family: "Manrope", sans-serif; font-weight: 700; }
.contact-details { display: grid; gap: 5px; margin-top: 7px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.contact-details a:not(.inline-link) { color: #50615a; text-decoration: none; }
.field-address { grid-column: span 2; }
.contact-entry .add-button { grid-column: 5; }
.shopping-list-entry { grid-template-columns: minmax(170px, 1fr) minmax(190px, 1.3fr) auto; }
.shopping-toolbar { margin-top: 31px; }
.shopping-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; }
.shopping-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.72); }
.shopping-card-heading { display: flex; align-items: center; gap: 12px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.store-symbol { display: grid; flex: 0 0 auto; width: 40px; height: 40px; place-items: center; border-radius: 4px; color: var(--green-dark); background: var(--lime); font-family: "Manrope", sans-serif; font-size: 18px; font-weight: 800; }
.shopping-card-title { min-width: 0; }
.shopping-card-title h3 { margin: 3px 0 0; font-family: "Manrope", sans-serif; font-size: 16px; overflow-wrap: anywhere; }
.shopping-card-title p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.shopping-card-heading > form { margin-left: auto; }
.shopping-items { margin-top: 5px; }
.shopping-item { display: flex; align-items: center; gap: 10px; min-height: 47px; border-bottom: 1px solid #e8ece7; }
.shopping-item > form:first-child { display: flex; }
.item-check { display: grid; width: 22px; height: 22px; padding: 0; place-items: center; border: 1px solid #a9b7ad; border-radius: 5px; color: white; background: white; cursor: pointer; font-size: 13px; }
.item-checked .item-check { border-color: var(--green); background: var(--green); }
.shopping-item-copy { display: flex; flex: 1; min-width: 0; align-items: baseline; justify-content: space-between; gap: 8px; }
.shopping-item-copy strong { overflow-wrap: anywhere; font-size: 13px; font-weight: 600; }
.shopping-item-copy span { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.item-checked .shopping-item-copy strong { color: #89948d; text-decoration: line-through; }
.shopping-item-entry { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto; gap: 7px; margin-top: 13px; }
.shopping-item-entry input { width: 100%; min-width: 0; height: 38px; padding: 0 9px; border: 1px solid #d5ddd5; border-radius: 4px; outline: none; background: white; font-size: 12px; }
.shopping-item-entry input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(30, 102, 82, .12); }
.shopping-item-entry .button { min-height: 38px; padding: 0 9px; font-size: 11px; }
.shopping-empty { grid-column: 1 / -1; padding: 30px; border: 1px dashed #bcc9be; border-radius: 5px; text-align: center; }
.empty-basket { display: inline-grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: var(--green); background: #e1ebdf; font-size: 20px; }
.shopping-empty h3 { margin: 10px 0 4px; font-family: "Manrope", sans-serif; font-size: 16px; }
.shopping-empty p { max-width: 390px; margin: 0 auto; color: var(--muted); font-size: 12px; line-height: 1.6; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.family-overview { max-width: 850px; padding: 23px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.7); }
.family-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.family-heading h2, .family-option h2 { margin: 6px 0 0; font-family: "Manrope", sans-serif; font-size: 23px; }
.member-count { color: var(--muted); font-size: 12px; }
.family-note, .family-option > p:not(.eyebrow) { max-width: 610px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.invite-strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0; padding: 15px; background: #edf2eb; }
.invite-strip > div { display: grid; gap: 5px; }
.invite-strip code { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.member-list { padding-top: 16px; border-top: 1px solid var(--line); }
.member-list h3 { margin: 0 0 7px; font-size: 13px; }
.member-row { display: flex; align-items: center; gap: 10px; min-height: 47px; border-top: 1px solid #e8ece7; }
.member-avatar { width: 30px; height: 30px; font-size: 12px; }
.member-row strong { font-size: 13px; }
.member-row .muted-label { margin-left: auto; }
.family-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px; max-width: 950px; }
.family-option { padding: 22px 0; border-top: 3px solid var(--green); }
.family-join { border-top-color: var(--orange); }
.stack-form { display: grid; gap: 14px; margin-top: 22px; }
.flash-stack { display: grid; gap: 7px; margin: 14px 0; }
.flash { margin: 0; padding: 10px 13px; border-radius: 4px; font-size: 13px; }
.flash-success { color: #1b543f; background: #dfede2; }
.flash-error { color: #8b3f2d; background: #f8e4dc; }
.flash-info { color: #355c67; background: #e0edf0; }
.auth-page { min-height: 100vh; background: radial-gradient(circle at 15% 20%, rgba(215,232,178,.52), transparent 28%), linear-gradient(135deg, #f2f4ed 0%, #e5ede6 100%); }
.auth-wrap { display: grid; min-height: 100vh; align-content: center; justify-items: center; padding: 38px 20px; }
.auth-brand { margin-bottom: 25px; }
.auth-panel { width: min(100%, 450px); padding: 31px; border: 1px solid rgba(192, 206, 194, .85); border-radius: 6px; background: rgba(255,255,255,.88); box-shadow: var(--shadow); }
.auth-panel h1 { margin-top: 8px; font-size: 29px; }
.intro-copy { margin: 9px 0 23px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.button-wide { width: 100%; margin-top: 3px; }
.check-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.check-label input { accent-color: var(--green); }
.auth-switch { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.auth-switch a { color: var(--green); font-weight: 700; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .entry-form, .event-entry, .contact-entry, .shopping-list-entry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-title, .field-address { grid-column: span 2; }
  .contact-entry .add-button { grid-column: 2; }
}

@media (max-width: 700px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 13px 16px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-mark { width: 33px; height: 33px; }
  .brand-name { font-size: 16px; }
  .main-nav { display: flex; gap: 4px; overflow-x: auto; margin-top: 14px; padding-bottom: 2px; }
  .main-nav a { flex: 0 0 auto; min-height: 37px; gap: 7px; padding: 0 9px; font-size: 12px; }
  .nav-mark { display: none; }
  .sidebar-bottom { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 2px 0; }
  .sidebar-bottom .muted-label { display: none; }
  .sidebar-bottom strong { overflow: hidden; max-width: 48vw; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  .sidebar-bottom form { margin: 0 0 0 auto; }
  .text-button { font-size: 12px; }
  .main-content { padding: 15px 16px 24px; }
  .page-heading { align-items: flex-start; margin: 14px 0 24px; }
  .page-heading h1 { font-size: 28px; }
  .page-heading > .button { align-self: center; min-height: 36px; padding: 0 9px; font-size: 11px; white-space: normal; }
  .matrix-grid, .family-options, .shopping-grid { grid-template-columns: 1fr; }
  .quadrant { padding: 14px 13px 7px; }
  .toolbar-row { align-items: flex-start; flex-direction: column; }
  .segmented { max-width: 100%; }
  .entry-form, .event-entry, .contact-entry, .shopping-list-entry { grid-template-columns: 1fr 1fr; gap: 10px; }
  .field-title, .field-address { grid-column: 1 / -1; }
  .contact-entry .add-button { grid-column: 1 / -1; }
  .entry-form .button { width: 100%; }
  .invite-strip { align-items: flex-start; flex-direction: column; }
  .auth-panel { padding: 24px 20px; }
}

@media (max-width: 380px) {
  .entry-form, .event-entry, .contact-entry, .shopping-list-entry { grid-template-columns: 1fr; }
  .shopping-item-entry { grid-template-columns: minmax(0, 1fr) 64px; }
  .shopping-item-entry .button { grid-column: 1 / -1; }
  .field-title, .field-address, .contact-entry .add-button { grid-column: 1; }
  .page-heading { flex-direction: column; }
}
/* Rechtliches: Impressum, Datenschutz, Footer-Links */
.legal-links { display: flex; gap: 18px; justify-content: center; margin-top: 22px; font-size: 12px; }
.legal-links a, .page-footer a { color: var(--muted); }
.legal-panel { width: min(100%, 720px); padding: 31px; border: 1px solid rgba(192, 206, 194, .85); border-radius: 6px; background: rgba(255,255,255,.88); box-shadow: var(--shadow); line-height: 1.6; }
.main-content .legal-panel { margin-top: 20px; }
.legal-panel h1 { margin: 8px 0 14px; font-family: "Manrope", sans-serif; font-size: 29px; }
.legal-panel h2 { margin: 24px 0 6px; font-family: "Manrope", sans-serif; font-size: 16px; }
.legal-panel p { margin: 0 0 10px; }
.legal-date { margin-top: 24px !important; color: var(--muted); font-size: 12px; }
.placeholder { padding: 0 3px; border-radius: 3px; background: var(--red-pale); color: #9a3b1c; }
