/* Family Time App styles.
   No external fonts: the device's own font is used (fast, and private). */

/* --- Colours --------------------------------------------------------------
   fjord:  the app's blue (from the house icon) for actions and the day number
   spruce: things that are done
   lingon: things that need attention                                        */
:root {
  --fjord: #2457a6;
  --fjord-deep: #1a4282;
  --fjord-tint: #e7eef9;
  --spruce: #2f7d57;
  --lingon: #b3263e;
  --lingon-tint: #fbe9ec;
  --ink: #1c2733;
  --muted: #5d6b7a;
  --paper: #f6f8f9;
  --sheet: #ffffff;
  --line: #dde3e8;
  --on-fjord: #ffffff;
  --shadow: rgba(28, 39, 51, 0.18);
  color-scheme: light dark;
}

/* Dark colours: used when the device is in dark mode (unless the user chose
   "Light"), or when the user chose "Dark" on the Appearance page. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fjord: #82a9ec;
    --fjord-deep: #a4c0f1;
    --fjord-tint: #1d2b42;
    --spruce: #6fcf9b;
    --lingon: #ff8a9b;
    --lingon-tint: #3a1c23;
    --ink: #e6ebf0;
    --muted: #9aa7b4;
    --paper: #10161d;
    --sheet: #18202a;
    --line: #2a3644;
    --on-fjord: #0d1622;
    --shadow: rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --fjord: #82a9ec;
    --fjord-deep: #a4c0f1;
    --fjord-tint: #1d2b42;
    --spruce: #6fcf9b;
    --lingon: #ff8a9b;
    --lingon-tint: #3a1c23;
    --ink: #e6ebf0;
    --muted: #9aa7b4;
    --paper: #10161d;
    --sheet: #18202a;
    --line: #2a3644;
    --on-fjord: #0d1622;
    --shadow: rgba(0, 0, 0, 0.45);
    color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}

[hidden] { display: none !important; }

a { color: var(--fjord); }

:focus-visible { outline: 3px solid var(--fjord); outline-offset: 2px; border-radius: 4px; }

h1 { font-size: 1.5rem; line-height: 1.25; margin: 8px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* --- Forms and buttons (all pages) ------------------------------------------ */

label { display: block; font-weight: 600; margin: 16px 0 6px; }

input[type="text"], input[type="password"], input[type="url"] {
  width: 100%;
  padding: 12px;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}

button, .button {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px 16px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}
.primary { background: var(--fjord); color: var(--on-fjord); }
.primary:hover { background: var(--fjord-deep); }
.secondary { background: transparent; color: var(--fjord); border: 2px solid var(--fjord); }
.danger { background: transparent; color: var(--lingon); border: 2px solid var(--lingon); }
button:disabled { opacity: 0.5; cursor: default; }

button.link {
  width: auto; margin: 0; padding: 6px 10px;
  background: transparent; color: #fff; font-weight: 600;
}
button.link-dark {
  width: auto; margin: 16px auto 0; padding: 6px 4px;
  background: transparent; color: var(--fjord); font-weight: 600; text-decoration: underline;
}

.error, .notice {
  margin: 16px 0 0;
  padding: 12px 14px;
  color: var(--lingon);
  background: var(--lingon-tint);
  border-radius: 16px;
}
.notice a { color: inherit; font-weight: 600; }
.ok { color: var(--spruce); font-weight: 600; }

/* --- Single-card pages: login, setup, account --------------------------------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--fjord);
  color: #fff;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topbar { background: #1d3a6b; } }
:root[data-theme="dark"] .topbar { background: #1d3a6b; }
.brand { font-weight: 700; }
.topbar a { color: #fff; font-weight: 600; text-decoration: none; padding: 6px 10px; }
.topbar .actions { display: flex; gap: 4px; align-items: center; }

.card {
  max-width: 440px;
  margin: 24px auto;
  padding: 24px 20px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 16px 40px -28px var(--shadow);
}
body > .notice { max-width: 440px; margin: 16px auto 0; }
@media (max-width: 480px) {
  .card { margin: 16px; }
  body > .notice { margin: 16px 16px 0; }
}
.logo { display: block; margin: 0 auto 8px; border-radius: 16px; }

details.option { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
details.option summary { cursor: pointer; color: var(--fjord); font-weight: 600; }

ol.codes {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 1.05rem;
  columns: 2;
  padding-left: 1.6em;
}
.qr { display: block; margin: 12px auto; width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 8px; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 10px 0; border-bottom: 1px solid var(--line); }
ul.plain li button { margin-top: 8px; padding: 8px 12px; width: auto; display: inline-block; }

section.block { margin-top: 24px; }
section.block h2 { font-size: 1.15rem; margin: 0 0 8px; }

/* --- The app: views and navigation ------------------------------------------- */

body.app { padding-bottom: 0; }

.view {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px calc(110px + env(safe-area-inset-bottom));
  outline: none;
}

.view-title { font-size: 1.75rem; margin: 12px 0 8px; }
.phase-note { color: var(--fjord); font-weight: 600; }

/* Bottom bar on phones: a floating, rounded bar */
.tabbar {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 6px;
  box-shadow: 0 14px 34px -14px var(--shadow);
  z-index: 10;
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 0 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.72rem;
  border-radius: 22px;
}
.tabbar svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.tabbar a { position: relative; }
.tab-badge {
  position: absolute; top: 2px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--lingon); color: #fff; font-size: 0.68rem; font-weight: 800; line-height: 18px; text-align: center;
}
.tabbar a[aria-current="page"] { color: var(--fjord); background: var(--fjord-tint); font-weight: 700; }
.tabbar a[aria-current="page"] svg { stroke-width: 2.2; }

/* A floating rail on the left on larger screens */
@media (min-width: 900px) {
  .tabbar {
    top: 16px; bottom: 16px; left: 16px; right: auto; width: 88px;
    grid-template-columns: 1fr;
    grid-auto-flow: row;
    align-content: start;
    gap: 6px;
    padding: 12px 8px;
  }
  .view { padding-bottom: 40px; }
  body.app { padding-left: 112px; }
}

/* --- The Today view: a mood card on top ----------------------------------------- */

.mood {
  position: relative;
  overflow: hidden;
  min-height: 196px;
  padding: 22px 22px 20px;
  border-radius: 28px;
  color: var(--mood-ink);
  background: var(--mood-sky);
  box-shadow: 0 22px 44px -24px var(--mood-glow);
  isolation: isolate;
}
.mood .scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.mood-content { position: relative; }
.mood-greeting {
  font-size: clamp(1.5rem, 6.5vw, 1.9rem);
  font-weight: 750;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  text-shadow: var(--mood-text-shadow);
}
.mood-date { display: flex; align-items: flex-end; gap: 12px; text-shadow: var(--mood-text-shadow); }
.mood-day {
  font-size: 3.6rem;
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.mood-date-text { display: flex; flex-direction: column; line-height: 1.25; padding-bottom: 2px; }
.mood-weekday { font-weight: 700; font-size: 1.1rem; }

/* The moods: sky colours, text colour, and the colour of the card's glow */
.mood-fjord {
  --mood-sky: linear-gradient(180deg, #2457a6 0%, #4f86d4 100%);
  --mood-ink: #ffffff; --mood-glow: #2457a6; --mood-text-shadow: 0 1px 10px rgba(0, 20, 60, 0.35);
}
.mood-calm-day {
  --mood-sky: linear-gradient(180deg, #bfe3f5 0%, #e9f6ef 100%);
  --mood-ink: #17324a; --mood-glow: #7cc29a; --mood-text-shadow: none;
}
.mood-calm-night {
  --mood-sky: linear-gradient(180deg, #0d1b3a 0%, #2b3f6b 100%);
  --mood-ink: #f2f4ff; --mood-glow: #0d1b3a; --mood-text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}
.mood-sunny-day {
  --mood-sky: linear-gradient(180deg, #7cc4ff 0%, #ffe9a3 100%);
  --mood-ink: #10304f; --mood-glow: #f5b83d; --mood-text-shadow: none;
}
.mood-bonfire {
  --mood-sky: linear-gradient(180deg, #1b0f1f 0%, #4a1c22 55%, #b2441d 100%);
  --mood-ink: #fff3e6; --mood-glow: #c2481e; --mood-text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}
.mood-beach {
  --mood-sky: linear-gradient(180deg, #7fd3e8 0%, #fdeccb 100%);
  --mood-ink: #0f2b33; --mood-glow: #1aa6b7; --mood-text-shadow: none;
}
.mood-northern-lights {
  --mood-sky: linear-gradient(180deg, #071a24 0%, #0e3b43 100%);
  --mood-ink: #eafff6; --mood-glow: #0e3b43; --mood-text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

/* Gentle movement in the scenes (switched off for reduced motion) */
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-26px); } }
@keyframes flicker { 0%, 100% { transform: scaleY(1) scaleX(1); } 40% { transform: scaleY(1.1) scaleX(0.96); } 70% { transform: scaleY(0.95) scaleX(1.03); } }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-70px); opacity: 0; } }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-100px); } }
@keyframes sway { 0%, 100% { transform: translateX(0) skewX(0deg); } 50% { transform: translateX(14px) skewX(-6deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.85; } 50% { opacity: 1; } }

.scene .tw1 { animation: twinkle 3s ease-in-out infinite; }
.scene .tw2 { animation: twinkle 4.4s ease-in-out 0.7s infinite; }
.scene .tw3 { animation: twinkle 5.2s ease-in-out 1.4s infinite; }
.scene .drift { animation: drift 14s ease-in-out infinite alternate; }
.scene .flicker { animation: flicker 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.scene .rise { animation: rise 3.2s ease-out infinite; }
.scene .r2 { animation-delay: 1.1s; }
.scene .r3 { animation-delay: 2.2s; }
.scene .wave1 { animation: wave 9s linear infinite; }
.scene .wave2 { animation: wave 6s linear infinite reverse; }
.scene .sway { animation: sway 11s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0; }
.scene .sway2 { animation: sway 15s ease-in-out 2s infinite reverse; transform-box: fill-box; transform-origin: 50% 0; }
.scene .pulse { animation: pulse 5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .scene * { animation: none !important; }
}

.today-sections { margin-top: 8px; }
.today-section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.today-section:last-child { border-bottom: none; }
.today-section h2 { font-size: 1rem; margin: 0 0 2px; }
.today-empty { margin: 0; color: var(--muted); font-size: 0.95rem; }
.today-items { margin: 4px 0 0; padding-left: 1.2em; }
.today-coming { color: var(--muted); margin: 18px 4px 0; max-width: 34em; }

/* "📖 User guide  English  Norsk" at the bottom of Today */
.today-guide {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  margin: 22px 0 8px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--sheet);
}
.today-guide-title { font-weight: 600; margin-right: auto; }
.today-guide-link {
  display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 0.95rem;
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600;
}
.today-guide-langs { display: flex; gap: 8px; }
.today-guide-link:hover, .today-guide-link:focus-visible { border-color: var(--fjord); }

/* --- Floating event boxes, coloured by category ----------------------------------- */

.float-cards { display: grid; gap: 12px; margin: 12px 0 8px; }
.float-card {
  position: relative;
  padding: 14px 18px 14px 18px;
  border-radius: 22px;
  color: var(--c-ink);
  background: linear-gradient(135deg, var(--c) 0%, var(--c2) 100%);
  box-shadow: 0 14px 26px -16px var(--c);
}
.float-card-time { font-size: 0.85rem; font-weight: 700; opacity: 0.9; font-variant-numeric: tabular-nums; }
.float-card-title { font-size: 1.08rem; font-weight: 700; line-height: 1.3; }
.float-card-category { font-size: 0.8rem; opacity: 0.85; margin-top: 2px; }

/* The category colours. Text colour is chosen for readability on each. */
.colour-blue   { --c: #2f6fde; --c2: #5a90f0; --c-ink: #ffffff; }
.colour-teal   { --c: #0e8f86; --c2: #2bb3a7; --c-ink: #ffffff; }
.colour-green  { --c: #2e8b57; --c2: #4fae78; --c-ink: #ffffff; }
.colour-purple { --c: #7b4bd6; --c2: #9c74ec; --c-ink: #ffffff; }
.colour-pink   { --c: #d63c86; --c2: #ec6aa6; --c-ink: #ffffff; }
.colour-red    { --c: #d64545; --c2: #ec6d62; --c-ink: #ffffff; }
.colour-orange { --c: #ef7d22; --c2: #f7a04f; --c-ink: #2a1600; }
.colour-yellow { --c: #f2c230; --c2: #f8d968; --c-ink: #2a2100; }
.colour-brown  { --c: #8d5b3a; --c2: #ac7a56; --c-ink: #ffffff; }
.colour-slate  { --c: #5b6b7c; --c2: #7d8d9e; --c-ink: #ffffff; }

/* --- Rounded choice buttons:  [✓ Automatic] [Light] [Dark] --------------------------- */

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--fjord-tint);
  border-radius: 999px;
}
.segmented button {
  width: auto;
  margin: 0;
  padding: 10px 18px;
  background: transparent;
  color: var(--fjord);
  font-weight: 600;
}
.segmented button[aria-pressed="true"] { background: var(--fjord); color: var(--on-fjord); }
.segmented button[aria-pressed="true"]::before { content: "✓ "; }

/* --- Appearance page ----------------------------------------------------------------- */

.settings-heading { font-size: 1.05rem; margin: 26px 0 10px; }

.mood-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.mood-option {
  min-height: 92px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  box-shadow: none;
}
.mood-option-name { font-size: 0.9rem; font-weight: 700; text-shadow: var(--mood-text-shadow); }
.mood-option[aria-pressed="true"] { outline: 3px solid var(--fjord); outline-offset: 3px; }
.mood-option[aria-pressed="true"] .mood-option-name::before { content: "✓ "; }

.category-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.category-name { width: 6.5em; font-weight: 600; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  width: 28px; height: 28px;
  margin: 0; padding: 0;
  border-radius: 50%;
  background: var(--c);
}
.swatch[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }

/* --- The More view ------------------------------------------------------------- */

.more-links { margin-top: 16px; }
.more-links { display: grid; gap: 10px; }
.more-link {
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  text-decoration: none;
}
.more-link:hover { border-color: var(--fjord); }
.more-heading { font-size: 1rem; margin: 28px 0 4px; }
.later-list { list-style: none; padding: 0; margin: 0; }
.later-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* --- When the day and the evening start (Appearance page) --------------------------- */

.hour-choices { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.hour-choice { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.hour-choice select {
  font: inherit;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--sheet);
  color: var(--ink);
}

/* --- The Family page --------------------------------------------------------------- */

.notice-ok { color: var(--spruce); background: var(--fjord-tint); }
.notice button { margin-top: 10px; }

.member-list { display: grid; gap: 12px; margin-top: 16px; }
.member-card {
  padding: 14px 18px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.member-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.member-name { font-size: 1.05rem; margin-right: 8px; }
.member-status { margin: 6px 0 0; }
.role-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  vertical-align: middle;
  background: var(--fjord-tint);
  color: var(--fjord);
}
.role-admin { background: var(--fjord); color: var(--on-fjord); }
.role-guest { background: transparent; border: 1px solid var(--line); color: var(--muted); }

.member-manage { margin-top: 10px; }
.member-manage > summary { cursor: pointer; color: var(--fjord); font-weight: 700; padding: 4px 0; }
.member-tools { border-top: 1px solid var(--line); margin-top: 8px; }
.member-tools h3 { font-size: 0.95rem; margin: 18px 0 8px; }
.member-tools button { margin-top: 10px; }
.member-tools .segmented button { margin-top: 0; }
.remove-member { margin-top: 18px; }
.remove-member > summary { cursor: pointer; color: var(--lingon); font-weight: 700; }

.add-member { margin-top: 8px; }
.add-member .segmented { margin-bottom: 4px; }

.link-panel {
  margin-top: 14px;
  padding: 16px;
  border: 2px solid var(--fjord);
  border-radius: 20px;
  background: var(--fjord-tint);
}
.link-panel h3 { margin: 0 0 4px; font-size: 1.05rem; }
.link-panel input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85rem; }

.activity-log { list-style: none; padding: 0; margin: 0; }
.activity-log li { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* --- The calendar ---------------------------------------------------------------------- */

a.float-card { display: block; text-decoration: none; }
a.float-card:hover { filter: brightness(1.05); }
.float-card-private {
  margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  font-size: 0.72rem; background: rgba(0, 0, 0, 0.18);
}

.week-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; flex-wrap: wrap; }
.week-label { display: flex; flex-direction: column; min-width: 10em; flex: 1; text-align: center; }
.week-label strong { font-size: 1.1rem; }
.week-step {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; background: var(--fjord-tint); color: var(--fjord);
  font-size: 1.6rem; font-weight: 700; text-decoration: none;
}
.week-today { width: 100%; text-align: center; font-weight: 600; color: var(--fjord); }

.cal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 8px 0 4px; }
.cal-filter { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.cal-new { width: auto; margin: 0; padding: 10px 18px; }
.cal-link { color: var(--fjord); font-weight: 600; }

select, textarea, input[type="date"], input[type="time"] {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px;
}
select { border-radius: 999px; padding: 8px 14px; max-width: 100%; }
textarea { width: 100%; resize: vertical; }
.event-form select { width: 100%; padding: 12px; border-radius: 14px; }

.week { display: grid; gap: 4px; }
.day { padding: 10px 0 6px; border-bottom: 1px solid var(--line); }
.day-head { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 400; margin: 0; }
.day-head > span:first-child { flex: 1; }
.day.is-today .day-head strong { color: var(--fjord); }
.today-chip { padding: 2px 10px; border-radius: 999px; background: var(--fjord); color: var(--on-fjord); font-size: 0.75rem; font-weight: 700; }
.day-add {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%;
  background: var(--fjord-tint); color: var(--fjord); font-size: 1.3rem; font-weight: 700; text-decoration: none;
}
.day .float-cards { margin: 8px 0 4px; gap: 8px; }
.day .float-card { padding: 10px 14px; border-radius: 18px; }
.day-empty { margin: 4px 0 6px; color: var(--muted); font-size: 0.85rem; }

@media (min-width: 900px) {
  .view:has(.week) { max-width: 1200px; }
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
  .day { border: 1px solid var(--line); border-radius: 18px; padding: 10px; background: var(--sheet); }
  .day.is-today { border-color: var(--fjord); }
  .day-head { flex-wrap: wrap; }
  .day .float-card-title { font-size: 0.95rem; }
}

/* Event details and editor */
.back-link { display: inline-block; margin: 8px 0; color: var(--fjord); font-weight: 600; text-decoration: none; }
.event-detail { margin-top: 4px; }
.event-title { margin: 2px 0; font-size: 1.4rem; color: inherit; }
.details { margin: 16px 0; }
.detail-row { display: grid; grid-template-columns: 9em 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-row dt { color: var(--muted); font-weight: 600; }
.detail-row dd { margin: 0; }
.notes { white-space: pre-wrap; }
.detail-buttons { display: grid; gap: 0; }

.when-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.when-label { font-weight: 600; }
.when-row input[hidden] { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  width: auto; margin: 0; padding: 8px 14px;
  background: var(--sheet); color: var(--fjord); border: 2px solid var(--fjord-tint); font-weight: 600;
}
.chip[aria-pressed="true"] { background: var(--fjord); color: var(--on-fjord); border-color: var(--fjord); }
.chip[aria-pressed="true"]::before { content: "✓ "; }

.new-category { margin-top: 8px; }
.new-category > summary, .category-edit > summary { cursor: pointer; color: var(--fjord); font-weight: 600; }
.new-category .swatches, .category-edit .swatches { margin: 4px 0; }

/* Categories page */
.category-list { margin: 12px 0 20px; }
.category-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.category-line { display: flex; align-items: center; gap: 10px; }
.cat-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--c); }
.when-row { flex-wrap: nowrap; }
.when-row input { box-sizing: border-box; min-width: 0; padding: 10px 8px; }
.when-row input[type="date"] { flex: 1 1 auto; }
.when-row input[type="time"] { flex: 0 0 auto; }
.when-label { flex: 0 0 3.6em; }

/* --- Calendar: week/month switch, month grid, repeats, choice sheet ------------------- */

.cal-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.view-switch a {
  padding: 8px 16px; border-radius: 999px; color: var(--fjord); font-weight: 600; text-decoration: none;
}
.view-switch a[aria-current="page"] { background: var(--fjord); color: var(--on-fjord); }
.view-switch a[aria-current="page"]::before { content: "✓ "; }
.float-card-repeat { font-weight: 700; }

.month { margin-top: 8px; }
.month-row { display: grid; grid-template-columns: 2.1em repeat(7, minmax(0, 1fr)); gap: 3px; margin-bottom: 3px; }
.month-head span { text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.month-wk { display: grid; place-items: center; font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.month-cell {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 52px; padding: 6px 2px; border-radius: 14px;
  background: var(--sheet); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; overflow: hidden;
}
.month-cell.other-month { opacity: 0.45; }
.month-cell.is-today .month-num { background: var(--fjord); color: var(--on-fjord); }
.month-cell[aria-current="date"] { border: 2px solid var(--fjord); background: var(--fjord-tint); }
.month-num { display: grid; place-items: center; min-width: 1.8em; height: 1.8em; border-radius: 999px; font-weight: 600; font-variant-numeric: tabular-nums; }
.month-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.month-titles { display: none; }
.month-day-list { margin-top: 16px; }
.month-day-list .day-head { font-weight: 700; }

@media (min-width: 900px) {
  .view:has(.month) { max-width: 1200px; }
  .month-row { grid-template-columns: 2.6em repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
  .month-cell { align-items: stretch; min-height: 104px; padding: 6px; }
  .month-num { align-self: flex-start; }
  .month-dots { display: none; }
  .month-titles { display: flex; flex-direction: column; gap: 3px; }
  .month-title {
    padding: 2px 8px; border-radius: 8px; font-size: 0.78rem; font-weight: 600;
    background: var(--c); color: var(--c-ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .month-more { font-size: 0.75rem; color: var(--muted); padding-left: 4px; }
}

.repeat-details { margin-top: 8px; }
.repeat-details .small { margin: 12px 0 6px; font-weight: 600; }
.interval-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.interval-row input[type="number"] { width: 5em; padding: 10px; font: inherit; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); }
.interval-row input[hidden] { display: none; }
.weekday-chips .chip { padding: 8px 11px; }

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(10, 18, 30, 0.45);
}
.sheet {
  width: 100%; max-width: 480px;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  background: var(--sheet); color: var(--ink);
  border-radius: 24px 24px 0 0; box-shadow: 0 -12px 40px -20px var(--shadow);
}
.sheet h2 { margin: 0 0 4px; font-size: 1.15rem; }
@media (min-width: 600px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 24px; } }
.error-text { color: var(--lingon); }

/* --- Reminders --------------------------------------------------------------------------- */

.reminders { margin: 8px 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--sheet); }
.reminders h2 { font-size: 1.05rem; margin: 0 0 4px; }
.reminder-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reminder-list li button { margin: 0; }
.reminder-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.reminder-add button { width: auto; margin: 0; padding: 10px 18px; }
.reminder-picker { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 auto; }
.reminder-picker select { flex: 1 1 12em; }
.reminder-picker input[hidden] { display: none; }
.remind-area .chips { margin-bottom: 4px; }
.chip.removable { background: var(--fjord); color: var(--on-fjord); border-color: var(--fjord); }
.reminder-picker button[hidden], .reminder-picker input[hidden] { display: none; }
.reminder-picker button { width: auto; margin: 0; padding: 10px 18px; }
.reminder-text { display: flex; flex-direction: column; gap: 2px; }
.reminder-status { font-size: 0.82rem; }
.status-waiting { color: var(--muted); }
.status-done { color: var(--spruce); font-weight: 600; }
.status-problem { color: var(--lingon); font-weight: 600; }
.event-form .reminders { margin-top: 18px; }

/* --- Standalone reminders ------------------------------------------------------------------ */

.view-switch .soon { padding: 8px 12px; color: var(--muted); font-size: 0.85rem; }
.reminder-day { margin-top: 14px; }
.reminder-day .day-head { font-weight: 700; }
.float-card-status { font-size: 0.8rem; margin-top: 4px; opacity: 0.95; font-weight: 600; }
.reminder-card.is-done { opacity: 0.55; }
.reminder-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.reminder-row .done-button { width: auto; margin: 0; padding: 10px 14px; }
.today-missed { color: var(--lingon); font-weight: 600; margin: 4px 0 0; }
.big-status { font-size: 0.95rem; margin: 10px 0 0; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.icon-choice { width: 44px; height: 44px; margin: 0; padding: 0; font-size: 1.3rem; background: var(--sheet); border: 2px solid var(--line); border-radius: 12px; }
.icon-choice[aria-pressed="true"] { border-color: var(--fjord); background: var(--fjord-tint); }
.mute-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.mute-row .segmented button { padding: 6px 14px; }
.category-form .segmented { margin-bottom: 4px; }
.done-hint { margin: 6px 0 0; text-align: center; }

/* --- To-dos and chores ---------------------------------------------------------------------- */

.task-list { display: grid; gap: 2px; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-row.is-overdue .task-meta { color: var(--lingon); font-weight: 600; }
.task-main { display: flex; flex-direction: column; gap: 2px; flex: 1; color: var(--ink); text-decoration: none; min-width: 0; }
.task-title { font-weight: 600; }
.task-meta { font-size: 0.82rem; color: var(--muted); }
.check {
  flex: 0 0 auto; width: 34px; height: 34px; margin: 0; padding: 0;
  border-radius: 50%; border: 2px solid var(--fjord); background: var(--sheet); color: var(--on-fjord);
  font-weight: 700; display: grid; place-items: center;
}
.check.is-checked { background: var(--spruce); border-color: var(--spruce); }
.chore-list { display: grid; gap: 12px; }
.chore-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--sheet); }
.chore-head { display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-decoration: none; margin-bottom: 4px; }
.chore-time .task-title { font-weight: 500; }
.chore-time.is-mine .task-title { font-weight: 700; }
.chore-times .task-row:last-child { border-bottom: none; }
.done-list { margin-top: 18px; }
.done-list > summary { cursor: pointer; color: var(--fjord); font-weight: 600; }
.turn-order { margin: 10px 0 0; padding-left: 1.4em; }
.turn-order li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; }
.turn-order button { width: auto; margin: 0; padding: 4px 12px; }
.small-button { width: auto; margin: 0; padding: 8px 14px; }
.today-chore { border-bottom: 1px solid var(--line); padding-top: 6px; }
.today-chore-title { font-size: 0.82rem; color: var(--muted); text-decoration: none; font-weight: 600; }
.today-chore .task-row { border-bottom: none; padding-top: 2px; }
.cal-actions .button.secondary.cal-new { border-width: 2px; }

/* --- Dinners (Phase 3a) ------------------------------------------------------------------ */

.dinner-days { display: grid; gap: 0; margin-top: 6px; }
.dinner-week { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 16px 0 2px; }
.dinner-row {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 4px;
  border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.dinner-row.is-today { background: var(--fjord-tint); border-radius: 14px; padding-left: 10px; padding-right: 10px; }
.dinner-row.is-past { opacity: 0.6; }
.dinner-date { flex: 0 0 3.4em; display: flex; flex-direction: column; line-height: 1.2; font-size: 0.9rem; }
.dinner-date strong { color: var(--fjord); }
.dinner-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dinner-title { font-weight: 600; overflow-wrap: anywhere; }
.dinner-title.big { font-size: 1.3rem; }
.dinner-add { color: var(--fjord); font-weight: 600; }
.dinner-row.is-empty .dinner-add { opacity: 0.85; }
.toggle-line { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.toggle-line input { width: 20px; height: 20px; accent-color: var(--fjord); }
.dinner-current { margin: 12px 0 4px; }
.dinner-current .detail-buttons button { margin-top: 10px; }

.ing-groups { display: grid; gap: 6px; margin-top: 6px; }
.ing-head { font-size: 0.8rem; color: var(--muted); margin: 6px 0 2px; font-weight: 700; }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 0.95rem; }
.ing-list li:last-child { border-bottom: none; }
.ing-qty { color: var(--muted); white-space: nowrap; }

.meal-pick, .meal-list { display: grid; gap: 8px; margin-top: 8px; }
.meal-choice, .meal-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  width: 100%; margin: 0; padding: 12px 16px; border-radius: 18px;
  background: var(--sheet); color: var(--ink); border: 1px solid var(--line); text-decoration: none; font-weight: 400;
}
.meal-choice.is-current { border: 2px solid var(--fjord); background: var(--fjord-tint); }
.meal-choice.is-current .dinner-title::after { content: " ✓"; color: var(--fjord); }

.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 44px; height: 44px; margin: 0; padding: 0; font-size: 1.3rem; line-height: 1; }
.stepper-value { min-width: 2.2em; text-align: center; font-weight: 700; font-size: 1.15rem; }

.ing-rows { display: grid; gap: 10px; }
.ing-row { padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--sheet); display: grid; gap: 8px; }
.ing-row-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ing-row-line input.ing-amount { width: 6em; flex: 0 0 auto; }
.ing-row-line select { width: auto; flex: 0 0 auto; padding: 10px 12px; }
.ing-row-line .segmented button { padding: 8px 12px; }
.ing-remove { width: 40px; height: 40px; margin: 0 0 0 auto; padding: 0; font-size: 1.2rem; line-height: 1; }
.unit-list { list-style: none; padding: 0; margin: 8px 0; }
.unit-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.scale-note { margin: 10px 0 4px; padding: 10px 12px; border-radius: 14px; background: var(--fjord-tint); font-size: 0.92rem; }
.scale-hint { color: var(--fjord); font-weight: 600; margin: 6px 0 0; }
.scale-hint:empty { display: none; }
.how-to { margin-top: 10px; padding: 12px 14px; border-radius: 16px; background: var(--fjord-tint); font-size: 0.92rem; }
.how-to ol { margin: 6px 0 0; padding-left: 1.3em; }
.how-to li { margin: 3px 0; }
.import-list .task-row.is-left-out .task-title { color: var(--muted); }
.import-note { color: var(--lingon); }
.file-input { display: block; width: 100%; padding: 12px; border: 2px dashed var(--line); border-radius: 16px; background: var(--sheet); color: var(--ink); font: inherit; }
.suggestion-list { margin-top: 12px; }
.suggestion-from { font-size: 0.82rem; font-weight: 700; color: var(--fjord); }
.suggestion-title { display: block; font-size: 1.1rem; margin: 2px 0; }
.suggestion-message { font-style: italic; }
.suggestion-status { font-weight: 600; margin-top: 4px; }
.suggestion.is-accepted .suggestion-status { color: var(--spruce); }
.suggestion.is-declined .suggestion-status { color: var(--lingon); }
.suggestion-buttons { grid-template-columns: 1fr 1fr; gap: 10px; }
.cal-suggestions { font-weight: 700; }
.cal-guest-note { width: 100%; margin: 0; }
.eating { display: grid; gap: 8px; }
.eating-row { display: flex; align-items: center; justify-content: space-between; max-width: 18em; }
.eating-row > span { font-weight: 600; }
.cal-dinner { display: block; margin: 4px 0 2px; font-size: 0.88rem; font-weight: 600; color: var(--muted); text-decoration: none; }

/* --- Shopping lists (Phase 3b) ----------------------------------------------------------- */

.shop-card { gap: 4px; }
.shop-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.shop-card.is-now { border: 2px solid var(--fjord); }
.shop-sub { margin-top: -6px; }
.shop-add { display: grid; gap: 8px; margin: 12px 0 4px; padding: 12px; border-radius: 18px; background: var(--sheet); border: 1px solid var(--line); }
.shop-add .ing-row-line select { flex: 1 1 auto; min-width: 5em; }
.shop-add .small-button { margin-left: auto; }
.shop-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.shop-qty { font-weight: 700; white-space: nowrap; color: var(--fjord); }
.shop-row.is-done .shop-qty, .shop-row.is-have .shop-qty { color: var(--muted); }
.shop-row.is-have .task-title { color: var(--muted); }
.shop-have { flex: 0 0 auto; padding: 6px 12px; font-size: 0.85rem; }
.shop-have-mark { flex: 0 0 34px; text-align: center; font-size: 1.2rem; }
.shop-row .ing-remove { margin: 0; flex: 0 0 auto; }
.shop-offline { background: var(--fjord-tint); color: var(--ink); }
.shop-foot { margin-top: 18px; }
.shop-cart { flex: 0 0 34px; text-align: center; font-size: 1.3rem; }
.shop-qty-button { background: transparent; border: 0; padding: 2px 4px; margin: -2px -4px; border-radius: 8px; font: inherit; font-weight: 700;
  cursor: pointer; min-height: 0; box-shadow: none; }
.shop-qty-button:hover, .shop-qty-button:focus-visible { background: var(--fjord-tint); }
.shop-qty-pen { font-weight: 400; opacity: 0.6; font-size: 0.85em; }
.shop-qty-button.is-changed { text-decoration: underline dotted; text-underline-offset: 3px; }
.shop-plan-changed { color: var(--lingon); }
.shop-row.is-editing { flex-wrap: wrap; }
.shop-amount-edit { flex: 1 1 100%; display: grid; gap: 6px; margin-top: 4px; padding: 10px; border-radius: 14px;
  background: var(--sheet); border: 1px solid var(--line); }
.shop-amount-edit .ing-row-line { display: flex; gap: 6px; align-items: center; }
.shop-amount-edit input.ing-amount { flex: 0 0 4.5em; width: 4.5em; min-width: 0; }
.shop-amount-edit select { flex: 1 1 4em; min-width: 0; }
.shop-amount-edit .small-button { flex: 0 0 auto; padding-left: 12px; padding-right: 12px; }
.shop-amount-edit p { margin: 0; }
.shop-amount-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.shop-amount-actions .small-button { white-space: normal; text-align: left; }
.today-shop { color: var(--ink); text-decoration: none; }

/* --- Housekeeping: server problem bar, account page ----------------------------------- */

.server-problem {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--lingon-tint); color: var(--ink); border-bottom: 2px solid var(--lingon);
  font-size: 0.92rem; font-weight: 600;
}
.server-problem span { flex: 1 1 14em; }
.server-problem button { width: auto; margin: 0; padding: 8px 16px; background: var(--lingon); color: #fff; }
.danger-zone h2 { color: var(--lingon); }
.danger-zone summary { cursor: pointer; color: var(--lingon); font-weight: 600; }

/* --- Votes (Phase 4) ------------------------------------------------------------------------- */

.lists-nav { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.lists-nav a { padding: 8px 9px; font-size: 0.86rem; white-space: nowrap; }
@media (max-width: 420px) { .lists-nav a { padding: 7px 5px; font-size: 0.76rem; } }
/* Six Lists tabs (Steps added 26.10.2026): on phones, two rows of three instead of tiny text. */
@media (max-width: 480px) {
  .lists-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; border-radius: 22px; overflow: visible; }
  .lists-nav a { padding: 8px 4px; font-size: 0.86rem; text-align: center; overflow: hidden; text-overflow: ellipsis; }
}
.lists-nav a[aria-current="page"]::before { content: ""; }
.today-vote.is-waiting .task-meta { color: var(--lingon); font-weight: 600; }
.vote-card.is-passed { border-left: 6px solid var(--spruce); }
.vote-card.is-failed { border-left: 6px solid var(--lingon); }
.vote-result-chip { font-size: 0.78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.vote-description { white-space: pre-wrap; }
.vote-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vote-button { margin: 0; padding: 18px 10px; font-size: 1.2rem; border-radius: 20px; background: var(--sheet); color: var(--ink); border: 2px solid var(--line); }
.vote-yes.is-chosen { background: var(--spruce); border-color: var(--spruce); color: #fff; }
.vote-no.is-chosen { background: var(--lingon); border-color: var(--lingon); color: #fff; }
.vote-progress { margin-top: 18px; }
.vote-bar { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.vote-bar-fill { display: block; height: 100%; width: 0; background: var(--fjord); border-radius: 999px; transition: width 0.6s ease; }
.vote-result { margin: 16px 0; padding: 18px; border-radius: 22px; background: var(--sheet); border: 1px solid var(--line); text-align: center; }
.vote-result h2 { margin: 4px 0; font-size: 1.4rem; }
.vote-result.is-passed { background: linear-gradient(160deg, #fff6d6, #e3f6ea); color: #1c2733; border-color: transparent; }
.vote-result.is-failed { background: linear-gradient(160deg, #e7edf5, #dfe5ee); color: #1c2733; border-color: transparent; }
.vote-result-emoji { font-size: 3rem; line-height: 1; }
.vote-count { font-weight: 700; }
.vote-ballots { list-style: none; padding: 0; margin: 8px 0; text-align: left; }
.vote-ballots li { padding: 6px 0; border-bottom: 1px dashed rgba(28, 39, 51, 0.15); }
.vote-ballots li.is-none { color: var(--muted); }
.vote-alt input, .vote-alt textarea { margin-top: 8px; }

/* The shows: confetti (passed) and a rain cloud with a sinking balloon (not passed). */
.show-overlay { position: fixed; inset: 0; z-index: 90; pointer-events: auto; overflow: hidden; }
.show-message {
  position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 26px; border-radius: 24px; background: rgba(255, 255, 255, 0.92); color: #1c2733;
  font-size: 1.5rem; font-weight: 800; text-align: center; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.45);
  animation: show-pop 0.6s cubic-bezier(.2, 1.6, .4, 1) both, show-fade 0.6s ease 4.4s forwards;
}
.show-emoji { font-size: 3.4rem; line-height: 1; }
.confetto {
  position: absolute; top: -20px; left: var(--x); width: 10px; height: 16px; border-radius: 2px;
  animation: confetti-fall var(--time) cubic-bezier(.25, .6, .4, 1) var(--delay) forwards;
}
.confetto.round { width: 11px; height: 11px; border-radius: 50%; }
.confetto.c1 { background: #f4b400; } .confetto.c2 { background: #2457a6; } .confetto.c3 { background: #2f7d57; }
.confetto.c4 { background: #e2445c; } .confetto.c5 { background: #9b59d0; } .confetto.c6 { background: #ff8a3d; }
@keyframes confetti-fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--drift), 110vh) rotate(var(--spin)); opacity: 0.9; }
}
@keyframes show-pop { from { transform: translate(-50%, -50%) scale(0.4); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes show-fade { to { opacity: 0; } }
.rainy { background: rgba(70, 86, 110, 0.25); animation: show-fade 0.6s ease 4.4s forwards; }
.rain-cloud { position: absolute; left: 50%; top: 9%; transform: translateX(-50%); font-size: 6rem; line-height: 1; width: 1.4em; height: 3.2em; }
.raindrop {
  position: absolute; top: 0.8em; left: var(--x); width: 3px; height: 14px; border-radius: 3px; background: #5b8fd6;
  animation: rain 0.9s linear var(--delay) infinite;
}
@keyframes rain { from { transform: translateY(0); opacity: 1; } to { transform: translateY(120px); opacity: 0; } }
.sad-balloon {
  position: absolute; left: 50%; top: 52%; font-size: 4rem; line-height: 1; display: flex; flex-direction: column; align-items: center;
  animation: balloon-sink 3.6s ease-in 0.4s forwards;
}
.pfff { font-size: 0.9rem; font-weight: 700; color: #1c2733; opacity: 0; animation: show-fade-in 0.4s ease 1.2s forwards; }
@keyframes balloon-sink {
  0% { transform: translate(-50%, 0) rotate(0) scale(1); }
  30% { transform: translate(-46%, 4vh) rotate(-12deg) scale(0.85); }
  60% { transform: translate(-54%, 14vh) rotate(10deg) scale(0.6); }
  100% { transform: translate(-50%, 40vh) rotate(-20deg) scale(0.3); opacity: 0.4; }
}
@keyframes show-fade-in { to { opacity: 1; } }
.rainy .show-message { top: 36%; background: rgba(255, 255, 255, 0.9); }
@media (prefers-reduced-motion: reduce) { .show-overlay { display: none; } }

/* --- Budgets (Phase 5a) ------------------------------------------------------------------- */

.budget-card { gap: 6px; }
.budget-spent, .budget-amount { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.budget-bar { width: 100%; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.budget-bar span { display: block; height: 100%; width: 0; background: var(--spruce); border-radius: 999px; }
.budget-bar.is-near span { background: #e0a100; }
.budget-bar.is-over span { background: var(--lingon); }
.budget-summary { margin: 10px 0 14px; padding: 16px; border-radius: 22px; background: var(--sheet); border: 1px solid var(--line); text-align: center; display: grid; gap: 6px; }
.budget-big { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.budget-left { font-weight: 700; color: var(--spruce); }
.budget-left.is-over { color: var(--lingon); }
.budget-row { color: var(--ink); text-decoration: none; }
.budget-day { flex: 0 0 3.6em; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.budget-links { margin-top: 18px; }
.year-list { display: grid; gap: 4px; }
.year-row { display: grid; grid-template-columns: 2.6em 1fr auto; gap: 10px; align-items: center; padding: 6px 2px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.year-month { font-weight: 600; color: var(--muted); }
.year-track { position: relative; height: 14px; background: var(--paper); border-radius: 999px; overflow: visible; }
.year-bar { display: block; height: 100%; width: 0; background: var(--fjord); border-radius: 999px; }
.year-bar.is-over { background: var(--lingon); }
.year-plan { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: 0.55; }
.export-grid { display: grid; grid-template-columns: 1fr auto auto; gap: 8px 10px; align-items: center; margin-top: 10px; }
.export-grid .button { margin: 0; }
.import-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--sheet); }
.import-table { border-collapse: collapse; font-size: 0.8rem; min-width: 100%; }
.import-table th, .import-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; max-width: 14em; overflow: hidden; text-overflow: ellipsis; }
.import-table th { background: var(--fjord-tint); }
.map-grid { display: grid; gap: 8px; }
.map-row { display: grid; grid-template-columns: 8.5em 1fr; gap: 10px; align-items: center; margin: 0; font-weight: 600; }
.map-row select { width: 100%; }
.import-problems { color: var(--lingon); }
.access-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.access-row .segmented button { padding: 6px 12px; }
.fixed-form .segmented { flex-wrap: wrap; }
.receipt-form select { width: 100%; }

/* --- Start screen (splash) ------------------------------------------------------------ */

.splash {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: #ffffff;
  transition: opacity 0.45s ease;
  /* Safety net: even if the app's code fails, the start screen goes away. */
  animation: splash-failsafe 0.4s ease 6s forwards;
}
.splash img { width: 132px; height: 132px; border-radius: 30px; box-shadow: 0 18px 40px -22px rgba(28, 74, 145, 0.7); }
.splash-name { font-size: 1.25rem; font-weight: 700; color: #1c2733; letter-spacing: 0.01em; }
.splash.is-hidden { opacity: 0; pointer-events: none; }
@keyframes splash-failsafe { to { opacity: 0; visibility: hidden; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .splash { background: #0f1722; }
  :root:not([data-theme="light"]) .splash-name { color: #e6edf5; }
}
:root[data-theme="dark"] .splash { background: #0f1722; }
:root[data-theme="dark"] .splash-name { color: #e6edf5; }
@media (prefers-reduced-motion: reduce) { .splash { transition: none; } }

/* --- Garbage calendar import (Phase 6) --- */
.notice-soft { background: var(--fjord-tint); border-radius: 10px; padding: 10px 12px; margin: 8px 0 14px; }
.notice-soft a { font-weight: 600; }
.short-input { max-width: 8em; }
.garbage-kinds { display: grid; gap: 10px; margin: 8px 0 14px; }
.garbage-kind { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.garbage-kind .toggle-line { flex: 0 0 auto; min-width: 76px; }
.garbage-picture { height: 30px; width: auto; max-width: 140px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }
.garbage-drawing { height: 30px; width: 30px; background: #fff; border-radius: 6px; padding: 2px; }
#view details.small { margin: 6px 0 12px; }
#view details.small summary { cursor: pointer; }
.garbage-kind-name { display: grid; gap: 2px; flex: 1 1 160px; }
.garbage-kind-name input { margin: 0; }

/* --- School holidays import (Phase 6) --- */
.howto { margin: 4px 0 10px; padding-left: 22px; display: grid; gap: 6px; }
.paste-box { width: 100%; min-height: 8em; font: inherit; }
.import-list .import-title { margin: 4px 0 2px; padding: 6px 10px; }
#sc-address { flex: 1 1 auto; min-width: 0; }

/* --- Receipt reading (Phase 6) --- */
.budget-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.budget-add-row .button { flex: 1 1 140px; margin: 0; text-align: center; }
.receipt-line { display: flex; gap: 6px; align-items: center; }
.receipt-line .receipt-name { flex: 1 1 auto; min-width: 0; padding: 8px 10px; }
.receipt-line .receipt-amount { flex: 0 0 6.5em; width: 6.5em; text-align: right; padding: 8px 10px; }
.receipt-amount.is-wrong { border-color: var(--lingon); }
.receipt-sum { margin: 10px 0; font-weight: 600; }
.receipt-sum.is-ok { color: var(--spruce); }
.receipt-sum.is-off { color: var(--lingon); }
.receipt-lines .task-row.is-check { border-left: 4px solid var(--lingon); padding-left: 8px; }
.receipt-lines .task-row.is-check .task-meta { color: var(--lingon); }
.receipt-check-note { background: var(--lingon-tint); }
.receipt-more { display: grid; gap: 6px; margin: 16px 0; padding: 12px; border-radius: 18px; background: var(--sheet); border: 1px solid var(--line); }
.receipt-more label { font-weight: 600; }
.receipt-text { white-space: pre-wrap; font-size: 0.85em; max-height: 20em; overflow: auto; background: var(--paper); padding: 8px; border-radius: 8px; }

/* --- Chat (Phase 7) --- */
.link-button { background: none; border: none; color: var(--fjord); padding: 4px 0; margin: 0; width: auto; font: inherit; text-decoration: underline; cursor: pointer; }
.recovery-code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 1.15rem; font-weight: 700; letter-spacing: 0.04em;
  background: var(--sheet); border: 2px dashed var(--fjord); border-radius: 12px; padding: 10px 12px; flex: 1 1 auto; text-align: center; overflow-wrap: anywhere; }
.safety-code { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 10px; margin: 14px 0; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.2rem; font-weight: 700; text-align: center; background: var(--sheet); border-radius: 14px; padding: 14px; border: 1px solid var(--line); }
.msg-details { margin: 12px 0; }
.msg-details summary { cursor: pointer; font-weight: 600; }
.msg-lock-note { margin-top: 18px; }
.chat-row { align-items: center; text-decoration: none; color: inherit; }
.chat-avatar { flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--fjord-tint); color: var(--fjord); display: grid; place-items: center; font-weight: 800; }
.chat-row-head { display: flex; justify-content: space-between; gap: 8px; }
.chat-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.chat-row.is-unread .task-title, .chat-row.is-unread .chat-preview { font-weight: 700; color: var(--ink); }
.chat-unread { background: var(--lingon); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; padding: 0 6px; font-size: 0.75rem; font-weight: 800; display: grid; place-items: center; }
.chat-head { display: grid; gap: 2px; }
.chat-head .chat-title { margin: 4px 0 0; overflow-wrap: anywhere; }
.chat-head .cal-link { justify-self: start; }
.chat-messages { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 12px; }
.chat-day { align-self: center; font-size: 0.75rem; color: var(--muted); background: var(--sheet); border-radius: 999px; padding: 2px 10px; margin: 8px 0 2px; }
.chat-event { align-self: center; text-align: center; font-size: 0.8rem; color: var(--muted); max-width: 90%; }
.chat-line { display: flex; }
.chat-line.is-mine { justify-content: flex-end; }
.chat-bubble { max-width: 82%; background: var(--sheet); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 8px 12px 6px; display: grid; gap: 2px; }
.chat-bubble.is-mine { background: var(--fjord); color: #fff; border-color: var(--fjord); border-radius: 18px 18px 6px 18px; }
:root[data-theme="dark"] .chat-bubble.is-mine { color: #0d1622; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chat-bubble.is-mine { color: #0d1622; } }
.chat-sender { font-size: 0.75rem; font-weight: 700; color: var(--fjord); }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-time { font-size: 0.68rem; opacity: 0.75; justify-self: end; }
.chat-deleted { font-style: italic; opacity: 0.8; }
.chat-warning { display: block; font-size: 0.75rem; color: var(--lingon); }
.chat-bubble.is-mine .chat-warning { color: #ffe1e6; }
.chat-delete { color: inherit; font-size: 0.8rem; justify-self: end; }
.chat-empty { text-align: center; }
.chat-compose { position: sticky; bottom: calc(86px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: flex-end;
  background: var(--paper); padding: 8px 0; z-index: 5; }
.chat-compose textarea { flex: 1 1 auto; min-height: 44px; max-height: 160px; resize: none; border-radius: 22px; padding: 10px 14px; margin: 0; }
.chat-compose .chat-send { width: auto; margin: 0; border-radius: 22px; padding: 10px 16px; }
@media (min-width: 900px) { .chat-compose { bottom: 12px; } }
/* "↓ New message" when a message arrives while you read further up (chat tweak). */
.chat-new-pill { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: auto; margin: 0;
  padding: 8px 14px; border-radius: 999px; border: 0; background: var(--fjord); color: var(--on-fjord); font: inherit; font-size: 0.85rem;
  font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); cursor: pointer; white-space: nowrap; }
.chat-new-pill[hidden] { display: none; }
/* Seven tabs on narrow phones: a little smaller text so "Calendar" still fits. */
@media (max-width: 400px) { .tabbar a { font-size: 0.66rem; letter-spacing: -0.01em; } .tabbar { left: 8px; right: 8px; padding: 5px; } }

/* --- Votes with options and majority (tweak) --- */
.vote-rule { margin: 2px 0 10px; font-weight: 600; color: var(--fjord); }
.vote-options { display: grid; gap: 8px; margin: 8px 0; }
.vote-option { width: 100%; margin: 0; text-align: left; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--sheet); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.vote-option.is-chosen { border-color: var(--fjord); background: var(--fjord-tint); color: var(--fjord); }
.vote-option-inputs { display: grid; gap: 6px; margin-bottom: 6px; }
.vote-option-inputs .interval-row input { flex: 1 1 auto; }
.vote-tally { display: grid; gap: 8px; margin: 12px 0; }
.vote-tally-row { display: grid; grid-template-columns: minmax(0, 8em) 1fr 2em; gap: 8px; align-items: center; }
.vote-tally-label { overflow-wrap: anywhere; }
.vote-tally-track { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.vote-tally-bar { display: block; height: 100%; background: var(--muted); border-radius: 999px; }
.vote-tally-row.is-winner .vote-tally-bar { background: var(--spruce); }
.vote-tally-row.is-winner .vote-tally-label { font-weight: 700; }
.vote-tally-count { text-align: right; font-weight: 700; }
.vote-result.is-tie, .vote-result.is-chosen { text-align: center; }

/* --- Swiping event cards: left = delete, right = change ------------------------------ */
.swipe-row { position: relative; border-radius: 22px; transition: max-height 0.22s ease, opacity 0.22s ease; }
.day .swipe-row { border-radius: 18px; }
.swipe-row > .float-card { position: relative; z-index: 1; touch-action: pan-y; }
.swipe-hint {
  position: absolute; inset: 0; display: none; align-items: center; gap: 6px;
  padding: 0 20px; border-radius: inherit; font-weight: 700;
  color: var(--on-fjord); opacity: 0.6; transition: opacity 0.15s ease;
}
.swipe-hint-edit { justify-content: flex-start; background: var(--fjord); }
.swipe-hint-delete { justify-content: flex-end; background: var(--lingon); }
/* While dragging, the card is clipped so the page never gets wider than the screen. */
.swipe-row.is-swiping { overflow: hidden; }
.swipe-row.is-swiping[data-side="edit"] .swipe-hint-edit,
.swipe-row.is-swiping[data-side="delete"] .swipe-hint-delete { display: flex; }
.swipe-row.is-armed .swipe-hint { opacity: 1; }
.swipe-icon { display: inline-block; font-size: 1.2rem; transition: transform 0.15s ease; }
.swipe-row.is-armed .swipe-icon { transform: scale(1.3); }
.swipe-row.is-gone { max-height: 0 !important; opacity: 0; overflow: hidden; }
.swipe-row[hidden] { display: none; }

.undo-bar {
  position: fixed; z-index: 60;
  left: 12px; right: 12px; margin: 0 auto; max-width: 480px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 18px; border-radius: 18px;
  background: var(--ink); color: var(--paper);
  box-shadow: 0 12px 30px -12px var(--shadow);
  animation: undo-in 0.2s ease;
}
.undo-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.undo-bar button {
  width: auto; margin: 0; padding: 8px 14px; flex: none;
  background: transparent; color: var(--fjord-tint); font-weight: 700; text-decoration: underline;
}
@keyframes undo-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .swipe-row, .undo-bar { transition: none; animation: none; } }
@media (min-width: 900px) { .undo-bar { bottom: 24px; } }

/* --- Install as app (login, setup and account pages) ------------------------- */
.install { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
section.block.install { border-top: none; padding-top: 0; margin-top: 24px; }
.install-intro { margin: 0; }
.install .install-button { margin-top: 10px; }
.install-help { margin-top: 12px; padding: 12px 14px; background: var(--fjord-tint); border-radius: 16px; }
.install-help p { margin: 0 0 8px; }
.install-help p:last-child { margin-bottom: 0; }
.install-steps { margin: 0 0 8px; padding-left: 22px; }
.install-steps li { margin: 6px 0; }
.install-steps li::marker { color: var(--fjord); font-weight: 700; }
.share-icon { width: 1.25em; height: 1.25em; vertical-align: -0.25em; margin: 0 2px;
  fill: none; stroke: var(--fjord); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.install-status { margin: 12px 0 0; color: var(--spruce); font-weight: 600; }
.install-status.is-muted { color: var(--muted); font-weight: 400; }

/* --- Wishlists and saving goals ------------------------------------------------------------ */

.wish-count { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.wish-sub { margin: -4px 0 4px; font-weight: 600; color: var(--fjord); }
.wish-items { display: grid; gap: 10px; margin-top: 10px; }
.wish-item { padding: 12px 16px; border-radius: 18px; background: var(--sheet); border: 1px solid var(--line); display: grid; gap: 6px; }
.wish-item.is-wanted { border-color: #e0a100; }
.wish-item.is-received { opacity: 0.72; }
.wish-item.is-received .wish-title { text-decoration: line-through; }
.wish-title { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.wish-notes { margin: 0; white-space: pre-line; font-size: 0.92rem; overflow-wrap: anywhere; }
.wish-link { font-size: 0.9rem; font-weight: 600; color: var(--fjord); overflow-wrap: anywhere; }
.wish-claim { margin: 2px 0 0; font-size: 0.9rem; color: var(--muted); }
.wish-claim.is-taken { color: var(--spruce); font-weight: 700; }
.wish-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wish-actions button, .wish-actions .button { margin: 0; padding: 8px 14px; font-size: 0.9rem; width: auto; flex: 0 1 auto; }
.wish-goal { display: grid; gap: 4px; padding: 8px 10px; border-radius: 14px; background: var(--fjord-tint); color: var(--ink); text-decoration: none; }
.wish-goal-line { display: flex; justify-content: space-between; gap: 8px; font-size: 0.9rem; font-weight: 600; }
.wish-goal-open { color: var(--fjord); }
.wish-emojis .emoji-chip { font-size: 1.25rem; padding: 6px 10px; line-height: 1.2; }
.wish-emojis .emoji-chip[aria-pressed="true"]::before { content: ""; }
.wish-reached-link { margin-top: 18px; }
.goal-bar span { background: var(--fjord); }
.goal-bar.is-reached span { background: var(--spruce); }
.goal-summary.is-reached { border-color: var(--spruce); }
.goal-trophy { font-size: 2.4rem; line-height: 1; }
.goal-pace { margin: 2px 0; }
.goal-quick { margin: 12px 0; }
.goal-saved-button { width: 100%; }
.goal-other { flex-wrap: wrap; }
.goal-other input[type="text"] { width: 7.5em; flex: 0 0 auto; }
.goal-other input[type="date"] { width: auto; flex: 1 1 9em; }
.goal-other button { margin: 0; }
.goal-reach { margin: 14px 0; }
.goal-reached-button { width: 100%; font-size: 1.05rem; }
.goal-entry-amount { display: inline-flex; align-items: center; gap: 6px; }
.goal-entries .ing-remove { width: 32px; height: 32px; font-size: 1rem; }
.goal-inspire { padding: 12px 14px; border-radius: 16px; background: var(--fjord-tint); font-weight: 600; }
.plan-form { display: grid; gap: 4px; }
.plan-form .segmented { flex-wrap: wrap; }
.weekday-choice button { padding: 8px 10px; }
.inline-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; margin-top: 6px; }
.inline-label input { width: auto; }
.today-saving .task-main { color: var(--ink); text-decoration: none; }
.today-saving .task-main { flex: 1 1 auto; min-width: 0; }
.today-saving button { margin: 0; flex: 0 0 auto; width: auto; padding: 8px 14px; white-space: nowrap; }

/* Stores: lists sorted in the order of a shop (user wish 26.10.2026) */
.shop-store { display: grid; gap: 8px; margin: 12px 0 4px; padding: 12px; border-radius: 18px; background: var(--sheet); border: 1px solid var(--line); }
.shop-store { grid-template-columns: minmax(0, 1fr); }
.shop-store > * { min-width: 0; }
.shop-store p { margin: 0; }
.shop-store-line { display: flex; align-items: center; gap: 8px; }
.shop-store-line label { font-weight: 600; white-space: nowrap; margin: 0; }
.shop-store-line select { flex: 1 1 auto; min-width: 0; }
.shop-store-line .cal-link { flex: 0 0 auto; }
.shop-store-options { gap: 6px; }
.shop-store-options .chip { font-size: 0.85rem; padding: 6px 10px; }
.shop-group { margin-top: 6px; }
.shop-group p { margin: 0 0 6px; }
.shop-group .small-button { margin: 0 0 6px; }
.shop-group-title { font-size: 0.95rem; margin: 14px 0 2px; color: var(--muted); font-weight: 700; }
.shop-drag { flex: 0 0 auto; width: 40px; height: 40px; margin: 0; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: grab; touch-action: none;
  -webkit-user-select: none; user-select: none; }
.shop-drag:hover, .shop-drag:focus-visible { background: var(--fjord-tint); color: var(--fjord); }
.shop-row.is-dragging { position: relative; z-index: 5; background: var(--sheet); border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22); transition: none; }
.shop-row.is-dragging .shop-drag { cursor: grabbing; color: var(--fjord); }
body.is-sorting { -webkit-user-select: none; user-select: none; cursor: grabbing; }
.shop-moves { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
.shop-move { width: 40px; height: 32px; margin: 0; padding: 0; font-size: 1rem; line-height: 1; border-radius: 10px; }
.shop-row .task-main { min-width: 0; }
.shop-place { flex: 0 1 auto; width: 6.5em; min-width: 0; padding: 6px 8px; font-size: 0.85rem; }
.shop-row .shop-have { white-space: nowrap; }
.store-order { margin: 6px 0 0; padding-left: 2.2em; }
.store-order-row { padding: 4px 0; border-bottom: 1px solid var(--line); }
.store-order-row { display: list-item; }
.store-order-row > span, .store-order-row > button { vertical-align: middle; }
.store-order-row .store-order-name { display: inline-block; width: calc(100% - 48px); overflow-wrap: anywhere; }
.store-order-row .ing-remove { display: inline-block; width: 36px; height: 36px; margin: 0; }
.store-symbol { min-width: 44px; }

/* --- Step-by-step (user wish 26.10.2026) ------------------------------------------------- */
.steps-list { display: grid; gap: 10px; margin-top: 10px; }
.steps-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--sheet); }
.steps-card-main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 12em; min-width: 0; color: var(--ink); text-decoration: none; }
.steps-card-title { font-weight: 700; overflow-wrap: anywhere; }
.steps-continue { flex: 0 0 auto; }
.steps-empty { margin-top: 14px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 20px; }
.steps-empty p { margin: 0 0 6px; }
.steps-meta { margin: 0 0 8px; }
.steps-description { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; }
.steps-start { margin-top: 14px; }
.steps-chores { margin-top: 12px; }
.steps-details { display: block; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.9rem; color: var(--ink); opacity: 0.85; }
.steps-num { flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--fjord-tint); color: var(--fjord); font-weight: 700; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.steps-num-inline { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Reading the steps (the step-by-step's page) */
.steps-read, .steps-run, .steps-edit-list { list-style: none; margin: 0; padding: 0; }
.steps-read-section h3 { margin: 16px 0 4px; font-size: 1rem; color: var(--muted); }
.steps-read-step { display: flex; align-items: flex-start; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.steps-read-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.steps-read-title { font-weight: 600; overflow-wrap: anywhere; }
.steps-read-step.is-important .steps-read-title { color: var(--lingon); }
.steps-needs-read { margin: 0; padding-left: 1.3em; }
.steps-needs-read li { padding: 3px 0; overflow-wrap: anywhere; }
.steps-history-row { color: var(--ink); text-decoration: none; }
.steps-history-row.is-stopped .task-title { color: var(--muted); }
.steps-note-line { display: block; font-size: 0.88rem; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }

/* Doing it (a run) */
.steps-progress-line { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; }
.steps-progress { flex: 1; height: 10px; border-radius: 999px; background: var(--fjord-tint); overflow: hidden; }
.steps-progress-bar { display: block; height: 100%; width: 0; background: var(--spruce); border-radius: 999px; transition: width 0.3s; }
.steps-options { margin: 6px 0; }
.steps-options .chip { font-size: 0.85rem; padding: 6px 10px; }
.steps-run-step { display: flex; align-items: flex-start; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); border-radius: 14px; }
.steps-run-step .check { width: 44px; height: 44px; font-size: 1.1rem; }
.steps-run-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; padding-top: 2px; }
.steps-run-title { font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }
.steps-run-step.is-current { background: var(--fjord-tint); border-bottom-color: transparent; box-shadow: inset 4px 0 0 var(--fjord); }
.steps-run-step.is-done .steps-run-title { text-decoration: line-through; color: var(--muted); }
.steps-run-step.is-locked { opacity: 0.55; }
.steps-run-step.is-important:not(.is-done) .steps-run-title { color: var(--lingon); }
.steps-note-button { flex: 0 0 auto; padding: 6px 10px; font-size: 0.85rem; }
.steps-note-edit { margin-top: 6px; }
.steps-note-buttons { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.steps-end { margin-top: 18px; }
.steps-end .small-button { margin-top: 6px; }
.steps-run-note { margin: 4px 0; }
.steps-needs .check { width: 38px; height: 38px; }

/* Making and changing a step-by-step */
.steps-symbols .steps-symbol { min-width: 44px; padding: 6px 8px; font-size: 1.15rem; }
.steps-symbols .steps-symbol[aria-pressed="true"]::before { content: ""; }
.steps-needs-edit { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.steps-needs-edit li { display: flex; align-items: center; gap: 8px; }
.steps-needs-edit .ing-remove { flex: 0 0 auto; margin: 0; }
.steps-add-need input { flex: 1 1 10em; min-width: 0; }
.steps-edit-list { display: grid; gap: 8px; }
.steps-edit-row { padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--sheet); }
.steps-edit-row.is-section { background: var(--fjord-tint); border-color: transparent; }
.steps-edit-row.is-dragging { position: relative; z-index: 5; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22); transition: none; }
.steps-edit-row.is-dragging .shop-drag { cursor: grabbing; color: var(--fjord); }
.steps-edit-line { display: flex; align-items: center; gap: 6px; }
.steps-edit-line input { flex: 1 1 auto; min-width: 0; padding: 10px; }
.steps-edit-line .ing-remove { flex: 0 0 auto; margin: 0; }
.steps-edit-line .shop-drag { width: 36px; }
.steps-section-input { font-weight: 700; }
.steps-edit-more { margin: 6px 0 0 42px; }
.steps-edit-more .steps-more { padding: 4px 12px; font-size: 0.85rem; border-width: 1px; }
.steps-edit-extra { margin-top: 8px; }
.steps-edit-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.steps-wait { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.steps-wait input { width: 4.2em; padding: 8px; font: inherit; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); }
.steps-wait select { padding: 8px 10px; }
.steps-add-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.steps-add-buttons button { margin-top: 10px; padding: 12px 8px; }
@media (max-width: 380px) { .steps-edit-more { margin-left: 0; } }
.steps-wait span { white-space: nowrap; }
.steps-wait { flex-wrap: nowrap; }

/* --- Today: swiping between the days' dinners (dinner.js) ---------------------------------- */
.dinner-swipe-head { display: flex; align-items: center; gap: 6px; }
.dinner-swipe-head h2 { margin-right: auto; }
.dinner-swipe-head button { width: auto; margin: 0; }
.dinner-swipe-nav {
  width: 38px !important; height: 38px; padding: 0; border-radius: 999px;
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  font-size: 1.35rem; line-height: 1; font-weight: 600;
}
.dinner-swipe-nav:hover, .dinner-swipe-nav:focus-visible { border-color: var(--fjord); color: var(--fjord); }
.dinner-swipe-today {
  padding: 6px 12px; border-radius: 999px; font-size: 0.9rem;
  background: var(--fjord-tint); color: var(--fjord); border: 1px solid transparent;
}
.dinner-swipe-today[hidden] { display: none; }
/* Room around the card for its shadow, while a card sliding out is cut off at the sides. */
.dinner-swipe { overflow: hidden; margin: 4px -10px -14px; padding: 8px 10px 22px; }
.dinner-swipe-track { touch-action: pan-y; will-change: transform; }
.dinner-swipe-track > .float-card { display: block; text-decoration: none; }
.float-card-day { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; opacity: 0.85; margin-bottom: 2px; }
.float-card.dinner-swipe-empty {
  background: var(--sheet); color: var(--ink); box-shadow: none;
  border: 2px dashed var(--line);
}
.dinner-swipe-empty .float-card-day { color: var(--muted); opacity: 1; }
.dinner-swipe-empty .float-card-title { color: var(--muted); }
.dinner-swipe-plan { margin-top: 4px; font-size: 0.9rem; font-weight: 600; color: var(--fjord); }
.dinner-swipe-hint { margin: 0 0 4px; text-align: center; }
@media (prefers-reduced-motion: reduce) { .dinner-swipe-track { transition: none !important; } }
