/* Admin layout. Colors and fonts come from ../styles.css */
.adm { background: var(--stone); }
.adm-top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 16px; padding: 8px 20px; background: #000; color: #fff;
}
.adm-logo img { height: 46px; width: auto; display: block; }
.adm-top a.adm-home {
  display: inline-flex; align-items: center; gap: 7px; margin-left: 10px; padding: 7px 13px;
  color: #fff; text-decoration: none; font: 600 14px var(--body); white-space: nowrap;
  border: 2px solid #fff; border-radius: 4px; background: transparent;
}
.adm-top a.adm-home svg { color: var(--green); }
.adm-top a.adm-home:hover { background: #fff; color: #000; }
.adm-top a.adm-home:hover svg { color: #000; }
.adm-who { margin-left: auto; text-align: right; font-size: 13px; line-height: 1.3; color: #cfd2cb; }
.adm-who b { color: #fff; font-weight: 600; }
.btn.light { color: #fff; border-color: #fff; padding: 7px 14px; font-size: 14px; white-space: nowrap; }
.adm-shell { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 62px); }
.adm-nav {
  background: #fff; border-right: 1px solid var(--rule); padding: 14px 0;
  /* Stays in view while the page scrolls, just below the black header */
  position: sticky; top: var(--adm-top-h, 62px); align-self: start;
  height: calc(100vh - var(--adm-top-h, 62px)); overflow-y: auto;
}
.adm-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px;
  color: var(--ink); text-decoration: none; font: 600 15px var(--body); border-left: 4px solid transparent;
}
.adm-nav a:hover { background: var(--stone); }
.adm-nav a[aria-current="page"] { border-left-color: var(--green); background: #effde9; }
.adm-nav .nav-i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; color: #5c6157; }
.adm-nav a:hover .nav-i, .adm-nav a[aria-current="page"] .nav-i { color: var(--ink); }
.adm-nav .nav-l { flex: 1; min-width: 0; }
.adm-nav .count { font: 700 12px var(--body); background: var(--green); color: #000; border-radius: 10px; padding: 1px 8px; }
.adm-main { padding: 24px 28px 60px; max-width: 1240px; width: 100%; min-width: 0; outline: none; }
.adm-main h1 { font: 700 34px/1 var(--display); margin: 0 0 18px; }
.adm-main h2 { font: 700 22px/1.1 var(--display); margin: 26px 0 10px; }
.signin { max-width: 440px; margin: 60px auto; background: #fff; padding: 30px; border: 1px solid var(--rule); }
.bar-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.bar-row .grow { flex: 1; min-width: 200px; }
.inp, .adm select, .adm textarea {
  padding: 9px 11px; border: 1px solid #b9bdb3; border-radius: 4px; font: 400 15px var(--body); background: #fff; color: var(--ink);
}
.inp:focus, .adm select:focus, .adm textarea:focus { outline: 3px solid var(--green); outline-offset: 0; border-color: #000; }
.btn.sm { padding: 7px 12px; font-size: 14px; }
.btn.danger { background: var(--alert); }
.btn.ghost.cdel { color: var(--alert); border-color: var(--alert); margin-left: auto; }
.pill { display: inline-block; font: 600 12px var(--body); padding: 2px 9px; border-radius: 10px; background: #e3e5df; white-space: nowrap; }
.pill.new { background: #ffe9a8; } .pill.needs_manual, .pill.error { background: #ffd3cc; }
.pill.ordered, .pill.approved, .pill.placing, .pill.shipped { background: #d9ecff; } .pill.arrived { background: var(--green); }
.pill.completed { background: #e3e5df; } .pill.cancelled { background: #eee; color: #777; text-decoration: line-through; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-bottom: 20px; }
.kpi { background: #fff; padding: 14px 16px; }
.kpi .v { font: 700 30px/1.1 var(--display); }
.kpi .l { font-size: 13px; color: var(--ink-2); }
.kpi.alert .v { color: var(--alert); }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.panel { background: #fff; border: 1px solid var(--rule); padding: 16px 18px; }
.panel h2 { margin-top: 0; }
.chart-box { position: relative; height: 260px; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid #000; padding: 8px 10px; white-space: nowrap; }
.tbl td { border-bottom: 1px solid var(--rule); padding: 8px 10px; vertical-align: top; }
.tbl td.n, .tbl th.n { text-align: right; white-space: nowrap; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #f6fbef; }
.scroll-x { overflow-x: auto; }

/* Orders */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.tabs button { padding: 8px 12px; border: 1px solid var(--rule); background: #fff; color: var(--ink, #111); border-radius: 4px; font: 600 14px var(--body); -webkit-appearance: none; appearance: none; cursor: pointer; }   /* color set: phones (iPhone) otherwise draw button text blue */
.tabs button[aria-pressed="true"] { background: #000; color: #fff; border-color: #000; }
.ord { background: #fff; border: 1px solid var(--rule); padding: 16px 18px; margin-bottom: 14px; }
.ord-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.ord-h h3 { font: 700 22px var(--display); margin: 0; }
.ord-tot { display: inline-flex; align-items: center; gap: 10px; }
.ord-fold { width: 34px; height: 34px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ord-fold::before { content: ''; width: 9px; height: 9px; border: solid #111; border-width: 0 2px 2px 0; transform: translateY(2px) rotate(-135deg); }
.ord.folded .ord-fold::before { transform: translateY(-2px) rotate(45deg); }
.ord-fold:hover { background: #f1f3ee; }
.ord-sum { display: none; color: var(--ink-2); font-size: 14px; }
.ord.folded .ord-sum { display: block; }
.ord.folded .ord-body { display: none; }
.ord.folded .who { margin-bottom: 2px; }
.ord .who { color: var(--ink-2); font-size: 14px; margin: 4px 0 10px; }
.ful { margin-top: 10px; padding: 10px 12px; border-left: 4px solid #c9a227; background: #f8f1dc; font-size: 14px; }
.ful.submitted { border-color: var(--green); background: #effde9; }
.ful.error { border-color: var(--alert); background: #f6e4e0; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
details.more { margin-top: 12px; font-size: 14px; }
details.more summary { cursor: pointer; font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 8px 0 0; }
.timeline li { padding: 6px 0 6px 14px; border-left: 2px solid var(--rule); }
.timeline time { color: var(--ink-2); font-size: 12px; display: block; }

/* Item lookup */
.lk { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; }
.lk:not(:has(.lk-img)) { grid-template-columns: minmax(0, 1fr); }
.lk-img { width: 96px; height: 96px; object-fit: contain; background: #fff; border: 1px solid var(--rule); }
.lk .tbl { margin-top: 4px; }
.lk .tbl tr.lk-best td { background: #effde9; }
/* Business card */
.bc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.bc-send .tabs { margin-bottom: 12px; }
.bc-h { font: 700 15px var(--body); margin: 18px 0 8px; }
.bc-send .fld { margin-bottom: 10px; }
.bc-send textarea { width: 100%; box-sizing: border-box; resize: vertical; font: 400 15px/1.45 var(--body); }
.bc-send #bcsubj { width: 100%; box-sizing: border-box; }
.bc-new { margin-bottom: 4px; }
.bc-save { margin-top: 2px; }
.bc-results { display: grid; gap: 6px; margin-top: 8px; }
.bc-hit { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--rule); background: #fff; border-radius: 4px; font: inherit; }
.bc-hit:hover, .bc-hit:focus-visible { border-color: #000; background: #f7fdf4; }
.bc-hit small { display: block; color: var(--ink-2); }
.bc-picked { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--rule); border-left: 4px solid var(--green); background: #fff; }
.bc-send .acts .btn.disabled { opacity: .45; pointer-events: none; }
.bc-side { display: grid; gap: 16px; }
.bc-phone { width: 340px; height: 600px; border: 10px solid #111; border-radius: 34px; overflow: hidden; background: #eceee9; box-shadow: 0 18px 40px -22px rgba(0,0,0,.5); }
.bc-phone iframe { width: 100%; height: 100%; border: 0; display: block; }
.bc-qr { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; }
.bc-qr #bcqr { width: 112px; height: 112px; }
.bc-qr #bcqr svg { width: 100%; height: 100%; display: block; }
.bc-qr p { margin: 4px 0 10px; font-size: 14px; }
@media (max-width: 1100px) { .bc-grid { grid-template-columns: 1fr; } .bc-side { grid-template-columns: auto minmax(0, 1fr); align-items: start; } }
@media (max-width: 700px) { .bc-side { grid-template-columns: 1fr; } .bc-phone { display: none; } }

.lk-why { margin: 8px 0 10px; font-size: 14px; }

.ffl-xfer { line-height: 1.5; }
.ffl-steps { margin: 6px 0 4px; padding-left: 20px; }

/* Visitors */
.vs-map-panel { margin-bottom: 16px; }
.vs-map { height: 380px; margin-top: 12px; border: 1px solid var(--rule); background: #aad3df; z-index: 0; }
.vs-map-note { font-size: 13px; margin: 8px 0 0; }
.vs-map-panel .leaflet-popup-content { font: 14px/1.45 var(--body); }
@media (max-width: 700px) { .vs-map { height: 300px; } }
.vs-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 8px; align-items: start; }
.vs-cols .panel h2 { font-size: 18px; }
.vs-row.open td { background: #f3fdee; }
.vs-path td { background: #fafbf8; padding: 10px 14px 14px; }
.vs-path ol { margin: 0; padding-left: 22px; display: grid; gap: 5px; }
.vs-path li { line-height: 1.4; }
.vs-path .vs-t { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 10px; background: #000; color: var(--green); font: 600 12px var(--body); }
@media (max-width: 900px) { .vs-cols { grid-template-columns: 1fr; } }

/* Notifications bell and panel */
.adm-bell { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 2px solid #fff; border-radius: 6px; background: transparent; color: #fff; cursor: pointer; flex: none; }
.adm-bell:hover { background: rgba(255,255,255,.12); }
.adm-bell[hidden] { display: none; }
.nf-checks { display: grid; gap: 8px; margin: 0 0 6px; }
.nf-check { font-size: 16px; }
.nf-on { margin: 0 0 12px; }
.notice.ok { border-left-color: var(--green); background: #effde9; }
.nf-note { font-size: 13px; margin: 10px 0 0; }
.nf-steps { padding-left: 20px; margin: 0 0 10px; line-height: 1.6; }
.nf-h { font: 700 15px var(--body); margin: 18px 0 6px; }
.nf-devs { list-style: none; margin: 0; padding: 0; }
.nf-devs li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); }

@media (max-width: 860px) { .lk { grid-template-columns: minmax(0, 1fr); } .lk-img { width: 72px; height: 72px; } }

/* New order */
.no-sec { margin-bottom: 16px; }
.no-find { position: relative; }
.no-find > .inp { width: 100%; }
.no-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); background: #fff; border: 1px solid #b9bdb3; box-shadow: 0 10px 24px rgba(0,0,0,.15); max-height: 360px; overflow-y: auto; }
.no-results button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--rule); background: #fff; font: 400 14px var(--body); cursor: pointer; color: var(--ink); }
.no-results button:hover, .no-results button:focus { background: #effde9; }
.no-cust { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.cust-details th { width: 150px; text-align: left; border-bottom: 1px solid var(--rule); font-weight: 600; }
.cust-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cust-kpis .v { font-size: 24px; }
.adm a.btn { text-decoration: none; display: inline-block; }

/* Serial numbers on order lines */
.sn-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.sn-row .inp { flex: 1; min-width: 160px; max-width: 360px; padding: 5px 8px; font-size: 13px; }
.cu-hint { flex-basis: 100%; font-size: 12px; }
.cu-hint a { font-weight: 600; }

/* Customer form */
dialog.modal.wide-modal { width: min(680px, 94vw); }
.cform { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
.cform .wide { grid-column: 1 / -1; }
.cform .fld { align-content: start; }
.cform .inp, .cform select, .cform textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.cform .inp, .cform select { height: 40px; }
.cform-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 560px) { .cform { grid-template-columns: 1fr; } }

/* Forms (settings, users) */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px 20px; align-items: start; }
.form-grid > .wide { grid-column: 1 / -1; }
.fld { display: grid; gap: 5px; font-size: 14px; align-content: start; }
.fld > span { font-weight: 600; }
.fld small { color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
/* Every box the same height and full width, whatever the help text under it */
.form-grid .fld > .inp, .form-grid .fld > select { width: 100%; box-sizing: border-box; height: 42px; }
.form-grid .fld > textarea.inp { height: auto; min-height: 76px; resize: vertical; font: 400 15px/1.45 var(--body); }
/* Checkboxes line up with the boxes beside them (below the label row) */
.fld.check { grid-template-columns: 20px 1fr; align-items: start; gap: 10px; }
/* On/off options: a tidy list in columns, under the boxes */
.form-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px 24px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.form-checks.solo { margin-top: 14px; padding-top: 0; border-top: 0; }
.fld.check input { width: 18px; height: 18px; margin-top: 2px; }
.fld.check > span { font-weight: 400; display: grid; gap: 3px; }
.fld.check > span b { font-weight: 600; }
.with-suffix { display: flex; align-items: center; gap: 6px; } .with-suffix .inp { width: 110px; height: 42px; box-sizing: border-box; }
.secret-state { font-size: 12px; color: var(--green-ink); font-weight: 600; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sec-head h2 { margin: 0; }
.sec-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.sec-nav a { font-size: 14px; padding: 5px 10px; background: #fff; border: 1px solid var(--rule); border-radius: 14px; text-decoration: none; color: var(--ink); }
.perm-grid { display: grid; gap: 8px; margin: 6px 0; }
pre.log { background: #111; color: #d8f5cc; padding: 12px; font-size: 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; }

dialog.modal { border: 0; padding: 0; width: min(560px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog.modal::backdrop { background: rgba(0,0,0,.45); }
.modal-b { padding: 20px 22px; }
.modal-b h2 { margin-top: 0; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: #000; color: #fff; padding: 12px 18px; border-left: 5px solid var(--green); z-index: 50; max-width: 92vw; font-size: 15px; }
.toast.bad { border-left-color: var(--alert); }
.muted { color: var(--ink-2); }
.empty { padding: 30px 0; color: var(--ink-2); }

/* Menu button (phones) */
.adm-menu { display: none; align-items: center; gap: 8px; background: none; border: 0; color: #fff; padding: 6px 4px; font: 700 15px var(--body); cursor: pointer; }
.adm-menu span { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 39; }

/* Page headers (title, search, filters, tabs) stay pinned under the black bar */
.page-head { position: sticky; top: var(--adm-top-h, 62px); z-index: 12; background: var(--stone);
  margin: -24px -28px 16px; padding: 18px 28px 12px; border-bottom: 1px solid var(--rule); box-shadow: 0 6px 12px -10px rgba(0,0,0,.25); }
.page-head > :last-child { margin-bottom: 0; }
.page-head h1 { margin-bottom: 12px; }
.sec-pick { display: flex; align-items: center; gap: 10px; font: 600 14px var(--body); }
.sec-pick select { flex: 1; max-width: 360px; font-size: 16px; padding: 10px 12px; }

@media (max-width: 860px) {
  .adm-shell { grid-template-columns: minmax(0, 1fr); }
  .adm-top { gap: 10px; padding: 8px 12px; }
  .adm-menu { display: inline-flex; }
  /* The section list becomes a slide-out panel */
  .adm-nav { position: fixed; top: var(--adm-top-h, 54px); left: 0; bottom: 0; height: auto; align-self: stretch; width: min(290px, 84vw); z-index: 40;
    transform: translateX(-102%); transition: transform .2s ease; box-shadow: 8px 0 24px rgba(0,0,0,.25); padding: 8px 0 24px; }
  body.nav-open .adm-nav { transform: none; }
  body.nav-open { overflow: hidden; }
  .adm-nav a { padding: 14px 20px; font-size: 16px; }
  .adm-main { padding: 16px 14px 50px; }
  .page-head { margin: -16px -14px 14px; padding: 12px 14px 10px; }
  .page-head h1 { font-size: 26px; margin-bottom: 10px; }
  .adm-main h1 { font-size: 28px; }
  /* Tabs scroll sideways in one row instead of stacking */
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; flex: none; }
  .bar-row { gap: 8px; }
  .bar-row .grow { flex-basis: 100%; min-width: 0; }
  .bar-row .inp, .bar-row select { font-size: 16px; }   /* 16px stops iPhones zooming in on tap */
  .sec-pick select { max-width: none; }
  .cols { grid-template-columns: 1fr; }
  .adm-who { display: none; }
  .adm-top a.adm-home { margin-left: auto; padding: 6px 9px; }
  .adm-bell { width: 36px; height: 36px; }
  .adm-top a.adm-home span { display: none; }
  .adm-logo img { height: 34px; }
  .adm-top .btn.light { padding: 6px 10px; font-size: 13px; }
  .ord { padding: 14px 12px; }
  .acts .btn { flex: 0 1 auto; }
  .form-grid { grid-template-columns: 1fr; }
  .inp, .adm select, .adm textarea { font-size: 16px; }
}
@media (max-width: 420px) { .adm-logo { display: none; } }
@media print { .adm-top, .adm-nav, .bar-row, .acts, .toast, .tabs, .nav-scrim { display: none !important; } .page-head { position: static; box-shadow: none; } .adm-shell { display: block; } }

/* Business card: your details and email signature */
.bc-me { margin: 0 0 18px; }
.bc-me-f { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.bc-me-f .btn { height: 42px; }
@media (max-width: 760px) { .bc-me-f { grid-template-columns: 1fr; } }
.bc-sig { margin: 18px 0 0; }
.bc-sig-box { background: #fff; border: 1px solid var(--rule); padding: 18px; overflow-x: auto; }
.bc-sig-how { margin: 8px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.bc-sig-how li { margin: 0 0 6px; }

/* Sign-in page logo */
.signin-logo { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto 20px; }
.signin { text-align: center; }
.signin #signinErr { text-align: left; }

/* Resources: shared website logins */
.res-bar { margin: 0 0 8px; }
.res-cat { margin: 22px 0 10px; font-size: 18px; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.res-card { background: #fff; border: 1px solid var(--rule); border-left: 4px solid var(--accent, #45f00e); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.res-h { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.res-h h3 { margin: 0; font-size: 17px; }
.res-url { font-size: 14px; color: var(--muted, #4d5148); word-break: break-all; }
.res-login { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; margin: 0; align-items: center; }
.res-login dt { color: var(--muted, #4d5148); font-size: 14px; }
.res-login dd { margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 0; }
.res-login code { font-family: inherit; font-size: 15px; font-weight: 600; background: #f3f4f1; padding: 3px 8px; word-break: break-all; }
.res-notes { margin: 0; font-size: 14px; white-space: pre-wrap; }
.res-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.res-pwin { display: flex; gap: 6px; }
.res-pwin .inp { flex: 1; min-width: 0; }
.res-only { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.res-people { display: grid; gap: 4px; padding: 4px 0 0 24px; max-height: 180px; overflow: auto; }
@media (max-width: 600px) { .res-form { grid-template-columns: 1fr !important; } }

/* Social */
.soc-nets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.soc-net { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); background: #fff; padding: 5px 10px; font-size: 14px; color: #5c6157; }
.soc-net.on { border-color: var(--green); color: var(--ink); background: #effde9; }
.soc-net img { border-radius: 50%; }
.soc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.soc-grid h2 { font-size: 17px; margin: 18px 0 8px; }
.soc-side { position: sticky; top: calc(var(--adm-top-h, 62px) + 12px); }
@media (max-width: 1000px) { .soc-grid { grid-template-columns: 1fr; } .soc-side { position: static; } }
.soc-items { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.soc-items li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--rule); background: #fff; padding: 6px; }
.soc-items img, .soc-noimg { width: 56px; height: 56px; object-fit: contain; background: #f3f4f1; display: block; }
.soc-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 0 0 10px; }
.soc-ph { border: 2px solid var(--rule); background: #fff; display: grid; cursor: pointer; }
.soc-ph.on { border-color: var(--green); }
.soc-ph img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #f3f4f1; }
.soc-ph span { padding: 4px 6px; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.soc-res { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: 14px; }
.soc-res li.ok::before { content: '✓ '; color: #2a7a08; font-weight: 700; }
.soc-res li.bad::before { content: '✗ '; color: var(--alert); font-weight: 700; }
.soc-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.soc-thumbs img { width: 64px; height: 64px; object-fit: contain; background: #f3f4f1; border: 1px solid var(--rule); }
.soc-acc { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.soc-card { border: 1px solid var(--rule); background: #fff; padding: 10px 12px; display: grid; gap: 6px; align-content: start; }
.soc-card.on { border-left: 4px solid var(--green); }
.soc-card-h { display: flex; gap: 10px; align-items: center; }
.soc-card-h img { border-radius: 50%; }
.soc-card select { width: 100%; }
.soc-badge { width: 28px; height: 28px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font: 700 14px var(--body); flex: none; }

/* Messages (Google Voice) */
.gv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; font-size: 14px; }
.gv { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); border: 1px solid var(--rule); background: #fff; height: calc(100vh - var(--adm-top-h, 60px) - 170px); min-height: 420px; }
.gv-side { border-right: 1px solid var(--rule); display: flex; flex-direction: column; min-height: 0; }
.gv-side > .inp { margin: 10px; width: auto; }
#gvl { overflow-y: auto; flex: 1; }
#gvl .empty { padding: 20px 14px; }
.gv-c { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.gv-c:hover { background: #f5f6f3; }
.gv-c[aria-current="true"] { background: #effde9; box-shadow: inset 4px 0 0 var(--green); }
.gv-av { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #1b1d19; color: #fff; display: grid; place-items: center; font-weight: 700; }
.gv-cb { flex: 1; min-width: 0; }
.gv-cn { display: flex; gap: 6px; align-items: baseline; }
.gv-cn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.gv-cn time { margin-left: auto; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.gv-cn .pill { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: #eef0ea; color: var(--ink-2); }
.gv-cp { display: block; font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gv-c.unread .gv-cn b { font-weight: 800; }
.gv-c.unread .gv-cp { color: var(--ink); font-weight: 600; }
.gv-c .count { flex: none; background: var(--green); color: #000; font-size: 12px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.gv-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.gv-pick { margin: auto; }
.gv-th { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.gv-thn { flex: 1; min-width: 140px; display: flex; flex-direction: column; }
.gv-thn small { font-size: 13px; }
.gv-th .acts { margin: 0; }
.gv-th .gv-back { display: none !important; }
.gv-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #f7f8f5; }
.gv-b { max-width: min(78%, 520px); padding: 9px 12px; border-radius: 14px; font-size: 15px; line-height: 1.4; }
.gv-b p { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.gv-b time { display: block; font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.gv-b.in { align-self: flex-start; background: #fff; border: 1px solid var(--rule); border-bottom-left-radius: 4px; }
.gv-b.out { align-self: flex-end; background: #dff8d3; border-bottom-right-radius: 4px; }
.gv-vm { border-left: 4px solid var(--green) !important; }
.gv-vm b { display: block; margin-bottom: 4px; font-weight: 600; }
.gv-vm .btn { margin: 4px 0; }
.gv-audio { display: block; width: 100%; max-width: 320px; margin: 6px 0; }
.gv-img { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin: 4px 0; }
.gv-ev { align-self: center; font-size: 13px; color: var(--ink-2); background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 4px 12px; text-align: center; }
.gv-ev time { margin-left: 6px; }
.gv-r { border-top: 1px solid var(--rule); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.gv-r textarea { width: 100%; resize: none; font: 400 15px var(--body); }
.gv-ra { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gv-note { border-top: 1px solid var(--rule); padding: 12px 14px; margin: 0; font-size: 14px; }
.gv-setup { max-width: 760px; }
.gv-setup ol { padding-left: 20px; line-height: 1.55; }
.gv-setup li { margin-bottom: 10px; }
.gv-uri { display: inline-block; margin: 4px 0; padding: 4px 8px; background: #f2f3ef; word-break: break-all; font-family: var(--body); }
@media (max-width: 760px) {
  .gv { grid-template-columns: 1fr; height: calc(100dvh - var(--adm-top-h, 60px) - 250px); min-height: 380px; }
  .gv-top { font-size: 13px; }
  .gv-th { padding: 8px 10px; gap: 6px; }
  .gv-side { border-right: 0; }
  .gv-main { display: none; }
  .gv.gv-open .gv-side { display: none; }
  .gv.gv-open .gv-main { display: flex; }
  .gv-th .gv-back { display: inline-flex !important; }
  .gv-b { max-width: 88%; }
}

/* A&D book: fills everything beside the menu and below the header */
body.ad-full .adm-main { max-width: none; padding: 0; height: calc(100dvh - var(--adm-top-h, 62px)); display: flex; flex-direction: column; overflow: hidden; }
.ad-bar { display: flex; align-items: center; gap: 12px; padding: 6px 12px; border-bottom: 1px solid var(--rule); background: var(--stone); flex: none; }
.ad-bar b { font: 700 16px var(--display); }
.ad-bar small { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.ad-bar .btn { margin-left: auto; }
.ad-frame { display: block; flex: 1; width: 100%; min-height: 0; border: 0; background: #fff; }
@media (max-width: 760px) { body.ad-full .adm-main { padding: 0; } .ad-bar small { display: none; } }

/* Social tabs, Insights and Comments */
.page-tabs { margin: 0; }
.page-tabs a { padding: 7px 12px; border: 1px solid var(--rule); background: #fff; border-radius: 4px; font: 600 14px var(--body); color: var(--ink); text-decoration: none; }
.page-tabs a[aria-current="page"] { background: #000; color: #fff; border-color: #000; }
.si-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.si-bar .tabs { margin: 0; }
.si-bar .btn { margin-left: auto; }
.kpi .pos { color: #1d7a0c; } .kpi .neg { color: var(--alert); }
.kpi .l a { color: inherit; }
.si-tbl td.num, .si-tbl th.num { text-align: right; white-space: nowrap; }
.si-err { color: var(--alert); font-size: 12.5px; max-width: 420px; margin-top: 3px; }
.si-sort { margin-bottom: 10px; }
.si-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.si-post { display: flex; gap: 12px; background: #fff; border: 1px solid var(--rule); padding: 12px; min-width: 0; }
.si-post > img, .si-noimg { flex: none; width: 84px; height: 84px; object-fit: cover; border-radius: 4px; background: #eef0ea; }
.si-pb { min-width: 0; flex: 1; }
.si-ph { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.si-ph small:last-child { margin-left: auto; }
.si-pb p { margin: 4px 0 6px; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.si-chips { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--ink-2); }
.si-chip b { color: var(--ink); }
.ci-group { margin-bottom: 14px; }
.ci-post { display: flex; gap: 12px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); }
.ci-post img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; flex: none; }
.ci-post p { margin: 4px 0; font-size: 14px; color: var(--ink-2); }
.ci { padding: 10px 0 10px 12px; border-left: 3px solid transparent; }
.ci + .ci { border-top: 1px solid #eef0ea; }
.ci.needs { border-left-color: var(--green); }
.ci.hidden > p { opacity: .55; }
.ci-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ci-h small { margin-left: auto; }
.ci p { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ci-acts { display: flex; gap: 6px; }
.ci-replies { margin: 6px 0 0 14px; border-left: 2px solid var(--rule); }
.ci-replies .ci { padding: 6px 0 6px 12px; }
.ci.mine > .ci-h b { color: #1d7a0c; }
.ci-rbox, .ci-new .ci-form { margin-top: 8px; }
.ci-form textarea { width: 100%; resize: vertical; font: 400 15px var(--body); }
.ci-new { margin-top: 10px; }
.ci-new summary { cursor: pointer; font-size: 14px; color: var(--ink-2); }
@media (max-width: 760px) { .si-post > img, .si-noimg { width: 64px; height: 64px; } .si-bar .btn { margin-left: 0; } }

/* Sent posts: long links, hashtags and error notes wrap instead of running off the page */
.soc-h, .soc-side, #sresults { min-width: 0; max-width: 100%; }
.soc-h p, .soc-res, .soc-res li, #sresults, .si-err { overflow-wrap: anywhere; word-break: break-word; }
.soc-thumbs { flex-wrap: wrap; }

/* Specials */
.sp-tbl td { vertical-align: middle; }
.sp-tbl td.num, .sp-tbl th.num { text-align: right; white-space: nowrap; }
.sp-item { display: flex; gap: 10px; align-items: center; min-width: 220px; }
.sp-item img, .sp-pick img { width: 48px; height: 48px; object-fit: contain; background: #fff; border: 1px solid var(--rule); flex: none; }
.sp-acts { white-space: nowrap; }
.sp-acts .btn { margin: 2px 0; }
.bad-t { color: var(--alert); font-weight: 600; }
.sp-form { margin-top: 14px; }
.sp-pick { display: flex; gap: 12px; align-items: center; margin: 12px 0 4px; padding: 10px; background: #f6f7f3; border: 1px solid var(--rule); }
.sp-pick img { width: 64px; height: 64px; }
.sp-grid { margin-top: 12px; }
.sp-quick { margin: 4px 0 0; }
.sp-sum { margin: 10px 0; font-size: 15px; }

/* Version in the header */
.adm-ver { background: none; border: 1px solid #555; color: #bbb; font: 600 12px var(--body); padding: 4px 8px; border-radius: 12px; cursor: pointer; white-space: nowrap; }
.adm-ver:hover { color: #fff; border-color: #fff; }
.adm-ver.bad { color: #ffd35a; border-color: #ffd35a; }
.chlog { max-height: 55vh; overflow-y: auto; }
.chlog h3 { margin: 14px 0 4px; font-size: 16px; }
.chlog ul { margin: 0; padding-left: 20px; }
.chlog li { margin: 3px 0; font-size: 14px; }
@media (max-width: 760px) { .adm-ver { padding: 3px 6px; font-size: 11px; } }
.disc-note { color: #1d7a0c; font-size: 14px; margin: 8px 0; }

/* Home page: collections and sign-ups */
.hm-list { display: grid; gap: 12px; margin-top: 14px; }
.hm-col .sec-head { align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.hm-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; }
.hm-thumb { flex: none; width: 92px; font-size: 12px; line-height: 1.25; }
.hm-thumb img, .hm-thumb > span { display: block; width: 92px; height: 92px; object-fit: contain; background: #fff; border: 1px solid var(--rule); margin-bottom: 4px; }
.hm-thumb small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hm-thumb.gone { opacity: .55; }
.hm-items { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.hm-items li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--rule); background: #fff; }
.hm-items li > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hm-items img, .hm-noimg { width: 44px; height: 44px; object-fit: contain; flex: none; background: #f6f7f3; }

/* ── Rounded corners everywhere (matches the storefront) ── */
:root { --r: 10px; --r-sm: 8px; --r-xs: 5px; }
/* Boxes and panels */
.signin, .panel, .ord, .bc-picked, .bc-hit, .vs-map, .no-results, .bc-sig-box, .res-card, .res-only, .soc-items li, .soc-ph, .soc-card,
.gv, .si-post, .sp-pick, .hm-items li, .ffl-box, .toast, dialog.modal, .acct-order { border-radius: var(--r); }
.vs-map, .gv, .soc-card, .si-post { overflow: hidden; }
/* Stat tiles: separate rounded boxes instead of a shared grid of lines */
.kpis { gap: 12px; background: none; border: 0; }
.kpi { border: 1px solid var(--rule); border-radius: var(--r); }
/* Tables not already inside a panel get a rounded frame */
.scroll-x:has(> .tbl) { border-radius: var(--r); border: 1px solid var(--rule); background: #fff; }
.panel .scroll-x:has(> .tbl), dialog .scroll-x:has(> .tbl) { border: 0; border-radius: 0; }
/* Buttons, fields, tabs */
.btn, .inp, .adm select, .adm textarea, .tabs button, .page-tabs a, .adm-bell, .adm-top a.adm-home, .adm-top .btn, .sec-pick select { border-radius: var(--r-sm); }
/* Small images and thumbnails */
.lk-img, .soc-thumbs img, .sp-item img, .sp-pick img, .hm-items img, .hm-noimg, .hm-thumb img, .hm-thumb > span, .si-post > img, .si-noimg, .ci-post img { border-radius: var(--r-xs); }
.hm-thumb img, .hm-thumb > span { border-radius: var(--r-sm); }

/* ── Card view for tables (header button; default on phones) ── */
.adm-view[hidden] { display: none; }
body.cards .scroll-x:has(> .tbl-c) { border: 0; background: none; overflow: visible; }
body.cards .tbl.tbl-c { display: block; background: none; }
body.cards .tbl-c > thead, body.cards .tbl-c .tbl-hrow { display: none; }
body.cards .tbl-c > tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
body.cards .tbl-c > tbody > tr { display: block; background: #fff; border: 1px solid var(--rule); border-radius: var(--r, 10px); padding: 10px 14px; }
body.cards .tbl-c > tbody > tr.click:hover { border-color: #000; }
body.cards .tbl-c > tbody > tr.click:hover td { background: none; }
body.cards .tbl-c td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; border: 0; padding: 4px 0; text-align: right; white-space: normal; overflow-wrap: anywhere; }
body.cards .tbl-c td::before { content: attr(data-label); flex: none; max-width: 45%; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
body.cards .tbl-c td[data-label=""]::before { display: none; }
body.cards .tbl-c td[data-label=""] { justify-content: flex-start; text-align: left; flex-wrap: wrap; }
body.cards .tbl-c td:first-child { display: block; text-align: left; font-size: 15px; padding: 2px 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--rule); }
body.cards .tbl-c td:first-child::before { display: none; }
body.cards .tbl-c td.tbl-span { display: block; text-align: left; }
body.cards .tbl-c td:empty { display: none; }
body.cards .tbl-c td > .tc { min-width: 0; }
body.cards .tbl-c td[data-label=""] > .tc { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
body.cards .tbl-c td[data-label=""] > .tc .cdel { margin-left: 0; }
body.cards .tbl-c td .inp, body.cards .tbl-c td select { max-width: 60%; }
body.cards .tbl-c td.sp-acts, body.cards .tbl-c td:last-child[data-label=""] { padding-top: 8px; gap: 6px; }

/* Phones: header fits on one line, and pages never slide sideways */
html, body { overflow-x: clip; max-width: 100%; }
body { overscroll-behavior-x: none; }
#auth { display: inline-flex; align-items: center; gap: 6px; }
#auth svg { flex: none; }
@media (max-width: 760px) {
  .adm-top { gap: 8px; padding: 8px 10px; }
  .adm-menu { min-width: 0; flex: 0 1 auto; }
  .adm-menu #navcur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .adm-top a.adm-home, .adm-bell, .adm-top #auth { flex: none; }
  .adm-top #auth { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .adm-top #auth span { display: none; }
  .adm-ver { flex: none; }
}
@media (max-width: 380px) { .adm-ver { display: none; } }

/* Social: video posts */
.soc-video { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 14px; align-items: start; margin: 0 0 12px; padding: 10px; border: 2px solid var(--green); border-radius: var(--r, 10px); background: #fff; }
.soc-video video { width: 100%; max-height: 320px; background: #000; border-radius: var(--r-xs, 5px); }
.soc-vinfo { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.soc-vbar { height: 8px; background: #e3e5df; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.soc-vbar span { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s; }
.ok-t { color: var(--green-ink, #2a7a08); font-weight: 600; }
.soc-dim { opacity: .45; pointer-events: none; }
.soc-off { opacity: .6; }
.soc-vthumb { position: relative; display: inline-grid; place-items: center; width: 64px; height: 64px; background: #111; border-radius: var(--r-xs, 5px); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.soc-vthumb img { width: 100%; height: 100%; object-fit: cover; }
.soc-vthumb > span { position: absolute; color: #fff; font-size: 20px; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
@media (max-width: 560px) { .soc-video { grid-template-columns: 1fr; } }

/* Version number at the bottom of the menu (click for what changed) */
.adm-nav { display: flex; flex-direction: column; }
.adm-nav .nav-ver { margin: auto 20px 4px; padding-top: 14px; align-self: flex-start; background: none; border: 0; color: #8a8f84; font: 600 12px var(--body); cursor: pointer; text-align: left; }
.adm-nav .nav-ver:hover { color: var(--ink); text-decoration: underline; }
.adm-nav .nav-ver.bad { color: var(--alert); }
.adm-nav .nav-ver[hidden] { display: none; }
.deals-box { margin: 0 0 16px; }

/* Customer (and estimate) details: never wider than the screen */
.cols > * { min-width: 0; }
.cust-details td { overflow-wrap: anywhere; word-break: break-word; }
.cust-kpis .kpi { min-width: 0; }
.cust-kpis .v { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  /* Buttons in a tidy two-column grid, Delete on its own row */
  .cust-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .cust-acts .btn { width: 100%; margin: 0; text-align: center; justify-content: center; white-space: normal; line-height: 1.25; padding: 10px 8px; }
  .cust-acts .cdel { grid-column: 1 / -1; margin-left: 0; }
  .cust-details th { width: auto; min-width: 0; padding-right: 10px; white-space: normal; }
  .cust-details th, .cust-details td { font-size: 14px; padding-left: 0; }
  .cust-kpis { gap: 8px; }
  .cust-kpis .kpi { padding: 10px; }
  .cust-kpis .v { font-size: 19px; }
  .cust-kpis .l { font-size: 12px; }
}
@media (max-width: 380px) { .cust-acts { grid-template-columns: 1fr; } }

/* Item lookup filters */
.lk-filters { margin: 0 0 14px; padding: 12px 16px; }
.lk-fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; margin-top: 10px; }
.lk-fgrid .fld select, .lk-fgrid .fld .inp { width: 100%; min-width: 0; }
.lk-fhint { grid-column: 1 / -1; margin: 0; font-size: 13px; }
.lk-details { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.lk-details span { background: #f3f4f1; border: 1px solid var(--rule); border-radius: 6px; padding: 2px 8px; font-size: 13px; }
.lk-details small { color: var(--ink-2); font-weight: 600; margin-right: 3px; }
@media (max-width: 560px) { .lk-fgrid { grid-template-columns: 1fr 1fr; } }

/* New order / estimate: pick an existing customer from a list or search */
.cust-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.cust-pick .fld > span { font-weight: 600; font-size: 14px; }
.cust-pick select { width: 100%; }
@media (max-width: 700px) { .cust-pick { grid-template-columns: 1fr; } }

/* Inspect feed window */
dialog.modal.insp { width: min(900px, 96vw); }
.insp-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.insp-h h2 { margin: 0; }
.insp-x { border: 0; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; padding: 4px 10px; border-radius: 999px; color: inherit; }
.insp-x:hover { background: rgba(0,0,0,.08); }
.insp-out { max-height: 65vh; overflow: auto; white-space: pre-wrap; word-break: break-word; user-select: text; }
.insp .acts { justify-content: flex-end; margin-top: 12px; }

/* Feeds: live sync status */
.sync-live { border: 1px solid var(--line, #ddd); border-radius: var(--r, 12px); padding: 14px 16px; margin: 0 0 18px; background: var(--card, #fff); }
.sl-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 17px; }
.sl-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sl-steps li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; }
.sl-steps li > div { min-width: 0; overflow-wrap: anywhere; }
.sl-i { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; font-weight: 700; }
.sl-steps .ok .sl-i { color: #2a7a08; }
.sl-steps .bad .sl-i, .sl-steps .bad .muted { color: var(--alert, #b00020); }
.sl-steps .wait { opacity: .6; }
.sl-bar { height: 8px; border-radius: 999px; background: rgba(0,0,0,.08); overflow: hidden; margin: 6px 0 4px; max-width: 480px; }
.sl-bar i { display: block; height: 100%; background: #3cd10d; border-radius: 999px; transition: width .6s ease; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0,0,0,.15); border-top-color: #3cd10d; display: inline-block; animation: slspin .8s linear infinite; }
@keyframes slspin { to { transform: rotate(360deg); } }

/* Specials: social posting status */
.sp-posted { margin-top: 4px; line-height: 1.5; }
.sp-posted small { color: var(--ink-2, #555); }
.pill.warn { background: #ffe9a8; color: #6b4b00; }
.pill.badp { background: #ffd9d9; color: #8a0010; }

/* Home page → FFL copy */
.ffl-now { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; border: 1px solid rgba(0,0,0,.12); border-radius: var(--r, 10px); padding: 12px; background: #fff; }
.ffl-now img { width: 140px; max-height: 110px; object-fit: contain; border-radius: 6px; background: #f4f4f2; }
.ffl-pdf { width: 90px; height: 110px; border-radius: 6px; background: #b00020; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; }
.ffl-now .acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* Estimates: customer opened it */
.pill.viewed { background: #e6dcff; }

.est-sig { margin: 6px 0 4px; border: 1px solid rgba(0,0,0,.12); border-radius: 8px; background: #fff; max-width: 360px; }
.est-sig img { display: block; width: 100%; height: auto; border-radius: 8px; }

.ord-sig { margin: 8px 0; border: 1px solid rgba(0,0,0,.12); border-radius: var(--r, 10px); padding: 8px 12px; background: #fff; }
.ord-sig summary { cursor: pointer; }

/* Orders: how many orders are at each step, in the corner of each tab */
#otabs { padding: 9px 9px 2px 0; gap: 12px; }
#otabs button { position: relative; }
.tab-n { position: absolute; top: -8px; right: -7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #3cd10d; color: #000; font: 700 11px/18px var(--body); text-align: center; box-shadow: 0 0 0 2px #fff; }
.tab-n[hidden] { display: none; }
#otabs button[data-k="attention"] .tab-n, #otabs button[data-k="new"] .tab-n, #otabs button[data-k="needs_manual"] .tab-n { background: #e5484d; color: #fff; }
#otabs button[data-k="cancelled"] .tab-n { background: #c9ccc3; color: #333; }

/* Orders steps: same look on phones as on desktop (wrap onto more lines, no sideways scrolling, badges not cut off) */
@media (max-width: 860px) {
  #otabs { flex-wrap: wrap; overflow: visible; }
  #otabs button { flex: 0 0 auto; }
}
.tabs button[aria-pressed="true"] { color: #fff; }

/* Header Sign in / Sign out: icon only on phones and small tablets (the words don't fit the round button) */
@media (max-width: 860px) {
  .adm-top #auth { width: 36px; height: 36px; min-width: 36px; padding: 0; justify-content: center; flex: none; }
  .adm-top #auth span { display: none; }
}

/* Orders steps on phones: one dropdown instead of the row of buttons, with the same count badges */
.otab-pick { display: none; }
@media (max-width: 860px) {
  #otabs { display: none; }
  .otab-pick { display: block; position: relative; margin: 0 0 14px; }
  #otabbtn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer; font: 700 16px var(--body); padding: 11px 40px 11px 14px; color: var(--ink, #111); background: #fff no-repeat right 14px center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  #otabbtn[aria-expanded="true"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath d='M6 15l6-6 6 6' fill='none' stroke='%23111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  #otabmenu { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid rgba(0,0,0,.14); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; max-height: 70vh; overflow: auto; }
  #otabmenu[hidden] { display: none; }
  #otabmenu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; font: 600 16px var(--body); color: var(--ink, #111); padding: 12px 12px; border-radius: 8px; cursor: pointer; -webkit-appearance: none; appearance: none; }
  #otabmenu button[aria-selected="true"] { background: #111; color: #fff; }
  .otab-pick .tab-n { position: static; box-shadow: none; flex: none; }
  .otab-pick .tab-n[data-k="attention"], .otab-pick .tab-n[data-k="new"], .otab-pick .tab-n[data-k="needs_manual"] { background: #e5484d; color: #fff; }
  .otab-pick .tab-n[data-k="cancelled"] { background: #c9ccc3; color: #333; }
}

/* Order buttons on phones: main step stays a button, the rest drop down under "More actions" */
.ord-more { display: none; }
@media (max-width: 860px) {
  .ord-acts:not(.few) .ord-more { display: flex; order: 1; width: 100%; justify-content: space-between; align-items: center; font-weight: 700;
    padding-right: 38px; background: #fff no-repeat right 14px center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  .ord-acts.open .ord-more { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath d='M6 15l6-6 6 6' fill='none' stroke='%23111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  .ord-acts > .btn:not(.ghost) { flex: 1 1 auto; justify-content: center; }
  .ord-acts:not(.few) > .btn.ghost:not(.ord-more) { display: none; }
  .ord-acts.open:not(.few) > .btn.ghost:not(.ord-more) { display: flex; order: 2; width: 100%; justify-content: flex-start; margin: 0; }
  .ord-acts .btn.ghost.cdel { margin-left: 0; }
}

/* Item lookup: change an item's category, type, brand and filters by hand */
.lk-fixbtn { margin: 6px 0 2px; }
.fx-modal .modal-b { max-width: 640px; }
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 12px; margin-bottom: 10px; }
.fx-grid .fld { margin: 0; }
.fx-grid select, .fx-grid .inp { width: 100%; }
.fx-modal .acts .cdel { margin-left: auto; }

/* Social: the YouTube video's voiceover */
.soc-voice { margin: 0 0 12px; display: grid; gap: 6px; }
.soc-voice textarea { min-height: 90px; }

/* Photos on estimates and orders */
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 8px 0 10px; }
.ph-item { position: relative; margin: 0; aspect-ratio: 1; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: #f3f4f1; }
.ph-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-rm { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font: 700 17px/26px var(--body); cursor: pointer; padding: 0; }
.ph-empty { margin: 8px 0; }
.ph-acts { margin-top: 4px; }
.ph-pick { position: relative; display: inline-block; }
.ph-pick > summary { list-style: none; cursor: pointer; }
.ph-pick > summary::-webkit-details-marker { display: none; }
.ph-pick > summary::after { content: ''; width: 9px; height: 9px; margin-left: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); display: inline-block; }
.ph-pick[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.ph-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 190px; background: #fff; border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 4px; }
.ph-opt { display: block; padding: 11px 14px; border-radius: 7px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ph-opt:hover, .ph-opt:focus-within { background: #f1f3ee; }
.ph-modal .modal-b { max-width: 980px; }

/* Collapsible cards (js/fold.js): the arrow sits in the card's top right corner */
.fold-rel { position: relative; }
[data-fold-ready="1"] > .fold-head { padding-right: 46px; min-height: 34px; }
.fold-btn { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 1px solid var(--rule); border-radius: var(--r-sm, 8px); background: #fff; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; font: inherit; z-index: 1; }
.fold-btn::before { content: ''; width: 9px; height: 9px; border: solid #111; border-width: 0 2px 2px 0; transform: translateY(2px) rotate(-135deg); }
.folded .fold-btn::before { transform: translateY(-2px) rotate(45deg); }
.fold-btn:hover { background: #f1f3ee; }
[data-fold-ready="1"].folded > :not(.fold-head):not(.fold-btn) { display: none !important; }
[data-fold-ready="1"].folded > .fold-head { margin-bottom: 0; }
h2.fold-head, h3.fold-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Buttons next to search boxes are the search box's height */
.bar-row > .btn:not(.sm), .bar-row > a.btn:not(.sm) { padding: 7px 12px; font-size: 14px; }
@media (min-width: 761px) { .adm-top #auth { min-height: 40px; } }
