/* ============================================================
   JOIN Handover Portal v2 - shared styles
   Tokens + platform-wide components now live in the shared
   base (base.css), imported below and shared with the admin app.
   Portal-specific components stay in this file.
   Governing rules: STYLE-GUIDE.md.
   ============================================================ */
@import "base.css";

*{box-sizing:border-box;margin:0;padding:0}
body{font-family:var(--font-sans);background:var(--bg);color:var(--fg);font-size:13px;line-height:1.55}
a{color:inherit}
button{font:inherit}
.hidden{display:none!important}

/* ── Shell: white left sidenav + breadcrumb topbar + grey canvas ──
   Primary destinations live in .shell-sidenav (injected by app.js).
   The topbar carries the breadcrumb. Each page's own left list
   (#sideTree) is a SECONDARY sub-nav that sits on the canvas. */
body:has(.shell-sidenav){display:grid;grid-template-columns:232px minmax(0,1fr);grid-template-rows:auto 1fr;min-height:100vh}
body:has(.shell-sidenav)>*{grid-column:2}
/* Placement needs to OUTWEIGH the catch-all above (it carries the :has()
   specificity), so the sidenav/topbar/body rows are pinned with > rules. */
body:has(.shell-sidenav)>.shell-sidenav{grid-column:1;grid-row:1/-1}
body:has(.shell-sidenav)>.shell-topbar{grid-column:2;grid-row:1}
body:has(.shell-sidenav)>.shell-body{grid-row:2}
.shell-sidenav{position:sticky;top:0;height:100vh;overflow-y:auto;background:var(--surface);border-right:1px solid var(--border);display:flex;flex-direction:column}
.sn-logo{height:56px;flex:none;display:flex;align-items:center;padding:0 18px;border-bottom:1px solid var(--border)}
.sn-logo img{height:22px;display:block}
.sn-nav{flex:1;overflow-y:auto;padding:12px 10px;display:flex;flex-direction:column;gap:2px}
.sn-eyebrow{padding:8px 10px 4px;font-size:10px;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.sn-item{display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:12.5px;font-weight:450;color:var(--fg-2);border-radius:var(--radius);text-decoration:none;cursor:pointer;transition:background var(--dur-fast) var(--ease)}
.sn-item:hover{background:var(--surface-2)}
.sn-item.active{background:var(--fg);color:#fff;font-weight:500}
.sn-item.active:hover{background:var(--fg)}



.shell-topbar{grid-row:1;display:flex;align-items:center;gap:14px;padding:0 20px;height:56px;border-bottom:1px solid var(--border);background:var(--surface);position:sticky;top:0;z-index:50}
.crumbbar{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--muted);min-width:0}
.crumbbar svg{flex:none;color:var(--muted-2)}
.crumbbar b{color:var(--fg);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crumbbar b.crumb-dim{color:var(--muted);font-weight:400}
.crumbbar a.crumb-page{color:var(--fg);font-weight:500;text-decoration:none}
.crumbbar a.crumb-page:hover{text-decoration:underline;text-underline-offset:3px}
.crumbbar a.crumb-page.crumb-dim{color:var(--muted);font-weight:400}
.backlink{display:inline-block;font-size:12px;font-weight:500;color:var(--muted);text-decoration:none;margin-bottom:8px}
.backlink:hover{color:var(--fg)}
.crumbbar #crumbExtra{display:inline-flex;align-items:center;gap:7px;min-width:0}
.shell-topbar-right{margin-left:auto;display:flex;align-items:center;gap:10px}
.proj-btn{display:inline-flex;align-items:center;gap:7px;font:inherit;font-size:12px;font-weight:500;color:var(--fg);border:1px solid var(--border);background:var(--surface);border-radius:var(--radius);padding:5px 10px;cursor:pointer;max-width:220px;white-space:nowrap;overflow:hidden}
.proj-btn svg{flex:none;color:var(--muted-2)}
.proj-btn:hover{border-color:var(--border-strong)}
.proj-panel{position:fixed;z-index:90;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);padding:4px;display:flex;flex-direction:column;gap:2px;min-width:180px;max-height:60vh;overflow:auto}
.proj-opt{display:flex;border:0;background:none;padding:7px 10px;border-radius:6px;cursor:pointer;font:inherit;font-size:12.5px;color:var(--fg);text-align:left;white-space:nowrap}
.proj-opt:hover{background:var(--surface-2)}
.proj-opt.on{background:var(--surface-3);font-weight:500}

/* Content region: pages keep their .shell-body wrapper; the optional
   #sideTree inside it is the SECONDARY nav, quiet on the canvas. */
.shell-body{display:grid;grid-template-columns:224px minmax(0,1fr)}
.shell-body.no-side{grid-template-columns:1fr}
.shell-side{padding:20px 8px 20px 16px;display:flex;flex-direction:column;gap:2px;align-self:start;position:sticky;top:56px;max-height:calc(100vh - 56px);overflow-y:auto}
.side-eyebrow{padding:8px 10px 4px;font-size:10px;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.side-item{display:flex;align-items:center;justify-content:space-between;padding:6px 10px;font-size:12px;font-weight:450;color:var(--fg-2);border-radius:var(--radius-sm);text-decoration:none;cursor:pointer}
.side-item:hover{background:var(--surface)}
.side-item.active{background:var(--surface-3);color:var(--fg);font-weight:500}
/* Group rows read exactly like the links; the chevron is the only
   difference (they were smaller letter-spaced muted text - off-pattern) */
.side-group{border:none;background:none;width:100%;display:flex;align-items:center;justify-content:space-between;padding:6px 10px;font:inherit;font-size:12px;font-weight:450;letter-spacing:0;color:var(--fg-2);cursor:pointer;border-radius:var(--radius-sm)}
.side-group svg{color:var(--muted-2)}
.side-group:hover{background:var(--surface)}
.side-group svg{transition:transform .15s}
.side-group.closed svg{transform:rotate(-90deg)}
.side-group.closed+.side-rooms{display:none}
.side-rooms{display:flex;flex-direction:column;gap:1px;margin-bottom:4px}
.side-rooms .side-item{padding-left:18px}
.shell-main{padding:28px 32px;background:var(--bg);min-width:0}
.wrap{max-width:980px}
.wrap.centered{margin:0 auto}
.hamburger{display:none;border:none;background:none;color:var(--fg-2);cursor:pointer;padding:4px}
@media(max-width:860px){
  body:has(.shell-sidenav){display:block}
  .shell-sidenav{position:fixed;inset:0 auto 0 0;width:248px;z-index:80;transform:translateX(-105%);transition:transform var(--dur-med) var(--ease);box-shadow:var(--shadow-lg)}
  body.nav-open .shell-sidenav{transform:none}
  body.nav-open::before{content:"";position:fixed;inset:0;background:var(--scrim);z-index:70}
  .hamburger{display:inline-flex}
  .shell-body{grid-template-columns:1fr}
  .shell-side{display:none}
  .shell-main{padding:20px 16px 80px}
}

.back-chip{display:none;align-items:center;gap:6px;font-size:12.5px;font-weight:500;color:var(--fg-2);text-decoration:none;margin-bottom:12px}
/* On phones the back-chip takes over; the in-page backlink would double up */
@media(max-width:860px){.back-chip{display:inline-flex}#roomBack,#sysBack{display:none}}

/* ── Type ── */
h1.page{font-family:var(--font-display);font-size:28px;font-weight:600;letter-spacing:-.02em}
.section{margin-top:26px}
.section-kicker{font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:10px}
.crumb{font-size:11px;color:var(--muted);margin-bottom:8px}
.crumb a{color:var(--muted);text-decoration:none}
.crumb a:hover{color:var(--fg)}

/* ── Buttons / chips / pills ──
   .btn/.btn-primary live in base.css only. A second .btn here used to
   sit after the import and washed every .btn-primary back to white. */
/* Contact chip: soft blue = a person or company you can reach. One
   component for suppliers, contacts, chase lists - everywhere. */
.chip{display:inline-block;font-size:11.5px;font-weight:500;line-height:1.35;color:var(--info-fg);background:var(--info-bg);border:1px solid rgba(61,98,160,.28);border-radius:var(--radius);padding:3px 9px;text-decoration:none;text-align:left}
.chip-flat{cursor:default}
.pill{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:500;border-radius:999px;padding:2px 9px;white-space:nowrap}
.lvl{font-size:10.5px;font-weight:600;letter-spacing:0;background:var(--surface-3);color:var(--fg-2);border-radius:999px;padding:2px 9px;white-space:nowrap}

/* ── Pill select: coloured filter/status dropdown (same as admin) ── */
.psel{display:inline-flex;align-items:center;gap:5px;border:0;cursor:pointer;font:inherit;font-size:11px;font-weight:500;line-height:1.35;padding:4px 11px}
.psel svg{flex:none;opacity:.55}
.psel:hover{filter:brightness(.96)}
.psel:focus-visible{outline:2px solid var(--fg);outline-offset:1px}
.psel-panel{position:fixed;z-index:140;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);padding:4px;display:flex;flex-direction:column;gap:2px;min-width:150px;max-height:60vh;overflow:auto}
.psel-item{display:flex;align-items:center;border:0;background:none;padding:5px 8px;border-radius:6px;cursor:pointer;font:inherit;font-size:12px;color:var(--fg);text-align:left;white-space:nowrap}
.psel-item:hover{background:var(--surface-2)}
.psel-item.on{background:var(--surface-2)}

/* Topbar: global New request action - icon-only on narrow phones */
.btn-newreq{gap:5px}
@media(max-width:640px){
  .btn-newreq{padding:7px 9px}
  .btn-newreq .nr-lbl{display:none}
}

/* Nav counter: open requests still with JOIN */
.nav-count{margin-left:auto;font-size:10.5px;font-weight:600;background:var(--surface-3);color:var(--fg-2);border-radius:999px;padding:1px 7px;line-height:1.5}
.sn-item.active .nav-count{background:rgba(255,255,255,.22);color:#fff}

/* ── Search ── */
.gsearch{margin:18px 0 0;position:relative;max-width:560px}
.gsearch input{width:100%;padding:10px 14px 10px 40px;border:1px solid var(--border);border-radius:var(--radius-lg);font:inherit;font-size:13px;background:var(--surface);box-shadow:var(--shadow-sm)}
.gsearch input:focus{outline:2px solid var(--fg);outline-offset:-1px}
.gsearch>svg{position:absolute;left:13px;top:13px;color:var(--muted-2)}
.gresults{position:absolute;top:calc(100% + 6px);left:0;right:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);z-index:40;max-height:340px;overflow:auto;display:none}
.gresults.open{display:block}
.gresult{display:flex;align-items:baseline;gap:10px;padding:9px 14px;cursor:pointer;border-bottom:1px solid var(--surface-2)}
.gresult:hover{background:var(--surface-2)}
.gresult .what{font-weight:600}
.gresult .prod{color:var(--muted);font-size:12px}
.gresult .where{margin-left:auto;font-size:11px;color:var(--muted);white-space:nowrap}
.gnone{padding:12px 14px;color:var(--muted)}
.room-search{position:relative;margin-left:auto}
.room-search input{padding:6px 10px 6px 30px;border:1px solid var(--border);border-radius:999px;font:inherit;font-size:12.5px;background:var(--surface);width:210px}
.room-search svg{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--muted-2);pointer-events:none}
.search-hide{display:none!important}

/* ── Zone tiles ── */
.floor{margin-top:28px}
.floor-head h2{font-size:13px;font-weight:600;color:var(--muted);margin-bottom:10px}
.zone-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:10px}
.zone-tile{display:flex;gap:12px;align-items:flex-start;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:14px;text-decoration:none;box-shadow:var(--shadow-sm);transition:box-shadow .15s,transform .12s;cursor:pointer}
.zone-tile:hover{box-shadow:var(--shadow-lg);transform:translateY(-1px)}
.zone-ic{width:38px;height:38px;border-radius:var(--radius);flex-shrink:0;display:flex;align-items:center;justify-content:center;background:var(--surface-3);color:var(--fg-2)}
.zone-tile .zn{font-weight:600;font-size:13.5px;color:var(--fg)}
.zone-tile .zs{color:var(--muted);font-size:12px;margin-top:2px;line-height:1.45;display:block}
.wh-banner{display:flex;gap:12px;align-items:flex-start;text-decoration:none;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:14px;margin:22px 0 6px;box-shadow:var(--shadow-sm);transition:box-shadow .15s,transform .12s;cursor:pointer}
.wh-banner:hover{box-shadow:var(--shadow-lg);transform:translateY(-1px)}
.wh-banner .zi{width:38px;height:38px;border-radius:var(--radius);flex-shrink:0;display:flex;align-items:center;justify-content:center;background:var(--surface-3);color:var(--fg-2)}
.wh-banner .t{font-weight:600;font-size:13.5px;color:var(--fg)}
.wh-banner .zs{color:var(--muted);font-size:12px;margin-top:2px;display:block}

/* ── Room view ── */
.room-head{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:18px 22px;margin-bottom:14px;box-shadow:var(--shadow-sm)}
.room-head h1{font-family:var(--font-display);font-size:21px;font-weight:600;letter-spacing:-.01em;display:flex;align-items:center;gap:10px}
.room-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px;align-items:center;position:sticky;top:56px;z-index:30;background:var(--bg);padding:16px 0 12px;box-shadow:0 8px 8px -8px rgba(20,20,20,.06)}
.cat-jump{font-size:12px;font-weight:500;color:var(--fg-2);background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:4px 12px;text-decoration:none;transition:background .12s,color .12s,border-color .12s}
.cat-jump:hover{border-color:var(--border-strong);background:var(--surface-2)}
.cat-jump.active{background:var(--fg);color:#fff;border-color:var(--fg)}

.cat{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);margin-bottom:14px;scroll-margin-top:110px;overflow:hidden}
.cat-head{display:flex;align-items:center;gap:10px;padding:11px 16px;border-bottom:1px solid var(--border)}
.cat-head .ci{width:26px;height:26px;border-radius:var(--radius-sm);background:var(--surface-3);color:var(--fg-2);display:flex;align-items:center;justify-content:center}
.cat-head h2{font-size:13.5px;font-weight:600}
/* One quiet care line per category: the hard rule, always visible, no tint */
.care-line{display:flex;align-items:baseline;gap:8px;padding:8px 16px;border-bottom:1px solid var(--border);font-size:12px;color:var(--muted)}
.care-line svg{flex-shrink:0;color:var(--muted-2);transform:translateY(1.5px)}
.care-line a{color:var(--fg);font-weight:500;text-decoration:underline;text-underline-offset:2px;text-decoration-color:var(--border-strong);text-decoration:none;cursor:pointer;white-space:nowrap}
.care-line a:hover{text-decoration:underline;text-underline-offset:2px}

/* Room view tabs: design-system underline tabs on the header card */
.tabs{display:flex;gap:20px;align-items:center;margin:14px -22px -18px;padding:0 22px;border-top:1px solid var(--border)}
.tabs .room-search{margin-left:auto;padding:6px 0}
.tab{border:none;background:none;padding:10px 2px;font-size:13px;font-weight:500;color:var(--muted);cursor:pointer;border-bottom:2.5px solid transparent}
.tab:hover:not(.active){color:var(--fg-2)}

/* Care guide page: prose gets its own mode, no amber wash */
.care-guide{display:flex;flex-direction:column;gap:10px}
.care-block{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:16px 18px;box-shadow:var(--shadow-sm)}
.care-block .cb-head{display:flex;align-items:baseline;gap:10px}
.care-block h3{font-size:13.5px;font-weight:600}
.care-block .freq{font-size:10.5px;color:var(--muted)}
.care-block .cat-tag{margin-left:auto;font-size:11px;color:var(--muted-2)}
.care-block .warn{color:var(--warning-fg);font-size:12.5px;font-weight:600;margin-top:6px}
.care-block ul{margin:8px 0 0 16px;color:var(--fg-2)}
.care-block li{font-size:12.5px;margin:3px 0}

/* ── Tables ── */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);overflow:hidden}
table{width:100%;border-collapse:collapse}
th{font-size:10.5px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);text-align:left;padding:7px 16px;border-bottom:1px solid var(--border);background:var(--surface)}
td{padding:9px 16px;border-bottom:1px solid var(--border);vertical-align:top;font-size:12.5px}
tr:last-child td{border-bottom:none}
/* Spec tables read as one continuous spreadsheet: identical column
   widths on every card, enforced by fixed table layout. */
.cat table{table-layout:fixed}
.cat th:nth-child(1){width:200px}
.cat th:nth-child(3){width:190px}
.cat th:nth-child(4){width:40px}
/* Maintenance variant: balanced thirds, task slightly favoured */
.cat table.cols-m th:nth-child(1){width:45%}
.cat table.cols-m th:nth-child(2){width:30%}
.cat table.cols-m th:nth-child(3){width:25%}
/* Trade rates: company + a price per service frequency */
.cat table.cols-tr th:nth-child(1){width:36%}
.cat table.cols-tr th:nth-child(2),.cat table.cols-tr th:nth-child(3),.cat table.cols-tr th:nth-child(4),.cat table.cols-tr th:nth-child(5){width:16%}
/* Contact tables (company / person / phone) get their own shape */
table.cols-c th:nth-child(1){width:42%}
table.cols-c th:nth-child(2){width:33%}
table.cols-c th:nth-child(3){width:25%}
/* Maintenance with due dates: task / frequency / next due / contact */
.cat table.cols-mj th:nth-child(1){width:40%}
.cat table.cols-mj th:nth-child(2){width:22%}
.cat table.cols-mj th:nth-child(3){width:16%}
.cat table.cols-mj th:nth-child(4){width:22%}
/* Documents: Document | (Details when the section has them) | action.
   The name column takes the leftover width so filenames stop wrapping. */
.cat table.cols-docs th.w-det{width:280px}
.cat table.cols-docs th.w-act{width:110px}
.pill-gap{display:inline-block;margin-top:4px}
td.item{font-weight:600;color:var(--fg);overflow-wrap:break-word}
td.item .ref-tag{display:inline-block;font-weight:400;font-size:10.5px;color:var(--muted);background:var(--surface-2);border-radius:var(--radius-sm);padding:1px 6px;margin-top:4px}
td.prod{color:var(--fg-2);overflow-wrap:break-word}
td.prod .detail{display:block;color:var(--muted);font-size:11.5px;margin-top:2px;line-height:1.5;white-space:pre-line}
/* Documents attached to a spec: quiet file buttons under the product line */
td.prod .spec-docs{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
td.prod .spec-docs .file-btn{font-size:11px;padding:3px 9px}
td.supplier{overflow-wrap:break-word}
td.supplier .chip{margin:3px 0}
td.copy{text-align:right}
td.right{text-align:right}
@media(max-width:700px){td.right{text-align:left;padding-top:4px}}
.row-copy{opacity:0;border:none;background:none;cursor:pointer;color:var(--muted-2);padding:2px;border-radius:var(--radius-sm)}
tr:hover .row-copy{opacity:1}
.row-copy:hover{color:var(--fg-2);background:var(--surface-2)}
.empty{padding:20px 16px;color:var(--muted);font-size:12.5px}
tr.row-link{cursor:pointer}
tr.row-link:hover td{background:var(--surface-2)}

/* System detail */
.prose-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:16px 18px;margin-bottom:14px}
.prose-card p{font-size:13px;color:var(--fg-2);line-height:1.6}
.prose-card .warn{color:var(--warning-fg);font-weight:600;font-size:12.5px;margin-top:8px}
.prose-card ul{margin:4px 0 0 16px;color:var(--fg-2);font-size:12.5px}
.prose-card li{margin:3px 0}
.sys-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;align-items:center}
.file-btn{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:var(--fg-2);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:5px 11px;cursor:pointer;text-decoration:none}
.file-btn:hover{border-color:var(--border-strong)}
tr.files-row td{background:var(--surface-2);padding:10px 16px}
tr.files-row .sys-meta{margin-top:0}

/* Gallery */
.media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px}
.media-card{position:relative;border-radius:var(--radius-lg);overflow:hidden;background:var(--surface-2);border:1px solid var(--border);cursor:pointer;transition:box-shadow .15s}
.media-card:hover{box-shadow:var(--shadow-lg)}
.media-card img,.media-card video{width:100%;aspect-ratio:4/3;object-fit:cover;display:block;background:#000;pointer-events:none}
.media-card .cap{padding:7px 10px;font-size:12px;font-weight:500;color:var(--fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.media-play{position:absolute;top:0;left:0;right:0;aspect-ratio:4/3;display:flex;align-items:center;justify-content:center;pointer-events:none}
.media-play span{width:40px;height:40px;border-radius:50%;background:rgba(20,20,20,.55);display:flex;align-items:center;justify-content:center}
.lightbox{position:fixed;inset:0;background:rgba(20,20,20,.88);z-index:99;display:flex;align-items:center;justify-content:center;cursor:pointer}
.lightbox img,.lightbox video{max-width:92vw;max-height:86vh;border-radius:var(--radius-lg)}
.lightbox .cap{position:absolute;bottom:22px;left:50%;transform:translateX(-50%);background:rgba(0,0,0,.6);color:#fff;font-size:13px;padding:6px 14px;border-radius:999px;white-space:nowrap}
.lb-nav{position:absolute;top:50%;transform:translateY(-50%);width:44px;height:64px;border:0;border-radius:10px;background:rgba(0,0,0,.35);color:#fff;font-size:34px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}
.lb-nav:hover{background:rgba(0,0,0,.55)}
.lb-prev{left:12px}
.lb-next{right:12px}
.lb-count{opacity:.7;font-size:11px;margin-left:6px}
/* Photos & Videos: grid | list view toggle + list rows */
.view-seg{display:inline-flex;border:1px solid var(--border);border-radius:7px;overflow:hidden;flex:none}
.view-seg button{border:0;background:var(--surface);padding:7px 11px;cursor:pointer;color:var(--muted);display:flex;align-items:center}
.view-seg button + button{border-left:1px solid var(--border)}
.view-seg button.on{background:var(--surface-3);color:var(--fg)}
.mth{overflow:hidden}
.mth img,.mth video{width:100%;height:100%;object-fit:cover;display:block}
.media-list{background:var(--surface);border:1px solid var(--border);border-radius:10px;overflow:hidden}
.media-card.media-lrow{display:flex;align-items:center;gap:12px;padding:8px 14px;border:0;border-bottom:1px solid var(--border);border-radius:0;background:var(--surface)}
.media-card.media-lrow:last-child{border-bottom:none}
.media-lrow .ml-thumb{width:64px;height:44px;border-radius:6px;background:var(--surface-3);flex:none;aspect-ratio:auto}
.media-lrow .ml-thumb img,.media-lrow .ml-thumb video{height:100%;aspect-ratio:auto}
.media-card.media-lrow:hover{box-shadow:none;background:var(--surface-2)}
.media-lrow .ml-cap{flex:1;font-size:12.5px;font-weight:500;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:700px){.media-lrow .ml-cap{white-space:normal}}

/* ── Dashboard: welcome hero ── */
/* Dashboard header: quiet light greeting on the canvas (was a navy band).
   Brand lives in the topbar wordmark; the header is just type + search. */
.hero{background:transparent;border-radius:0;padding:14px 0 6px;box-shadow:none;margin-bottom:4px}
.hero .eyebrow{font-size:10px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--muted-2)}
.hero h1{font-family:var(--font-display);font-size:27px;font-weight:600;letter-spacing:-.02em;color:var(--fg);margin-top:8px}
.hero .addr{color:var(--muted);font-size:13px;margin-top:4px}
.hero .gsearch{margin-top:18px;max-width:520px}
.hero .gsearch input{border:1px solid var(--border-strong);box-shadow:var(--shadow-sm)}
@media(max-width:700px){.hero{padding:6px 0 2px}.hero h1{font-size:21px}}

/* ── Mobile: stacked tables below 700px ── */
@media(max-width:700px){
  .proj-btn{max-width:120px}

  .room-toolbar{overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
  .room-toolbar::-webkit-scrollbar{display:none}
  .cat-jump{white-space:nowrap;flex-shrink:0}
  /* In-room search keeps working on phones: it drops to its own
     full-width row under the tabs instead of disappearing. */
  .tabs{flex-wrap:wrap}
  .room-search,.tabs .room-search{margin:2px 0 10px;order:9;flex-basis:100%;padding:0}
  .room-search input{width:100%}

  .cat table,.card table,.cat thead,.card thead,.cat tbody,.card tbody,.cat tr,.card tr,.cat td,.card td{display:block;width:auto!important}
  .cat thead,.card thead{display:none}
  .cat tr,.card tr{padding:10px 16px;border-bottom:1px solid var(--border)}
  .cat tr:last-child,.card tr:last-child{border-bottom:none}
  .cat td,.card td{padding:2px 0;border-bottom:none}
  .cat td:empty,.card td:empty{display:none}
  td.item{font-weight:600}
  td.supplier .chip{margin-top:4px}
  td.copy{display:none}
}

/* ── Dashboard: emergency rows ── */
.em-row{display:flex;align-items:center;gap:14px;padding:11px 16px;border-bottom:1px solid var(--border)}
.em-row:last-child{border-bottom:none}
.em-what{width:150px;flex-shrink:0;font-weight:600;font-size:12.5px;display:flex;align-items:center;gap:8px}
.em-what svg{color:var(--muted);flex-shrink:0}
.em-do{flex:1;font-size:12.5px;color:var(--fg-2)}
.em-do b{font-weight:600;color:var(--fg)}
.em-photo{flex-shrink:0;width:46px;height:36px;border:1px solid var(--border);border-radius:6px;overflow:hidden;background:var(--surface-3);padding:0;cursor:zoom-in}
.em-photo img{width:100%;height:100%;object-fit:cover;display:block}
.em-doc{flex-shrink:0;display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;color:var(--fg-2);background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);padding:4px 10px;cursor:pointer}
.em-doc:hover{border-color:var(--border-strong)}
.em-doc svg{color:var(--muted)}
.em-callbtn{flex-shrink:0;display:inline-flex;align-items:center;font-size:12px;font-weight:600;color:var(--info-fg);background:var(--info-bg);border:1px solid rgba(61,98,160,.28);border-radius:var(--radius);padding:4px 12px;text-decoration:none;white-space:nowrap}
.em-callbtn:hover{border-color:var(--info)}
.em-callbtn.zero{background:var(--danger);border-color:var(--danger);color:#fff}
@media(max-width:700px){
  .em-row{flex-direction:column;align-items:flex-start;gap:5px}
  .em-what{width:auto}
  .em-photo{margin-top:3px}
  .em-doc{margin-top:3px}
  .em-callbtn{margin-top:3px}
}

/* ── Dashboard: day-one rules ── */
.rule{border-bottom:1px solid var(--border)}
.rule:last-child{border-bottom:none}
.rule summary{display:flex;align-items:baseline;gap:10px;padding:10px 16px;cursor:pointer;list-style:none}
.rule summary::-webkit-details-marker{display:none}
.rule summary:hover{background:var(--surface-2)}
.rule .r-what{font-weight:600;font-size:12.5px;width:160px;flex-shrink:0}
.rule .r-line{color:var(--fg-2);font-size:12.5px}
.rule .r-body{padding:0 16px 12px 186px;font-size:12.5px;color:var(--fg-2)}
.rule .r-body .warn{color:var(--warning-fg);font-weight:600;margin-bottom:4px}
.rule .r-body ul{margin-left:16px}
.rule .r-body li{margin:2px 0}
@media(max-width:700px){.rule summary{flex-wrap:wrap}.rule .r-body{padding-left:16px}}

/* ── Dashboard: contacts table ── */
td.mono{font-size:12px;white-space:nowrap;font-variant-numeric:tabular-nums}
td a.tel{color:var(--fg);font-weight:500;text-decoration:none}
td a.tel:hover{text-decoration:underline;text-underline-offset:2px}

/* ── Login ── */
.login{max-width:360px;margin:12vh auto 0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:26px;box-shadow:var(--shadow)}
.login h1{font-size:18px;margin-bottom:16px}
.login label{display:block;font-size:12px;font-weight:500;color:var(--fg-2);margin:12px 0 4px}
.login input{width:100%;padding:9px 12px;border:1px solid var(--border);border-radius:var(--radius);font:inherit}
.login input:focus{outline:2px solid var(--fg);outline-offset:-1px}
.login .btn{width:100%;justify-content:center;margin-top:16px}
.login .alt{width:100%;justify-content:center;margin-top:8px}
.msg{margin-top:12px;font-size:12.5px;border-radius:var(--radius);padding:8px 12px;display:none}
.msg.err{display:block;background:var(--danger-bg);color:var(--danger-fg)}
.msg.ok{display:block;background:var(--success-bg);color:var(--success-fg)}

/* ── Print: content only, no chrome ── */
@media print{
  .shell-topbar,.shell-side,.hamburger,.btn,.file-btn,.gsearch,.back-chip{display:none!important}
  .shell-body{display:block;min-height:0}
  .shell-main{padding:0;background:#fff}
  body{background:#fff}
  .cat,.card,.prose-card{box-shadow:none;break-inside:avoid}
}

/* ── Toast / loading ── */
.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:var(--fg);color:#fff;font-size:12.5px;padding:8px 16px;border-radius:999px;box-shadow:var(--shadow-lg);opacity:0;transition:opacity .2s;pointer-events:none;z-index:60}
.toast.show{opacity:1}
.loading{padding:60px 20px;text-align:center;color:var(--muted)}
.spinner{display:inline-block;width:18px;height:18px;border:2px solid var(--surface-3);border-top-color:var(--fg);border-radius:50%;animation:spin .7s linear infinite;vertical-align:middle;margin-right:8px}
@keyframes spin{to{transform:rotate(360deg)}}

/* ── Shared small text bits ── */
.td-sub{display:block;font-weight:400;color:var(--muted);font-size:11.5px;margin-top:1px}
.none-dash{color:var(--muted-2)}
.login-logo{height:28px;margin-bottom:14px}
.report-link{display:inline-block;margin-top:14px;font-size:12.5px;font-weight:500;color:var(--fg);text-decoration:none}
.report-link:hover{text-decoration:underline;text-underline-offset:2px}
.view-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:12px 0 2px}

/* ── My Home: progressive disclosure - first rows visible, detail layer behind "Full specification" ── */
tr.spec-extra{display:none}
.cat.show-all tr.spec-extra{display:table-row}
.show-more{display:block;width:100%;border:none;border-top:1px solid var(--border);background:var(--surface-2);color:var(--fg-2);font:inherit;font-size:12px;font-weight:500;padding:8px;cursor:pointer}
.show-more:hover{background:var(--surface-3)}
.cat.show-all .show-more .when-closed{display:none}
.cat:not(.show-all) .show-more .when-open{display:none}
@media(max-width:700px){.cat.show-all tr.spec-extra{display:block}}
@media print{tr.spec-extra{display:table-row}.show-more{display:none!important}}

/* ── Requests: wizard ── */
.wiz-body{padding:18px 16px}
.wiz-progress{display:flex;gap:6px;margin-bottom:14px}
.wiz-progress span{height:3px;flex:1;border-radius:999px;background:var(--surface-3)}
.wiz-progress span.on{background:var(--fg)}
.wiz-q{font-size:15px;font-weight:600;margin-bottom:12px}
.wiz-back{display:inline-flex;align-items:center;gap:5px;border:none;background:none;font-size:12px;font-weight:500;color:var(--muted);cursor:pointer;padding:0;margin-bottom:10px}
.wiz-back:hover{color:var(--fg-2)}
.opt-list{display:flex;flex-direction:column;gap:8px}
.opt-btn{width:100%;text-align:left;padding:12px 14px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);cursor:pointer;font-size:13px;font-weight:500;color:var(--fg)}
.opt-btn:hover{border-color:var(--border-strong);background:var(--surface-2)}
.opt-btn.sel{border-color:var(--fg);box-shadow:inset 0 0 0 1px var(--fg)}
.opt-btn .od{display:block;font-weight:400;color:var(--muted);font-size:12px;margin-top:2px}
.wiz-field{margin-bottom:12px}
.wiz-gap{margin-top:12px}
.wiz-field label{display:block;font-size:12px;font-weight:500;color:var(--fg-2);margin-bottom:4px}
.wiz-field input,.wiz-field textarea,.wiz-field select{width:100%;padding:9px 12px;border:1px solid var(--border);border-radius:var(--radius);font:inherit;background:var(--surface)}
.wiz-field textarea{min-height:90px;resize:vertical}
.wiz-field input:focus,.wiz-field textarea:focus,.wiz-field select:focus{outline:2px solid var(--fg);outline-offset:-1px}
.upl-list{display:flex;flex-direction:column;gap:4px;margin-top:8px}
.upl-item{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--fg-2);background:var(--surface-2);border-radius:var(--radius);padding:5px 10px}
.upl-item button{margin-left:auto;border:none;background:none;color:var(--muted);cursor:pointer;font-size:14px;line-height:1;padding:0 2px}
.upl-item button:hover{color:var(--fg)}
.wiz-actions{margin-top:14px}
.em-notice{background:var(--danger-bg);border:1px solid var(--danger);border-radius:var(--radius-lg);padding:12px 14px;margin-top:12px}
.em-notice .t{font-weight:600;color:var(--danger-fg);font-size:12.5px}
.em-notice .em-calls{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.warranty-note{margin-top:18px;padding-top:12px;border-top:1px solid var(--border);font-size:12px;color:var(--muted);line-height:1.6}
.warranty-note b{color:var(--fg-2);font-weight:600}
.w-state{font-size:10px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--muted-2);margin-left:4px}
.wiz-done h3{font-size:15px;font-weight:600}
.wiz-done .wiz-ref{font-family:var(--font-display);font-size:16px;font-weight:600;letter-spacing:.02em;margin-top:4px;font-variant-numeric:tabular-nums}
.wiz-done p{margin-top:10px;font-size:12.5px;color:var(--fg-2)}
.wiz-done .btn{margin-top:14px}

/* ── Requests: list + thread ── */
.cat table.cols-req th:nth-child(1){width:150px}
.cat table.cols-req th:nth-child(3){width:130px}
.cat table.cols-req th:nth-child(4){width:120px}
.cat table.cols-req th:nth-child(5){width:130px}
/* Dates never wrap mid-cell */
td.td-date{white-space:nowrap}
tr.req-detail td{background:var(--surface-2);padding:14px 16px;cursor:default}
.req-desc{font-size:12.5px;color:var(--fg-2);white-space:pre-line}
.req-photos{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.req-photos img{width:76px;height:76px;object-fit:cover;border-radius:var(--radius);border:1px solid var(--border);cursor:pointer;background:#000}
.req-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px;font-size:12px;color:var(--muted)}
.req-note{font-size:12px;color:var(--muted);margin-top:12px}
.tl{margin-top:14px}
.tl-item{position:relative;padding:0 0 14px 22px}
.tl-item::before{content:'';position:absolute;left:5px;top:14px;bottom:-2px;width:2px;background:var(--border)}
.tl-item:last-child::before{display:none}
.tl-dot{position:absolute;left:0;top:3px;width:12px;height:12px;border-radius:50%;background:var(--surface);border:2px solid var(--muted-2)}
.tl-item.milestone .tl-dot{border-color:var(--fg);background:var(--fg)}
.tl-title{font-weight:600;font-size:12.5px}
.tl-when{font-size:10.5px;color:var(--muted-2);margin-top:1px;font-variant-numeric:tabular-nums}
.tl-msg{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:8px 12px;margin-top:5px;font-size:12.5px;color:var(--fg-2);white-space:pre-line;max-width:520px}
.req-comment{display:flex;gap:8px;margin-top:4px}
.req-comment textarea{flex:1;padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius);font:inherit;font-size:12.5px;background:var(--surface);min-height:38px;resize:vertical}
.req-comment textarea:focus{outline:2px solid var(--fg);outline-offset:-1px}
@media(max-width:700px){
  tr.req-detail{padding:0}
  tr.req-detail td{padding:14px 16px;display:block}
  .req-comment{flex-direction:column}
}

/* ── Maintenance: sub-view tabs (mobile) + attention dot ──
   Desktop switches views in the secondary subnav; below 860px the
   subnav hides, so the same views render as underline tabs. */
.view-tabs{display:none}
@media(max-width:860px){
  .view-tabs{display:flex;gap:18px;align-items:center;margin:12px 0 0;border-bottom:1px solid var(--border);overflow-x:auto;scrollbar-width:none}
  .view-tabs::-webkit-scrollbar{display:none}
  .view-tabs .tab{white-space:nowrap;flex:none;text-decoration:none;display:inline-flex;align-items:center;gap:6px}
}
.att-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--warning);flex:none}

/* ── Maintenance: upcoming visit scoping card ──
   The date is the hero: a calendar tile that carries the status colour
   (blue in flight, green once confirmed, grey while there's no date). */
.visit-hero{display:flex;align-items:center;gap:14px;padding:14px 16px;border-bottom:1px solid var(--border)}
.vh-tile{width:64px;flex:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;background:var(--info-bg);color:var(--info-fg);border-radius:var(--radius-lg);padding:9px 4px 10px;line-height:1.1;text-align:center}
.vh-tile .vt-mon{font-size:10px;font-weight:600;letter-spacing:.09em;text-transform:uppercase}
.vh-tile .vt-day{font-family:var(--font-display);font-size:24px;font-weight:600;font-variant-numeric:tabular-nums}
.vh-tile .vt-dow{font-size:10px;font-weight:500;opacity:.8}
.vh-tile.ok{background:var(--success-bg);color:var(--success-fg)}
.vh-tile.tbc{background:var(--surface-3);color:var(--muted)}
.vh-info{flex:1;min-width:0}
.vh-info .vh-title{font-weight:600;font-size:14px}
.vh-info .vh-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:5px}
.vh-info .vh-count{font-size:12px;color:var(--muted)}
.visit-item{display:flex;align-items:center;gap:14px;padding:9px 16px;border-bottom:1px solid var(--border)}
.visit-item .vi-text{flex:1;min-width:0}
.visit-item .vi-label{font-weight:600;font-size:12.5px}
.visit-item .vi-trade{color:var(--muted);font-size:11.5px;margin-top:1px}
.visit-item.skipped .vi-label{color:var(--muted);text-decoration:line-through;text-decoration-thickness:1px}
.scope-toggle{display:inline-flex;flex-shrink:0;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}
.scope-toggle button{border:none;background:var(--surface);color:var(--fg-2);font:inherit;font-size:12px;font-weight:500;padding:7px 14px;min-width:58px;cursor:pointer}
.scope-toggle button+button{border-left:1px solid var(--border)}
.scope-toggle button:not(.on):hover{background:var(--surface-2)}
.scope-toggle button.on{background:var(--fg);color:#fff}
.scope-toggle button.on.skip{background:var(--surface-3);color:var(--fg)}
.scope-state{flex-shrink:0;display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:500;color:var(--muted)}
.visit-ask{padding:10px 16px;border-bottom:1px solid var(--border);font-size:12.5px;color:var(--fg-2)}
.visit-ask:last-child{border-bottom:none}
.visit-ask a{color:var(--fg);font-weight:500;text-decoration:none}
.visit-ask a:hover{text-decoration:underline;text-underline-offset:2px}
.visit-confirm{display:flex;align-items:center;gap:14px;padding:12px 16px;background:var(--surface-2)}
.visit-confirm span{font-weight:600;font-size:12.5px}
.visit-confirm .btn{margin-left:auto}
.visit-confirmed{display:flex;align-items:center;gap:7px;padding:12px 16px;background:var(--surface-2);font-size:12.5px;color:var(--fg-2)}
.visit-confirmed svg,.scope-state svg{color:var(--muted);flex-shrink:0}

/* Past visits: read-only rows */
.past-row{display:flex;gap:14px;padding:10px 16px;border-bottom:1px solid var(--border)}
.past-row:last-child{border-bottom:none}
.past-row .pv-date{font-size:11px;font-variant-numeric:tabular-nums;color:var(--muted);flex-shrink:0;width:90px;padding-top:2px}
.past-row .pv-title{font-weight:600;font-size:12.5px}
.past-row .pv-sum{color:var(--fg-2);font-size:12.5px;margin-top:2px;white-space:pre-line}

/* Maintenance schedule: frequency group bands inside a table */
tr.fg-head td{padding:6px 16px;font-size:10.5px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);background:var(--surface-2);border-bottom:1px solid var(--border)}
/* Task notes: one clipped line, tap to expand */
.td-notes{cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.td-notes.open{white-space:normal}
/* Folded card: a .cat that opens on demand (service rates) */
details.cat>summary{list-style:none;cursor:pointer}
details.cat>summary::-webkit-details-marker{display:none}
details.cat>summary:hover{background:var(--surface-2)}
details.cat:not([open])>summary{border-bottom:none}
details.cat>summary .fold-caret{margin-left:auto;color:var(--muted);display:inline-flex;transition:transform .15s}
details.cat[open]>summary .fold-caret{transform:rotate(180deg)}

/* Dashboard reuses .visit-hero with a one-line ask + action button */
.vh-info .vh-ask{color:var(--fg-2);font-size:12.5px;margin-top:5px}
.visit-hero>.btn{flex-shrink:0;align-self:center}

@media(max-width:700px){
  .scope-toggle button{padding:9px 15px}
  .visit-confirm{flex-direction:column;align-items:flex-start;gap:8px}
  .visit-confirm .btn{margin-left:0}
  .visit-hero{flex-wrap:wrap}
  .visit-hero>.btn{flex-basis:100%;justify-content:center;margin-top:4px}
  .past-row{flex-direction:column;gap:2px}
  .past-row .pv-date{width:auto;padding-top:0}
  tr.fg-head{padding:0}
  tr.fg-head td{padding:7px 16px}
}

/* ── Segmented control: recessed track, raised white active segment ── */
.seg{display:inline-flex;flex:none;padding:3px;gap:2px;background:var(--surface-3);border-radius:var(--radius)}
.seg button{border:0;background:transparent;padding:3px 11px;border-radius:4px;font:inherit;font-size:11.5px;font-weight:500;color:var(--muted);cursor:pointer;white-space:nowrap;transition:background var(--dur-fast) var(--ease),color var(--dur-fast) var(--ease)}
.seg button:hover{color:var(--fg)}
.seg button.on{background:var(--surface);color:var(--fg);box-shadow:var(--shadow-sm)}

/* ============================================================
   Request composer + maintenance cart (16 Jul 2026)
   ============================================================ */

/* Per-row add button on the maintenance schedule */
.addtask-btn{border:1px solid var(--border-strong);background:var(--surface);color:var(--fg-2);border-radius:6px;font:inherit;font-size:11px;font-weight:500;padding:3px 9px;cursor:pointer;white-space:nowrap;transition:background var(--dur-fast) var(--ease),color var(--dur-fast) var(--ease)}
.addtask-btn:hover{background:var(--surface-2);color:var(--fg)}
.addtask-btn.on{background:var(--fg);border-color:var(--fg);color:var(--surface)}

/* Cart bar: docked to the bottom while services are selected */
.cartbar{position:fixed;left:50%;transform:translateX(-50%);bottom:18px;z-index:60;display:flex;align-items:center;gap:12px;background:var(--fg);color:var(--surface);border-radius:999px;padding:8px 10px 8px 18px;box-shadow:var(--shadow-lg, 0 10px 30px rgba(20,20,20,.25));font-size:12.5px}
.cartbar .cb-count{font-weight:600;white-space:nowrap}
.cartbar .cb-clear{border:0;background:transparent;color:var(--surface);opacity:.65;font:inherit;font-size:12px;cursor:pointer;padding:4px 2px}
.cartbar .cb-clear:hover{opacity:1}
.cartbar .cb-go{border:0;background:var(--surface);color:var(--fg);border-radius:999px;font:inherit;font-size:12px;font-weight:600;padding:7px 14px;cursor:pointer}
@media(max-width:700px){.cartbar{bottom:12px;width:calc(100% - 24px);justify-content:space-between}}

/* Composer sheet */
body.rc-open{overflow:hidden}
.rc-overlay{position:fixed;inset:0;background:var(--scrim, rgba(20,20,20,.44));z-index:80}
.rc-sheet{position:fixed;z-index:81;left:50%;top:50%;transform:translate(-50%,-50%);width:min(560px,calc(100% - 32px));max-height:min(86vh,760px);display:flex;flex-direction:column;background:var(--surface);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg, 0 18px 50px rgba(20,20,20,.3));overflow:hidden}
@media(max-width:700px){.rc-sheet{left:0;top:auto;bottom:0;transform:none;width:100%;max-height:92dvh;border-radius:14px 14px 0 0}}
.rc-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:14px 18px;border-bottom:1px solid var(--border)}
.rc-eyebrow{font-size:10px;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.rc-head h3{font-family:var(--font-display);font-size:16px;margin:2px 0 0}
.rc-close{border:0;background:transparent;color:var(--muted);font-size:20px;line-height:1;cursor:pointer;padding:2px 6px;border-radius:6px}
.rc-close:hover{background:var(--surface-2);color:var(--fg)}
.rc-body{flex:1;overflow-y:auto;padding:14px 18px}
.rc-foot{display:flex;justify-content:flex-end;gap:8px;padding:12px 18px;border-top:1px solid var(--border);background:var(--surface-2)}

.rc-items{display:flex;flex-direction:column;gap:10px}
.rc-item{border:1px solid var(--border);border-radius:var(--radius-lg);padding:10px 12px;background:var(--surface)}
.rc-item-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.rc-item-title{font-size:12.5px;font-weight:600;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.rc-rm{border:0;background:transparent;color:var(--muted);font-size:16px;line-height:1;cursor:pointer;padding:2px 6px;border-radius:6px}
.rc-rm:hover{background:var(--surface-2);color:var(--fg)}
.rc-comment{width:100%;margin-top:8px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);font:inherit;font-size:12px;padding:7px 10px;resize:none;overflow:hidden}
.rc-comment:focus{outline:2px solid var(--fg);outline-offset:-1px}
.rc-photorow{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}
.rc-thumb{position:relative;display:inline-flex}
.rc-thumb img{width:44px;height:44px;object-fit:cover;border-radius:6px;border:1px solid var(--border)}
.rc-thumb button{position:absolute;top:-6px;right:-6px;width:17px;height:17px;border-radius:50%;border:0;background:var(--fg);color:var(--surface);font-size:11px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}

.rc-addrow{margin-top:12px}
.rc-addbtn{border:1px dashed var(--border-strong);background:transparent;color:var(--fg-2);border-radius:var(--radius);font:inherit;font-size:12px;font-weight:500;padding:8px 12px;width:100%;cursor:pointer;text-align:left}
.rc-addbtn:hover,.rc-addbtn.on{background:var(--surface-2);color:var(--fg)}
.rc-picker{border:1px solid var(--border);border-radius:var(--radius-lg);margin-top:8px;overflow:hidden}
.rc-picker>input{width:100%;border:0;border-bottom:1px solid var(--border);padding:9px 12px;font:inherit;font-size:12px;background:var(--surface)}
.rc-picker>input:focus{outline:none;background:var(--surface-2)}
.rc-pick-list{max-height:220px;overflow-y:auto}
.rc-pick{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;border:0;border-bottom:1px solid var(--border);background:transparent;font:inherit;font-size:12px;padding:8px 12px;cursor:pointer;text-align:left}
.rc-pick:last-child{border-bottom:0}
.rc-pick:hover{background:var(--surface-2)}
.rc-pick-t{flex:1;min-width:0}
.rc-adhoc{display:flex;gap:8px;padding:10px 12px;border-top:1px solid var(--border);background:var(--surface-2)}
.rc-adhoc input{flex:1;border:1px solid var(--border);border-radius:var(--radius);font:inherit;font-size:12px;padding:7px 10px;background:var(--surface)}
.rc-none{padding:14px 12px;color:var(--muted);font-size:12px}
.rc-none-lead{padding:4px 0 2px}

.rc-block{margin-top:14px}
.rc-label{font-size:12px;font-weight:600;margin-bottom:6px}
.rc-opt{font-weight:400;color:var(--muted)}
.rc-note{width:100%;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);font:inherit;font-size:12px;padding:7px 10px;resize:none;overflow:hidden}
.rc-note:focus{outline:2px solid var(--fg);outline-offset:-1px}

/* Visit card: propose-a-date */
.visit-propose{padding:12px 16px;background:var(--surface-2);border-top:1px solid var(--border)}
.visit-propose .vpr-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.visit-propose input[type=date]{border:1px solid var(--border);border-radius:var(--radius);font:inherit;font-size:12px;padding:6px 9px;background:var(--surface)}
.visit-propose textarea{width:100%;margin-top:8px;border:1px solid var(--border);border-radius:var(--radius);font:inherit;font-size:12px;padding:7px 10px;background:var(--surface);resize:none}
.visit-proposed-note{display:flex;align-items:center;gap:8px;padding:12px 16px;background:var(--surface-2);font-size:12.5px;font-weight:500}
.visit-confirm .btn-ghostlink{border:0;background:transparent;color:var(--fg-2);font:inherit;font-size:12px;font-weight:500;cursor:pointer;text-decoration:underline;text-underline-offset:2px;padding:4px 2px}
.visit-confirm .btn-ghostlink:hover{color:var(--fg)}

/* Also coming up: later scheduled visits */
.upcoming-row{display:flex;align-items:center;gap:12px;padding:10px 16px;border-bottom:1px solid var(--border);font-size:12.5px}
.upcoming-row:last-child{border-bottom:0}
.upcoming-row .up-date{width:110px;flex-shrink:0;font-weight:600;font-variant-numeric:tabular-nums}
.upcoming-row .up-title{flex:1;min-width:0}
.upcoming-row .pill{flex-shrink:0}

/* Requests list: search + pill-dropdown filters on one quiet row */
.req-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 16px;border-bottom:1px solid var(--border)}
.req-tools .gsearch{margin:0;flex:1;min-width:170px;max-width:340px}
.req-tools .gsearch input{padding:7px 12px 7px 34px;border-radius:999px;font-size:12.5px;box-shadow:none}
.req-tools .gsearch>svg{top:50%;transform:translateY(-50%);left:12px;width:14px;height:14px}
.req-tools .spacer{flex:1}
#reqFilterSlot{display:inline-flex;align-items:center;gap:8px}

/* Request detail: resolved strip - confirm the fix or reopen */
.resolve-strip{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:12px 16px;margin-bottom:14px;font-size:12.5px;color:var(--fg-2)}
.resolve-strip b{color:var(--fg);font-weight:600}
.resolve-strip .sp{flex:1}
@media(max-width:700px){.resolve-strip .sp{display:none}.resolve-strip .btn{flex:1;justify-content:center}}

/* Request detail: reply composer photos + photos on timeline entries */
.reply-photos{margin-top:8px}
.tl-photos{margin-top:6px}
.tl-photos img{width:64px;height:64px}

/* Request detail: in-place edits + quiet danger action (armed on first tap) */
.req-meta .sp{flex:1}
.fb-danger{color:var(--danger-fg)}
.fb-danger:hover{background:var(--danger-bg);border-color:var(--danger-bg)}
.fb-danger.armed{background:var(--danger);border-color:var(--danger);color:#fff}
.desc-edit{margin-top:10px}

/* Request detail: services on the request */
.req-items{padding:0}
.req-item{padding:11px 16px;border-bottom:1px solid var(--border)}
.req-item:last-child{border-bottom:0}
.req-item-head{font-size:12.5px;font-weight:600;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.req-item-comment{font-size:12.5px;color:var(--fg-2);margin-top:3px;white-space:pre-wrap}
.req-item-photos{margin-top:8px}
.req-item-photos img{width:64px;height:64px}

/* Maintenance schedule: keep the Add column tight */
td.addcell{width:1%;white-space:nowrap;text-align:right}

/* Maintenance schedule now carries an Add column (5 cols) */
.cat table.cols-mj th:nth-child(1){width:38%}
.cat table.cols-mj th:nth-child(2){width:18%}
.cat table.cols-mj th:nth-child(3){width:15%}
.cat table.cols-mj th:nth-child(4){width:19%}
.cat table.cols-mj th:nth-child(5){width:10%}

/* Frequency bucket bands: pastel dot + count so the schedule scans fast */
tr.fg-head .fg-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:7px;vertical-align:-1px;background:currentColor}
tr.fg-head .fg-dot.pill-sky{background:#2A66A8}
tr.fg-head .fg-dot.pill-mint{background:#1F7A4D}
tr.fg-head .fg-dot.pill-lilac{background:#5E3DBE}
tr.fg-head .fg-dot.pill-peach{background:#A85B1D}
tr.fg-head .fg-dot.pill-slate{background:#47536C}
tr.fg-head .fg-dot.pill-grey{background:var(--muted)}
tr.fg-head .fg-count{color:var(--muted-2);font-weight:400;margin-left:7px}

/* ============================================================
   Mobile pass (17 Jul 2026) - the portal is phone-first for owners
   ============================================================ */

/* Keyboard access: every clickable row/card is focusable (tabindex in
   markup) and Enter/Space activates it (delegated handler in app.js). */
tr.row-link:focus-visible td{background:var(--surface-2)}
tr.row-link:focus-visible td:first-child{box-shadow:inset 2px 0 0 var(--fg)}
.gresult:focus-visible,.media-card:focus-visible,.rule summary:focus-visible{outline:2px solid var(--fg);outline-offset:-2px}

@media(max-width:700px){
  /* Text controls hold 15px on phones. iOS would zoom a focused control
     under 16px, so config.js caps the focus zoom on iOS (pinch zoom is
     unaffected there). !important is deliberate: this is a platform
     invariant that must beat every component font size. */
  input[type=search],input[type=text],input[type=email],input[type=password],
  input[type=date],textarea,select{font-size:15px!important}

  /* Finger-sized controls */
  .seg button{padding:7px 13px}
  .addtask-btn{padding:7px 12px}
  .btn{padding:9px 15px}
  .file-btn{padding:8px 12px}

  /* Maintenance schedule rows stack: task first, then the meta bits
     (frequency, who, contact) flow on one line instead of a tall pile. */
  .cat table.cols-mj tr:not(.fg-head)>td:not(.item):not(.addcell),
  .cat table.cols-m tr>td:not(.item){display:inline-block;margin:4px 8px 0 0}
  .cat table.cols-mj td.addcell{display:block;text-align:left;margin-top:6px}

  /* Login card breathes on small screens */
  .login{margin:8vh 16px 0;max-width:none}
}

/* Topbar breadcrumb: the page name wins on narrow phones */
@media(max-width:560px){
  .crumbbar .crumb-root,.crumbbar>svg:first-of-type{display:none}
}
