/* hive-refine.css – the understated-luxury pass on both portals (Resident Portal and Admin Panel), 2026-10-22.
   Loaded LAST by both headers (after portal-extras.css). A refinement only: the palette (including the user-approved
   warm near-black Dark theme), the logo, layouts, routes and every control stay exactly as they are. It settles:
     · one shape scale (corners) instead of 20–26px "bubble" cards
     · neutral elevation instead of orange glows; the orange stays for the one main action and the active page
     · the sidebar's "More" button sitting on top of the last menu item
     · one focus ring, themed text selection and caret, tabular numbers in data
   Motion uses the tokens from hive-ui.css (--hu-ease-out, --hu-t-*). High contrast (html.hc) keeps its own rules.
   Remove the <link> in both includes/header.php files to switch it all off. */

:root, [data-theme="dark"], [data-theme="light"] {
  --r: 14px;          /* cards, panels (was 20px) */
  --r-lg: 18px;       /* large cards, stat cards (was 24px) */
  --r-sm: 10px;       /* inputs, chips, small controls */
  --hr-elev: 0 1px 2px rgba(0,0,0,.25), 0 14px 32px -22px rgba(0,0,0,.7);
}
[data-theme="light"] { --hr-elev: 0 1px 2px rgba(23,20,15,.05), 0 14px 32px -24px rgba(23,20,15,.25); }

/* ---------- the sidebar's "More" button: its own row under the menu, never on top of an item ---------- */
.sb-more { margin: 4px auto 8px !important; }
.sb-more:not(.show) { display: none !important; }

/* ---------- one set of shapes ---------- */
.modal { border-radius: 20px; }
.dropdown-menu { border-radius: 14px; }
.tabs { border-radius: 14px; }
.fi, .form-control, select.fi, textarea.fi { border-radius: var(--r-sm); }

/* ---------- depth: neutral, never an orange halo ---------- */
.btn-rust:hover, .btn-primary:hover, .btn-accent:hover { box-shadow: 0 8px 18px -12px rgba(0,0,0,.6) !important; }
.content a.ad-kpi:hover, .content a.building-stat-card:hover, .content a.rd-kpi:hover { box-shadow: var(--hr-elev) !important; }
html[data-theme="dark"]:not([data-tone]):not(.hc) .tx-card[aria-pressed="true"] {
  box-shadow: 0 0 0 1px var(--brand, #FF8A00), 0 18px 40px -22px rgba(0,0,0,.8) !important;
}
html[data-theme="dark"]:not([data-tone]):not(.hc) .marketplace-category-tab.on { box-shadow: none; }

/* ---------- reading and data ---------- */
.content h1, .content h2, .content h3, .modal h2, .modal h3 { text-wrap: balance; }
.content p, .modal p { text-wrap: pretty; }
.tbl td, .tbl th, .content table td, .content table th, .stat-card b, .stat-card strong { font-variant-numeric: tabular-nums; }

/* ---------- browser surfaces carry the brand ---------- */
::selection { background: rgba(var(--brand-rgb, 255,138,0),.30); color: inherit; }
input, textarea { caret-color: var(--accent); }
:where(a, button, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent2, #FFB25C); outline-offset: 2px; }

/* ---------- motion: brief and natural (tokens from hive-ui.css) ---------- */
.card, .stat-card, .dropdown-menu .dropdown-item, .sb-item {
  transition-timing-function: var(--hu-ease-out, cubic-bezier(.23, 1, .32, 1));
}

/* ---------- high contrast: its own strong rules stay in charge ---------- */
html.hc ::selection { background: var(--hc-link, #ffd400); color: #000; }

/* ---------- one solid orange action per screen ----------
   The page's main action (e.g. "+ Add Owner") keeps the solid orange. Secondary actions and selected filters become
   outlined / tinted orange, so the eye lands on one thing. Nothing is hidden or moved. */
/* the search button inside a search field */
html:root .content .pp-search .btn.btn-rust {   /* (as specific as the Dark theme's button rule) */
  background: transparent !important; color: var(--accent2) !important; border: 1px solid rgba(var(--brand-rgb, 255,138,0),.5) !important; box-shadow: none !important;
}
html:root .content .pp-search .btn.btn-rust:hover { background: var(--accent-dim) !important; border-color: var(--accent) !important; }
/* the per-row "Properties" button on Owners / Tenants / Non-residents */
.content .pp-main { background: transparent; color: var(--accent2); border: 1px solid rgba(var(--brand-rgb, 255,138,0),.5); font-weight: 700; }
.content .pp-main:hover { background: var(--accent-dim); border-color: var(--accent); filter: none; }
/* selected filter and sort chips: tinted, not solid */
.content .pp-chips a.on, .content .pp-sort a.on, .content .tx-chips a[aria-current="true"] {
  background: var(--accent-dim); border-color: rgba(var(--brand-rgb, 255,138,0),.55); color: var(--accent2);
}
html:root[data-theme="light"] .content .pp-search .btn.btn-rust, [data-theme="light"] .content .pp-main,
[data-theme="light"] .content .pp-chips a.on, [data-theme="light"] .content .pp-sort a.on, [data-theme="light"] .content .tx-chips a[aria-current="true"] { color: #9A4A05 !important; }
html.hc .content .pp-main, html.hc .content .pp-chips a.on, html.hc .content .pp-sort a.on { border-width: 2px; }
/* the dashboard welcome card: "Pay bills" stays solid, "Browse units" is the quiet second option */
html:root .welcome-card .btn.btn-ghost, html:root .welcome-card a.btn.btn-ghost {
  background: rgba(8,9,11,.35) !important; color: #fff !important; border: 1px solid rgba(255,255,255,.4) !important; box-shadow: none !important;
}
html:root .welcome-card .btn.btn-ghost:hover { border-color: var(--accent) !important; color: var(--accent-bright, #FFD29A) !important; }

/* ---------- Transaction history filters on a phone: an even two-column grid, not a ragged wrap ---------- */
@media (max-width: 720px) {
  .content .tx-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end; }
  .content .tx-bar > * { min-width: 0; }
  .content .tx-bar .grow, .content .tx-bar .fl:has(#tx-g) { grid-column: 1 / -1; }
  .content .tx-bar .fi { width: 100%; }
  .content .tx-bar > .btn, .content .tx-bar > a.btn { width: 100%; justify-content: center; }
}

/* ---------- one solid orange per screen, across the Admin Panel (approved 2026-10-22) ----------
   Repeated per-row / per-card actions and toolbar "Apply / Filter" buttons are outlined; the page's main action
   (+ New bill, + New Lease, + Add Lead…) and each form's own Save stay solid. Same buttons, same places. */
html:root .content :is(.dc-acts, .property-card .card-actions, .nt-side, .filter-bar .btn-group, .al-actions, .ls-bulk .ls-acts) .btn.btn-rust,
html:root .content .pc-actions .pc-btn.next {
  background: transparent !important; color: var(--accent2) !important; border: 1px solid rgba(var(--brand-rgb, 255,138,0),.5) !important; box-shadow: none !important;
}
html:root .content :is(.dc-acts, .property-card .card-actions, .nt-side, .filter-bar .btn-group, .al-actions, .ls-bulk .ls-acts) .btn.btn-rust:hover,
html:root .content .pc-actions .pc-btn.next:hover { background: var(--accent-dim) !important; border-color: var(--accent) !important; }

/* selected tabs and sub-page switches: tinted, not solid (they say "you are here", not "do this") */
html:root .content :is(.tab.on, .tab.active, .hx-tab[aria-selected="true"]),
html:root .content a.on:not(.btn):not(.pp-main) {
  background: var(--accent-dim) !important; color: var(--accent2) !important; border-color: rgba(var(--brand-rgb, 255,138,0),.55) !important; box-shadow: none !important;
}
html:root[data-theme="light"] .content :is(.tab.on, .tab.active, .hx-tab[aria-selected="true"]),
html:root[data-theme="light"] .content a.on:not(.btn):not(.pp-main),
html:root[data-theme="light"] .content :is(.dc-acts, .property-card .card-actions, .nt-side, .filter-bar .btn-group, .al-actions, .ls-bulk .ls-acts) .btn.btn-rust,
html:root[data-theme="light"] .content .pc-actions .pc-btn.next { color: #9A4A05 !important; }

/* the last oversized corners: tab strips, filter bars, permission cards */
html:root .content :is(.tabs, .filter-bar, .pm-card) { border-radius: 14px; }

/* more "you are here" switches, tinted the same way: Audit Log tabs, Permissions sub-pages, the Account recovery
   "With authenticator / All accounts" switch, Pipeline Board / List, Site Media categories */
html:root .content :is(.al-tabs a[aria-current="page"], .al-tabs a[aria-current="true"], .pm-nav a[aria-current="page"], .pm-nav a[aria-current="true"],
                       .rc-af a[aria-current="true"], .pl-seg [aria-pressed="true"], .sm-cats [aria-pressed="true"]) {
  background: var(--accent-dim) !important; color: var(--accent2) !important; border-color: rgba(var(--brand-rgb, 255,138,0),.55) !important; box-shadow: none !important;
}
/* Site Media: "Add to the page" repeats on every group – outlined */
html:root .content .sm-actions .sm-btn.primary { background: transparent !important; color: var(--accent2) !important; border: 1px solid rgba(var(--brand-rgb, 255,138,0),.5) !important; }
html:root .content .sm-actions .sm-btn.primary:hover { background: var(--accent-dim) !important; }
html:root[data-theme="light"] .content :is(.al-tabs a[aria-current], .pm-nav a[aria-current], .rc-af a[aria-current="true"], .pl-seg [aria-pressed="true"], .sm-cats [aria-pressed="true"], .sm-actions .sm-btn.primary) { color: #9A4A05 !important; }
/* the remaining 20–22px corners: dashboard tiles, landing editor and site media panels */
html:root .content :is(.ad-kpi, .lp-nav, .lp-panel, .smx-side, .sm-group) { border-radius: 14px; }

/* ---------- Resident Portal: the same rules ----------
   selected tabs / chips tinted (Billing payment tabs, Towers unit-type chips); the Transaction history "Filter" outlined
   (the list itself is the point of that page); toggles stay solid orange because orange there means "on". */
html:root .content :is(.pay-tabs [aria-selected="true"], .pay-tabs .on, .tx-filters [aria-pressed="true"]) {
  background: var(--accent-dim) !important; color: var(--accent2) !important; border-color: rgba(var(--brand-rgb, 255,138,0),.55) !important; box-shadow: none !important;
}
html:root .content .tx-bar .btn.btn-rust { background: transparent !important; color: var(--accent2) !important; border: 1px solid rgba(var(--brand-rgb, 255,138,0),.5) !important; box-shadow: none !important; }
html:root .content .tx-bar .btn.btn-rust:hover { background: var(--accent-dim) !important; }
html:root[data-theme="light"] .content :is(.pay-tabs [aria-selected="true"], .pay-tabs .on, .tx-filters [aria-pressed="true"], .tx-bar .btn.btn-rust) { color: #9A4A05 !important; }
/* the remaining 20–22px corners */
html:root .content :is(.rd-card, .tx-plan, .tx-wrap, .tx-media, .marketplace-category-tabs) { border-radius: 14px; }
html:root .content .card { border-radius: var(--r); }

/* ---------- pop-ups: the same corner scale (forms, terms, document viewer, confirm dialogs) ---------- */
html:root .modal-overlay .modal, html:root .terms-box, html:root .dv, html:root .hd-box { border-radius: 18px; }
html:root .hd-ico { border-radius: 10px; }

/* ---------- second pass (2026-10-22, from the premium-redesign brief): calm surfaces, legible photos ---------- */
/* Resident dashboard tower cards: the shade starts higher, so the small white line reads on bright facades */
html:root .rd-tower::after { background: linear-gradient(180deg, rgba(8,9,11,.08) 0%, rgba(8,9,11,.5) 45%, rgba(8,9,11,.9) 100%); }
html:root .rd-tower span:last-child { opacity: 1; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
/* About The Hive: the solid orange banner becomes a quiet panel – the orange stays for actions */
html:root .about-hero { background: var(--card); border: 1px solid var(--border); color: var(--ink); text-align: left; padding: clamp(28px, 4vw, 44px) clamp(22px, 4vw, 40px); }
html:root .about-hero h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -.01em; }
html:root .about-hero p { max-width: 60ch; color: var(--ink2); }
/* section headings on About: no coloured stripe down the side */
html:root .info-card h3 { border-left: 0; padding-left: 0; color: var(--ink); }
/* touch screens: the pager, per-page choice and tab-row arrows keep their size but get a 44px tall tap area */
@media (pointer: coarse) {
  html:root .hv-pg, html:root .hv-per { position: relative; }
  html:root .hv-pg::after, html:root .hv-per::after, html:root .hu-rail-btn::after { content: ""; position: absolute; inset: -8px -1px; }
}

/* ---------- third pass (2026-10-22, code review of the signed-in pages) ---------- */
/* small print never drops below 11px (16px base): notes, tags, table heads and dates were 9–10.5px */
html:root :is(.mop-default, .pay-k, .pay-payee > span:first-child, .proof-for, .proof-zone kbd, .rd-date small, .rd-facts dt,
  .card-img-note, .by-owner, .notif-time, .notif-mark button, .setting-note, .notif-tag, .pu-tag,
  .ad-date span, .ad-act .badge, .ad-kpi-l, .rp-type, .pr-tbl th, .hx-tag, .lp-pic-tag, .card-img .tower-photo-note,
  .card-badge .badge, .ls-cover, .rc-tbl th, .rc-dd .rc-dd-h, .pm-role .pm-dirty, .pm-custom, .pc-src, .pl-menu h6, .pp-new) { font-size: .6875rem; }
html:root .pay-steps li::before, html:root .rec-table td::before { font-size: .6875rem; }
/* notes and pop-up headings: a tinted panel or plain heading, not a coloured stripe down the side
   (section titles and warning banners keep theirs: those are part of each theme) */
html:root :is(.mr-note, .pp-note, .ol-req .reply, .or-notes) { border: 1px solid rgba(var(--brand-rgb, 255,138,0),.28); }
html:root .modal-section h4 { border-left: 0; padding-left: 0; }
html:root .ca-item { border-left: 1px solid var(--border, rgba(255,255,255,.08)); }
/* text fields that only changed a 1px border on focus get the same visible ring as the rest of the portal */
html:root :is(.hx-search input, .hx-field input, .hx-field textarea, .hx-field select, .pm-input, .sm-field input[type=text]):focus-visible {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 255,138,0),.22);
}
/* pale yellow status pills were drawn for the light theme only: tinted on the dark themes */
html:not([data-theme="light"]) :is(.res-badge, .op-row .st) { background: var(--accent-dim, rgba(var(--brand-rgb, 255,138,0),.12)); color: var(--accent2, #ffb25c); }

/* ---------- smaller, calmer type (user request 2026-10-23: "the fonts are too big, even on mobile") ----------
   One role scale for both portals. Big things come down (headings, dashboard numbers, desktop inputs) and heavy
   800 weights become 600/700 – heavy type reads larger than it is. The smallest labels go UP to 11px so they stay
   readable. On phones, inputs stay 16px: iPhones zoom the whole page in when a field under 16px is tapped.
   Larger text ("Aa") still scales everything up for whoever turns it on. */
:root {
  --ty-title: 1.0625rem;   /* page heading            17px */
  --ty-section: .9375rem;  /* section / card heading  15px */
  --ty-body: .8125rem;     /* body text               13px */
  --ty-small: .75rem;      /* secondary text          12px */
  --ty-label: .6875rem;    /* labels, table headers   11px (the floor) */
}
html:root .content h1, html:root .ad-h1, html:root .pg-title { font-size: var(--ty-title) !important; font-weight: 700; letter-spacing: -.01em; }
html:root .content h2, html:root .rd-hero h1 { font-size: var(--ty-section) !important; font-weight: 700; }
html:root .content h3, html:root .modal-title, html:root .modal h2, html:root .modal h3 { font-size: .875rem !important; font-weight: 700; }
html:root .content p { font-size: var(--ty-body); line-height: 1.6; }
/* buttons and links: same size, lighter weight */
html:root .content .btn, html:root .modal .btn { font-weight: 700; }
/* labels, table headers, badges, sidebar section names: up to the 11px floor, less shouting */
html:root .content th, html:root .tbl th { font-size: var(--ty-label) !important; font-weight: 700 !important; letter-spacing: .05em; }
html:root .content :is(.rc-pill, .badge, .pm-sign, .tx-pill, .sb-count) { font-size: var(--ty-label) !important; font-weight: 700; }
html:root .sb-section, html:root .sb-section .sb-sec-btn { font-size: var(--ty-label); font-weight: 700; }
html:root .sb-role { font-weight: 700; }
/* dashboard numbers */
html:root .ad-kpi-v, html:root .rd-kpi b, html:root .stat-number { font-size: 1.5rem !important; font-weight: 700 !important; }
html:root .ad-kpi-v.money { font-size: 1.3rem !important; }
/* inputs: 14px with a mouse (desktop); 16px stays on touch screens */
@media (hover: hover) and (pointer: fine) {
  html:root .content :is(.fi, .form-control, input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea), html:root .tb-search input { font-size: .875rem; }
}
/* phones and tablets: one step smaller again */
@media (max-width: 900px) {
  :root { --ty-title: 1rem; --ty-section: .875rem; --ty-body: .8125rem; }
  body { font-size: 13px !important; }
  html:root .content h3, html:root .modal-title { font-size: .8125rem !important; }
  html:root .ad-kpi-v, html:root .rd-kpi b, html:root .stat-number { font-size: 1.25rem !important; }
  html:root .ad-kpi-v.money { font-size: 1.1rem !important; }
  html:root .content .tbl td { font-size: .75rem !important; }
}
/* list names and filter chips: in step with the scale (names 15px/700 → 14px/600, chips 13px/700 → 12px/600) */
html:root .content :is(td b, .pp-who b, .rc-person b, .rc-st-n b) { font-size: .875rem; font-weight: 600; }
html:root .content :is(.pp-chips a, .pp-sort a, .tx-chips a, .al-tabs a, .chip, .fchip, .tab) { font-size: .75rem; font-weight: 600; }
/* the dashboard greeting leads its page: page-title size, not section size */
html:root .rd-hero h1 { font-size: var(--ty-title) !important; }

/* ---------- motion: a saved / refused message arrives instead of popping in (2026-10-23) ----------
   The one moment a form answers back. Short (240ms), from just above; reduced motion keeps only the fade. */
@keyframes hrMsgIn { from { opacity: 0; translate: 0 -6px; } to { opacity: 1; translate: 0 0; } }
@keyframes hrMsgFade { from { opacity: 0; } to { opacity: 1; } }
html:root .content :is(.alert, .hx-flash, .flash, [role="status"].alert) { animation: hrMsgIn 240ms var(--hu-ease-out, cubic-bezier(.23, 1, .32, 1)) both; }
@media (prefers-reduced-motion: reduce) {
  html:root .content :is(.alert, .hx-flash, .flash, [role="status"].alert) { animation: hrMsgFade 160ms ease-out both; }
}

/* ======================================================================================================
   LAYOUT pass (2026-10-23): one spacing rhythm with the smaller type.
   12px between pieces that belong together, 16px under a page's own header, 24px between distinct sections;
   cards 22px inside on computers (the 30px desktop padding made the smaller text float); phones one step tighter.
   Plain `.card` specificity on purpose: cards that are padding-free (tables) keep their own rule.
   ====================================================================================================== */
:root { --sp-tight: 12px; --sp-head: 16px; --sp-section: 24px; }
@media (min-width: 1025px) { .card, .card-lg { padding: 22px; } }
/* Admin dashboard: greeting → tiles close, tiles set apart from the sections below, sections evenly apart */
html:root .ad-hero { margin-bottom: var(--sp-head); }
html:root .ad-kpis { margin-bottom: calc(var(--sp-section) + 4px); gap: var(--sp-tight); }
html:root .ad-row { margin-bottom: 20px; gap: 18px; }
/* Resident dashboard: the same break between the tiles and the sections under them */
html:root .rd-kpis { margin-bottom: var(--sp-section); }
/* list pages: search, filters and the list are one group – tight; the page header sits a step above it */
html:root .content .pp-head { margin-bottom: var(--sp-head); }
html:root .content :is(.pp-search, .pp-filters) { margin-bottom: var(--sp-tight); }
@media (max-width: 900px) {
  :root { --sp-tight: 10px; --sp-head: 12px; --sp-section: 18px; }
  html:root .ad-row { margin-bottom: 14px; gap: 14px; }
}

/* ======================================================================================================
   DELIGHT pass (2026-10-23): the honeycomb cell from The Hive's logo marks the two quiet moments.
   · "Nothing here yet" (empty lists): an empty cell, drawn in the line weight of the icons – calm, not a sad face.
   · "All done" (All paid, All caught up): the cell fills with honey and a check draws itself once (.hive-done).
   No new library, no sound; a reload or a revisit doesn't make it busier, and reduced motion shows the finished
   state at once.
   ====================================================================================================== */
html:root .content :is(.ad-empty, .tx-empty, .bi-empty, .dc-empty, .nt-empty, .al-empty, .hx-empty, .es-empty, .lr-empty, .pl-empty,
                        .sp-empty, .op-empty, .ol-empty, .pm-empty, .pu-empty, td.pp-none):not(.hive-done)::before {
  content: ''; display: block; width: 30px; height: 30px; margin: 0 auto 10px; opacity: .55;
  background: var(--accent2, #FFB25C);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M12 2.6 20.2 7.3v9.4L12 21.4 3.8 16.7V7.3z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M12 2.6 20.2 7.3v9.4L12 21.4 3.8 16.7V7.3z'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* the finished state: honey-filled cell, green check that draws in once */
.hive-done .hi { overflow: visible; }
.hive-done .hx-cell { fill: rgba(var(--brand-rgb, 255,138,0),.16); stroke: var(--accent, #FF8A00); }
.hive-done .hx-tick { stroke: #6EE7B7; stroke-width: 2.2; stroke-dasharray: 12; stroke-dashoffset: 0; }
[data-theme="light"] .hive-done .hx-tick { stroke: #15803D; }
html.hc .hive-done .hx-cell { fill: none; stroke: currentColor; } html.hc .hive-done .hx-tick { stroke: currentColor; }
@keyframes hxTick { from { stroke-dashoffset: 12; } to { stroke-dashoffset: 0; } }
@keyframes hxCell { from { fill-opacity: 0; scale: .9; } to { fill-opacity: 1; scale: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .hive-done .hx-cell { transform-origin: 12px 12px; animation: hxCell 360ms var(--hu-ease-out, cubic-bezier(.23, 1, .32, 1)) both; }
  .hive-done .hx-tick { animation: hxTick 420ms 180ms var(--hu-ease-out, cubic-bezier(.23, 1, .32, 1)) both; }
}
/* where each one sits */
html:root .bl-empty-ico.hive-done { background: none; width: auto; height: auto; }
html:root .bl-empty-ico.hive-done .hi { width: 46px; height: 46px; }
html:root .rd-ic.hive-done { background: rgba(var(--brand-rgb, 255,138,0),.10); }
html:root .ad-empty.hive-done .hi, html:root .nt-empty.hive-done .hi { display: block; width: 34px; height: 34px; margin: 0 auto 10px; }
html:root .ad-empty.hive-done b { display: block; color: var(--ink); margin-bottom: 4px; }

/* ---------- text stays the size it was designed at (user, 2026-10-23: "I have a setting that makes fonts bigger") ----------
   · the base size is fixed at 16px, so a browser's "font size" preference doesn't inflate the rem-based sizes;
   · phones don't "boost" text on their own (Android Chrome font boosting, iOS Safari text inflation).
   Browser zoom (Ctrl +/−, pinch) and the site's own "Aa → Larger text" still enlarge everything for whoever needs it. */
html { font-size: 16px; -webkit-text-size-adjust: 100%; -moz-text-size-adjust: 100%; text-size-adjust: 100%; }

/* ---------- phones (2026-10-23): the content area fits a phone – the sidebar keeps its own size ----------
   The page content (main > .content) is drawn at 87%: text, buttons, padding and pictures shrink together, so a
   screen holds more and the scroll is shorter. Typing fields are enlarged back to 16px on screen, so iPhones don't
   zoom in when one is tapped. Then the few oversized headings, prices and big numbers get a calm phone size,
   photos get a height cap, and rows of filter pills scroll sideways instead of wrapping into several rows. */
@media (max-width: 640px) {
  html:root .content { zoom: .87; }
  html:root .content :is(input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea) {
    font-size: 0.875rem;
    line-height: 1.4;
  }
  html:root .content :is(input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea)::placeholder {
    font-size: 0.8125rem;
    color: var(--ink3);
    opacity: 0.8;
    text-overflow: ellipsis;
  }
  /* "Larger text" (Aa) still works on phones: root font size elevates all rem typography */
  html:root.lg { font-size: 18px !important; }
  html:root.lg .content { zoom: 1 !important; font-size: 1.05rem; }
  html:root.lg .content :is(input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea) { font-size: 1rem !important; }

  /* page headings */
  html:root .content :is(h1, .pm-h1, .hx-h1, .pl-title, .pp-title, .pp-top h2) { font-size: 1.3rem; line-height: 1.25; }
  html:root .content h2 { font-size: 1.15rem; }
  html:root .content :is(h3, .modal-title, .tx-detail h3, .tx-plans-head h3, .ud-info h3, .proof-head h3) { font-size: 1.05rem; }
  /* big numbers and prices */
  html:root .content :is(.pp-sum b, .pp-price b, .card-price, .ud-price, .sc-val, .bl-total b, .pay-big, .rd-kpi b, .pm-stat b, .pl-stat b, .bi-stat b, .stat-number, .rq-out .rq-big) { font-size: 1.25rem; }
  html:root .content .pay-ref-code { font-size: 1.35rem; }

  /* Towers: each tower is a short card – a slim photo, one-line name, small letter tile */
  html:root .content .tx-photo { height: 76px; }
  html:root .content .tx-top strong { font-size: 1rem; white-space: nowrap; }
  html:root .content .tx-letter { width: 34px; height: 34px; font-size: 1rem; border-radius: 10px; }
  html:root .content .tx-floor-title { font-size: 1.05rem; }
  /* photos never take the whole screen */
  html:root .content .rd-tower { min-height: 112px; }
  html:root .content .rd-hero { min-height: 0; }
  html:root .content .pp-photo { min-height: 120px; max-height: 180px; }
  html:root .content :is(.ud-gallery, .ud-main, .uv-stage) img { max-height: 46vh; object-fit: cover; }

  /* filter pills: one row that scrolls sideways */
  html:root .content :is(.bi-tabs, .pp-chips, .pp-sort, .tx-chips, .tx-filters) { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  html:root .content :is(.bi-tabs, .pp-chips, .pp-sort, .tx-chips, .tx-filters) > * { flex: 0 0 auto; white-space: nowrap; }
}

/* ---------- Medium theme: the current page in the sidebar gets its pill too (Dark and Light already had one;
   the Admin Panel's base style hides it, so Medium showed no highlight at all) ---------- */
html[data-tone="medium"]:not(.hc) .sb-item.on { background: rgba(var(--brand-rgb, 255,138,0),.16); color: var(--brand-light, #FFB25C); box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb, 255,138,0),.34); }
html[data-tone="medium"]:not(.hc) .sb-item.on .sb-icon { color: var(--brand-light, #FFB25C); }

/* ---------- Phone check (2026-10-23): small labels no smaller than 11px, client lists as cards ----------
   The labels below were set at .6–.68rem in their own pages (10–10.9px); 11px is the floor everywhere. */
html:root .content :is(.al-filters label, .al-who, .res-badge, td [style*="font-size:0.67rem"], .filter-group label, .card-actions .btn-sm,
  .pc-new, .pc-age, .smx-side-h, .sm-badge, .lp-nav-h span, .ad-mini span, .cp-facts span, a > small, .setting-desc, .setting-desc strong) { font-size: .6875rem; }

/* Owners / Tenants / Non-residents on a phone or tablet: each client is a card (name, then unit and phone, then the buttons),
   so Properties and ⋯ are in reach without swiping the table sideways */
@media (max-width: 900px) {
  html:root .content :is(.pp-scroll, .tbl-wrap:has(> .pp-table)) { overflow: visible; }
  html:root .content .pp-table { min-width: 0 !important; width: 100%; table-layout: auto; }   /* (some pages' table wrapper sets 900px) */
  html:root .content .pp-table :is(colgroup, thead) { display: none; }
  html:root .content .pp-table tbody { display: block; }
  html:root .content .pp-table tr { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 12px; padding: 14px 14px 12px; border-bottom: 1px solid var(--border); }
  html:root .content .pp-table tr:last-child { border-bottom: 0; }
  html:root .content .pp-table td { display: block; height: auto; padding: 0 !important; border: 0 !important; min-width: 0; text-align: left !important; }
  html:root .content .pp-table td.pp-person { display: flex; grid-column: 1 / -1; }
  html:root .content .pp-table td:nth-last-child(2):not([colspan]) { text-align: right !important; }   /* phone (just before Actions) */
  html:root .content .pp-table td.pp-acts { grid-column: 1 / -1; display: flex; gap: 8px; text-align: left; }
  html:root .content .pp-table td.pp-acts .pp-main { flex: 1; width: auto; min-height: 38px; justify-content: center; }
  html:root .content .pp-table td.pp-acts .pp-more { flex: none; min-width: 44px; min-height: 38px; }
  html:root .content .pp-table td[colspan] { grid-column: 1 / -1; }
  html:root .content .pp-who { max-width: none; }
}

/* Permissions → Account security on a phone or tablet: each resident is a card (name and Manage, then status, last sign-in, warning signs) */
@media (max-width: 900px) {
  html:root .content #secTable { min-width: 0 !important; width: 100%; }
  html:root .content .tbl-wrap:has(> #secTable) { overflow: visible; }
  html:root .content #secTable thead { display: none; }
  html:root .content #secTable tbody { display: block; }
  html:root .content #secTable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  html:root .content #secTable td { display: block; padding: 0 !important; border: 0 !important; min-width: 0; text-align: left !important; }
  html:root .content #secTable td:nth-child(n+2) { grid-column: 1 / -1; }
  html:root .content #secTable td:nth-child(5) { grid-column: 2; grid-row: 1; }
  html:root .content #secTable td:nth-child(2) { display: flex; flex-wrap: wrap; gap: 6px; }
  html:root .content #secTable td:nth-child(4):has(> span:only-child[style]) { display: none; }   /* "None" warning signs: nothing to show */
  html:root .content #secTable td[colspan] { grid-column: 1 / -1; grid-row: auto; }
  html:root .content #secTable tr.pm-flag { box-shadow: inset 3px 0 0 var(--accent); }   /* the "worth a look" bar runs down the whole card */
  html:root .content #secTable tr.pm-flag td:first-child { box-shadow: none; }
}

/* date fields keep the Hive calendar icon in every theme (the Dark theme's input rule resets the whole background with !important) */
html:root.hd-cal-on :is(input[type="date"], input[type="datetime-local"], input[type="month"]):not(:disabled) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF8A00' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2.5'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 12px center !important; background-size: 17px !important; padding-right: 38px; }
/* tablets: the client card keeps its buttons on the right of the name */
@media (min-width: 641px) and (max-width: 900px) {
  html:root .content .pp-table td.pp-person { grid-column: 1; grid-row: 1; }
  html:root .content .pp-table td.pp-acts { grid-column: 2; grid-row: 1; }
  html:root .content .pp-table td.pp-acts .pp-main { flex: none; width: 140px; }
  html:root .content .pp-table td:nth-child(2) { grid-column: 1; }
}
