/* Home Maintenance Info - forest green + warm amber, paper background */
:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --ink: #1f2a24;
  --muted: #6b746e;
  --line: #e4ded1;
  --brand: #2f4a3a;
  --brand-2: #3d6b52;
  --accent: #f4c95d;
  --accent-ink: #5a4310;
  --danger: #b4432f;
  --danger-bg: #fbe9e5;
  --soon: #9a6a00;
  --soon-bg: #fdf1d4;
  --ok: #2f6b4f;
  --ok-bg: #e4f1e9;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(31, 42, 36, .06), 0 4px 16px rgba(31, 42, 36, .06);
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141a17;
    --surface: #1c2420;
    --surface-2: #212b26;
    --ink: #e8ece9;
    --muted: #9aa49e;
    --line: #2e3a34;
    --brand: #1a2a21;
    --brand-2: #6fb08b;
    --accent: #f4c95d;
    --danger: #ef8a76;
    --danger-bg: #3a211c;
    --soon: #f2c35b;
    --soon-bg: #3a3019;
    --ok: #8fd0aa;
    --ok-bg: #1f3329;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- header (same look as Occasions Address Book) ---------- */
.app-header {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: var(--brand); }
.brand-name { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
/* Homes and Businesses sit next to the name; the account menu stays at the right */
#app-nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; margin-left: 18px; }
#app-nav[hidden] { display: none; }
#app-nav > a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; }
#app-nav > a:hover { background: var(--surface-2); color: var(--ink); }
#app-nav > a.active { color: var(--ink); background: var(--surface); box-shadow: inset 0 -2px 0 var(--accent); }
/* account menu (matches Vehicle Maintenance Tracker) */
.user-menu { position: relative; min-width: 0; margin-left: auto; }
.user-chip {
  display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 3px 8px 3px 3px; border-radius: 999px;
  cursor: pointer; color: var(--ink); font: inherit; text-align: left; min-width: 0;
}
.user-chip:hover, .user-chip[aria-expanded=true] { background: var(--surface-2); }
#user-avatar { display: flex; flex: none; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: block; background: var(--surface-2); }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: var(--brand); font-weight: 700; letter-spacing: .02em; }
.user-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-name { font-weight: 600; font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-name[hidden] { display: none; }
.user-email { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .chevron { flex: none; color: var(--muted); transition: transform .15s; }
.user-chip[aria-expanded=true] .chevron { transform: rotate(180deg); }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 180px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
}
.menu[hidden] { display: none; }
#app-nav .menu [role=menuitem] {
  display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px;
  padding: 8px 10px; font: inherit; font-size: 14px; font-weight: 400; color: var(--ink); cursor: pointer; text-decoration: none;
}
#app-nav .menu [role=menuitem]:hover, #app-nav .menu [role=menuitem]:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* ---------- layout ---------- */
.container { max-width: 1040px; margin: 0 auto; padding: 28px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-weight: 500; font-size: 14px; }
.toolbar { display: flex; gap: 8px; margin: 18px 0; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 600 14px var(--font); border-radius: 9px; padding: 9px 16px; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--brand-2); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #355e48; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--muted); }
.btn-ghost-danger { color: var(--danger); }
.btn-on-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.btn-on-dark:hover { background: rgba(255,255,255,.1); }
.btn-small { padding: 6px 11px; font-size: 13px; }
.btn-block { width: 100%; padding: 11px 16px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 22px; line-height: 1;
}
.icon-btn:hover { background: var(--surface-2); color: var(--danger); }
.modal-head .icon-btn:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- pills ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-overdue { background: var(--danger-bg); color: var(--danger); }
.pill-soon { background: var(--soon-bg); color: var(--soon); }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-done { background: var(--surface-2); color: var(--muted); }

/* ---------- homes ---------- */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.home-card {
  display: flex; flex-direction: column; gap: 16px; padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: inherit; text-decoration: none; transition: border-color .15s, transform .15s;
}
.home-card:hover { border-color: var(--brand-2); transform: translateY(-2px); }
.home-card-top { display: flex; gap: 12px; align-items: flex-start; }
.home-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 11px; background: var(--ok-bg); color: var(--ok); }
.home-card-stats { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: auto; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .tab { padding: 10px 16px; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; font: 600 15px var(--font); color: var(--muted); cursor: pointer; }
.tabs .tab:hover { color: var(--ink); }
.tabs .tab[aria-selected=true] { color: var(--ink); border-bottom-color: var(--accent); }
.settings-tabs { margin: 0 0 6px; }
.settings-panel .setting-row { padding: 14px 2px; }
.settings-panel[hidden], .btn[hidden] { display: none !important; }
.settings-panel[data-panel=profile], .settings-panel[data-panel=alerts] { display: grid; gap: 16px; padding-top: 12px; }
.modal-foot .foot-left { margin-right: auto; }
label.check { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 400; color: var(--ink); cursor: pointer; }
label.check input { width: 18px; height: 18px; flex: none; accent-color: var(--brand-2); }
.avatar-row { display: flex; align-items: center; gap: 16px; }
.avatar-edit { position: relative; flex: none; width: 72px; height: 72px; }
.avatar-edit .busy { opacity: .4; }
/* trash badge centred on the circle's edge at the 2 o'clock position (30° above horizontal), like VMT */
.avatar-remove {
  position: absolute; left: calc(50% + 50% * 0.866 - 13px); top: calc(50% - 50% * 0.5 - 13px);
  width: 26px; height: 26px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.avatar-remove[hidden] { display: none; }
.avatar-remove:hover, .avatar-remove:focus-visible { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.avatar-upload { cursor: pointer; font-weight: 600; color: var(--ink); }
.label-like { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.email-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 6px 6px 11px; background: var(--surface); min-height: 44px; }
.email-row [data-email-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn-plain { width: 30px; height: 30px; }
.icon-btn-edit:hover, .icon-btn-edit:focus-visible { color: var(--brand-2); background: var(--surface-2); }
.head-actions { align-items: center; }
.icon-btn-plain:hover, .icon-btn-plain:focus-visible { color: var(--brand-2); background: var(--surface-2); }
.email-change { display: grid; gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.email-change[hidden] { display: none; }
.email-change-note { margin: 0; color: var(--ink); }
.email-change-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.code-input { max-width: 160px; letter-spacing: .2em; font-variant-numeric: tabular-nums; }

/* ---------- tasks ---------- */
.task-list, .history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.task {
  display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.task-overdue { border-left-color: var(--danger); }
.task-soon { border-left-color: var(--soon); }
.task-ok { border-left-color: var(--ok); }
.task-done { opacity: .75; }
.task-name { font-weight: 600; }
.task-notes { margin-top: 4px; color: var(--muted); white-space: pre-wrap; }
.task-dates { display: grid; gap: 4px; justify-items: end; text-align: right; min-width: 150px; }
.task-dates .label { margin-right: 4px; }
.task-actions { display: flex; gap: 6px; align-items: center; }
.done-group { margin-top: 22px; }
.done-group summary { cursor: pointer; color: var(--muted); font-weight: 600; margin-bottom: 10px; }

/* ---------- history ---------- */
.history-summary { display: flex; gap: 18px; margin: 18px 0 12px; color: var(--muted); font-weight: 600; font-size: 14px; }
.history-item {
  display: grid; grid-template-columns: 120px 1fr auto auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
}
.history-date { font-weight: 600; color: var(--brand-2); font-size: 14px; }
.history-cost { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- empty / loading ---------- */
.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--ok-bg); color: var(--ok); margin-bottom: 8px; }
.empty-icon svg { width: 32px; height: 32px; }
.loading { display: flex; gap: 6px; justify-content: center; padding: 48px; }
.loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-2); animation: bob 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: .15s; }
.loading span:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* ---------- panels / settings ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .2s; }
.slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--brand-2); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- forms ---------- */
label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea {
  font: 15px var(--font); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(61, 107, 82, .18); }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }
.interval-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.interval-row[hidden] { display: none; }
.form-error { color: var(--danger); background: var(--danger-bg); padding: 9px 12px; border-radius: 8px; font-size: 14px; margin: 14px 0 0; }
.check-list { display: grid; gap: 4px; max-height: 50vh; overflow: auto; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-weight: 400; font-size: 14px; cursor: pointer; }
.check-item:hover { background: var(--surface-2); }
.check-item input { width: 18px; height: 18px; flex: none; accent-color: var(--brand-2); }

/* ---------- auth (same layout as Vehicle Maintenance Tracker) ---------- */
body.signed-out #view { min-height: 100vh; max-width: none; display: grid; place-items: center; padding: 24px 16px; }
.auth-photos { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.auth-photos img {
  position: absolute; width: clamp(130px, 19vw, 280px); aspect-ratio: 1; object-fit: cover;
  padding: 6px; background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  transform: rotate(var(--turn)); opacity: .25; filter: grayscale(1);
}
.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); padding: 28px; text-align: left;
}
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.auth-mark { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px; background: var(--accent); color: var(--brand); }
.auth-mark svg { width: 46px; height: 46px; }
.auth-card h1 { margin: 22px 0 4px; font-size: 24px; letter-spacing: -.02em; }
.auth-sub { margin: 0; }
.auth-card form { display: grid; gap: 14px; margin-top: 18px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 14px; }
.auth-links a { font-weight: 600; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.auth-note { margin: 14px 0 0; }
.pw-field { position: relative; display: block; }
.pw-field input { padding-right: 42px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--ink); background: var(--surface-2); }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20, 28, 24, .5); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: pop .18s ease-out; }
.modal-wide { max-width: 620px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 8px; }
.modal-head h2 { font-size: 20px; }
.modal-body { padding: 8px 20px 4px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 20px; }
.dialog-message { margin: 4px 0 8px; color: var(--ink); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--brand); color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 500;
  box-shadow: var(--shadow); transition: opacity .2s, transform .2s; pointer-events: none; z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .app-header { padding: 10px 16px; flex-wrap: wrap; }
  .brand-name { font-size: 16px; }
  #app-nav { flex: 1 1 100%; width: 100%; overflow-x: auto; margin-left: 0; }
  #app-nav { overflow: visible; }
  .user-menu { margin-left: auto; }
  .user-text { display: none; }
  .user-chip { padding: 2px 4px 2px 2px; gap: 4px; }
  .container { padding: 20px 16px 48px; }
  h1 { font-size: 24px; }
  .task { grid-template-columns: 1fr; gap: 10px; }
  .task-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; text-align: left; min-width: 0; }
  .task-dates > * { white-space: nowrap; }
  .history-item { grid-template-columns: 1fr auto auto; }
  .history-date { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}

@media (prefers-color-scheme: dark) {
  .btn-primary { color: #10201a; }
  .btn-primary:hover:not(:disabled) { background: #85c29f; }
}

/* ---------- projects ---------- */
.ptype-maintenance { background: var(--ok-bg); color: var(--ok); }
.ptype-home-improvement { background: var(--soon-bg); color: var(--soon); }
.ptype-remodel { background: #e6ecf8; color: #34558b; }
@media (prefers-color-scheme: dark) { .ptype-remodel { background: #1f2a3d; color: #9db8e6; } }
.toolbar { align-items: center; }
.toolbar-total { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 14px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.project-card {
  display: grid; gap: 6px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); color: inherit; text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.project-card:hover { border-color: var(--brand-2); transform: translateY(-2px); }
.project-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.project-card h2 { font-size: 17px; }
.project-total { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.project-desc { color: var(--muted); margin-top: 4px; white-space: pre-wrap; max-width: 680px; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 4px 0 4px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.stat-value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat-value.stat-small { font-size: 15px; padding-top: 4px; }
.item-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pitem {
  display: grid; grid-template-columns: 110px 1fr auto auto; gap: 16px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
}
.pitem-date { font-weight: 600; color: var(--brand-2); font-size: 14px; padding-top: 1px; }
.pitem-main { display: grid; gap: 3px; min-width: 0; }
.pitem-amount { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 16px; padding-top: 1px; }
.kind-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; vertical-align: 1px; }
.kind-vendor { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.kind-contractor { background: #e6ecf8; color: #34558b; }
@media (prefers-color-scheme: dark) { .kind-contractor { background: #1f2a3d; color: #9db8e6; } }
.receipts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.receipt {
  display: block; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line);
  background: var(--surface-2); text-decoration: none; color: var(--ink);
}
.receipt img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.receipt:hover { border-color: var(--brand-2); }
.doc-tile { display: grid; place-items: center; align-content: center; gap: 2px; width: 100%; height: 100%; padding: 4px; text-align: center; }
.doc-tile b { font-size: 12px; color: var(--danger); letter-spacing: .04em; }
.doc-tile small { font-size: 9.5px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.att-grid:empty { display: none; }
.att-tile { position: relative; }
.att-new .receipt { border-style: dashed; }
.att-remove {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; font-size: 15px; line-height: 1; cursor: pointer;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.att-remove:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
@media (max-width: 720px) {
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pitem { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .pitem-date { grid-column: 1 / -1; }
  .pitem-main { grid-column: 1; }
  .pitem-amount { grid-column: 2; grid-row: 2; }
  .pitem .task-actions { grid-column: 1 / -1; }
}

/* ---------- contractors & vendors ---------- */
.filter-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg-btn { border: 0; background: none; font: 600 14px var(--font); color: var(--muted); padding: 7px 14px; border-radius: 7px; cursor: pointer; }
.seg-btn[aria-selected=true] { background: var(--brand-2); color: #fff; }
.search { max-width: 280px; margin-left: auto; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.contact-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none;
}
.contact-row:hover { border-color: var(--brand-2); }
.contact-main { min-width: 0; }
.contact-stats { text-align: right; flex: none; }
.info-panel { padding: 16px 18px; margin-bottom: 14px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 24px; margin: 0; }
.info-grid dd { margin: 2px 0 0; word-break: break-word; }
.info-notes { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); white-space: pre-wrap; color: var(--ink); }
.stat-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 8px; }
.section-title { font-size: 19px; margin: 22px 0 10px; }
.contact-history { grid-template-columns: 120px 1fr auto; }
.history-main a { color: inherit; }
.history-main a:hover { color: var(--brand-2); }
@media (max-width: 720px) {
  .search { max-width: none; margin-left: 0; width: 100%; }
  .stat-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .contact-history { grid-template-columns: 1fr auto; }
}

/* icon buttons (red trash, move) in a dialog's lower left */
.modal-foot .foot-icons { display: flex; gap: 4px; margin-right: auto; }
.modal-foot .icon-btn-move { width: 38px; height: 38px; border-radius: 9px; color: var(--muted); }
.modal-foot .icon-btn-move svg { width: 18px; height: 18px; }
.modal-foot .icon-btn-move:hover, .modal-foot .icon-btn-move:focus-visible { color: var(--ink); background: var(--surface-2); }
.move-preview { margin: 14px 0 6px; }
.move-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.move-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 8px; background: var(--surface-2); }
.move-list li.left span:first-child { color: var(--muted); }
.move-unmatched { border: 0; padding: 0; margin: 12px 0 4px; display: grid; gap: 8px; }
.move-unmatched[hidden] { display: none; }
.move-unmatched legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.modal-foot .icon-btn-danger { width: 38px; height: 38px; border-radius: 9px; color: var(--danger); }
.modal-foot .icon-btn-danger svg { width: 18px; height: 18px; }
.modal-foot .icon-btn-danger:hover, .modal-foot .icon-btn-danger:focus-visible { color: var(--danger); background: var(--danger-bg); }

/* receipts drop zone (matches Vehicle Maintenance Tracker) */
.att-field { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.att-field legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.att-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  padding: 18px 14px; border: 2px dashed var(--line); border-radius: 10px; background: var(--surface-2);
  color: var(--muted); cursor: pointer; font-weight: 400; transition: border-color .12s, background .12s;
}
.att-drop:hover, .att-drop:focus-within { border-color: var(--muted); }
.att-drop.over { border-color: var(--brand-2); background: var(--ok-bg); color: var(--ink); }
.att-drop-icon { color: var(--muted); }
.att-drop.over .att-drop-icon { color: var(--brand-2); }
.att-drop-main { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.att-drop-main u { color: var(--brand-2); text-decoration: none; }
.att-drop-sub { font-size: 12.5px; color: var(--muted); }
.att-drop .tap-only { display: none; }
@media (hover: none) and (pointer: coarse) { .att-drop .drag-only { display: none; } .att-drop .tap-only { display: inline; } }

/* input with an icon button beside it (Paid to + contact card) */
.input-with-btn { display: flex; align-items: center; gap: 6px; }
.input-with-btn input { flex: 1; min-width: 0; }
.input-with-btn .icon-btn { width: 40px; height: 40px; flex: none; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }

/* ---------- inventory ---------- */
.field-rows { display: grid; gap: 8px; margin-bottom: 10px; }
.field-row { display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 8px; align-items: center; border-radius: 8px; }
/* grab dots for drag-to-reorder (same as VMT's Edit Specs) */
.drag-handle {
  display: inline-grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: grab; padding: 8px 6px; line-height: 1;
  touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 6px;
}
.drag-handle:hover, .drag-handle:focus-visible { color: var(--ink); background: var(--surface-2); }
.sorting, .sorting * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.field-row.dragging { background: var(--surface-2); box-shadow: 0 6px 18px rgba(0, 0, 0, .14); position: relative; z-index: 1; }
.field-row.dragging input, .field-row.dragging select { background: var(--surface); }
.field-row input, .field-row select { padding: 8px 10px; font-size: 14px; }
.fr-extra { display: flex; min-width: 0; }
.fr-extra > * { flex: 1; min-width: 0; }
.fr-extra [hidden] { display: none; }
.fr-btns { display: flex; gap: 2px; }
.fr-btns .icon-btn { width: 30px; height: 30px; }
.fr-btns [data-remove-field]:hover { color: var(--danger); }
.search-left { margin-left: 0; max-width: 260px; }
.cat-filter { width: auto; min-width: 160px; padding: 8px 10px; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font: 600 12.5px var(--font);
  background: var(--surface); color: var(--muted); border: 1px solid var(--line); cursor: default;
}
button.tag-chip { cursor: pointer; }
button.tag-chip:hover { border-color: var(--brand-2); color: var(--ink); }
.tag-chip.on { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.tag-chip.sm { font-size: 11px; padding: 1px 8px; }
.tag-chip button { border: 0; background: none; padding: 0 0 0 2px; font-size: 15px; line-height: 1; color: inherit; cursor: pointer; }
.tag-chip button:hover { color: var(--danger); }
.tag-line { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
/* tag chips input (same as Groups in Occasions Address Book) */
.chip-input {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 5px 6px; min-height: 44px; cursor: text;
  border: 1px solid var(--line); background: var(--surface); border-radius: 9px;
}
.chip-input:focus-within { outline: 2px solid var(--brand-2); outline-offset: -1px; border-color: transparent; }
.chip-tag {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; font-weight: 400; color: var(--ink); line-height: 1.3; max-width: 100%;
}
.chip-tag > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-x {
  border: 0; background: none; color: var(--muted); cursor: pointer; width: 20px; height: 20px; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 15px; line-height: 1; padding: 0;
}
.chip-x:hover, .chip-x:focus-visible { background: color-mix(in srgb, var(--ink) 12%, transparent); color: var(--ink); }
.chip-input .chip-text {
  flex: 1 1 120px; min-width: 120px; width: auto; border: 0 !important; outline: none; background: transparent; margin: 0 !important;
  padding: 4px 6px !important; font-size: 15px; box-shadow: none !important;
}
.chip-suggest {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 20; max-height: 240px; overflow: auto;
  width: max-content; min-width: 200px; max-width: min(300px, 100%);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.14);
}
.chip-suggest[hidden] { display: none; }
.chip-option { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--ink); font-weight: 400; }
.chip-option[aria-selected=true], .chip-option:hover { background: var(--surface-2); }
.chip-option.new { color: var(--muted); }
.inv-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.inv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.inv-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.inv-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.inv-table tbody tr:last-child td { border-bottom: 0; }
.inv-table tbody tr[data-inv-item] { cursor: pointer; }
.inv-table tbody tr[data-inv-item]:hover, .inv-table tbody tr[data-inv-item]:focus-visible { background: var(--surface-2); outline: none; }
.inv-thumb-col { width: 56px; padding-right: 0 !important; }
.inv-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; display: block; border: 1px solid var(--line); }
.inv-thumb-empty { background: var(--surface-2); }
.inv-files-col { width: 48px; text-align: right; }
.files-count { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.att-drop-compact { padding: 12px; flex-direction: row; gap: 10px; }
.att-drop-compact .att-drop-icon { width: 22px; height: 22px; }
.att-drop-compact .att-drop-main { font-size: 14px; }
.links-block { display: grid; gap: 8px; }
.links-block select { max-width: 100%; }
.linked-entry { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.linked-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.linked-main > a { font-weight: 600; color: var(--ink); }
.linked-remove { position: static; flex: none; }
.inv-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.inv-link {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--ok-bg); color: var(--ok); text-decoration: none;
}
.inv-link:hover { filter: brightness(.95); }
@media (max-width: 720px) {
  .field-row { grid-template-columns: auto 1fr 1fr; }
  .field-row .drag-handle { grid-row: 1 / span 2; grid-column: 1; align-self: stretch; padding: 6px 8px; }
  .fr-extra { grid-column: 2; }
  .fr-btns { grid-column: 3; justify-content: flex-end; }
  .field-row { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .search-left { max-width: none; }
  .inv-table thead { display: none; }
  .inv-table, .inv-table tbody, .inv-table tr, .inv-table td { display: block; width: 100%; }
  .inv-table tr[data-inv-item] { display: grid; grid-template-columns: 56px 1fr auto; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .inv-table tr[data-inv-item] td { border: 0; padding: 2px 0; }
  .inv-table tr[data-inv-item] td.inv-thumb-col { grid-row: span 6; }
  .inv-table tr[data-inv-item] td.inv-files-col { grid-row: 1; grid-column: 3; width: auto; }
  .inv-table tr[data-inv-item] td[data-label] { grid-column: 2 / 4; font-size: 13px; }
  .inv-table tr[data-inv-item] td[data-label]:empty { display: none; }
  .inv-table tr[data-inv-item] td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
}

/* projects toolbar: totals left, print + add right */
.toolbar-total-left { margin-left: 0; margin-right: auto; font-size: 15px; color: var(--ink); }
.toolbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.print-btn { width: 40px; height: 40px; }
.print-btn[aria-busy=true] { cursor: progress; opacity: .5; }
/* PDF viewer dialog (like VMT) */
.modal.pdf-modal { max-width: min(980px, calc(100vw - 32px)); }
.pdf-frame { display: block; width: 100%; height: min(72vh, 900px); border: 1px solid var(--line); border-radius: 8px; background: #525659; }

/* CSV import */
.modal.modal-xwide { max-width: min(860px, calc(100vw - 32px)); }
.csv-preview:empty { display: none; }
.csv-table td { font-size: 13px; padding: 6px 10px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.csv-table tr.csv-head td { font-weight: 600; background: var(--surface-2); }
.map-rows { display: grid; gap: 8px; }
.fill-rows { display: grid; }
.fill-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-weight: 400; }
.fill-row:first-child { border-top: 0; }
.fill-info { display: grid; min-width: 0; }
.fill-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .fill-row { grid-template-columns: 1fr; gap: 6px; } }
.map-head, .map-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr) minmax(0, 1.1fr) minmax(0, 1.2fr); gap: 10px; align-items: center; }
.map-head span { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.map-row { padding: 8px 0; border-top: 1px solid var(--line); }
.map-row select, .map-row input { padding: 8px 10px; font-size: 14px; }
.map-row [hidden] { visibility: hidden; display: block; }
.map-col { display: grid; min-width: 0; }
.map-col b, .map-col span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-type { display: flex; gap: 6px; min-width: 0; }
.map-type > select { flex: 1; min-width: 0; }
.map-type > select[hidden] { display: none; }
.import-errors { margin: 0; padding-left: 18px; max-height: 40vh; overflow: auto; display: grid; gap: 4px; font-size: 14px; }
.import-errors b { margin-right: 6px; }
@media (max-width: 720px) {
  .map-head { display: none; }
  .map-row { grid-template-columns: 1fr 1fr; }
  .map-col { grid-column: 1 / -1; }
  .map-row [hidden] { display: none; }
}

/* inventory filter (funnel button + panel, like OAB) */
.filter-wrap { position: relative; }
.filter-btn { height: 40px; gap: 7px; }
.filter-btn.on { border-color: var(--brand-2); color: var(--brand-2); }
.filter-count { background: var(--brand-2); color: #fff; border-radius: 999px; font-size: 11.5px; min-width: 19px; height: 19px; display: inline-grid; place-items: center; padding: 0 5px; font-weight: 700; }
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 14px; }
.filter-chips:empty { display: none; }
.link-btn { border: 0; background: none; padding: 2px 4px; color: var(--brand-2); font: 600 13px var(--font); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.filter-panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: min(380px, calc(100vw - 28px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.18);
  display: flex; flex-direction: column; max-height: min(70vh, 620px);
}
.toolbar-right .filter-panel { left: auto; right: 0; } /* a Filter button on the right opens its panel leftward */
.fp-body { overflow: auto; padding: 6px 16px; }
.fp-body section { padding: 12px 0; border-bottom: 1px solid var(--line); }
.fp-body section:last-child { border-bottom: 0; }
.fp-body h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.fp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.fp-head h3 { margin: 0; }
.fp-list { display: grid; gap: 2px; max-height: 176px; overflow: auto; }
.fp-opt { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; padding: 4px 2px; border-radius: 6px; font-size: 14px; }
.fp-opt[hidden] { display: none; }
.fp-opt:hover { background: var(--surface-2); }
.fp-opt input { width: 16px; height: 16px; }
.fp-n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fp-search { margin: 0 0 6px !important; padding: 6px 9px !important; font-size: 14px !important; }
.fp-range { display: flex; align-items: center; gap: 8px; }
.fp-range input { padding: 6px 9px; font-size: 14px; min-width: 0; }
.fp-under { font-size: 14px; padding: 3px 0; }
.fp-seg { display: inline-flex; padding: 2px; }
.fp-seg label { display: flex; margin: 0; }
.fp-seg input { position: absolute; opacity: 0; pointer-events: none; }
.fp-seg span { padding: 4px 11px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-radius: 7px; }
.fp-seg input:checked + span { background: var(--brand-2); color: #fff; }
.fp-seg input:focus-visible + span { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.fp-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
.fp-buttons { display: flex; gap: 6px; }
@media (max-width: 760px) {
  .filter-panel, .toolbar-right .filter-panel { position: fixed; left: 14px; right: 14px; top: 120px; width: auto; }
}

/* empty date fields show nothing (no grayed-out date or mm/dd/yyyy) until a date is picked or typed */
input[type=date].date-empty::-webkit-datetime-edit { color: transparent; }
input[type=date].date-empty { color: transparent; caret-color: var(--ink); }
input[type=date].date-empty::-webkit-calendar-picker-indicator { opacity: .7; }

/* Retailer and Individual types, and the 6-box project totals */
.kind-retailer { background: var(--soon-bg); color: var(--soon); }
.kind-individual { background: #efe8f6; color: #6a4a8c; }
@media (prefers-color-scheme: dark) { .kind-individual { background: #2e2540; color: #c7b0e3; } }
.stat-row-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 900px) { .stat-row-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stat-row-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* list editor: Business field types (checkbox menu that looks like a select) */
.kinds-pick { position: relative; }
.kinds-pick[hidden] { display: none; }
.kinds-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left;
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; cursor: pointer;
}
.kinds-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kinds-btn:focus-visible, .kinds-btn[aria-expanded=true] { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(61, 107, 82, .18); }
.kinds-caret { flex: none; opacity: .8; }
.kinds-menu {
  position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; right: 0; min-width: 160px; display: grid; gap: 2px;
  padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
}
.kinds-menu[hidden] { display: none; }
.kinds-menu label.check { padding: 6px 8px; border-radius: 6px; font-size: 14px; }
.kinds-menu label.check:hover { background: var(--surface-2); }

/* list editor: eye toggle = show the field as a column in the list view */
.eye-btn { width: 30px; height: 30px; color: var(--muted); }
.eye-btn[aria-pressed=true] { color: var(--brand-2); }
.eye-btn[aria-pressed=true] .eye-slash { display: none; }
.eye-btn[aria-pressed=false] { opacity: .55; }
.eye-btn:hover { background: var(--surface-2); color: var(--ink); opacity: 1; }

/* sign-in screen: why you were signed out */
.auth-notice { margin: 14px 0 0; padding: 9px 12px; border-radius: 8px; background: var(--soon-bg); color: var(--soon); font-size: 14px; text-align: left; }

/* inactivity warning sits above any other dialog */
.idle-backdrop { z-index: 200; }
.idle-modal { width: min(420px, calc(100vw - 32px)); }

/* ---------- admin (same layout as Vehicle Maintenance Tracker) ---------- */
.admin-tabs { margin: 0 0 18px; }
.page-head a.btn { text-decoration: none; }
.tab-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; text-align: center; }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-totals { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 14px; }
.admin-totals b { color: var(--ink); font-variant-numeric: tabular-nums; }
.admin-invite { display: flex; gap: 8px; flex: 1 1 360px; max-width: 480px; }
.admin-invite input { min-width: 0; }
.admin-invite .btn { flex: none; }
.admin-invite-label { align-self: center; font-weight: 600; margin: 0; }
.admin-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.admin-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 600px; font-size: 14.5px; }
.admin-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-name { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.admin-name .icon-btn { width: 28px; height: 28px; }
.admin-table .row-actions { text-align: right; white-space: nowrap; }
.admin-table .row-actions .btn + .btn { margin-left: 6px; }
.admin-table tr.is-off td:not(.row-actions) { opacity: .6; }
.admin-settings { display: grid; gap: 14px; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.admin-settings input[name=idleMinutes] { max-width: 140px; }
@media (max-width: 600px) { .admin-invite { max-width: none; } }

/* Admin › Categories */
.admin-cats { display: grid; gap: 12px; max-width: 460px; justify-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.cat-rows { display: grid; gap: 8px; width: 100%; }
.cat-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 34px; gap: 8px; align-items: center; border-radius: 8px; }
.cat-row.dragging { background: var(--surface-2); box-shadow: 0 6px 18px rgba(0, 0, 0, .14); position: relative; z-index: 1; }
.cat-row input { padding: 8px 10px; font-size: 14px; }
.cat-row input[readonly] { color: var(--muted); }
.admin-cats .form-error { width: 100%; margin: 0; }

/* task descriptions */
.task-desc { color: var(--ink); margin: 2px 0 3px; white-space: pre-line; }
.check-desc { display: block; margin-top: 2px; }
.common-desc { font-weight: 400; margin-top: 2px; white-space: normal; max-width: 420px; }

/* maintenance project <-> tasks */
.project-tasks { margin: 16px 0 4px; display: grid; gap: 6px; }
.ptask-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ptask { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; }
.ptask-name { font-weight: 600; }
.ptask a { font-weight: 600; text-decoration: none; color: var(--ink); }
.ptask a:hover { text-decoration: underline; }
.ptask-list select { width: auto; min-width: 220px; padding: 7px 10px; font-size: 14px; }
.project-tasks[hidden] { display: none; }
.form-grid .project-tasks { margin: 0; }
.pill-cat { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill-stack { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.done-mode { display: flex; width: 100%; }
.done-mode .seg-btn { flex: 1; }
.form-grid > [hidden] { display: none !important; }
.task-cat { margin-left: 6px; vertical-align: 1px; font-size: 11.5px; padding: 1px 8px; }

/* sign-in screen: no top header (the card has the icon) */
body.signed-out .app-header { display: none; }

/* ---------- welcome page (signed out; same structure as Occasions Address Book) ---------- */
body.on-landing #view { display: block; min-height: 0; max-width: none; padding: 0; }
.landing { max-width: 1120px; margin: 0 auto; padding: 0 24px 40px; --sky: #fbefcd; }
@media (prefers-color-scheme: dark) { .landing { --sky: #2a2717; } }
.lp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0; }
.lp-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.lp-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #2f4a3a; flex: none; }
.lp-mark svg { width: 32px; height: 32px; }
.lp-nav { display: flex; align-items: center; gap: 18px; }
.lp-link { color: var(--muted); text-decoration: none; font-weight: 600; }
.lp-link:hover { color: var(--ink); text-decoration: underline; }

.lp-hero { display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center; padding: 40px 0 72px; }
.lp-hero h1 { font-size: clamp(36px, 5.2vw, 58px); line-height: 1.04; letter-spacing: -.035em; margin: 0 0 22px; max-width: 13ch; }
.lp-lede { font-size: 18.5px; line-height: 1.55; color: var(--muted); margin: 0 0 28px; max-width: 46ch; }
.lp-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lp-big { padding: 13px 28px; font-size: 16px; }
.lp-note { font-size: 14px; color: var(--muted); max-width: 30ch; }

/* hero picture */
.lp-art { display: flex; justify-content: center; }
.lp-photo {
  display: block; width: 100%; max-width: 500px; aspect-ratio: 1; object-fit: cover;
  border: 6px solid #fff; border-radius: 28px; box-shadow: 0 14px 40px rgba(31, 42, 36, .16); background: var(--sky);
}

/* features */
.lp-features { display: grid; gap: 64px; padding: 72px 0; border-top: 1px solid var(--line); }
.lp-feature { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.lp-feature:nth-child(even) .lp-text { order: 2; }
.lp-feature h2 { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 12px; max-width: 22ch; }
.lp-feature p { font-size: 16.5px; line-height: 1.6; color: var(--muted); margin: 0; max-width: 52ch; }
.lp-visual { display: grid; place-items: center; min-height: 220px; }
.lp-panel { width: min(100%, 400px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 14px; display: grid; gap: 8px; font-size: 14px; }
.lp-task { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.lp-task .pill-cat { font-size: 11px; padding: 1px 7px; margin-left: 4px; }
.lp-email-head { display: flex; gap: 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.lp-email-head svg { color: var(--brand-2); flex: none; }
.lp-email-body { display: grid; gap: 6px; padding: 4px 2px; }
.lp-email-body span { color: var(--muted); }
.lp-proj-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lp-proj-total { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.lp-proj-rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lp-proj-rows span { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.lp-proj-rows i { font-style: normal; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.lp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-chips span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; color: var(--muted); }
.lp-item { grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.lp-item-photo { display: grid; place-items: center; width: 92px; height: 120px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.lp-item-text { display: grid; gap: 8px; }
.lp-item dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 13.5px; }
.lp-item dt { color: var(--muted); }
.lp-item dd { margin: 0; }
.lp-biz-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); }
.lp-hist { gap: 0; padding: 10px 16px; }
.lp-hist-row { display: grid; grid-template-columns: 12px 92px 1fr; gap: 10px; align-items: start; padding: 9px 0; border-left: 2px solid var(--line); margin-left: 5px; padding-left: 0; }
.lp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-2); margin: 4px 0 0 -6px; }
.lp-hist-date { color: var(--muted); font-size: 13px; padding-top: 1px; }

.lp-more { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; padding: 40px 0 56px; border-top: 1px solid var(--line); }
.lp-more h3 { font-size: 16px; margin: 0 0 6px; }
.lp-more p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.lp-foot { display: flex; gap: 20px; align-items: center; padding: 20px 0 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.lp-foot span { margin-right: auto; }
.lp-foot .link-btn { font-size: 14px; }

@media (max-width: 860px) {
  .lp-hero, .lp-feature { grid-template-columns: 1fr; gap: 32px; }
  .lp-hero { padding: 16px 0 48px; }
  .lp-feature:nth-child(even) .lp-text { order: 0; }
  .lp-features { gap: 48px; padding: 48px 0; }
  .lp-more { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .landing { padding: 0 16px 32px; }
  .lp-nav .lp-link { display: none; }
  .lp-more { grid-template-columns: 1fr; }
  .lp-photo { border-width: 5px; border-radius: 22px; }
  .lp-hist-row { grid-template-columns: 12px 80px 1fr; }
}
/* the muted second line under a bold name (welcome page email, businesses and history cards) */
.lp-f-sub { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; }
.lp-biz-row .lp-f-sub { white-space: nowrap; }
.lp-nav .btn { white-space: nowrap; }

/* shared homes: whose homes (header), the Sharing tab, and view-only */
.book-switch { width: auto; max-width: 340px; margin-right: 10px; padding: 7px 10px; font-size: 14px; font-weight: 600; }
.book-switch[hidden] { display: none; }
.share-intro { margin: 0 0 14px; font-size: 14px; line-height: 1.5; }
.share-list { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; margin-bottom: 16px; }
.share-list[hidden] { display: none; }
.share-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.share-row:first-child { border-top: 0; }
.share-who { display: grid; min-width: 0; }
.share-who > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.share-row select { width: auto; padding: 6px 10px; font-size: 14px; }
.btn-danger-text { color: var(--danger); }
.share-new { border: 1px solid var(--line); border-radius: 12px; padding: 6px 16px 14px; margin: 0; }
.share-new legend { padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.share-new-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; }
.share-new p { margin: 8px 0 0; }
@media (max-width: 600px) {
  .share-row { grid-template-columns: 1fr auto; }
  .share-row .share-who { grid-column: 1 / -1; }
  .share-new-grid { grid-template-columns: 1fr; }
  .book-switch { max-width: 170px; }
}
body.view-only :is(#add-contact, #add-home, #add-home-empty, #add-inv-item, #add-item, #add-list, #add-project, #add-task,
  #edit-contact, #edit-home, #edit-list, #edit-project, #import-list, [data-item-edit], [data-item-delete], [data-act], [data-log], [data-unlink-task]) { display: none !important; }

/* Settings › Security */
.sec-box { border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px 16px; margin: 0 0 16px; display: grid; gap: 12px; }
.sec-box legend { padding: 0 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.sec-mfa { display: grid; gap: 10px; }
.sec-mfa p { margin: 0; }
.mfa-on { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.mfa-steps { margin: 0; padding-left: 20px; display: grid; gap: 12px; font-size: 14px; }
.mfa-qr { margin-top: 10px; }
.mfa-qr img { display: block; border-radius: 8px; background: #fff; padding: 6px; }
.mfa-secret { font-family: ui-monospace, Menlo, monospace; word-break: break-all; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.mfa-buttons { display: flex; gap: 8px; justify-content: flex-end; }
.code-input { font-family: ui-monospace, Menlo, monospace; letter-spacing: .2em; max-width: 180px; }

/* Trash (like OAB) */
.trash-list { display: grid; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.trash-row { display: grid; grid-template-columns: 116px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.trash-row:last-child { border-bottom: 0; }
.trash-row .pill { justify-self: start; }
.trash-what { min-width: 0; }
.trash-name { font-weight: 600; overflow-wrap: anywhere; }
.trash-soon { color: var(--danger); font-weight: 600; }
.trash-actions { display: flex; gap: 4px; align-items: center; }
.trash-actions .icon-btn-danger { color: var(--danger); }
.trash-actions .icon-btn-danger:hover, .trash-actions .icon-btn-danger:focus-visible { background: var(--danger-bg); }
@media (max-width: 600px) {
  .trash-row { grid-template-columns: 1fr auto; }
  .trash-row .pill { grid-column: 1 / -1; }
}
