/* SAMS Style Plus: app identities over the shared, compact Sam-style shell.
   Screen-only accents; account, authentication and printed documents stay neutral. */
@media screen {
  .app-logo {
    width: 56px;
    height: 56px;
    max-width: 100%;
    display: block;
  }
  .tile .app-logo {
    width: 32px;
    height: 32px;
  }
  .app-icon:has(.app-logo) {
    background: transparent;
    padding: 0;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
  }
  .space-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }
  .space-logo {
    flex: 0 0 56px;
  }

  body:has(.space-aemtliapp) {
    --app-ink: #285950;
    --app-hover: #1b443d;
    --app-soft: #edf4e8;
    --app-line: #d5dfcd;
    --app-paper: #fffdf6;
    --app-accent: #f2c16b;
    --app-radius: 22px;
    background: #f5f1e7;
    background-image: radial-gradient(#cdd2bc 0.7px, transparent 0.7px);
    background-size: 18px 18px;
  }
  body:has(.space-lernapp) {
    --app-ink: #544188;
    --app-hover: #40316a;
    --app-soft: #efeafb;
    --app-line: #dcd3ee;
    --app-paper: #fefcff;
    --app-accent: #f3ce84;
    --app-radius: 18px;
    background: #f1edf8;
    background-image:
      linear-gradient(#ddd5ed55 1px, transparent 1px),
      linear-gradient(90deg, #ddd5ed55 1px, transparent 1px);
    background-size: 30px 30px;
  }
  body:has(.space-fitfoodapp) {
    --app-ink: #204e3f;
    --app-hover: #13392e;
    --app-soft: #edf3df;
    --app-line: #d5dfc9;
    --app-paper: #fcfdf6;
    --app-accent: #cee39e;
    --app-radius: 26px 8px 26px 8px;
    background: #f2f5ea;
    background-image: radial-gradient(
      ellipse at 100% 0,
      #dce8c7,
      transparent 60%
    );
  }
  body:has(.space-versicherungsschneider) {
    --app-ink: #183f3b;
    --app-hover: #0f2e2b;
    --app-soft: #eaf0e1;
    --app-line: #d6ddce;
    --app-paper: #f9faf5;
    --app-accent: #c6a26d;
    --app-radius: 10px;
    background: #eff2e9;
  }
  body:has(main[class*="space-"]) .space-header {
    max-width: 1140px;
    padding: 18px 28px;
    border-bottom: 1px solid var(--app-line);
  }
  body:has(main[class*="space-"]) .space-name {
    color: var(--app-ink);
    font-size: 19px;
    font-weight: 750;
  }
  body:has(main[class*="space-"]) .space-name::before {
    display: none;
  }
  body:has(main[class*="space-"]) .space-switcher summary {
    background: #ffffffbb;
    color: var(--app-ink);
    border: 1px solid var(--app-line);
  }
  main.feature-workspace[class*="space-"] {
    max-width: 1080px;
    padding: 24px 28px 64px;
    accent-color: var(--app-ink);
  }
  main[class*="space-"] > .feature-panel {
    border: 1px solid var(--app-line);
    border-radius: 28px;
    background: var(--app-paper);
    padding: 28px;
    box-shadow: 0 12px 40px #22352308;
  }
  .app-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    align-items: center;
    gap: 16px;
    margin: -8px -8px 24px;
    padding: 20px 24px;
    border-radius: 20px;
    background: var(--app-soft);
    overflow: hidden;
  }
  .intro-copy {
    min-width: 0;
  }
  .intro-art {
    width: 100%;
    height: 190px;
  }
  main[class*="space-"] .app-intro h1 {
    font-size: clamp(28px, 3.2vw, 40px);
    font-weight: 750;
    line-height: 1.12;
    margin: 14px 0;
    color: var(--app-ink);
    overflow-wrap: anywhere;
  }
  main[class*="space-"] .eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: var(--app-ink);
    margin: 0;
  }
  main[class*="space-"] .intro-subtitle {
    font-size: 14px;
    color: var(--app-ink);
    margin: 0;
    line-height: 1.65;
  }
  main[class*="space-"] h2 {
    color: var(--app-ink);
    font-weight: 700;
    font-size: 23px;
    margin-top: 26px;
  }
  main[class*="space-"] :is(.button.primary, .app-save .button.primary) {
    background: var(--app-ink);
    border-color: var(--app-ink);
    color: #fff;
  }
  main[class*="space-"] .button.primary:hover {
    background: var(--app-hover);
  }
  main[class*="space-"] .button.secondary {
    background: #fff;
    border-color: var(--app-line);
    color: var(--app-ink);
  }
  main[class*="space-"] .button.secondary:hover {
    background: var(--app-soft);
  }
  main[class*="space-"] .button {
    min-height: 44px;
  }
  main[class*="space-"] .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  main[class*="space-"] :is(input, select, textarea) {
    border-color: var(--app-line);
  }
  body:has(main[class*="space-"])
    :is(button, a, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--app-ink);
    outline-offset: 3px;
  }
  main[class*="space-"] .feature-panel details {
    background: #fff;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
  }
  main[class*="space-"] .feature-panel summary {
    color: var(--app-ink);
    font-weight: 700;
  }
  main[class*="space-"] .feature-options label {
    border: 1px solid var(--app-line);
    border-radius: 12px;
    background: white;
  }
  main[class*="space-"] .feature-options label:has(input:checked) {
    background: var(--app-soft);
    border: 2px solid var(--app-ink);
  }
  main[class*="space-"] .food-nav {
    background: var(--app-soft);
    padding: 7px;
    border: 1px solid var(--app-line);
  }
  main[class*="space-"] .food-nav .button {
    font-size: 12px;
    border-radius: 10px;
  }
  main[class*="space-"] .food-nav .button.primary {
    background: var(--app-ink);
    color: #fff;
  }
  .space-aemtliapp .app-intro {
    background: #f5e5c7;
    border-radius: 18px 48px 18px 18px;
  }
  .space-aemtliapp .button {
    border-radius: 14px;
  }
  .family-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 20px;
  }
  .family-progress span {
    font-size: 12px;
    font-weight: 700;
    color: #285950;
    background: #e4eddf;
    padding: 9px 14px;
    border-radius: 30px;
  }
  .family-progress span:nth-child(2) {
    background: #f5e5c7;
  }
  .space-aemtliapp .weekday-picker {
    grid-column: 1 / -1;
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
  }
  .weekday-picker legend {
    font-size: 14px;
    font-weight: 750;
    color: var(--app-ink);
  }
  .weekday-picker .fine {
    margin: 5px 0 10px;
    font-size: 12px;
  }
  .weekday-chips {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
    max-width: 520px;
  }
  .weekday-chips label {
    position: relative;
    cursor: pointer;
    min-width: 0;
  }
  .weekday-chips input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    inset: 0;
    margin: 0;
    cursor: pointer;
  }
  .weekday-chips span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 1px solid var(--app-line);
    border-radius: 13px;
    background: #fff;
    font-size: 14px;
    font-weight: 750;
  }
  .weekday-chips input:checked + span {
    background: var(--app-ink);
    border-color: var(--app-ink);
    color: white;
    box-shadow: 0 3px 0 #173d35;
  }
  .weekday-chips input:focus-visible + span {
    outline: 3px solid var(--app-ink);
    outline-offset: 3px;
  }
  .day-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 0;
  }
  .day-shortcuts button {
    background: transparent;
    border: 0;
    color: var(--app-ink);
    padding: 10px 4px;
    min-height: 44px;
    text-decoration: underline;
    text-underline-offset: 4px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
  }
  .week-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 22px 0;
  }
  .week-day {
    min-width: 0;
    background: #fff;
    border: 1px solid #d5dfcd;
    border-radius: 18px;
    overflow: hidden;
  }
  .week-day h3 {
    margin: 0;
    padding: 13px 16px;
    background: #e4eddf;
    color: #285950;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
  }
  .week-day:nth-child(3n + 2) h3 {
    background: #f5e5c7;
  }
  .week-day:nth-child(3n) h3 {
    background: #e9def0;
  }
  .week-day h3 span {
    font-size: 12px;
  }
  .week-day .meal-list {
    margin: 0;
    padding: 6px 14px;
  }
  .week-day .meal-list li {
    border: 0;
    border-bottom: 1px dashed #d5dfcd;
    border-radius: 0;
    background: transparent;
    padding: 14px 0;
    display: block;
  }
  .week-day .meal-list li:last-child {
    border: 0;
  }
  .week-day .meal-list label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    cursor: pointer;
  }
  .week-day .meal-list input {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin-top: 2px;
  }
  .week-day .meal-list small {
    display: block;
    margin-top: 5px;
    color: #647365;
  }
  .week-day .meal-list button {
    font-size: 11px;
    min-height: 32px;
    margin: 5px 0 0 28px;
    padding: 4px 8px;
    border: 0;
    text-decoration: underline;
    color: #617165;
  }
  .week-day .is-done strong {
    text-decoration: line-through;
    color: #637363;
  }
  .week-day .day-empty {
    font-size: 12px;
    color: #687165;
    min-height: 76px;
  }
  .space-lernapp .app-intro {
    background: #e8e0f8;
    border-radius: 16px 16px 45px 16px;
    border-bottom: 4px solid #d4c5ee;
  }
  .space-lernapp .button {
    border-radius: 12px;
  }
  .space-lernapp .study-card {
    background: #fffdf5;
    border: 1px solid #e6dbbd;
    border-radius: 14px;
    border-top: 8px solid #efd28c;
    box-shadow: 4px 5px 0 #e3dcef;
    padding: 26px;
  }
  .space-lernapp .study-card h2 {
    line-height: 1.5;
  }
  .space-lernapp #learning-assistant {
    background: #efeafb;
    border-radius: 14px;
    padding: 18px;
  }
  .space-lernapp .food-stats article {
    background: #ede7f8;
    border: 0;
    border-radius: 16px;
    border-bottom: 4px solid #d2c3eb;
  }
  .space-lernapp .food-stats article:nth-child(2) {
    background: #f6ebd0;
    border-color: #e9d09c;
  }
  .space-lernapp .food-stats article:nth-child(3) {
    background: #e4eee9;
    border-color: #c5ded1;
  }
  .space-fitfoodapp .app-intro {
    background: #e5edd4;
    border-radius: 32px 8px 60px 8px;
  }
  .space-fitfoodapp .button {
    border-radius: 9px 18px 9px 18px;
  }
  .space-fitfoodapp .feature-panel .feature-panel {
    padding: 10px 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .space-fitfoodapp .food-card {
    border: 1px solid #d1ddc5;
    background: #fffef8;
    border-radius: 24px 8px 24px 8px;
    padding: 24px;
  }
  .space-fitfoodapp .food-stats article {
    background: #e6edd6;
    border: 1px solid #d5dfc9;
    border-radius: 22px 7px 22px 7px;
    padding: 20px;
  }
  .space-fitfoodapp .food-stats article:nth-child(2) {
    background: #f4e5cf;
    border-color: #e7d7bd;
  }
  .space-fitfoodapp .food-stats article:nth-child(3) {
    background: #e2ece7;
  }
  .space-fitfoodapp .food-stats article:nth-child(4) {
    background: #f2e2da;
    border-color: #e6d0c6;
  }
  .space-fitfoodapp .food-stats strong {
    font-size: 26px;
    color: #204e3f;
    font-weight: 800;
  }
  .space-fitfoodapp progress {
    accent-color: #366b46;
    width: 100%;
  }
  .space-fitfoodapp .food-history article {
    border-radius: 16px;
    background: #fffef8;
    border: 1px solid #d5dfc9;
  }
  .space-versicherungsschneider .app-intro {
    background: #e6eddc;
    border: 1px solid #d0d9c4;
    border-radius: 8px;
    position: relative;
  }
  .space-versicherungsschneider .app-intro::after {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px dashed #9ba98a;
    pointer-events: none;
    border-radius: 4px;
  }
  .space-versicherungsschneider .app-intro h1 {
    font-weight: 550;
    letter-spacing: -0.045em;
  }
  .space-versicherungsschneider .button {
    border-radius: 8px;
  }
  .space-versicherungsschneider .feature-panel legend {
    border-left: 3px solid #c6a26d;
    padding-left: 12px;
  }
  .space-versicherungsschneider .feature-options label {
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 3px 0 #e7ebdf;
  }
  .space-versicherungsschneider .feature-options label:has(input:checked) {
    box-shadow: 0 3px 0 #183f3b;
  }
  @media (max-width: 700px) {
    .hero {
      grid-template-columns: minmax(0, 1fr);
    }
    .hero-copy {
      min-width: 0;
    }
    .tile .app-logo {
      width: 27px;
      height: 27px;
    }
    main.feature-workspace[class*="space-"] {
      padding: 14px 12px 40px;
    }
    main[class*="space-"] > .feature-panel {
      padding: 18px 14px;
      border-radius: 22px;
    }
    .app-intro {
      grid-template-columns: minmax(0, 1fr) 82px;
      gap: 4px;
      padding: 20px 16px;
      margin: -5px -3px 20px;
    }
    .intro-art {
      height: 105px;
    }
    main[class*="space-"] .app-intro h1 {
      font-size: 27px;
    }
    main[class*="space-"] .intro-subtitle {
      font-size: 12px;
    }
    main[class*="space-"] .eyebrow {
      font-size: 9px;
      letter-spacing: 0.09em;
    }
    body:has(main[class*="space-"]) .space-header {
      padding: 14px 16px;
    }
    body:has(main[class*="space-"]) .space-name {
      font-size: 16px;
    }
    .space-logo {
      width: 40px;
      height: 40px;
      flex-basis: 40px;
    }
    .space-brand {
      gap: 8px;
    }
    .week-board {
      grid-template-columns: minmax(0, 1fr);
    }
    .weekday-chips {
      gap: 4px;
    }
    .weekday-chips span {
      min-height: 44px;
      border-radius: 10px;
      font-size: 12px;
    }
    .space-fitfoodapp .food-stats {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .space-fitfoodapp .food-stats article {
      padding: 14px;
      min-width: 0;
    }
    .space-fitfoodapp .food-stats strong {
      font-size: 20px;
    }
  }
  @media (max-width: 360px) {
    .app-intro {
      grid-template-columns: minmax(0, 1fr) 60px;
      padding: 16px 12px;
    }
    main[class*="space-"] .app-intro h1 {
      font-size: 24px;
    }
    .family-progress {
      gap: 6px;
    }
    .family-progress span {
      font-size: 11px;
      padding: 8px 10px;
    }
  }
}
[data-custom-subject][hidden],
[data-child-age][hidden] {
  display: none;
}

/* Dedicated printable keeps each person's tasks in a clear, repeatable weekly grid. */

.print-plan {
  font-family: "Segoe UI", sans-serif;
  color: #213e37;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.print-sheet {
  --print-accent: #dfebd5;
  --print-ink: #285950;
  break-before: page;
  padding: 0;
}
.print-sheet:first-child {
  break-before: auto;
}
.print-palette-1 {
  --print-accent: #e8dff3;
  --print-ink: #554188;
}
.print-palette-2 {
  --print-accent: #f5e4c0;
  --print-ink: #725026;
}
.print-palette-3 {
  --print-accent: #dce9ed;
  --print-ink: #28566a;
}
.print-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6mm;
  border: 0.4mm solid var(--print-ink);
  border-radius: 4mm 12mm 4mm 4mm;
  background: var(--print-accent);
  break-inside: avoid;
}
.print-plan .print-kicker {
  font-size: 7pt;
  font-weight: 800;
  letter-spacing: 1.2px;
  margin: 0 0 3mm;
}
.print-plan h1 {
  font-size: 23pt;
  line-height: 1.1;
  color: var(--print-ink);
  margin: 0 0 3mm;
  overflow-wrap: anywhere;
}
.print-heading p {
  font-size: 9pt;
  margin: 0;
}
.print-star {
  font-size: 40pt;
  color: var(--print-ink);
  padding-left: 4mm;
}
.print-person {
  display: flex;
  align-items: center;
  gap: 4mm;
  padding: 7mm 0 5mm;
  break-after: avoid;
}
.print-face {
  font-size: 27pt;
}
.print-person h2 {
  font-size: 20pt;
  color: var(--print-ink);
  margin: 0 0 1mm;
  overflow-wrap: anywhere;
}
.print-person p {
  font-size: 10pt;
  margin: 0;
}
.print-score {
  margin-left: auto;
  min-width: 28mm;
  font-size: 18pt;
  font-weight: 800;
  text-align: right;
  color: var(--print-ink);
}
.print-score small {
  display: block;
  font-size: 8pt;
  font-weight: 400;
}
.print-plan table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  font-size: 10pt;
}
.print-task-col {
  width: 44%;
}
.print-plan th,
.print-plan td {
  border: 0.25mm solid #bdc9b9;
  padding: 3.5mm 1.5mm;
  vertical-align: middle;
}
.print-plan thead {
  display: table-header-group;
}
.print-plan thead th {
  background: var(--print-accent);
  color: var(--print-ink);
  font-size: 10pt;
}
.print-plan th:first-child {
  text-align: left;
  padding-left: 3mm;
}
.print-plan tbody th {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.print-plan td {
  text-align: center;
}
.print-plan tbody tr:nth-child(even) {
  background: #f7f8f4;
}
.print-task-icon {
  font-size: 13pt;
  margin-right: 2mm;
}
.print-check {
  display: inline-flex;
  width: 5.5mm;
  height: 5.5mm;
  border: 0.45mm solid var(--print-ink);
  border-radius: 1.4mm;
  align-items: center;
  justify-content: center;
  font-size: 13pt;
  line-height: 1;
  background: white;
}
.print-check.done {
  background: var(--print-accent);
  font-weight: 800;
}
.print-free {
  color: #879080;
}
.print-legend {
  font-size: 8pt;
  margin: 3mm 0 6mm;
}
.print-rewards {
  border: 0.4mm dashed var(--print-ink);
  padding: 5mm;
  border-radius: 3mm;
  background: var(--print-accent);
  break-inside: avoid;
}
.print-rewards h3 {
  font-size: 13pt;
  margin: 0 0 3mm;
  color: var(--print-ink);
}
.print-rewards :is(p, ul) {
  font-size: 10pt;
  margin: 0;
  line-height: 1.8;
}
.print-footer {
  display: flex;
  justify-content: space-between;
  gap: 5mm;
  border-top: 0.25mm solid #bdc9b9;
  padding-top: 4mm;
  margin-top: 6mm;
  font-size: 8pt;
  break-inside: avoid;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 13mm;
  }
  body:has(.print-plan) main.feature-workspace {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
  }
}
@media screen {
  body.print-preview main > :not(.print-plan):not(.print-toolbar) {
    display: none;
  }
  body.print-preview .print-plan {
    display: block;
    overflow-x: auto;
    padding-bottom: 20px;
  }
  body.print-preview .print-sheet {
    width: 184mm;
    min-height: 260mm;
    padding: 13mm;
    box-sizing: content-box;
    background: white;
    margin: 20px auto;
    box-shadow: 0 8px 30px #00000012;
  }
  .print-toolbar {
    margin: 10px 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .print-toolbar[hidden] {
    display: none;
  }
  .print-toolbar p {
    width: 100%;
    font-size: 12px;
    color: #526358;
  }
}

@media screen {
  .space-header {
    flex-wrap: wrap;
  }
  .space-home {
    flex: 0 0 100%;
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    color: var(--app-ink, #285950);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    margin-bottom: 8px;
  }
  .space-home:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
  }
  .space-brand {
    flex: 1 1 240px;
  }
  .space-name {
    overflow-wrap: anywhere;
    min-width: 0;
  }
  .insurance-lines {
    margin-bottom: 20px;
  }
  .insurance-current {
    padding: 14px 18px;
    border-left: 4px solid #c6a26d;
    background: #e6eddc;
    border-radius: 4px 12px 12px 4px;
  }
  .insurance-current span {
    display: block;
    font-size: 11px;
    color: #526450;
    margin-bottom: 3px;
  }
  .insurance-current strong {
    font-size: 20px;
    color: #183f3b;
  }
  .insurance-coming ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .insurance-coming li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 12px;
    padding: 12px 0;
    border-top: 1px solid #d6ddce;
    font-size: 13px;
  }
  .insurance-coming small {
    background: #edf0e7;
    border: 1px solid #d6ddce;
    color: #56624e;
    border-radius: 12px;
    padding: 3px 8px;
    white-space: nowrap;
  }
  .mobile-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  @media (max-width: 700px) {
    .space-brand {
      flex: 1 1 100%;
    }
    .space-header .space-switcher {
      margin-left: auto;
    }
    body:has(main[class*="space-"]) .space-name {
      font-size: 18px;
    }
    .tile {
      min-width: 0;
    }
    .tile span {
      overflow-wrap: anywhere;
    }
  }
}

@media screen {
  .space-wordmark {
    display: block;
    width: auto;
    height: 56px;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
  }
  @media (max-width: 700px) {
    .space-wordmark {
      height: auto;
      max-height: 56px;
      max-width: 100%;
    }
  }
}
