/* ============================================================
   THE FRIDGE — Signal v2
   Flat ink on cream. Hairlines, full-bleed edges, no shadows,
   no gradients, no radii. Colour only ever means category.
   Paper (notes) is the one material allowed rotation + shadow.
   ============================================================ */

:root {
  /* core palette — light (cream) */
  --paper:       #FFF4E4;
  --card:        #FFF9EE;
  --ink:         #141210;
  --text:        #141210;
  --text-dim:    #4A423B;
  --label:       #6E6459;
  --muted:       #726859;
  --faint:       #C0B3A1;
  --placeholder: #B0A599;
  --cell:        #FFF4E4;
  --cell-weekend:#F8ECD6;
  --cell-other:  #F6EEDE;
  --rule:        #141210;
  --rule-soft:   rgba(20,18,16,.16);
  --rule-hair:   rgba(20,18,16,.12);
  --edge:        #141210;
  --backdrop:    rgba(20,18,16,.40);
  --gold:        #FFC93C;
  --danger:      #D6335C;
  --occasion:    #A2564E;

  /* category colours — semantics fixed */
  --c-shared:   #FF4D8D;
  --c-work:     #FF8A3D;
  --c-shift:    #00BFA5;
  --c-personal: #FFC53D;
  --c-family:   #8C7BFF;
  --c-holiday:  #38B6E3;
  --c-birthday: #E14EC8;
  --pill-text:  #141210;   /* ink-on-colour, always, all seven */

  /* paper material — deliberately identical in both themes:
     a note stuck on the door is white paper whatever the room is doing */
  --paper-card:    #FFFEF9;
  --paper-ink:     #141210;
  --paper-ink-70:  rgba(20,18,16,.74);
  --paper-ink-55:  rgba(20,18,16,.58);
  --paper-ink-40:  rgba(20,18,16,.42);
  --paper-ink-22:  rgba(20,18,16,.22);
  --paper-shadow:  rgba(20,18,16,.18);
  --paper-lift:    rgba(0,0,0,.45);
  --paper-danger:  #A3261E;

  --hair: 1px;

  --font-display: 'Archivo', sans-serif;   /* 800 only */
  --font-body: 'Outfit', sans-serif;
}

:root[data-theme="dark"] {
  --paper:       #0C0C0F;
  --card:        #141418;
  --ink:         #FFF4E4;
  --text:        #FFF4E4;
  --text-dim:    #B0A597;
  --label:       #8A8279;
  --muted:       #8A8279;
  --faint:       #45454C;
  --placeholder: #57514B;
  --cell:        #16161A;
  --cell-weekend:#1C1C22;
  --cell-other:  #0F0F13;
  --rule:        rgba(255,244,228,.35);
  --rule-soft:   rgba(255,244,228,.14);
  --rule-hair:   rgba(255,244,228,.10);
  --edge:        rgba(255,244,228,.28);
  --backdrop:    rgba(0,0,0,.60);
  --danger:      #FF4D8D;
  --occasion:    #C77FA8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* the `hidden` attribute loses to any display: rule — settle it once, for everything */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
html, body { overscroll-behavior-y: contain; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 16px 190px;
}
@media (min-width: 720px) {
  .app { border-left: var(--hair) solid var(--ink); border-right: var(--hair) solid var(--ink); }
}

button { font-family: inherit; cursor: pointer; color: inherit; background: none; border: none; }

/* invert-on-press replaces v1's shadow press */
.pressable { transition: background .1s, color .1s; }
.pressable:active { background: var(--ink) !important; color: var(--paper) !important; }
.solid-press:active { opacity: .82; }

/* ============ HEADER BLOCK ============ */

.masthead { display: flex; flex-direction: column; gap: 9px; }

.mast-row { display: flex; align-items: center; justify-content: space-between; }

.wordmark {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .30em;
  text-transform: uppercase;
  color: var(--label);
}

.icon-row { display: flex; gap: 6px; }

.icon-btn {
  width: 31px; height: 31px;
  display: grid; place-items: center;
  border: var(--hair) solid var(--edge);
  font-size: .85rem;
  position: relative;
  transition: background .1s, color .1s;
}
.icon-btn::after { content: ""; position: absolute; inset: -7px; } /* ≥44px tap area */
.icon-btn:active { background: var(--ink); color: var(--paper); }

.period-row { display: flex; align-items: flex-end; justify-content: space-between; }

.period-display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 44px;
  line-height: .88;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}
.period-display.range { font-size: 38px; }

.meta-stack { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.meta-stack .meta-year { font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--text); }
.meta-stack .meta-wk { font-size: 9px; font-weight: 700; letter-spacing: .14em; color: var(--label); text-transform: uppercase; }

.greeting {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.3;
}

/* ============ LEGEND BAR (the one ornament + filter row) ============ */

.legend {
  display: flex;
  margin: 10px -16px 0;
}
.legend-seg {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 2px;
  transition: opacity .12s;
  position: relative;
}
.legend-seg::after { content: ""; position: absolute; inset: -13px 0; } /* ≥44px tap area */
.legend-seg .seg-block { height: 7px; background: var(--cat); }
.legend-seg .seg-label {
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--label);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.legend-seg.off { opacity: .3; }
.legend.plain .seg-label { display: none; }
.legend.plain .seg-block { height: 6px; }

/* ============ SPECIAL AREA ============ */

.special-banner {
  margin: 12px -16px 0;
  background: var(--ink);
  padding: 14px 16px;
}
.special-banner .sb-date {
  font-size: 9px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}
.special-banner .sb-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: 23px; text-transform: uppercase;
  color: var(--paper);
  letter-spacing: -0.02em;
}

.note-card {
  margin-top: 12px;
  border: var(--hair) solid var(--ink);
  padding: 13px 14px;
  position: relative;
}
.note-from {
  font-size: 9px; font-weight: 800; letter-spacing: .20em; text-transform: uppercase;
  color: var(--label);
  margin-bottom: 5px;
}
.note-text { font-size: 15px; font-weight: 700; line-height: 1.35; }
.note-actions { display: flex; gap: 7px; margin-top: 10px; }
.note-reply, .note-keep {
  font-size: 10.5px; font-weight: 800; letter-spacing: .10em; text-transform: uppercase;
  padding: 6px 11px;
}
.note-reply { background: var(--ink); color: var(--paper); }
.note-keep { border: var(--hair) solid var(--edge); color: var(--text); }
.note-dismiss {
  position: absolute; top: 8px; right: 10px;
  font-size: 13px; font-weight: 800; color: var(--label);
  padding: 6px;
}

/* ============ COMING UP STRIP ============ */

.coming-up { margin-top: 12px; }
.strip-title {
  font-size: 9px; font-weight: 800; letter-spacing: .20em; text-transform: uppercase;
  color: var(--label);
  margin-bottom: 7px;
}
.strip { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }

.up-card {
  flex: 0 0 128px;
  border: var(--hair) solid var(--ink);
  text-align: left;
  background: transparent;
}
.up-card .up-cap { height: 6px; background: var(--cat, var(--ink)); }
.up-card .up-body { padding: 8px 9px 9px; }
.up-when {
  font-size: 8.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--label);
}
.up-title {
  font-size: 14px; font-weight: 800;
  margin: 3px 0 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.up-meta { font-size: 9.5px; font-weight: 700; color: var(--label); }

.strip-empty { font-size: 12.5px; font-weight: 500; color: var(--placeholder); padding: 2px 0; }

/* ============ MONTH GRID (full-bleed) ============ */

.month-grid {
  margin: 12px -16px 0;
  border-top: var(--hair) solid var(--rule);
}
.dow-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: var(--hair) solid var(--rule);
}
.dow {
  text-align: center;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text);
  padding: 5px 0;
}

.week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: var(--hair) solid var(--rule-soft);
}

.day-cell {
  min-height: 72px;
  padding: 3px 2px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  background: var(--cell);
  border-right: var(--hair) solid var(--rule-hair);
}
.day-cell:nth-child(7n) { border-right: none; }
.day-cell.weekend { background: var(--cell-weekend); }
.day-cell.other { background: var(--cell-other); }
.day-cell.other .day-num { color: var(--faint); }
.day-cell.paintable { cursor: crosshair; }
.day-cell.paint-flash { background: var(--c-shift); }

.cell-top { display: flex; align-items: baseline; justify-content: space-between; gap: 2px; }
.day-num { font-size: 12px; font-weight: 800; letter-spacing: -0.02em; }
.day-tag {
  font-size: 7.5px; font-weight: 800;
  color: var(--occasion);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

.day-cell.today .day-num {
  background: var(--ink);
  color: var(--paper);
  min-width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  padding: 0 3px;
}

.pill {
  display: block;
  width: 100%;
  padding: 1px 3px;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--pill-text);
  background: var(--cat, var(--muted));
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pill-more { font-size: 7.5px; font-weight: 800; color: var(--muted); padding-left: 3px; }


/* month empty state */
.month-grid.dimmed, .legend.dimmed { opacity: .45; }
.legend.dimmed { opacity: .3; }
.empty-card {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(152px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
  background: var(--paper);
  border: var(--hair) solid var(--ink);
  padding: 16px 16px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 30;
}
.empty-kicker { font-size: 9px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--label); }
.empty-head {
  font-family: var(--font-display);
  font-weight: 800; font-size: 21px; line-height: 1.1;
  letter-spacing: -0.03em; text-transform: uppercase;
}
.empty-copy { font-size: 12.5px; font-weight: 500; color: var(--text-dim); }
.empty-actions { display: flex; gap: 7px; margin-top: 4px; }
.empty-actions .primary { background: var(--ink); color: var(--paper); }
.empty-actions button {
  font-size: 11px; font-weight: 800; letter-spacing: .10em; text-transform: uppercase;
  padding: 9px 13px;
  border: var(--hair) solid var(--edge);
}
.empty-actions .primary { border-color: var(--ink); }

/* ============ WEEK VIEW (continuous ruled list) ============ */

.week-list { margin: 12px -16px 0; border-top: var(--hair) solid var(--rule); }

.wday-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
}
.wday-name {
  font-family: var(--font-display);
  font-weight: 800; font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
}
.wday-date { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--label); }
.wday-head.today { background: var(--ink); }
.wday-head.today .wday-name { color: var(--paper); }
.wday-head.today .wday-date { color: #A79C90; }
.wday-hol { margin-left: auto; font-size: 8.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--occasion); }
.wday-head.today .wday-hol { color: var(--gold); }

.ev-row {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  border-top: var(--hair) solid rgba(20,18,16,.08);
}
:root[data-theme="dark"] .ev-row { border-top-color: rgba(255,244,228,.08); }
.ev-spine { width: 7px; align-self: stretch; background: var(--cat, var(--muted)); flex: 0 0 auto; }
.ev-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 6px 12px 6px 10px; }
.ev-time { font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--label); min-width: 44px; text-transform: uppercase; }
.ev-title { font-size: 13px; font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-bell { font-size: 10px; }
.person-badge { font-size: 9.5px; font-weight: 800; color: var(--text); flex: 0 0 auto; }

.wday-empty { display: block; width: 100%; text-align: left; font-size: 11.5px; font-weight: 600; color: var(--placeholder); padding: 6px 14px; }
.wday-block { border-bottom: var(--hair) solid var(--rule-soft); }

/* ============ YEAR VIEW (heat map) ============ */

.year-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 12px 0 0;
}
.mini-month {
  padding: 7px 6px 8px;
  border: var(--hair) solid rgba(20,18,16,.16);
  text-align: left;
}
:root[data-theme="dark"] .mini-month { border-color: rgba(255,244,228,.16); }
.mini-month h4 {
  font-family: var(--font-display);
  font-weight: 800; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.mini-month.current { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 10%, transparent); }
.mini-month.current h4 { color: var(--text); }
.mini-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1.5px; }
.mini-day {
  aspect-ratio: 1;
  display: grid; place-items: center;
  font-size: 6.5px; font-weight: 800;
  color: var(--faint);
}
.mini-day.has { background: var(--cat); color: #141210; }

/* ============ THE DOOR (notes board) ============ */

.door-board {
  margin: 0 -16px;
  padding: 20px 46px 30px 14px; /* right inset keeps notes clear of the handle */
  background: var(--card);
  min-height: 50vh;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 10px;
  align-content: flex-start;
  align-items: flex-start; /* a polaroid must not stretch its row-mates */
  position: relative;
}

/* the door handle — two brackets and a bar, flat ink */
.door-board::before {
  content: "";
  position: absolute;
  top: 34px;
  right: 9px;
  width: 20px;
  height: 9px;
  background: var(--ink);
  box-shadow: 0 196px 0 var(--ink); /* the lower bracket */
}
.door-board::after {
  content: "";
  position: absolute;
  top: 34px;
  right: 17px;
  width: 10px;
  height: 205px;
  background: var(--ink);
  border: var(--hair) solid var(--card);
}

.paper-note {
  padding: 11px 11px 12px;
  /* paper stays paper in both themes — a white note on the enamel */
  background: var(--note-bg, #FFFEF9);
  color: #141210;
  box-shadow: 2px 3px 7px rgba(20,18,16,.18);
  position: relative;
  width: 156px;
}
.paper-note::before {
  content: "";
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 11px; height: 11px;
  border-radius: 50%;      /* the only circle in the app */
  background: #141210;
}
.paper-note .pn-from {
  font-size: 7.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(20,18,16,.6);
  margin-bottom: 4px;
}
.paper-note .pn-text { font-size: 12.5px; font-weight: 700; line-height: 1.3; text-wrap: pretty; }
.paper-note .pn-x {
  position: absolute; top: 4px; right: 6px;
  font-size: 11px; font-weight: 800; color: rgba(20,18,16,.5);
  padding: 4px;
}
.door-empty { font-size: 12.5px; font-weight: 500; color: var(--placeholder); padding: 8px 4px; }

/* ============ PAINT BAR ============ */

.paint-bar {
  margin: 10px -16px 0;
  background: var(--c-shift);
  padding: 11px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.paint-top { display: flex; align-items: center; justify-content: space-between; }
.paint-hint { font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: #0A2E29; }
.paint-done {
  font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  background: var(--ink); color: var(--paper);
  padding: 5px 11px;
}
.paint-opts { display: flex; gap: 6px; }
.paint-opt {
  flex: 1;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 8px 0;
  border: var(--hair) solid #0A2E29;
  color: #0A2E29;
  text-align: center;
}
.paint-opt.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ============ BOTTOM BAR ============ */

.bottombar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  max-width: 1080px;
  margin: 0 auto;
  background: var(--paper);
  border-top: var(--hair) solid var(--rule);
  padding: 11px 16px calc(26px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.stick-btn {
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 12px 0;
}
.bb-nav { display: flex; align-items: center; gap: 10px; }
.nav-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: var(--hair) solid var(--edge);
  font-size: 15px;
  position: relative;
  transition: background .1s, color .1s;
}
.nav-btn::after { content: ""; position: absolute; inset: -6px; }
.nav-btn:active { background: var(--ink); color: var(--paper); }
.bb-period {
  flex: 1;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800; font-size: 13px; letter-spacing: .10em; text-transform: uppercase;
}
.bb-row { display: flex; align-items: center; gap: 14px; }
.tab {
  font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  padding: 8px 0;
  position: relative;
}
.tab::after { content: ""; position: absolute; inset: -8px -5px; }
.tab.active { color: var(--text); box-shadow: 0 2px 0 var(--ink); }
.today-btn {
  margin-left: auto;
  background: var(--ink);
  color: var(--paper);
  font-size: 11.5px; font-weight: 800; letter-spacing: .10em; text-transform: uppercase;
  padding: 8px 13px;
}
.today-btn:active { opacity: .82; }

/* ============ FAB ============ */

.fab {
  position: fixed;
  right: 18px;
  bottom: calc(130px + env(safe-area-inset-bottom));
  width: 64px; height: 56px;
  z-index: 35;
}
.fab span { position: absolute; inset: 4px 3px; width: 58px; height: 48px; }
.pad-back  { background: #38B6E3; transform: rotate(6deg); }
.pad-mid   { background: #FF4D8D; transform: rotate(1deg); }
.pad-front {
  background: #FFC53D;
  transform: rotate(-4deg);
  box-shadow: 3px 4px 10px rgba(20,18,16,.3);
  display: grid; place-items: center;
  color: #141210;
  font-size: 26px; font-weight: 600;
}
.pad-front::before {
  content: "";
  position: absolute;
  top: -5px; left: 50%;
  transform: translateX(-50%);
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #141210;
}
.fab:active .pad-front { transform: rotate(-4deg) scale(1.06); }
.fab[hidden] { display: none; }

/* ============ SHEETS (modals) ============ */

.overlay {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  animation: backdrop-in 180ms both;
}
.overlay[hidden], .paint-bar[hidden], .empty-card[hidden] { display: none; }
@keyframes backdrop-in { from { opacity: 0; } }

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--card);
  border-top: var(--hair) solid var(--ink);
  padding-bottom: 30px;
  animation: sheet-in 180ms cubic-bezier(.2,.9,.3,1) both;
}
@keyframes sheet-in { from { transform: translateY(100%); } }

.sheet-legend { display: flex; height: 5px; }
.sheet-legend span { flex: 1; }

.sheet-body { padding: 15px 16px 0; display: flex; flex-direction: column; gap: 14px; }

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; }
.modal-head h3 {
  font-family: var(--font-display);
  font-weight: 800; font-size: 21px; letter-spacing: .02em; text-transform: uppercase;
}
.sheet-sub {
  font-size: 9.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: var(--label);
  margin-top: 4px;
}
.close-x {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: var(--hair) solid var(--edge);
  font-size: 13px; font-weight: 800;
  position: relative;
}
.close-x::after { content: ""; position: absolute; inset: -7px; }

/* underline fields */
.field { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.field > span {
  font-size: 9px; font-weight: 800; letter-spacing: .20em; text-transform: uppercase;
  color: var(--label);
  margin-bottom: 1px;
}
.field > span em { font-style: normal; letter-spacing: .06em; opacity: .7; }
.field input, .field select {
  font-family: inherit;
  font-weight: 700;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--ink);
  padding: 8px 2px;
  width: 100%;
  outline: none;
  border-radius: 0;
}
.field input[type=text] { font-size: 17px; }
.field input[type=date], .field input[type=time] { font-size: 14px; }
.field input.optional-empty { border-bottom-color: rgba(20,18,16,.22); color: var(--placeholder); }
:root[data-theme="dark"] .field input.optional-empty { border-bottom-color: rgba(255,244,228,.22); }
.field input:user-invalid { border-bottom-color: var(--danger); }
.field-row { display: flex; gap: 12px; }
.field-row .time-field { flex: 0 0 76px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
  border: var(--hair) solid var(--edge);
  color: var(--muted);
  background: transparent;
}
.chip .dot { width: 8px; height: 8px; background: var(--cat); }
.chip.selected {
  background: var(--cat);
  border-color: var(--cat);
  color: #141210;
}
.chip.selected .dot { background: #141210; }

.who-row { display: flex; gap: 6px; flex: 1; }
.who-btn {
  flex: 1;
  padding: 9px 0;
  font-size: 12px; font-weight: 800;
  border: var(--hair) solid var(--edge);
  color: var(--muted);
  text-align: center;
}
.who-btn.selected { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.remind-field select {
  font-size: 12px; font-weight: 700;
  border: var(--hair) solid var(--edge);
  border-bottom: var(--hair) solid var(--edge);
  padding: 9px 10px;
  appearance: none;
  background-image: none;
}

.switch-row { display: flex; align-items: center; gap: 10px; }
.switch {
  width: 36px; height: 20px;
  border: var(--hair) solid var(--edge);
  position: relative;
  flex: 0 0 auto;
}
.switch .knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: var(--muted);
  transition: left .12s, background .12s;
}
.switch.on .knob { left: 18px; background: var(--ink); }
.switch-row label { font-size: 13px; font-weight: 600; color: var(--text-dim); cursor: pointer; }

.notes-field input {
  border: var(--hair) solid rgba(20,18,16,.16);
  border-bottom: var(--hair) solid rgba(20,18,16,.16);
  min-height: 48px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
}
:root[data-theme="dark"] .notes-field input { border-color: rgba(255,244,228,.16); }

.modal-actions { display: flex; gap: 8px; }
.btn-save {
  flex: 1;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 15px 0;
}
.btn-save:active { opacity: .82; }
.btn-save.full { width: 100%; }
.btn-danger {
  width: 60px;
  border: var(--hair) solid rgba(255,77,141,.5);
  color: var(--danger);
  font-size: 13px; font-weight: 800; text-transform: uppercase;
  padding: 15px 0;
}

/* day sheet rows */
.ds-list { border-top: var(--hair) solid var(--ink); margin: 0 -16px; }
.ds-row {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  border-bottom: var(--hair) solid var(--rule-soft);
}
.ds-edge { width: 8px; align-self: stretch; background: var(--cat, var(--muted)); flex: 0 0 auto; }
.ds-main { flex: 1; min-width: 0; padding: 11px 12px; }
.ds-title { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-meta { font-size: 10px; font-weight: 800; letter-spacing: .10em; text-transform: uppercase; color: var(--label); margin-top: 2px; }
.ds-row .person-badge { font-size: 10px; padding-right: 12px; }
.ds-empty { font-size: 12.5px; font-weight: 500; color: var(--placeholder); padding: 12px 0; }
.ds-actions { display: flex; gap: 8px; }
.ds-paint {
  width: 56px;
  border: var(--hair) solid var(--ink);
  font-size: 16px;
  display: grid; place-items: center;
}

/* note composer */
.note-modal textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: transparent;
  border: var(--hair) solid rgba(20,18,16,.16);
  padding: 12px;
  min-height: 90px;
  resize: vertical;
  outline: none;
  border-radius: 0;
}
:root[data-theme="dark"] .note-modal textarea { border-color: rgba(255,244,228,.16); }
.note-modal textarea:focus { border-color: var(--ink); }

/* ============ LOGIN ============ */

.login-overlay {
  background: var(--paper);
  align-items: stretch;
  animation: none;
}
.login-shell {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.login-legend { display: flex; height: 10px; flex: 0 0 auto; }
.login-legend span { flex: 1; }
.login-photo {
  flex: 1 1 auto;
  min-height: 180px;
  background: url('assets/fridge-door.png') center / cover no-repeat;
  position: relative;
}
.login-photo .login-title {
  position: absolute;
  right: 18px; bottom: 14px;
  font-family: var(--font-display);
  font-weight: 800; font-size: 46px; line-height: .9;
  letter-spacing: -0.045em; text-transform: uppercase;
  color: #141210;
  text-align: right;
}
.login-panel {
  flex: 0 0 auto;
  background: var(--paper);
  border-top: var(--hair) solid var(--ink);
  padding: 22px 28px calc(26px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.login-sub {
  font-size: 10px; font-weight: 800; letter-spacing: .26em; text-transform: uppercase;
  color: var(--label);
}
.login-panel .field input { font-size: 17px; font-weight: 700; }
.login-panel .pin-field input {
  font-size: 26px; font-weight: 700; letter-spacing: .5em; text-align: center;
}
.login-persons { display: flex; gap: 8px; }
.login-person {
  flex: 1;
  padding: 13px 0;
  font-size: 12px; font-weight: 800; letter-spacing: .10em; text-transform: uppercase;
  border: var(--hair) solid rgba(20,18,16,.30);
  color: var(--muted);
  text-align: center;
}
:root[data-theme="dark"] .login-person { border-color: rgba(255,244,228,.30); }
.login-person.selected { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.login-err { font-size: 13px; font-weight: 700; color: var(--danger); margin-top: 10px; }

.login-alt {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 16px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--label);
  padding: 8px 0;
}

.reveal-pin {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 52px;
  letter-spacing: .12em;
  margin-top: 8px;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 10px;
}
.reveal-note { font-size: 12.5px; font-weight: 500; color: var(--text-dim); line-height: 1.4; }

.door-foot {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}
.door-foot .df-name {
  font-size: 9px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: var(--label);
}
.door-foot .df-logout {
  font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  border: var(--hair) solid var(--edge);
  color: var(--text);
  padding: 7px 12px;
}
.login-footer {
  text-align: center;
  font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(20,18,16,.30);
}
:root[data-theme="dark"] .login-footer { color: rgba(255,244,228,.30); }

/* ============ TOAST (a note, not a pill) ============ */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(140px + env(safe-area-inset-bottom));
  transform: translateX(-50%) rotate(1.4deg);
  background: var(--gold);
  color: #141210;
  font-size: 11.5px;
  font-weight: 800;
  padding: 8px 14px;
  z-index: 200;
  box-shadow: 2px 3px 7px rgba(20,18,16,.18);
  animation: toast-in 160ms ease-out;
  white-space: nowrap;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(8px) rotate(1.4deg); } }

/* ============ PULL TO REFRESH (square tile) ============ */

.ptr {
  position: fixed;
  top: -56px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 40px;
  border: var(--hair) solid var(--ink);
  background: var(--paper);
  z-index: 90;
  transition: transform .3s cubic-bezier(.2,.9,.3,1);
  pointer-events: none;
  overflow: hidden;
}
.ptr.dragging { transition: none; }
.ptr .ptr-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0%;
  background: var(--ink);
}
.ptr.refreshing { background: var(--ink); }
.ptr.refreshing .ptr-fill { display: none; }
.ptr-sun { display: none; }

/* ============ MOTION (transition-based: degrades to visible) ============ */

.view { transition: opacity 120ms ease-out; }
.view.fade-start { opacity: 0; transition: none; }

.reveal { opacity: 0; transform: translateY(6px); }
.reveal.revealed {
  opacity: 1;
  transform: none;
  transition: opacity 200ms ease-out, transform 200ms ease-out;
  transition-delay: var(--reveal-delay, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  .view, .reveal.revealed, .pressable, .icon-btn, .nav-btn, .switch .knob { transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .modal, .overlay, .toast { animation: none !important; }
}

/* ============ DESKTOP ============ */

@media (min-width: 720px) {
  .day-cell { min-height: 104px; }
  .pill { font-size: 10px; }
  .period-display { font-size: 54px; }
  .empty-card { left: 50%; right: auto; transform: translateX(-50%); width: 480px; }
}


/* ============ THE ADD SHEET IS PAPER (v2.1) ============ */

#eventOverlay { background: rgba(20,18,16,.62); }

#eventOverlay .modal.paper-sheet {
  --sheet-col: #FFC53D;               /* resting state: Personal gold */
  margin: 0 14px 22px;
  width: calc(100% - 28px);
  max-width: 532px;
  background: var(--sheet-col);
  border-top: none;
  transform: rotate(-0.7deg);
  box-shadow: 5px 7px 22px rgba(0,0,0,.45);
  padding-bottom: 20px;
  overflow: visible;
  position: relative;
  color: #141210;                     /* paper doesn't theme */
}
.paper-sheet::before {
  content: "";
  position: absolute;
  top: -9px; left: 50%;
  transform: translateX(-50%);
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #141210;
}
.paper-sheet .sheet-body { padding: 22px 16px 0; gap: 13px; }
.paper-sheet .modal-head h3 { color: #141210; }
.paper-sheet .field > span { color: rgba(20,18,16,.74); }
.paper-sheet .field input, .paper-sheet .field select {
  color: #141210;
  border-bottom-color: #141210;
}
.paper-sheet .field input.optional-empty {
  border-bottom-color: rgba(20,18,16,.34);
  color: rgba(20,18,16,.56);
}
.paper-sheet input::placeholder { color: rgba(20,18,16,.58); }
.paper-sheet .close-x { border-color: rgba(20,18,16,.42); color: #141210; }

/* controls outline in ink-alpha; selected = solid ink (the sheet carries the colour) */
.paper-sheet .chip {
  border-color: rgba(20,18,16,.42);
  color: rgba(20,18,16,.74);
}
.paper-sheet .chip .dot { border: none; }
.paper-sheet .chip.selected {
  background: #141210;
  border-color: #141210;
  color: #FFF4E4;
}
.paper-sheet .chip.selected .dot { background: #FFF4E4; }
.paper-sheet .who-btn { border-color: rgba(20,18,16,.42); color: rgba(20,18,16,.74); }
.paper-sheet .who-btn.selected { background: #141210; border-color: #141210; color: #FFF4E4; }
.paper-sheet .remind-field select { border-color: rgba(20,18,16,.42); }
.paper-sheet .switch { border-color: rgba(20,18,16,.42); }
.paper-sheet .switch .knob { background: rgba(20,18,16,.4); }
.paper-sheet .switch.on .knob { background: #141210; }
.paper-sheet .switch-row label { color: rgba(20,18,16,.74); }

/* notes = ruled lines on the paper, no side borders */
.paper-sheet .notes-field input {
  border: none;
  border-top: 1.5px solid rgba(20,18,16,.22);
  border-bottom: 1.5px solid rgba(20,18,16,.22);
  padding: 10px 2px;
}

.paper-sheet .btn-save { background: #141210; color: #FFF4E4; }
.paper-sheet .btn-danger { border-color: rgba(20,18,16,.42); color: #A3261E; }

/* pinned paper notes inside the day sheet */
.ds-note { margin: 10px 0 2px; width: auto; max-width: 240px; }

/* optional pin-to-day field in the composer */
.note-modal .field { margin-bottom: 12px; }


/* ============ THE MENU ("The lot") + DRAWN MARKS (v2.2) ============ */

.overflow-btn {
  background: var(--ink);
  border-color: var(--ink);
  display: grid;
  place-content: center;
  gap: 3px;
}
.overflow-btn i { display: block; width: 15px; height: 1.5px; background: var(--paper); }

.menu-rows { border-top: var(--hair) solid var(--ink); margin-top: 14px; }
.menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  border-bottom: var(--hair) solid var(--rule-soft);
}
.menu-row .mr-label { font-size: 15px; font-weight: 700; flex: 1; }
.menu-row .mr-side {
  font-size: 10.5px; font-weight: 800; letter-spacing: .10em; text-transform: uppercase;
  color: var(--label);
}
.menu-row .mr-chev { font-size: 16px; font-weight: 800; color: var(--label); }

.menu-foot {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px 26px;
}
.menu-foot span {
  font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--label);
}
.menu-foot .menu-version { color: var(--placeholder); }

/* switch, menu-sized */
.switch.big { width: 44px; height: 24px; }
.switch.big .knob { width: 18px; height: 18px; top: 2px; left: 2px; }
.switch.big.on .knob { left: 22px; background: var(--ink); }
.switch.big.on { background: var(--ink); }
.switch.big.on .knob { background: var(--paper); }

/* theme segmented control */
.seg3 { display: flex; border: var(--hair) solid var(--ink); }
.seg3 button {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 9px;
  color: var(--muted);
}
.seg3 button + button { border-left: var(--hair) solid var(--rule-soft); }
.seg3 button.selected { background: var(--ink); color: var(--paper); }

/* --- tool marks: drawn from the system's own parts, 31×31 boxed --- */

.mark {
  width: 31px; height: 31px;
  border: var(--hair) solid var(--edge);
  position: relative;
  flex: 0 0 auto;
  display: block;
}

/* shift painter: three day cells, first empty */
.mark-paint i { position: absolute; top: 8px; width: 5px; height: 13px; border: 1px solid var(--ink); }
.mark-paint i:nth-child(1) { left: 5px; }
.mark-paint i:nth-child(2) { left: 12px; background: var(--ink); }
.mark-paint i:nth-child(3) { left: 19px; background: var(--ink); }

/* a note on a magnet */
.mark-note::before {
  content: "";
  position: absolute;
  left: 7px; top: 10px;
  width: 15px; height: 12px;
  border: 1px solid var(--ink);
  transform: rotate(-5deg);
}
.mark-note::after {
  content: "";
  position: absolute;
  left: 13px; top: 7px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ink);
}

/* the bell — deliberately literal */
.mark-bell i { position: absolute; }
.mark-bell .b-body {
  left: 9px; top: 8px;
  width: 11px; height: 9px;
  border: 1.5px solid var(--ink);
  border-bottom: none;
  border-radius: 5.5px 5.5px 1px 1px;
}
.mark-bell .b-rim { left: 7px; top: 17px; width: 15px; height: 1.5px; background: var(--ink); }
.mark-bell .b-clapper { left: 13px; top: 19.5px; width: 3px; height: 3px; border-radius: 50%; background: var(--ink); }
.mark-bell .b-cap { left: 13.5px; top: 5.5px; width: 2px; height: 2px; border-radius: 50%; background: var(--ink); }
.mark-bell .b-strike { display: none; }
.mark-bell.muted .b-body, .mark-bell.muted .b-rim, .mark-bell.muted .b-clapper, .mark-bell.muted .b-cap { opacity: .4; }
.mark-bell.muted .b-strike {
  display: block;
  left: 4px; top: 14px;
  width: 22px; height: 1.5px;
  background: var(--ink);
  transform: rotate(-38deg);
}

/* theme: sun with stubs / crescent cut by the background */
.mark-theme .t-core { position: absolute; left: 10px; top: 10px; width: 11px; height: 11px; border-radius: 50%; background: var(--ink); }
.mark-theme .t-cut { display: none; }
.mark-theme.sun .t-core::before, .mark-theme.sun .t-core::after {
  content: "";
  position: absolute;
  background: var(--ink);
}
.mark-theme.sun .t-core::before { left: -5px; top: 4.75px; width: 21px; height: 1.5px; }
.mark-theme.sun .t-core::after { left: 4.75px; top: -5px; width: 1.5px; height: 21px; }
.mark-theme.moon .t-core { left: 8px; top: 8px; width: 15px; height: 15px; }
.mark-theme.moon .t-cut {
  display: block;
  position: absolute;
  left: 14px; top: 7px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--card);
}

/* a padlock */
.mark-lock .l-shackle {
  position: absolute;
  left: 10.5px; top: 6px;
  width: 10px; height: 9px;
  border: 1.5px solid var(--ink);
  border-bottom: none;
  border-radius: 5px 5px 0 0;
}
.mark-lock .l-body { position: absolute; left: 8px; top: 13px; width: 15px; height: 11px; background: var(--ink); }

/* day-sheet paint button hosts the mark without its own box */
.ds-paint .mark { border: none; }


/* ============ POLAROIDS ON THE DOOR ============ */

.door-actions { display: flex; gap: 8px; }
.door-actions[hidden] { display: none; }
.door-actions .stick-btn { flex: 1; }
.photo-btn {
  width: 48px;
  border: var(--hair) solid var(--ink);
  display: grid;
  place-items: center;
}
.mark-polaroid { border: none; width: 22px; height: 22px; }
.mark-polaroid::before {
  content: "";
  position: absolute;
  left: 2px; top: 2px;
  width: 17px; height: 17px;
  border: 1px solid var(--ink);
  transform: rotate(-4deg);
}
.mark-polaroid i {
  position: absolute;
  left: 5px; top: 5px;
  width: 11px; height: 8px;
  background: var(--ink);
  transform: rotate(-4deg);
}

.polaroid {
  /* photo paper — stays photo paper in both themes */
  background: #FDFDF8;
  padding: 6px 6px 5px;
  width: 118px;
  cursor: pointer;
  box-shadow: 2px 3px 7px rgba(20,18,16,.22);
  position: relative;
}
.polaroid::before {
  content: "";
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #141210;
  z-index: 1;
}
.polaroid img {
  display: block;
  width: 106px;
  height: 106px;
  object-fit: cover;
  background: #E8E4DA;
}
.polaroid .pol-caption {
  font-size: 9.5px;
  font-weight: 700;
  color: #141210;
  text-align: center;
  padding: 7px 2px 2px;
  line-height: 1.25;
  min-height: 16px;
  overflow: hidden;
}
.polaroid .pol-from {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(20,18,16,.45);
  text-align: center;
  padding-bottom: 2px;
}
.polaroid .pn-x { color: rgba(20,18,16,.5); }

.polaroid.preview {
  margin: 0 auto 14px;
  transform: rotate(-1.4deg);
  width: 190px;
}
.polaroid.preview img { width: 176px; height: 176px; }


/* ============ PHOTO LIGHTBOX ============ */

.overlay.photo-view {
  align-items: center;
  justify-content: center;
  background: rgba(8,3,10,.72);
}
.photo-view .polaroid.big {
  width: min(86vw, 420px);
  padding: 12px 12px 10px;
  transform: rotate(-0.9deg);
  box-shadow: 6px 9px 26px rgba(0,0,0,.5);
  cursor: default;
}
.photo-view .polaroid.big img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}
.photo-view .polaroid.big .pol-caption { font-size: 14px; padding-top: 10px; }
.photo-view .polaroid.big .pol-from { font-size: 9px; }
.photo-view .pv-actions { display: flex; gap: 8px; margin-top: 10px; }
.photo-view .pv-actions button {
  flex: 1;
  font-size: 10.5px; font-weight: 800; letter-spacing: .10em; text-transform: uppercase;
  padding: 11px 0;
}
.photo-view .pv-close { background: #141210; color: #FFF4E4; }
.photo-view .pv-remove { border: 1px solid rgba(20,18,16,.42); color: #A3261E; }


/* ============ THE TO-DO LIST ============ */

/* drawn mark: a tiny list — two box+line rows */
.mark-list { border: none; width: 22px; height: 22px; }
.mark-list i:nth-child(1) { position: absolute; left: 3px; top: 4px; width: 4px; height: 4px; border: 1px solid var(--ink); }
.mark-list i:nth-child(2) { position: absolute; left: 10px; top: 5.5px; width: 9px; height: 1.5px; background: var(--ink); }
.mark-list i:nth-child(3) { position: absolute; left: 3px; top: 13px; width: 4px; height: 4px; background: var(--ink); }
.mark-list i:nth-child(4) { position: absolute; left: 10px; top: 14.5px; width: 9px; height: 1.5px; background: var(--ink); }

/* compact list pinned on the Door — paper */
.list-card {
  width: 168px;
  background: #FFFEF9;
  color: #141210;
  padding: 12px 12px 10px;
  box-shadow: 2px 3px 7px rgba(20,18,16,.18);
  position: relative;
  cursor: pointer;
}
.list-card::before {
  content: "";
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #141210;
}
.list-card .lc-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 8px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.list-card .lc-row { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.list-card .lc-box { width: 10px; height: 10px; border: 1px solid #141210; flex: 0 0 auto; display: grid; place-items: center; }
.list-card .lc-box.done { background: #141210; }
.list-card .lc-label {
  font-size: 12px; font-weight: 700;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.list-card .lc-label.done { text-decoration: line-through; color: rgba(20,18,16,.45); }
.list-card .lc-foot {
  font-size: 7.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(20,18,16,.6);
  margin-top: 9px;
}
.list-card .lc-empty { font-size: 12px; font-weight: 700; color: rgba(20,18,16,.55); padding: 2px 0 4px; }

/* the list open — a paper sheet (white paper, unlike the gold event sheet) */
.list-sheet { --sheet-col: #FFFEF9; }
.list-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: 23px; letter-spacing: -0.02em; text-transform: uppercase;
  color: #141210;
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  padding: 0;
}
.list-title:focus { border-bottom: 1.5px solid rgba(20,18,16,.34); }
.list-sheet .sheet-sub { color: rgba(20,18,16,.6); }

.list-items { display: flex; flex-direction: column; }
.li-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 11px 2px;
  border-bottom: 1px solid rgba(20,18,16,.12);
}
.li-box { width: 18px; height: 18px; border: 1px solid #141210; flex: 0 0 auto; display: grid; place-items: center; }
.li-box.done { background: #141210; }
.li-label { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-label.done { text-decoration: line-through; color: rgba(20,18,16,.45); }
.li-by { font-size: 9.5px; font-weight: 800; letter-spacing: .10em; color: rgba(20,18,16,.55); }
.li-empty { font-size: 15px; font-weight: 700; color: rgba(20,18,16,.55); padding: 14px 2px; }

.list-add { display: flex; align-items: center; gap: 11px; padding: 12px 2px 0; }
.list-add .la-box {
  width: 18px; height: 18px;
  border: 1px dashed rgba(20,18,16,.34);
  flex: 0 0 auto;
  display: grid; place-items: center;
}
.list-add input {
  flex: 1;
  font-family: inherit;
  font-size: 15px; font-weight: 700;
  color: #141210;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(20,18,16,.22);
  padding: 2px 2px 7px;
  outline: none;
  border-radius: 0;
}
.list-add input::placeholder { color: #B0A599; font-weight: 600; }
.list-add input:focus { border-bottom-color: #141210; }

.list-clear {
  border: 1px solid rgba(20,18,16,.42);
  color: #141210;
  font-size: 10.5px; font-weight: 800; letter-spacing: .10em; text-transform: uppercase;
  padding: 12px 16px;
}


/* ============================================================
   PASSKEYS (v2.3) — welcome, join, claim, recovery
   ============================================================ */

/* a phase is a stack; the login panel's own gap sits between phases */
.phase { display: flex; flex-direction: column; gap: 16px; }

.login-h {
  font-family: var(--font-display);
  font-weight: 800; font-size: 23px; line-height: 1.05;
  letter-spacing: -0.03em; text-transform: uppercase;
  color: var(--text);
}
.login-copy {
  font-size: 12.5px; font-weight: 500; line-height: 1.45;
  color: var(--text-dim);
  margin-top: 6px;
}
.login-hint {
  font-size: 9.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: var(--label);
  margin-top: 8px;
  text-align: center;
}
.login-links { display: flex; flex-direction: column; }
.login-links .login-alt { margin-top: 4px; }

/* the quiet twin of .btn-save */
.btn-outline {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  border: var(--hair) solid var(--edge);
  color: var(--text);
  background: transparent;
  font-family: inherit;
  font-size: 15px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 14px 0;
}
.btn-outline:active { background: var(--ink); color: var(--paper); }

/* ---- "we've moved": a note pinned to the door, legacy domain only ---- */

.moved-note {
  position: absolute;
  top: 16px; left: 14px;
  width: 178px;
  padding: 11px 11px 12px;
  background: var(--paper-card);
  color: var(--paper-ink);
  box-shadow: 2px 3px 7px var(--paper-shadow);
  transform: rotate(-1.8deg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.moved-note::before {
  content: "";
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 11px; height: 11px;
  border-radius: 50%;              /* ink magnet */
  background: var(--paper-ink);
}
.moved-note .mn-kicker {
  font-size: 7.5px; font-weight: 800; letter-spacing: .20em; text-transform: uppercase;
  color: var(--paper-ink-55);
}
.moved-note .mn-text { font-size: 12px; font-weight: 700; line-height: 1.3; }
.moved-note .mn-link {
  font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--paper-ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--paper-ink);
  align-self: flex-start;
  margin-top: 3px;
  padding-bottom: 2px;
}

/* ---- "we've moved": in-app banner for logged-in legacy users ---- */

.moved-banner {
  margin: 12px -16px 0;
  background: var(--ink);
  color: var(--paper);
  padding: 13px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.moved-banner .mb-kicker {
  font-size: 9px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold);
}
.moved-banner .mb-text {
  font-size: 14px; font-weight: 800; line-height: 1.25;
  color: var(--paper);
}
.moved-banner .mb-actions { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.moved-banner .mb-go {
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  padding: 9px 13px;
}
.moved-banner .mb-x {
  margin-left: auto;
  border: var(--hair) solid var(--paper);
  color: var(--paper);
  font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  padding: 8px 12px;
}

/* ---- passkey sheets: proper paper in both themes ---- */

/* auth sheets must paint above the login screen (#loginOverlay is z 100, earlier in the DOM) */
#signupOverlay, #inviteOverlay, #addKeyOverlay { background: var(--backdrop); z-index: 110; }

.modal.pk-sheet {
  --sheet-col: var(--paper-card);
  margin: 0 14px 22px;
  width: calc(100% - 28px);
  max-width: 532px;
  background: var(--sheet-col);
  color: var(--paper-ink);
  border-top: none;
  transform: rotate(-0.7deg);
  box-shadow: 5px 7px 22px var(--paper-lift);
  padding-bottom: 22px;
  overflow: visible;
  position: relative;
}
.pk-sheet .sheet-body { padding: 22px 16px 0; gap: 14px; }
.pk-sheet .sheet-sub { color: var(--paper-ink-55); }
.pk-sheet .btn-save { background: var(--paper-ink); color: var(--paper-card); }

.sheet-copy {
  font-size: 12.5px; font-weight: 500; line-height: 1.45;
  color: var(--paper-ink-70);
}
.sheet-err {
  font-size: 13px; font-weight: 700;
  color: var(--paper-danger);
}

.invite-link {
  font-size: 13px; font-weight: 700;
  line-height: 1.35;
  color: var(--paper-ink);
  word-break: break-all;
  border-top: 1.5px solid var(--paper-ink-22);
  border-bottom: 1.5px solid var(--paper-ink-22);
  padding: 11px 2px;
}

.btn-outline.paper {
  flex: 0 0 auto;
  width: 118px;
  border-color: var(--paper-ink-40);
  color: var(--paper-ink);
}
.btn-outline.paper:active { background: var(--paper-ink); color: var(--paper-card); }
.login-alt.paper-alt { color: var(--paper-ink-55); margin-top: 4px; }

/* ---- new tool marks ---- */

/* invite: an envelope — the box is the mark's own border, the flap is two strokes */
.mark-invite::before {
  content: "";
  position: absolute;
  left: 6px; top: 9px;
  width: 19px; height: 13px;
  border: 1px solid var(--ink);
}
.mark-invite i { position: absolute; top: 10px; width: 11px; height: 1.5px; background: var(--ink); }
.mark-invite .i-flap  { left: 6.5px; transform: rotate(34deg); transform-origin: left center; }
.mark-invite .i-flap2 { left: 24.5px; transform: rotate(-34deg); transform-origin: right center; }

/* face id: a face inside brackets */
.mark-face::before {
  content: "";
  position: absolute;
  left: 7px; top: 7px;
  width: 17px; height: 17px;
  border: 1px solid var(--ink);
}
.mark-face i { position: absolute; background: var(--ink); }
.mark-face .f-eye-l { left: 11px; top: 12px; width: 2px; height: 3px; }
.mark-face .f-eye-r { left: 18px; top: 12px; width: 2px; height: 3px; }
.mark-face .f-mouth { left: 12px; top: 18px; width: 7px; height: 1.5px; }

/* ---- the lot: the account's email, under the rows ---- */

.menu-email {
  padding: 13px 16px 0;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--label);
  word-break: break-all;
}
