.directory-views { display:inline-flex; margin-inline-start:auto; padding:3px; gap:2px; border:1px solid var(--line); border-radius:8px; background:#f0f2eb; }
.directory-views button { border:0; padding:6px 12px; background:transparent; color:#415146; border-radius:5px; font-weight:600; }
.directory-views button[aria-pressed="true"] { color:#183f30; background:white; box-shadow:0 1px 3px #263b2929; }
.sheet-tools { display:flex; align-items:baseline; justify-content:space-between; gap:12px; border-block:1px solid var(--line); padding:6px 15px; color:var(--muted); font-size:.83rem; }
.sheet-columns { flex-shrink:0; }
.sheet-commands { display:flex; align-items:center; flex-wrap:wrap; gap:4px; margin-inline-start:auto; }
.sheet-commands button { background:none; border:1px solid var(--line); border-radius:5px; color:var(--green); padding:5px 9px; font-weight:600; }
.household-sheet td[aria-selected="true"] { background:#d9e9dc!important; box-shadow:inset 0 -1px #bdd3c4; }
.sheet-editor .sheet-save-status { margin:0; font-size:.78rem; color:#455b4c; }
.sheet-key-list { display:grid; grid-template-columns:minmax(6rem,auto) minmax(0,1fr); gap:.65rem .9rem; }
.sheet-key-list dt { font-weight:650; }.sheet-key-list dd { margin:0; }
.sheet-columns summary { color:var(--green); font-weight:650; cursor:pointer; padding:5px 0; }
.sheet-tools:has(.sheet-columns[open]) { flex-wrap:wrap; }
.sheet-columns[open] { flex:1 1 100%; }
.sheet-columns>div { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,10rem),1fr)); gap:4px 10px; padding-bottom:6px; }
.sheet-columns label { display:flex; align-items:center; gap:6px; min-height:34px; cursor:pointer; color:var(--ink); }
.sheet-scroll { --sheet-name-width:15rem; position:relative; isolation:isolate; width:100%; overflow:auto; max-height:min(68dvh,52rem); overscroll-behavior-x:contain; scroll-padding:3rem 6px 6px calc(2.8rem + var(--sheet-name-width)); }
.household-sheet { min-width:100%; table-layout:fixed; border-spacing:0; border-collapse:separate; font-size:.88rem; color:var(--ink); }
.household-sheet thead { position:sticky; top:0; z-index:3; background:#e9efe6; }
.household-sheet th { padding:0; height:2.75rem; background:#e9efe6; border-bottom:1px solid #c6d1c3; }
.household-sheet th button { display:flex; align-items:center; gap:.4rem; width:100%; min-height:2.75rem; text-align:start; background:transparent; border:0; color:#33493b; font-size:.83rem; font-weight:650; padding:0 .6rem; }
.household-sheet th button span { color:#637969; }
.household-sheet th[aria-sort] button { color:#174d36; }
.household-sheet td { height:2.75rem; padding:0 .6rem; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.household-sheet :is(th,td) { border-inline-end:1px solid #e0e5da; }
.household-sheet tbody tr[data-sheet-row] { background:#fffefa; }
.household-sheet tbody tr[data-sheet-row]:nth-child(even) { background:#f6f8f2; }
.household-sheet tr[data-sheet-row]:has([data-select]:checked) { background:#e8f0e6; }
.household-sheet :is(th,td):first-child { position:sticky; left:0; z-index:1; padding:0; }
.household-sheet :is(th,td):nth-child(2) { position:sticky; left:2.8rem; z-index:1; border-inline-end:1px solid #bac9bb; }
.household-sheet tbody td:first-child,.household-sheet tbody td:nth-child(2) { background:inherit; }
.household-sheet td[data-col] { cursor:text; }
.household-sheet td[data-col]:hover { box-shadow:inset 0 0 0 1px #789481; }
.household-sheet td[data-col]:focus { outline:2px solid #396a4d; outline-offset:-2px; }
.sheet-check { display:grid; place-items:center; min-height:2.75rem; cursor:pointer; }
.sheet-check input { width:17px; height:17px; }
.household-sheet td[data-col=sent_bool] { padding:0; cursor:pointer; }
.sheet-sent { display:flex; align-items:center; gap:.4rem; min-height:2.75rem; padding-inline:.5rem; font-size:.8rem; cursor:pointer; }
.sheet-sent input { width:17px; height:17px; flex:none; margin:0; accent-color:var(--green); cursor:inherit; }
.sheet-sent:has(input:disabled) { cursor:default; }
.sheet-sent:has(input:checked) { color:#1e5c3d; font-weight:650; }
.sheet-sent:focus-within { outline:2px solid #396a4d; outline-offset:-2px; }
.sheet-name { display:flex; align-items:center; justify-content:space-between; gap:.3rem; font-weight:650; }
.sheet-name span { overflow:hidden; text-overflow:ellipsis; }
.sheet-flag { display:inline-block; font-size:.8rem; color:#475549; }
.sheet-flag.marked { color:#1e5c3d; font-weight:650; }
.sheet-blank { color:#748174; }
.household-sheet .sheet-space td { padding:0; border:0; position:static; }
dialog.sheet-editor { position:fixed; inset:auto; margin:0; width:min(18.5rem,calc(100vw - 10px)); padding:11px; border:2px solid #436c52; border-radius:7px; box-shadow:0 6px 24px #1d372938; white-space:normal; }
.sheet-editor::backdrop { background:transparent; }
.sheet-editor form { display:grid; gap:7px; }
.sheet-editor label { display:block; color:#30493a; font-weight:650; font-size:.84rem; }
.sheet-editor label span { font-weight:450; }
.sheet-editor :is(input,select,textarea) { width:100%; border:1px solid #acb9ac; border-radius:4px; background:#fff; padding:7px 8px; font:inherit; }
.sheet-editor .sheet-edit-actions { display:flex; justify-content:flex-end; gap:6px; }
.sheet-edit-actions button { border:1px solid var(--line); border-radius:5px; padding:5px 12px; color:var(--green); background:white; }
.sheet-edit-actions button[type=submit] { background:var(--green); color:white; }
.sheet-editor .sheet-error { margin:0; color:#8d322b; font-size:.87rem; }
@media(max-width:720px) {
  .directory-views { margin-inline-start:0; }
  .sheet-scroll { --sheet-name-width:9rem; max-height:65dvh; }
  .sheet-name span { white-space:normal; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-height:1.15; overflow-wrap:anywhere; }
  .sheet-tools { flex-wrap:wrap; }
}
@media(pointer:coarse) {
  .sheet-commands button { min-height:44px; }
  .directory-views button,.sheet-edit-actions button,.sheet-columns label,.sheet-columns summary { min-height:44px; }
  .sheet-editor :is(input,textarea,select) { font-size:16px; min-height:44px; }
}
