/* Clocked.
   Three looks, picked per device under My settings (stored as data-theme on <html>):
     pink  – blush ground, rose accent (the default look)
     white – clean white, black accent
     dark  – plum-black, soft rose accent
     auto  – pink by day, dark when the phone is in dark mode
   One narrow column on phones, two columns on wide screens. */
:root {
  --bg: #fbf5f3;
  --bg-2: #f6ece9;
  --surface: #ffffff;
  --ink: #2c2230;
  --muted: #8d7f88;
  --line: #f0e3e2;
  --accent: #c9557d;
  --accent-soft: #fbe6ee;
  --accent-ink: #ffffff;
  --glow: #fbe6ee;
  --on-solid: #ffffff;
  --work: #4f9a78;   --work-bg: #e2f2ea;
  --off: #a48d7b;    --off-bg: #f4ece4;
  --sick: #e06d6d;   --sick-bg: #fde6e4;
  --leave: #8676cf;  --leave-bg: #ece8fb;
  --hol: #c9557d;
  --danger: #c0392b;
  --shadow: 0 1px 2px rgba(90,40,60,.04), 0 12px 32px -12px rgba(150,70,100,.18);
  --shadow-sm: 0 1px 2px rgba(90,40,60,.06), 0 4px 12px -6px rgba(150,70,100,.18);
  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --body: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-lg: 26px;
  --r-md: 18px;
  color-scheme: light;
}
:root[data-theme="white"] {
  --bg: #f7f7f6; --bg-2: #efefee; --surface: #ffffff; --ink: #151515; --muted: #77746f; --line: #ebeae8;
  --accent: #151515; --accent-soft: #efefee; --accent-ink: #ffffff; --glow: transparent; --on-solid: #ffffff;
  --work: #2f8a62; --work-bg: #e3f3eb; --off: #8a8178; --off-bg: #f0eeeb;
  --sick: #d2504d; --sick-bg: #fbe5e3; --leave: #6b5cc4; --leave-bg: #ebe8fa; --hol: #d2504d; --danger: #c0392b;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 28px -14px rgba(0,0,0,.16);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 4px 12px -6px rgba(0,0,0,.14);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1b151c; --bg-2: #342836; --surface: #261e27; --ink: #f6ecef; --muted: #b3a1ab; --line: #3a2e3b;
  --accent: #f08fb0; --accent-soft: #42283a; --accent-ink: #2a1520; --glow: #42283a; --on-solid: #1b151c;
  --work: #7fcda6; --work-bg: #213a2f; --off: #cdb6a3; --off-bg: #3a3029;
  --sick: #f59a96; --sick-bg: #482827; --leave: #b1a5f2; --leave-bg: #2f2a4a; --hol: #f08fb0; --danger: #f5a097;
  --shadow: 0 12px 32px -14px rgba(0,0,0,.6); --shadow-sm: 0 4px 12px -6px rgba(0,0,0,.5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]), :root[data-theme="auto"] {
    --bg: #1b151c; --bg-2: #342836; --surface: #261e27; --ink: #f6ecef; --muted: #b3a1ab; --line: #3a2e3b;
    --accent: #f08fb0; --accent-soft: #42283a; --accent-ink: #2a1520; --glow: #42283a; --on-solid: #1b151c;
    --work: #7fcda6; --work-bg: #213a2f; --off: #cdb6a3; --off-bg: #3a3029;
    --sick: #f59a96; --sick-bg: #482827; --leave: #b1a5f2; --leave-bg: #2f2a4a; --hol: #f08fb0; --danger: #f5a097;
    --shadow: 0 12px 32px -14px rgba(0,0,0,.6); --shadow-sm: 0 4px 12px -6px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
/* Elements with display:flex/grid would otherwise ignore the hidden attribute. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; font-weight: 400;
  background-image: radial-gradient(1200px 500px at 85% -10%, var(--glow), transparent 60%);
  background-repeat: no-repeat;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 600; }
h1 { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 2.6rem; line-height: 1.05; letter-spacing: -.01em; }
h2 { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; letter-spacing: -.005em; }
p { margin: 0; }
.eyebrow { font-size: .7rem; text-transform: uppercase; letter-spacing: .22em; color: var(--muted); font-weight: 500; }
.card { background: var(--surface); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card > h2 { margin-bottom: 14px; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .55; cursor: default; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- Sign-in and setup ---- */
.auth { max-width: 420px; margin: 0 auto; padding-block: 56px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 16px; }
.auth .wordmark { font-size: 3rem; }
.auth .sub { font-size: .7rem; text-transform: uppercase; letter-spacing: .22em; color: var(--muted); margin-top: -6px; }
.lede { color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 16px; }
.alert { background: var(--sick-bg); color: var(--ink); border-radius: 14px; padding: 12px 14px; font-size: .92rem; }

/* ---- App shell ---- */
.wrap { max-width: 1060px; margin: 0 auto; padding-block: 22px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 18px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding-block: 4px 6px; }
.brand { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wordmark { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 2.4rem; line-height: 1; letter-spacing: -.015em; }
.who { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.1rem; flex: none; }
.who-name { color: var(--ink); font-weight: 500; }
@media (max-width: 420px) { .who-name { display: none; } }
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (min-width: 880px) { .cols { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); } }

.viewing { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; }
.viewing label { font-weight: 500; font-size: .9rem; color: var(--muted); }
.viewing select { width: auto; flex: 1; min-width: 0; max-width: 320px; }

/* ---- Today ---- */
.today { display: flex; flex-direction: column; gap: 14px; }
.greet { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--accent); }
.today-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-top: -6px; }
.today-date { font-family: var(--serif); font-size: 1.7rem; font-weight: 500; line-height: 1.15; }
.status-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sbtn { border: 0; border-radius: 999px; padding: 12px 6px; font-weight: 500; font-size: .92rem; min-height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 6px; transition: transform .12s ease, background-color .15s ease, color .15s ease; }
.sbtn:active { transform: scale(.96); }
.sbtn .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sbtn[data-s="work"]  { background: var(--work-bg); }  .sbtn[data-s="work"] .dot  { background: var(--work); }
.sbtn[data-s="off"]   { background: var(--off-bg); }   .sbtn[data-s="off"] .dot   { background: var(--off); }
.sbtn[data-s="sick"]  { background: var(--sick-bg); }  .sbtn[data-s="sick"] .dot  { background: var(--sick); }
.sbtn[data-s="leave"] { background: var(--leave-bg); } .sbtn[data-s="leave"] .dot { background: var(--leave); }
.sbtn.on { color: var(--on-solid); box-shadow: var(--shadow-sm); }
.sbtn.on .dot { background: var(--on-solid) !important; }
.sbtn.on[data-s="work"]  { background: var(--work); }
.sbtn.on[data-s="off"]   { background: var(--off); }
.sbtn.on[data-s="sick"]  { background: var(--sick); }
.sbtn.on[data-s="leave"] { background: var(--leave); }
@media (max-width: 400px) { .sbtn { font-size: .82rem; padding-inline: 4px; } .sbtn .dot { display: none; } }
.linkbtn { background: none; border: 0; color: var(--accent); font-weight: 500; padding: 4px 0; font-size: .9rem; border-bottom: 1px solid currentColor; }
.hint { font-size: .84rem; color: var(--muted); }

/* ---- Calendar ---- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.nav { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--bg-2); font-size: 1.25rem; line-height: 1; flex: none; color: var(--ink); }
.month-name { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; text-align: center; flex: 1; }
.month-name em { font-style: italic; color: var(--muted); font-weight: 400; }
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px 4px; }
.dow { text-align: center; font-size: .66rem; color: var(--muted); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; padding-bottom: 4px; }
.day { aspect-ratio: 1; max-width: 100%; border-radius: 50%; border: 0; background: transparent; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; position: relative;
  font-variant-numeric: tabular-nums; min-width: 0; transition: transform .12s ease; }
.day:active { transform: scale(.94); }
.day .n { font-weight: 500; font-size: .98rem; line-height: 1.1; }
.day .tag { font-size: .55rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; line-height: 1; margin-top: 2px; }
.day .tag:empty { display: none; }
.day.blank { visibility: hidden; }
.day.today-cell { box-shadow: inset 0 0 0 1.5px var(--ink); }
.day.s-work  { background: var(--work-bg); }  .day.s-work .tag  { color: var(--work); }
.day.s-off   { background: var(--off-bg); }   .day.s-off .tag   { color: var(--off); }
.day.s-sick  { background: var(--sick-bg); }  .day.s-sick .tag  { color: var(--sick); }
.day.s-leave { background: var(--leave-bg); } .day.s-leave .tag { color: var(--leave); }
.day .hol { position: absolute; top: 8%; right: 14%; width: 6px; height: 6px; border-radius: 50%; background: var(--hol); }
.day .note-mark { position: absolute; bottom: 4%; font-size: .55rem; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 16px; font-size: .78rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend i.w { background: var(--work); } .legend i.o { background: var(--off); } .legend i.s { background: var(--sick); }
.legend i.l { background: var(--leave); } .legend i.h { background: var(--hol); width: 6px; height: 6px; }

.totals { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; margin-top: 16px; }
.tot { text-align: center; padding: 10px 2px 8px; border-radius: var(--r-md); background: var(--bg); }
.tot b { display: block; font-family: var(--serif); font-size: 1.7rem; font-weight: 500; font-variant-numeric: lining-nums tabular-nums; line-height: 1.1; }
.tot small { font-size: .66rem; color: var(--muted); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.tot.work { background: var(--work-bg); } .tot.work b { color: var(--work); }
.tot.off { background: var(--off-bg); } .tot.off b { color: var(--off); }
.tot.sick { background: var(--sick-bg); } .tot.sick b { color: var(--sick); }
.tot.leave { background: var(--leave-bg); } .tot.leave b { color: var(--leave); }

/* ---- Forms ---- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: .8rem; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
input[type=text], input[type=password], input[type=number], input[type=date], select {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid transparent; border-radius: 14px;
  padding: 12px 14px; width: 100%; min-width: 0; transition: border-color .15s ease, background-color .15s ease; }
input:focus, select:focus { border-color: var(--accent); background: var(--surface); outline: none; }
.row2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.primary { background: var(--ink); color: var(--bg); border: 0; border-radius: 999px; padding: 15px 18px; font-weight: 500; font-size: 1rem;
  letter-spacing: .02em; text-align: center; text-decoration: none; display: block; transition: transform .12s ease, opacity .15s ease; }
.primary:active { transform: scale(.98); }
.primary:hover { opacity: .92; }
.secondary { background: var(--bg-2); color: var(--ink); border: 0; border-radius: 999px; padding: 10px 16px; font-weight: 500; }
.small { padding: 7px 13px; font-size: .84rem; }
.danger { color: var(--danger); }
.msg { font-size: .86rem; color: var(--muted); min-height: 1.2em; }
.msg.err { color: var(--danger); }

/* ---- Team table ---- */
.tablewrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .94rem; }
th, td { padding: 10px 6px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { text-align: left; }
th { font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 500; }
td.w { color: var(--work); font-weight: 600; } td.s { color: var(--sick); } td.l { color: var(--leave); }
tr.sel td { background: var(--accent-soft); }
tr.sel td:first-child { border-radius: 12px 0 0 12px; } tr.sel td:last-child { border-radius: 0 12px 12px 0; }
.namebtn { background: none; border: 0; padding: 0; font-weight: 500; text-align: left; color: var(--ink); }
.namebtn::after { content: " ›"; color: var(--muted); }

/* ---- Staff list ---- */
.staff { display: flex; flex-direction: column; }
.person { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.person-name { font-weight: 500; }
.person-meta { font-size: .82rem; color: var(--muted); }
.pill { font-size: .62rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; padding: 3px 9px; border-radius: 99px; background: var(--off-bg); color: var(--off); vertical-align: 2px; }
.pill.admin { background: var(--accent-soft); color: var(--accent); }
.person-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline input { flex: 1 1 160px; }
details > summary { cursor: pointer; font-family: var(--serif); font-weight: 500; font-size: 1.2rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; font-family: var(--body); font-weight: 300; font-size: 1.4rem; color: var(--muted); }
details[open] > summary::after { content: "–"; }
details[open] > summary { margin-bottom: 14px; }
.staff + details { border-top: 1px solid var(--line); padding-top: 14px; }

/* ---- Day sheet ---- */
.scrim { position: fixed; inset: 0; background: rgba(44,34,48,.38); z-index: 20; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--surface); border-radius: 30px 30px 0 0;
  padding-top: 12px; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
  max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 -16px 40px -12px rgba(60,20,40,.3);
  animation: up .22s cubic-bezier(.2,.8,.2,1); }
.sheet::before { content: ""; width: 40px; height: 4px; border-radius: 4px; background: var(--line); align-self: center; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sbtn, .day, .primary { animation: none; transition: none; } }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sheet-head h2 { font-size: 1.5rem; }
.holname { color: var(--hol); font-size: .85rem; font-weight: 500; margin-top: 2px; }
.holname:empty, .sheet-who:empty { display: none; }
.sheet-who { font-size: .7rem; text-transform: uppercase; letter-spacing: .22em; color: var(--muted); margin-bottom: 2px; }
.sheet-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 10px; }
.sheet-actions .secondary { padding: 15px 12px; }
.close { border: 0; background: var(--bg-2); border-radius: 50%; width: 38px; height: 38px; font-size: 1rem; flex: none; color: var(--ink); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: .9rem; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.toast.err { background: var(--danger); color: #fff; }
.loading { padding: 80px 16px; text-align: center; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 1.2rem; }

/* ---- Clocked. wordmark ---- */
.wordmark .stop { color: var(--accent); font-style: normal; margin-left: .02em; }

/* ---- Google Calendar ---- */
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; }
.gbtn .g { width: 24px; height: 24px; border-radius: 50%; background: var(--bg); color: var(--ink); display: grid; place-items: center;
  font-family: var(--body); font-weight: 600; font-size: .85rem; }
.gconn { display: flex; gap: 12px; align-items: flex-start; }
.okdot { width: 10px; height: 10px; border-radius: 50%; background: var(--work); margin-top: 7px; flex: none; box-shadow: 0 0 0 4px var(--work-bg); }
code.uri { display: block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; background: var(--bg); border-radius: 12px; padding: 10px 12px; overflow-wrap: anywhere; }

/* ---- Google sign-in ---- */
.gsignin { display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--surface); color: var(--ink); text-decoration: none;
  border-radius: 999px; padding: 14px 18px; font-weight: 500; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.gsignin:active { transform: scale(.98); }
.glogo { width: 20px; height: 20px; flex: none; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .78rem; letter-spacing: .08em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.notice { background: var(--work-bg); color: var(--ink); border-radius: 14px; padding: 12px 14px; font-size: .92rem; }
.pill.wait { background: var(--leave-bg); color: var(--leave); }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--leave-bg); border-radius: var(--r-lg); padding: 14px 18px; }
.banner b { font-weight: 600; }
.howto { background: var(--bg); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }

/* ---- Install popup ---- */
.install { position: fixed; z-index: 19; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-width: 400px; margin: 0 auto; background: var(--surface);
  border-radius: 24px; padding: 16px; box-shadow: 0 18px 50px -12px rgba(60,20,40,.35); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; animation: slidein .3s cubic-bezier(.2,.8,.2,1); }
@keyframes slidein { from { transform: translateY(24px); } }
@media (prefers-reduced-motion: reduce) { .install { animation: none; } }
@media (min-width: 880px) { .install { left: auto; right: 24px; bottom: 24px; margin: 0; width: 380px; } }
.install-head { display: flex; align-items: center; gap: 12px; }
.install-head img { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.install-head > div { flex: 1; min-width: 0; }
.install-title { font-family: var(--serif); font-style: italic; font-size: 1.3rem; line-height: 1.1; }
.install-title .stop { color: var(--accent); font-style: normal; }
.install .close { width: 32px; height: 32px; font-size: .85rem; }
.isteps { margin: 0; padding: 12px 14px 12px 32px; background: var(--bg); border-radius: var(--r-md); display: flex; flex-direction: column; gap: 6px; font-size: .92rem; }
.ishare { width: 17px; height: 17px; vertical-align: -3px; color: #0a84ff; }
.install-actions { display: flex; gap: 10px; justify-content: flex-end; }
.install-actions .primary, .install-actions .secondary { padding: 11px 20px; }

/* ---- Roles and pay ---- */
.pill.super { background: var(--ink); color: var(--bg); }
.person-extra { display: flex; gap: 10px 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.person-extra label { display: flex; align-items: center; gap: 8px; }
.person-extra select { width: auto; padding: 7px 10px; font-size: 15px; }
.person-extra input { width: 96px; padding: 7px 10px; font-size: 15px; }
.paystat { border-radius: var(--r-md); padding: 12px 14px; }
.paystat.due { background: var(--sick-bg); }
.paystat.ok { background: var(--work-bg); }
.paylist { display: flex; flex-direction: column; }
.payrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
/* Paid days: a small green ✓ badge on the day's corner */
.day .paid-mark, .paid-key { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  background: var(--work); color: var(--surface); font-size: .62rem; font-weight: 700; line-height: 1; box-shadow: 0 0 0 2px var(--surface); }
.day .paid-mark { position: absolute; top: -5px; left: -5px; width: 15px; height: 15px; font-size: .58rem; }
.paid-key { display: inline-grid; box-shadow: none; }

/* ---- Selecting several days ---- */
.day { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.day.picked { box-shadow: inset 0 0 0 2.5px var(--accent); transform: scale(.94); }
.selhint { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: 12px; }
.selbar { position: fixed; z-index: 22; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-width: 520px; margin: 0 auto; background: var(--surface);
  border-radius: 24px; padding: 14px 16px; box-shadow: 0 18px 50px -12px rgba(60,20,40,.35); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; animation: slidein .25s cubic-bezier(.2,.8,.2,1); }
.selbar-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.selbar .sbtn { min-height: 46px; }
@media (prefers-reduced-motion: reduce) { .selbar { animation: none; } .day.picked { transform: none; } }

/* ---- My settings: theme swatches ---- */
.themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.swatch { border: 2px solid var(--line); background: var(--surface); border-radius: 16px; padding: 8px 6px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .8rem; font-weight: 500; color: var(--ink); }
.swatch[aria-pressed="true"] { border-color: var(--accent); }
.swatch .chip { width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; position: relative; overflow: hidden; border: 1px solid rgba(0,0,0,.06); }
.swatch .chip::after { content: ""; position: absolute; right: 12%; bottom: 18%; width: 22%; aspect-ratio: 1; border-radius: 50%; background: var(--dot); }
.chip.pink { background: linear-gradient(135deg, #fbf5f3 55%, #fbe6ee); --dot: #c9557d; }
.chip.white { background: #ffffff; --dot: #151515; }
.chip.dark { background: linear-gradient(135deg, #261e27 55%, #42283a); --dot: #f08fb0; }
.chip.auto { background: linear-gradient(135deg, #fbf5f3 50%, #261e27 50%); --dot: #c9557d; }
.rate-row { display: flex; gap: 10px; align-items: flex-end; }
.rate-row .field { flex: 1; }

/* ---- Compact header with tabs (phones: ☰ menu) ---- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 15; background: var(--bg); }
.appbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 14; background: var(--bg);
  background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line); }
.appbar-in { max-width: 1060px; margin: 0 auto; padding-block: 10px; display: flex; align-items: center; gap: 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand-sm { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.wordmark-sm { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.6rem; letter-spacing: -.015em; }
.wordmark-sm .stop { color: var(--accent); font-style: normal; }
.brand-sub { font-size: .58rem; text-transform: uppercase; letter-spacing: .22em; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.tabs { display: flex; gap: 2px; margin-left: auto; background: var(--bg-2); padding: 4px; border-radius: 999px; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 8px 16px; border-radius: 999px; font-weight: 500; font-size: .92rem;
  display: inline-flex; align-items: center; gap: 6px; transition: background-color .15s ease, color .15s ease; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.tab .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  font-size: .68rem; font-weight: 600; display: inline-grid; place-items: center; }
.appbar .who { gap: 8px; }
.appbar .avatar { width: 32px; height: 32px; font-size: 1rem; }
.menu-btn { display: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--bg-2); margin-left: auto;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: none; }
.menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .2s ease, opacity .2s ease; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.drawer-scrim { position: fixed; inset: 0; z-index: 12; background: rgba(30,20,30,.25); }
.drawer { position: fixed; z-index: 13; top: calc(env(safe-area-inset-top, 0px) + 66px);
  left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  background: var(--surface); border-radius: 24px; padding: 14px; box-shadow: 0 18px 50px -12px rgba(60,20,40,.35); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; animation: dropin .2s cubic-bezier(.2,.8,.2,1); }
@keyframes dropin { from { transform: translateY(-10px); } }
.drawer-who { display: flex; align-items: center; gap: 12px; padding: 4px 4px 10px; border-bottom: 1px solid var(--line); }
.drawer-tabs { display: flex; flex-direction: column; gap: 2px; }
.drawer-tabs .tab { width: 100%; justify-content: space-between; padding: 14px 14px; font-size: 1.05rem; border-radius: 14px; color: var(--ink); }
.drawer-tabs .tab[aria-current="page"] { background: var(--accent-soft); box-shadow: none; }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drawer-actions .secondary:only-child, .drawer-actions [hidden] + .secondary { grid-column: 1 / -1; }
@media (max-width: 759px) {
  .tabs, .appbar .who { display: none; }
  .menu-btn { display: flex; }
}
@media (min-width: 760px) { .drawer, .drawer-scrim { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } .menu-btn span { transition: none; } }

/* Views: one column on phones, two side by side on wide screens */
.view { display: flex; flex-direction: column; gap: 18px; }
.view .col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (min-width: 880px) { .view.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
@media (min-width: 880px) { .view[data-view="calendar"] { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); } }
.wrap { padding-block: 18px 56px; }

/* ---- Payments mini calendar ---- */
.paycal { background: var(--bg); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.paycal-head { display: flex; align-items: center; justify-content: space-between; }
.paycal-month { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; }
.paycal-month em { font-style: italic; color: var(--muted); font-weight: 400; }
.nav.sm { width: 34px; height: 34px; font-size: 1.05rem; background: var(--surface); }
.paycal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; touch-action: pan-y; }
.pc-dow { text-align: center; font-size: .62rem; font-weight: 600; letter-spacing: .12em; color: var(--muted); padding-bottom: 2px; }
.pc-day { aspect-ratio: 1; max-width: 100%; border-radius: 50%; display: grid; place-items: center; position: relative;
  font-size: .86rem; font-variant-numeric: tabular-nums; color: var(--muted); opacity: .55; border: 0; background: transparent; padding: 0;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pc-day.today { box-shadow: inset 0 0 0 1.5px var(--muted); }
.pc-day.unpaid { opacity: 1; color: var(--work); font-weight: 600; background: var(--work-bg); cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, color .12s ease; }
.pc-day.unpaid:hover { transform: scale(1.06); }
.pc-day.unpaid.on { background: var(--accent); color: var(--accent-ink); transform: scale(1.04); box-shadow: 0 4px 12px -4px var(--accent); }
.pc-day.paid { opacity: .9; color: var(--ink); }
.pc-day.paid i { position: absolute; top: -2px; right: -1px; font-style: normal; font-size: .6rem; font-weight: 700; color: var(--work);
  background: var(--surface); border-radius: 50%; width: 14px; height: 14px; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.paycal-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.paycal-foot .inline { gap: 14px; }
@media (prefers-reduced-motion: reduce) { .pc-day.unpaid { transition: none; } .pc-day.unpaid:hover, .pc-day.unpaid.on { transform: none; } }
