/* Leads360 shell and components (Phase 1). Everything is scoped to body.l360. */
body.l360 .mainnav { display: none; }
body.l360 .l360-nav { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
body.l360 .l360-nav a { color: var(--topbar-muted, #c9d6d7); text-decoration: none; padding: .55rem .9rem; border-bottom: 3px solid transparent; font-weight: 600; min-height: var(--l-h-md); display: inline-flex; align-items: center; }
body.l360 .l360-nav a:hover { color: #fff; }
body.l360 .l360-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--l-yellow); }
body:not(.l360) .l360-nav { display: none; }
body.l360 main { max-width: 1180px; margin: 0 auto; padding: 20px var(--l-gutter) 48px; }
body.l360 h1, body.l360 h2, body.l360 .l-figure { font-family: var(--l-font-head); font-weight: 700; color: var(--l-navy); }
body.l360 h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
body.l360 .l-sub { color: var(--l-muted); margin: 0 0 1.25rem; }
body.l360 a { color: var(--l-teal); }

/* Card */
body.l360 .l-card { background: var(--l-card); border: 1px solid var(--l-hair); border-radius: var(--l-radius); box-shadow: var(--l-shadow); padding: 16px 18px; margin: 0 0 16px; }
body.l360 .l-card > h2 { font-size: 1.05rem; margin: 0 0 .6rem; }

/* Stat */
body.l360 .l-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
body.l360 .l-stat { background: var(--l-card); border: 1px solid var(--l-hair); border-radius: var(--l-radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
body.l360 a.l-stat:hover { border-color: var(--l-teal); }
body.l360 .l-stat .l-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--l-muted); }
body.l360 .l-stat .l-figure { font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
body.l360 .l-stat .l-note { font-size: 12px; color: var(--l-muted); }
body.l360 .l-stat.is-null .l-figure { color: var(--l-muted); }

/* Badge, Chip */
body.l360 .l-badge { display: inline-block; border-radius: var(--l-radius-sm); padding: 1px 7px; font-size: 12px; font-weight: 600; background: #eef2f2; color: var(--l-navy); white-space: nowrap; }
body.l360 .l-badge.tone-info { background: var(--l-pale-blue); }
body.l360 .l-badge.tone-warn { background: var(--l-warn-bg); color: var(--l-warn-fg); }
body.l360 .l-badge.tone-good { background: #dff3ee; color: #12665f; }
body.l360 .l-badge.band-hot { background: #ffd9c7; color: #8a2d00; }
body.l360 .l-badge.band-warm { background: var(--l-warn-bg); color: var(--l-warn-fg); }
body.l360 .l-badge.band-cold { background: #e4eaee; }

/* Button: one yellow hero per view */
body.l360 .l-btn { min-height: var(--l-h-md); padding: 0 16px; border-radius: 8px; border: 1px solid var(--l-rule); background: #fff; color: var(--l-navy); font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
body.l360 .l-btn:hover { border-color: var(--l-navy); }
body.l360 .l-btn.is-small { min-height: var(--l-h-sm); padding: 0 12px; }
body.l360 .l-btn.is-large { min-height: var(--l-h-lg); padding: 0 22px; }
body.l360 .l-btn.is-hero { background: var(--l-yellow); border-color: var(--l-yellow); }
body.l360 .l-btn:focus-visible, body.l360 .l-nav a:focus-visible { outline: 3px solid var(--l-teal); outline-offset: 2px; }

/* Callout (the Zoho banner) */
body.l360 .l-callout { background: var(--l-pale-blue); border-radius: var(--l-radius); padding: 10px 14px; margin: 0 0 12px; }

/* Table */
body.l360 .l-table { width: 100%; border-collapse: collapse; }
body.l360 .l-table th { background: var(--l-head); text-transform: uppercase; font-size: 11px; letter-spacing: .08em; color: var(--l-muted); text-align: left; padding: 8px 10px; }
body.l360 .l-table td { padding: 10px; border-top: 1px solid var(--l-rule); vertical-align: top; }
body.l360 .l-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
body.l360 .l-scroll { overflow-x: auto; }

@media (max-width: 640px) {
  body.l360 main { padding-top: 14px; }
  body.l360 .l-stats { grid-template-columns: repeat(2, 1fr); }
  body.l360 .l360-nav a { padding: .5rem .6rem; }
}

/* header: the search takes less room so the account menu stays on the first row */
body.l360 .top-search { flex: 0 1 22rem; }
body.l360 .l-card .l-stats + p { margin-top: 12px; }

/* Prospects list: views and filters */
body.l360 .l-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--l-rule); margin: 0 0 12px; }
body.l360 .l-tabs a { padding: 8px 12px; text-decoration: none; color: var(--l-muted); font-weight: 600; border-bottom: 3px solid transparent; min-height: var(--l-h-md); display: inline-flex; align-items: center; }
body.l360 .l-tabs a[aria-current="page"] { color: var(--l-navy); border-bottom-color: var(--l-yellow); }
body.l360 .l-filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
body.l360 .l-filters .l-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--l-muted); margin: 0 4px 0 8px; }
body.l360 .l-pill { border: 1px solid var(--l-rule); border-radius: 999px; padding: 2px 10px; text-decoration: none; color: var(--l-navy); font-size: 13px; min-height: 28px; display: inline-flex; align-items: center; }
body.l360 .l-pill.is-on { background: var(--l-navy); color: #fff; border-color: var(--l-navy); }

/* Prospect page */
body.l360 .l-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin: 0 0 12px; }
body.l360 .l-head-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
body.l360 .l-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
body.l360 .l-head-actions .btn { min-height: var(--l-h-md); }
body.l360 .l-btn.is-disabled { opacity: .5; cursor: not-allowed; }
body.l360 button.l-tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 14px; font: inherit; font-weight: 600; color: var(--l-muted); cursor: pointer; min-height: var(--l-h-md); }
body.l360 button.l-tab[aria-selected="true"] { color: var(--l-navy); border-bottom-color: var(--l-yellow); }
body.l360 [role="tabpanel"] > .stack > h2 { font-size: 1.05rem; margin: 1rem 0 .4rem; }

/* Zoho lead page */
body.l360 .l-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 16px; margin: 12px 0; }
body.l360 .l-field { display: flex; flex-direction: column; gap: 4px; }
body.l360 .l-field label { font-size: 12px; font-weight: 600; color: var(--l-muted); }
body.l360 .l-field select, body.l360 .l-field input { min-height: var(--l-h-md); border: 1px solid var(--l-rule); border-radius: 8px; padding: 0 10px; font: inherit; background: #fff; }
body.l360 .l-actions { margin: 4px 0 12px; }
body.l360 .l-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
body.l360 .l-dl dt { color: var(--l-muted); font-size: 13px; }
body.l360 .l-dl dd { margin: 0; }

/* Needs you */
body.l360 .l-card h3 { font-size: .95rem; margin: 14px 0 6px; }
body.l360 .l-list { list-style: none; margin: 0 0 8px; padding: 0; }
body.l360 .l-item { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--l-rule); flex-wrap: wrap; }
body.l360 .l-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Prospects list: tiles, preview, menu, bar */
body.l360 .l-tiles { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
body.l360 .l-tile { display: flex; flex-direction: column; gap: 2px; min-width: 96px; padding: 8px 12px; border: 1px solid var(--l-hair); border-radius: var(--l-radius); background: var(--l-card); text-decoration: none; color: inherit; }
body.l360 .l-tile .l-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--l-muted); }
body.l360 .l-tile-n { font-family: var(--l-font-head); font-weight: 700; font-size: 1.25rem; color: var(--l-navy); font-variant-numeric: tabular-nums; }
body.l360 .l-tile-note { font-size: 11px; color: var(--l-muted); white-space: nowrap; }
body.l360 .l-tile.is-on { border-color: var(--l-navy); box-shadow: inset 0 -3px 0 var(--l-yellow); }
body.l360 .l-filters select { min-height: var(--l-h-sm); border: 1px solid var(--l-rule); border-radius: 8px; padding: 0 8px; background: #fff; font: inherit; max-width: 14rem; }
body.l360 .l-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
body.l360 .l-split:has(.l-preview) { grid-template-columns: minmax(0, 1fr) 340px; }
body.l360 .l-preview { position: sticky; top: 72px; background: var(--l-card); border: 1px solid var(--l-hair); border-radius: var(--l-radius); padding: 14px; box-shadow: var(--l-shadow); }
body.l360 .l-preview-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
body.l360 .l-preview-head h2 { font-size: 1.05rem; margin: 0 0 8px; }
body.l360 .l-table tr.is-selected td { background: var(--l-pale-blue); }
body.l360 .l-table tbody tr { cursor: pointer; }
body.l360 .l-bar { display: flex; gap: 10px; align-items: center; margin: 0 0 8px; padding: 8px 12px; background: var(--l-pale-blue); border-radius: var(--l-radius); }
body.l360 .l-menu { position: relative; }
body.l360 .l-menu summary { cursor: pointer; list-style: none; padding: 4px 8px; border-radius: 6px; min-height: 28px; }
body.l360 .l-menu-list { position: absolute; right: 0; z-index: 5; background: #fff; border: 1px solid var(--l-rule); border-radius: 8px; box-shadow: var(--l-shadow); min-width: 10rem; padding: 4px; display: flex; flex-direction: column; }
body.l360 .l-menu-list a { padding: 8px 10px; text-decoration: none; white-space: nowrap; }
@media (max-width: 900px) { body.l360 .l-split:has(.l-preview) { grid-template-columns: minmax(0, 1fr); } body.l360 .l-preview { position: static; } }
body.l360 .l-bar[hidden] { display: none; }
body.l360 .l-menu summary { border: 0; background: none; box-shadow: none; min-width: 0; }
body.l360 .l-menu summary::-webkit-details-marker { display: none; }

/* Accessibility (Lighthouse pass, 2 Dec 2026): text and links meet 4.5:1 on white, the grey page and the pale-blue callout */
body.l360 { --link: #166f6f; --muted: #566170; --l-muted: #566170; --l-teal: #166f6f; }
body.l360 .l-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.l360 .l-tab, body.l360 .l-tabs a { color: #566170; }

/* Phone width (2 Dec 2026): nothing makes the page scroll sideways; tiles and tabs scroll in their own row; State and Why drop out of tables */
body.l360 .l-scroll { position: relative; }
@media (max-width: 640px) {
  body.l360 .l-tiles { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  body.l360 .l-tile { flex: 0 0 auto; min-width: 84px; }
  body.l360 .l-tabs { flex-wrap: nowrap; overflow-x: auto; }
  body.l360 .l-tabs a, body.l360 button.l-tab { white-space: nowrap; flex: 0 0 auto; }
  body.l360 .l-filters select { flex: 1 1 42%; max-width: 100%; min-width: 0; }
  body.l360 .l-hide-sm { display: none; }
  body.l360 .l-head { flex-direction: column; }
  body.l360 .l-head-actions { width: 100%; }
  body.l360 .l-head-actions .l-btn, body.l360 .l-head-actions .btn { flex: 1 1 auto; justify-content: center; }
  body.l360 .l-item { flex-direction: column; }
  body.l360 .l-form { grid-template-columns: 1fr; }
  body.l360 .l-card { padding: 14px; }
  body.l360 .l-dl { grid-template-columns: 1fr; gap: 2px; }
  body.l360 .l-dl dd { margin-bottom: 8px; }
}
@media (max-width: 640px) {
  body.l360 .l-table .l-badge { white-space: normal; }
  body.l360 .l-table td, body.l360 .l-table th { padding: 8px 6px; }
  body.l360 .l-table td:first-child:has(input) { width: 28px; }
}

/* Find */
body.l360 #find-note { width: 100%; min-height: 5.5rem; border: 1px solid var(--l-rule); border-radius: 8px; padding: 10px 12px; font: inherit; margin: 6px 0 2px; box-sizing: border-box; }
body.l360 .l-more { margin: 8px 0; }
body.l360 .l-more summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
body.l360 .l-starts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
body.l360 .l-start { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--l-hair); border-radius: var(--l-radius); text-decoration: none; color: inherit; }
body.l360 .l-start:hover { border-color: var(--l-navy); }
body.l360 .l-start strong { color: var(--l-navy); }
body.l360 button.l-pill { background: #fff; font: inherit; cursor: pointer; }
body.l360 .check { display: inline-flex; gap: 6px; align-items: center; }

/* Find lists (Runs, Found, Saved searches) */
body.l360 .l-row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 640px) { body.l360 .l-head .l-btn { width: 100%; } }

/* Find run page */
body.l360 .l-crumbs { margin: 0 0 8px; }
body.l360 .l-progress { height: 8px; background: var(--l-rule); border-radius: 999px; overflow: hidden; margin: 0 0 14px; }
body.l360 .l-progress span { display: block; height: 100%; background: var(--l-teal); }
body.l360 .l-verdict .l-filters { margin: 0 0 6px; }
body.l360 .l-verdict input[type="text"] { min-height: var(--l-h-sm); border: 1px solid var(--l-rule); border-radius: 8px; padding: 0 8px; font: inherit; max-width: 100%; }
body.l360 pre.brief { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }

/* Find forms */
body.l360 .l-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 12px; }
body.l360 .l-field { display: flex; flex-direction: column; gap: 4px; }
body.l360 .l-field input, body.l360 .l-field select, body.l360 textarea, body.l360 .l-card input[type="text"], body.l360 .l-card input[type="number"], body.l360 .l-card select { min-height: var(--l-h-sm); border: 1px solid var(--l-rule); border-radius: 8px; padding: 0 8px; font: inherit; max-width: 100%; background: #fff; }
body.l360 textarea { width: 100%; padding: 8px; box-sizing: border-box; }
body.l360 .l-field .l-label, body.l360 .l-card > div > .l-label, body.l360 .l-card > .l-label, body.l360 .l-card label.l-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--l-muted); }
body.l360 .check input[type="checkbox"] { width: 24px; height: 24px; margin: 0 4px 0 0; flex: 0 0 auto; }

/* Push to Zoho */
body.l360 .l-match { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
body.l360 .l-bar { flex-wrap: wrap; }

/* Zoho accounts and contacts */
body.l360 .l-facts { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 6px 16px; margin: 0; }
body.l360 .l-facts dt { color: var(--l-muted); font-size: 13px; }
body.l360 .l-facts dd { margin: 0; overflow-wrap: anywhere; }
body.l360 ul.l-plain { list-style: none; margin: 0 0 8px; padding: 0; }
body.l360 ul.l-plain li { padding: 3px 0; }
@media (max-width: 640px) { body.l360 .l-facts { grid-template-columns: 1fr; } }
body.l360 .l-bar-track { display: block; width: 100%; min-width: 80px; height: 10px; background: var(--l-rule); border-radius: 999px; overflow: hidden; }
body.l360 .l-bar-fill { display: block; height: 100%; background: var(--l-teal); }

/* Settings → Users */
body.l360 .l-person { display: inline-flex; gap: 10px; align-items: center; }
body.l360 .l-table select { min-height: var(--l-h-sm); border: 1px solid var(--l-rule); border-radius: 8px; padding: 0 8px; font: inherit; background: #fff; }

/* Agents and Logs */
body.l360 .l-agents { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 20px; align-items: start; }
body.l360 .l-agent-list { display: flex; flex-direction: column; gap: 12px; }
body.l360 .l-agent { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: inherit; border: 1px solid transparent; }
body.l360 .l-agent:hover { border-color: var(--l-rule); }
body.l360 .l-agent[aria-current="page"] { background: var(--l-pale-blue); border-color: var(--l-navy); }
body.l360 .l-x { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; padding: 0 2px; min-width: 24px; min-height: 24px; }
body.l360 .l-agents > * { min-width: 0; }
@media (max-width: 800px) { body.l360 .l-agents { grid-template-columns: minmax(0, 1fr); } }

/* Team → Reports and Data sources */
body.l360 .l-report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); gap: 16px; }
body.l360 .l-report-grid .l-card { margin: 0; min-width: 0; }
body.l360 .l-bars th { background: none; text-transform: none; letter-spacing: 0; font-size: inherit; color: inherit; font-weight: 400; width: 38%; }
body.l360 .l-bars .l-bar-cell { width: 45%; }
body.l360 .l-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Tap targets: at least 24 px for every control (QA 2 Dec) */
body.l360 .l-table input[type="checkbox"], body.l360 .l-bar input[type="checkbox"], body.l360 th input[type="checkbox"] { width: 24px; height: 24px; margin: 0; }
body.l360 .btn, body.l360 button.btn-small { min-height: 24px; min-width: 24px; }
body.l360 input[type="text"], body.l360 input[type="search"], body.l360 input[type="email"], body.l360 input[type="file"], body.l360 select, body.l360 textarea { min-height: 24px; }

/* The Prospects list on a phone: each row is a small card (tick, company and menu on top, then band and Zoho status) */
@media (max-width: 640px) {
  body.l360 .l-rows thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  body.l360 .l-rows, body.l360 .l-rows tbody { display: block; }
  body.l360 .l-rows tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 2px 8px; padding: 10px 4px; border-top: 1px solid var(--l-rule); align-items: start; }
  body.l360 .l-rows td { display: block; border: 0; padding: 0; min-width: 0; width: auto; }
  body.l360 .l-rows td:nth-child(1) { grid-column: 1; grid-row: 1 / span 3; }
  body.l360 .l-rows td:nth-child(2) { grid-column: 2; grid-row: 1; overflow-wrap: anywhere; }
  body.l360 .l-rows td:nth-child(3) { grid-column: 2; grid-row: 2; }
  body.l360 .l-rows td:nth-child(6) { grid-column: 2; grid-row: 3; }
  body.l360 .l-rows td:nth-child(7) { grid-column: 3; grid-row: 1; }
  body.l360 .l-rows td:nth-child(4), body.l360 .l-rows td:nth-child(5) { display: none; }
}

/* Rules: the blocks inside the Leads360 frame use the Leads360 colours, radius and type (3 Dec 2026) */
body.l360 .l-rules-body .block-title { color: var(--l-muted); letter-spacing: .06em; }
body.l360 .l-rules-body .pending-block, body.l360 .l-rules-body .block { background: var(--l-card); border: 1px solid var(--l-hair); border-radius: var(--l-radius); box-shadow: var(--l-shadow); }
body.l360 .l-rules-body .pending-block { border-color: var(--l-yellow); }
body.l360 .l-rules-body .change { border: 1px solid var(--l-hair); border-left: 3px solid var(--l-yellow); border-radius: var(--l-radius-sm); background: var(--l-card); }
body.l360 .l-rules-body .setting { border-top-color: var(--l-hair); }
body.l360 .l-rules-body .rule { border-top-color: var(--l-hair); }
body.l360 .l-rules-body .rule:hover { background: var(--l-head); }
body.l360 .l-rules-body .rule-pending, body.l360 .l-rules-body .rule-pending:hover { background: var(--l-warn-bg); }
body.l360 .l-rules-body .rule-id, body.l360 .l-rules-body .rule-why, body.l360 .l-rules-body .rule-meta { color: var(--l-muted); }
body.l360 .l-rules-body .value-chip { background: var(--l-pale-blue); color: var(--l-navy); }
body.l360 .l-rules-body .setting-quote { border-left-color: var(--l-yellow); background: var(--l-head); }
body.l360 .l-rules-body .btn-ghost { color: var(--l-teal); }
