/* The panel's one stylesheet (plan 3.1, AI-3): phone first, one column of cards on a phone; buttons at least 44 px;
   text at least 16 px; the main action at the bottom, within a thumb's reach. From 75rem the list is a table that
   scrolls sideways inside its own box, never the page: the owner's choice over plan 3.1's "never a sideways-scrolling
   table" (final-design.txt).
   The look follows the demo video (demo-video/src/styles.css): its colours, its cards, its bands, its tabs, its
   bottom menu with icons, and on a desktop its dark rail on the left and its wider pages. The icons are files of
   their own (icons/*.svg, from the demo's set) drawn through a CSS mask, since the page's policy allows no data:
   image and no style= attribute. */
:root {
  /* the demo's tokens */
  --bg: #f2f3f1; --card: #ffffff; --ink: #18211f; --ink2: #56625f; --line: #dfe3df; --line2: #eceee9;
  --primary: #1557d6; --primary-dk: #0f45ad; --primary-soft: #e6eefc;
  --green: #0b7a4b; --green-bg: #e3f4ec; --amber-ink: #7c5200; --amber-fill: #f5c044; --amber-bg: #fdf2d3;
  --amber-line: #eccf85; --red: #b42318; --red-bg: #fdeceb; --red-line: #f3c0bb; --deadline: #96174a;
  --band-high: #14233f; --band-med: #55698a; --band-low: #e4e7ea; --field-line: #b9c1bd;
  --rail: #18232b; --rail-on: #2a3944; --rail-ink: #c8d3d9; --rail-width: 14rem; --menu-height: 64px;
  --series-1: #2a78d6; --series-2: #eb6834;
  /* the names the rules below have always used, kept, now in the demo's colours */
  --muted: var(--ink2); --paper: var(--card); --ground: var(--bg); --accent: var(--primary); --danger: var(--red);
  --amber: var(--amber-ink);
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: "Adwaita Sans", "Inter", "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto,
       sans-serif; font-size: 1rem; line-height: 1.4; color: var(--ink); background: var(--bg);
       font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); }
.page { max-width: 44rem; margin: 0 auto; padding: 1rem 1rem 6rem; }
h1 { font-size: 1.6rem; line-height: 1.2; font-weight: 740; letter-spacing: -0.01em; margin: 0.25rem 0 0.75rem; }
h2 { font-size: 1.125rem; line-height: 1.25; font-weight: 700; margin: 0 0 0.6rem; }
h3 { font-size: 1rem; font-weight: 700; margin: 0.9rem 0 0.4rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0.75rem 0.85rem;
        margin: 0 0 0.75rem; }
.card p { margin: 0 0 0.45rem; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card.narrow { max-width: 26rem; margin: 2rem auto 0.75rem; }
.card.list { padding: 0; overflow: hidden; }
.row-link { display: flex; align-items: center; gap: 0.75rem; min-height: 54px; padding: 0.5rem 0.85rem;
            color: var(--ink); text-decoration: none; font-weight: 540; border-bottom: 1px solid var(--line2); }
.row-link:last-child { border-bottom: 0; }
.row-link::after { content: ""; flex: none; margin-left: auto; width: 0.55rem; height: 0.55rem;
                   border-top: 2px solid var(--ink2); border-right: 2px solid var(--ink2); transform: rotate(45deg); }
a.card.row-link { border: 1px solid var(--line); margin-bottom: 0.5rem; }
.list-heading { margin: 1.1rem 0.15rem 0.5rem; }
.more-list .row-link::before { background-color: var(--ink2); }
.more-list form { margin: 0; }
button.row-link { width: 100%; border: 0; background: none; font: inherit; font-weight: 540; color: var(--ink);
                  text-align: left; cursor: pointer; }
button.row-link::after { display: none; }
label { display: block; margin: 0.75rem 0 0.3rem; font-weight: 620; }
label.check { display: flex; gap: 0.6rem; align-items: center; min-height: 44px; font-weight: 500; }
label.weight { display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; min-height: 44px;
               margin: 0; font-weight: 500; border-bottom: 1px solid var(--line2); }
input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="file"] {
       width: 100%; min-height: 44px; font-size: 1rem; font-family: inherit; color: var(--ink);
       padding: 0.55rem 0.75rem; border: 1.5px solid var(--field-line); border-radius: 10px; background: #fff; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--primary);
       box-shadow: 0 0 0 3px rgba(21, 87, 214, 0.2); }
label.weight input { width: 6rem; flex: none; }
input[type="checkbox"], input[type="radio"] { width: 1.5rem; height: 1.5rem; flex: none; accent-color: var(--primary); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 46px;
          min-width: 44px; padding: 0.5rem 0.9rem; margin: 0.75rem 0 0; font: inherit; font-size: 1rem;
          font-weight: 640; line-height: 1.2; text-align: center; border-radius: 10px;
          border: 1.5px solid var(--field-line); background: var(--card); color: var(--ink); text-decoration: none;
          cursor: pointer; }
.button:active { filter: brightness(0.92); }
.button.primary { width: 100%; background: var(--primary); border-color: var(--primary); color: #ffffff; }
.button.danger { color: var(--red); border-color: var(--red-line); background: #fff; }
.button[disabled] { opacity: 0.5; cursor: default; }
.error { color: var(--red); font-weight: 600; }
p.card.error, .card.error { background: var(--red-bg); border-color: var(--red-line); color: #8d1a11; }
.warning { color: var(--amber-ink); font-weight: 620; }
.notice { background: var(--primary-soft); color: #123c8d; border-radius: 10px; padding: 0.6rem 0.75rem; }
.chip { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 1rem; background: var(--line2);
        border: 0; color: #38443f; font-weight: 520; }
.reference { color: var(--muted); }
.codes { columns: 2; padding-left: 1.25rem; }
.secret { word-break: break-all; }
.link-text { overflow-wrap: anywhere; }
.qr { width: 14rem; height: 14rem; display: block; margin: 1rem auto; }
.qr-paper { fill: #ffffff; }
.qr-ink { fill: #000000; }
.test-data { background: #c21807; color: #ffffff; text-align: center; font-weight: 700; letter-spacing: 0.03em;
             padding: 0.5rem; }
.message-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--menu-height) + 0.75rem); margin: 0 0.75rem;
               padding: 0.75rem 0.9rem; background: #1a2422; color: #ffffff; font-weight: 520;
               border-radius: 12px; z-index: 30; box-shadow: 0 0.25rem 1rem rgba(13, 20, 24, 0.25); }
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.muted { color: var(--muted); }

/* ---- Icons: a shape from icons/*.svg, painted in the text's own colour ---------------------------------------- */
.menu-item::before, .rail-link::before, .bell-line a::before, .countdown::before, .cell-address .warning::before,
.button.call::before, details.hours > summary.button::before, .filters > summary::before,
.number .dnc::before, .maps .button::before, .more-list .row-link::before {
  content: ""; flex: none; display: inline-block; width: 1.25rem; height: 1.25rem; background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
.menu-item[href$="/today/"], .i-today { --icon: url("icons/list.d820b24368c4.svg"); }
.menu-item[href$="/search/"], .i-search { --icon: url("icons/search.a774bad010f3.svg"); }
.menu-item[href$="/my-leads/"], .i-my_leads, .i-account { --icon: url("icons/user.8167dc8c51d9.svg"); }
.menu-item[href$="/credits/"], .i-credits { --icon: url("icons/credits.8c8d6c459425.svg"); }
.menu-item[href$="/more/"] { --icon: url("icons/more.80fed7989556.svg"); }
.i-follow { --icon: url("icons/calendar.8455d5fd6887.svg"); }
.i-auctions, .countdown { --icon: url("icons/clock.b439d9b17a2a.svg"); }
.i-bell, .bell-line a { --icon: url("icons/bell.63652d3b05c6.svg"); }
.i-hidden { --icon: url("icons/hide.65ccc37148f9.svg"); }
.i-opted { --icon: url("icons/ban.ef45ea896617.svg"); }
.i-postcards { --icon: url("icons/mail.51cc622245ac.svg"); }
.i-automation { --icon: url("icons/zap.b6f015a4ff84.svg"); }
.i-settings { --icon: url("icons/sliders.0f92ffc50cc3.svg"); }
.i-team { --icon: url("icons/users.4506b0409899.svg"); }
.i-activity { --icon: url("icons/log.3fa18c74ef4a.svg"); }
.i-out { --icon: url("icons/logout.151d4e7c84bf.svg"); }
.button.call, details.hours > summary.button { --icon: url("icons/phone.9b7ab5dad6f2.svg"); }
.cell-address .warning, .number-amber .dnc { --icon: url("icons/alert.96f033091a62.svg"); }
.filters > summary { --icon: url("icons/filter.c1419904947f.svg"); }
.number-green .dnc { --icon: url("icons/check.273f7ccea7b4.svg"); }
.number-red .dnc, .number-opted_out .dnc { --icon: url("icons/ban.ef45ea896617.svg"); }
.maps .button { --icon: url("icons/pin.a4e68001223f.svg"); }

/* ---- The bottom menu (phone): icon above its word, the current page in blue ------------------------------------ */
.bottom-menu { position: fixed; left: 0; right: 0; bottom: 0; height: var(--menu-height); display: flex;
               padding: 3px 2px 4px; background: var(--card); border-top: 1px solid var(--line); z-index: 10; }
.menu-item { flex: 1; min-width: 0; min-height: 56px; display: flex; flex-direction: column; align-items: center;
             justify-content: center; gap: 2px; color: var(--ink2); text-decoration: none; font-size: 1rem;
             font-weight: 500; line-height: 1.15; white-space: nowrap; }
.menu-item::before { width: 1.4rem; height: 1.4rem; }
.menu-item.current { color: var(--primary); font-weight: 700; }

/* ---- The status line: the owner's credit gauge and the bell, at the top of every page -------------------------- */
#status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; padding: 0.5rem 1rem;
               background: var(--card); border-bottom: 1px solid var(--line); }
#status-line:not(:has(> *)) { display: none; }  /* nothing to show: its answer is then line breaks, not :empty */
#status-line p { margin: 0; }
.status-paused { flex: 0 0 calc(100% + 2rem); order: -1; margin: -0.5rem -1rem 0; padding: 0.55rem 1rem;
                 background: var(--amber-fill); color: #3d2a00; font-weight: 620; }
.gauge-box { flex: 1 1 14rem; min-width: 0; }
.gauge-line a { color: var(--ink); font-weight: 620; text-decoration: none; }
.gauge-meter, .hbar-meter { display: block; width: 100%; height: 9px; margin-top: 4px; border: 0; border-radius: 5px;
                            background: #e4e7e3; -webkit-appearance: none; appearance: none; }
.gauge-meter::-webkit-meter-bar, .hbar-meter::-webkit-meter-bar { background: #e4e7e3; border: 0; border-radius: 5px;
                                                                  height: 9px; }
.gauge-meter::-webkit-meter-optimum-value, .gauge-meter::-webkit-meter-suboptimum-value,
.gauge-meter::-webkit-meter-even-less-good-value { background: var(--primary); border-radius: 5px; }
.gauge-meter::-moz-meter-bar { background: var(--primary); border-radius: 5px; }
.hbar-meter, .hbar-meter::-webkit-meter-bar { height: 8px; }
.hbar-meter::-webkit-meter-optimum-value, .hbar-meter::-webkit-meter-suboptimum-value,
.hbar-meter::-webkit-meter-even-less-good-value { background: var(--series-1); border-radius: 4px; }
.hbar-meter::-moz-meter-bar { background: var(--series-1); border-radius: 4px; }
#status-line .bell-line { margin-left: auto; }
.bell-line a { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0 0.6rem;
               border-radius: 10px; color: var(--ink); font-weight: 620; text-decoration: none; }
.bell-line a::before { width: 1.4rem; height: 1.4rem; }

/* ---- The rail: the desktop's menu on the left (hidden on a phone) ----------------------------------------------- */
.rail { display: none; }
.rail form { margin: 0; }
.rail-brand { display: block; padding: 0.15rem 0.65rem 0.9rem; color: #fff; font-size: 1.25rem; font-weight: 720;
              text-decoration: none; }
.rail-link { display: flex; align-items: center; gap: 0.65rem; width: 100%; min-height: 44px; padding: 0.4rem 0.65rem;
             border: 0; border-radius: 8px; background: none; color: var(--rail-ink); font: inherit;
             font-weight: 540; text-align: left; text-decoration: none; cursor: pointer; }
.rail-link:hover { background: #22303a; color: #fff; }
.rail-link.current { background: var(--rail-on); color: #fff; font-weight: 650; }
.rail-gap { height: 0.9rem; flex: none; }
.rail-end { margin-top: auto; }

/* ---- Today: the tiles, the "Not done yet" box, the tabs, the toolbar ------------------------------------------- */
.today-box[hx-get].card { background: none; border: 0; padding: 0; }
.today-box[hx-get] h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
                white-space: nowrap; }
.today-box dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 0.4rem; row-gap: 0;
                margin: 0; }
.today-box dt, .today-box dd { margin: 0; background: var(--card); border: 1px solid var(--line); text-align: center; }
.today-box dd { border-bottom: 0; border-radius: 12px 12px 0 0; padding: 0.45rem 0.1rem 0; font-size: 1.45rem;
                font-weight: 740; line-height: 1.2; }
.today-box dt { border-top: 0; border-radius: 0 0 12px 12px; padding: 0 0.15rem 0.5rem; line-height: 1.16; }
.today-box dt a { color: var(--ink2); text-decoration: none; }
.today-box dt { position: relative; }
/* the whole tile taps: the word's link also covers its number, the dd just above (2.19rem and its 1px border) */
.today-box dt a::after { content: ""; position: absolute; left: -1px; right: -1px; bottom: -1px;
                         top: calc(-2.19rem - 1px); }
.today-box dt:nth-of-type(1) { grid-area: 2 / 1; } .today-box dd:nth-of-type(1) { grid-area: 1 / 1; }
.today-box dt:nth-of-type(2) { grid-area: 2 / 2; } .today-box dd:nth-of-type(2) { grid-area: 1 / 2; }
.today-box dt:nth-of-type(3) { grid-area: 2 / 3; } .today-box dd:nth-of-type(3) { grid-area: 1 / 3; }
.today-box dt:nth-of-type(4) { grid-area: 2 / 4; } .today-box dd:nth-of-type(4) { grid-area: 1 / 4; }
.not-done.card { background: #fff9e8; border-color: var(--amber-line); }
.not-done h2 { margin-bottom: 0.25rem; }
.not-done-line { display: flex; flex-wrap: wrap; gap: 0 0.5rem; padding: 0.5rem 0 0.6rem;
                 border-top: 1px solid var(--amber-line); }
.not-done-line p { flex-basis: 100%; margin: 0; }
.not-done-line form { flex: 1 1 auto; }
.not-done-line .button { width: 100%; margin-top: 0.5rem; }
.not-done details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700;
                            border-top: 1px solid var(--amber-line); }
.tabs { display: flex; gap: 0.25rem; margin: 0.25rem 0 0.75rem; overflow-x: auto; border-bottom: 1px solid var(--line);
        scrollbar-width: none; }
.tab { flex: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 0.6rem;
       border: 0; border-bottom: 3px solid transparent; background: none; color: var(--ink2); font-weight: 580;
       text-decoration: none; white-space: nowrap; }
.tab.current { color: var(--primary); border-bottom-color: var(--primary); font-weight: 680; }
.filters summary { min-height: 44px; display: flex; align-items: center; gap: 0.45rem; cursor: pointer;
                   font-weight: 640; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters.card { padding: 0 0.85rem; border: 1.5px solid var(--field-line); border-radius: 10px; }
.filters[open].card { padding-bottom: 0.85rem; border-color: var(--line); border-width: 1px; border-radius: 14px; }
.filters:not([open]) { float: left; width: calc(50% - 0.25rem); }
.filters:not([open]) > summary { justify-content: center; }
.filters:not([open]) + .select-start { float: right; width: calc(50% - 0.25rem); }
.filters:not([open]) + .select-start .button { width: 100%; }
.cards, .select-bar { clear: both; }
.filters select { width: 100%; min-height: 44px; font-size: 1rem; font-family: inherit; padding: 0.5rem;
                  border: 1.5px solid var(--field-line); border-radius: 10px; background: var(--paper); }
.select-start { margin: 0 0 0.75rem; }
.select-start .button { margin: 0; }

/* ---- The lead cards. A card is a row of cells (leads/card.html), in the order of the desktop's table columns. On a
   phone, and on a desktop narrower than 75rem (1200 px), the cells wrap into the demo's card: the category with the
   band on its right, then the deadline, the address, why, the value, the status lines and the action at the bottom.
   The table's own cells (Phones, Data, a "New" or "-" placeholder) and its header show only in the table. -------- */
.lead-card { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 0.5rem; row-gap: 0.2rem;
             -webkit-touch-callout: none; }
.lead-card p { margin: 0; }
.lead-card > .cell { flex: 1 1 100%; min-width: 0; order: 6; }
.lead-card > .cell:empty, .lead-card > .cell-phones, .lead-card > .cell-data, .lead-card .table-only,
.cards-head { display: none; }
.lead-card > .cell-select { order: 0; display: flex; justify-content: flex-end; }
.lead-card > .cell-what { order: 1; flex: 1 1 0; }
.lead-card > .cell-band { order: 2; flex: none; display: flex; align-items: center; min-height: 44px; }
.lead-card > .cell-deadline { order: 3; }
.lead-card > .cell-address { order: 4; }
.lead-card > .cell-why { order: 5; }
.lead-card > .cell-value { order: 6; }
.lead-card > .cell-work, .lead-card > .cell-assigned { order: 7; }
.lead-card > .cell-act { order: 9; }
.lead-card > .points-to { order: 10; flex: 1 1 100%; }
.cell-why .chips { margin-top: 0.25rem; }
.card-top { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.card-top a { color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center;
              min-width: 0; line-height: 1.2; }
.new { display: inline-block; background: var(--primary); color: #ffffff; font-weight: 720; padding: 0 0.4rem;
       border-radius: 6px; }
.band { display: inline-flex; align-items: center; padding: 0.05rem 0.5rem; border-radius: 7px;
        font-weight: 680; white-space: nowrap; background: var(--band-low); color: #36423f; }
.band-high { background: var(--band-high); color: #fff; }
.band-medium { background: var(--band-med); color: #fff; }
.band-low { background: var(--band-low); color: #36423f; }
.countdown { display: flex; align-items: center; gap: 0.35rem; color: var(--deadline); font-weight: 680; }
.reason { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-clamp: 2;
          overflow: hidden; color: #3c4845; }
.address { font-weight: 620; }
.address .label { color: var(--muted); font-weight: 400; }
.cell-address .warning { display: flex; align-items: center; gap: 0.35rem; }
.value strong { color: var(--ink); }
.source, .value, .case-status { color: var(--muted); }
.cell-phones .in, .cell-data .in { color: var(--green); font-weight: 650; }
.not-in { color: var(--ink2); }
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.follow-up { color: var(--primary); font-weight: 700; }
.lead-card .run:empty { display: none; }
.run .button, .call-line .button, .lead-card .hours > summary.button { width: 100%; margin-top: 0.5rem; }
.run .button { background: var(--primary); border-color: var(--primary); color: #fff; }
.run a.button { background: var(--card); border-color: var(--field-line); color: var(--ink); }
.run .notice, .run .warning { margin: 0.5rem 0 0; }
.more { text-align: center; }
.more .button { width: 100%; }
.title { color: var(--muted); }
.off-list { color: var(--amber-ink); font-weight: 700; }

/* ---- Calling: green for a callable number, amber when the hours or the lists ask for care ---------------------- */
.button.call { background: var(--green); border-color: var(--green); color: #fff; }
details.hours > summary.button { background: var(--amber-fill); border-color: var(--amber-fill); color: #3d2a00;
                                 list-style: none; }
details.hours > summary.button::-webkit-details-marker { display: none; }
details.hours .warning { margin: 0.5rem 0 0; }
.number-amber .button.call { background: var(--amber-fill); border-color: var(--amber-fill); color: #3d2a00; }

/* ---- Search (P2-007) ------------------------------------------------------------------------------------------ */
input[type="search"] { width: 100%; min-height: 44px; font-size: 1rem; font-family: inherit; padding: 0.55rem 0.75rem;
                       border: 1.5px solid var(--field-line); border-radius: 10px; }
.points-to { margin-top: 0.5rem; border-left: 3px solid var(--line); padding-left: 0.75rem; }
.points-to .card { margin-bottom: 0; }

/* ---- The lead page (P2-009): the story, the contacts, the property ------------------------------------------- */
.next-lead { display: flex; gap: 0.5rem; margin: 0 0 0.75rem; }
.next-lead .button { flex: 1; margin: 0; }
section[aria-label="What it is"] > p { margin: 0 0 0.3rem; }
section[aria-label="What it is"] .band { margin-left: 0; }
section[aria-label="What it is"] .address { font-size: 1.125rem; }
.call-line { margin: 0.25rem 0 0.5rem; }
.person { padding: 0.5rem 0; border-top: 1px solid var(--line2); }
.person:first-of-type { border-top: 0; }
.person p { margin: 0 0 0.2rem; }
.assigned { color: var(--muted); }
.line { padding: 0.45rem 0; border-bottom: 1px solid var(--line2); }
.line:last-child { border-bottom: 0; }
.line p { margin: 0 0 0.2rem; }
.line.on-record { opacity: 0.6; }
.timeline .line { position: relative; padding: 0 0 0.75rem 1.25rem; border: 0; }
.timeline .line::before { content: ""; position: absolute; left: 0; top: 0.35rem; width: 0.75rem; height: 0.75rem;
                          border-radius: 50%; background: var(--band-high); }
.timeline .line::after { content: ""; position: absolute; left: 0.3rem; top: 1.25rem; bottom: 0.1rem; width: 2px;
                         background: #cfd5d1; }
.timeline .line:last-child::after { display: none; }
.timeline .line.on-record { opacity: 1; color: #7f8985; }
.timeline .line.on-record::before { background: #c0c6c2; }
.maps { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.maps .button { flex: 1 1 auto; margin: 0.5rem 0 0; }
/* "Why this score" (P2-015): it opens in the page itself, no request and no script */
.why-score summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--primary);
                     font-weight: 680; }
.score-line { display: flex; justify-content: space-between; gap: 0.75rem; margin: 0 0 0.25rem; }
.score-line.total { border-top: 1px solid var(--line); padding-top: 0.25rem; }
/* Work on a lead (phase 3): the hide, the status, the notes and history, the picker, the selection's bar */
.work summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.work select, .card select, .select-bar select { width: 100%; min-height: 44px; font-size: 1rem; font-family: inherit;
       padding: 0.5rem; border: 1.5px solid var(--field-line); border-radius: 10px; background: var(--paper);
       color: var(--ink); }
.history .line.note p:last-of-type { white-space: normal; }
textarea { width: 100%; min-height: 88px; font-size: 1rem; padding: 0.55rem 0.75rem;
           border: 1.5px solid var(--field-line); border-radius: 10px; font-family: inherit; }
.row-button { width: 100%; justify-content: flex-start; margin: 0; border: 0; border-bottom: 1px solid var(--line2);
              border-radius: 0; }
.row-button.current { font-weight: 700; color: var(--primary); }
.choice .button.primary { margin-top: 0.5rem; }
/* The selection's bar (P3-006; plan 3.3: "A bottom bar then shows"; 3.1: the main action at the bottom, within a
   thumb's reach): fixed just above the bottom menu whatever the scroll, its actions opening upward inside the
   screen; .select-room keeps room for it under the last card while selecting. The demo's dark bar. */
.select-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--menu-height) + 0.5rem); width: calc(100% - 2rem);
              max-width: 42rem; max-height: 70vh; overflow-y: auto; margin: 0 auto; z-index: 5;
              background: var(--band-high); color: #fff; border-color: var(--band-high);
              box-shadow: 0 0.25rem 1rem rgba(27, 31, 36, 0.3); }
.select-bar p { margin: 0 0 0.5rem; }
.select-bar a { color: #9cc0ff; font-weight: 700; }
.select-bar label { color: #fff; }
.select-bar .button { background: #e8ebe7; border-color: #e8ebe7; color: var(--ink); }
.select-bar .button.danger { background: var(--red); border-color: var(--red); color: #fff; }
.select-bar .notice { color: #123c8d; }
.select-bar summary { color: #fff; }
.select-room { height: 14rem; }
.select-toggle { margin: 0; }
.select-toggle .button { margin: 0; min-height: 44px; }
.select-button.selected { background: var(--primary); border-color: var(--primary); color: #ffffff; }
input[type="date"] { width: 100%; min-height: 44px; font-size: 1rem; font-family: inherit; padding: 0.5rem 0.75rem;
                     border: 1.5px solid var(--field-line); border-radius: 10px; }
.today-box dt a:hover { color: var(--primary); }
/* The contact cards (P4-010, P4-011; plan 4.7): a number's colour in its state line, the warning in its own words. */
.contact { padding: 0.25rem 0 0.5rem; border-bottom: 1px solid var(--line); }
.contact:last-of-type { border-bottom: 0; }
.contact p { margin: 0 0 0.25rem; }
.contact-top { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.contact-top .chip:first-of-type { margin-left: auto; }
.number { margin: 0; padding: 0.6rem 0 0.55rem; border-top: 1px solid var(--line2); }
.number p { margin: 0 0 0.25rem; }
.number strong { font-size: 1.0625rem; font-weight: 720; }
.number .dnc { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; font-weight: 580; }
.number-green .dnc { color: var(--green); }
.number-amber .dnc { color: var(--amber-ink); }
.number-red .dnc, .number-opted_out .dnc { color: var(--red); font-weight: 700; }
/* a row of buttons fills a phone-wide card; on a wide card it stops at 32rem rather than stretch each button */
.number .actions { display: flex; flex-wrap: wrap; gap: 0.4rem; max-width: 32rem; }
.number > details { max-width: 32rem; }  /* the same for its [ Opted out ], [ Show ] and out-of-hours [ Call ] */
.number .actions .button, .email .actions .button { flex: 1 1 auto; margin-top: 0.25rem; padding: 0.4rem 0.6rem; }
.number details > summary.button { margin-top: 0.25rem; }
.check-tick { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0 0 0 auto; font-weight: 680;
              color: var(--primary); min-height: 44px; }
.try-first { background: var(--primary); color: #ffffff; border-color: var(--primary); }
.test-stamp { background: var(--red); color: #ffffff; border-color: var(--red); }
details.show summary, details.opt-out summary { list-style: none; }
details.show summary::-webkit-details-marker, details.opt-out summary::-webkit-details-marker { display: none; }
.lists-checked { margin-top: 0.75rem; }
.email { padding: 0.5rem 0 0.25rem; border-top: 1px solid var(--line2); }
.email p { overflow-wrap: anywhere; }  /* a long address breaks inside a narrow card, never runs out of it */
form.marks { display: flex; flex-wrap: wrap; gap: 0.4rem; max-width: 32rem; }
form.marks .button { flex: 1 1 auto; margin-top: 0.25rem; }
.check-form { display: flex; flex-wrap: wrap; gap: 0.4rem; max-width: 32rem; }
.check-form .button { flex: 1 1 auto; }
/* "How did the call go?" (P4-013): a sheet at the bottom, within a thumb's reach, over the bottom menu. */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 85vh; overflow-y: auto; background: var(--paper);
         border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 0.5rem 1rem 1.25rem; z-index: 20;
         box-shadow: 0 -0.5rem 2rem rgba(13, 20, 24, 0.35); }
.sheet::before { content: ""; display: block; width: 44px; height: 5px; margin: 0.25rem auto 0.75rem;
                 border-radius: 3px; background: #c9ceca; }
.sheet h2 { margin-top: 0; }
form.marks .button { margin-top: 0.25rem; }
/* The run and check sheets, in the page */
.run-sheet, .check-sheet, .run-progress, .check-status { border-color: var(--primary); border-width: 1.5px; }
.run-sheet .cost, .run-sheet .cost strong { font-size: 1.25rem; font-weight: 720; }
.run-sheet .actions, .check-sheet .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.run-sheet .actions form, .check-sheet .actions form { flex: 1 1 auto; }
.run-sheet .actions .button, .check-sheet .actions .button { width: 100%; }
.warnings { padding-left: 1.1rem; }
.said { background: var(--green-bg); border-color: transparent; color: #0a5d3a; font-weight: 600; }
/* The property data panel (P4-016): the images keep their set size's shape on a narrow screen. */
.images { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.images img { max-width: 100%; height: auto; border-radius: 10px; }
.on-market { display: flex; gap: 0.5rem; background: var(--red-bg); border: 1px solid var(--red-line); color: #8d1a11;
             padding: 0.55rem 0.65rem; border-radius: 10px; font-weight: 700; }
/* label | value rows: a label stays on one line while there is room and wraps before its value would be pushed
   out of a narrow column; on a wide card the rows stop at 30rem, so that a value stays near its label */
dl.facts { display: grid; grid-template-columns: minmax(min-content, max-content) minmax(min-content, 1fr); gap: 0;
           max-width: 30rem; margin: 0 0 0.5rem; }
dl.facts dt { color: var(--muted); padding: 0.4rem 0.6rem 0.4rem 0; border-top: 1px solid var(--line2); }
dl.facts dd { margin: 0; padding: 0.4rem 0; text-align: right; font-weight: 560; border-top: 1px solid var(--line2); }
dl.facts dt:first-of-type, dl.facts dd:first-of-type { border-top: 0; }
/* Credits (P5-016): the gauge's figures as rows, the lists by day, source, category and person as rows */
dl.gauge { display: grid; grid-template-columns: 1fr auto; max-width: 30rem; margin: 0.5rem 0 0; }
dl.gauge ~ .bar-words, dl.gauge ~ .gauge-meter { max-width: 30rem; }
dl.gauge dt { color: var(--muted); padding: 0.4rem 0; border-top: 1px solid var(--line2); }
dl.gauge dd { margin: 0; padding: 0.4rem 0; text-align: right; font-weight: 680; border-top: 1px solid var(--line2); }
dl.gauge dt:first-of-type, dl.gauge dd:first-of-type { border-top: 0; }
dl.gauge dd:first-of-type { font-size: 1.6rem; font-weight: 760; line-height: 1.1; }
/* The Credits screen's charts (final-design.txt): bars as <meter> elements and an SVG whose sizes are its own
   attributes, so the page's policy (no style=) holds; the figures stay in the lists under "By day", "By source"... */
.bar-words { margin: 0.75rem 0 0; font-weight: 620; }
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; margin: 0 0 0.5rem; }
.chart-legend .muted { margin-left: auto; }
.key { display: inline-flex; align-items: center; gap: 0.4rem; }
.key::before { content: ""; width: 0.8rem; height: 0.8rem; border-radius: 3px; background: var(--series-1); }
.key-hand::before { background: var(--series-2); }
.day-chart { display: block; width: 100%; height: 9rem; border-bottom: 1px solid #aeb6b2; }
.bar-auto { fill: var(--series-1); }
.bar-hand { fill: var(--series-2); }
.day-chart g:hover rect { opacity: 0.75; }
.chart-ends { display: flex; justify-content: space-between; margin: 0.25rem 0 0.5rem; }
.hbars { display: grid; gap: 0.6rem; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.75rem; }
.hbar .hbar-meter { grid-column: 1 / -1; }
.hbar > span { overflow-wrap: anywhere; }  /* a long name wraps in a narrow column, never under its figure */
.page details > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 640; }
.card ul { margin: 0; padding: 0; list-style: none; }
.card ul > li { padding: 0.4rem 0; border-top: 1px solid var(--line2); }
.card ul > li:first-child { border-top: 0; }
.card ul.codes, .card ul.warnings { list-style: disc; padding-left: 1.25rem; }
.card ul.codes > li, .card ul.warnings > li { border-top: 0; padding: 0.1rem 0; }
.bell-list { margin: 0.75rem 0 0; padding: 0; list-style: none; }
.bell-list .unread { border-left: 4px solid var(--primary); }
.auto-row { display: grid; grid-template-columns: 1fr; padding: 0.5rem 0; border-top: 1px solid var(--line2); }
.auto-row:first-child { border-top: 0; }
fieldset.card { min-width: 0; }
legend { font-weight: 700; padding: 0 0.25rem; }
.error-card h1 { margin-top: 0; }

/* The Postcards preview (P7b-003): a side of the card at the width of the screen, its own shape */
.postcard-preview { display: block; width: 100%; max-width: 100%; height: auto; border: 0; margin-block: 8px 16px; }
.postcard-preview.preview-4x6 { aspect-ratio: 1800 / 1200; }
.postcard-preview.preview-6x9 { aspect-ratio: 2700 / 1800; }
.postcard-preview.preview-6x11 { aspect-ratio: 3300 / 1800; }

/* ---- The desktop (plan 3.1: "the same pages with more columns"; the demo's chapter 27): the dark rail on the left
   instead of the bottom menu, the status line as the top bar, wider pages. A list of cards in two columns, in the
   list's own order row by row, its other parts (a heading, "Show more") across both. ----------------------------- */
@media (min-width: 60rem) {
  body:has(> .rail) { padding-left: var(--rail-width); }
  .rail { display: flex; flex-direction: column; gap: 2px; position: fixed; left: 0; top: 0; bottom: 0;
          width: var(--rail-width); padding: 1rem 0.6rem; overflow-y: auto; background: var(--rail);
          color: var(--rail-ink); z-index: 15; }
  .bottom-menu { display: none; }
  #status-line { position: sticky; top: 0; z-index: 12; justify-content: flex-end; padding: 0.6rem 1.5rem; }
  .gauge-box { flex: 0 1 20rem; }
  #status-line .bell-line { margin-left: 0; }
  .not-done-line form { flex: none; }
  .not-done-line .button { width: auto; min-width: 10rem; }
  .page { max-width: 48rem; padding: 1.25rem 1.5rem 3rem; }
  body:has(> .rail) .page { margin: 0; }
  .page.wide { max-width: 100rem; }
  .list-page > form.card, .list-page > .card:not(.lead-card):not(.not-done):not(.today-box):not(.filters) {
    max-width: 44rem; }
  .button.primary { width: auto; }
  .run .button, .call-line .button, .lead-card .hours > summary.button, .more .button,
  .filters:not([open]) + .select-start .button { width: 100%; }
  .filters:not([open]) { width: auto; min-width: 9rem; margin-right: 0.5rem; }
  .filters:not([open]) + .select-start { float: left; width: auto; min-width: 9rem; }
  .today-box dl { grid-template-columns: repeat(4, minmax(0, 12rem)); column-gap: 0.6rem; }
  .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 0.75rem;
           grid-auto-flow: row dense; align-items: start; }
  .cards > :not(.lead-card) { grid-column: 1 / -1; }
  .more .button { max-width: 24rem; }
  .select-bar { left: var(--rail-width); bottom: 1rem; }
  .message-bar { left: var(--rail-width); bottom: 1rem; max-width: 40rem; }
  .sheet { left: calc(var(--rail-width) + 1.5rem); right: auto; bottom: 1rem; width: 32rem;
           border: 1px solid var(--line); border-radius: 20px; }
  html { scroll-padding-top: 7rem; }  /* a jump within a page (#budget) lands below the sticky top bar */
  .status-paused { flex-basis: calc(100% + 3rem); margin: -0.6rem -1.5rem 0; padding: 0.55rem 1.5rem; }
  #run-sheet > *, .next-lead { max-width: 44rem; }  /* a sheet and its two buttons, not the wide page's width */
}
/* A wide desktop: the lead page in three columns (the story, the contacts, the property), the Credits screen's
   cards in columns. */
@media (min-width: 75rem) {
  .lead-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1fr); gap: 0.9rem;
               align-items: start; }
  .lead-col .cards { display: block; }
  .page.credits-page { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 0.9rem;
                       align-items: start; }
  .page.credits-page > :not(section) { grid-column: 1 / -1; }
}
/* A laptop and wider (75rem, 1200 px): Today, My leads, the work lists, search and Recently hidden as the demo's table
   (chapter 27), every column. The cards' cells line up in shared columns (CSS subgrid) under the header row
   (leads/cards_head.html); the cards that "Show more" adds go into the same columns. Where the screen is narrower than
   the table, the table scrolls sideways inside its own box (the owner's choice: final-design.txt), the page itself
   never does, and the action column stays held at the box's right edge. Narrower desktops keep two columns of cards. */
@media (min-width: 75rem) {
  .list-page .cards { grid-template-columns: [select] auto [band] auto [what] minmax(8.5rem, 1.1fr)
                        [deadline] minmax(6rem, 0.7fr) [address] minmax(9rem, 1.2fr) [why] minmax(10rem, 2fr)
                        [value] auto [phones] auto [data] auto [work] minmax(5.5rem, 8rem) [assigned] minmax(5rem, 8rem)
                        [act] minmax(9.5rem, 11rem) [end];
                      column-gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
                      overflow-x: auto; margin-bottom: 0.75rem; }
  .list-page .cards > .cards-head, .list-page .cards > .lead-card { display: grid; grid-column: 1 / -1;
                                                                     grid-template-columns: subgrid; }
  .list-page .cards > .cards-head { background: #fafbf9; border-bottom: 2px solid var(--line); color: var(--ink2);
                                    font-weight: 640; line-height: 1.2; }
  .list-page .cards > .cards-head:not(:has(~ .lead-card)) { display: none; }
  .list-page .cards > .lead-card { margin: 0; padding: 0; gap: 0; align-items: start; border: 0; border-radius: 0;
                                   border-bottom: 1px solid var(--line2); background: var(--card); }
  .list-page .cards > .lead-card:hover, .list-page .cards > .lead-card:hover > .cell-act { background: #fafbf9; }
  .list-page .cards > .cards-head > span,
  .list-page .cards > .lead-card > .cell { display: block; grid-row: 1; min-width: auto; padding: 0.55rem 0.6rem; }
  .list-page .cards > .lead-card > .cell .table-only { display: block; }
  .list-page .cards > * > .cell-select { grid-column: select / span 1; }
  .list-page .cards > * > .cell-band, .list-page .cards > * > .head-band { grid-column: band / span 1; min-height: 0; }
  .list-page .cards > * > .cell-what, .list-page .cards > * > .head-what { grid-column: what / span 1; }
  .list-page .cards > * > .cell-deadline, .list-page .cards > * > .head-deadline { grid-column: deadline / span 1; }
  .list-page .cards > * > .cell-address, .list-page .cards > * > .head-address { grid-column: address / span 1; }
  .list-page .cards > * > .cell-why, .list-page .cards > * > .head-why { grid-column: why / span 1; }
  .list-page .cards > * > .cell-value, .list-page .cards > * > .head-value { grid-column: value / span 1;
                                                                             white-space: nowrap; }
  .list-page .cards > * > .cell-phones, .list-page .cards > * > .head-phones { grid-column: phones / span 1; }
  .list-page .cards > * > .cell-data, .list-page .cards > * > .head-data { grid-column: data / span 1; }
  .list-page .cards > * > .cell-work, .list-page .cards > * > .head-work { grid-column: work / span 1; }
  .list-page .cards > * > .cell-assigned, .list-page .cards > * > .head-assigned { grid-column: assigned / span 1; }
  .list-page .cards > * > .cell-act, .list-page .cards > * > .head-act { grid-column: act / span 1; position: sticky;
                                                                         right: 0; z-index: 1;
                                                                         box-shadow: -1px 0 0 var(--line2); }
  .list-page .cards > .lead-card > .cell-act { background: var(--card); }
  .list-page .cards > .cards-head > .head-act { background: #fafbf9; }
  .list-page .cards > .lead-card > .points-to { grid-row: 2; grid-column: what / end; margin: 0 0.6rem 0.6rem; }
  .list-page .cards > .more { padding: 0.75rem; text-align: left; }
  .list-page .cards > .more .button { margin: 0; }
  .list-page .cards > p.card { margin: 0.75rem; }
  .list-page .cards > .lead-card > .cell .value-words, .list-page .cards > .lead-card > .cell .cell-words {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .list-page .cards > .lead-card > .cell .value strong { font-weight: 560; }
  .list-page .cards > .lead-card > .cell .countdown::before { display: none; }
  .list-page .cards > .lead-card > .cell-act .button { width: 100%; margin: 0; min-height: 44px;
                                                      padding: 0.35rem 0.6rem; }
  .list-page .cards > .lead-card > .cell-act .run .notice,
  .list-page .cards > .lead-card > .cell-act .run .warning { margin: 0; }
  .list-page .cards > .lead-card > .cell-act details.hours .warning { margin-top: 0.35rem; }
}
