/* Family Vault 1.5: an asset's page made of blocks (blocks.js) and the category editor (categories.js). Uses the
   tokens of look.css; the category colours are the look's k1 … k8. */

.blocks{display:grid;gap:30px}
.blk{display:grid;gap:12px;min-width:0}
.blk-h{scroll-margin-top:80px}
.blk>.small.muted{margin:0}

/* specs: a tidy grid of facts, two or three columns, one on phones */
dl.specs{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:0 28px;margin:0}
dl.specs>div{display:grid;gap:2px;padding:10px 0;border-bottom:1px solid var(--line);min-width:0}
dl.specs dt{font-size:.74rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--faint)}
dl.specs dd{margin:0;font-weight:600;overflow-wrap:anywhere}
.kp{display:inline-flex;align-items:center;gap:6px;font-family:var(--f-mono);font-size:.88rem;font-weight:500;padding:2px 8px;border-radius:8px;background:var(--surface-2)}
.kp svg.i{width:14px;height:14px;color:var(--muted)}

/* the page's main button opens what can be added */
.addmenu>summary.btn{display:inline-flex}
.addmenu .menu-pop{min-width:240px}

/* an item's icon takes its category's colour */
.av.tav[class*=" k"]{background:color-mix(in srgb,var(--kc) 16%,var(--surface));color:var(--kc)}
.av.tav[class*=" k"] svg.i{stroke:var(--kc)}

/* category editor: colour swatches and the spec fields */
.swatches{display:flex;flex-wrap:wrap;gap:8px}
.swatches .sw{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;cursor:pointer;background:var(--kc,var(--surface-2));border:2px solid transparent;color:var(--muted);font-weight:700;font-size:.8rem}
.swatches .sw input{position:absolute;opacity:0;pointer-events:none}
.swatches .sw:has(input:checked){border-color:var(--fg);box-shadow:0 0 0 2px var(--surface) inset}
.swatches .sw:has(input:focus-visible){outline:2px solid var(--accent)}
.specs-ed{display:grid}
.specrow{display:grid;grid-template-columns:minmax(0,1fr) 190px auto;gap:8px;align-items:center;padding:8px 0;border-top:1px solid var(--line)}
.specrow .full{grid-column:1/-1;margin:0}
.specmove{display:flex;gap:2px}
@media (max-width:600px){
  .specrow{grid-template-columns:minmax(0,1fr) auto}
  .specrow select{grid-column:1/2}
  .specmove{grid-row:1;grid-column:2}
  dl.specs{grid-template-columns:1fr 1fr;gap:0 16px}
}

/* insurance and contracts in their blocks: only the fields that are filled in (Edit shows them all) */
.blk dl.kv dt:has(+ dd > span.muted:only-child),.blk dl.kv dd:has(> span.muted:only-child){display:none}
/* on phones the Add button is the round + at the bottom: its menu opens above it */
@media (max-width:820px){.addmenu:has(> summary.fab) .menu-pop{position:fixed;top:auto;right:16px;bottom:calc(84px + env(safe-area-inset-bottom));z-index:41;box-shadow:var(--shadow-lg)}}

/* the blocks an item has nothing in yet: one row of buttons */
.addrow .chips{display:flex;flex-wrap:wrap;gap:8px}
.addrow .chip{display:inline-flex;align-items:center;gap:6px;cursor:pointer}
.addrow .chip svg.i{width:16px;height:16px}
dl.specs.earlier dd{font-weight:500;color:var(--muted)}
/* phones: room under the last block for the round + button, so it covers no button */
@media (max-width:820px){.blocks{padding-bottom:76px}}

/* a new section of a ready-made kind: a plain form of its values (vault.js cardDialog), the field builder behind a link */
.frow.simple,.panel .frow.simple{grid-template-columns:minmax(0,1fr);gap:6px}
.frow.simple .flabel{font-weight:600;font-size:.88rem}
.frow.simple .fopts,.frow.simple .fval{grid-column:1 / -1}
.frow .fnote{grid-column:1 / -1;margin:0}
#ed .linkbtn{background:none;border:0;padding:4px 0;color:var(--accent);font:inherit;font-weight:600;cursor:pointer;justify-self:start}

/* 1.21: a row of what matters now under a page's title (as on a rental property), and a category of assets as tiles */
.hchips{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.hchip{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 11px;border-radius:999px;background:var(--surface);border:1px solid var(--line);font-size:.8rem;font-weight:500;color:var(--fg);white-space:nowrap}
.hchip i{width:7px;height:7px;border-radius:50%;background:currentColor;display:block}
.hchip.ok{background:var(--ok-soft);border-color:transparent;color:var(--ok)}
.hchip.warn{background:var(--warn-soft);border-color:transparent;color:var(--warn)}
.hchip.bad{background:var(--danger-soft);border-color:transparent;color:var(--danger)}
.av.catpic{border-radius:18px}
.thscope{display:grid;gap:12px}
.thscope>.sheet-h{margin:0}
.thtiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,380px),1fr));gap:14px}
.thtile{position:relative;display:flex;align-items:center;gap:16px;padding:16px 18px;border-radius:24px;background:var(--surface);border:1px solid var(--line);cursor:pointer;min-width:0;transition:border-color .15s,box-shadow .15s}
.thtile:hover,.thtile.open{border-color:var(--accent);box-shadow:var(--shadow-lg)}
.thtile:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.thtile.off{background:var(--surface-2)}
.thtile.off .thpic{filter:grayscale(.6);opacity:.8}
.thpic{width:84px;height:84px;border-radius:20px;flex:none;display:grid;place-items:center;overflow:hidden;background:color-mix(in srgb,var(--kc,var(--accent)) 16%,var(--surface));color:var(--kc,var(--accent))}
.thpic img{width:100%;height:100%;object-fit:cover}
.thpic .i{width:34px;height:34px}
.tht{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.tht b{font-size:1.05rem;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tht small{font-size:.84rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tht .hchips{margin-top:6px}
.thtile>.go{width:18px;height:18px;color:var(--muted);flex:none}
.thpick{position:absolute;top:10px;right:12px}
.gone-things{margin-top:6px}
.gone-things>summary{cursor:pointer;padding:8px 0}
.gone-things>.thtiles{margin-top:8px}
@media (max-width:560px){.thpic{width:64px;height:64px;border-radius:16px}.thtile{padding:14px}}

/* 1.32.1: up to four facts under an item page's head (factCards in app.js) */
.facts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:4px 0 6px}
.fact{display:flex;flex-direction:column;gap:3px;min-width:0;padding:14px 16px 15px;background:var(--surface);border-radius:18px;box-shadow:var(--shadow);border:1px solid transparent}
.fact .fk{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:.8rem;font-weight:550;margin-bottom:4px}
.fact .fk svg{flex:none;width:26px;height:26px;padding:5px;border-radius:8px;background:var(--pt-tile,var(--surface-2));color:var(--pt-ico,var(--muted))}
.fact .fv{font-family:var(--f-display,inherit);font-size:1.3rem;font-weight:650;letter-spacing:-.015em;line-height:1.2;color:var(--fg);overflow-wrap:anywhere}
.fact .fd{font-size:.8rem;color:var(--muted);line-height:1.35}
.fact .bar{height:5px;margin-top:8px;border-radius:9px;background:var(--surface-2);overflow:hidden}
.fact .bar i{display:block;height:100%;border-radius:9px;background:var(--accent)}
.fact.ok .fd{color:var(--ok)}
.fact.warn .fd{color:var(--warn)}
.fact.warn{box-shadow:inset 3px 0 0 var(--pt-amber,var(--warn)),var(--shadow)}
.fact.bad .fd{color:var(--danger)}
.fact.bad{box-shadow:inset 3px 0 0 var(--danger),var(--shadow)}
@media (max-width:1100px){.facts{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:420px){.facts{gap:10px}.fact{padding:12px 13px}.fact .fv{font-size:1.1rem}}
