/* Counties page (partner-coverage.mjs). Builds on the shared board styles (partners-board.css). Phone first: every row
   wraps inside its card, nothing scrolls sideways at 375px. */
.kb{min-width:0}
.kb-upgrades{display:grid;grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:8px;margin-bottom:24px}
.kb-upgrade{display:grid;gap:2px;text-align:left;min-height:56px;padding:10px 12px;border:1px solid var(--pb-line);border-radius:12px;background:#fff;color:var(--pb-ink);font:inherit;cursor:pointer;min-width:0}
.kb-upgrade strong{font-size:14px;font-weight:650;overflow-wrap:anywhere}
.kb-upgrade small{font-size:14px;color:var(--pb-muted)}
.kb-upgrade:hover{background:#eef4e9}
.kb-upgrade.is-selected{border-color:var(--pb-green);background:#eef6ee;box-shadow:inset 0 0 0 1px var(--pb-green)}
.kb-upgrade:focus-visible,.kb-chip:focus-visible,.kb-sheet h2:focus-visible{outline:3px solid #679078;outline-offset:2px}

.kb-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0 0 16px;border:1px solid var(--pb-line);border-radius:12px;background:#fff;overflow:hidden}
.kb-summary>div{padding:14px 18px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.kb-summary>div+div{border-left:1px solid var(--pb-line)}
.kb-summary dt{font-size:14px;color:var(--pb-muted);line-height:1.5}
.kb-summary dd{font-size:24px;line-height:1;font-weight:650;font-variant-numeric:tabular-nums;letter-spacing:-.8px;margin:0;color:var(--pb-ink)}
.kb-summary>div:first-child{background:#f1f7f2}
.kb-summary>div:first-child dd{color:var(--pb-green)}
.kb-overlap-note{font-size:14px;color:var(--pb-muted);line-height:1.5}
.kb-filters{display:flex;flex-wrap:wrap;gap:8px 22px;margin-bottom:16px}
.kb-filters .pb-check{flex:0 1 auto;font-size:14px;min-height:36px}
.kb-counties{list-style:none;margin:0 0 10px;padding:0;display:grid;gap:10px}
.kb-county{background:#fff;border:1px solid var(--pb-line);border-radius:12px;padding:12px 14px;display:grid;gap:8px;min-width:0}
.kb-county.is-overlap{border-color:var(--pb-urgent-line)}
.kb-county.is-empty{background:transparent;border-style:dashed}
/* A homeowner's county, from Homeowners ("See attic on Counties"). */
.kb-county.is-target{border:2px solid var(--pb-green);background:#f3faf4}
.pb .kb-from{margin:0 0 10px;font-weight:600;color:var(--pb-ink)}
.kb-county-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.kb-county-head strong{font-size:13px;margin-right:4px}
.kb-county-head small{font-size:13px;color:var(--pb-muted)}
.kb-chips{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px}
.kb-chip{display:grid;gap:2px;width:100%;min-height:44px;text-align:left;padding:8px 12px;border:1px solid #dbe3d6;border-left-width:4px;border-radius:10px;background:#fbfcf9;color:var(--pb-ink);font:inherit;cursor:pointer;min-width:0}
.kb-chip:hover{background:#eef4e9}
.kb-chip.is-open{border-left-color:var(--pb-paying)}
.kb-chip.is-closed{border-left-color:#c9a26b}
.kb-chip-name{font-size:14px;font-weight:650;overflow-wrap:anywhere}
.kb-chip small{font-size:14px;color:var(--pb-muted);overflow-wrap:anywhere}
.kb-chip.is-closed small:first-of-type{color:var(--pb-urgent)}
.pb .kb-ex{color:var(--pb-talk);font-weight:600}
.kb-star{color:#b07a00;margin-right:4px}
.kb-key{margin-top:4px}
.kb-fold{border:1px solid var(--pb-line);border-radius:12px;background:#fff;margin:0 0 12px}
.kb-fold>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px;cursor:pointer;list-style:none}
.kb-fold>summary::-webkit-details-marker{display:none}
.kb-fold>summary::after{content:'+';font-size:20px;line-height:1;color:var(--pb-muted);flex:none}
.kb-fold[open]>summary::after{content:'−'}
.kb-fold>summary>span:first-child{display:grid;gap:4px}
.kb-fold>summary strong{font-size:14px;font-weight:650;color:var(--pb-ink)}
.kb-fold>summary small,.kb-fold-count{font-size:13px;line-height:1.5;color:var(--pb-muted)}
.kb-fold-count{margin-left:auto;white-space:nowrap}
.kb-fold[open]>summary{border-bottom:1px solid var(--pb-line)}
.kb-fold-body{padding:18px}
.kb-fold-body>.pb-note:last-child{margin-bottom:0}

.kb-partners{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.kb-partners>li{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border:1px solid var(--pb-line);border-radius:12px;padding:12px 14px;min-width:0}
.kb-partner-main{display:grid;gap:3px;min-width:0}
.kb-partner-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
.kb-partner-head strong{font-size:15px;overflow-wrap:anywhere}
.kb-partner-main small{font-size:14px;color:var(--pb-muted);overflow-wrap:anywhere}

.kb-notice{border:1px solid #cfe5d3;background:#f3faf4;border-radius:12px;padding:12px 14px;margin-bottom:18px;display:grid;gap:8px}
.kb-notice p{color:var(--pb-ink);font-size:14px}
.kb-notice ul{margin:0;padding-left:18px;display:grid;gap:4px;font-size:14px}
.kb-notice .pb-actions{justify-content:flex-start}

.kb-partners.kb-test{margin-top:10px}
.kb-partners.kb-test>li{background:var(--pb-soft);border-style:dashed}
.pb .kb-leads-line,.pb .kb-invoices-line{color:var(--pb-trial);font-weight:600;overflow-wrap:anywhere}

/* The editor: a sheet, phone first. Each choice is a tappable chip (a real checkbox drawn as a pill); the Save bar
   sticks to the bottom of the sheet so it is always in reach. */
.kb-modal{position:fixed;inset:0;z-index:50;background:#16221b8c;display:grid;place-items:center;padding:16px}
.kb-sheet{width:min(560px,100%);max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain;background:#fff;border-radius:16px;padding:20px;display:grid;gap:12px;box-shadow:0 20px 60px #0000004d}
.kb-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.kb-sheet h2{font-size:19px;overflow-wrap:anywhere;min-width:0}
.kb-x{flex:none;width:44px;height:44px;border:0;border-radius:22px;background:var(--pb-soft);color:var(--pb-ink);font:inherit;font-size:24px;line-height:1;cursor:pointer}
.kb-x:hover{background:#e6ece1}
.kb-form{gap:4px}
.kb-form .kb-sec{border-top:1px solid var(--pb-line);padding:14px 0 10px;gap:10px}
.kb-form .kb-sec:first-child{border-top:0;padding-top:4px}
.kb-form legend{display:flex;align-items:baseline;gap:8px;font-size:15px;font-weight:700;color:var(--pb-ink);padding:0;float:left;width:100%;margin-bottom:8px}
.kb-form legend+*{clear:both}
.kb-form legend small{font-size:14px;font-weight:500;color:var(--pb-muted)}
.kb-picks{display:flex;flex-wrap:wrap;gap:8px}
.kb-form .kb-pick{position:relative;display:inline-flex;min-width:0;max-width:100%;font-weight:500}
.kb-pick input{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none}
.kb-pick span{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:8px 14px 8px 12px;border:1px solid #cfd9ca;border-radius:999px;background:#fff;color:var(--pb-ink);font-size:14px;line-height:1.25;cursor:pointer;user-select:none;overflow-wrap:anywhere;transition:background .12s,border-color .12s}
.kb-pick span::before{content:"+";display:inline-grid;place-items:center;flex:none;width:18px;height:18px;border-radius:9px;background:var(--pb-soft);color:var(--pb-muted);font-size:13px;font-weight:700}
.kb-pick:hover span{border-color:var(--pb-green-2)}
.kb-pick input:checked+span{background:var(--pb-green);border-color:var(--pb-green);color:#fff}
.kb-pick input:checked+span::before{content:"✓";background:#ffffff2e;color:#fff}
.kb-pick input:focus-visible+span{outline:3px solid #679078;outline-offset:2px}
.kb-pick input:disabled+span{opacity:.45;cursor:not-allowed;border-style:dashed}
.kb-unlisted{list-style:none;margin:0;padding:0;display:grid;gap:4px}
.kb-unlisted li{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 8px;font-size:13px;color:var(--pb-muted)}
.kb-unlisted li span{text-decoration:line-through;text-decoration-color:#9aa59d}
.kb-unlisted small{font-size:14px}
.kb-quick{display:flex;gap:8px;flex-wrap:wrap}
.kb-quick .pb-btn{min-height:40px;padding:7px 14px;border-color:#cad6c3;text-decoration:none}
.kb-province{display:grid;gap:8px;margin-top:4px}
.kb-prov-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.kb-prov-head h3{margin:0;font-size:14px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:var(--pb-muted)}
.kb-link{border:0;background:none;padding:10px 0;min-height:40px;color:var(--pb-green-2);font:inherit;font-size:13px;font-weight:600;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.kb-leads-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.kb-leads-fields label>span{display:flex;align-items:baseline;gap:6px}
/* Their business (13 Oct 2026): a long name, so the whole row; its label wraps on a phone. */
.kb-leads-fields label:nth-child(3){grid-column:1/-1}
.kb-leads-fields label>span,.kb-invoices-field>span{flex-wrap:wrap;overflow-wrap:anywhere;min-width:0}
.kb-invoices-field>span{display:flex;align-items:baseline;gap:6px}
.kb-leads .kb-link{justify-self:start}
/* Up to three people their leads go to (18 Oct 2026): a block each, its heading and Remove only once there are two. */
.kb-leads-person{display:grid;gap:8px}
.kb-leads-person[hidden]{display:none}
.kb-leads-person+.kb-leads-person{padding-top:12px;border-top:1px solid var(--pb-line)}
.kb-leads-head{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0}
.kb-leads-head h3{margin:0;font-size:14px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:var(--pb-muted)}
.kb-leads[data-kb-people="1"] .kb-leads-head{display:none}
.kb-leads .kb-leads-remove{min-height:44px;padding:10px 4px}
.kb-leads-add{justify-self:start;min-height:44px;max-width:100%;white-space:normal;text-align:left}
.kb-leads-add[hidden]{display:none}
.kb-leads-several{overflow-wrap:anywhere}
/* Places they don't cover (22 Oct 2026): each with Remove, then a town or Eircode, how far round it, and Leave out. */
.kb-place-list{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.kb-place-list li{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;padding:8px 12px;border:1px solid var(--pb-line);border-radius:12px}
.kb-place-list li>span{display:grid;gap:2px;min-width:0;overflow-wrap:anywhere}
.kb-place-list small{font-size:14px;color:var(--pb-muted)}
.kb-place-list .kb-link{flex:none;min-height:44px;padding:10px 4px}
.kb-place-add{display:grid;grid-template-columns:minmax(0,1fr) 7.5em auto;gap:10px;align-items:end}
.kb-place-add label>span{display:flex;align-items:baseline;gap:6px}
.kb-place-add .pb-btn{min-height:44px}
.kb-form .kb-save-bar{position:sticky;bottom:-20px;z-index:1;background:#fff;padding:12px 0 14px;margin:6px 0 -10px;border-top:1px solid var(--pb-line);justify-content:flex-end}
/* Why a Save didn't go: its own full-width first row in the Save bar, so it is always beside Save. */
.kb-save-bar .kb-error{flex:1 0 100%;margin:0;font-size:14px;line-height:1.4}
.kb-to-partners{justify-self:start}

@media (min-width:1100px){.kb-counties{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}.kb-chips{grid-template-columns:1fr}}
@media (max-width:640px){
  .kb-upgrades{grid-template-columns:repeat(2,minmax(0,1fr))}
  .kb-chips{grid-template-columns:1fr}
  .kb-summary>div{padding:14px 12px;align-items:flex-start;flex-direction:column;gap:8px}
  .kb-summary dt{font-size:14px;min-height:30px}
  .kb-summary dd{font-size:26px}
  .kb-filters{gap:4px 14px}
  .kb-filters .pb-check{min-height:44px}
  .kb-county-head strong{font-size:14px}
  .kb-chip-name{font-size:13px}
  .kb-chip small{font-size:14px}
  .kb-fold>summary{padding:15px}
  .kb-fold-body{padding:14px}
  .kb-fold-count{font-size:13px}
  .kb-partners>li{flex-direction:column;align-items:stretch}
  .kb-partners .pb-btn{width:100%}
  .kb-modal{padding:8px 0 0;place-items:end center}
  .kb-sheet{max-height:calc(100vh - 8px);max-height:calc(100dvh - 8px);padding:14px 16px 16px;border-radius:18px 18px 0 0}
  .kb-pick span{min-height:44px;font-size:15px}
  .kb-leads-fields{grid-template-columns:1fr}
  .kb-place-add{grid-template-columns:minmax(0,1fr) 6.5em}
  .kb-place-add .pb-btn{grid-column:1/-1;width:100%}
  .kb-form .kb-save-bar{bottom:-16px}
  .kb-form .kb-save-bar .pb-btn{flex:1 1 0}
}
