:root {
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #e3e6ea;
  --soft: #f0f2f5;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);
  --sidebar: 236px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { font-size: 14px; line-height: 1.45; }
a { color: var(--accent); }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- buttons & inputs ---------- */
button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); padding: 7px 12px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { background: var(--soft); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover { filter: brightness(.95); }
button.danger { color: var(--danger); border-color: #f3c4c4; }
button.ghost { border-color: transparent; background: transparent; }
button.small, .btn.small { padding: 4px 8px; font-size: 12px; }
button:disabled { opacity: .55; cursor: default; }
input, select, textarea {
  font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff;
  width: 100%;
}
input[type=checkbox], input[type=radio] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
label.field { display: block; margin-bottom: 10px; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---------- auth screen ---------- */
.auth-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); padding: 28px; }
.auth-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.brand-dot { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); flex: none; }
.auth-card button.primary { width: 100%; justify-content: center; padding: 10px; margin-top: 4px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; }
.msg { padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.msg.err { background: #fdecec; color: #991b1b; }
.msg.ok { background: #e8f6ee; color: #14532d; }
.msg.info { background: #eef2ff; color: #3730a3; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100%; }
.sidebar {
  width: var(--sidebar); background: #111827; color: #d1d5db; flex: none; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px; color: #fff; font-weight: 700; }
.sidebar nav { padding: 6px 8px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #d1d5db; text-decoration: none;
  margin-bottom: 2px;
}
.nav-item:hover { background: #1f2937; color: #fff; }
.nav-item.active { background: var(--accent); color: var(--accent-ink); }
.nav-item.child { padding-left: 34px; font-size: 13px; }
.nav-item .badge { margin-left: auto; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; padding: 14px 10px 6px; }
.nav-ico { width: 16px; text-align: center; opacity: .9; }
.sidebar .foot { padding: 12px 16px; border-top: 1px solid #1f2937; font-size: 12px; }
.sidebar .foot a { color: #9ca3af; }
.site-link { display: flex; align-items: center; gap: 8px; padding: 5px 10px; color: #9ca3af; text-decoration: none; font-size: 13px; border-radius: 6px; }
.site-link:hover { background: #1f2937; color: #fff; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 20px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-weight: 700; font-size: 16px; }
.menu-btn { display: none; }
.content { padding: 20px; flex: 1; min-width: 0; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; flex: none; }

@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
  .menu-btn { display: inline-flex; }
  .content { padding: 14px; }
  .topbar { padding: 0 12px; }
  .hide-sm { display: none !important; }
}

/* ---------- panels, tables, misc ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.panel.flush { padding: 0; overflow: hidden; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 14px; border: 0; background: none; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); font-weight: 600; }
.tab:hover { background: none; color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { background: #fafbfc; font-size: 12px; color: var(--muted); font-weight: 600; position: sticky; top: 0; cursor: default; white-space: nowrap; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--ink); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: #f8fafc; }
table.data tr.group td { background: #f3f4f6; font-weight: 700; }
table.data tr.subtotal td { font-weight: 600; background: #fafafa; }
table.data tfoot td { font-weight: 700; background: #f3f4f6; }
.neg { color: var(--danger); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--soft); color: var(--muted); }
.badge.soon { background: #374151; color: #d1d5db; }
.badge.added, .badge.readded { background: #e8f6ee; color: #166534; }
.badge.removed { background: #fdecec; color: #991b1b; }
.badge.updated { background: #fff4e5; color: #92400e; }
.badge.notes { background: #eef2ff; color: #3730a3; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 8px; }
.coming-soon { text-align: center; padding: 80px 16px; }
.coming-soon .big { font-size: 48px; }

/* ---------- modal & drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 12px; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; flex: 1; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--panel); z-index: 110; box-shadow: -10px 0 40px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.drawer .modal-body { overflow-y: auto; flex: 1; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.3); z-index: 105; }

.toast-box { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #111827; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13px; }
.toast.err { background: var(--danger); }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; margin-bottom: 16px; }
.kv .k { color: var(--muted); }
.note { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.note .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; }
.note .body { white-space: pre-wrap; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.legend label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: 12px; user-select: none; }
.legend label.off { opacity: .45; }
.weekdays { display: flex; gap: 4px; flex-wrap: wrap; }
.weekdays label { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 12px; }
.weekdays input { display: none; }
.weekdays label.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- calendar ---------- */
.cal-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
@media (max-width: 1100px) { .cal-layout { grid-template-columns: 1fr; } }
.fc { --fc-border-color: var(--line); --fc-today-bg-color: color-mix(in srgb, var(--accent) 7%, transparent); font-size: 13px; }
.fc .fc-toolbar-title { font-size: 18px; }
.fc .fc-button-primary { background: #fff; color: var(--ink); border-color: var(--line); text-transform: capitalize; }
.fc .fc-button-primary:hover { background: var(--soft); color: var(--ink); border-color: var(--line); }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fc-event { cursor: pointer; }
.fc-event.is-task { border-style: dashed !important; }
.fc-event.is-done { opacity: .5; text-decoration: line-through; }
.fc-event.is-task .fc-event-title::before { content: "☐ "; }
.fc-event.is-task.is-done .fc-event-title::before { content: "☑ "; }
@media (max-width: 700px) {
  .fc .fc-toolbar { flex-direction: column; gap: 8px; }
  .fc .fc-toolbar-title { font-size: 16px; }
}
.task-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row .t { flex: 1; cursor: pointer; }
.task-row.done .t { text-decoration: line-through; color: var(--muted); }
.task-row .when { font-size: 12px; color: var(--muted); }
.task-row .when.late { color: var(--danger); font-weight: 600; }
.task-row input { margin-top: 3px; width: 16px; height: 16px; }

/* ---------- health ---------- */
.health-head { align-items: center; }
.person-tabs button { font-weight: 600; padding: 8px 16px; }
.person-tabs button.on { color: #fff; }
.hist-nav input { padding: 6px 8px; }
.health-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr) 270px; gap: 16px; align-items: start; }
.h-col .panel { margin-bottom: 14px; }
@media (max-width: 1100px) { .health-grid { grid-template-columns: 1fr 1fr; } .h-mid { grid-column: 1 / -1; order: -1; } }
@media (max-width: 640px) { .health-grid { grid-template-columns: 1fr; } }
.widget { text-align: center; padding: 14px; border-top: 4px solid var(--who, var(--accent)); }
.w-title { display: flex; align-items: center; gap: 8px; font-weight: 700; justify-content: center; margin-bottom: 6px; }
.w-ico { font-size: 22px; }
.w-count { font-size: 40px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.w-icons { font-size: 20px; letter-spacing: 2px; margin: 8px 0 10px; min-height: 26px; word-break: break-all; }
.w-btn { width: 48px; height: 40px; justify-content: center; font-size: 20px; font-weight: 700; }
.ticks { display: flex; flex-direction: column; gap: 6px; }
.tick { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; text-align: left; user-select: none; }
.tick input { display: none; }
.tick-ico { font-size: 18px; }
.tick span:nth-child(3) { flex: 1; }
.tick-mark { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; color: #fff; }
.tick.on { background: color-mix(in srgb, var(--ok) 10%, #fff); border-color: color-mix(in srgb, var(--ok) 45%, #fff); }
.tick.on .tick-mark { background: var(--ok); border-color: var(--ok); }
.readings { margin: 8px 0; text-align: left; }
.reading { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.reading span:first-child { color: var(--muted); width: 64px; }
.reading b { flex: 1; }
button.x { border: 0; background: none; color: var(--muted); padding: 2px 6px; font-size: 12px; }
button.x:hover { color: var(--danger); background: none; }
form.mini { display: flex; gap: 4px; margin-top: 6px; }
form.mini input { padding: 6px; font-size: 13px; min-width: 0; }
form.mini input[type=time] { flex: 0 0 112px; min-width: 112px; }
.widget form.mini { flex-wrap: wrap; }
.widget form.mini input[type=time] { flex: 1 1 100%; }
form.mini button { padding: 6px 10px; }
form.mini.bp input[name=s], form.mini.bp input[name=d], form.mini.bp input[name=p] { flex: 1; }
.food { border-top: 4px solid var(--who, var(--accent)); }
.food .w-title { justify-content: flex-start; margin-bottom: 12px; }
.meals { display: flex; flex-direction: column; gap: 10px; }
.meal { background: var(--soft); border-radius: 12px; overflow: hidden; }
.meal-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; background: none; border: 0; font: inherit; font-weight: 700; text-align: left; cursor: pointer; color: inherit; }
.meal-head:hover { background: rgba(0,0,0,.03); }
.meal-lbl { flex: none; }
.meal-sum { flex: 1; min-width: 0; font-weight: 400; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-plus { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--who, var(--accent)); color: #fff; font-size: 20px; line-height: 1; font-weight: 700; }
.meal-ico { font-size: 24px; }
.meal-body { padding: 0 14px 14px; }
.food-item { display: flex; gap: 8px; align-items: baseline; background: #fff; border-radius: 8px; padding: 7px 8px; margin-bottom: 6px; font-size: 13px; }
.food-time { color: var(--muted); font-size: 12px; width: 62px; flex: none; }
.food-desc { flex: 1; }
.food-add { padding-top: 6px; }
.food-add input[name=d] { flex: 3; }

/* ---------- round 4: shared kit ---------- */
.nav-fold { margin-left: auto; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-weight: 700; font-size: 15px; line-height: 1; color: #cbd5e1; background: rgba(255,255,255,.08); flex: none; }
.nav-fold:hover { background: rgba(255,255,255,.2); color: #fff; }
.nav-item .badge + .nav-fold { margin-left: 6px; }
.btn-like { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 7px 12px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.btn-like:hover { background: var(--soft); }
.btn-like.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pickers { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-wrap { display: flex; gap: 4px; align-items: center; }
label.field.pl-wrap { display: block; }
.pl-wrap > select { flex: 1; }
.pl-edit { flex: none; }
.field .pl-line { display: flex; gap: 4px; }
.upload-progress { position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 210; width: min(420px, 92vw); box-shadow: var(--shadow); }
.upload-progress .bar { height: 6px; background: #374151; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.upload-progress .bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.dragging { outline: 3px dashed var(--accent) !important; outline-offset: -3px; background: color-mix(in srgb, var(--accent) 6%, transparent) !important; }
.attach { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 6px 0 10px; }
.attach-head { margin-bottom: 8px; font-size: 13px; }
.attach-drop { border-radius: 8px; }
.attach-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.attach-hint { margin-bottom: 6px; }
.att { position: relative; width: 92px; height: 92px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--soft); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.att img { width: 100%; height: 100%; object-fit: cover; }
.att .att-ico { font-size: 30px; }
.att .att-name { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; background: rgba(255,255,255,.88); padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att .x { position: absolute; top: 2px; right: 2px; background: rgba(255,255,255,.9); border-radius: 50%; width: 22px; height: 22px; padding: 0; justify-content: center; }
.att.pending { opacity: .75; border-style: dashed; }
.viewer-img { max-width: 100%; max-height: 72vh; display: block; margin: 0 auto; border-radius: 8px; }
.viewer-pdf { width: 100%; height: 72vh; border: 0; }
.viewer-file { text-align: center; padding: 40px; }
.viewer-file .big { font-size: 56px; }
.fold-btn { width: 26px; height: 26px; border-radius: 50%; padding: 0; justify-content: center; font-weight: 700; font-size: 16px; line-height: 1; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #eef2ff; color: #3730a3; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 600; margin: 1px 2px 1px 0; }
.chip button { border: 0; background: none; padding: 0 0 0 2px; font-size: 11px; color: inherit; }
.flag { color: var(--danger); font-weight: 700; }
/* health round 4 */
.widget .w-title { position: relative; cursor: pointer; padding: 0 30px; user-select: none; }
.widget .fold-btn { position: absolute; right: 0; top: 50%; transform: translateY(-50%); background: var(--soft); }
.widget.folded { padding-bottom: 10px; }
.widget.folded .w-title { margin-bottom: 0; flex-wrap: wrap; }
.w-sum { font-weight: 400; font-size: 12px; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 1px 8px; }
.food .w-title { justify-content: flex-start; font-size: 17px; padding-left: 0; }
.meds { gap: 8px; }
.med-row { display: flex; gap: 6px; align-items: stretch; }
.med-row .tick { flex: none; padding: 9px 10px; gap: 6px; }
.med-row .tick span:nth-child(3) { display: none; }
.med-edit { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; white-space: normal; border-radius: 10px; padding: 7px 10px; gap: 2px; }
.med-lbl { font-weight: 600; }
.med-list { line-height: 1.3; }
/* cash flow */
.cf-chart { width: 100%; height: auto; display: block; margin: 6px 0 4px; }
.cf-grid { stroke: var(--line); stroke-width: 1; }
.cf-zero { stroke: var(--danger); stroke-width: 1; stroke-dasharray: 4 3; }
.cf-ax { font-size: 11px; fill: var(--muted); }
.cf-line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.cf-in { fill: var(--ok); }
.cf-out { fill: var(--danger); }
/* plants / cds / library */
.row-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; display: inline-grid; place-items: center; overflow: hidden; vertical-align: middle; }
.row-thumb.ph { background: var(--soft); font-size: 20px; }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-thumb .lib-ico { font-size: 20px; }
.water-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.water-card { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.water-card img, .water-ph { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }
.water-ph { background: var(--soft); display: grid; place-items: center; font-size: 30px; }
.water-info { flex: 1; min-width: 0; }
.cd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.cd-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; transition: box-shadow .15s; }
.cd-card:hover { box-shadow: var(--shadow); }
.cd-cover { position: relative; aspect-ratio: 1; background: linear-gradient(135deg, #1f2937, #4b5563); display: grid; place-items: center; overflow: hidden; }
.cd-cover span { font-size: 48px; }
.cd-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.cd-cover.big { width: 180px; flex: none; border-radius: 10px; }
.cd-meta { padding: 8px 10px; }
.cd-detail { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
ol.tracks { margin: 0; padding-left: 26px; columns: 2 260px; column-gap: 28px; }
ol.tracks li { padding: 3px 0; break-inside: avoid; }
ol.tracks li span:last-child { margin-left: 8px; }
.rel-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.rel { display: flex; flex-direction: column; align-items: flex-start; text-align: left; white-space: normal; gap: 2px; }
.lib-drop { border-style: dashed; border-width: 2px; background: #fbfcfd; }
.lib-drop-hint { color: var(--muted); }
.bulk { background: #eef2ff; border-color: #c7d2fe; padding: 10px 12px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.lib-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; }
.lib-card.sel { outline: 3px solid var(--accent); }
.lib-card .lib-chk { position: absolute; top: 8px; left: 8px; z-index: 2; width: 18px; height: 18px; }
.lib-thumb { aspect-ratio: 4 / 3; background: var(--soft); display: grid; place-items: center; overflow: hidden; }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lib-ico { font-size: 42px; }
.lib-cap { padding: 7px 9px; }
.lib-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-preview { margin-bottom: 12px; text-align: center; }
.lib-preview img { max-width: 100%; max-height: 46vh; border-radius: 8px; }
.lib-preview iframe { width: 100%; height: 46vh; border: 1px solid var(--line); border-radius: 8px; }
.drawer .modal-foot { border-top: 1px solid var(--line); }
.task-row .pct { height: 5px; background: var(--soft); border-radius: 3px; margin-top: 4px; overflow: hidden; max-width: 180px; }
.task-row .pct i { display: block; height: 100%; background: var(--ok); }
.fc .is-overdue { border-width: 2px !important; font-weight: 700; }
.plant-look { display: flex; gap: 12px; align-items: flex-start; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 10px; margin: -2px 0 10px; }
.plant-look img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; flex: none; }
.care-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 2px; margin-bottom: 10px; background: #fbfdfb; }
.care-head { margin-bottom: 8px; }
.care-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 560px) { .care-grid { grid-template-columns: 1fr; } }
/* books / watch list */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.media-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; transition: box-shadow .15s; }
.media-card:hover { box-shadow: var(--shadow); }
.media-cover { position: relative; aspect-ratio: 2 / 3; background: linear-gradient(135deg, #334155, #64748b); display: grid; place-items: center; overflow: hidden; }
.media-cover span { font-size: 44px; }
.media-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.media-cover.big { width: 160px; flex: none; border-radius: 10px; }
.media-done { position: absolute; z-index: 2; left: 6px; bottom: 6px; background: var(--ok); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.media-meta { padding: 8px 10px; }
.media-meta b { display: block; line-height: 1.25; }
.media-edit { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 6px; }
.media-picks { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 4px; }
.media-picks button { flex: none; width: 96px; padding: 4px; flex-direction: column; align-items: stretch; white-space: normal; text-align: left; gap: 4px; }
.media-picks button.on { outline: 2px solid var(--accent); }
.media-picks img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; }
.media-picks span { font-size: 30px; text-align: center; }
.media-picks small { font-size: 10px; line-height: 1.2; }

/* ---------- chat ---------- */
.content.chat-mode { padding: 0; display: flex; flex: none; height: calc(100vh - 56px); height: calc(100dvh - 56px); overflow: hidden; }
.chat { display: flex; flex: 1; min-width: 0; min-height: 0; background: var(--panel); }
.ch-side { width: 300px; flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #fafbfc; }
.ch-side-head { display: flex; gap: 6px; padding: 12px 12px 8px; }
.ch-side-head .primary { flex: 1; justify-content: center; border-radius: 999px; padding: 9px 14px; font-weight: 600; }
.ch-search { padding: 0 12px 8px; }
.ch-search input { border-radius: 999px; background: var(--soft); border-color: transparent; padding-left: 14px; }
.ch-lists { flex: 1; overflow-y: auto; padding: 0 6px 16px; }
.ch-sec { display: flex; align-items: center; padding: 10px 6px 4px; }
.ch-sec-h { flex: 1; border: 0; background: none; padding: 2px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); justify-content: flex-start; gap: 6px; }
.ch-sec-h:hover { background: none; color: var(--ink); }
.ch-sec-h.static { display: block; }
.ch-plus { font-size: 15px; padding: 0 8px !important; color: var(--muted); }
.ch-emptyline { padding: 4px 12px 8px; }
.ch-browse { display: block; padding: 6px 12px; color: var(--muted); text-decoration: none; }
.ch-browse:hover { color: var(--accent); }
.ch-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; text-decoration: none; color: var(--ink); margin-bottom: 1px; }
.ch-item:hover { background: var(--soft); }
.ch-item.on { background: color-mix(in srgb, var(--accent) 14%, #fff); }
.ch-item-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-item-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.ch-item-p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--muted); }
.ch-item.unread .ch-item-n { font-weight: 700; }
.ch-item.unread .ch-item-p { color: var(--ink); }
.ch-item-r { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.ch-item-w { font-size: 11px; color: var(--muted); }
.ch-pill { min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.ch-pill.mute { background: #cbd5e1; color: #334155; }
.ch-pill.at { background: #dc2626; color: #fff; }
.ch-av { position: relative; display: inline-flex; flex: none; }
.ch-av .avatar { width: 32px; height: 32px; font-size: 12px; }
.ch-av.lg .avatar, .ch-av.lg .ch-tile { width: 38px; height: 38px; font-size: 18px; }
.ch-av.xl .avatar, .ch-av.xl .ch-tile { width: 64px; height: 64px; font-size: 30px; border-radius: 18px; }
.ch-av.xl .avatar { border-radius: 50%; font-size: 22px; }
.ch-tile { width: 32px; height: 32px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 16%, #fff); display: grid; place-items: center; font-size: 16px; }
.ch-tile.group { background: #e0e7ff; }
.ch-tile.sm { width: 24px; height: 24px; font-size: 13px; }
.ch-on { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.ch-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-right: 4px; vertical-align: 1px; }
.ch-result { display: flex; gap: 10px; padding: 8px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.ch-result:hover { background: var(--soft); }
.ch-result > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.ch-result-b { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ch-result mark { background: #fef08a; color: inherit; border-radius: 3px; }

.ch-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; position: relative; }
.ch-main.dragging::after { content: "Drop files to share"; position: absolute; inset: 8px; border: 2px dashed var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--accent) 8%, rgba(255,255,255,.85)); display: grid; place-items: center; font-weight: 700; color: var(--accent); z-index: 5; }
.ch-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); min-height: 60px; }
.ch-head-t { min-width: 0; flex: 1; }
.ch-head-t .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-head-n { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-back { display: none; font-size: 18px; padding: 4px 8px; }
.ch-tabs button { padding: 5px 12px; font-size: 13px; }
.ch-desc { padding: 6px 18px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.ch-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ch-msgs { flex: 1; overflow-y: auto; padding: 8px 0 12px; }
.ch-msgs.static { overflow: visible; }
.ch-intro { text-align: center; padding: 36px 16px 20px; }
.ch-intro h2 { margin: 12px 0 4px; }
.ch-older { text-align: center; padding: 8px; }
.ch-day, .ch-new { display: flex; align-items: center; gap: 10px; margin: 14px 18px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ch-day::before, .ch-day::after, .ch-new::before, .ch-new::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ch-new { color: #dc2626; } .ch-new::before, .ch-new::after { background: #fca5a5; }
.ch-msg { display: flex; gap: 10px; padding: 6px 18px 4px; position: relative; }
.ch-msg.grouped { padding-top: 1px; }
.ch-msg:hover { background: #f8fafc; }
.ch-msg.pinned { background: #fffbeb; }
.ch-msg.flash { animation: chflash 2.4s ease-out; }
@keyframes chflash { 0%, 40% { background: color-mix(in srgb, var(--accent) 22%, #fff); } 100% { background: transparent; } }
.ch-gutter { width: 36px; flex: none; display: flex; justify-content: center; }
.ch-gutter .avatar { width: 34px; height: 34px; }
.ch-time-h { font-size: 10px; color: var(--muted); visibility: hidden; padding-top: 3px; white-space: nowrap; }
.ch-msg:hover .ch-time-h { visibility: visible; }
.ch-msg-b { flex: 1; min-width: 0; }
.ch-meta { display: flex; gap: 8px; align-items: baseline; }
.ch-meta b { font-size: 13.5px; }
.ch-text { overflow-wrap: anywhere; line-height: 1.5; }
.ch-text.big { font-size: 34px; line-height: 1.2; }
.ch-text code { background: var(--soft); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: 12.5px; }
.ch-pre { background: #0f172a; color: #e2e8f0; padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; margin: 4px 0; white-space: pre-wrap; }
.ch-at { background: color-mix(in srgb, var(--accent) 14%, #fff); color: var(--accent); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.ch-at.me { background: #fef3c7; color: #92400e; }
.ch-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; align-items: flex-start; }
.ch-img { padding: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--soft); }
.ch-img img { display: block; max-width: 280px; max-height: 220px; min-width: 60px; min-height: 60px; object-fit: cover; }
.ch-file { text-align: left; border-radius: 10px; padding: 8px 12px; max-width: 300px; }
.ch-file > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.ch-file-i { font-size: 24px; }
.ch-file-n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.ch-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.ch-react { padding: 1px 8px; border-radius: 999px; font-size: 13px; background: var(--soft); border-color: transparent; }
.ch-react span { font-size: 12px; font-weight: 600; color: var(--muted); }
.ch-react.mine { background: color-mix(in srgb, var(--accent) 15%, #fff); border-color: var(--accent); }
.ch-react.add { opacity: 0; font-size: 12px; }
.ch-msg:hover .ch-react.add { opacity: 1; }
.ch-replies { margin-top: 5px; padding: 3px 10px; border-radius: 8px; gap: 10px; color: var(--accent); font-weight: 600; font-size: 13px; border-color: transparent; background: transparent; }
.ch-replies:hover { border-color: var(--line); background: #fff; }
.ch-acts { position: absolute; right: 14px; top: -14px; display: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 2px; z-index: 3; }
.ch-acts button { padding: 3px 7px; font-size: 14px; }
.ch-msg:hover .ch-acts, .ch-msg:focus-within .ch-acts, .ch-msg.show-acts .ch-acts { display: flex; }
@media (hover: none) { .ch-msg:hover .ch-acts { display: none; } .ch-msg.show-acts .ch-acts { display: flex; } .ch-react.add { opacity: 1; } }
.ch-edit textarea { resize: none; margin: 4px 0; }
.ch-typing { min-height: 18px; padding: 0 20px; font-style: italic; }
.ch-joinbar { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 14px; border-top: 1px solid var(--line); background: #fafbfc; flex-wrap: wrap; }
.ch-comp { margin: 0 14px 10px; border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 4px 6px 2px; position: relative; }
.ch-comp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.ch-comp-row { display: flex; align-items: flex-end; gap: 2px; }
.ch-comp textarea { border: 0; outline: 0 !important; resize: none; padding: 8px 6px; max-height: 200px; line-height: 1.4; box-shadow: none; }
.ch-icon-btn { padding: 6px 9px; font-size: 17px; cursor: pointer; border-radius: 8px; border: 0; background: none; display: inline-flex; }
.ch-icon-btn:hover { background: var(--soft); }
.ch-send { border-radius: 50%; width: 36px; height: 36px; padding: 0; justify-content: center; margin: 0 0 2px 2px; }
.ch-hint { padding: 0 8px 4px; font-size: 11px; }
.ch-comp.compact .ch-hint { display: none; }
.ch-pending { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 4px 0; }
.ch-pending:empty { display: none; }
.ch-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 8px; padding: 3px 4px 3px 8px; font-size: 12px; max-width: 220px; }
.ch-chip > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 5px; }
.ch-at-list { position: absolute; bottom: 100%; left: 8px; margin-bottom: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 240px; padding: 4px; z-index: 10; }
.ch-at-list button { display: flex; width: 100%; gap: 8px; border: 0; justify-content: flex-start; padding: 6px 8px; }
.ch-at-list button.on { background: var(--soft); }
.ch-at-list .avatar { width: 24px; height: 24px; font-size: 10px; }
.ch-empty { margin: auto; text-align: center; padding: 30px 20px; max-width: 460px; }
.ch-empty .big { font-size: 54px; }
.ch-tabpane { padding: 16px 18px; overflow-y: auto; flex: 1; }
.ch-filegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.ch-fcard { flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; border-radius: 12px; text-align: left; white-space: normal; gap: 0; }
.ch-fcard img, .ch-fbig { height: 110px; width: 100%; object-fit: cover; display: grid; place-items: center; font-size: 40px; background: var(--soft); }
.ch-fcard .ch-fname { font-weight: 600; padding: 8px 10px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-fcard .small { padding: 0 10px 8px; }
.ch-pinrow { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 4px 0; }
.ch-pinrow .ch-msg.pinned { background: none; }
.ch-goto { margin: 0 0 4px 64px; }
.ch-thread { width: 380px; flex: none; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #fff; }
.ch-menu { position: fixed; z-index: 300; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 4px; min-width: 190px; }
.ch-menu button { display: flex; width: 100%; border: 0; justify-content: flex-start; padding: 7px 10px; }
.ch-menu button.danger { color: var(--danger); }
.ch-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.ch-menu.ch-emoji { display: grid; grid-template-columns: repeat(8, 34px); max-width: 300px; max-height: 260px; overflow-y: auto; min-width: 0; }
.ch-menu.ch-emoji button { width: 34px; height: 34px; padding: 0; justify-content: center; font-size: 19px; }
.ch-emoji-btn { width: 100%; justify-content: center; font-size: 20px; padding: 3px; height: 36px; }
.ch-people { max-height: 360px; overflow-y: auto; margin-top: 8px; }
.ch-people.short { max-height: 200px; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.ch-person { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 8px; }
label.ch-person { cursor: pointer; }
label.ch-person:hover { background: var(--soft); }
.ch-pops { position: fixed; right: 16px; bottom: 16px; z-index: 150; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.ch-pop { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 10px 8px 10px 12px; cursor: pointer; animation: chpop .2s ease-out; }
.ch-pop > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
@keyframes chpop { from { transform: translateY(10px); opacity: 0; } }
.nav-item .ch-badge { margin-left: auto; background: #ef4444; color: #fff; }
@media (max-width: 1500px) {
  .chat.has-thread .ch-thread { position: absolute; right: 0; top: 0; bottom: 0; z-index: 30; box-shadow: -10px 0 30px rgba(0,0,0,.12); }
  .chat { position: relative; }
}
@media (max-width: 860px) {
  .ch-side { width: 100%; border-right: 0; }
  .chat.has-open .ch-side { display: none; }
  .chat:not(.has-open) .ch-main { display: none; }
  .ch-back { display: inline-flex; }
  .ch-thread { width: 100%; }
  .ch-hint { display: none; }
  .ch-msg { padding-left: 12px; padding-right: 12px; }
  .ch-acts { right: 8px; }
  .ch-head { flex-wrap: wrap; padding: 8px 10px; row-gap: 8px; }
  .ch-head .spacer { display: none; }
  .ch-tabs { order: 10; width: 100%; }
  .ch-tabs button { flex: 1; justify-content: center; }
  .ch-img img { max-width: 100%; }
}

/* task subtasks */
.task-tabs { margin: -4px 0 14px; }
.subtasks .sub-prog { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.subtasks .sub-prog .pct { flex: 1; height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; max-width: 220px; }
.subtasks .sub-prog .pct i { display: block; height: 100%; background: var(--ok); transition: width .2s; }
.sub-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sub-row > input[type=checkbox] { margin-top: 9px; width: 16px; height: 16px; flex: none; }
.sub-row .sub-main { flex: 1; min-width: 0; }
.sub-row input.sub-title { width: 100%; border-color: transparent; background: transparent; padding-left: 4px; font-weight: 600; }
.sub-row input.sub-title:hover, .sub-row input.sub-title:focus { border-color: var(--line); background: #fff; }
.sub-row div.sub-title { font-weight: 600; padding: 6px 4px 0; }
.sub-row.done .sub-title { text-decoration: line-through; color: var(--muted); }
.sub-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.sub-meta select, .sub-meta input[type=date] { width: auto; min-width: 0; padding: 4px 6px; font-size: 13px; }
.sub-meta select { max-width: 220px; }
.sub-btns { display: flex; gap: 2px; flex: none; }
.sub-add { margin-top: 12px; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; }
.sub-add input[name=title] { width: 100%; }
.sub-add .sub-meta { margin-top: 8px; }
.sub-add .sub-meta button { margin-left: auto; }
@media (max-width: 700px) { .sub-meta select, .sub-meta input[type=date] { max-width: 100%; flex: 1 1 130px; } }

/* ---------- Spectrum Archive + "No Updates 7 Days" ---------- */
.toggle-btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.toggle-btn .tg-dot { width: 30px; height: 17px; border-radius: 999px; background: #cbd5e1; position: relative; flex: none; transition: background .15s; }
.toggle-btn .tg-dot::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle-btn.on { background: #fef9c3; border-color: #facc15; color: #713f12; }
.toggle-btn.on .tg-dot { background: #eab308; }
.toggle-btn.on .tg-dot::after { left: 15px; }
table.data tr.stale td { background: #fef9c3; }
table.data tr.stale.click:hover td { background: #fef08a; }
.sp-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 24px; }
.sp-head .kv { margin-bottom: 0; grid-template-columns: 110px 1fr; }
.sp-h { font-size: 16px; margin: 18px 0 8px; }
.sp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.sp-two .kv { grid-template-columns: 1fr auto; max-width: 340px; }
.sp-raw { margin-top: 12px; }
.sp-raw pre, details pre { background: var(--soft); border-radius: 8px; padding: 10px; font-size: 12px; white-space: pre-wrap; }
@media (max-width: 900px) { .sp-head, .sp-two { grid-template-columns: 1fr; } }

/* Global admin */
select.ga-role { min-width: 92px; }
select.ga-role.on { background: #e8f6ee; border-color: #86c59d; color: #166534; font-weight: 600; }

/* ---------- Apps launcher ---------- */
.app-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.app-tile { display: flex; gap: 14px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: inherit; text-decoration: none; transition: box-shadow .15s, border-color .15s; }
.app-tile:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.app-tile.soon { opacity: .6; }
.app-ico { font-size: 30px; width: 48px; height: 48px; display: grid; place-items: center; background: var(--soft); border-radius: 12px; flex: none; }
.app-name { font-weight: 700; font-size: 15px; margin-bottom: 2px; }

/* ---------- Story Writer ---------- */
.pos { color: var(--ok); }
.content.sw-mode { padding: 0; display: flex; flex: none; height: calc(100vh - 56px); height: calc(100dvh - 56px); overflow: hidden; }
.sw-h { margin: 22px 0 10px; display: flex; align-items: center; gap: 12px; }
.sw-arch { font-weight: 400; display: inline-flex; gap: 4px; align-items: center; }
.sw-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.sw-card { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none; min-height: 150px; transition: box-shadow .15s, transform .15s; }
.sw-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.sw-spine { width: 10px; flex: none; }
.sw-card-b { padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.sw-card-t { font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 700; line-height: 1.2; }
.sw-card-meta { display: flex; gap: 4px; flex-wrap: wrap; }
.sw-clip { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-clip3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sw-bar { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.sw-bar span { display: block; height: 100%; border-radius: 99px; }
.sw-empty { grid-column: 1 / -1; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.sw-empty-line { grid-column: 1 / -1; padding: 8px 0; }
.sw-colors { display: flex; gap: 6px; flex-wrap: wrap; }
.sw-color { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; position: relative; display: inline-block; }
.sw-color input { position: absolute; opacity: 0; pointer-events: none; }
.sw-color span { position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; }
.sw-color input:checked + span { border-color: var(--ink); }
.sw-menu { position: fixed; z-index: 200; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 4px; min-width: 190px; }
.sw-menu button { display: flex; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: 6px; text-align: left; }
.sw-menu button:hover { background: var(--soft); }
.sw-menu button.danger { color: var(--danger); }
.sw-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.sw-st { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sw-lbl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }

.sw-shell { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; background: var(--bg); }
.sw-top { display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); min-height: 48px; flex: none; }
.sw-back { font-size: 18px; text-decoration: none; color: var(--muted); padding: 4px 6px; border-radius: 6px; }
.sw-back:hover { background: var(--soft); color: var(--ink); }
.sw-dot { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.sw-ptitle { font-family: Georgia, serif; font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.sw-tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.sw-tabs button { border: 0; background: none; border-radius: 0; padding: 14px 10px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; font-size: 13px; }
.sw-tabs button:hover { color: var(--ink); background: none; }
.sw-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.sw-save { white-space: nowrap; }
.sw-body { flex: 1; min-height: 0; overflow: auto; position: relative; }
.sw-body-write { overflow: hidden; display: flex; }
.sw-pad { padding: 18px 20px; }

/* write */
.sw-write { display: grid; grid-template-columns: 270px 1fr 300px; flex: 1; min-height: 0; position: relative; }
.sw-write.no-insp { grid-template-columns: 270px 1fr 0; }
.sw-write.no-insp .sw-insp { display: none; }
.sw-binder { background: #fafbfc; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.sw-binder-head { display: flex; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sw-tree { flex: 1; overflow-y: auto; padding: 6px; }
.sw-chrow, .sw-scrow { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 7px; cursor: pointer; user-select: none; }
.sw-chrow { font-weight: 600; font-size: 13px; margin-top: 4px; }
.sw-chrow.cur { color: var(--accent); }
.sw-chrow:hover, .sw-scrow:hover { background: var(--soft); }
.sw-scrow { padding-left: 26px; font-size: 13px; }
.sw-scrow.on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--ink); }
.sw-chname, .sw-scname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-tw { padding: 0 2px; width: 18px; font-size: 11px; color: var(--muted); }
.sw-wc { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 400; }
.sw-more { padding: 0 4px; opacity: 0; font-size: 14px; }
.sw-chrow:hover .sw-more, .sw-scrow:hover .sw-more, .sw-scrow.on .sw-more { opacity: 1; }
.sw-pubdot { color: var(--ok); font-size: 9px; }
.sw-drop-end { padding: 2px 0 2px 22px; border-radius: 7px; }
.sw-drop-end button { color: var(--muted); }
.sw-binder-foot { padding: 8px 12px; border-top: 1px solid var(--line); }
.sw-over { box-shadow: inset 0 2px 0 var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent) !important; }
.sw-over-end { box-shadow: inset 0 -2px 0 var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent) !important; }
.sw-drag { opacity: .4; }

.sw-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.sw-toolbar { display: flex; align-items: center; gap: 1px; padding: 5px 10px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; scrollbar-width: thin; }
.sw-toolbar button { padding: 5px 8px; min-width: 30px; justify-content: center; font-size: 14px; }
.sw-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; flex: none; }
.sw-only-sm { display: none !important; }
.sw-scroll { flex: 1; overflow-y: auto; background: #eef0f3; padding: 28px 16px 80px; transition: background .2s; }
.sw-page { max-width: 760px; margin: 0 auto; background: #fff; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.05); padding: 48px 64px 80px; min-height: 100%; --sw-size: 18px; }
.sw-page.font-serif .sw-editor { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif; }
.sw-page.font-sans .sw-editor { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.sw-page.font-mono .sw-editor { font-family: "Courier Prime", "Courier New", Courier, monospace; }
.sw-chhead { text-align: center; margin-bottom: 4px; }
.sw-chtitle, .sw-sctitle { border: 0; background: transparent; text-align: center; width: 100%; padding: 2px 4px; border-radius: 6px; color: inherit; }
.sw-chtitle { font-family: Georgia, serif; font-size: 26px; font-weight: 700; }
.sw-sctitle { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 26px; }
.sw-chtitle:focus, .sw-sctitle:focus { outline: 1px dashed var(--line); }
.sw-editor { font-size: var(--sw-size); line-height: 1.75; outline: none; min-height: 50vh; color: #1f2328; caret-color: var(--accent); word-wrap: break-word; }
.sw-editor p { margin: 0 0 .9em; }
.sw-editor h2 { font-size: 1.25em; margin: 1.2em 0 .5em; } .sw-editor h3 { font-size: 1.1em; margin: 1em 0 .4em; }
.sw-editor blockquote { margin: 1em 2em; padding-left: 1em; border-left: 3px solid var(--line); font-style: italic; color: #444; }
.sw-editor hr, .sw-reader-text hr { border: 0; text-align: center; margin: 1.6em 0; height: 1.2em; }
.sw-editor hr::after, .sw-reader-text hr::after { content: "⁂"; color: var(--muted); }
.sw-editor:empty::before, .sw-editor > p:only-child:has(> br:only-child)::before { content: attr(data-ph); color: #b0b5bd; position: absolute; pointer-events: none; }
.sw-scroll.night { background: #15171c; }
.sw-scroll.night .sw-page { background: #1f2229; box-shadow: none; }
.sw-scroll.night .sw-editor, .sw-scroll.night .sw-chtitle { color: #d8dbe1; }
.sw-scroll.night .sw-editor blockquote { color: #aab; border-color: #3a3f4a; }
.sw-status { display: flex; gap: 16px; padding: 6px 14px; background: var(--panel); border-top: 1px solid var(--line); color: var(--muted); flex-wrap: wrap; flex: none; }
.sw-status b { color: var(--ink); font-variant-numeric: tabular-nums; }
.sw-status .pos b { color: var(--ok); }
.sw-sprint { color: var(--accent); font-weight: 600; }
.sw-insp { border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 0 14px 14px; min-height: 0; }
.sw-insp-head { display: flex; align-items: center; padding: 12px 0 10px; position: sticky; top: 0; background: var(--panel); z-index: 1; }
.sw-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.sw-chips .chip { font-size: 12px; padding: 2px 8px; }

.sw-focus { position: fixed; inset: 0; z-index: 70; }
.sw-focus .sw-top, .sw-focus .sw-binder, .sw-focus .sw-insp, .sw-focus .sw-status { display: none !important; }
.sw-focus .sw-write { grid-template-columns: 1fr !important; }
.sw-focus .sw-toolbar { opacity: .15; transition: opacity .2s; }
.sw-focus .sw-toolbar:hover { opacity: 1; }
.sw-focus .sw-page { box-shadow: none; }

.sw-snaps { display: grid; grid-template-columns: 260px 1fr; gap: 14px; min-height: 300px; max-height: 65vh; }
.sw-snaplist { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.sw-snap { flex-direction: column; align-items: flex-start; text-align: left; white-space: normal; }
.sw-snap.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.sw-snapview { overflow-y: auto; border-left: 1px solid var(--line); padding-left: 14px; }
.sw-reader-text { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 18px; line-height: 1.75; }
.sw-reader-text p { margin: 0 0 .9em; }
.sw-reader-text blockquote { margin: 1em 2em; font-style: italic; }
.sw-reader-text .scene-break { text-align: center; color: var(--muted); margin: 1.4em 0; }

/* outline */
.sw-outline { display: flex; flex-direction: column; gap: 14px; }
.sw-och { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 12px; }
.sw-och-h { display: flex; align-items: center; gap: 8px; cursor: grab; }
.sw-grip { color: var(--muted); }
.sw-och-syn { margin: 4px 0 0 20px; }
.sw-ocs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; }
.sw-oc { background: #fffdf5; border: 1px solid #ece6cf; border-top: 4px solid; border-radius: 8px; padding: 10px; cursor: pointer; min-height: 110px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.sw-oc:hover { box-shadow: var(--shadow); }
.sw-oc.add { background: none; border: 1px dashed var(--line); box-shadow: none; display: grid; place-items: center; cursor: default; }
.sw-oc-t { font-weight: 700; }
.sw-oc-s { font-size: 13px; flex: 1; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.sw-oc-m { display: flex; align-items: center; gap: 5px; }

/* plot grid */
.sw-gridwrap { max-height: calc(100dvh - 210px); overflow: auto; }
.sw-grid td { vertical-align: top; }
.sw-gc-scene { min-width: 220px; max-width: 280px; }
.sw-gc-pl { min-width: 220px; }
.sw-grid thead th { z-index: 2; }
.sw-cell { border: 1px solid transparent; background: transparent; resize: none; min-height: 44px; font-size: 13px; padding: 5px 7px; border-left: 3px solid var(--pl); background: color-mix(in srgb, var(--pl) 5%, transparent); overflow: hidden; }
.sw-cell:hover { border-color: var(--line); border-left-color: var(--pl); }

/* timeline */
.sw-tl-wrap { overflow: auto; max-height: calc(100dvh - 200px); }
.sw-tl { display: grid; gap: 6px; padding: 10px; width: max-content; }
.sw-tl-corner { position: sticky; left: 0; background: var(--panel); z-index: 3; align-self: center; }
.sw-tl-h { position: sticky; top: 0; z-index: 2; background: var(--soft); border-radius: 6px; padding: 6px 8px; display: flex; align-items: center; gap: 6px; cursor: grab; white-space: nowrap; overflow: hidden; }
.sw-tl-lane { position: sticky; left: 0; z-index: 1; background: var(--panel); padding: 8px 10px; font-weight: 600; font-size: 13px; display: flex; align-items: center; border-radius: 4px; }
.sw-tl-card { border: 1px solid; border-left-width: 4px; border-radius: 8px; padding: 7px 9px; cursor: pointer; font-size: 13px; min-height: 64px; }
.sw-tl-card:hover { box-shadow: var(--shadow); }
.sw-tl-empty { border-bottom: 1px dashed var(--line); align-self: center; }

/* story bible */
.sw-bible { display: grid; grid-template-columns: 290px 1fr; height: 100%; }
.sw-bible-list { border-right: 1px solid var(--line); background: #fafbfc; overflow-y: auto; }
.sw-bk { padding: 0 8px 8px; }
.sw-bk-h { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 4px 4px; }
.sw-bk-h button { margin-left: auto; }
.sw-bi { display: flex; gap: 8px; align-items: flex-start; width: 100%; border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: 7px; white-space: normal; }
.sw-bi > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.sw-bi .sw-st { margin-top: 6px; }
.sw-bi:hover { background: var(--soft); }
.sw-bi.on { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.sw-bible-main { overflow-y: auto; padding: 18px 22px; }
.sw-el { max-width: 860px; }
.sw-el-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.sw-el-fields .sw-wide { grid-column: span 1; }
.sw-appears { display: flex; flex-direction: column; gap: 4px; }

/* goals */
.sw-goal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sw-goal-grid .panel { margin-bottom: 16px; }
.sw-big-bar { height: 14px; background: var(--soft); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.sw-big-bar span { display: block; height: 100%; border-radius: 99px; }
.sw-chart { width: 100%; height: auto; color: var(--ink); }
.sw-hbar { display: grid; grid-template-columns: minmax(90px, 200px) 1fr 60px; gap: 8px; align-items: center; margin-bottom: 6px; }
.sw-hbar-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.sw-hbar-b { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.sw-hbar-b span { display: block; height: 100%; border-radius: 99px; }
.sw-hbar .num { text-align: right; font-variant-numeric: tabular-nums; }

/* publish & settings */
.sw-publish, .sw-settings { max-width: 980px; }
.sw-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.sw-switch input { position: absolute; opacity: 0; }
.sw-switch span { width: 38px; height: 22px; background: #cbd5e1; border-radius: 99px; position: relative; transition: background .15s; flex: none; }
.sw-switch span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sw-switch input:checked + span { background: var(--ok); }
.sw-switch input:checked + span::after { left: 18px; }
.sw-switch input:disabled + span { opacity: .5; }
.sw-exbtns button { padding: 10px 14px; }
.sw-people { display: flex; flex-direction: column; gap: 8px; }
.sw-person { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }

/* reading room */
.sw-read { display: grid; grid-template-columns: 260px 1fr; height: 100%; }
.sw-read-toc { border-right: 1px solid var(--line); background: var(--panel); padding: 16px; overflow-y: auto; }
.sw-read-book { display: flex; gap: 10px; margin-bottom: 10px; }
.sw-read-book .sw-spine { width: 8px; border-radius: 3px; }
.sw-read-toc ol { padding-left: 22px; margin: 10px 0; }
.sw-read-toc li { margin: 5px 0; font-size: 14px; }
.sw-read-toc a { color: inherit; text-decoration: none; }
.sw-read-toc a.on { color: var(--accent); font-weight: 700; }
.sw-read-main { overflow-y: auto; padding: 24px 16px 60px; background: #eef0f3; }
.sw-read-page { max-width: 720px; margin: 0 auto; background: #fff; padding: 44px 60px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.sw-read-h { font-family: Georgia, serif; text-align: center; font-size: 30px; margin: 10px 0 30px; }
.sw-read-nav { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 16px; }
.sw-comments { max-width: 720px; margin: 20px auto 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.sw-comment { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sw-comment-b { white-space: pre-wrap; margin-top: 2px; }
.sw-cform { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; margin-top: 12px; }

@media (max-width: 1100px) {
  .sw-write, .sw-write.no-insp { grid-template-columns: 250px 1fr; }
  .sw-insp { display: none; position: absolute; right: 0; top: 0; bottom: 0; width: min(320px, 92vw); z-index: 30; box-shadow: -10px 0 30px rgba(0,0,0,.15); }
  .sw-write.show-insp .sw-insp, .sw-write.no-insp.show-insp .sw-insp { display: block; }
  .sw-write .sw-insp-head .sw-only-sm { display: inline-flex !important; }
  .sw-goal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sw-write, .sw-write.no-insp { grid-template-columns: 1fr; }
  .sw-binder { display: none; position: absolute; left: 0; top: 0; bottom: 0; width: min(300px, 88vw); z-index: 30; box-shadow: 10px 0 30px rgba(0,0,0,.15); }
  .sw-write.show-binder .sw-binder { display: flex; }
  .sw-only-sm { display: inline-flex !important; }
  .sw-more { opacity: 1; }
  .sw-page { padding: 28px 22px 60px; }
  .sw-scroll { padding: 12px 8px 60px; }
  .sw-ptitle { max-width: 130px; }
  .sw-top { flex-wrap: wrap; padding: 0 8px; }
  .sw-tabs { order: 5; flex-basis: 100%; }
  .sw-tabs button { padding: 8px 8px 10px; }
  .sw-save { margin-left: auto; }
  .sw-pad { padding: 12px; }
  .sw-bible, .sw-read { grid-template-columns: 1fr; height: auto; }
  .sw-bible-list, .sw-read-toc { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .sw-read-page { padding: 26px 20px; }
  .sw-el-fields { grid-template-columns: 1fr; }
  .sw-snaps { grid-template-columns: 1fr; max-height: none; }
  .sw-snapview { border-left: 0; padding-left: 0; }
}
@media print {
  .sidebar, .topbar, .sw-top, .sw-binder, .sw-insp, .sw-toolbar, .sw-status { display: none !important; }
}

/* A/R invoice drill-down (027): click an aging amount */
table.data td.amt { cursor: pointer; }
table.data td.amt:hover, table.data td.amt.on { background: #eef4ff !important; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
table.data tr.inv-expand > td { background: #f8fafc; padding: 8px 12px 12px 28px; cursor: default; }
.inv-box { border-left: 3px solid var(--accent); padding-left: 12px; }
table.data.inv-table { background: var(--panel); }
table.data.inv-table th, table.data.inv-table td { font-size: 12.5px; padding: 5px 8px; }

/* ---------- Lists > Vehicles (vehicles.js, SQL 037) ---------- */
.vh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.vh-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.vh-card:hover, .vh-card:focus { box-shadow: 0 6px 18px rgba(15,23,42,.10); transform: translateY(-1px); outline: none; }
.vh-cover { position: relative; aspect-ratio: 16 / 9; background: var(--soft); display: grid; place-items: center; font-size: 54px; }
.vh-cover img { width: 100%; height: 100%; object-fit: cover; }
.vh-status { position: absolute; top: 8px; left: 8px; background: #374151; color: #fff; }
.vh-card-body { padding: 12px 14px 14px; }
.vh-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; color: var(--muted); }
.vh-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.vh-alerts .vh-alert { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-top: 1px solid var(--line); cursor: pointer; flex-wrap: wrap; }
.vh-alerts .vh-alert:first-of-type { border-top: 0; }
.vh-alerts .vh-alert:hover { background: var(--soft); }
.vh-alert .badge { margin-left: auto; }
.vh-head { align-items: center; }
.vh-head-main { display: flex; align-items: center; gap: 12px; }
.vh-head-pic { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: var(--soft); display: grid; place-items: center; font-size: 28px; flex: none; }
.vh-head-pic img { width: 100%; height: 100%; object-fit: cover; }
.vh-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 16px; }
.vh-kv { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); }
.vh-kv:first-of-type { border-top: 0; }
.vh-kv > span { color: var(--muted); font-size: 13px; flex: none; }
.vh-kv > b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.vh-kv.click { cursor: pointer; } .vh-kv.click:hover { background: var(--soft); }
.vh-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .03em; }
.vh-clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vh-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.vh-checks.inline { margin-top: 4px; }
.vh-checks label, .vh-check { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.vh-checks label input, .vh-check input { width: auto; }
.vh-check { margin: 0 0 10px; }
.vh-form h4 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.vh-form h4:first-child { margin-top: 0; }
.vh-drop.dragging { outline: 2px dashed var(--accent); outline-offset: -6px; }
.vh-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.vh-photo { position: relative; border-radius: 10px; overflow: hidden; background: var(--soft); aspect-ratio: 1; cursor: pointer; display: grid; place-items: center; }
.vh-photo img { width: 100%; height: 100%; object-fit: cover; }
.vh-photo-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 5px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.vh-star { position: absolute; top: 6px; right: 6px; border: 0; background: rgba(0,0,0,.45); color: #fff; border-radius: 999px; width: 28px; height: 28px; padding: 0; display: grid; place-items: center; font-size: 15px; }
.vh-star.on { background: #f59e0b; }
@media (max-width: 560px) { .vh-head-main { width: 100%; } .vh-clip { max-width: 200px; } }

/* ---------------------------------------------------------------- JS Electric field operations (jse.js) */
.drawer.wide { width: min(880px, 100%); }
.jse-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.jse-foot .spacer { flex: 1; }
.jse-sec { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 4px; margin: 0 0 14px; }
.jse-sec legend { font-weight: 700; font-size: 13px; padding: 0 6px; }
.jse-sec:first-child { border: 0; padding: 0; }
.jse-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.jse-grid .span2 { grid-column: 1 / -1; }
.drawer.wide .jse-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jse-bool { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; display: flex; }
.jse-bool input { width: auto; }
.jse-lines table.jse-lt input, .jse-lines table.jse-lt select { min-width: 70px; padding: 5px 6px; }
.jse-lines table.jse-lt td { padding: 3px 4px; }
.jse-lines-total { font-size: 13px; }
.jse-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.jse-check { display: flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; background: #fff7ed; cursor: pointer; }
.jse-check.ok { background: #ecfdf5; border-color: #a7f3d0; }
.jse-check input { width: auto; margin: 0; }
.jse-sign canvas { width: 100%; max-width: 600px; height: 150px; border: 1px dashed var(--line); border-radius: 8px; background: #fff; touch-action: none; display: block; }
.jse-sign canvas.hidden { display: none; }
.jse-sign-img { max-height: 120px; background: #fff; border: 1px solid var(--line); border-radius: 8px; display: block; margin-bottom: 6px; }
.jse-totals { display: grid; grid-template-columns: repeat(6, auto); gap: 4px 14px; justify-content: end; font-size: 13px; margin: 6px 0 10px; }
.jse-totals div { display: flex; flex-direction: column; align-items: flex-end; }
.jse-totals span { color: var(--muted); font-size: 11px; }
.jse-totals .t b { color: var(--accent); }
.jse-legacy-files { margin: 12px 0; }
.jse-lf { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.jse-lf a { display: flex; flex-direction: column; align-items: center; width: 92px; font-size: 11px; text-decoration: none; color: inherit; word-break: break-all; text-align: center; }
.jse-lf img { width: 92px; height: 70px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.jse-orig pre { max-height: 260px; overflow: auto; font-size: 11px; background: var(--soft); padding: 8px; border-radius: 6px; }
.jse-bar { padding: 10px 12px; }
.jse-dates input { width: 140px; }
.jse-clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jse-table td { vertical-align: top; }
.stat.warn .v { color: #b45309; }
.jse-st-active, .jse-st-approved, .jse-st-complete, .jse-st-billed { background: #e8f6ee; color: #166534; }
.jse-st-pending, .jse-st-open, .jse-st-unbilled, .jse-st-set-to-deliver, .jse-st-set-for-pick-up { background: #fff4e5; color: #92400e; }
.jse-st-inactive, .jse-st-deleted, .jse-st-sold { background: var(--soft); color: var(--muted); }
.jse-st-inactive-broken, .jse-st-rejected, .jse-st-overdue { background: #fdecec; color: #991b1b; }
.jse-cards { display: grid; gap: 8px; }
.jse-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; }
.jse-card-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 4px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .jse-grid, .drawer.wide .jse-grid { grid-template-columns: 1fr; }
  .jse-totals { grid-template-columns: repeat(3, auto); }
}
/* JS Electric Mobile */
.m-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.m-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 104px; padding: 12px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none; font-weight: 600; }
.m-tile:active { transform: scale(.98); }
.m-ico { font-size: 30px; }
body.is-mobile .content { padding-bottom: 80px; }
body.is-mobile button, body.is-mobile input, body.is-mobile select, body.is-mobile textarea { font-size: 16px; }
body.is-mobile .jse-foot button { min-height: 42px; }
body.is-mobile .drawer { width: 100%; }
.jse-form .pl-wrap { display: grid; grid-template-columns: 1fr auto; gap: 0 4px; align-items: center; }
.jse-form .pl-wrap > span { grid-column: 1 / -1; }
.jse-form .pl-wrap .pl-edit { margin: 0; }
body.is-mobile .jse-foot .primary { order: -1; flex: 1 0 100%; }
.jse-train-box { margin-bottom: 14px; }

/* Employees: badge dates (JS Electric, SQL 044) */
.emp-bdg { display: inline-block; font-size: 11px; line-height: 1.5; padding: 0 7px; border-radius: 9px; background: #e8f6ee; color: #166534; white-space: nowrap; }
.emp-bdg.soon { background: #fff4e5; color: #92400e; }
.emp-bdg.bad { background: #fdecec; color: #991b1b; }
.emp-bdg-t td, .emp-bdg-t th { padding: 6px 8px; }

/* ---------- top icon bar (SITE.topnav: JS Electric Admin + Field) ---------- */
.shell.tn { display: flex; flex-direction: column; min-height: 100%; }
.tn-head { position: sticky; top: 0; z-index: 30; background: #111827; color: #e5e7eb; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.tn-top { display: flex; align-items: center; gap: 10px; padding: 8px 16px 0; min-height: 44px; }
.tn-top .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 15px; }
.tn-top .brand-dot { width: 26px; height: 26px; }
.tn-me { background: transparent; border: 1px solid transparent; color: #e5e7eb; padding: 4px 6px 4px 10px; border-radius: 999px; cursor: pointer; }
.tn-me:hover, .tn-me.open, .tn-me.active { background: #1f2937; border-color: #374151; }
.tn-bar { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tn-bar::-webkit-scrollbar { display: none; }
.tn-row { display: flex; width: max-content; min-width: 100%; justify-content: center; gap: 2px; padding: 4px 12px 8px; }
.tn-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 74px; max-width: 128px; padding: 7px 8px 6px;
  border: 0; border-radius: 10px; background: transparent; color: #cbd5e1; text-decoration: none; cursor: pointer; font: inherit;
  margin: 0; position: relative;
}
.tn-btn .ni { width: 24px; height: 24px; flex: none; }
.tn-lbl { font-size: 11.5px; line-height: 1.2; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* unread chat count sits on the icon's top-right corner */
.tn-btn .ch-badge { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0; min-width: 18px; padding: 0 5px; font-size: 10.5px; line-height: 17px; text-align: center; }
.tn-caret { font-style: normal; font-size: 9px; margin-left: 3px; opacity: .7; }
.tn-btn:hover { background: #1f2937; color: #fff; }
.tn-btn.open { background: #273244; color: #fff; }
.tn-btn.active { background: var(--accent); color: var(--accent-ink); }
.tn-btn.active .tn-caret { opacity: .9; }
.tn-btn:focus-visible, .tn-me:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tn-pop {
  position: fixed; z-index: 45; min-width: 230px; max-width: min(340px, calc(100vw - 16px)); max-height: calc(100vh - 140px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(15,23,42,.22); padding: 6px;
}
.tn-pop .tn-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px calc(10px + var(--d, 0) * 18px); border-radius: 8px;
  color: var(--ink); text-decoration: none; margin: 0; font-size: 13.5px;
}
.tn-pop .tn-link .ni { width: 18px; height: 18px; color: var(--muted); flex: none; }
.tn-pop .tn-link:hover { background: var(--soft); color: var(--ink); }
.tn-pop .tn-link.active { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--ink); font-weight: 600; }
.tn-pop .tn-link.active .ni { color: var(--accent); }
.tn-pop .tn-link .badge { margin-left: auto; }
.tn-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 10px 4px; }
.shell.tn .content { width: 100%; max-width: 1600px; margin: 0 auto; }
.m-ico .ni { width: 30px; height: 30px; }
@media (max-width: 640px) {
  .tn-top { padding: 6px 12px 0; }
  .tn-row { justify-content: safe center; padding: 2px 8px 6px; }
  .tn-btn { min-width: 64px; padding: 6px 6px 5px; }
  .tn-lbl { font-size: 10.5px; }
  .tn-pop { max-height: calc(100vh - 130px); }
  .tn-pop .tn-link { padding-top: 11px; padding-bottom: 11px; font-size: 15px; }
  .shell.tn .content { padding: 14px 12px; }
}
@media print { .tn-head, .tn-pop { display: none !important; } }
.m-ico .ni { color: var(--accent); }

/* gear (Users & access / Global admin), top right on every site, admins only */
.gear-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; margin-left: 2px; border-radius: 50%;
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; flex: none; }
.gear-btn .ni { width: 22px; height: 22px; }
.gear-btn:hover, .gear-btn.open { background: var(--soft); color: var(--ink); border-color: var(--line); }
.gear-btn.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tn-head .gear-btn { color: #cbd5e1; }
.tn-head .gear-btn:hover, .tn-head .gear-btn.open { background: #1f2937; color: #fff; border-color: #374151; }
.tn-head .gear-btn.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* site switcher: the site name at the top left */
button.brand-sw { border: 0; background: transparent; font: inherit; cursor: pointer; text-align: left; border-radius: 10px; margin: 0; }
.sidebar button.brand-sw { width: calc(100% - 12px); margin: 6px 6px 0; padding: 12px 10px; color: #fff; font-weight: 700; }
.tn-top button.brand-sw { padding: 4px 10px 4px 4px; color: #fff; font-weight: 700; font-size: 15px; }
button.brand-sw:hover, button.brand-sw.open { background: #1f2937; color: #fff; }
.brand-caret { font-style: normal; font-size: 11px; opacity: .75; margin-left: auto; padding-left: 6px; }
.tn-pop .tn-link.here { background: var(--soft); font-weight: 600; cursor: default; }
.tn-check { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; }
.tn-pop { z-index: 60; }
/* logos under the site name (left) and account name (right), SITE.logos */
.tn-side { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.tn-side-r { align-items: flex-end; }
.tn-acct { display: flex; align-items: center; gap: 10px; }
.tn-logo { display: block; height: 52px; width: auto; }
.tn-logo-l { margin-left: 4px; }
@media (max-width: 640px) { .tn-logo { height: 38px; } }
@media (max-width: 640px) { .tn-top .brand-name { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* ---------------- Profit Center (profit.js) ---------------- */
.pc-jobbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.pc-jobbar .spacer { flex: 1; }
.pc-search { flex: 1 1 280px; max-width: 420px; }
.pc-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pc-seg button { border: 0; border-radius: 0; padding: 6px 14px; background: var(--panel); }
.pc-seg button.on { background: var(--accent); color: var(--accent-ink); }
.pc-subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pc-subtabs button { border-radius: 999px; padding: 5px 14px; font-size: 13px; }
.pc-subtabs button.on { background: #1f2937; color: #fff; border-color: #1f2937; }
.pc-tall { max-height: 70vh; overflow: auto; }
.pc-up2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
@media (max-width: 900px) { .pc-up2 { grid-template-columns: 1fr; } }
.pc-report { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.pc-rep-head { display: flex; gap: 28px; align-items: baseline; flex-wrap: wrap; font-size: 17px; }
.pc-rep-head .pc-k { color: var(--muted); margin-right: 14px; font-size: 15px; }
.pc-code { font-size: 20px; }
.pc-jname { font-size: 17px; }
.pc-rep-meta { margin: 4px 0 6px; }
.pc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
@media (max-width: 760px) { .pc-cols { grid-template-columns: 1fr; } }
.pc-sec { margin-top: 18px; }
.pc-sec-h { display: flex; align-items: center; gap: 14px; font-weight: 600; color: #1d4ed8; margin-bottom: 6px; }
.pc-sec-h i { flex: 1; border-top: 1px solid #9ca3af; }
.pc-r { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0 3px 14px; max-width: 420px; }
.pc-n { font-variant-numeric: tabular-nums; text-align: right; }
table.pc-ct { border-collapse: collapse; width: 100%; max-width: 760px; margin-left: 14px; }
table.pc-ct th { font-weight: 600; text-decoration: underline; color: var(--ink); padding: 4px 10px; text-align: left; }
table.pc-ct td { padding: 4px 10px; }
table.pc-ct .num { text-align: right; font-variant-numeric: tabular-nums; }
table.pc-ct tr.pc-tot td, table.data tr.pc-tot td { font-weight: 700; border-top: 2px solid #9ca3af; background: #fafafa; }
.pc-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; vertical-align: 0; }
.pc-svg { width: 100%; height: auto; display: block; font-family: inherit; }
.pc-svg .pc-ax { font-size: 12px; fill: #52514e; }
.pc-svg .pc-val { font-size: 12px; fill: #0b0b0b; font-weight: 600; }
.pc-svg .pc-grid { stroke: #e5e7eb; stroke-width: 1; }
.pc-svg .pc-base, .pc-svg .pc-zero { stroke: #9ca3af; stroke-width: 1; }
.pc-svg g[data-tip]:hover path, .pc-svg g[data-tip]:hover rect[fill]:not([fill="transparent"]) { opacity: .85; }
.pc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: #52514e; margin-bottom: 6px; }
.pc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.pc-tip { position: fixed; z-index: 1000; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 8px; padding: 8px 10px; font-size: 12px; pointer-events: none; min-width: 170px; }
.pc-tip-h { font-weight: 700; margin-bottom: 4px; }
.pc-tip-row { display: flex; align-items: center; gap: 6px; }
.pc-tip-row i { width: 9px; height: 9px; border-radius: 2px; }
.pc-tip-row span { flex: 1; color: #52514e; }
.pc-tip-row b { font-variant-numeric: tabular-nums; }
.pc-gtitle { text-align: center; margin: 4px 0 14px; }
.pc-gtitle h2 { font-size: 20px; margin: 0 0 2px; }
.pc-kpis .stat { text-align: center; }
.pc-kpis .stat .v { font-size: 22px; }
table.pc-gt td { padding-top: 11px; padding-bottom: 11px; }
.pc-caret { display: inline-block; width: 12px; color: var(--muted); }
tr.pc-sub > td { background: #f8fafc; padding: 8px 12px 14px 28px; }
.pc-gsub table.data { background: #fff; border: 1px solid var(--line); }
.pc-grp { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.pc-grp .row { margin-bottom: 6px; }
.pc-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 12px; max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.pc-pk { display: flex; gap: 8px; align-items: flex-start; padding: 3px 4px; border-radius: 6px; cursor: pointer; }
.pc-pk:hover { background: var(--soft); }
.pc-pk.hidden { display: none; }
.pc-taken { color: var(--warn); }
@media print {
  .pc-noprint, .tn-head, .sidebar, .topbar, .tabs, .pc-tip { display: none !important; }
  body, .content { background: #fff !important; }
  .content { padding: 0 !important; margin: 0 !important; }
  .pc-report, .panel { border: 0; box-shadow: none; }
  .pc-tall { max-height: none; overflow: visible; }
  .pc-break { break-before: page; }
}
.pc-up3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; align-items: start; }
@media (max-width: 1100px) { .pc-up3 { grid-template-columns: 1fr; } }

/* top icon bar: full-height pages fit under the taller header */
.shell.tn .content.chat-mode, .shell.tn .content.sw-mode { height: calc(100vh - var(--head-h, 112px)); height: calc(100dvh - var(--head-h, 112px)); max-width: none; }

/* A/R: notes on single invoices (049) */
table.data.inv-table tr.inv-line { cursor: pointer; }
table.data.inv-table tr.inv-line:hover td, table.data.inv-table tr.inv-line.on td { background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
table.data.inv-table tr.inv-notes > td { background: #fffdf5; padding: 8px 10px 10px 22px; cursor: default; }
.inv-note-box { border-left: 3px solid #eab308; padding-left: 10px; max-width: 760px; }
.inv-note-box .note { margin-bottom: 6px; }
table.data.inv-table td.inv-nc { max-width: 220px; }
/* personal care (Health, SQL 058) */
.h-care { grid-column: 1 / -1; }
.care { text-align: left; }
.care .w-title { justify-content: flex-start; font-size: 17px; padding-left: 0; margin-bottom: 10px; }
.care-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.care-bar { flex: 0 1 260px; height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.care-bar i { display: block; height: 100%; background: var(--who, var(--accent)); transition: width .2s; }
.care-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; align-items: start; }
.care-group { background: var(--soft); border-radius: 12px; padding: 10px; }
.care-group.full { background: color-mix(in srgb, var(--ok) 8%, var(--soft)); }
.care-gh { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.care-gi { font-size: 20px; }
.care-group .tick { background: var(--panel, #fff); padding: 7px 10px; }
.care-group .tick.on { background: color-mix(in srgb, var(--ok) 10%, #fff); }
.care-prod, .care-ago, .care-due { display: block; font-size: 11px; line-height: 1.3; color: var(--muted); }
.care-due { color: #b45309; font-weight: 600; }
.care-note { margin-top: 12px; }
.care-note input { width: 100%; }
.care-set-group { border-top: 1px solid var(--line); padding: 8px 0; }
.care-set-group h4 { margin: 4px 0 6px; }
.care-set-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.care-prod-in { flex: 0 1 220px; min-width: 0; }
.care-add { margin-top: 4px; }
@media (max-width: 640px) { .care-prod-in { flex: 1 1 100%; } }
