/* myStuf "Beta Look" — Compass/CAPS-inspired shell.
   Loads AFTER css/site.css (tokens: colors, the --space-, --radius- and --text- scales, --shadow, --danger)
   on every web/beta/*.html page. This file owns the whole beta visual system on its own - it does NOT
   load css/app.css, so every component the classic app gets from app.css (modal, form fields, rows,
   toolbars) is redeclared here under the same class names app.openModal()/the shared JS already
   produce, just with the new shell's own spacing/look. No new colors anywhere - every value below is
   one of site.css's existing custom properties. */

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: 'Inter', sans-serif; color: var(--ink); background: var(--bg); }

/* ---------- Grid shell ---------- */
.beta-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  grid-template-rows: 5em 1fr;
  grid-template-areas: "header header" "nav content";
  position: fixed;
  inset: 0;
}

/* ---------- Header ---------- */
.beta-header {
  grid-area: header;
  background: var(--brand-navy);
  border-bottom: 2px solid var(--teal);
  color: #fff;
  display: flex;
  align-items: center;
  gap: var(--space-7);
  padding: 0 var(--space-8);
}
.beta-header-brand { display: flex; align-items: center; gap: var(--space-4); font-weight: 700; font-size: var(--text-lg); white-space: nowrap; flex-shrink: 0; }
.beta-header-brand img { height: 64px; width: auto; flex-shrink: 0; object-fit: contain; }
.beta-header-brand-suffix { font-weight: 600; font-size: var(--text-xl); opacity: 0.85; margin-left: calc(-1 * var(--space-3)); }
.beta-header-spacer { flex: 1; }

/* ---------- Hamburger + drawer scrim (mobile only) ----------
   Both are rendered unconditionally by BetaShell.renderHeader() and hidden here at desktop widths,
   rather than being injected/removed on a resize listener - a media query is the only thing that can
   keep the visible state correct through an orientation change or a window drag with no JS running. */
.beta-nav-toggle {
  display: none; flex-shrink: 0; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-left: calc(-1 * var(--space-5));
  background: none; border: none; border-radius: var(--radius-sm); padding: 0; cursor: pointer; color: #fff;
}
.beta-nav-toggle:hover { background: rgba(255,255,255,0.12); }
.beta-nav-toggle:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.beta-nav-toggle-bars, .beta-nav-toggle-bars::before, .beta-nav-toggle-bars::after {
  display: block; width: 22px; height: 2px; border-radius: 2px; background: #fff;
}
.beta-nav-toggle-bars { position: relative; }
.beta-nav-toggle-bars::before, .beta-nav-toggle-bars::after { content: ''; position: absolute; left: 0; }
.beta-nav-toggle-bars::before { top: -7px; }
.beta-nav-toggle-bars::after { top: 7px; }

.beta-nav-scrim { display: none; position: fixed; inset: 0; z-index: 90; background: rgba(11, 37, 69, 0.45); }

/* The header's own Dashboard/Collections/Groups/More/myStuf.app links have nowhere to sit once the
   header shrinks to phone width, so each sidebar renderer prepends a copy of them wrapped in this
   class. Hidden at desktop (where the real header links are visible) to avoid showing both. */
.beta-nav-mobile-only { display: none; }
.beta-nav-drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: 0 var(--space-5) var(--space-4) var(--space-7);
}
.beta-nav-drawer-title {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint);
}
.beta-nav-drawer-close {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; border-radius: var(--radius-sm);
  background: none; color: var(--ink-soft); font-size: var(--text-lg); line-height: 1; cursor: pointer; padding: 0;
}
.beta-nav-drawer-close:hover { background: var(--surface-neutral); color: var(--ink); }
.beta-header-back {
  color: rgba(255,255,255,0.85); text-decoration: none; font-size: var(--text-sm); font-weight: 600; white-space: nowrap;
  border-bottom: 2px solid transparent; padding-bottom: var(--space-2);
}
.beta-header-back:hover { color: #fff; }
.beta-header-back.active { color: #fff; border-bottom-color: var(--teal); }
.beta-account { position: relative; }
.beta-account-trigger {
  display: flex; align-items: center; gap: var(--space-3); background: none; border: none; cursor: pointer;
  color: #fff; font-family: 'Inter', sans-serif; font-size: var(--text-sm); font-weight: 600; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
}
.beta-account-trigger:hover { background: rgba(255,255,255,0.1); }
.beta-account-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--surface-neutral); color: var(--teal-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--text-xs); flex-shrink: 0;
}
.beta-account-panel {
  display: none; position: absolute; top: calc(100% + 6px); right: 0; min-width: 180px; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: var(--space-2);
}
.beta-account-panel.open { display: block; }
.beta-account-panel a, .beta-account-panel button {
  display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); color: var(--ink); font-family: 'Inter', sans-serif; font-size: var(--text-sm); text-decoration: none;
}
.beta-account-panel a:hover, .beta-account-panel button:hover { background: var(--surface-neutral); }
.beta-account-panel .beta-signout { color: var(--danger); }

/* ---------- Sidebar ---------- */
.beta-nav {
  grid-area: nav;
  background: var(--surface-alt-strong);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: var(--space-6) 0 var(--space-9);
}
.beta-nav-section-header {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); padding: var(--space-6) var(--space-7) var(--space-2);
}
/* Collapsible By type / By groups section headers in the collections sidebar. */
.beta-nav-section-toggle {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.beta-nav-section-toggle:hover { color: var(--ink-soft); }
.beta-nav-section-chevron { display: inline-block; width: 1em; text-align: center; }
.beta-nav-section-count { font-weight: 500; letter-spacing: 0; }
.beta-nav-link {
  display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-7);
  color: var(--ink-soft); font-size: var(--text-sm); font-weight: 500; text-decoration: none;
  text-transform: uppercase; letter-spacing: 0.03em;
  border-left: 3px solid transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.beta-nav-link:hover { background: var(--surface-neutral); color: var(--ink); }
.beta-nav-link.active { color: var(--teal-dark); border-left-color: var(--teal); background: var(--surface-neutral); font-weight: 700; }
.beta-nav-link img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.beta-nav-link .beta-nav-link-count { margin-left: auto; color: var(--ink-faint); font-size: var(--text-xs); font-weight: 600; }
/* A long collection or group name ends in "..." (2026-10-12) instead of being cut off mid-letter and pushing the item count out of
   the row - the name span shrinks, the icon and count keep their size. The full name is the row's title (hover). */
.beta-nav-link > span:not(.beta-nav-link-count) { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.beta-nav-link .beta-nav-link-count { flex-shrink: 0; }
.beta-nav-archived { font-size: var(--text-xs); color: var(--ink-faint); font-weight: 600; }
.beta-nav-empty { padding: var(--space-4) var(--space-7); color: var(--ink-faint); font-size: var(--text-sm); }
/* A collection row is its own flex container (link + menu button) rather than putting the button inside
   the <a> itself - nested interactive elements inside an anchor are invalid HTML and unreliable to click.
   .beta-nav-link keeps its own padding/hover/active styling unchanged since renderHeader()/
   renderMoreSidebar() reuse that same class name for plain links with no menu button. */
.beta-nav-row { display: flex; align-items: center; }
.beta-nav-row .beta-nav-link { flex: 1; min-width: 0; }
.beta-nav-row-menu-btn {
  flex-shrink: 0; margin-right: var(--space-5); width: 22px; height: 22px; border-radius: 6px;
  border: none; background: none; color: var(--ink-faint); font-size: var(--text-base); line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.beta-nav-row-menu-btn:hover { background: var(--surface-neutral); color: var(--ink); }
.beta-nav-new {
  margin: var(--space-5) var(--space-7); display: flex; align-items: center; gap: var(--space-3);
  color: var(--teal-dark); font-size: var(--text-sm); font-weight: 700; cursor: pointer; background: none; border: none; padding: 0;
}
.beta-nav-new:hover { text-decoration: underline; }
.beta-nav-toolbar {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-7) var(--space-4);
  position: relative;
}
.beta-nav-search {
  flex: 1; min-width: 0;
  font-family: 'Inter', sans-serif; font-size: var(--text-sm);
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink);
}
.beta-nav-search:focus { outline: none; border-color: var(--teal); }
.beta-nav-icon-btn {
  position: relative; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink-soft); font-size: var(--text-md); cursor: pointer; padding: 0;
}
.beta-nav-icon-btn:hover { background: var(--surface-neutral); color: var(--ink); }
.beta-nav-icon-btn img { width: 16px; height: 16px; object-fit: contain; }
.beta-nav-filter-count {
  position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: var(--radius-pill); background: var(--teal); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 15px; text-align: center;
}
.beta-nav-filter-panel {
  position: absolute; top: 100%; right: var(--space-7); z-index: 20; margin-top: var(--space-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow); padding: var(--space-4); min-width: 180px;
  display: flex; flex-direction: column; gap: var(--space-3);
}
/* Same specificity as the UA's own [hidden] { display: none } but declared later here would normally
   lose to it - EXCEPT the rule above already overrides display to flex at equal specificity, so this
   attribute-qualified selector (higher specificity than a plain class) is what actually wins and hides
   the panel once JS sets hidden. Without this, toggling the hidden attribute did nothing visible. */
.beta-nav-filter-panel[hidden] { display: none; }
.beta-nav-filter-option {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: var(--text-sm); color: var(--ink); text-transform: none; letter-spacing: normal; cursor: pointer;
}
.beta-nav-filter-clear {
  align-self: flex-start; background: none; border: none; padding: 0; margin-top: var(--space-2);
  color: var(--teal-dark); font-size: var(--text-xs); font-weight: 700; cursor: pointer;
}
.beta-nav-filter-clear:hover { text-decoration: underline; }

/* ---------- Content ---------- */
.beta-content { grid-area: content; overflow-y: auto; padding: var(--space-9); }
.beta-content-inner { max-width: 1280px; margin: 0 auto; }
.beta-content-inner.beta-content-full { max-width: none; }

/* Pages with a fixed head (page title/tabs/tab toolbar) that must never scroll: .beta-content itself
   stops being the scrolling element and instead splits into a non-scrolling .beta-fixed-head on top of
   a .beta-scroll-body that owns its own overflow - a real DOM split, not position:sticky, so scrolled
   content can never visually pass through or under the fixed area. */
.beta-content.has-fixed-head { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.beta-fixed-head { flex-shrink: 0; background: var(--bg); border-bottom: 1px solid var(--border); }
.beta-fixed-head .beta-content-inner { padding: var(--space-9) var(--space-9) var(--space-7); }
.beta-fixed-head .beta-subtabs { margin-bottom: 0; border-bottom: none; }
#hiTabHead:not(:empty) { margin-top: var(--space-7); }
#hiTabHead .section-head-row { margin-bottom: 0; }
.beta-scroll-body { flex: 1; overflow-y: auto; min-height: 0; }
.beta-scroll-body .beta-content-inner { padding: var(--space-7) var(--space-9) var(--space-9); }

.beta-page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-7); flex-wrap: wrap; margin-bottom: var(--space-4); }
.beta-page-head-bordered { border: 2px solid var(--teal); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); background: var(--surface); }
.beta-page-head h1 { margin: 0; font-size: var(--text-2xl); font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--ink); }
.beta-page-head h1 .beta-page-type { font-family: 'Inter', sans-serif; font-weight: 400; font-size: var(--text-sm); color: var(--ink-faint); margin-left: var(--space-3); vertical-align: middle; }
.beta-page-head .beta-page-sub { margin: 4px 0 0; color: var(--ink-faint); font-size: var(--text-base); }
.beta-page-head-actions { display: flex; gap: var(--space-4); flex-wrap: wrap; }

/* ---------- Hero tiles (KPI cards) ---------- */
.beta-hero-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-6); margin-bottom: var(--space-9); }
.beta-hero-tile {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  border-left: 5px solid var(--teal); padding: var(--space-6) var(--space-7);
  display: flex; flex-direction: column; gap: 2px; text-decoration: none;
}
.beta-hero-tile .beta-hero-num { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1.9rem; color: var(--ink); }
.beta-hero-tile .beta-hero-label { font-size: var(--text-sm); color: var(--ink-soft); font-weight: 600; }
.beta-hero-tile.accent-brown { border-left-color: var(--brown); }
.beta-hero-tile.accent-good { border-left-color: var(--good); }
.beta-hero-tile.accent-faint { border-left-color: var(--ink-faint); }
.beta-hero-tile.accent-mustard { border-left-color: var(--mustard); }
.beta-hero-tile.accent-coral { border-left-color: var(--coral); }

/* ---------- Data card + data table (the "grid styling") ---------- */
.data-card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-bottom: var(--space-8); overflow: hidden; }
.data-card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); padding: var(--space-6) var(--space-7); border-bottom: 1px solid var(--border); }
.data-card-header h2, .data-card-header h3 { margin: 0; font-size: var(--text-lg); font-weight: 700; color: var(--ink); }
.data-card-count { color: var(--ink-faint); font-size: var(--text-sm); font-weight: 600; }
.section-head-row h3 .data-card-count { margin-left: var(--space-2); }
.data-card-body { padding: var(--space-7); }
.data-card-body.no-pad { padding: 0; }
.data-card-toolbar { display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap; padding: var(--space-5) var(--space-7); border-bottom: 1px solid var(--border); }
.data-card-toolbar input[type="search"], .data-card-toolbar select {
  font-family: 'Inter', sans-serif; font-size: var(--text-sm); padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
}
.data-card-toolbar input[type="search"] { flex: 1; min-width: 160px; }

.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.data-table thead th {
  text-align: left; font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-faint); padding: var(--space-4) var(--space-7); border-bottom: 1px solid var(--border);
  background: var(--surface-neutral); white-space: nowrap; cursor: pointer; user-select: none;
}
.data-table thead th:hover { color: var(--ink); }
.data-table thead th.sort-asc::after { content: ' \2191'; color: var(--teal); }
.data-table thead th.sort-desc::after { content: ' \2193'; color: var(--teal); }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--surface-neutral); }
.data-table tbody tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
.data-table td { padding: var(--space-3) var(--space-7); color: var(--ink-soft); vertical-align: middle; }
.data-table td.data-table-primary { color: var(--ink); font-weight: 600; }
.data-table td.data-table-amount { color: var(--teal-dark); font-weight: 700; text-align: right; white-space: nowrap; }
.data-table td.data-table-actions { text-align: right; white-space: nowrap; }
.data-table td.data-table-actions button { background: none; border: none; cursor: pointer; color: var(--ink-faint); font-size: var(--text-lg); padding: 2px 6px; }
.data-table td.data-table-actions button:hover { color: var(--teal-dark); }
.data-table td.data-table-overdue { color: var(--coral); font-weight: 600; }
.data-table-empty { padding: var(--space-9); text-align: center; color: var(--ink-faint); font-size: var(--text-base); }

/* ---------- Complete-toggle (Checklist/Reminders) - a tap-to-check circle in the first column,
   independent of opening the row's slide-out panel. ---------- */
.data-table td.data-table-toggle { width: 1%; padding-right: 0; }
.toggle-complete {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface);
  color: transparent; font-size: 0.7rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.toggle-complete:hover { border-color: var(--teal); }
.toggle-complete.complete { background: var(--good); border-color: var(--good); color: #fff; }
.data-table-complete-title { text-decoration: line-through; color: var(--ink-faint); }

/* ---------- Color swatch picker (Notes) ---------- */
.color-swatch-picker { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0;
}
.color-swatch.selected { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.note-color-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

/* ---------- Cover thumbnail + uploader (Books) ---------- */
.data-table td.data-table-cover { width: 1%; padding-right: 0; }
.cover-thumb {
  width: 32px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0;
  border: 1px solid var(--border); background: var(--surface-neutral); display: block;
}
.cover-uploader { display: flex; align-items: center; gap: var(--space-6); margin-bottom: var(--space-2); flex-wrap: wrap; }
.cover-uploader .cover-preview {
  width: 84px; height: 112px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--surface-neutral); flex-shrink: 0;
}

/* ---------- Star rating (Books) - editable picker in the panel, plain read-only span in the table. ---------- */
.star-picker { display: flex; gap: 4px; }
.star-picker button { background: none; border: none; font-size: var(--text-xl); cursor: pointer; color: var(--border); padding: 0; line-height: 1; }
.star-picker button.filled { color: var(--mustard); }
.star-rating-display { color: var(--mustard); letter-spacing: 1px; white-space: nowrap; }
/* Shared field renderer (js/fields.js) - its own class so the older per-page .star-picker click handlers never also fire. */
.sf-star-picker { display: flex; gap: 4px; }
.sf-star-picker button { background: none; border: none; font-size: var(--text-xl); cursor: pointer; color: var(--border); padding: 0; line-height: 1; }
.sf-star-picker button.filled { color: var(--mustard); }
.sf-star-picker button:disabled { cursor: default; }
/* Tappable favourite star on list rows (js/listfilters.js). */
.sf-row-star { background: none; border: none; cursor: pointer; font-size: 1.15rem; line-height: 1; color: var(--ink-faint); padding: 2px 4px; flex-shrink: 0; }
.sf-row-star.on { color: var(--mustard); }
.sf-row-star:hover { color: var(--mustard); }
.sf-row-star:disabled { cursor: default; }
[data-sf-filters].active { border-color: var(--teal); color: var(--teal-dark); }

/* ---------- Sub-tabs (Compass §4's simpler in-page tab widget - Details/Rooms/Items/Maintenance/Photos) ---------- */
.beta-subtabs { display: flex; gap: var(--space-2); border-bottom: 2px solid var(--border); margin-bottom: var(--space-8); flex-wrap: wrap; }
.beta-subtab {
  background: none; border: none; border-bottom: 3px solid transparent; margin-bottom: -2px;
  padding: var(--space-4) var(--space-6); font-family: 'Inter', sans-serif; font-size: var(--text-base); font-weight: 600; color: var(--ink-faint); cursor: pointer;
}
.beta-subtab:hover { color: var(--ink-soft); }
.beta-subtab.active { color: var(--teal-dark); border-bottom-color: var(--teal); }
/* Docked in the detail (3rd) panel (Vehicle/Medical Records) instead of a full-width page - narrower
   space means wrapping to multiple rows looks bad, so this scrolls horizontally instead. */
.beta-pane-detail .beta-subtabs { flex-wrap: nowrap; overflow-x: auto; margin: 0; border-bottom: 1px solid var(--border); padding: 0 var(--space-7); }
.beta-pane-detail .beta-subtab { white-space: nowrap; flex-shrink: 0; padding: var(--space-5) var(--space-5); }

/* ---------- Dashboard two-column layout: Upcoming/Favorites on the left, Quick Links on the right ---------- */
.beta-dash-columns { display: grid; grid-template-columns: 2fr 1fr; align-items: start; gap: var(--space-7); }
.beta-fav-star { color: var(--mustard); }

/* ---------- Quick Links (Quick Notes/Reminders/Checklist) ---------- */
.beta-quicklink-row { display: flex; align-items: center; gap: var(--space-5); padding: var(--space-5) var(--space-7); text-decoration: none; color: inherit; }
.beta-quicklink-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.beta-quicklink-row:hover { background: var(--surface-neutral); }
.beta-quicklink-row img { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.beta-quicklink-row .beta-quicklink-title { display: block; font-weight: 600; color: var(--ink); font-size: var(--text-base); }
.beta-quicklink-row .beta-quicklink-sub { display: block; font-size: var(--text-sm); color: var(--ink-faint); }

/* ---------- Today's Chores (dashboard) ---------- */
.beta-chores-row { display: flex; align-items: flex-start; gap: var(--space-5); padding: var(--space-4) 0; text-decoration: none; color: inherit; }
.beta-chores-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.beta-chores-row img { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.beta-chores-main { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.beta-chores-main strong { color: var(--ink); }
.beta-chores-track { height: 6px; border-radius: 3px; background: var(--surface-alt-strong); overflow: hidden; }
.beta-chores-track span { display: block; height: 100%; background: var(--good); }
.beta-chores-kids { font-size: var(--text-sm); color: var(--ink-soft); }

/* ---------- Collection card grid (Dashboard favorites/recent) ---------- */
.beta-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-6); }
.beta-coll-card {
  display: flex; align-items: center; gap: var(--space-5); padding: var(--space-6) var(--space-7);
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); text-decoration: none;
  transition: transform 0.15s ease;
}
.beta-coll-card:hover { transform: translateY(-2px); }
.beta-coll-card { position: relative; }
.beta-coll-card-menu { margin-left: auto; align-self: flex-start; background: none; border: none; color: var(--ink-faint); font-size: 1.1rem; line-height: 1; padding: 2px 4px; cursor: pointer; border-radius: 6px; }
.beta-coll-card-menu:hover { color: var(--ink); background: var(--surface-alt); }
.beta-coll-card img { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.beta-coll-card .beta-coll-card-name { display: block; font-weight: 700; color: var(--ink); font-size: var(--text-md); }
.beta-coll-card .beta-coll-card-meta { display: block; font-size: var(--text-sm); color: var(--ink-faint); margin-top: 2px; }

/* ---------- Upcoming/due list ---------- */
.beta-upcoming-row { display: flex; align-items: center; gap: var(--space-5); padding: var(--space-5) var(--space-7); }
.beta-upcoming-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.beta-upcoming-row .beta-upcoming-title { display: block; font-weight: 600; color: var(--ink); font-size: var(--text-base); }
.beta-upcoming-row .beta-upcoming-sub { display: block; font-size: var(--text-sm); color: var(--ink-faint); }
.beta-upcoming-row .beta-upcoming-date { margin-left: auto; font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.beta-upcoming-row.overdue .beta-upcoming-sub { color: var(--coral); font-weight: 600; }

/* ---------- Photo grid ---------- */
.beta-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--space-5); }
.beta-photo-tile { position: relative; border-radius: var(--radius-md); overflow: hidden; background: var(--surface-neutral); aspect-ratio: 1; }
.beta-photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Buttons that need a size not already covered by site.css's .btn-fake-* ---------- */
.btn-fake-solid.beta-btn-sm, .btn-fake-ghost.beta-btn-sm { padding: var(--space-3) var(--space-5); font-size: var(--text-xs); }

/* Save buttons: dark blue (--ink) rather than the teal used by every other primary action, so a Save
   always reads as visually distinct from a plain confirm/create button. */
.btn-save {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: 'Inter', sans-serif; font-size: var(--text-sm); font-weight: 600;
  padding: var(--space-4) var(--space-6); border-radius: var(--radius-sm); cursor: pointer;
  background: var(--navy); border: 1.5px solid var(--navy); color: #ffffff;
  transition: filter 0.15s ease;
}
.btn-save:hover { filter: brightness(0.88); }
.btn-save.beta-btn-sm { padding: var(--space-3) var(--space-5); font-size: var(--text-xs); }

/* ---------- Modal (app.openModal() produces .modal-overlay > .modal-box - redeclared here since
   beta pages don't load css/app.css, which is where these normally live) ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 120; background: rgba(11, 37, 69, 0.45); display: flex; align-items: center; justify-content: center; padding: var(--space-8); }
.modal-box { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: var(--space-9); width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow-y: auto; }
.modal-box h3 { margin-top: 0; margin-bottom: var(--space-6); font-size: var(--text-xl); font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--space-4); margin-top: var(--space-7); }
.modal-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; margin: 4px 0; }
.modal-list button.picker-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--ink-faint); border-radius: 8px; padding: 9px 12px;
  cursor: pointer; font-family: 'Inter', sans-serif; font-size: 0.88rem; font-weight: 600; color: var(--ink);
}
.modal-list button.picker-row:hover { border-color: var(--teal); background: var(--surface-alt); }
.modal-list button.picker-row img { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.modal-list button.picker-row.picker-row-danger { color: var(--danger); border-color: var(--danger); }
.modal-list button.picker-row.picker-row-danger:hover { background: rgba(179,65,62,0.08); }
.form-grid { display: flex; flex-direction: column; gap: var(--space-6); }
.dyn-field-group { display: flex; flex-direction: column; gap: var(--space-6); }
.field-label { display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); font-weight: 600; color: var(--ink); }
.field-label input, .field-label select, .field-label textarea {
  font-family: 'Inter', sans-serif; font-size: var(--text-base); padding: var(--space-4) var(--space-5);
  /* --border reads too faint against --surface here - same fix app.css uses for the classic app's fields. */
  border: 1px solid var(--ink-faint); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-weight: 400;
}
.field-label textarea { resize: vertical; min-height: 72px; }
.field-row-inline { flex-direction: row; align-items: center; gap: var(--space-4); }
.field-row-inline input[type="checkbox"] { width: auto; accent-color: var(--teal); }

/* ---------- Simple list rows (Rooms/Maintenance/Attachments inside a bespoke type's sub-tabs -
   the Items list itself uses .data-table, but rooms/maintenance entries don't fit a table shape). ---------- */
.modal-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: 'Inter', sans-serif; font-size: var(--text-sm); font-weight: 600;
  padding: var(--space-4) var(--space-6); border-radius: var(--radius-sm); cursor: pointer;
  background: transparent; border: 1px solid var(--danger); color: var(--danger); margin-right: auto;
}
.modal-danger:hover { background: var(--danger-tint); }
.entry-list { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: var(--space-3); }
.entry-row { display: flex; align-items: center; gap: var(--space-5); padding: var(--space-5) var(--space-6); background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow); }
.entry-row .entry-main { flex: 1; min-width: 0; }
.entry-row .entry-title { display: block; font-weight: 600; font-size: var(--text-base); color: var(--ink); }
.entry-row .entry-sub { display: block; font-size: var(--text-sm); color: var(--ink-faint); }
.entry-row .entry-amount { font-size: var(--text-base); font-weight: 700; color: var(--teal-dark); flex-shrink: 0; }
.entry-row .entry-actions { display: flex; gap: var(--space-2); flex-shrink: 0; }
.entry-row .entry-actions button { background: none; border: none; cursor: pointer; color: var(--ink-faint); font-size: var(--text-md); padding: 2px 4px; }
.entry-row .entry-actions button:hover { color: var(--teal-dark); }
.entry-row.selected { background: var(--teal-tint); box-shadow: inset 0 0 0 1.5px var(--teal); }

/* ---------- Two-pane list+detail (Beta Look) ----------
   Structural analog of the classic app's .collections-shell 2nd/3rd panes (.pane-items/.pane-detail) -
   a persistent list-on-one-side, detail-on-the-other layout instead of a slide-out .detail-panel
   drawer - but re-skinned with the beta look (white .data-card-style panes, not the classic app's
   muted per-pane background colors) and always full width of whatever the page gives it, since the
   beta left nav already replaces the classic 1st pane (.pane-collections). One list row is
   highlighted via .entry-row.selected (above) to show which note the detail pane is showing. */
.beta-two-pane {
  display: grid; grid-template-columns: 1fr;
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow); min-height: 60vh;
}
/* Bounds .beta-two-pane to the scroll body's own height (instead of growing with content) so the
   list pane and detail pane each scroll independently via their own .beta-pane-list/.beta-pane-body
   overflow, rather than the whole page scrolling both panes together. Scoped with :has() to this one
   layout - every other beta type page keeps .beta-scroll-body's normal whole-page scroll. */
.beta-scroll-body:has(.beta-two-pane) { display: flex; flex-direction: column; overflow-y: hidden; }
.beta-scroll-body:has(.beta-two-pane) .beta-content-inner { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; }
.beta-scroll-body:has(.beta-two-pane) .beta-two-pane { flex: 1; min-height: 0; width: 100%; }
.beta-pane { display: none; flex-direction: column; min-height: 0; min-width: 0; }
.beta-pane-master { border-right: 1px solid var(--border); background: var(--surface-alt); }
.beta-pane-detail { background: var(--neutral-grey); }
.beta-pane-header {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-6) var(--space-7); border-bottom: 1px solid var(--border);
}
.beta-pane-header h3 { margin: 0; font-size: var(--text-lg); font-weight: 700; color: var(--ink); flex: 1; min-width: 0; }
.beta-pane-back { display: none; background: none; border: none; font-size: 1.15rem; cursor: pointer; color: var(--ink); padding: 4px 8px 4px 0; line-height: 1; flex-shrink: 0; }
.beta-pane-toolbar { display: flex; gap: var(--space-3); padding: var(--space-5) var(--space-7); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.beta-pane-toolbar input[type="search"] { flex: 1; min-width: 90px; }
.beta-pane-toolbar select {
  font-family: 'Inter', sans-serif; font-size: var(--text-sm); padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
}
.beta-pane-list { flex: 1; overflow-y: auto; padding: var(--space-5); }
.beta-pane-list .entry-list { margin-bottom: 0; }
.beta-pane-list .entry-row { cursor: pointer; box-shadow: none; border: 1px solid var(--ink-faint); }
.beta-pane-list .entry-row:hover { border-color: var(--teal); }
.beta-pane-body { flex: 1; overflow-y: auto; padding: var(--space-8); }
.beta-pane-actions { display: flex; justify-content: flex-end; gap: var(--space-4); padding: var(--space-6) var(--space-7); border-top: 1px solid var(--border); }
.beta-pane-actions[hidden] { display: none; }

@media (min-width: 860px) {
  .beta-two-pane { grid-template-columns: 360px 1fr; }
  .beta-pane { display: flex; }
  .beta-pane-back { display: none !important; }
}
@media (max-width: 859px) {
  .beta-two-pane:not([data-view="detail"]) .beta-pane-master { display: flex; }
  .beta-two-pane[data-view="detail"] .beta-pane-detail { display: flex; }
  .beta-pane-back { display: inline-flex; }
}
.entry-row.overdue .entry-sub { color: var(--coral); font-weight: 600; }
.section-head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-7); gap: var(--space-5); flex-wrap: wrap; }
.section-head-row h3 { margin: 0; font-size: var(--text-lg); font-weight: 700; color: var(--ink); }
.section-head-actions { display: flex; align-items: center; gap: var(--space-4); }
.inline-search {
  font-family: 'Inter', sans-serif; font-size: var(--text-sm); padding: var(--space-3) var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface);
  color: var(--ink); width: 200px; max-width: 40vw;
}
.inline-search:focus { outline: none; border-color: var(--teal); }
.readonly-banner { background: var(--card-warm); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-5) var(--space-6); font-size: var(--text-sm); color: var(--ink); margin-bottom: var(--space-6); }
.pane-empty { color: var(--ink-faint); font-size: var(--text-base); padding: var(--space-7) 0; }
.pane-empty.form-error { color: var(--danger); }
.form-error { color: var(--danger); font-size: var(--text-sm); }
.form-success { color: var(--good); font-size: var(--text-sm); }

/* ---------- Section buttons (Details tab) + slide-out detail panel -----------------------------
   Replaces a flat stack of always-open .data-card sections with clickable rectangle tiles; clicking
   one slides in a right-hand panel showing just that section's fields, with Close/Save actions. */
.section-btn-grid { display: flex; flex-direction: column; gap: var(--space-3); }
.section-btn {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  width: 100%; text-align: left; font-family: 'Inter', sans-serif; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow); padding: var(--space-4) var(--space-6);
}
.section-btn:hover { border-color: var(--teal); }
.section-btn-main { flex: 1; min-width: 0; }
.section-btn-label { font-size: var(--text-base); font-weight: 700; color: var(--ink); }
.section-btn-sub { display: block; margin-top: 1px; font-size: var(--text-xs); font-weight: 400; color: var(--ink-faint); }
.section-btn-chevron { font-size: var(--text-lg); color: var(--ink-faint); flex-shrink: 0; }
.section-btn-reorder { display: flex; flex-direction: column; gap: var(--space-1); flex-shrink: 0; }
.section-btn-arrow {
  background: var(--surface-neutral); border: 1px solid var(--border); border-radius: var(--radius-sm);
  width: 22px; height: 18px; line-height: 1; font-size: var(--text-xs); color: var(--ink-soft); cursor: pointer;
}
.section-btn-arrow:hover:not(:disabled) { border-color: var(--teal); color: var(--teal-dark); }
.section-btn-arrow:disabled { opacity: 0.35; cursor: default; }

.detail-panel-overlay {
  position: fixed; inset: 0; z-index: 110; background: rgba(11, 37, 69, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.detail-panel-overlay.open { opacity: 1; pointer-events: auto; }
.detail-panel {
  position: fixed; top: 0; right: -460px; bottom: 0; width: 460px; max-width: 90vw; z-index: 111;
  background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: right 0.25s ease;
}
.detail-panel.open { right: 0; }
.detail-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); padding: var(--space-7); border-bottom: 1px solid var(--border); }
.detail-panel-head h3 { margin: 0; font-size: var(--text-xl); font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--ink); }
.detail-panel-close { background: none; border: none; cursor: pointer; font-size: var(--text-xl); line-height: 1; color: var(--ink-faint); padding: var(--space-2); }
.detail-panel-close:hover { color: var(--ink); }
.detail-panel-body { flex: 1; overflow-y: auto; padding: var(--space-7); }
.detail-panel-actions { display: flex; justify-content: flex-end; gap: var(--space-4); padding: var(--space-6) var(--space-7); border-top: 1px solid var(--border); }
.detail-panel-subhead { font-size: var(--text-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); margin: var(--space-7) 0 var(--space-3); }
.detail-panel-subhead:first-child { margin-top: 0; }
.summary-badge-row { display: flex; gap: var(--space-5); margin-bottom: var(--space-7); }
.summary-badge { flex: 1; display: flex; flex-direction: column; gap: var(--space-1); background: var(--neutral-grey); border-radius: var(--radius-md); padding: var(--space-5) var(--space-6); }
.summary-badge-value { font-family: 'Poppins', sans-serif; font-size: var(--text-xl); font-weight: 700; color: var(--ink); }
.summary-badge-label { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.link-field-resolved { display: flex; align-items: center; gap: var(--space-4); }
.link-field-open { color: var(--teal-dark); font-weight: 600; text-decoration: none; }
.link-field-open:hover { text-decoration: underline; }
.link-field-unresolved { display: flex; align-items: center; gap: var(--space-3); }
.link-field-unresolved input { flex: 1; min-width: 0; }
.link-field-resolved button, .link-field-unresolved button {
  background: none; border: none; cursor: pointer; color: var(--ink-faint); font-size: var(--text-sm);
  font-weight: 600; padding: var(--space-2) var(--space-3); flex-shrink: 0; white-space: nowrap;
}
.link-field-resolved button:hover, .link-field-unresolved button:hover { color: var(--teal-dark); }
.detail-panel-group { border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: var(--space-5); overflow: hidden; }
.detail-panel-group > summary {
  cursor: pointer; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: var(--text-base);
  color: var(--teal-dark); list-style: none; background: var(--surface-neutral); padding: var(--space-5) var(--space-6);
}
.detail-panel-group > summary::-webkit-details-marker { display: none; }
.detail-panel-group > summary::before { content: '▸'; display: inline-block; margin-right: var(--space-3); color: var(--teal-dark); transition: transform 0.15s ease; }
.detail-panel-group[open] > summary { border-bottom: 1px solid var(--border); }
.detail-panel-group[open] > summary::before { transform: rotate(90deg); }
.detail-panel-group > .dyn-field-group { margin: 0; padding: var(--space-6) var(--space-6) var(--space-6) var(--space-9); }

.photo-gallery { display: flex; flex-wrap: wrap; gap: var(--space-5); margin: var(--space-3) 0 var(--space-5); }
.photo-gallery-item { position: relative; width: 100px; height: 100px; flex-shrink: 0; border-radius: var(--radius-md); overflow: hidden; }
.photo-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: var(--radius-md); cursor: pointer; }
.photo-gallery-remove {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.55); color: #fff; cursor: pointer; font-size: 11px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.photo-gallery-add {
  width: 100px; height: 100px; flex-shrink: 0; border: 2px dashed var(--border); border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: var(--ink-faint); cursor: pointer;
}
.photo-gallery-add:hover { border-color: var(--teal); color: var(--teal-dark); }
.photo-gallery-add input { display: none; }
.attachment-file-list { display: flex; flex-direction: column; gap: var(--space-3); }
.attachment-file-row {
  display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.attachment-file-row:hover { border-color: var(--teal); }
.attachment-file-icon { font-size: 1.1rem; flex-shrink: 0; }
.attachment-file-name { flex: 1; min-width: 0; font-size: var(--text-sm); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-file-add {
  display: flex; align-items: center; justify-content: center; gap: var(--space-3); padding: var(--space-4) var(--space-5);
  border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-alt);
  color: var(--ink-faint); font-size: var(--text-sm); cursor: pointer;
}
.attachment-file-add:hover { border-color: var(--teal); color: var(--teal-dark); }
.attachment-file-add input { display: none; }

/* ---------- Account-wide Photos tab (All Items page) - a .photo-gallery-item tile plus a caption
   linking back to its collection/item, since that page has no single item context of its own. ---------- */
.ai-photo-tile { display: flex; flex-direction: column; gap: 6px; width: 100px; text-decoration: none; }
.ai-photo-caption {
  font-size: var(--text-xs); color: var(--ink-faint); line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Tools collection dashboard (list pane, mirrors ToolsListViewModel's summary bar). ---------- */
.tools-dashboard {
  display: flex; gap: var(--space-6); flex-wrap: wrap; padding: var(--space-5) var(--space-6);
  background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow); margin-bottom: var(--space-5);
}
.tools-stat { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.tools-stat-value { font-size: 1.3rem; font-weight: 700; line-height: 1.1; }
.tools-stat-label { font-size: var(--text-xs); color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.03em; }
.tools-filter-chips { display: flex; gap: var(--space-2); flex-wrap: wrap; padding: 0 var(--space-2) var(--space-4); }
.tools-chip {
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: var(--text-sm); cursor: pointer; color: var(--ink-soft);
}
.tools-chip.active { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ---------- shared.html: "Collections I've Shared" grouped by person / by collection ---------- */
.share-view-chips { padding: 0; }
.share-total { font-weight: 500; color: var(--ink-faint); }
.share-group + .share-group { margin-top: var(--space-6); }
.share-group-head {
  display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) 0; margin-bottom: var(--space-3);
  cursor: pointer; list-style: none; border-bottom: 1px solid var(--border);
}
.share-group-head::-webkit-details-marker { display: none; }
.share-group-head::before { content: '▾'; color: var(--ink-faint); font-size: var(--text-sm); width: 1em; transition: transform 0.15s; }
.share-group:not([open]) > .share-group-head::before { transform: rotate(-90deg); }
.share-group-title { font-weight: 700; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.share-group-count { font-size: var(--text-sm); color: var(--ink-faint); white-space: nowrap; }
.share-group-action { margin-left: auto; flex-shrink: 0; }

/* ---------- Cross-item/collection/group Links (generic to every item, ported from app.css's own
   .simple-* rows) ---------- */
.simple-list { display: flex; flex-direction: column; gap: var(--space-3); }
.simple-row {
  display: flex; align-items: center; gap: var(--space-5); padding: var(--space-5) var(--space-7); border: 1px solid var(--border);
  border-radius: var(--radius-md); background: var(--surface); text-decoration: none;
}
.simple-row:hover { border-color: var(--teal); }
.simple-row .simple-main { flex: 1; min-width: 0; }
.simple-row .simple-title { display: block; font-weight: 600; color: var(--ink); font-size: var(--text-sm); }
.simple-row .simple-sub { display: block; font-size: var(--text-xs); color: var(--ink-faint); }

/* ---------- Tags (native Tag entity system, ported from app.css) ---------- */
.tag-chips { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-5); }
.tag-chip {
  display: inline-flex; align-items: center; gap: var(--space-3); padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--teal-tint); color: var(--teal-dark); font-size: var(--text-sm); font-weight: 600;
}
.tag-chip-remove { background: none; border: none; cursor: pointer; color: var(--teal-dark); font-size: var(--text-xs); padding: 0; line-height: 1; }
.tag-chip-remove:hover { color: var(--danger); }
.tag-input-row { display: flex; gap: var(--space-3); align-items: center; }
.tag-input-row input {
  flex: 1; min-width: 0; font-family: 'Inter', sans-serif; font-size: var(--text-sm); padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
}

/* ---------- Address box + Map Pin (Home Inventory) - mirrors the mobile app's AddressFieldsCard/
   MapPinCard: a bordered box titled "Address" with each line individually labeled (Street Address/City/
   State/Zip), followed by a separate "Map Pin" box with an entry + an "open in Maps" button. The button
   deliberately stays a plain bordered box rather than a solid teal/navy fill - a dark icon on a dark fill
   was the exact contrast bug fixed on mobile this same pass. ---------- */
.address-box {
  display: flex; flex-direction: column; gap: var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-6);
  margin-bottom: var(--space-5);
}
.address-box-title { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: var(--text-base); color: var(--ink); }
.address-box-optional { font-size: var(--text-xs); font-weight: 400; color: var(--ink-faint); }
.address-box-row { display: flex; gap: var(--space-5); }
.address-box-row .field-label { flex: 1; min-width: 0; }
.map-pin-row { display: flex; gap: var(--space-4); align-items: stretch; }
.map-pin-row input { flex: 1; min-width: 0; }
.map-pin-btn {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 44px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; font-size: var(--text-lg);
}
.map-pin-btn:hover { border-color: var(--teal); background: var(--surface-neutral); }

/* ---------- List fields (Medical Records' Allergies) - Label/Value list editor, ported from the
   classic app's own .list-field* rules (app.css) with beta's token scale. ---------- */
.list-field { display: flex; flex-direction: column; gap: var(--space-3); }
.list-field-rows { display: flex; flex-direction: column; gap: var(--space-2); }
.list-field-row {
  display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4);
  background: var(--surface-neutral); border-radius: var(--radius-sm);
}
.list-field-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.list-field-row-label { font-weight: 600; font-size: var(--text-sm); color: var(--ink); }
.list-field-row-value { font-size: var(--text-sm); color: var(--ink-soft); }
.list-field-row button { background: none; border: none; cursor: pointer; color: var(--ink-faint); font-size: var(--text-md); padding: 2px 4px; flex-shrink: 0; }
.list-field-row button:hover { color: var(--teal-dark); }
.list-field-add-prompt { color: var(--teal-dark); font-weight: 600; font-size: var(--text-sm); cursor: pointer; align-self: flex-start; }
.list-field-add-prompt:hover { text-decoration: underline; }
.list-field-add-form { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-neutral); }
.list-field-add-form input { font-family: 'Inter', sans-serif; font-size: var(--text-base); padding: var(--space-4) var(--space-5); border: 1px solid var(--ink-faint); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.list-field-add-actions { display: flex; gap: var(--space-4); align-items: center; }

/* ---------- Sizes: group-then-template picker modal (ported from css/app.css's own copy, retokenized
   to shell's space/text scale, so app/collections.html's generic engine can show the same picker) ---------- */
.modal-subtitle { margin: calc(-1 * var(--space-3)) 0 var(--space-6); color: var(--ink-soft); font-size: var(--text-sm); }
.size-template-groups { display: flex; flex-direction: column; gap: var(--space-6); max-height: 55vh; overflow-y: auto; }
.size-template-group h4 { margin: 0 0 var(--space-4); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); }
.size-template-list { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.size-template-btn {
  font-family: 'Inter', sans-serif; font-size: var(--text-sm); padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink);
  cursor: pointer;
}
.size-template-btn:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- Responsive ----------------------------------------------------------------------
   Two breakpoints, both chosen to line up with rules that already existed in this file:

   <= 859px  "compact" - the width at which the 300px sidebar column no longer leaves content a
             usable share of the screen. Matches the .beta-two-pane master/detail breakpoint above
             exactly (859/860) so the whole shell flips to its mobile shape at one single point
             rather than the sidebar and the two-pane layout switching a pixel apart.
   <= 560px  "phone" - where even the compact header's secondary chrome (brand suffix, account
             name) has to go, and card/modal padding needs tightening.

   The sidebar is NOT hidden here. It used to be a flat `.beta-nav { display: none }`, which left
   the collections list, its search/sort/filter toolbar and "+ New Collection" with no mobile
   equivalent at all - on a phone there was literally no way to reach another collection. It now
   slides in as an off-canvas drawer behind the header hamburger, and since the header's own
   Dashboard/Collections/Groups/More links also have to give up their space at this width, each
   sidebar renderer prepends them into the drawer (.beta-nav-mobile-only) so nothing the header
   drops becomes unreachable. -------------------------------------------------------------------- */
@media (max-width: 859px) {
  .beta-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 4em 1fr;
    grid-template-areas: "header" "content";
  }
  .beta-nav-toggle { display: inline-flex; }
  /* One coherent list inside the drawer: the header's links on top, separated from whatever the
     page's own sidebar (Collections / Groups / More) puts below them. The sidebars each open with
     their own standalone Dashboard link, which would duplicate the one above - so it hides here
     rather than showing twice. */
  .beta-nav-mobile-only {
    display: block; padding-bottom: var(--space-4); margin-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
  }
  .beta-nav-desktop-only { display: none; }

  /* Off-canvas drawer. Translated off-screen rather than display:none-d so it keeps its scroll
     position and its already-wired search/sort/filter/row-menu handlers between opens - the
     renderers only build that DOM once per page load. `visibility` (transitioned, so it flips
     only after the slide-out finishes) is what keeps the closed drawer out of the tab order and
     away from screen readers, which a bare translate would not. */
  .beta-nav {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
    width: min(320px, 86vw);
    padding-top: var(--space-6);
    box-shadow: var(--shadow);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0.22s;
  }
  .beta-nav.open { transform: translateX(0); visibility: visible; }
  /* The slide is decoration; the drawer still has to appear and disappear. Dropping the transition
     entirely (rather than shortening it) is what's wanted here - `visibility` is transitioned above
     purely to delay the hide until the slide-out ends, and with no slide there's nothing to wait for. */
  @media (prefers-reduced-motion: reduce) {
    .beta-nav { transition: none; }
  }
  .beta-nav-scrim.open { display: block; }
  /* Comfortable tap target for the per-collection "⋯" menu, which is a 22px hit area on desktop. */
  .beta-nav-row-menu-btn { width: 36px; height: 36px; }

  .beta-header { gap: var(--space-5); padding: 0 var(--space-5); }
  .beta-header-brand img { height: 40px; }
  /* Duplicated into the drawer by .beta-nav-mobile-only above. */
  .beta-header-back { display: none; }

  .beta-content { padding: var(--space-6); min-width: 0; }
  .beta-fixed-head .beta-content-inner { padding: var(--space-6) var(--space-6) var(--space-5); }
  .beta-scroll-body .beta-content-inner { padding: var(--space-5) var(--space-6) var(--space-6); }
  .beta-dash-columns { grid-template-columns: 1fr; }

  /* Tabs scroll sideways instead of wrapping into three stacked rows - the same treatment
     .beta-pane-detail .beta-subtabs already gets for the same reason (narrow container). */
  .beta-subtabs {
    flex-wrap: nowrap; overflow-x: auto; border-bottom-width: 1px;
    margin-bottom: var(--space-7);
  }
  .beta-subtab { white-space: nowrap; flex-shrink: 0; }

  /* A 4-5 column .data-table squeezed into a phone's width makes every cell unreadable, so the
     card body scrolls sideways and the page itself stays put. .data-card's own overflow:hidden
     already clips this to the card's rounded corners, and every table this file styles is a direct
     child of a .data-card-body (see app/types/home-inventory.html), which is what :has matches. */
  .data-card-body:has(> .data-table) { overflow-x: auto; }
  .data-card-body:has(> .data-table) > .data-table { min-width: 520px; }
  .data-table thead th, .data-table td { padding-left: var(--space-5); padding-right: var(--space-5); }
  .data-card-header, .data-card-toolbar, .data-card-body { padding-left: var(--space-6); padding-right: var(--space-6); }
  .data-card-body.no-pad { padding-left: 0; padding-right: 0; }
}

@media (max-width: 560px) {
  .beta-header { gap: var(--space-4); padding: 0 var(--space-4); }
  .beta-nav-toggle { margin-left: calc(-1 * var(--space-4)); }
  .beta-header-brand img { height: 34px; }
  .beta-header-brand-suffix { display: none; }
  /* Avatar only - the display name is the first thing worth dropping when the header runs out of
     room, and it's repeated inside the account panel the avatar opens anyway. */
  .beta-account-trigger > span:not(.beta-account-avatar) { display: none; }

  .beta-page-head h1 { font-size: var(--text-xl); }
  .beta-page-head-actions { width: 100%; }
  .beta-page-head-actions > * { flex: 1; justify-content: center; }

  .beta-content { padding: var(--space-5); }
  .beta-fixed-head .beta-content-inner { padding: var(--space-5) var(--space-5) var(--space-4); }
  .beta-scroll-body .beta-content-inner { padding: var(--space-4) var(--space-5) var(--space-5); }
  .beta-hero-row { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--space-5); }

  /* Near-fullscreen sheet rather than a centered card that a phone keyboard would push off-screen. */
  .modal-overlay { padding: var(--space-4); align-items: flex-end; }
  .modal-box { padding: var(--space-7); max-height: 88vh; border-radius: var(--radius-lg); }
  .modal-actions { flex-wrap: wrap; }
  .modal-danger { margin-right: 0; width: 100%; }

  .beta-pane-toolbar, .beta-pane-header, .beta-pane-list, .beta-pane-body, .beta-pane-actions {
    padding-left: var(--space-5); padding-right: var(--space-5);
  }
  .inline-search { width: 100%; max-width: none; }
  .section-head-actions { width: 100%; }
}

/* ---------- List view (js/listview.js) ----------
   Compact View - mobile's one-line "Title: details" rows. Built from each page's normal row markup, so every list
   gets it without its own compact template. */
.list-compact .entry-list { gap: 4px; }
.list-compact .entry-row { padding: 6px var(--space-6); }
.list-compact .entry-row .entry-main { display: flex; align-items: baseline; gap: .35em; min-width: 0; }
.list-compact .entry-row .entry-title { display: inline; flex-shrink: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-compact .entry-row .entry-title:has(+ .entry-sub:not(:empty))::after { content: ':'; }
.list-compact .entry-row .entry-sub { display: inline; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); }
.list-compact .entry-row img, .list-compact .entry-row .entry-thumb, .list-compact .entry-row .photo-thumb { display: none; }
/* Previous / next in the detail header - mobile's swipe between items. */
.lv-nav { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.lv-nav .lv-pos { font-size: var(--text-sm); color: var(--ink-faint); white-space: nowrap; }
.lv-nav button:disabled { opacity: .35; cursor: default; }

/* Paired fields - two fields on one row where the type's field order pairs them (ItemFormLayoutService). */
.field-pair-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: start; }
@media (max-width: 560px) { .field-pair-row { grid-template-columns: 1fr; } }
.form-tabs { margin-bottom: var(--space-5); }

/* The photo just made the cover (js/photos.js). */
.photo-gallery-item { position: relative; }
.photo-gallery-item.photo-cover::after { content: 'Cover'; position: absolute; left: 6px; bottom: 6px; background: var(--teal); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 8px; }
/* Set as cover on a photo gallery (Books, 2026-10-15) */
.photo-cover-set, .photo-cover-badge { position: absolute; left: 4px; bottom: 4px; border: none; border-radius: 8px; padding: 1px 6px; font-size: 11px; font-weight: 600; background: rgba(0,0,0,0.55); color: #fff; cursor: pointer; }
.photo-cover-badge { background: var(--teal); cursor: default; }
/* Videos (js/videos.js, 2026-10-15): a poster tile with a play mark and its length, the upload bar and the player. */
.vid-tile img { cursor: pointer; background: #111; }
.vid-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 15px; line-height: 34px; text-align: center; pointer-events: none; padding-left: 3px; box-sizing: border-box; }
.vid-length { position: absolute; right: 4px; bottom: 4px; padding: 0 5px; border-radius: 6px; font-size: 11px; font-weight: 600;
  background: rgba(0,0,0,.65); color: #fff; pointer-events: none; }
.vid-progress { height: 10px; border-radius: 5px; background: var(--surface-alt); overflow: hidden; margin: 10px 0 6px; }
.vid-progress-fill { height: 100%; background: var(--teal); transition: width .2s; }
.vid-progress-name { margin: 0; font-weight: 600; word-break: break-all; }
.vid-progress-text { margin: 0; color: var(--ink-soft); font-size: var(--text-sm); }

.photo-gallery-label { position: absolute; left: 0; right: 0; top: 0; padding: 1px 6px; font-size: 10px; color: #fff; background: rgba(0,0,0,0.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 8px 8px 0 0; pointer-events: none; }
.mv-badge-want { background: #E8A317; color: #fff; }

/* Row quick actions (Restaurants' Call / Order / Menu / Map) - List view only, as on mobile. */
.list-compact .row-actions { display: none !important; }

/* Dark mode: every collection-type / menu icon sits on a white chip, as in the app - the icon art is drawn for a
   light background and gets lost on a dark one. (site.js switches this block on or off with Appearance.) */
@media all { /* dark theme - the default; site.js turns it off for Light, or ties it to the device for "Match my device" */
  img[src*="images/icons/icon_"]:not([src*="icon_filter"]),
  img[src*="images/icons/doc_"] { /* Important Documents kinds */
    background: #fff;
    border-radius: 22%;
    padding: 2px;
    box-sizing: border-box;
  }
}

/* Ask (AI assistant) entry points - hidden until shell.js confirms the plan includes it (html.ask-available). */
html:not(.ask-available) [data-requires="canUseAiAssistant"] { display: none !important; }

/* Plan banner (shell.js renderPlanBanner, md files/stuf-plans-revamp-plan.md): trial ending, plan ended, payment
   problem, over storage. Light tints with dark text so it reads in both themes. */
.beta-plan-banner {
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline;
  margin: 0 0 var(--space-4); padding: 10px 14px; border-radius: var(--radius-lg);
  background: var(--teal-tint); color: #0B2545; font-size: var(--text-sm); line-height: 1.45;
}
.beta-plan-banner.is-warning { background: #FDF1D8; border: 1px solid #F0B84B; }
.beta-plan-banner.is-ended { background: #FBE3E3; border: 1px solid #E45858; }
.beta-plan-banner a { color: #0A5A62; font-weight: 600; white-space: nowrap; }

/* Service Providers list (2026-10-13): stars, "Don't use" / 24/7 badges and the row's call button. */
.sp-stars { color: #E0A000; font-size: var(--text-xs, 12px); margin-left: 6px; letter-spacing: 1px; }
.sp-stars-off { color: var(--neutral-grey); }
.sp-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px; font-size: 11px; font-weight: 600;
  background: var(--teal-tint); color: var(--teal-dark); vertical-align: middle; }
.sp-badge-no { background: var(--danger); color: #fff; }
.sp-call { text-decoration: none; font-size: 17px; padding: 4px 8px; border-radius: 8px; align-self: center; }
.sp-call:hover { background: var(--surface-alt); }

/* People (2026-10-13): age line and Health card on a person's Overview. */
.pp-age-line { margin: 0 0 var(--space-5); color: var(--ink-soft); font-size: 14px; }
.pp-health { border: 1px solid var(--border); border-radius: 14px; padding: var(--space-6); margin: 0 0 var(--space-7); background: var(--surface); }
.pp-health-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-4); }
.pp-health-label { margin: var(--space-5) 0 var(--space-2); font-size: 12px; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }
.pp-health-line { font-size: 14px; margin: 2px 0; }
.pp-health-detail { color: var(--ink-soft); }
.pp-health-warn strong { color: var(--danger); }
.pp-health-next { color: var(--teal-dark); font-weight: 600; font-size: 14px; }
.pp-health-follow { color: #B7791F; font-size: 14px; }

/* Dashboard "Me" avatar (2026-10-13): your person's photo or initials beside the greeting, +N while several are marked Self. */
.beta-me { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--teal); background: var(--teal-tint);
  padding: 0; cursor: pointer; flex: none; display: flex; align-items: center; justify-content: center; overflow: visible; }
.beta-me-initials { font-weight: 700; font-size: 18px; color: var(--ink); }
.beta-me-photo { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.beta-me-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--danger);
  color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* A person's Linked tree (2026-10-13): groups > collections > items, a medical record's tabs counted. */
.pp-tree-bar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.pp-tree-summary { color: var(--ink-soft); font-size: 13px; margin-right: auto; }
.pp-tree { border: 1px solid var(--border); border-radius: 14px; padding: var(--space-3) var(--space-4); background: var(--surface); }
.pp-tree details > summary { cursor: pointer; padding: 7px 4px; list-style: none; border-radius: 8px; }
.pp-tree details > summary::-webkit-details-marker { display: none; }
.pp-tree details > summary::before { content: "\25B8"; display: inline-block; width: 18px; color: var(--ink-faint); }
.pp-tree details[open] > summary::before { content: "\25BE"; }
.pp-tree summary:hover, .pp-tree-leaf[href]:hover { background: var(--surface-alt); }
.pp-tree-group > summary .pp-tree-title { font-weight: 600; }
.pp-tree-children { padding-left: 18px; }
.pp-tree-leaf { display: flex; align-items: baseline; gap: 6px; padding: 7px 4px 7px 22px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.pp-tree-detail { color: var(--ink-faint); font-size: 13px; }
.pp-tree-count { display: inline-block; min-width: 20px; padding: 0 7px; border-radius: 9px; background: var(--teal-tint); color: var(--teal-dark); font-size: 11px; font-weight: 600; text-align: center; }
.pp-tree-go { margin-left: auto; color: var(--ink-faint); }
.pp-tree-open { margin-left: var(--space-4); font-size: 13px; font-weight: 600; color: var(--teal-dark); text-decoration: none; }
.pp-tree-open:hover { text-decoration: underline; }
.pp-health > summary { cursor: pointer; list-style: none; margin-bottom: 0; }
.pp-health > summary::-webkit-details-marker { display: none; }
.pp-health > summary > span::before { content: "\25B8"; display: inline-block; width: 18px; color: var(--ink-faint); }
.pp-health[open] > summary > span::before { content: "\25BE"; }
.pp-health[open] > summary { margin-bottom: var(--space-4); }
.pp-tree-menu { margin-left: var(--space-3); border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 0 8px; font-size: 16px; line-height: 22px; color: var(--ink-soft); cursor: pointer; }
.pp-tree-menu:hover { background: var(--surface-alt); color: var(--ink); }
.pp-tree div.pp-tree-leaf { align-items: center; }
