/* =====================================================================
   TaskPilot · "Paper + Oxblood"
   Warm paper surfaces, oxblood maroon accent, antique-gold highlights.
   ===================================================================== */

:root {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --text: #1F1B1A;
  --muted: #6E6760;
  --faint: #A39D93;
  --line: #E8E2D8;
  --line-strong: #D9D1C4;

  --accent: #7A2335;
  --accent-hover: #651C2B;
  --accent-soft: #F3E4E7;
  --accent-ink: #5A1726;
  --on-accent: #FFFFFF;
  --gold: #B8924F;
  --gold-soft: #F4EBDD;
  --gold-ink: #6B4E1C;

  --p1: #E0613F;       /* coral: urgent, deliberately distinct from the maroon brand */
  --p2: #B7862B;
  --p3: #B9B3A6;
  --danger: #B42318;
  --veg: #3F7D4E;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(31, 27, 26, .04), 0 4px 16px rgba(31, 27, 26, .05);
  --shadow-lg: 0 12px 40px rgba(31, 27, 26, .18);
  --nav-h: 62px;
  --rail-w: 232px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151212; --surface: #1E1A1A; --surface-2: #242020; --text: #EFE9E4; --muted: #A89F98; --faint: #6F6660;
    --line: #332C2B; --line-strong: #463D3B;
    --accent: #C4566B; --accent-hover: #D06A7E; --accent-soft: #3A2027; --accent-ink: #F0C9D1; --on-accent: #FFFFFF;
    --gold: #D4B06E; --gold-soft: #3A301F; --gold-ink: #EBD3A2;
    --p1: #F07A5A; --p2: #D4A24A; --p3: #6F6660; --danger: #F97066; --veg: #7FBF8E;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151212; --surface: #1E1A1A; --surface-2: #242020; --text: #EFE9E4; --muted: #A89F98; --faint: #6F6660;
  --line: #332C2B; --line-strong: #463D3B;
  --accent: #C4566B; --accent-hover: #D06A7E; --accent-soft: #3A2027; --accent-ink: #F0C9D1; --on-accent: #FFFFFF;
  --gold: #D4B06E; --gold-soft: #3A301F; --gold-ink: #EBD3A2;
  --p1: #F07A5A; --p2: #D4A24A; --p3: #6F6660; --danger: #F97066; --veg: #7FBF8E;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
@media (min-width: 900px) { html { font-size: 15.5px; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
.ti { font-size: 1.15em; line-height: 1; vertical-align: -0.15em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.error { color: var(--danger); min-height: 1.2em; margin: 0; font-size: .87rem; }
h1 { font-family: var(--serif); font-weight: 500; font-size: 1.65rem; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 4px; }
h3 { font-size: .95rem; font-weight: 600; margin: 0; }
code { font-size: .85em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
a { color: var(--accent); }

/* ---------------------------------------------------------------- controls */
input, select, textarea { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .6rem .75rem; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: vertical; }

button, a.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: .55rem .9rem;
  font-weight: 500; font-size: .92rem; text-decoration: none; color: var(--text); transition: background .15s, border-color .15s, transform .08s; }
button:hover, a.button:hover { border-color: var(--line-strong); }
button:active { transform: scale(.98); }
button.primary, a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover, a.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--surface-2); }
button.danger { color: var(--danger); }
button:disabled { opacity: .55; cursor: default; }

.chip { border-radius: 999px; padding: .3rem .7rem; font-size: .82rem; font-weight: 500; background: var(--surface);
  border: 1px solid var(--line); gap: 5px; white-space: nowrap; }
.chip.small { padding: .22rem .6rem; font-size: .78rem; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip.lock { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
body.locked .chip.lock { background: var(--gold-soft); color: var(--gold-ink); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-top: 10px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin-top: 0; }
.chips::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }

.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-top: 12px; border-bottom: 1px solid var(--line); }
.tab { border: none; background: none; border-radius: 0; padding: .5rem .7rem .6rem; color: var(--muted); font-size: .9rem;
  font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.badge { background: var(--accent); color: var(--on-accent); border-radius: 999px; font-size: .68rem; padding: 1px 6px; font-weight: 600; }

.segmented { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.segmented button { flex: 1; border: none; background: transparent; padding: .45rem; font-size: .85rem; }
.segmented button.active { background: var(--surface); box-shadow: var(--shadow); color: var(--accent); }

.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input { flex: 1; min-width: 0; }
.search { position: relative; margin-top: 10px; }
.search .ti { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 2.1rem; }

/* ---------------------------------------------------------------- login */
#login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; text-align: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 32px 24px; box-shadow: var(--shadow); }
.login-card .logo { font-size: 2.2rem; color: var(--accent); }
.login-card h1 { margin-top: 4px; }
.login-card p.muted { margin: 4px 0 20px; font-size: .9rem; }
#login-form { display: flex; flex-direction: column; gap: 10px; }

/* ---------------------------------------------------------------- layout */
.content { min-height: 100dvh; }
.page > header { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 14px 16px 0;
  padding-top: max(14px, env(safe-area-inset-top)); }
.page > header .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.top-actions { display: flex; gap: 6px; align-items: center; }
.page > main { padding: 14px 16px calc(var(--nav-h) + 90px + env(safe-area-inset-bottom)); }
#page-settings > main { padding-bottom: calc(var(--nav-h) + 30px + env(safe-area-inset-bottom)); }

.progress-line { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--muted); font-size: .82rem; }
.progress-line:empty { display: none; }
.progress-line .bar { flex: 1; height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; max-width: 220px; }
.progress-line .bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 99px; }

/* bottom navigation (phone) → left rail (tablet landscape / laptop) */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bottom-nav .brand { display: none; }
.bottom-nav button { flex: 1; flex-direction: column; gap: 2px; border: none; background: none; padding: 4px 0; font-size: .7rem;
  color: var(--faint); font-weight: 500; border-radius: 10px; max-width: 90px; }
.bottom-nav button .ti { font-size: 1.45rem; }
.bottom-nav button.active { color: var(--accent); }

.capture { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 15; padding: 10px 16px;
  background: linear-gradient(to top, var(--bg) 60%, transparent); }
#capture-form { display: flex; gap: 8px; max-width: 760px; margin: 0 auto; align-items: flex-end; }
#capture-input { border-radius: 23px; padding: .72rem 1.1rem; background: var(--surface); box-shadow: var(--shadow); border-color: var(--line);
  resize: none; line-height: 1.4; min-height: 46px; max-height: calc(1.4em * 6 + 1.5rem); overflow-y: hidden; display: block; }
#capture-input.scroll { overflow-y: auto; }
.mic { flex: none; width: 46px; height: 46px; border-radius: 50%; padding: 0; border: none; background: var(--accent); color: var(--on-accent);
  font-size: 1.1rem; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); touch-action: manipulation; }
.mic:hover { background: var(--accent-hover); }
.mic.recording { background: var(--p1); animation: pulse 1.1s ease-in-out infinite; }
.mic.busy { opacity: .6; }
@keyframes pulse { 50% { transform: scale(1.08); } }

.toast-action { background: transparent; border: 1px solid color-mix(in srgb, var(--bg) 40%, transparent); color: var(--bg);
  padding: .25rem .7rem; font-size: .8rem; margin-left: 10px; flex: none; }
.toast { display: flex; align-items: center; justify-content: space-between; position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 80px + env(safe-area-inset-bottom)); max-width: 560px;
  margin: 0 auto; z-index: 30; background: var(--text); color: var(--bg); padding: .7rem 1rem; border-radius: 12px;
  font-size: .87rem; box-shadow: var(--shadow-lg); }

@media (min-width: 640px) {
  .page > header, .page > main { padding-left: max(24px, calc((100% - 720px) / 2)); padding-right: max(24px, calc((100% - 720px) / 2)); }
}
@media (min-width: 900px) {
  :root { --nav-h: 0px; }
  .bottom-nav { top: 0; right: auto; width: var(--rail-w); flex-direction: column; justify-content: flex-start; gap: 2px;
    border-top: none; border-right: 1px solid var(--line); padding: 22px 14px; background: var(--surface-2); backdrop-filter: none; }
  .bottom-nav .brand { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 1.25rem; font-weight: 600;
    color: var(--accent); padding: 0 10px 22px; }
  .bottom-nav button { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; max-width: none; padding: .6rem .75rem;
    font-size: .93rem; color: var(--muted); }
  .bottom-nav button .ti { font-size: 1.2rem; }
  .bottom-nav button:hover { background: var(--surface); color: var(--text); }
  .bottom-nav button.active { background: var(--accent-soft); color: var(--accent-ink); }
  .content { margin-left: var(--rail-w); }
  .capture { left: var(--rail-w); bottom: 0; padding: 12px 24px 18px; }
  .toast { left: calc(var(--rail-w) + 24px); bottom: 96px; }
  h1 { font-size: 1.9rem; }
  .page > header { padding-top: 26px; }
  .page > main { padding-bottom: 120px; }
}

/* ---------------------------------------------------------------- tasks */
.group-title { display: flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--faint); margin: 18px 2px 8px; }
.group-title:first-child { margin-top: 4px; }
.task { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .7rem .75rem; margin-bottom: 8px; transition: border-color .15s, box-shadow .15s; }
.task:hover { border-color: var(--line-strong); }
.handle { flex: none; color: var(--line-strong); cursor: grab; padding: 2px 0; margin-left: -4px; touch-action: none; font-size: 1.05rem; }
.handle:hover { color: var(--faint); }
.task .check { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; padding: 0; background: none;
  border: 1.75px solid var(--p3); display: grid; place-items: center; color: transparent; font-size: .75rem; }
.task.p1 .check { border-color: var(--p1); }
.task.p2 .check { border-color: var(--p2); }
.task .check:hover { background: var(--accent-soft); color: var(--accent); }
.task.done .check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.task.done .title { text-decoration: line-through; color: var(--faint); }
.task .body { flex: 1; min-width: 0; cursor: pointer; }
.task .title { font-weight: 500; font-size: .95rem; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; margin-top: 5px; font-size: .76rem; color: var(--muted); }
.meta > span, .meta > a { display: inline-flex; align-items: center; gap: 3px; }
.meta .pill { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.meta .proj { background: var(--accent-soft); color: var(--accent-ink); border-radius: 6px; padding: 0 6px; }
.meta .overdue, .meta .today { color: var(--p1); font-weight: 600; }
.meta a { text-decoration: none; }
.inbox-actions { display: flex; gap: 6px; margin-top: 10px; }
.inbox-actions button { padding: .3rem .7rem; font-size: .8rem; }
.empty { text-align: center; color: var(--muted); padding: 48px 12px; font-size: .92rem; }
.empty .ti { display: block; font-size: 2rem; color: var(--line-strong); margin: 0 auto 8px; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: var(--shadow-lg); border-color: var(--accent); }

/* sharing, weekend, selection */
.meta .wk { background: var(--gold-soft); color: var(--gold-ink); border-radius: 6px; padding: 0 6px; }
.meta .from { color: var(--accent-ink); }
.avs { display: inline-flex; }
.av { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .62rem; font-weight: 600;
  background: var(--accent); color: var(--on-accent); border: 1.5px solid var(--surface); margin-left: -4px; }
.av:first-child { margin-left: 0; }
.share-box { display: flex; flex-direction: column; gap: 6px; }
.share-box:empty { display: none; }
.share-box .label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.check-row { flex-direction: row !important; align-items: center; gap: 8px !important; font-size: .9rem !important; color: var(--text) !important; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
body.selecting .handle { display: none; }
body.selecting .task { cursor: pointer; }
body.selecting .task .check { border-radius: 6px; border-color: var(--line-strong); }
.task.selected { border-color: var(--accent); background: var(--accent-soft); }
.task.selected .check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
#select-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.select-bar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 16;
  max-width: 720px; margin: 0 auto; background: var(--text); color: var(--bg); border-radius: 16px; padding: 8px 8px 8px 14px;
  display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-lg); }
.select-bar #select-count { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.select-actions { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.select-actions button { background: transparent; border: none; color: var(--bg); flex-direction: column; gap: 1px; padding: .3rem .5rem; font-size: .68rem; }
.select-actions button .ti { font-size: 1.2rem; }
.select-actions button:hover { background: color-mix(in srgb, var(--bg) 14%, transparent); }
body.selecting .capture { display: none; }
@media (min-width: 900px) { .select-bar { left: calc(var(--rail-w) + 24px); right: 24px; bottom: 20px; } }
.move-list { display: flex; flex-direction: column; gap: 6px; max-height: 55dvh; overflow-y: auto; }
.move-list button { justify-content: flex-start; gap: 10px; padding: .7rem .8rem; }
.move-list button .e { font-size: 1.2rem; width: 26px; text-align: center; }
.project-card .badges { display: flex; gap: 6px; align-items: center; margin-top: 4px; font-size: .74rem; }
.project-card .badges .wk { background: var(--gold-soft); color: var(--gold-ink); border-radius: 6px; padding: 0 6px; }

/* checklists, snooze, search */
.checklist { display: flex; flex-direction: column; gap: 4px; }
.checklist:empty { display: none; }
.checklist .ci { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.checklist .ci input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin: 0; }
.checklist .ci span { flex: 1; overflow-wrap: anywhere; }
.checklist .ci.done span { text-decoration: line-through; color: var(--faint); }
.checklist .ci button { padding: .1rem .35rem; border: none; background: none; color: var(--faint); }
.snooze-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.snooze-row button { padding: .3rem .65rem; font-size: .8rem; }
.meta .snz { color: var(--muted); font-style: italic; }
#task-search-row { margin-top: 10px; }
#search-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------------------------------------------------------------- projects */
.project-card { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .85rem .9rem; margin-bottom: 8px; cursor: pointer; transition: border-color .15s; }
.project-card:hover { border-color: var(--line-strong); }
.ring { position: relative; width: 44px; height: 44px; flex: none; }
.ring svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.ring .track { stroke: var(--line); }
.ring .fill { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset .4s; }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .68rem; font-weight: 600; color: var(--accent-ink); }
.ring.complete span { color: var(--gold-ink); }
.project-card .pbody { flex: 1; min-width: 0; }
.project-card .pname { font-weight: 600; }
.project-card .chev { color: var(--faint); }
.progress { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 7px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 99px; }
.project-head { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.project-head h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.35rem; flex: 1; overflow-wrap: anywhere; }
.project-head button { padding: .4rem .55rem; }
.new-project { width: 100%; border-style: dashed; margin-bottom: 12px; color: var(--muted); background: transparent; }
.new-project:hover { color: var(--accent); border-color: var(--accent); }

/* ---------------------------------------------------------------- recipes */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; align-content: start; }
@media (min-width: 900px) { .recipe-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.recipe { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.recipe a.thumb { display: block; aspect-ratio: 16/10; background: var(--surface-2) center/cover no-repeat; }
.recipe .rbody { padding: .6rem .7rem .7rem; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.recipe .rtitle { color: var(--text); text-decoration: none; font-weight: 600; font-size: .88rem; line-height: 1.3; overflow-wrap: anywhere; }
.recipe .rmeta { font-size: .74rem; color: var(--muted); }
.recipe .ractions { display: flex; gap: 6px; margin-top: auto; padding-top: 8px; }
.recipe .ractions button { flex: 1; padding: .35rem .4rem; font-size: .76rem; white-space: nowrap; }
.recipe .ractions button.x { flex: 0 0 auto; }
.diet-veg { color: var(--veg); } .diet-non-veg { color: var(--p1); } .diet-egg { color: var(--p2); }

/* meal plan */
.plan-tools { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.plan-tools .grow { flex: 1; }
.plan-tools #plan-range { font-weight: 600; font-size: .9rem; }
.plan-tools button { padding: .4rem .65rem; font-size: .82rem; }
@media (max-width: 420px) { .plan-tools button span { display: none; } }
.mealplan { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; align-content: start; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem; }
.day.today { border-color: var(--accent); }
.day h4 { margin: 0 0 6px; font-size: .85rem; display: flex; justify-content: space-between; }
.day h4 .muted { font-weight: 500; }
.slot { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: flex-start; border: none; background: none; padding: .4rem .2rem;
  border-radius: 8px; font-weight: 400; font-size: .88rem; text-align: left; }
.slot:hover { background: var(--surface-2); }
.slot .sl { width: 70px; flex: none; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 600; }
.slot .dish { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.slot .dish.empty-slot { color: var(--faint); }
.slot .dish.recipe { color: var(--accent-ink); font-weight: 500; }

/* ---------------------------------------------------------------- lists */
.item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .7rem .8rem; margin-bottom: 6px; cursor: pointer; }
.item .check { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 1.75px solid var(--line-strong); background: none; padding: 0;
  display: grid; place-items: center; color: transparent; font-size: .75rem; }
.item.done .check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.item.done .itext { text-decoration: line-through; color: var(--faint); }
.item .itext { flex: 1; }
.item .qty { color: var(--muted); font-size: .8rem; }

.parcel { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .75rem .85rem; margin-bottom: 6px; }
.parcel .ti-package, .parcel .ti-truck-delivery { font-size: 1.4rem; color: var(--gold); }
.parcel .pb { flex: 1; min-width: 0; }
.parcel .pt { font-weight: 600; overflow-wrap: anywhere; }
.parcel .ps { font-size: .8rem; color: var(--muted); }
.parcel .ps.today { color: var(--p1); font-weight: 600; }
.parcel button { padding: .3rem .65rem; font-size: .78rem; }

/* ---------------------------------------------------------------- jobs */
.job { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem .9rem; margin-bottom: 8px; }
.job .jtop { display: flex; gap: 12px; align-items: flex-start; }
.job .score { flex: none; min-width: 50px; text-align: center; font-weight: 600; font-size: .9rem; border-radius: 10px; padding: .4rem .3rem;
  background: var(--surface-2); color: var(--muted); }
.job .score.hi { background: var(--accent-soft); color: var(--accent-ink); }
.job .score.mid { background: var(--gold-soft); color: var(--gold-ink); }
.job .jtitle { font-weight: 600; overflow-wrap: anywhere; }
.job .jmeta { font-size: .8rem; color: var(--muted); }
.job .jreason { font-size: .84rem; margin-top: 8px; color: var(--muted); }
.job .jactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.job .jactions button, .job .jactions a { padding: .35rem .7rem; font-size: .8rem; }
.materials { display: flex; flex-direction: column; gap: 10px; }
.materials section { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .7rem; font-size: .88rem; white-space: pre-wrap; }
.materials h4 { margin: 0 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  display: flex; justify-content: space-between; align-items: center; }
.materials h4 button { padding: .15rem .55rem; font-size: .75rem; text-transform: none; letter-spacing: 0; }
#job-add-fields { display: flex; flex-direction: column; gap: 8px; }

/* ---------------------------------------------------------------- settings */
.settings { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: 10px; }
.card p { margin: 0; font-size: .88rem; }
.card .inline-form { margin-top: 0; }
.file-label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: .88rem; color: var(--muted); cursor: pointer; }
.file-label input { flex: 1 1 100%; width: 100%; border: 1px dashed var(--line-strong); padding: .5rem; background: var(--surface-2); font-size: .82rem; }
.plain-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; color: var(--muted); }
.plain-list li { display: flex; align-items: center; gap: 8px; }
.plain-list button { padding: .15rem .55rem; font-size: .75rem; margin-left: auto; }
#logout { align-self: flex-start; color: var(--muted); }

/* work mode: personal areas are hidden (the server enforces it too) */
body.locked .personal-only { display: none !important; }

/* ---------------------------------------------------------------- dialogs */
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(20, 14, 14, .45); backdrop-filter: blur(2px); }
dialog form { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
dialog h2 { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; }
dialog label { display: flex; flex-direction: column; gap: 5px; font-size: .8rem; color: var(--muted); font-weight: 500; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.actions { display: flex; gap: 8px; margin-top: 6px; align-items: center; }
.actions span { flex: 1; }
.city-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.city-list button { padding: .8rem; }
details summary { color: var(--muted); font-size: .88rem; cursor: pointer; margin: 4px 0 8px; }
details .row { margin-bottom: 8px; }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.emoji-input { text-align: center; font-size: 1.2rem; }
.qr { width: 190px; height: 190px; align-self: center; border-radius: 10px; background: #fff; padding: 6px; }
.steps { margin: 0; padding-left: 18px; font-size: .88rem; }
.project-head button.on { color: var(--gold-ink); background: var(--gold-soft); }
