/* Langdon House styles
   Colors are defined once here. Change these to re-theme the whole app. */
:root {
  --bg: #f6f1e9;
  --card: #fffdf9;
  --card-2: #f9f4ec;
  --text: #2a2622;
  --muted: #7a7066;
  --line: #e8e0d4;
  --accent: #2f5d50;
  --accent-text: #ffffff;
  --accent-soft: #e3ece7;
  --logo-ink: #f6f1e9;
  --danger: #b4483a;
  --danger-soft: #f6e3df;
  --shadow: 0 1px 2px rgba(60, 45, 30, 0.06), 0 4px 16px rgba(60, 45, 30, 0.06);
  --shadow-lift: 0 2px 4px rgba(60, 45, 30, 0.08), 0 10px 28px rgba(60, 45, 30, 0.12);

  /* Person colors */
  --derek: #3d6a9e;
  --carly: #b35d7a;
  --finley: #c27c1e;
  --family: #2f5d50;

  /* Status colors */
  --need: #d0812b;  --need-soft: #fbecd9;
  --got: #3f8a5a;   --got-soft: #dff0e4;
  --traded: #3d6a9e; --traded-soft: #e0e9f5;
  --denied: #9a9086; --denied-soft: #eeeae4;
  --working: #6b55a8; --working-soft: #ebe6f6;

  --radius: 18px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

/* Dark colors: used when the phone is in dark mode (unless Settings says Light), or when Settings says Dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171513; --card: #22201d; --card-2: #1d1b19; --text: #f1ece4; --muted: #a39a8f; --line: #34302b;
    --accent: #7fb8a4; --accent-text: #10201b; --accent-soft: #24332e; --logo-ink: #171513;
    --danger: #e0806f; --danger-soft: #3a2420;
    --shadow: none; --shadow-lift: 0 0 0 1px #4a443d;
    --derek: #7fa9d9; --carly: #e09ab2; --finley: #e3a752; --family: #7fb8a4;
    --need: #eba25a; --need-soft: #3d2c19; --got: #78c48f; --got-soft: #1d3324;
    --traded: #7fa9d9; --traded-soft: #1e2a3a; --denied: #8f877e; --denied-soft: #2a2724;
    --working: #b4a2e6; --working-soft: #2b2540;}
}
:root[data-theme="dark"] {
    --bg: #171513; --card: #22201d; --card-2: #1d1b19; --text: #f1ece4; --muted: #a39a8f; --line: #34302b;
    --accent: #7fb8a4; --accent-text: #10201b; --accent-soft: #24332e; --logo-ink: #171513;
    --danger: #e0806f; --danger-soft: #3a2420;
    --shadow: none; --shadow-lift: 0 0 0 1px #4a443d;
    --derek: #7fa9d9; --carly: #e09ab2; --finley: #e3a752; --family: #7fb8a4;
    --need: #eba25a; --need-soft: #3d2c19; --got: #78c48f; --got-soft: #1d3324;
    --traded: #7fa9d9; --traded-soft: #1e2a3a; --denied: #8f877e; --denied-soft: #2a2724;
    --working: #b4a2e6; --working-soft: #2b2540;}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--sans); font-size: 17px; line-height: 1.4; -webkit-font-smoothing: antialiased; min-height: 100dvh; }
body.sheet-open { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
input, textarea, select { font-size: 17px; } /* 16px+ stops iPhone from zooming into fields */
svg { display: block; }

/* ---------- Phone layout ---------- */
.shell { max-width: 640px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 100px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; }
.topbar h1 { font-family: var(--serif); font-size: 30px; font-weight: 600; margin: 0; letter-spacing: -0.01em; line-height: 1.15; }
.topbar .sub { color: var(--muted); font-size: 15px; margin-top: 3px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card.tappable { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.card.tappable:active { transform: scale(0.99); }
@media (hover: hover) { .card.tappable:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0; font-weight: 700; }
.card-head h2.with-avatar { display: flex; align-items: center; gap: 8px; }
.card-head .sub, .muted { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); font-size: 15px; padding: 4px 0; }
.more-line { color: var(--muted); font-size: 14px; padding-top: 6px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.pill { background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.pill.need { background: var(--need); color: #fff; }

/* ---------- Avatars ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; flex: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; }
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.avatar.xs { width: 22px; height: 22px; font-size: 11px; }
.avatar svg { width: 60%; height: 60%; }
.c-derek { background: var(--derek); } .t-derek { color: var(--derek); }
.c-carly { background: var(--carly); } .t-carly { color: var(--carly); }
.c-finley { background: var(--finley); } .t-finley { color: var(--finley); }
.c-family { background: var(--family); } .t-family { color: var(--family); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { color: #1a1714; } }
:root[data-theme="dark"] .avatar { color: #1a1714; }

/* ---------- Bottom tabs (phone) ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: color-mix(in srgb, var(--card) 90%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px);
  display: flex; justify-content: space-around;
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 10.5px; font-weight: 600; padding: 4px 0; }
.tab-icon { position: relative; }
.tab svg { width: 25px; height: 25px; }
.tab.on { color: var(--accent); }
.side-badge { display: none; }
.badge { position: absolute; top: -4px; left: 16px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; display: flex; align-items: center; justify-content: center; }

/* ---------- Inputs ---------- */
.addbar { display: flex; gap: 8px; margin-bottom: 12px; }
.addbar input, .compose textarea, .field input, .field select {
  flex: 1; min-width: 0; width: 100%;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; outline: none;
}
.card .addbar input { background: var(--card-2); }
.addbar input:focus, .compose textarea:focus, .field input:focus, .field select:focus { border-color: var(--accent); background: var(--card); }
.btn { background: var(--accent); color: var(--accent-text); border-radius: 12px; padding: 0 16px; font-weight: 700; min-height: 44px; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn-quiet { color: var(--muted); font-size: 14px; font-weight: 600; padding: 6px 2px; }
.btn-quiet:hover { color: var(--text); }
.btn-danger { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 10px; }
.btn-danger svg { width: 18px; height: 18px; }
.btn-danger:hover { background: var(--danger-soft); }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--accent-soft); color: var(--text); }
.icon-btn.on { color: var(--accent); }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); background: var(--card); position: relative; transition: transform .2s ease, background .2s; }
.item:last-child { border-bottom: none; }
.item.swiping { transition: none; }
.item.sw-right { background: var(--got-soft); }
.item.sw-left { background: var(--danger-soft); }
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: flex; align-items: center; justify-content: center; margin-top: 1px; transition: background .15s, border-color .15s; }
.check svg { width: 15px; height: 15px; opacity: 0; }
.check:hover { border-color: var(--accent); }
.item.done .check, .check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.item.done .check svg, .check.on svg { opacity: 1; }
.check.big { width: 34px; height: 34px; }
.check.big svg { width: 19px; height: 19px; }
.item .body { flex: 1; min-width: 0; cursor: pointer; }
.item .text { word-wrap: break-word; }
.item.done .text { text-decoration: line-through; color: var(--muted); }
.item.done { opacity: 0.75; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--muted); margin-top: 3px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--text); }
.tag svg { width: 13px; height: 13px; }
.tag.plain { background: none; padding: 0; color: var(--muted); }
.tag.owner { background: var(--card-2); border: 1px solid var(--line); }
.tag.due.overdue { background: var(--danger); color: #fff; }
.tag.due.today { background: var(--need); color: #fff; }
.tag.due.soon { background: var(--need-soft); color: var(--text); }
.st-not_started { background: var(--denied-soft); }
.st-in_progress { background: var(--traded-soft); }
.st-partial { background: var(--need-soft); }
.st-waiting { background: var(--working-soft); }
.finished-link { display: block; margin-top: 8px; }

/* ---------- To-do columns ---------- */
.col-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.col-head h3 { margin: 0; font-size: 18px; flex: 1; }
.count { background: var(--accent-soft); color: var(--text); font-weight: 700; font-size: 13px; min-width: 26px; height: 26px; border-radius: 13px; display: flex; align-items: center; justify-content: center; padding: 0 8px; }

/* ---------- Segmented control ---------- */
.seg { display: flex; background: var(--accent-soft); border-radius: 12px; padding: 3px; margin-bottom: 14px; }
.seg button { flex: 1; padding: 9px 0; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 5px; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.seg-n { font-size: 11px; background: var(--accent); color: var(--accent-text); border-radius: 8px; padding: 0 5px; min-width: 16px; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--accent-soft); border-radius: 999px; padding: 6px 12px; font-size: 15px; }
.chip.more { color: var(--muted); }
.chip.pick { background: var(--card-2); border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.chip.pick.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip.add-chip { background: var(--card); border: 1px dashed var(--line); font-size: 14px; }
.chip.add-chip:hover { border-color: var(--accent); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 14px; }
.suggest:empty { display: none; }
.suggest-label { font-size: 13px; color: var(--muted); font-weight: 600; margin-right: 2px; }

/* ---------- Home extras ---------- */
.pinned-card { background: var(--need-soft); border-color: transparent; cursor: pointer; }
.pin-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--need); text-transform: uppercase; letter-spacing: 0.06em; }
.pin-head svg { width: 16px; height: 16px; }
.pin-text { font-family: var(--serif); font-size: 21px; line-height: 1.3; margin-top: 6px; white-space: pre-wrap; word-wrap: break-word; }
.today-card { border-left: 4px solid var(--need); }
.mini-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mini-days li { display: flex; align-items: center; gap: 8px; font-size: 15px; flex-wrap: wrap; }

/* ---------- Messages ---------- */
.narrow { max-width: 720px; }
.compose { margin-bottom: 14px; }
.compose textarea { min-height: 84px; resize: vertical; display: block; }
.compose .row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.msg { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.msg:last-child { border-bottom: none; }
.msg.pinned { background: var(--need-soft); margin: 0 -16px; padding: 12px 16px; }
.msg .who { font-weight: 700; font-size: 15px; display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; }
.msg .when, .note .when { color: var(--muted); font-size: 13px; font-weight: 400; margin-left: 6px; }
.msg .text { white-space: pre-wrap; word-wrap: break-word; margin-top: 2px; }
.msg .body { flex: 1; min-width: 0; }
.msg-actions { display: flex; flex-direction: column; gap: 2px; }
.pin-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--need); font-weight: 700; }
.pin-tag svg { width: 13px; height: 13px; }

/* ---------- Days off calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h2 { font-family: var(--serif); margin: 0; font-size: 22px; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow span { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.cal-day { min-height: 58px; border-radius: 10px; background: var(--card-2); padding: 4px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; text-align: left; overflow: hidden; border: 1px solid transparent; }
.cal-day:hover { border-color: var(--accent); }
.cal-day .num { font-size: 13px; font-weight: 700; padding-left: 2px; }
.cal-day.out { opacity: 0.35; }
.cal-day.past { opacity: 0.6; }
.cal-day.is-today { border-color: var(--accent); }
.cal-day.is-today .num { color: var(--accent); }
.cal-tag { font-size: 10px; font-weight: 700; border-radius: 5px; padding: 1px 4px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-tag em { display: none; font-style: normal; font-weight: 500; }
.cal-tag.need { background: var(--need); color: #fff; }
.cal-tag.got { background: var(--got); color: #fff; }
.cal-tag.traded { background: var(--traded); color: #fff; }
.cal-tag.denied { background: var(--denied-soft); color: var(--muted); text-decoration: line-through; }
.cal-tag.working { background: var(--working); color: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.day-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; display: inline-block; }
.day-dot.need { background: var(--need); } .day-dot.got { background: var(--got); } .day-dot.traded { background: var(--traded); }
.day-dot.denied { background: var(--denied); } .day-dot.working { background: var(--working); }
.day-line { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.day-line:last-child { border-bottom: none; }
.day-line .body { flex: 1; }
.do-need.on { background: var(--need); border-color: var(--need); color: #fff; }
.do-got.on { background: var(--got); border-color: var(--got); color: #fff; }
.do-traded.on { background: var(--traded); border-color: var(--traded); color: #fff; }
.do-denied.on { background: var(--denied); border-color: var(--denied); color: #fff; }
.dayoff-entry + .dayoff-entry { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }

/* ---------- Pop-up sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(20, 15, 10, 0.4); z-index: 40; animation: fade .15s ease; }
.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: 22px 22px 0 0; padding: 20px 18px calc(env(safe-area-inset-bottom) + 20px);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2); animation: rise .2s ease;
}
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-close { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--muted); background: var(--card-2); }
.sheet-close svg { width: 18px; height: 18px; }
.sheet-body { display: flex; flex-direction: column; gap: 4px; }
.sheet-title { font-family: var(--serif); font-size: 24px; margin: 0 40px 6px 0; font-weight: 600; }
.sheet-row { display: flex; align-items: center; gap: 12px; margin-right: 40px; }
.title-input { flex: 1; font-size: 21px; font-weight: 600; border: 1px solid transparent; background: none; padding: 6px 8px; border-radius: 10px; outline: none; min-width: 0; }
.title-input:hover, .title-input:focus { border-color: var(--line); background: var(--card-2); }
.sheet-meta { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.field { margin-top: 12px; }
.field > label, .field > div > label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin-bottom: 7px; }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.date-row { display: flex; gap: 6px; align-items: center; }
.notes { display: grid; gap: 10px; margin-bottom: 10px; }
.note { display: flex; gap: 10px; align-items: flex-start; background: var(--card-2); border-radius: 12px; padding: 10px; }
.note .body { flex: 1; min-width: 0; }
.note .who { font-weight: 700; font-size: 14px; }
.note .text { white-space: pre-wrap; word-wrap: break-word; font-size: 15px; }
.sheet-foot { margin-top: 16px; display: flex; justify-content: flex-start; }
.whatsnew { margin: 6px 0 10px; padding-left: 20px; display: grid; gap: 8px; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(env(safe-area-inset-top) + 24px) 24px calc(env(safe-area-inset-bottom) + 24px); text-align: center; }
.login-logo { width: 64px; height: 64px; margin-bottom: 14px; }
.login h1 { font-family: var(--serif); font-size: 38px; font-weight: 600; margin: 0 0 6px; }
.login p { color: var(--muted); margin: 0 0 32px; }
.people { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.person { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 600; }
.dots { display: flex; gap: 14px; justify-content: center; margin: 8px 0 10px; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.dot.full { background: var(--text); border-color: var(--text); }
.dots.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.err { color: var(--danger); min-height: 22px; font-size: 15px; margin-bottom: 8px; }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px; justify-content: center; }
.key { width: 76px; height: 76px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); font-size: 28px; font-weight: 500; }
.key:active { background: var(--accent-soft); }
.key.blank { visibility: hidden; }
.key.icon { background: none; border: none; display: flex; align-items: center; justify-content: center; }
.key.icon svg { width: 28px; height: 28px; }
.back { margin-top: 26px; color: var(--muted); font-weight: 600; }

/* ---------- Menu ---------- */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 44px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift); padding: 6px; min-width: 200px; z-index: 20; }
.menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.menu button:hover, .menu button:active { background: var(--accent-soft); }
.menu-ver { font-size: 12px; color: var(--muted); padding: 6px 12px 4px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 86px);
  background: var(--text); color: var(--bg); padding: 10px 10px 10px 16px; border-radius: 12px;
  font-size: 15px; z-index: 60; max-width: min(92vw, 520px); display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-lift);
}
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-undo { color: var(--bg); font-weight: 800; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--bg) 18%, transparent); flex: none; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 70; }

/* ---------- Phone tweaks ---------- */
@media (max-width: 999px) {
  .daysoff-side { margin-top: 0; }
  .cal-day { min-height: 52px; }
  .cal-tag { font-size: 0; padding: 0; height: 6px; border-radius: 3px; }
  .cal-tag.denied { background: var(--denied); }
}

/* ---------- Laptop layout ---------- */
@media (min-width: 1000px) {
  body { font-size: 16px; }
  .desk { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
  .side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--card-2); }
  .brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 21px; font-weight: 600; padding: 0 8px 22px; }
  .brand svg { width: 34px; height: 34px; }
  .side nav { display: grid; gap: 4px; }
  .side .tab { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 10px 12px; border-radius: 12px; color: var(--muted); }
  .side .tab svg { width: 22px; height: 22px; }
  .side .tab:hover { background: var(--accent-soft); color: var(--text); }
  .side .tab.on { background: var(--accent); color: var(--accent-text); }
  .side .badge { display: none; }
  .side-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; min-width: 22px; height: 20px; border-radius: 10px; padding: 0 6px; display: flex; align-items: center; justify-content: center; }
  .side-foot { margin-top: auto; display: grid; gap: 4px; justify-items: start; padding: 0 8px; }
  .side-foot .me { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
  .main { padding: 28px 32px 60px; min-width: 0; }
  .topbar h1 { font-size: 32px; }

  .columns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; margin-bottom: 18px; }
  .columns .card { margin-bottom: 0; }
  .home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .home-grid .card { margin-bottom: 0; }
  .list-col .item { padding: 9px 2px; }
  .list-col .text { font-size: 15.5px; }

  .grocery-wrap { max-width: 760px; }
  .daysoff-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
  .cal-day { min-height: 92px; padding: 6px; }
  .cal-tag { font-size: 11px; white-space: normal; }
  .cal-tag em { display: block; }

  .sheet-backdrop { animation: fade .15s ease; }
  .sheet { left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(620px, 92vw); max-height: 86vh; border-radius: 22px; padding: 26px 26px 22px; animation: pop .15s ease; }
  @keyframes pop { from { transform: translate(-50%, -48%); opacity: 0; } }
  .toast { bottom: 28px; }
}
@media (min-width: 1000px) and (max-width: 1250px) {
  .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Version 2.1: simpler to-do pop-up, details on items ---------- */
.item .details { font-size: 14px; color: var(--muted); margin-top: 1px; white-space: pre-wrap; word-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item.done .details { text-decoration: line-through; }

.todo-add { flex-direction: column; gap: 0; }
.addbar-row { display: flex; gap: 8px; }
.add-details { display: none; width: 100%; margin-top: 8px; resize: none; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; outline: none; font-size: 16px; }
.add-details:focus { border-color: var(--accent); background: var(--card); }
.todo-add.open .add-details { display: block; }

.todo-sheet { gap: 0; }
.sheet-list-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin: 2px 44px 4px 0; }
textarea.title-input { width: 100%; resize: none; overflow: hidden; font-size: 24px; font-weight: 700; line-height: 1.25; padding: 4px 6px; margin-left: -6px; font-family: var(--sans); }
.details-input { width: 100%; resize: none; overflow: hidden; border: 1px solid transparent; background: none; border-radius: 10px; padding: 4px 6px; margin: 2px 0 0 -6px; font-size: 17px; line-height: 1.4; color: var(--text); outline: none; white-space: pre-wrap; }
.details-input::placeholder { color: var(--muted); }
.details-input:hover, .details-input:focus { border-color: var(--line); background: var(--card-2); }
.sheet-tags { margin: 0 0 6px; }
.done-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 10px 0 20px; min-height: 50px; font-size: 17px; }
.done-btn svg { width: 20px; height: 20px; }
.done-btn.is-done { background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.section-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.more-toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 15px; padding: 14px 0 6px; border-top: 1px solid var(--line); margin-top: 8px; width: 100%; }
.more-toggle .chev svg { width: 16px; height: 16px; transition: transform .15s; transform: rotate(90deg); }
.more-toggle .chev.up svg { transform: rotate(-90deg); }
.more-box { display: grid; gap: 4px; padding-top: 4px; }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 52px; }
.opt-row.col { flex-direction: column; align-items: flex-start; }
.opt-label { font-weight: 600; }
.opt-val { display: flex; align-items: center; gap: 4px; }
.opt-row select, .opt-row input[type=date] { background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 16px; min-width: 150px; }
.link-btn { color: var(--accent); font-weight: 700; font-size: 16px; padding: 6px 0; }
.more-box .btn-danger { justify-self: start; margin-top: 8px; }

/* ---------- Version 2.1: home tiles ---------- */
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 18px 4px 10px; }
.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { position: relative; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; min-height: 118px; display: flex; flex-direction: column; box-shadow: var(--shadow); overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.tile-derek::before { background: var(--derek); } .tile-carly::before { background: var(--carly); }
.tile-finley::before { background: var(--finley); } .tile-family::before { background: var(--family); }
.tile:active, .qtile:active { transform: scale(0.98); }
.tile-top { display: flex; align-items: center; gap: 8px; }
.tile-name { font-weight: 700; font-size: 16px; }
.tile-num { font-family: var(--serif); font-size: 40px; font-weight: 600; line-height: 1; margin-top: auto; padding-top: 10px; }
.tile-clear { margin-top: auto; padding-top: 10px; color: var(--got); }
.tile-clear svg { width: 30px; height: 30px; }
.tile-sub { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.due-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.due-dot.overdue { background: var(--danger); } .due-dot.today { background: var(--need); } .due-dot.soon { background: var(--need); }
.quick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qtile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: var(--shadow); }
.qicon { position: relative; color: var(--accent); margin-bottom: 4px; }
.qicon svg { width: 28px; height: 28px; }
.qnum { position: absolute; top: -6px; right: -12px; background: var(--muted); color: var(--bg); font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; display: flex; align-items: center; justify-content: center; }
.qtile.hot .qnum { background: var(--danger); color: #fff; }
.qlabel { font-weight: 700; font-size: 14px; }
.qsub { font-size: 12px; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 700; font-size: 16px; padding: 4px 0 14px; }
.back-link svg { width: 20px; height: 20px; }
.hint.center { text-align: center; margin-top: 4px; }

/* ---------- Version 2.1: settings, chores, bigger text ---------- */
html.big { zoom: 1.12; }
.sub-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 6px 0 2px; }
.tag.time { background: var(--working-soft); }
.settings .card { padding: 14px 16px; }
.settings .section-title:first-of-type { margin-top: 4px; }
.seg.small { margin: 0; min-width: 190px; }
.seg.small button { padding: 7px 10px; font-size: 14px; }
.opt-row.noline { border-bottom: none; }
.link-btn.danger { color: var(--danger); }
.chore-list .chev svg { width: 18px; height: 18px; color: var(--muted); }
.chore-list .day-line { gap: 10px; }
.pin-form { display: grid; gap: 10px; }
.pin-form label { display: grid; gap: 5px; font-weight: 600; font-size: 14px; color: var(--muted); }
.pin-form input { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; font-size: 20px; letter-spacing: 0.3em; color: var(--text); outline: none; }
.pin-form input:focus { border-color: var(--accent); }
.row-btns { display: flex; justify-content: flex-end; gap: 12px; align-items: center; }
.day-pick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-pick button { padding: 10px 0; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.day-pick button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chore-sheet .field input { width: 100%; }
