/* ================================================================
   SNKK HQ — design system v2 "the premium one"
   App shell: fixed sidebar (desktop) / bottom tab bar (phones).
   Every color routes through theme tokens; each family member's
   theme restyles the whole shell.
   ================================================================ */

:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #14171f;
  --muted: #6a7180;
  --line: #e8eaf0;
  --accent: #5b6cf0;
  --accent-dark: #4152d9;
  --good: #12915e;
  --bad: #d64545;
  --warn: #e8a33d;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(18, 22, 33, .04), 0 8px 24px rgba(18, 22, 33, .06);
  --shadow-lift: 0 4px 12px rgba(18, 22, 33, .08), 0 20px 44px rgba(18, 22, 33, .14);
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --side-w: 250px;
  --side-bg: linear-gradient(180deg, #14161f 0%, #1c1f2c 60%, #232738 100%);
  --side-ink: #ffffff;
  --side-muted: rgba(255, 255, 255, .58);
  --side-line: rgba(255, 255, 255, .1);
  --side-hover: rgba(255, 255, 255, .07);
  --side-active: rgba(255, 255, 255, .14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------------------------------------------- app shell */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side-w);
  background: var(--side-bg);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  z-index: 40;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 18px;
  text-decoration: none;
  color: var(--side-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -.01em;
}
.brand-icon { font-size: 1.35rem; }
.side-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  padding-bottom: 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--side-muted);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
.nav-item:hover { background: var(--side-hover); color: var(--side-ink); }
.nav-item:active { transform: scale(.97); }
.nav-item.active {
  background: var(--side-active);
  color: var(--side-ink);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09);
}
.nav-icon { width: 26px; text-align: center; font-size: 1.1rem; flex: none; }
.nav-badge {
  margin-left: auto;
  background: var(--bad);
  color: #fff;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 8px;
}
.side-foot {
  border-top: 1px solid var(--side-line);
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.side-user {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--side-ink);
  transition: background .15s ease;
  min-width: 0;
}
.side-user:hover, .side-user.active { background: var(--side-hover); }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  flex: none;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .25);
}
.side-user-meta { min-width: 0; line-height: 1.25; }
.side-user-meta strong { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-meta small { color: var(--side-muted); font-size: .72rem; }
.side-logout {
  color: var(--side-muted);
  text-decoration: none;
  font-size: 1.05rem;
  padding: 9px 11px;
  border-radius: 10px;
  transition: background .15s ease, color .15s ease;
}
.side-logout:hover { background: var(--side-hover); color: var(--side-ink); }

.content { margin-left: var(--side-w); min-width: 0; }
main { max-width: 1040px; margin: 0 auto; padding: 38px 34px 90px; }

/* bottom tab bar — phones only */
.tabbar { display: none; }

/* ---------------------------------------------------- typography */
h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.1rem;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: .1em 0 .35em;
}
h2 { font-size: 1.1rem; margin: .3em 0; font-weight: 700; }
.subhead {
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: .6em;
  margin-top: 2.8em;
}
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.r { text-align: right; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }

/* ---------------------------------------------------- flash */
.flash {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-weight: 500;
  border-left: 4px solid currentColor;
  box-shadow: var(--shadow);
}
.flash.error { background: #fdecec; color: var(--bad); }
.flash.ok { background: #e7f6ef; color: var(--good); }

/* ---------------------------------------------------- cards */
.cards {
  display: grid;
  gap: 18px;
  margin-top: 22px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  text-decoration: none;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .25s ease;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 25%, transparent));
  opacity: 0;
  transition: opacity .25s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.card:hover::after { opacity: 1; }
.card h2 { font-size: .95rem; font-weight: 600; color: var(--muted); margin: 0 0 10px; }
.bignum {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.4rem;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.medtext { font-size: 1.12rem; font-weight: 600; }

/* ---------------------------------------------------- command center (home) */
.cc-hero {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 26px;
  flex-wrap: wrap;
}
.cc-greet { min-width: 0; }

/* weather + UV chip */
.wx {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 18px;
}
.wx-icon { font-size: 2rem; line-height: 1; }
.wx-col { display: flex; flex-direction: column; line-height: 1.35; }
.wx-temp {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.wx-temp small { font-family: var(--font-body); font-size: .85rem; font-weight: 600; color: var(--muted); }
.wx-sub { font-size: .74rem; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.uv-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  border-radius: 14px;
  padding: 7px 13px;
  font-size: .95rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.uv-pill small { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.uv-low     { background: #e3f3e9; color: #1c7c46; }
.uv-mod     { background: #fdf3d9; color: #9c6a1d; }
.uv-high    { background: #fde8d4; color: #b45e14; }
.uv-vhigh   { background: #fbdfdf; color: #c03434; }
.uv-extreme { background: #f3ddf5; color: #8e3a9e; }
.cc-eyebrow {
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 0 0 2px;
}
/* the spotlight — the calendar's answer to "what matters right now" */
.spotlight {
  display: block;
  margin-top: 18px;
  padding: 20px 26px 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(18, 22, 33, .1),
              0 18px 40px color-mix(in srgb, var(--accent) 38%, transparent);
  transition: transform .18s ease, box-shadow .25s ease;
}
.spotlight:hover { transform: translateY(-2px); }
.spotlight.live { outline: 3px solid color-mix(in srgb, #fff 35%, transparent); outline-offset: -3px; }
.sp-label {
  margin: 0 0 8px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
  opacity: .85;
}
.spotlight.live .sp-label { animation: sp-pulse 2s ease infinite; }
@keyframes sp-pulse { 50% { opacity: .5; } }
.sp-main { display: flex; align-items: center; gap: 16px; }
.sp-time {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.9rem;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.sp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sp-title { font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.sp-meta { font-size: .85rem; opacity: .8; }
.sp-count {
  flex: none;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  padding: 6px 16px;
  font-weight: 700;
  font-size: .9rem;
  white-space: nowrap;
}
.sp-leave {
  margin: 12px 0 0;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .14);
  font-size: .9rem;
  font-weight: 500;
}
.spotlight.quiet-day { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.spotlight.quiet-day .sp-meta, .spotlight.quiet-day .sp-label { color: var(--muted); opacity: 1; }

/* briefing columns: attention + week on the left, today on the right */
.cc-cols {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 901px) {
  .cc-cols {
    grid-template-columns: 1fr 1.15fr;
    grid-template-areas: "attn today" "week today";
  }
  .cc-attn { grid-area: attn; }
  .cc-today { grid-area: today; }
  .cc-week { grid-area: week; }
}
.cc-cols .card:hover { transform: none; box-shadow: var(--shadow); }
.cc-cols .card:hover::after { opacity: 0; }

/* attention feed rows */
.att-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px dashed var(--line);
  text-decoration: none;
  color: var(--ink);
  font-size: .92rem;
  border-radius: 8px;
  transition: background .15s ease;
}
.att-row:last-child { border-bottom: none; }
.att-row:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.att-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.att-dot.u0 { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 20%, transparent); }
.att-dot.u1 { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent); }
.att-dot.u2 { background: var(--muted); opacity: .55; }
.att-icon { flex: none; }
.all-clear { color: var(--good); font-weight: 600; margin: 6px 0 2px; }

/* today's timeline states */
.w-row.over { opacity: .45; }
.w-row.over .w-main { text-decoration: line-through; }
.w-row.live { background: color-mix(in srgb, var(--accent) 7%, transparent);
              border-radius: 8px; padding-left: 6px; padding-right: 6px; }
.leave-chip {
  display: inline-block;
  margin-left: 6px;
  background: #eff0f3;
  color: #6d7480;
  border: 1px dashed #c9cdd6;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.w-sub {
  margin: 14px 0 2px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--accent-dark);
}
.w-go.show { opacity: 1; font-size: .82rem; font-weight: 600; text-decoration: none; }
.w-go.show:hover { color: var(--accent-dark); }

@media (max-width: 900px) {
  /* spotlight: time + countdown on the first line, title underneath */
  .sp-main { flex-wrap: wrap; gap: 8px 14px; }
  .sp-time { font-size: 1.55rem; }
  .sp-count { margin-left: auto; }
  .sp-body { flex-basis: 100%; order: 3; }
  /* timeline rows: let the who-list wrap to its own line instead of
     squeezing the event title into a one-word-per-line column */
  .w-row { flex-wrap: wrap; }
  .w-row .w-main { flex: 1 1 60%; }
  .w-row > .muted.small { flex-basis: 100%; padding-left: 72px; }
}

/* quiet footer — everything else in one glance */
.cc-quiet {
  margin: 22px 4px 0;
  display: flex;
  gap: 8px 22px;
  flex-wrap: wrap;
  font-size: .88rem;
}
.cc-quiet a { color: var(--muted); text-decoration: none; font-weight: 600; }
.cc-quiet a:hover { color: var(--ink); }
.w-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.w-head h2 { margin: 0; flex: 1; }
.w-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}
.w-go { color: var(--muted); font-weight: 700; opacity: 0; transition: opacity .2s ease, transform .2s ease; }
.card:hover .w-go { opacity: 1; transform: translateX(2px); color: var(--accent-dark); }
.w-list { display: flex; flex-direction: column; }
.w-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: .92rem;
}
.w-row:last-child { border-bottom: none; }
.w-time {
  flex: none;
  min-width: 62px;
  font-size: .74rem;
  font-weight: 700;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.w-main { flex: 1; font-weight: 500; min-width: 0; }
.w-foot { margin: 10px 0 0; font-size: .88rem; border-top: 1px solid var(--line); padding-top: 10px; }

/* small date pills used on tasks / vehicles / home widgets */
.due-chip {
  flex: none;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: .74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.due-chip.today { background: color-mix(in srgb, var(--warn) 14%, transparent); border-color: var(--warn); color: #9c6a1d; }
.due-chip.overdue { background: color-mix(in srgb, var(--bad) 10%, transparent); border-color: var(--bad); color: var(--bad); }

/* trip countdown pill */
.trip-count {
  align-self: flex-start;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}
.trip-count.now {
  background: color-mix(in srgb, var(--good) 14%, transparent);
  color: var(--good);
}

/* ---------------------------------------------------- forms */
.addform {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin: 20px 0;
}
.addform input, .addform select, .login-box input, .wide-select,
.pagehead input[type="month"], .lb-pay input.amt, .fieldlabel input {
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: var(--font-body);
  background: #fff;
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.addform input { flex: 1; min-width: 130px; }
.addform input.amt { flex: 0 1 110px; min-width: 90px; }
.addform input:focus, .addform select:focus, .login-box input:focus,
.wide-select:focus, .lb-pay input.amt:focus, .fieldlabel input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.checklabel { display: flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); }
.formrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.fieldlabel { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin: 8px 0; }
.fieldlabel input { display: block; width: 100%; margin-top: 4px; }
.formrow .fieldlabel { flex: 1; }
.wide-select { width: 100%; margin-top: 4px; }

.btn {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .93rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  background: var(--line);
  color: var(--ink);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease, background .2s ease, color .2s ease;
}
.btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 1px 2px rgba(18, 22, 33, .12),
              0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent),
              inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn.primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(18, 22, 33, .12),
              0 10px 24px color-mix(in srgb, var(--accent) 45%, transparent),
              inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn.primary:active { transform: scale(.97); filter: brightness(.98); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: color-mix(in srgb, var(--bad) 9%, transparent); color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.btn.wide { width: 100%; }

/* ---------------------------------------------------- login */
.auth-main { max-width: 520px; margin: 0 auto; padding: 8vh 20px 40px; }
body.auth {
  background:
    radial-gradient(1100px 520px at 12% -8%, #e5eaff 0%, transparent 55%),
    radial-gradient(900px 520px at 108% 12%, #ffe9f0 0%, transparent 52%),
    var(--bg);
  min-height: 100vh;
}
.login-box {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow-lift);
  padding: 44px 38px;
  text-align: center;
}
.login-box h1 { font-size: 2.5rem; margin-bottom: 4px; }
.login-box.left { text-align: left; padding: 30px 28px; margin-top: 20px; }
.login-box label { display: block; text-align: left; margin: 16px 0 4px; font-weight: 600; font-size: .88rem; }
.login-box input { width: 100%; margin-top: 4px; }
.login-box .btn { margin-top: 22px; }

/* ---------------------------------------------------- tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  color: var(--muted);
}
tr:last-child td { border-bottom: none; }
table tr { transition: background .15s ease; }
table tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
td code { background: var(--bg); padding: 2px 8px; border-radius: 6px; font-size: .85rem; }
.tag {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: .76rem;
  font-weight: 600;
}

/* ---------------------------------------------------- stats & bars */
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.stat {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat .muted, .stat > span { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.stat strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.inline-stat { padding: 8px 18px; }

.cat-bars {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px;
}
.cat-bar { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.cat-name { flex: 0 0 120px; font-size: .88rem; font-weight: 500; }
.bar-track { flex: 1; background: var(--bg); border-radius: 999px; height: 12px; overflow: hidden; }
.bar {
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  border-radius: 999px;
  height: 12px;
  min-width: 3px;
  box-shadow: 0 1px 4px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: width .4s ease;
}
.cat-amt { flex: 0 0 90px; text-align: right; font-size: .88rem; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------- checklists */
.checklist { list-style: none; padding: 0; margin: 12px 0; }
.checklist li {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  margin-bottom: 9px;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}
.checklist li:hover { transform: translateX(2px); box-shadow: var(--shadow-lift); }
.checklist li.done { opacity: .68; }
.checklist li.done .item-name { text-decoration: line-through; color: var(--muted); }
.checkbox {
  width: 27px;
  height: 27px;
  border-radius: 9px;
  border: 2px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: none;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.checkbox:hover { transform: scale(1.12); border-color: var(--accent); }
.checkbox:active { transform: scale(.9); }
.checklist li.done .checkbox { background: var(--good); border-color: var(--good); }
.item-name { flex: 1; font-size: .98rem; font-weight: 500; }
.pool-amt {
  background: color-mix(in srgb, var(--good) 12%, transparent);
  color: var(--good);
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 12px;
  font-variant-numeric: tabular-nums;
  flex: none;
}

/* ---------------------------------------------------- calendar */
.eventlist { list-style: none; padding: 0; }
.eventlist li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  margin-bottom: 10px;
}
.eventlist.faded li { opacity: .55; }
.event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  border-radius: 12px;
  padding: 8px 14px;
  min-width: 66px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.event-day { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; }
.event-month { font-size: .7rem; color: var(--muted); font-weight: 600; }
.event-body { flex: 1; }
.event-body p { margin: 2px 0 0; }

/* ---------------------------------------------------- week grids */
.weekgrid {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
}
.daycol {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 15px;
}
.daycol h3 {
  margin: 0 0 10px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
}
.planitem {
  background: var(--bg);
  border-radius: 12px;
  padding: 9px 11px;
  margin-bottom: 9px;
  position: relative;
  transition: transform .15s ease, box-shadow .2s ease;
}
.planitem:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.planitem p { margin: 2px 0 0; }
.planitem .inline { position: absolute; top: 5px; right: 7px; }
.planitem .tag { display: inline-block; margin-bottom: 4px; }

/* ---------------------------------------------------- money pages */
.subnav { display: flex; gap: 7px; flex-wrap: wrap; margin: 6px 0 24px; }
.subnav a {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 600;
  transition: all .18s ease;
}
.subnav a:hover { color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow); }
.subnav a.active {
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
}
.badge {
  background: var(--bad);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: .72rem;
  font-weight: 700;
}
.cardgrid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); margin-top: 18px; }
.ccard {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.ccard h2 { margin-top: 0; }
/* compact tables inside cards (vehicle service log) — keep them inside the card */
.ccard table { box-shadow: none; border: 1px solid var(--line); margin: 8px 0; }
.ccard th, .ccard td { padding: 6px 9px; font-size: .82rem; }
.ccard .formrow input { flex: 1; min-width: 0; padding: 8px 10px;
                        border: 1.5px solid var(--line); border-radius: var(--radius-sm);
                        font-size: .88rem; font-family: var(--font-body); }
.ccard .formrow input.amt { flex: 0 1 86px; }
.ccard .formrow input[type="date"] { flex: 0 1 130px; }
.util-track { background: var(--bg); height: 10px; border-radius: 999px; margin-top: 10px; overflow: hidden; }
.util { height: 10px; border-radius: 999px; background: var(--good); }
.util.warn { background: var(--warn); }
.util.high { background: var(--bad); }
.rec {
  margin-top: 12px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}
.recamt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}
.approve-form { display: flex; gap: 6px; align-items: center; }
.approve-form select { max-width: 160px; }

/* ---------------------------------------------------- chores */
.leaderboard { display: flex; gap: 16px; flex-wrap: wrap; margin: 18px 0 6px; }
.lb-card {
  flex: 1 1 210px;
  max-width: 280px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  transition: transform .18s ease, box-shadow .25s ease;
}
.lb-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.lb-card.leader {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(135deg, #f4c95d, #e8a33d 45%, #f8e3ae) border-box;
  box-shadow: 0 4px 10px rgba(18, 22, 33, .06), 0 14px 34px rgba(232, 163, 61, .28);
}
.lb-medal { font-size: 1.6rem; }
.lb-name { font-weight: 700; font-size: 1.05rem; }
.lb-amt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  color: var(--good);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.lb-pay { display: flex; gap: 6px; margin-top: 10px; justify-content: center; }
.lb-pay input.amt { width: 92px; flex: 0 1 auto; min-width: 72px; padding: 7px 10px; font-size: .9rem; }

/* ---------------------------------------------------- accessibility */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ================================================================
   THEMES — accent + page wash + sidebar treatment per person
   ================================================================ */
.theme-classic { --accent: #5b6cf0; --accent-dark: #4152d9; }

.theme-evergreen {
  --accent: #2d6a4f; --accent-dark: #1b4332; --bg: #eef4ef;
  --side-bg: linear-gradient(180deg, #0c211a 0%, #14352a 55%, #1b4332 100%);
  background: linear-gradient(165deg, #dcebe0, #eef4ef 55%, #e2eee7) fixed;
}
.theme-rosegold {
  --accent: #bd6a5e; --accent-dark: #9e5247; --bg: #faf0ec;
  --side-bg: linear-gradient(180deg, #3c1e23 0%, #5c2f36 55%, #8a4a52 100%);
  background: linear-gradient(165deg, #f6ded4, #fbf0eb 55%, #f7e5dc) fixed;
}
.theme-sky {
  --accent: #4a9de0; --accent-dark: #3d8fd1; --bg: #eef6fd;
  --side-bg: linear-gradient(180deg, #d9edfb 0%, #c2e2f9 60%, #aed9f7 100%);
  --side-ink: #0e3f6e;
  --side-muted: rgba(14, 63, 110, .6);
  --side-line: rgba(14, 63, 110, .14);
  --side-hover: rgba(255, 255, 255, .5);
  --side-active: rgba(255, 255, 255, .8);
  background: linear-gradient(165deg, #d3e9fa, #edf6fe 55%, #ddeefc) fixed;
}
.theme-graphite {
  --accent: #c2622e; --accent-dark: #9e4e22; --bg: #eef0f2;
  --side-bg: linear-gradient(180deg, #0e1216 0%, #1c242c 55%, #2b353f 100%);
  background: linear-gradient(165deg, #dfe3e8, #f0f2f4 55%, #e8e5e0) fixed;
}
.theme-royal {
  --accent: #2952cc; --accent-dark: #1f3da3; --bg: #eef1fa;
  --side-bg: linear-gradient(180deg, #0d1740 0%, #16256b 55%, #1f3da3 100%);
  background: linear-gradient(165deg, #d9e1f8, #eef1fb 55%, #e1e7f9) fixed;
}
.theme-plum {
  --accent: #8e4585; --accent-dark: #6e3567; --bg: #f8f0f7;
  --side-bg: linear-gradient(180deg, #260f28 0%, #3d1b3e 55%, #5a2c55 100%);
  background: linear-gradient(165deg, #efdaec, #f9f0f8 55%, #f2e2ef) fixed;
}
.theme-maroon {
  --accent: #8d2235; --accent-dark: #6e1a29; --bg: #f9f0f1;
  --side-bg: linear-gradient(180deg, #2b0007 0%, #4d0d18 55%, #6e1a29 100%);
  background: linear-gradient(165deg, #f4d8dd, #fbeff0 55%, #f6e0e3) fixed;
}

/* ================================================================
   PHONES — hide sidebar, show bottom tab bar
   ================================================================ */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .content { margin-left: 0; }
  main { padding: 22px 16px 110px; }
  h1 { font-size: 1.7rem; }
  .tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--card) 86%, transparent);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-top: 1px solid var(--line);
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    overflow-x: auto;
    gap: 2px;
  }
  .tabbar a {
    flex: 1 0 62px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--muted);
    font-size: .6rem;
    font-weight: 600;
    padding: 5px 3px;
    border-radius: 11px;
    transition: color .15s ease, background .15s ease;
  }
  .tabbar a .nav-icon { font-size: 1.3rem; width: auto; }
  .tabbar a.active {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
  }
  .addform input, .addform select { min-width: 100%; }
  .addform .btn { width: 100%; }
  .cat-name { flex-basis: 90px; }
}


/* ---- recipe book ---- */
/* ===== category color system — drives pills, badges & card glow ===== */
.recipe-card[data-category="Breakfast"], .filter-pill[data-filter="Breakfast"] { --cat:#E8910C; --cat-soft:#FBE7C7; --cat-glow:rgba(232,145,12,.34); }
.recipe-card[data-category="Lunch"],     .filter-pill[data-filter="Lunch"]     { --cat:#1FA055; --cat-soft:#D5F0E0; --cat-glow:rgba(31,160,85,.32); }
.recipe-card[data-category="Dinner"],    .filter-pill[data-filter="Dinner"]    { --cat:#8E44AD; --cat-soft:#EBDBF4; --cat-glow:rgba(142,68,173,.34); }
.recipe-card[data-category="Dessert"],   .filter-pill[data-filter="Dessert"]   { --cat:#E84393; --cat-soft:#FBD9EA; --cat-glow:rgba(232,67,147,.34); }
.recipe-card[data-category="Snack"],      .filter-pill[data-filter="Snack"]     { --cat:#0FA9A0; --cat-soft:#CDEFEC; --cat-glow:rgba(15,169,160,.32); }
.recipe-card[data-category="Drink"],      .filter-pill[data-filter="Drink"]     { --cat:#2E86DE; --cat-soft:#D6E8FA; --cat-glow:rgba(46,134,222,.32); }

/* ===== hero ===== */
.recipe-book { position: relative; }
.rb-hero { text-align: center; margin: 6px 0 26px; }
.rb-eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: .3em;
  font-size: .7rem; font-weight: 700; color: var(--accent); margin-bottom: 10px;
}
.rb-hero h1 {
  font-family: "Fraunces", Georgia, serif; font-weight: 600;
  font-size: 3rem; line-height: 1.02; margin: 0; letter-spacing: -.015em;
}
.rb-hero p { font-style: italic; color: var(--muted); font-size: 1.05rem; margin: 12px 0 0; }
.rb-hero::after {
  content: ""; display: block; width: 56px; height: 3px; border-radius: 3px;
  background: var(--accent); margin: 18px auto 0; opacity: .8;
}

/* add-recipe (collapsible) */
.rb-add {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 4px 18px; margin: 0 auto 22px; max-width: 720px;
}
.rb-add > summary {
  cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none;
  color: var(--accent-dark); user-select: none;
}
.rb-add > summary::-webkit-details-marker { display: none; }
.recipe-form { padding: 4px 0 16px; display: flex; flex-direction: column; gap: 6px; }
.recipe-form .rf-row { display: flex; gap: 12px; flex-wrap: wrap; }
.recipe-form textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: .95rem; font-family: inherit; margin-top: 3px; resize: vertical;
}
.recipe-form input[type="file"] { margin-top: 6px; font-size: .9rem; }
.recipe-form textarea:focus, .recipe-form input:focus,
.recipe-form select:focus { outline: 2px solid var(--accent); border-color: transparent; }
.rf-ai { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }
.recipe-form .btn.primary { align-self: flex-start; }

/* ===== category filter pills ===== */
.filter-bar { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; margin: 6px 0 26px; }
.filter-pill {
  padding: 8px 18px; border-radius: 999px; cursor: pointer; font-size: .9rem; font-weight: 600;
  background: var(--card); color: var(--cat, var(--ink));
  border: 1.5px solid var(--cat-soft, var(--line));
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .2s ease, background .15s ease;
}
.filter-pill:hover { transform: translateY(-1px); border-color: var(--cat, var(--accent)); }
.filter-pill.active {
  background: var(--cat, var(--accent)); color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px var(--cat-glow, rgba(79,109,245,.34));
}
.filter-pill[data-filter="all"] { --cat: var(--accent); --cat-soft: var(--line); --cat-glow: rgba(79,109,245,.32); }

/* ===== recipe cards ===== */
.recipe-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.recipe-card {
  position: relative; background: var(--card); border-radius: 18px;
  box-shadow: 0 1px 3px rgba(31,37,51,.08), 0 0 0 1.5px var(--cat-soft, var(--line));
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .28s ease;
}
.recipe-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px var(--cat-glow, rgba(31,37,51,.16)), 0 0 0 2px var(--cat, var(--accent));
}
.recipe-photo {
  position: relative; height: 200px; background-size: cover; background-position: center;
  background-color: var(--bg); transition: transform .55s cubic-bezier(.2,.6,.2,1);
}
.recipe-card:hover .recipe-photo { transform: scale(1.07); }
.recipe-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.34), rgba(0,0,0,0) 52%);
}
.recipe-photo.placeholder {
  display: flex; align-items: center; justify-content: center; font-size: 3.4rem;
  background: linear-gradient(150deg, var(--cat-soft, var(--bg)), var(--card));
}
.recipe-photo.placeholder::after { display: none; }
.cat-badge {
  position: absolute; top: 13px; left: 13px; z-index: 2;
  background: var(--cat, rgba(0,0,0,.6)); color: #fff;
  padding: 5px 13px; border-radius: 999px; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  box-shadow: 0 3px 10px rgba(0,0,0,.28);
}
.recipe-card[data-category="Breakfast"] .cat-badge::before { content: "🍳 "; }
.recipe-card[data-category="Lunch"]     .cat-badge::before { content: "🥪 "; }
.recipe-card[data-category="Dinner"]    .cat-badge::before { content: "🍝 "; }
.recipe-card[data-category="Dessert"]   .cat-badge::before { content: "🍰 "; }
.recipe-card[data-category="Snack"]     .cat-badge::before { content: "🥨 "; }
.recipe-card[data-category="Drink"]     .cat-badge::before { content: "🥤 "; }
.recipe-body {
  padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px;
  border-top: 3px solid var(--cat, var(--accent));
}
.recipe-body h2 {
  font-family: "Fraunces", Georgia, serif; font-weight: 600;
  margin: 0; font-size: 1.4rem; line-height: 1.18; letter-spacing: -.01em;
}
.recipe-notes { margin: 0; }
.ing-details > summary {
  cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--accent-dark);
  list-style: none; padding: 2px 0;
}
.ing-details > summary::-webkit-details-marker { display: none; }
.ing-list { margin: 6px 0 2px; padding-left: 18px; font-size: .9rem; }
.ing-list li { margin: 2px 0; }
.assign-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px;
               border-top: 1px solid var(--line); padding-top: 12px; }
.assign-form select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
                      font-size: .9rem; background: #fff; flex: 1; min-width: 90px; }
.assign-form .grow { flex: 1; }
.card-tools { display: flex; gap: 6px; align-items: center; }
.card-tools .btn.ghost:hover { color: var(--accent-dark); }

/* inline edit panel — hidden until the card is in edit mode */
.edit-panel { display: none; flex-direction: column; gap: 4px;
              border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; }
.edit-panel textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line);
                       border-radius: 8px; font-size: .9rem; font-family: inherit; resize: vertical; }
.recipe-card.editing .edit-panel { display: flex; }
.recipe-card.editing .assign-form,
.recipe-card.editing .ing-details,
.recipe-card.editing .recipe-notes,
.recipe-card.editing .view-tools { display: none; }

.planthumb { display: block; width: 100%; height: 70px; object-fit: cover; border-radius: 8px; margin: 4px 0; }
.extras { display: grid; gap: 12px; margin-top: 12px;
          grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.extras .planitem { background: var(--card); box-shadow: var(--shadow); }


/* ---------------------------------------------------- calendar v2 */
.cal-nav { display: flex; gap: 8px; align-items: center; }
.cal-nav .btn { padding: 8px 14px; background: var(--card); border: 1px solid var(--line); }
.cal-nav .btn:hover { box-shadow: var(--shadow); }
.cal-month {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  min-width: 168px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.person-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 20px; }
.p-pill {
  --pc: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1.5px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
  transition: all .18s ease;
}
.p-pill .p-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--pc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 22%, transparent);
}
.p-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow); color: var(--ink); }
.p-pill.active {
  border-color: var(--pc);
  color: var(--ink);
  background: color-mix(in srgb, var(--pc) 9%, var(--card));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--pc) 25%, transparent);
}

.cal-add .att-picker {
  flex-basis: 100%;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.att-check { --pc: var(--accent); position: relative; }
.att-check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.att-check span {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  font-size: .84rem;
  font-weight: 600;
  color: var(--muted);
  transition: all .15s ease;
}
.att-check input:checked + span {
  background: color-mix(in srgb, var(--pc) 14%, var(--card));
  border-color: var(--pc);
  color: color-mix(in srgb, var(--pc) 75%, black);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 4px;
}
.cal-head {
  padding: 11px 8px 9px;
  text-align: center;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.cal-cell {
  min-height: 106px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-grid > .cal-cell:nth-last-child(-n+7) { border-bottom: none; }
.cal-cell.other { background: color-mix(in srgb, var(--bg) 60%, var(--card)); }
.cal-cell.other .cal-daynum { opacity: .35; }
.cal-daynum {
  align-self: flex-end;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cal-cell.today { background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.cal-cell.today .cal-daynum {
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 1px 8px;
}

.evt-chip {
  --pc: var(--accent);
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.3;
  padding: 3px 7px;
  border-radius: 7px;
  border-left: 3px solid var(--pc);
  background: color-mix(in srgb, var(--pc) 13%, var(--card));
  color: color-mix(in srgb, var(--pc) 72%, black);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: default;
}
.evt-time { opacity: .75; margin-right: 4px; font-size: .63rem; font-weight: 700; }

.event-people { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 5px; }
.att-name {
  --pc: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
}
.att-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--pc);
  box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--pc) 22%, transparent);
}

@media (max-width: 900px) {
  .cal-cell { min-height: 72px; padding: 4px; }
  .evt-chip { font-size: .58rem; padding: 2px 5px; }
  .evt-time { display: none; }
  .cal-month { min-width: 120px; font-size: 1rem; }
}

/* ---------------------------------------------------- event modal & logistics */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 19, 28, .48);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px;
  overflow-y: auto;
  z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--card);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-lift);
  width: 660px;
  max-width: 100%;
  padding: 26px 30px 24px;
  position: relative;
  animation: modal-in .22s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.modal h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 14px;
}
.modal-close { position: absolute; top: 14px; right: 14px; }
.modal .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.modal .full { grid-column: 1 / -1; }
.modal input:not([type="checkbox"]), .modal select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .93rem;
  font-family: var(--font-body);
  background: #fff;
  margin-top: 4px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.modal input:focus, .modal select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.modal input[type="file"] { padding: 8px; background: var(--bg); border-style: dashed; }
.modal input:disabled { opacity: .45; background: var(--bg); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* grey logistics chips (leave-by & warm-up) */
.evt-chip.ghost {
  --pc: #9aa1ad;
  background: #eff0f3;
  color: #6d7480;
  border-left-style: dashed;
  font-weight: 500;
}
.evt-chip.allday {
  background: var(--pc);
  color: #fff;
  border-left-color: color-mix(in srgb, var(--pc) 60%, black);
}
.logistics { margin: 4px 0 2px; }
.logistics strong { color: var(--ink); }
.event-actions { display: flex; flex-direction: column; gap: 4px; }
.att-file:hover { border-color: var(--accent); color: var(--accent-dark); }

@media (max-width: 900px) {
  .modal .form-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 2vh 10px; }
}

/* the nav-pill rule above must not bleach the primary Add-event button */
.cal-nav .btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  border: none;
  color: #fff;
}

/* ---------------------------------------------------- week & day views */
.view-switch {
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  margin-right: 6px;
}
.view-switch a {
  padding: 6px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
  transition: all .15s ease;
}
.view-switch a.active {
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 35%, transparent);
}

.tg {
  display: grid;
  grid-template-columns: 64px repeat(var(--cols), 1fr);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 4px;
}
.tg-corner, .tg-allday-label { border-right: 1px solid var(--line); }
.tg-allday-label {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  padding: 6px 8px;
  text-align: right;
  border-bottom: 1px solid var(--line);
}
.tg-dayhead {
  text-align: center;
  padding: 10px 6px 8px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: background .15s ease;
}
.tg-dayhead:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.tg-dayhead:last-of-type { border-right: none; }
.tg-dow {
  display: block;
  font-size: .64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}
.tg-dom {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}
.tg-dayhead.today .tg-dom {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 0 9px;
  display: inline-block;
}
.tg-allday {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 26px;
}
.tg-times { position: relative; border-right: 1px solid var(--line); }
.tg-times span {
  position: absolute;
  right: 8px;
  transform: translateY(-55%);
  font-size: .66rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tg-times span:first-child { transform: none; }
.tg-col {
  position: relative;
  border-right: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    to bottom, transparent 0, transparent 47px, var(--line) 47px, var(--line) 48px);
}
.tg-col:last-child { border-right: none; }
.tg-block {
  --pc: var(--accent);
  position: absolute;
  border-radius: 8px;
  border-left: 3px solid var(--pc);
  background: color-mix(in srgb, var(--pc) 16%, var(--card));
  color: color-mix(in srgb, var(--pc) 72%, black);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 3px 7px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(18, 22, 33, .1);
  cursor: default;
  transition: transform .12s ease, box-shadow .15s ease, z-index 0s;
}
.tg-block:hover { transform: scale(1.02); box-shadow: var(--shadow-lift); z-index: 6; }
.tg-block.ghost {
  --pc: #9aa1ad;
  background: #eff0f3;
  color: #6d7480;
  border-left-style: dashed;
  font-weight: 500;
}
.tg-block .tg-time { display: block; font-size: .6rem; font-weight: 700; opacity: .75; }
.tg-now {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #e0342f;
  z-index: 5;
  pointer-events: none;
}
.tg-now::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e0342f;
}

@media (max-width: 900px) {
  .tg { grid-template-columns: 44px repeat(var(--cols), 1fr); }
  .tg-block { font-size: .58rem; padding: 2px 4px; }
  .tg-block .tg-time { display: none; }
  .tg-dom { font-size: 1rem; }
  .view-switch a { padding: 5px 11px; font-size: .8rem; }
}
