/* Rotaly design system
   Calm off-white ground, near-black ink for primary actions, one deep green accent,
   orange only for things that need doing. Bricolage Grotesque headings, Figtree body. */

:root {
  --bg: #F0F5F2;
  --surface: #FFFFFF;
  --sidebar: #F8FBF9;
  --ink: #17211D;
  --ink-2: #3F4A44;
  --muted: #5B6660;
  --line: #E2E5DF;
  --line-soft: #EEF0EC;
  --control: #DADFD8;
  --accent: #1E6B52;
  --accent-ink: #154D3B;
  --accent-soft: #E3EFE9;
  --accent-line: #CFE3D8;
  --warn: #A34A0C;
  --warn-ink: #6E3410;
  --warn-soft: #FBEBDD;
  --warn-tint: #FDF6EF;
  --dark: #17211D;
  --dark-2: #2C3832;
  --dark-muted: #C9D1CC;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --radius: 12px;
  --radius-lg: 18px;

  --bs-body-font-family: var(--font-body);
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--ink);
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
  --bs-primary: var(--accent);
  --bs-primary-rgb: 30, 107, 82;
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: 30, 107, 82;
  --bs-link-hover-color: var(--accent-ink);
  --bs-link-hover-color-rgb: 21, 77, 59;
  --bs-border-radius: var(--radius);
}

html, body { background: var(--bg); }
body { font-family: var(--font-body); font-size: 15px; line-height: 1.5; color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6, .display { font-family: var(--font-display); font-weight: 650; letter-spacing: -0.02em; color: var(--ink); }
a { text-decoration: none; color: var(--accent); }
a:hover { color: var(--accent-ink); }
.text-secondary { color: var(--muted) !important; }
.text-muted { color: var(--muted) !important; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- App shell: sidebar + content ---------- */
.shell { display: flex; min-height: 100vh; }
/* Bootstrap has no min-width utility; without this the content column grows to fit wide children
   (e.g. the 7-day strip) and the whole page scrolls sideways on phones. */
.min-w-0 { min-width: 0; }
.sidebar {
  position: sticky; top: 0; height: 100vh; flex: 0 0 252px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 26px; padding: 24px 16px;
  background: var(--sidebar); border-right: 1px solid var(--line); overflow-y: auto;
}
.content { flex: 1 1 auto; min-width: 0; padding: 32px clamp(20px, 4vw, 56px) 64px; }
.content-inner { max-width: 1200px; margin-left: clamp(0px, calc((100% - 1200px) / 2), 72px); }  /* centred-ish on wide screens, but never a big gap by the sidebar */

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -0.02em; }

.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-label { padding: 0 12px 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--ink-2); font-weight: 500; min-height: 40px;
}
.side-link:hover { background: #EEF0EB; color: var(--ink); }
.side-link.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.side-link svg { flex: none; }
.side-link .rota-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.side-link .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link .flag { width: 8px; height: 8px; border-radius: 50%; background: #C2611F; flex: none; }
.side-link.add { color: var(--accent); font-weight: 600; margin-top: 4px; }

.account {
  margin-top: auto; display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; color: var(--ink);
}
.account:hover { border-color: var(--control); }
.account .meta { min-width: 0; line-height: 1.3; flex: 1; }
.account .meta .n { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account .meta .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Phone: top bar + bottom tabs instead of the sidebar */
.topbar { display: none; }
.tabbar { display: none; }
@media (max-width: 991.98px) {
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 1020; padding: 12px 16px;
    background: rgba(250, 250, 248, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  }
  .tabbar {
    display: flex; justify-content: space-around; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1020;
    padding: 8px 6px calc(10px + env(safe-area-inset-bottom)); background: var(--sidebar); border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; min-height: 44px;
    font-size: 12px; font-weight: 600; color: var(--muted); }
  .tabbar a.active { color: var(--accent-ink); }
  .content { padding: 20px 16px calc(80px + env(safe-area-inset-bottom)); }  /* just clears the tab bar */
  .content > :last-child, .content > .row:last-child > [class*="col"] > :last-child { margin-bottom: 0 !important; }
}
.offcanvas.sidebar-sheet { background: var(--sidebar); width: 290px; }
.offcanvas.sidebar-sheet .sidebar { display: flex; position: static; height: auto; min-height: 100%; border: 0; }

/* ---------- Page headers ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.page-header h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin: 0; }
.page-header .eyebrow { font-size: 14px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.page-header .subtitle { color: var(--muted); margin: 6px 0 0; }
.section-title { font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: -0.02em; margin: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head a { font-weight: 600; font-size: 14px; }
.eyebrow-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn { --bs-btn-font-weight: 600; --bs-btn-padding-y: .55rem; --bs-btn-padding-x: 1rem; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 42px; }
.btn-sm { min-height: 36px; --bs-btn-padding-y: .35rem; --bs-btn-padding-x: .8rem; --bs-btn-font-size: .875rem; border-radius: 10px; }
.btn-lg { min-height: 50px; --bs-btn-padding-x: 1.4rem; }
.btn-primary, .btn-dark {
  --bs-btn-color: #fff; --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--accent-ink); --bs-btn-hover-border-color: var(--accent-ink);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #0F3D2F; --bs-btn-active-border-color: #0F3D2F;
  --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent);
}
.btn-accent { --bs-btn-color: #fff; --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--accent-ink); --bs-btn-hover-border-color: var(--accent-ink); }
.btn-light, .btn-outline-secondary, .btn-secondary {
  --bs-btn-color: var(--ink); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--control);
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: #F1F3EF; --bs-btn-hover-border-color: #C8CEC6;
  --bs-btn-active-color: var(--ink); --bs-btn-active-bg: #E8EBE5; --bs-btn-active-border-color: #C8CEC6;
}
.btn-outline-primary { --bs-btn-color: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent); }
.btn-outline-danger, .btn-light.text-danger { --bs-btn-color: #B42318; --bs-btn-border-color: #F0C7C2; --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #B42318; --bs-btn-hover-border-color: #B42318; }
.btn-danger { --bs-btn-bg: #B42318; --bs-btn-border-color: #B42318; --bs-btn-hover-bg: #912018; --bs-btn-hover-border-color: #912018; }
.btn-warn { --bs-btn-color: var(--warn-ink); --bs-btn-bg: #fff; --bs-btn-border-color: #F1D2B8; --bs-btn-hover-color: var(--warn-ink);
  --bs-btn-hover-bg: #FFF8F2; --bs-btn-hover-border-color: #E7BE9C; }
.btn-on-dark { --bs-btn-color: var(--ink); --bs-btn-bg: #fff; --bs-btn-border-color: var(--accent-line);
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: #F7FBF9; --bs-btn-hover-border-color: #B5D5C5; }
.btn-icon { width: 42px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn.is-busy { pointer-events: none; opacity: .75; }

/* ---------- Surfaces ---------- */
.card { --bs-card-border-color: var(--line); --bs-card-border-radius: var(--radius-lg); --bs-card-inner-border-radius: calc(var(--radius-lg) - 1px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: none; }
.card-header { background: transparent; border-bottom: 1px solid var(--line-soft); padding: 16px 20px;
  font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.015em; }
.card-header .small, .card-header a { font-family: var(--font-body); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.card-body { padding: 20px; }
.card-footer { background: transparent; border-top: 1px solid var(--line-soft); }
a.card { color: var(--ink); transition: border-color .15s, transform .15s; }
a.card:hover { border-color: #C8CEC6; color: var(--ink); }

/* "Next up": a soft mint card (class name kept from the first draft) */
.dark-card { background: var(--accent-soft); color: var(--ink); border: 1px solid var(--accent-line); border-radius: var(--radius-lg); }
.dark-card .label { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.dark-card .muted { color: #3D5F50; }

/* "Open dates" summary: a calm card; a small dot is the only colour */
.attention { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.dot-open { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #C2611F; flex: none; }
.attention .dot { width: 8px; height: 8px; border-radius: 50%; background: #C2611F; flex: none; }
.open-list { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.open-list .head { display: flex; align-items: center; gap: 10px; padding: 14px 20px 6px; }
.open-list .row-item { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-soft); }
.open-list .row-item:first-of-type { border-top: 0; }
.open-label { color: var(--muted); font-weight: 500; }
.attention strong { font-weight: 600; }
.attention .grow { flex: 1 1 260px; }

.list-item { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--line-soft); color: var(--ink); min-height: 56px; }
.card > .list-item:first-child, .card-header + .list-item { border-top: 0; }
a.list-item:hover { background: #F8F9F6; color: var(--ink); }

/* ---------- Avatars, swatches, badges ---------- */
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 13px; }
.avatar-sm { width: 26px; height: 26px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar.t1 { background: #DCE8E1; color: #154D3B; } .avatar.t2 { background: #F0E2D3; color: #6E3410; }
.avatar.t3 { background: #E1E6F2; color: #2B4275; } .avatar.t4 { background: #EDE3EF; color: #5B2C66; }
.avatar.t5 { background: #F3EBC9; color: #5E4A0A; } .avatar.t0 { background: #E6EAE6; color: #3F4A44; }
.avatar.me { background: var(--accent); color: #fff; }
.avatar.empty { background: transparent; border: 1.5px dashed #B9C0B8; color: transparent; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.person { display: inline-flex; align-items: center; gap: 10px; }
.rota-dot, .rota-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.rota-swatch.lg { width: 14px; height: 14px; border-radius: 4px; }

.badge { font-weight: 600; border-radius: 999px; padding: .32em .7em; font-size: 12.5px; }
.badge-soft-primary { background: var(--accent-soft); color: var(--accent-ink); }
.badge-soft-success { background: var(--accent-soft); color: var(--accent-ink); }
.badge-soft-warning { background: var(--warn-soft); color: var(--warn); }
.badge-soft-danger { background: #FDECEA; color: #B42318; }
.badge-soft-secondary { background: #EDEFEA; color: #3F4A44; }
.badge-dark { background: var(--ink); color: #fff; }

/* ---------- Segmented tabs (rota pages) ---------- */
.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: #E8EAE5; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
.segmented a { padding: 8px 18px; border-radius: 9px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.segmented a:hover { color: var(--ink); }
.segmented.segmented-sm a, .segmented.segmented-sm button { padding: 5px 14px; font-size: 14px; }
.segmented button { border: 0; background: none; border-radius: 9px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.segmented button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(23, 33, 29, .08); }
.segmented a.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(23, 33, 29, .08); }

.settings-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; }
.settings-pill { padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); }
.settings-pill:hover { color: var(--ink); border-color: var(--control); }
.settings-pill.active { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-line); font-weight: 600; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: 13px 20px; border-bottom-color: var(--line-soft); vertical-align: middle; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: transparent;
  border-bottom-color: var(--line); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table-hover tbody tr:hover { --bs-table-hover-bg: #F8F9F6; --bs-table-bg-state: #F8F9F6; }
.row-link { cursor: pointer; }
.row-link a.row-main, a.row-main { color: inherit; font-weight: 600; }
a.row-main:hover { color: var(--accent-ink); }

/* ---------- Schedule rows (rota page) ---------- */
.month-label { padding: 14px 22px 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
/* Empty places: dashed seats + an action */
.seats { display: inline-flex; gap: 4px; flex: none; }
.seat { width: 30px; height: 30px; border-radius: 50%; border: 1.5px dashed #B9C0B8; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 600; color: var(--muted); box-sizing: border-box; }
.seat.sm { width: 24px; height: 24px; font-size: 10px; }
.seat.lg { width: 40px; height: 40px; font-size: 13px; }
.seat.more { border-style: solid; border-color: var(--line); background: #F6F7F4; }
.add-seats { display: inline-flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; margin: -4px 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; min-height: 40px; }
.add-seats:hover { background: var(--accent-soft); color: var(--accent-ink); }
.add-seats:hover .seat { border-color: var(--accent); }
.add-seats .plus { display: inline-flex; align-items: center; gap: 4px; }
.need-seats { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.dark-card .seat { border-color: #9BBFAE; }
.dark-card .seat.more { background: #fff; border-color: var(--accent-line); }
.dark-card .add-seats:hover { background: #fff; }

/* Text reminders box on the Reminders page */
.texts-box { padding: 14px 16px; border-radius: 14px; background: #F6FAF7; border: 1px solid var(--line-soft); }

/* Swap requests and "you take turns here" */
.swap-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: #E4ECF7; color: #26457A; border: 1px solid #CDDBEE; }
.swap-tag.offered { background: #F5EFDC; color: #5E4A0A; border-color: #E7DCBC; }
.me-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }

/* Invisible jump targets for each place on a date; positioned out of the flex flow so they add no spacing */
.turn-anchors { position: absolute; width: 0; height: 0; overflow: hidden; }
.dark-card, .turn-row { position: relative; scroll-margin-top: 90px; }
.turn-row { display: flex; align-items: center; gap: 16px; padding: 10px 22px; border-top: 1px solid var(--line-soft); min-height: 58px; }
.turn-row .when { width: 104px; flex: none; font-weight: 600; color: var(--ink); }
.turn-row .when:hover { color: var(--accent-ink); }
.turn-row .who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.turn-row .time { min-width: 54px; flex: none; color: var(--muted); font-size: 14px; white-space: nowrap; }
/* People on the same day with different times: each shows their own under their name */
.person-time { display: block; font-size: 12px; line-height: 1.2; color: var(--muted); white-space: nowrap; }
/* Next up with different times: same names and times as the Coming up rows */
.next-main { flex: 1 1 260px; min-width: 0; }  /* stays beside the date box unless the screen is narrow */
/* Next up with different times: even columns, so names and times line up */
.next-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; color: var(--ink); }
.next-people .person { min-width: 0; }
.next-people .person > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-people .person > span { font-weight: 700; }
.next-people .person-time { font-weight: 400; }

.turn-row.cancelled .when, .turn-row.cancelled .who { color: var(--muted); text-decoration: line-through; }
@media (max-width: 575.98px) {
  .turn-row { flex-wrap: wrap; gap: 8px 12px; padding: 12px 16px; }
  .turn-row .when { width: auto; }
  /* date · time · [Edit][Swap] on one line, people underneath */
  .turn-row .time { order: 1; width: auto; min-width: 0; }
  .turn-row .actions { order: 2; margin-left: auto; }
  .turn-row .who { order: 3; flex-basis: 100%; }
}

.date-block { width: 76px; height: 82px; border-radius: 14px; background: #fff; border: 1px solid var(--accent-line); display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1.05; flex: none; }
.date-block .dw { font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--accent-ink); text-transform: uppercase; }
.date-block .dd { font-family: var(--font-display); font-weight: 700; font-size: 34px; color: var(--ink); }
.date-block .dm { font-size: 13px; color: var(--muted); }
.date-chip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 52px; height: 56px;
  border-radius: 12px; background: #EEF0EB; line-height: 1.1; flex-shrink: 0; }
.date-chip .m { font-size: 11px; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.date-chip .d { font-family: var(--font-display); font-size: 20px; font-weight: 700; }

/* ---------- Dashboard ---------- */
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(108px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.day-cell { min-height: 132px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px; }
.day-cell .dh { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.day-cell .dh b { color: var(--ink); font-weight: 600; }
.day-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.day-cell.mine { background: var(--accent-soft); border-color: var(--accent-line); }
.day-cell.mine .dh { color: var(--accent-ink); }
.day-item { display: block; padding: 8px; border-radius: 9px; font-size: 13px; line-height: 1.3; background: var(--accent-soft); color: var(--accent-ink); }
.day-item b { display: block; font-weight: 600; }
.day-item:hover { filter: brightness(.97); color: var(--accent-ink); }
.day-item.gap { background: transparent; border: 1px dashed #C8CEC6; color: var(--muted); }
.day-item.gap b { font-weight: 500; }
.day-item .strip-add { color: var(--accent); font-weight: 600 !important; }
.day-item.me .strip-add { color: var(--accent); }
.day-item.me { background: #fff; color: var(--accent-ink); border: 1px solid var(--accent-line); }
.day-item.more { background: transparent; color: var(--muted); padding: 2px 8px; }

.rota-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.rota-card { display: flex; flex-direction: column; gap: 18px; padding: 20px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--line); color: var(--ink); min-height: 168px; }
.rota-card:hover { border-color: #C8CEC6; color: var(--ink); }
.rota-card .title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; min-width: 0; }
.rota-card .title span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rota-card .next-label { font-size: 13px; color: var(--muted); }
.rota-card .next { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.01em; line-height: 1.25; }
.rota-card .foot span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rota-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--muted); }
.rota-card.add { align-items: center; justify-content: center; gap: 8px; border: 1.5px dashed #C8CEC6; background: transparent; color: var(--ink-2); font-weight: 600; }
.rota-card.add:hover { background: var(--surface); }

/* "Your next turns": two columns, one on phones */
.turns-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 4px 16px 16px; }
.turns-grid .list-item { border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 12px; min-height: 0; }
.turns-grid .list-item:hover { border-color: var(--accent-line); background: #F7FBF9; }
@media (max-width: 575.98px) { .turns-grid { grid-template-columns: 1fr; } }

/* Quick actions on the home page */
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; font-weight: 600; text-align: left; }
.quick:hover { border-color: var(--control); background: #ECEEE9; color: var(--ink); }
.quick svg { flex: none; color: var(--accent); }

/* ---------- Light tints ---------- */
.tint-mint  { --t-bg: #E3EFE9; --t-line: #CFE3D8; --t-ink: #154D3B; }
.tint-peach { --t-bg: #FBEBDD; --t-line: #F1D7BF; --t-ink: #7A3D10; }
.tint-sky   { --t-bg: #E4ECF7; --t-line: #CDDBEE; --t-ink: #26457A; }
.tint-lilac { --t-bg: #EEE7F3; --t-line: #DDD0E8; --t-ink: #5B2C66; }
.tint-sand  { --t-bg: #F5EFDC; --t-line: #E7DCBC; --t-ink: #5E4A0A; }
.tint-rose  { --t-bg: #F8E6EC; --t-line: #EDCFDA; --t-ink: #7A2843; }
.quick[class*="tint-"] { background: var(--t-bg); border-color: var(--t-line); }
.quick[class*="tint-"] svg { color: var(--t-ink); }
.quick[class*="tint-"]:hover { background: #fff; border-color: var(--t-line); }

/* Each turn tile is washed in a light shade of its rota's colour */
.turns-grid .list-item[style*="--tint"] { background: color-mix(in srgb, var(--tint) 9%, white); border-color: color-mix(in srgb, var(--tint) 22%, white); }
.turns-grid .list-item[style*="--tint"] .date-chip { background: #fff; }
.turns-grid .list-item[style*="--tint"]:hover { border-color: color-mix(in srgb, var(--tint) 45%, white); }

/* Welcome screen */
.welcome { background: var(--accent-soft) !important; border-color: var(--accent-line) !important; }
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps-list li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--t-bg); border: 1px solid var(--t-line); color: var(--t-ink); }
.steps-list li strong { color: var(--ink); }
.steps-list .num { width: 30px; height: 30px; flex: none; border-radius: 50%; background: #fff; color: var(--t-ink); display: grid; place-items: center; font-weight: 700; }
.ideas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.idea { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: 14px; background: var(--t-bg); border: 1px solid var(--t-line); color: var(--ink); }
.idea .small { color: var(--t-ink); }
.idea:hover { background: #fff; color: var(--ink); }
.week-strip.ghost .day-cell { background: rgba(255, 255, 255, .55); border-style: dashed; min-height: 96px; }
.week-strip.ghost .day-item { background: var(--accent-soft); opacity: .7; height: 34px; }

/* Rota page: month bands and the coming-up header get a whisper of colour */
.month-label { background: #F6FAF7; border-top: 1px solid var(--line-soft); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 1.4rem; }
.empty-state h6 { font-size: 18px; }
.welcome { padding: clamp(28px, 5vw, 56px); border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.welcome h1, .welcome h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -0.03em; }
.steps-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 26px 0; }
.step-tile { padding: 18px; border-radius: 14px; background: var(--accent-soft); }
.step-tile .num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center;
  font-weight: 600; font-size: 13px; margin-bottom: 10px; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border: 1px solid var(--control); padding: .6rem .85rem; min-height: 44px; color: var(--ink); background-color: #fff; }
textarea.form-control { min-height: 88px; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30, 107, 82, .15); }
.form-control.is-invalid, .form-select.is-invalid { border-color: #B42318; }
.form-label { font-weight: 600; font-size: 14px; margin-bottom: .4rem; }
.form-text { color: var(--muted); font-size: 13px; }
.form-check-input { width: 1.1em; height: 1.1em; border-color: #B9C0B8; }
.form-switch { padding-left: 3.1em; }  /* room for the wider switch so it doesn't touch its label */
.form-switch .form-check-input { width: 2.4em; height: 1.3em; margin-left: -3.1em; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(30, 107, 82, .18); border-color: var(--accent); }
.form-check-label { font-size: 14.5px; }
.form-section { border-top: 1px solid var(--line-soft); padding-top: 22px; margin-top: 22px; }
/* A card that is also a fieldset: keep its heading inside the card, not on the border line */
fieldset.card > legend { float: left; width: 100%; padding: 0; }
fieldset.card > legend + * { clear: both; }
.form-section h6, .form-section-title { font-family: var(--font-display); font-weight: 600; font-size: 17px; margin-bottom: 14px; }
details.more { border-top: 1px solid var(--line-soft); padding-top: 16px; margin-top: 18px; }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--accent-soft); font-weight: 700; }
details.more[open] > summary::before { content: "–"; }
details.more > .more-body { margin-top: 18px; }

ul.weekday-picker { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
ul.weekday-picker li { position: relative; }
ul.weekday-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
ul.weekday-picker label { display: grid; place-items: center; min-width: 48px; height: 44px; padding: 0 10px; border: 1px solid var(--control);
  border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); background: #fff; user-select: none; }
ul.weekday-picker input:checked + label { background: var(--accent); border-color: var(--accent); color: #fff; }
ul.weekday-picker input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-picker input { position: absolute; opacity: 0; }
.color-picker label { width: 32px; height: 32px; border-radius: 9px; cursor: pointer; border: 3px solid transparent; }
.color-picker input:checked + label { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.color-picker input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Sentence-style schedule builder */
.sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 17px; }
.sentence .form-select, .sentence .form-control { width: auto; min-width: 0; background-color: #F7F8F5; font-size: 16px; }
.sentence .grow { flex: 1 1 180px; }

/* Create flow */
.focus-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line); background: var(--sidebar); position: sticky; top: 0; z-index: 1020; }
.stepper { display: flex; align-items: center; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 600; color: var(--muted); }
.stepper li { display: flex; align-items: center; gap: 8px; }
.stepper .n { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #C8CEC6; display: grid; place-items: center; font-size: 13px; }
.stepper li.current { color: var(--ink); }
.stepper li.current .n, .stepper li.done .n { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper .bar { width: 28px; height: 2px; background: var(--control); }
@media (max-width: 640px) { .stepper .label { display: none; } .stepper li.current .label { display: inline; } }
.stepper .label { white-space: nowrap; }
@media (max-width: 575.98px) {
  /* New rota: Cancel on the left, steps on the right, all on one line */
  .focus-spacer { display: none; }
  .stepper { gap: 6px; font-size: 13.5px; }
  .stepper li { gap: 6px; }
  .stepper .n { width: 24px; height: 24px; font-size: 12px; }
  .stepper .bar { width: 14px; }
}
.preview-panel { padding: 22px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-ink); position: sticky; top: 90px; }
.preview-panel .summary { font-family: var(--font-display); font-weight: 600; font-size: 21px; line-height: 1.25; color: var(--ink); margin: 6px 0 12px; }
.preview-panel ul { list-style: none; margin: 0; padding: 0; color: var(--ink); }
.preview-panel li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--accent-line); }
.preview-panel li:last-child { border-bottom: 0; }
.preview-panel .error { color: var(--warn); font-weight: 600; }
.step-pane[hidden] { display: none !important; }

/* ---------- Auth & marketing ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: var(--bg); }
.auth-card { width: 100%; max-width: 440px; min-width: 0; }
.auth-card .card { border-radius: 22px; }
/* ---------- Public home page ---------- */
.landing { background: var(--bg); min-height: 100vh; overflow-x: clip; }  /* the hero blob bleeds past the edge on phones */
.landing-wrap { max-width: 1120px; }
.landing-hero { padding: 2rem 0 4.5rem; }
.hero-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft);
  border: 1px solid var(--accent-line); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.hero-lead { font-size: 18px; line-height: 1.6; color: #3F4A44; max-width: 540px; margin: 0; }
.hero-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; color: var(--ink-2); font-weight: 500; }
.hero-points li { display: flex; align-items: center; gap: 10px; }
.hero-points svg { color: var(--accent); flex: none; }
#signin { scroll-margin-top: 24px; }
.signin-card { max-width: 400px; margin-left: auto; padding: 28px; border-radius: 20px; box-shadow: 0 16px 40px rgba(23, 33, 29, .07); }
.signin-title { font-size: 22px; font-weight: 700; margin: 0 0 2px; }
@media (max-width: 991.98px) { .signin-card { margin: 0 auto; } .landing-hero { padding-bottom: 3rem; } }

/* Public top bar links, help guide, contact cards */
.public-link { color: var(--ink-2); font-weight: 600; }
.public-link:hover, .public-link.active { color: var(--accent-ink); }
.help-toc { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.help-toc a { padding: 8px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
.help-toc a:hover { background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 991.98px) { .help-toc { position: static; flex-direction: row; flex-wrap: wrap; } }
.help-body section { padding: 24px 0; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.help-body section:first-child { border-top: 0; padding-top: 0; }
.help-body h2 { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.help-body li, .help-body p { line-height: 1.65; color: #2F3A34; }
.help-body li { margin-bottom: 8px; }
.day-head, .day-line { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 84px; gap: 8px; align-items: center; }
.day-head { margin-bottom: 4px; }
.day-line { padding: 6px 0; }
.day-line.is-new select { border-style: dashed; }
.day-remove { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; margin: 0; }
@media (max-width: 575.98px) {
  .day-head { display: none; }
  /* person + Remove on one line, from/until (equal widths) on the next */
  .day-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
  .day-line > select { order: 1; flex: 1 1 calc(100% - 100px); min-width: 0; }
  .day-line > .day-remove { order: 2; flex: none; padding-left: 4px; }
  .day-line > input[type="time"] { order: 3; flex: 1 1 calc(50% - 4px); min-width: 0; }
}
/* Summary page */
.sum-toolbar { display: grid; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.sum-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.sum-period { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sum-label { font-size: 20px; font-weight: 700; margin: 0 4px; white-space: nowrap; }
.sum-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 260px; }
.sum-filters .form-select, .sum-filters .form-control { width: auto; min-width: 150px; max-width: 260px; }
.sum-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.sum-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.sum-stat .k { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.sum-stat .v { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--ink); }
.sum-stat .v small { font-size: 16px; margin-left: 2px; color: var(--muted); }
.sum-head, .sum-person summary, .sum-total { display: grid; grid-template-columns: minmax(0, 1fr) 70px 70px 24px; align-items: center; gap: 12px; padding: 12px 20px; }
.sum-person.with-breaks summary, .sum-total.with-breaks, .sum-list:has(.with-breaks) .sum-head { grid-template-columns: minmax(0, 1fr) 70px 70px 70px 24px; }
.sum-head { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.sum-head span:not(:first-child) { text-align: right; }
.sum-person { border-top: 1px solid var(--line-soft); }
.sum-person:first-of-type { border-top: 0; }
.sum-person summary { cursor: pointer; list-style: none; }
.sum-person summary::-webkit-details-marker { display: none; }
.sum-person summary:hover { background: #F7FAF8; }
.sum-person .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sum-person .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-list .num { text-align: right; font-variant-numeric: tabular-nums; }
.sum-list .num.strong { font-weight: 700; }
.sum-list .num.muted { color: var(--muted); }
.sum-person .chev { color: var(--muted); transition: transform .15s; justify-self: end; }
.sum-person[open] .chev { transform: rotate(180deg); }
.sum-lines { list-style: none; margin: 0; padding: 0 20px 12px 62px; }
.sum-lines li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px; padding: 6px 0; font-size: 14px; border-top: 1px dashed var(--line); }
.sum-lines li > span:last-child { text-align: right; color: var(--ink-2); }
.sum-lines .is-break { color: var(--muted); font-style: italic; }
.sum-total { border-top: 1px solid var(--line); font-weight: 700; background: #F7FAF8; border-radius: 0 0 16px 16px; }
.sum-empty { padding: 36px 20px; text-align: center; }
.sum-empty .bi { font-size: 28px; color: var(--muted); display: block; margin-bottom: 8px; }
@media (max-width: 575.98px) {
  .sum-label { font-size: 17px; }
  .sum-stats { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
  .sum-stat { padding: 10px 12px; }
  .sum-stat .k { font-size: 12px; }
  .sum-stat .v { font-size: 22px; }
  .sum-head, .sum-person summary, .sum-total { grid-template-columns: minmax(0, 1fr) 46px 52px 18px; gap: 8px; padding: 12px 14px; }
  .sum-person.with-breaks summary, .sum-total.with-breaks, .sum-list:has(.with-breaks) .sum-head { grid-template-columns: minmax(0, 1fr) 40px 48px 48px 18px; }
  .sum-lines { padding: 0 14px 12px 14px; }
  .sum-filters .form-select, .sum-filters .form-control { min-width: 0; flex: 1 1 140px; max-width: none; }
}
.phone-group .phone-cc { flex: 0 0 auto; width: auto; max-width: 46%; }
.hours-period { display: flex; align-items: center; gap: 12px; }
.hours-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.hours-filter > div { flex: 1 1 160px; }
.hours-person { border-top: 1px solid var(--line); }
.hours-person summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 12px 24px; cursor: pointer; }
.hours-lines { padding: 0 24px 14px; }
.hours-lines li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 12px; padding: 5px 0; border-top: 1px dashed var(--line); }
.hours-lines li > span:last-child { text-align: right; }
.hours-lines .is-break { color: var(--ink-2); font-style: italic; }
@media (max-width: 575.98px) { .hours-person summary { padding: 12px 16px; } .hours-lines { padding: 0 16px 12px; } }
.hours-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hours-tiles .card-body { padding: 14px 16px; }
.hours-num { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.2; }
@media (max-width: 575.98px) { .hours-num { font-size: 22px; } .hours-tiles { gap: 8px; } .hours-tiles .card-body { padding: 10px 12px; } }
.hours-table summary { cursor: pointer; }
.delete-list > li { margin-bottom: 10px; line-height: 1.55; }
.policy table { font-size: 14px; }
.policy th { font-weight: 600; color: var(--ink); }
.policy mark.tbc { background: #FFF1C2; color: #6B4E00; padding: 0 4px; border-radius: 4px; }
/* Privacy policy page: a comfortable reading width, with room between sections. */
.policy-page { max-width: 760px; }
.policy-page section { padding: 28px 0; }
.policy-page section:first-child { padding-top: 16px; }
.policy-page h2 { margin-bottom: 14px; }
.policy-page p { margin-bottom: 12px; }
.policy-page ul { margin-bottom: 14px; padding-left: 1.25rem; }
.policy-page .table-responsive { margin: 6px 0 14px; }
.policy-page .table > :not(caption) > * > * { padding: 8px 10px; }
/* In the sign-up pop-up it's denser, so it fits the dialog. */
.modal .policy section { padding: 12px 0; }
.modal .policy h2 { font-size: 16px; margin-bottom: 6px; }
.modal .policy p, .modal .policy li { font-size: 14px; line-height: 1.45; }
.modal .policy p { margin-bottom: 6px; }
.modal .policy ul { margin-bottom: 6px; padding-left: 1.1rem; }
.modal .policy li { margin-bottom: 2px; }
.modal .policy table { font-size: 13px; margin-bottom: 6px; }
.modal .policy .table > :not(caption) > * > * { padding: 3px 6px; }
.help-body em { font-style: normal; font-weight: 600; color: var(--ink); }
.contact-card { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.contact-card:hover { border-color: var(--accent-line); background: #F7FBF9; color: var(--ink); }

/* Pricing */
.plan { padding: 24px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.plan-main { border-color: var(--accent-line); box-shadow: 0 16px 40px rgba(23, 33, 29, .07); }
.plan-flag { position: absolute; top: -11px; left: 24px; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; }
.plan-name { font-size: 18px; font-weight: 650; margin: 0; }
.plan-price { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 6px 0 4px; }
/* The price sits on its own line; what it covers goes neatly underneath, the same on every card */
.plan-price span { display: block; margin-top: 4px; font-family: var(--font-body); font-size: 14px; font-weight: 500;
  line-height: 1.35; color: var(--muted); letter-spacing: 0; }
.plan-list { list-style: none; padding: 0; margin: 8px 0 18px; display: grid; gap: 8px; font-size: 14.5px; }
.plan-list li { display: flex; gap: 8px; align-items: flex-start; }
.plan-list li::before { content: ""; width: 16px; height: 16px; flex: none; margin-top: 3px; border-radius: 50%; background: var(--accent-soft);
  box-shadow: inset 0 0 0 4px var(--accent-soft), inset 0 0 0 8px var(--accent); }

.section-heading { font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.showcase { padding: 3.5rem 0; border-top: 1px solid var(--line); }
.preview { margin: 0; padding: 18px; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: 0 20px 48px rgba(23, 33, 29, .08); }
.preview-head { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; }
.preview-next { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 16px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.preview-next .label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.preview-next .date-block { width: 64px; height: 70px; }
.preview-next .date-block .dd { font-size: 28px; }
.preview-rows { margin-top: 8px; }
.preview-row { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-top: 1px solid var(--line-soft); }
.preview-row:first-child { border-top: 0; }
.preview-row .when { width: 60px; font-weight: 600; flex: none; }
.fake-btn { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--control);
  background: #fff; font-weight: 600; font-size: 14px; flex: none; }
.fake-btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.away-tag { margin-left: 6px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--t-bg, #E4ECF7); color: #26457A; }
.benefits { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 22px; }
.benefits li { display: flex; gap: 14px; align-items: flex-start; line-height: 1.5; }
.benefits strong { font-size: 16.5px; }
.benefit-icon { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--t-bg); color: var(--t-ink); }
.closing { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 32px; margin: 1rem 0 2.5rem; border-radius: 22px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); }
.closing > :first-child, .closing > p { flex: 1 1 100%; }
@media (min-width: 768px) {
  .closing { display: grid; grid-template-columns: 1fr auto; }
  .closing .section-heading { grid-column: 1; } .closing p { grid-column: 1; } .closing .btn { grid-column: 2; grid-row: 1 / span 2; }
}
.landing-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 20px 0 32px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13.5px; }
.landing-hero h1 { font-size: clamp(2.1rem, 4.4vw, 3rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; }
.tint-primary, .tint-success { background: var(--accent-soft); color: var(--accent-ink); }
.tint-warning { background: var(--warn-soft); color: var(--warn); }
.tint-info { background: #E1E6F2; color: #2B4275; }

/* ---------- Stat cards (admin) ---------- */
.stat-card .stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Calendar ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head { padding: 10px 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 118px; padding: 8px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: #fff; overflow: hidden; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-week .cal-cell { min-height: 340px; }
.cal-cell.out { background: #FAFAF8; }
.cal-cell.out .cal-day { color: #A9B0AA; }
.cal-day { font-size: 13px; font-weight: 600; margin-bottom: 4px; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; }
.cal-cell.today .cal-day { background: var(--accent); color: #fff; }
.cal-event { display: block; font-size: 12.5px; padding: 4px 8px; border-radius: 8px; margin-bottom: 4px; color: var(--ink);
  background: color-mix(in srgb, var(--c) 14%, white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event:hover { background: color-mix(in srgb, var(--c) 24%, white); color: var(--ink); }
.cal-event.unfilled { background: #fff; border: 1px dashed #C8CEC6; color: var(--muted); }
.cal-filter { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.cal-filter.active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
@media (max-width: 767.98px) {
  .cal-month .cal-cell { min-height: 64px; padding: 4px; }
  .cal-month .cal-event { font-size: 0; padding: 0; height: 6px; background: var(--c); margin-bottom: 2px; }
  .cal-month .cal-event.unfilled { background: #C8CEC6; border: 0; }
  .cal-week { grid-template-columns: 1fr; }
  .cal-week .cal-head { display: none; }
  .cal-week .cal-cell { min-height: auto; border-right: 0; }
}

/* ---------- History timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1.1rem 1.75rem; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-soft); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--accent-line); }
pre.audit { font-size: .75rem; background: #FAFAF8; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .75rem; margin: .4rem 0 0; white-space: pre-wrap; max-height: 220px; overflow: auto; }

/* ---------- Toasts, modals, dropdowns, alerts ---------- */
/* Messages appear top right; on phones they sit just below the top bar */
@media (max-width: 991.98px) { .app-toasts { top: 60px !important; left: 0; right: 0; } .app-toasts .toast { width: 100%; } }
.app-toast { min-width: 300px; border-radius: 14px; background: #fff; color: var(--ink); border: 1px solid var(--line) !important; }
.modal-content { border: 0; border-radius: 20px; }
.modal-header, .modal-footer { border: 0; }
.modal-title { font-family: var(--font-display); font-weight: 650; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 12px 32px rgba(23, 33, 29, .12); }
.dropdown-item { border-radius: 9px; padding: 8px 12px; font-weight: 500; }
.dropdown-item:active { background: var(--accent-soft); color: var(--accent-ink); }
.alert { border-radius: 14px; border: 0; }
.alert-info { background: var(--accent-soft); color: var(--accent-ink); }
.alert-warning { background: var(--warn-soft); color: var(--warn-ink); }
.nav-tabs { border-bottom-color: var(--line); }

/* Landing hero: product preview with floating notes */
.hero-visual { position: relative; padding: 28px 8px 34px; }
.hero-blob { position: absolute; inset: 0 -4% 0 6%; border-radius: 36px; background: radial-gradient(120% 90% at 80% 10%, var(--accent-soft) 0%, rgba(255,255,255,0) 70%); z-index: 0; }
.hero-visual .preview { position: relative; z-index: 1; transform: rotate(-1deg); }
.float-chip { position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px 9px 9px; border-radius: 999px; background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 28px rgba(23, 33, 29, .12); font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; animation: chip-float 6s ease-in-out infinite; }
.float-chip.chip-top { top: 0; right: 4%; }
.float-chip.chip-bottom { bottom: 4px; left: -2%; animation-delay: -3s; }
.chip-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; }
.chip-dot.ok { background: var(--accent-soft); color: var(--accent-ink); }
.chip-dot.swap { background: #FCE9DC; color: #8A4A1F; }
@keyframes chip-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .float-chip { animation: none; } }
@media (max-width: 575.98px) { .float-chip.chip-bottom { left: 0; } .hero-visual .preview { transform: none; } }
.benefits-row { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; margin-top: 32px; }
.benefits-row li { flex-direction: column; gap: 12px; padding: 22px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }

/* ---------- Reminder channels (People page): Email, SMS, WhatsApp toggle independently ---------- */
.channel-pick { display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.channel-pick label { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--control); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; user-select: none; white-space: nowrap; }
.channel-pick label:hover { border-color: #C8CEC6; color: var(--ink); }
.channel-pick .btn-check:checked + label { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.channel-pick .btn-check:checked + label::after { content: "\2713"; font-size: 11px; margin-left: 1px; }  /* tick on what's switched on */
.channel-pick .btn-check:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
.channel-pick .btn-check:disabled + label { opacity: .45; cursor: not-allowed; }
@media (max-width: 575.98px) { .channel-pick label { min-height: 34px; } }

/* People list: one compact line per person; on phones the reminder switch drops to a second line */
.person-row { gap: 12px; padding: 8px 20px; min-height: 52px; }
.person-main { flex: 1 1 180px; line-height: 1.3; }
.person-channel { display: flex; align-items: center; gap: 10px; flex: none; margin: 0; }
.person-status { flex: none; width: auto; white-space: nowrap; }
@media (min-width: 768px) { .person-channel { width: 350px; } }  /* same width with or without "Add mobile", so the switches line up */
@media (max-width: 991.98px) { .person-status { display: none; } }
@media (max-width: 767.98px) {
  .person-row { flex-wrap: wrap; padding: 10px 16px; }
  .person-channel { order: 5; flex-basis: 100%; flex-wrap: wrap; row-gap: 6px; }
}
.people-search { position: relative; flex: 0 1 280px; }
.people-search .bi { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.people-search .form-control { min-height: 36px; padding-left: 32px; font-size: 14px; }
@media (max-width: 575.98px) { .people-search { flex-basis: 100%; } }

/* Cookie notice: a small card at the bottom; sits above the phone tab bar when there is one */
.cookie-notice { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1050; max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 30px rgba(23, 33, 29, .14); font-size: 14px; }
.cookie-notice[hidden] { display: none; }
.cookie-notice > .bi { font-size: 22px; color: var(--accent); flex: none; }
.cookie-notice p { flex: 1 1 auto; line-height: 1.45; }
.cookie-notice .flex-none { flex: none; }
@media (max-width: 991.98px) {
  body:has(.tabbar) .cookie-notice { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (max-width: 575.98px) {
  .cookie-notice { flex-wrap: wrap; gap: 10px; }
  .cookie-notice > .bi { display: none; }
  .cookie-notice .flex-none { width: 100%; justify-content: flex-end; }
}
.cookie-cat { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.cookie-cat:first-child { padding-top: 0; }

/* ---------- Phones: less chrome above the content ---------- */
@media (max-width: 575.98px) {
  /* Rota pages: title and actions share a line; Add person shows just its icon */
  .rota-head { flex-wrap: nowrap; align-items: flex-start; gap: 10px; margin-bottom: 14px !important; }
  .rota-head h1 { font-size: 24px; }
  .rota-head .subtitle { font-size: 14px; margin-top: 4px; }
  .rota-actions .btn { padding: 0; width: 40px; height: 40px; display: inline-grid; place-items: center; }
  .rota-add-label { display: none; }
  .rota-head + .segmented { display: flex; width: 100%; }
  .rota-head + .segmented a { flex: 1; text-align: center; padding: 8px 6px; }
  /* Settings tabs: one row that scrolls sideways instead of wrapping onto two */
  .settings-nav { flex-wrap: nowrap; overflow-x: auto; margin: -6px -16px 16px; padding: 6px 16px; scrollbar-width: none; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-pill { flex: none; }

  /* People: the add form folds away until the header's Add person button opens it */
  #add-person.fold-on-phone:not(:target) { display: none; }

  /* Schedule: from / until / starting each get their own row */
  .sentence-times { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; }
  .sentence-times .form-control { width: 100%; }

  /* Home: next 7 days as a list of days instead of seven narrow columns */
  .week-strip:not(.ghost) { display: grid; grid-template-columns: 1fr; gap: 8px; overflow: visible; }
  .week-strip:not(.ghost) .day-cell { min-height: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0 10px; align-items: start; padding-bottom: 6px; }
  .week-strip:not(.ghost) .day-cell .dh { grid-row: 1 / span 9; padding-top: 8px; white-space: nowrap; font-size: 12px; }
  .week-strip:not(.ghost) .day-cell > a { grid-column: 2; margin-bottom: 6px; }  /* no row gap: unused rows would add space */
  .week-strip:not(.ghost) .day-cell:not(.today):not(:has(.day-item)) { display: none; }
  .week-strip:not(.ghost) .day-cell.today:not(:has(.day-item))::after { content: "Nothing today"; grid-column: 2; color: var(--muted); font-size: 14px; padding: 7px 0 6px; }
}

/* Landing page preview card on phones: tighter, and names stay on one line */
@media (max-width: 575.98px) {
  .hero-visual { padding: 28px 0 34px; }
  .preview { padding: 12px; border-radius: 18px; }
  .preview-head { flex-wrap: wrap; row-gap: 2px; padding: 4px 4px 12px; }
  .preview-head .ms-auto { margin-left: 0 !important; flex-basis: 100%; padding-left: 24px; }
  .preview-next { gap: 12px; padding: 12px; }
  .preview-next > .flex-grow-1 { min-width: 0; }
  .preview-next .fw-bold { white-space: nowrap; font-size: 20px !important; }
  .preview-next .small { white-space: nowrap; }
  .preview-next .date-block { width: 56px; height: 64px; }
  .preview-next .fake-btn { padding: 0 12px; }
  .preview-row { gap: 10px; padding: 10px 4px; }
  .preview-row .when { width: 52px; }
  .preview-row .away-tag { white-space: nowrap; }
}

/* ---------- Phones: inside the app, less padding inside cards ---------- */
@media (max-width: 575.98px) {
  .card-body { padding: 16px; }
  .card > .px-4, .card .px-4 { padding-left: 16px !important; padding-right: 16px !important; }
  .card > .pt-4, .card .pt-4 { padding-top: 16px !important; }
  .card .p-4 { padding: 16px !important; }
  .section-title { line-height: 1.25; }
  .form-text, .small, small { line-height: 1.45; }
}
@media (max-width: 575.98px) {
  /* Next up card: lighter padding, date box beside the names instead of above them */
  .dark-card.p-4 { padding: 16px !important; gap: 14px !important; align-items: flex-start !important; }
  .dark-card > .date-block { width: 58px; height: 64px; border-radius: 12px; }
  .dark-card > .date-block .dd { font-size: 24px; }
  .dark-card .next-main { flex: 1 1 0; }
}

/* ==========================================================================
   Homepage and public pages on phones
   One rhythm: 16px side margins; 8 / 12 / 16 / 24 / 32 / 48px vertical steps;
   body copy 16-17px at 1.5; headings tight at 1.1.
   ========================================================================== */
@media (max-width: 575.98px) {
  .landing-wrap { padding-left: 16px; padding-right: 16px; }
  /* one left edge: logo, headline, text and buttons all start at 16px */
  .landing .brand, .topbar .brand { padding-left: 0; }

  /* Hero */
  .landing-hero { padding: 12px 0 48px; --bs-gutter-y: 32px; }
  .landing-hero h1 { font-size: 36px; line-height: 1.05; letter-spacing: -0.035em; margin: 12px 0 16px !important; }
  .hero-pill { font-size: 13px; padding: 5px 12px; }
  .hero-lead { font-size: 16.5px; line-height: 1.65; letter-spacing: 0.005em; color: var(--ink-2); }
  .hero-cta { flex-direction: column; align-items: stretch; gap: 10px !important; margin-top: 24px !important; }
  .hero-cta .btn-lg { width: 100%; padding: 14px 20px; font-size: 17px; border-radius: 14px; }
  .hero-cta .small { text-align: center; font-size: 13.5px; }
  .hero-points { margin-top: 24px; gap: 14px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
  .hero-points li { align-items: flex-start; gap: 12px; }
  .hero-points svg { flex: none; width: 22px; height: 22px; padding: 5px; margin-top: -1px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-ink); }

  /* App preview: no tilt, no blob; chips smaller and kept inside the screen */
  .hero-blob { display: none; }
  .hero-visual { padding: 22px 0 26px; }
  .hero-visual .preview { box-shadow: 0 12px 32px rgba(23, 33, 29, .08); }
  .float-chip { font-size: 13px; padding: 6px 12px 6px 6px; gap: 6px; }
  .float-chip .chip-dot { width: 20px; height: 20px; font-size: 11px; }
  .float-chip.chip-top { right: 12px; }
  .float-chip.chip-bottom { left: 12px; bottom: 0; }

  /* How it works: a full-width white band, left-aligned like the rest of the page */
  .showcase { margin: 0 -16px; padding: 48px 16px; background: var(--surface); border-top: 0;
    border-bottom: 1px solid var(--line); }
  .showcase-head { text-align: left !important; margin: 0 !important; }
  .showcase .section-heading { font-size: 26px; line-height: 1.12; }
  .benefits-row { margin-top: 28px; gap: 24px; }
  .benefits-row li { flex-direction: row; gap: 16px; padding: 0; border: 0; border-radius: 0; background: none; }
  .benefits-row .benefit-icon { width: 40px; height: 40px; border-radius: 12px; }
  .benefits strong { display: block; font-size: 16px; line-height: 1.3; margin-bottom: 4px; }
  .benefits .text-secondary { font-size: 15px; line-height: 1.6; }

  /* Closing call to action: solid green so the page ends on one clear step */
  .closing { margin: 32px 0; padding: 28px 24px; gap: 8px; border: 0; border-radius: 20px; background: var(--accent); }
  .closing .section-heading { color: #fff; font-size: 24px; line-height: 1.15; }
  .closing p { color: rgba(255, 255, 255, .82) !important; font-size: 15.5px; line-height: 1.6; }
  .closing .btn { width: 100%; margin-top: 12px; padding: 14px 20px; font-size: 17px; border-radius: 14px;
    background: #fff; border-color: #fff; color: var(--accent-ink); }
  .closing .btn:hover, .closing .btn:active { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); }

  /* Footer: tagline, then links on an even grid */
  .landing-foot { flex-direction: column; gap: 16px; padding: 24px 0 32px; font-size: 14px; line-height: 1.45; }
  .landing-foot > span:last-child { display: grid !important; grid-template-columns: repeat(3, max-content); gap: 12px 24px !important; }
  .landing-foot > span:last-child > a:last-child { grid-column: 1 / -1; }
}

/* Rota cards on Home: name + people, then the next date as a chip beside who's on */
.rota-card { gap: 14px; min-height: 0; }
.rota-card.add { min-height: 120px; }
.rota-card .title .avatar-stack { flex: none; }
.rota-card .next-row { display: flex; align-items: center; gap: 12px; }
.rota-card .next-row .date-chip { flex: none; width: 48px; height: 52px; }
.rota-card .next-who { font-size: 15.5px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rota-card .next-meta { margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.rota-card .next-meta .gaps { color: var(--warn); font-weight: 600; }
.rota-card .next-open { flex: none; font-size: 14px; font-weight: 600; color: var(--accent); }
.rota-card .next-empty { font-size: 14.5px; color: var(--muted); }

@media (max-width: 575.98px) {
  .section-title { font-size: 18px; }
  .rota-card { gap: 12px; padding: 14px 16px; border-radius: 14px; }
  .rota-card .title { font-size: 16px; }
}

/* ---------- Phones: less on the owner's pages ---------- */
.cal-row { align-items: center; gap: 12px; }
@media (max-width: 575.98px) {
  /* rota pages: the schedule line lives in Settings; keep just the name and actions */
  .rota-head .subtitle { display: none; }
  .rota-head { align-items: center; }
  /* People: when SMS and WhatsApp are off, there's nothing to choose per person */
  .person-channel.texts-off { display: none; }
  /* Calendar: rota filters on one row that scrolls sideways */
  .cal-filters { flex-wrap: nowrap !important; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .cal-filters::-webkit-scrollbar { display: none; }
  .cal-filters .cal-filter { flex: none; }
}

/* Swap icon only shows where the button text is hidden (Next up card on phones) */
.swap-ico { display: none; }
@media (max-width: 575.98px) {
  .dark-card .next-name { font-size: 22px !important; line-height: 1.2 !important; overflow-wrap: anywhere; }
  .next-actions { gap: 6px !important; flex-wrap: nowrap !important; }
  .next-actions .btn { width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; border-radius: 10px; }
  .next-actions .btn .bi { margin: 0 !important; font-size: 15px; }
  .next-actions .btn-label { display: none; }
  .next-actions .swap-ico { display: inline-block; }
  /* one person: name and the two icons share the row */
  .dark-card > .next-actions { align-self: flex-start; }
}
@media (max-width: 575.98px) {
  /* long rota names wrap beside the colour square instead of pushing it onto its own line */
  .rota-head .min-w-0 > .d-flex:first-child { flex-wrap: nowrap !important; align-items: flex-start !important; }
  .rota-head .min-w-0 > .d-flex:first-child > .rota-swatch { margin-top: 8px; }
}

/* Summary toolbar on phones: period tabs, then ‹ month ›, then person + download icons */
@media (max-width: 575.98px) {
  .sum-toolbar { gap: 12px; padding: 12px; border-radius: 14px; }
  .sum-toolbar .sum-row:first-child { gap: 12px; }
  .sum-toolbar .sum-row:first-child > .segmented { order: -1; flex: 1 1 100%; display: flex; }
  .sum-toolbar .sum-row:first-child > .segmented a { flex: 1; text-align: center; padding: 6px 4px; }
  .sum-period { flex: 1 1 100%; justify-content: space-between; }
  .sum-label { font-size: 18px; margin: 0; }
  .sum-period .btn-icon { width: 36px; height: 36px; display: inline-grid; place-items: center; }
  /* the filter form's fields join the row directly: dates fill a line, then person + download icons */
  .sum-toolbar .sum-row:last-child { flex-wrap: wrap; align-items: center; gap: 8px; }
  .sum-filters { display: contents; }
  .sum-filters .form-control[type="date"] { flex: 1 1 calc(50% - 24px); width: auto; min-width: 0; max-width: none; height: 38px; }
  .sum-filters .form-select { flex: 1 1 0; width: auto; max-width: none; min-width: 0; height: 38px; }
  .sum-period:not(:has(.btn-icon)) { justify-content: center; }
  .sum-dl .btn { width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; }
  .sum-dl .btn .bi { margin: 0 !important; font-size: 15px; }
  .sum-dl .btn-label { display: none; }
}

/* ---------- Summary: colour ---------- */
.sum-stat[class*="tint-"] { position: relative; background: var(--t-bg); border-color: var(--t-line); padding-left: 16px; }
.sum-stat[class*="tint-"] .k { color: var(--t-ink); opacity: .85; }
.sum-stat[class*="tint-"] .v { color: var(--t-ink); }
.sum-stat .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 6px;
  background: #fff; color: var(--t-ink); font-size: 15px; }
/* each person's share of the hours, in their avatar colour */
.share { display: block; height: 6px; margin-top: 6px; border-radius: 999px; background: #EEF1EC; overflow: hidden; max-width: 220px; }
.share > span { display: block; height: 100%; border-radius: inherit; min-width: 6px; }
.share.t1 > span { background: #3F8A6C; } .share.t2 > span { background: #D9894A; } .share.t3 > span { background: #5B7BC0; }
.share.t4 > span { background: #9A6AAA; } .share.t5 > span { background: #C9A227; }
.sum-person .who { align-items: center; }
.sum-person .who .name { display: block; }
.sum-total { background: var(--accent-soft); color: var(--accent-ink); }
/* recent changes */
.recent-row { display: flex; gap: 12px; padding: 10px 24px; border-top: 1px solid var(--line-soft); }
.recent-dot { width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.recent-what { font-weight: 600; font-size: 14.5px; line-height: 1.4; }
@media (max-width: 575.98px) {
  .sum-stats { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
  .sum-stat { padding: 12px !important; border-radius: 14px; }
  .sum-stat .ico { width: 26px; height: 26px; font-size: 13px; border-radius: 8px; }
  .sum-stat .k { font-size: 12px; }
  .sum-stat .v { font-size: 22px; }
  .recent-row { padding: 10px 16px; }
  .sum-recent .px-4 { padding-left: 16px !important; padding-right: 16px !important; }
}

/* Summary: the Week / Month / Year / Custom bar in the brand green */
.segmented.sum-periods { background: var(--accent-soft); border: 1px solid var(--accent-line); }
.segmented.sum-periods a { color: var(--accent-ink); }
.segmented.sum-periods a:hover { background: rgba(255, 255, 255, .6); color: var(--accent-ink); }
.segmented.sum-periods a.active { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(21, 77, 59, .25); }
.sum-hint { margin: 0 0 -4px; font-size: 13.5px; line-height: 1.4; color: var(--muted); }

/* Green segmented bar (Summary periods, Calendar views) */
.segmented.seg-green { background: var(--accent-soft); border: 1px solid var(--accent-line); }
.segmented.seg-green a { color: var(--accent-ink); }
.segmented.seg-green a:hover { background: rgba(255, 255, 255, .6); color: var(--accent-ink); }
.segmented.seg-green a.active { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(21, 77, 59, .25); }

/* ---------- Calendar ---------- */
.cal-sync { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 400; color: var(--accent); }
.cal-sync:hover { color: var(--accent-ink); text-decoration: underline; }
.cal-sync .bi { font-size: 13px; vertical-align: -1px; margin: 0 1px; }

.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px; }
.cal-nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cal-title { margin: 0 6px; font-size: 20px; font-weight: 700; white-space: nowrap; }
a.cal-day { color: inherit; }
a.cal-day:hover { background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 767.98px) {
  .cal-toolbar { padding: 12px; }
  .cal-nav { flex: 1 1 100%; }
  .cal-title { flex: 1; text-align: center; font-size: 18px; margin: 0; }
  .cal-nav .btn-icon { width: 36px; height: 36px; display: inline-grid; place-items: center; }
  .cal-today { order: 3; height: 36px; display: inline-flex; align-items: center; }
  .cal-views { flex: 1 1 100%; display: flex; }
  .cal-views a { flex: 1; text-align: center; padding: 6px 4px; }
  /* month grid: the whole cell picks the day; the picked day gets a ring */
  .cal-month .cal-cell { position: relative; }
  .cal-month a.cal-day::after { content: ""; position: absolute; inset: 0; }
  .cal-month a.cal-day.picked { box-shadow: 0 0 0 2px var(--accent); }
  .cal-month .cal-cell.today a.cal-day.picked { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
  .cal-dayview { border-top: 1px solid var(--line); }
}
@media (max-width: 767.98px) { .cal-head { text-align: center; padding: 8px 0; } .cal-month .cal-cell { text-align: center; } .cal-month .cal-cell > .d-flex { justify-content: center; } }
