/* Calix EM portal: the "Modern iOS" look. Grouped cards, large titles, segmented
   controls, and spring motion (see Motion at the end). */

/* Inter (variable: weight and optical size), served from here; SIL Open Font
   License 1.1, see fonts/OFL.txt. Latin Extended loads only for pages that use its letters. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin.4b73e2ff3024.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext.084b211fc382.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --bg: #f2f2f7; --surface: #fff; --raised: #fff; --subtle: #fafafc; --row-hover: #f6f6f9; --inset: #f7f7fa;
  --text: #000; --muted: #6a6a6f; --line: #e3e3e8; --soft: #ececf0;
  --fill: rgba(118, 118, 128, .12); --fill-strong: rgba(118, 118, 128, .2);  /* iOS's grey control fills */
  --field: rgba(118, 118, 128, .1); --field-line: #d1d1d6; --field-line-hover: #b4b4ba; --focus-ring: rgba(15, 118, 110, .22);
  --accent: #0f766e; --accent-hover: #0c655e; --accent-ink: #0b6b63; --accent-soft: rgba(15, 118, 110, .1); --link: #0b6f67;
  --danger: #d70015; --danger-soft: #ffe9eb; --danger-line: #ffc2c8; --danger-ink: #a5000f;
  --warn: #b25000; --warn-soft: #fff1e0; --warn-line: #ffd29e; --warn-ink: #7d3a00;
  --ok: #177a34; --ok-soft: #e3f7e8; --ok-line: #a6e3b6; --ok-ink: #0f6a2a;
  --info-soft: #e5f1ff; --info-line: #b5d6ff; --info-ink: #0040a8;
  --landlord: #8944ab; --building: #007aff; --tenant: #28a745; --meter: #8e8e93;
  /* chart series, in a fixed order validated for colour-blind separation */
  --c0: #0d9488; --c1: #eb6834; --c2: #2a78d6; --c3: #eda100;
  --c4: #e87ba4; --c5: #008300; --c6: #4a3aa7; --c7: #e34948;
  --grid: #ececf1;
  --radius: 22px; --shadow: 0 1px 1px rgba(0, 0, 0, .02), 0 8px 28px rgba(0, 0, 0, .05);
  --sheet: 0 2px 4px rgba(0, 0, 0, .03), 0 18px 50px rgba(0, 0, 0, .08);  /* a panel that opens over the page */
  --pop: rgba(0, 0, 0, .16);  /* popover shadows */
  --seg-on: #fff; --seg-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04);  /* a segmented control's chosen part */
  --bar: rgba(249, 249, 251, .78); --bar-line: rgba(0, 0, 0, .1);  /* the see-through top bar */
  --glow-1: #d7efe9; --glow-2: #e0ecff;  /* sign-in page background */
  --spring: cubic-bezier(.32, .72, 0, 1);  /* iOS's sheet curve: quick start, soft landing */
}
/* Dark mode (the default): <html data-theme="dark">, set by the server from the person's choice. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000; --surface: #1c1c1e; --raised: #2c2c2e; --subtle: #1c1c1e; --row-hover: #232325; --inset: #2c2c2e;
  --text: #fff; --muted: #9c9ca3; --line: #323236; --soft: #2c2c2e;
  --fill: rgba(118, 118, 128, .24); --fill-strong: rgba(118, 118, 128, .32);
  --field: rgba(118, 118, 128, .24); --field-line: #48484a; --field-line-hover: #636366; --focus-ring: rgba(64, 200, 184, .35);
  --accent: #0f766e; --accent-hover: #13887f; --accent-ink: #4fd1c1; --accent-soft: rgba(64, 200, 184, .16); --link: #4fd1c1;
  --danger: #ff453a; --danger-soft: rgba(255, 69, 58, .16); --danger-line: rgba(255, 69, 58, .4); --danger-ink: #ff8a82;
  --warn: #ff9f0a; --warn-soft: rgba(255, 159, 10, .16); --warn-line: rgba(255, 159, 10, .4); --warn-ink: #ffc266;
  --ok: #30d158; --ok-soft: rgba(48, 209, 88, .16); --ok-line: rgba(48, 209, 88, .4); --ok-ink: #7ce69a;
  --info-soft: rgba(100, 210, 255, .14); --info-line: rgba(100, 210, 255, .35); --info-ink: #9fe1ff;
  --landlord: #bf5af2; --building: #0a84ff; --tenant: #30d158; --meter: #98989f;
  /* the same eight hues stepped for the dark surface (validated on #1c1c1e) */
  --c0: #0d9488; --c1: #d95926; --c2: #3987e5; --c3: #c98500;
  --c4: #d55181; --c5: #008300; --c6: #9085e9; --c7: #e66767;
  --grid: #2a2a2d;
  --shadow: none; --sheet: none;
  --pop: rgba(0, 0, 0, .6);
  --seg-on: #636366; --seg-shadow: 0 3px 8px rgba(0, 0, 0, .24);
  --bar: rgba(22, 22, 24, .72); --bar-line: rgba(255, 255, 255, .08);
  --glow-1: #0f2e2a; --glow-2: #141f36;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-optical-sizing: auto; letter-spacing: -.006em; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 34px; font-weight: 750; line-height: 1.1; margin: 0 0 6px; letter-spacing: -.025em; }  /* a large title */
h2 { font-size: 20px; font-weight: 650; margin: 0 0 12px; letter-spacing: -.017em; }
h3 { font-size: 15px; font-weight: 650; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* top bar: see-through, with the menu as a segmented control in the middle */
.demo-bar { background: #b45309; color: #fff; text-align: center; font-size: 13px; font-weight: 600; padding: 5px 12px; }
.topbar { background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--bar-line); position: sticky; top: 0; z-index: 20; }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text); font-size: 17px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand svg { width: 32px; height: 32px; }
.nav { position: relative; display: flex; flex: 0 1 auto; min-width: 0; margin: 0 auto; padding: 3px; border-radius: 11px; background: var(--fill); overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--text); padding: 6px 17px; border-radius: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--fill); text-decoration: none; }
.nav a.on { background: var(--seg-on); box-shadow: var(--seg-shadow); font-weight: 600; }
.user { position: relative; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.theme-form { margin: 0; }
.theme-toggle { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 0; background: var(--fill); color: var(--text); cursor: pointer; }
.theme-toggle:hover { background: var(--fill-strong); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .sun { display: none; }  /* light: the moon offers dark; dark: the sun offers light */
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
.user summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.user summary::-webkit-details-marker { display: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(180deg, #a5abb8, #858994); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 15px; }
.user-menu { position: absolute; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px var(--pop); min-width: 220px; padding: 6px; }
.user-menu a, .user-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.user-menu a:hover, .user-menu button:hover { background: var(--soft); text-decoration: none; }
.user-menu .who { padding: 8px 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }

main { max-width: 1240px; margin: 0 auto; padding: 30px 20px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.premade { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); align-items: start; }  /* 3 across on a wide screen */
.premade.tiles:has(> :nth-child(4)) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }  /* 4 tiles: 4 across */

/* cards, layout */
.card { background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.card + .card { margin-top: 18px; }
.grid > .card + .card { margin-top: 0; }  /* side by side in a grid: the gap spaces them */
.grid { display: grid; gap: 18px; }
.cols-usage { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 22px; align-items: start; }
.sticky { position: sticky; top: 80px; }
.cols-usage > * { min-width: 0; }
@media (max-width: 900px) { .cols-usage { grid-template-columns: minmax(0, 1fr); } .sticky { position: static; } }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 0; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat .label { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.stat .value { font-size: 28px; font-weight: 750; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.stat.total { background: linear-gradient(135deg, var(--accent), #14857c); color: #fff; border: 0; }
.stat.total .label, .stat.total .value small { color: rgba(255,255,255,.8); }

/* forms */
label.field, .field > label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: -.003em; margin: 16px 0 7px 2px; }  /* sentence case, like iOS */
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=month], input[type=time], input[type=number], input[type=search], input[type=url], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--field); border: 1px solid transparent; border-radius: 11px; padding: 10px 12px; outline: none; }
input:focus, select:focus, textarea:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus-ring); }
select:not([multiple]) { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 1.8l3 2.7M3 7.5l3 2.7 3-2.7' fill='none' stroke='%238e8e93' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; }
input[type=search] { padding-left: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='5' fill='none' stroke='%238e8e93' stroke-width='1.7'/%3E%3Cpath d='m11 11 3.2 3.2' stroke='%238e8e93' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 11px center; background-size: 15px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.row > .shrink { flex: 0 0 auto; }
.help { font-size: 13px; color: var(--muted); margin-top: 4px; }
.errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--danger); font-size: 13px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label, .check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text); text-transform: none; letter-spacing: 0; font-weight: 500; margin: 0; cursor: pointer; }
.checks ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.radios ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.radios label { display: flex; gap: 8px; align-items: center; font-weight: 500; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; }

/* segmented control */
.seg { display: flex; background: var(--fill); border-radius: 10px; padding: 2px; }
.seg label { flex: 1; text-align: center; margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 8px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--text); }
.seg input:checked + span { background: var(--seg-on); box-shadow: var(--seg-shadow); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; border-radius: 12px; padding: 10px 18px; border: 0; background: var(--accent); color: #fff; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn.secondary { background: var(--fill); color: var(--accent-ink); }  /* iOS "gray" button: tinted text on grey */
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary:hover { background: var(--fill-strong); }
.btn.danger { background: var(--fill); color: var(--danger-ink); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 6px 14px; font-size: 13px; border-radius: 999px; }
.btn.block { width: 100%; padding: 14px; font-size: 16px; border-radius: 14px; }
.link { background: none; border: 0; color: var(--link); font: inherit; cursor: pointer; padding: 0; }
.link.danger { color: var(--danger); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 13px; letter-spacing: -.003em; color: var(--muted); font-weight: 600; padding: 10px; border-bottom: .5px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: .5px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--row-hover); }
tr.total td { font-weight: 650; border-top: .5px solid var(--line); }
tr.total td.num { color: var(--accent-ink); }
th.num, td.num { text-align: right; }

/* tags */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 500; background: var(--fill); color: var(--text); border: 0; white-space: nowrap; margin: 1px 2px 1px 0; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--meter); }
.chip.landlord::before { background: var(--landlord); } .chip.building::before { background: var(--building); }
.chip.tenant::before { background: var(--tenant); } .chip.meter::before { background: var(--meter); }
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.landlord { background: var(--landlord); } .dot.building { background: var(--building); } .dot.tenant { background: var(--tenant); } .dot.meter { background: var(--meter); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--fill); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.admin { background: var(--accent-soft); color: var(--accent-ink); } .badge.off { background: var(--danger-soft); color: var(--danger); }
.badge.ok::before, .badge.warn::before, .badge.off::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1.5px; }  /* a status light */

/* tag picker */
.picker { position: relative; }
.picker-btn { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; font: inherit; font-size: 14px; background: var(--field); border: 0; border-radius: 0; padding: 11px 12px; cursor: pointer; color: var(--text); }
.picker-btn:hover { background: var(--fill-strong); }
.picker-btn .lbl { font-weight: 500; }
/* pickers one after another form one grouped list */
.picker:first-child, :not(.picker) + .picker { margin-top: 8px; }
.picker:first-child .picker-btn, :not(.picker) + .picker .picker-btn { border-top-left-radius: 12px; border-top-right-radius: 12px; }
.picker:not(:has(+ .picker)) .picker-btn { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }
.picker + .picker .picker-btn { box-shadow: inset 0 .5px 0 var(--line); }
.picker-chips:empty { display: none; }
.picker-btn .summary { color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-btn .caret { font-size: 0; }
.picker-btn .caret::after { content: "›"; font-size: 20px; line-height: 1; color: var(--muted); }
.picker-panel { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--raised); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 28px var(--pop); z-index: 30; padding: 8px; }
.picker-list { max-height: 240px; overflow-y: auto; margin: 6px 0; }
.picker-list label { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.picker-list label:hover { background: var(--soft); }
.picker-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; }
.picker-chips { margin-top: 6px; }

/* format choices with example popovers */
.formats { display: flex; gap: 8px; flex-wrap: wrap; }
.fmt { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 10px; padding: 7px 11px; background: var(--fill); font-size: 14px; font-weight: 600; cursor: pointer; text-transform: none; letter-spacing: 0; color: var(--text); margin: 0; }
.fmt:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.info { position: relative; display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--soft); color: var(--muted); font-size: 11px; font-weight: 700; cursor: help; font-style: normal; }
.tip { display: none; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: 270px; background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px var(--pop); padding: 12px; z-index: 40; font-weight: 400; text-align: left; cursor: default; }
.info:hover .tip, .info:focus .tip, .info:focus-within .tip { display: block; }
.tip b { display: block; font-size: 13px; margin-bottom: 6px; }
.tip p { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.mini-pdf { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 11px; background: var(--subtle); }
.mini-pdf .t { font-weight: 700; font-size: 12px; }
.mini-pdf .r { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 2px 0; }
.mini-pdf .r:last-child { border: 0; font-weight: 700; color: var(--link); }
.mini-xls { border-collapse: collapse; width: 100%; font-size: 11px; }
.mini-xls td, .mini-xls th { border: 1px solid var(--field-line); padding: 2px 5px; text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--text); }
.mini-xls th { background: var(--accent); color: #fff; }
.mini-csv { font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--subtle); border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; margin: 0; white-space: pre; overflow: hidden; }

/* usage results */
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.result-head .actions .btn { border-radius: 999px; padding: 8px 16px; }
.group-card { padding: 0; overflow: hidden; }
.group-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: .5px solid var(--line); cursor: pointer; }
.group-head h2 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.group-head .big { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.group-head .big small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.group-card table td:first-child, .group-card table th:first-child { padding-left: 22px; }
.group-card table td:last-child, .group-card table th:last-child { padding-right: 22px; }
details.group-card > summary { list-style: none; }
details.group-card > summary::-webkit-details-marker { display: none; }
.chev { transition: transform .15s; color: var(--muted); }
details[open] .chev { transform: rotate(90deg); }
.chart-box { position: relative; height: 280px; }

/* predicted usage */
.forecast-card { margin-bottom: 18px; }
.forecast-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.forecast-head h2 { margin-bottom: 2px; }
.forecast-figures { display: flex; gap: 28px; }
.forecast-figures .label { font-size: 13px; color: var(--muted); }
.forecast-figures .value { font-size: 28px; font-weight: 750; letter-spacing: -.025em; line-height: 1.2; }
.forecast-figures .value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.forecast-box { height: 300px; }
.forecast-legend { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13.5px; color: var(--text); }
.forecast-legend li { display: flex; align-items: center; gap: 8px; }
.forecast-legend .nums { color: var(--muted); }
.forecast-legend .nums strong { color: var(--text); font-weight: 600; }
.forecast-legend .key { width: 24px; height: 8px; flex: none; }
.forecast-legend line { stroke-width: 2.5; stroke-linecap: round; }
.forecast-legend line.dash { stroke-dasharray: 5 4; }
.s0 { stroke: var(--c0); } .s1 { stroke: var(--c1); } .s2 { stroke: var(--c2); } .s3 { stroke: var(--c3); }
.s4 { stroke: var(--c4); } .s5 { stroke: var(--c5); } .s6 { stroke: var(--c6); } .s7 { stroke: var(--c7); }
.forecast-how { margin: 10px 0 0; }
.cost-card { margin-bottom: 18px; }
.cost-card .cost-box { margin-top: 10px; }
.cost-note { margin: 8px 0 0; }
.table-view { margin-top: 10px; }
.table-view summary { cursor: pointer; color: var(--link); font-size: 13.5px; font-weight: 600; }
.table-view .table-wrap { max-height: 320px; overflow: auto; margin-top: 8px; }
.table-view thead th { position: sticky; top: 0; background: var(--surface); }
.side-cards { display: flex; flex-direction: column; gap: 16px; align-self: start; }
/* building connectors (admins: top of Home, and Properties › Connectors) */
.connectors.on-home { margin-bottom: 22px; }
.on-home .conn-table { max-height: 330px; }  /* about 6 rows, then it scrolls */
.conn-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.conn-head h2 { margin: 0; }
.conn-sum { display: flex; gap: 6px; flex-wrap: wrap; }
.conn-table { max-height: calc(100vh - 230px); overflow: auto; }  /* long lists scroll under a fixed header */
.conn-table thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.conn-table td { vertical-align: top; }
.table-view tr.predicted td { color: var(--muted); font-style: italic; }
.panel { background: var(--surface); border: 0; border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.drop { position: relative; }
.drop > summary { list-style: none; }
.drop > summary::-webkit-details-marker { display: none; }
.drop-panel { position: absolute; right: 0; top: calc(100% + 6px); width: 340px; z-index: 30; background: var(--raised); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 30px var(--pop); padding: 16px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h2 { color: var(--text); }
.note { background: var(--warn-soft); color: var(--warn-ink); border-radius: 14px; padding: 10px 14px; font-size: 13.5px; margin-top: 14px; }
.note ul { margin: 4px 0 0; padding-left: 18px; }

/* messages */
.messages { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.messages li { padding: 12px 15px; border-radius: 14px; font-size: 14px; border: 1px solid; }
.messages .success { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-ink); }
.messages .error { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-ink); }
.messages .warning { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.messages .info { background: var(--info-soft); border-color: var(--info-line); color: var(--info-ink); }

/* tabs: a row of capsules, the chosen one filled */
.tabs { display: flex; gap: 6px; margin: -4px -2px 20px; padding: 4px 2px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 7px 15px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; }
.tabs a:hover { background: var(--fill-strong); text-decoration: none; }
.tabs a.on { background: var(--accent); color: #fff; }
.form-card { max-width: 720px; }
.form-card .field:first-child > label { margin-top: 0; }
/* fields side by side line up: same label spacing, tops aligned */
.form-card .row { align-items: flex-start; }
.form-card .row > .field > label { margin-top: 14px; }
fieldset { border: 0; padding: 0; margin: 0; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 26px 0 4px; }
.section-title:first-of-type { margin-top: 0; }
@media (max-width: 640px) {
  .topbar-in { gap: 12px; padding: 0 12px; }
  .topbar .brand span { display: none; }
  .nav { flex: 1 1 auto; margin: 0; }
  .nav a { padding: 6px 11px; }
  h1 { font-size: 30px; }
  main { padding: 16px 12px 40px; }
  .tip { left: 0; transform: none; width: 240px; }
}

/* sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, var(--glow-1) 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, var(--glow-2) 0, transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 0; border-radius: 26px; padding: 36px 32px; box-shadow: 0 20px 50px var(--pop); }
.auth-card .brand { justify-content: center; font-size: 22px; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.auth-card .btn { width: 100%; margin-top: 18px; padding: 14px; font-size: 16px; border-radius: 14px; }
.timeline td { font-size: 14px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 14px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }
@media print {
  :root, :root[data-theme="dark"] {
    color-scheme: light;
    --bg: #f2f2f7; --surface: #fff; --raised: #fff; --subtle: #fafafc; --row-hover: #f6f6f9; --inset: #f7f7fa;
    --text: #000; --muted: #6a6a6f; --line: #e3e3e8; --soft: #ececf0;
    --fill: rgba(118, 118, 128, .12); --fill-strong: rgba(118, 118, 128, .2);
    --field: rgba(118, 118, 128, .1); --field-line: #d1d1d6; --field-line-hover: #b4b4ba; --focus-ring: rgba(15, 118, 110, .22);
    --accent: #0f766e; --accent-hover: #0c655e; --accent-ink: #0b6b63; --accent-soft: rgba(15, 118, 110, .1); --link: #0b6f67;
    --danger: #d70015; --danger-soft: #ffe9eb; --danger-line: #ffc2c8; --danger-ink: #a5000f;
    --warn: #b25000; --warn-soft: #fff1e0; --warn-line: #ffd29e; --warn-ink: #7d3a00;
    --ok: #177a34; --ok-soft: #e3f7e8; --ok-line: #a6e3b6; --ok-ink: #0f6a2a;
    --info-soft: #e5f1ff; --info-line: #b5d6ff; --info-ink: #0040a8;
    --landlord: #8944ab; --building: #007aff; --tenant: #28a745; --meter: #8e8e93;
    /* chart series, in a fixed order validated for colour-blind separation */
    --c0: #0d9488; --c1: #eb6834; --c2: #2a78d6; --c3: #eda100;
    --c4: #e87ba4; --c5: #008300; --c6: #4a3aa7; --c7: #e34948;
    --grid: #ececf1;
    --radius: 22px; --shadow: 0 1px 1px rgba(0, 0, 0, .02), 0 8px 28px rgba(0, 0, 0, .05); --sheet: none;
    --pop: rgba(0, 0, 0, .16);  /* popover shadows */
    --seg-on: #fff; --seg-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04);
    --bar: rgba(249, 249, 251, .78); --bar-line: rgba(0, 0, 0, .1);
    --glow-1: #d7efe9; --glow-2: #e0ecff;  /* sign-in page background */
  }
}
@media print { .topbar, .no-print, .cols-usage > aside { display: none !important; } .cols-usage { display: block; } body { background: #fff; } .card { box-shadow: none; border: 1px solid var(--line); } *, *::before, *::after { animation: none !important; } }

/* meters: selection bar, name boxes, single-meter actions, directory */
.selbar { position: sticky; bottom: 12px; z-index: 15; margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px var(--pop); padding: 12px 16px; }
.selbar .help { margin-top: 6px; }
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none; background: var(--raised); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 28px var(--pop); z-index: 30; max-height: 260px; overflow: auto; }
.selbar .combo-list { top: auto; bottom: calc(100% + 4px); }  /* the bar sits at the bottom: open upward */
.combo-list li { padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.combo-list li.on, .combo-list li:hover { background: var(--accent-soft); }
.combo-list li.new { color: var(--accent-ink); font-weight: 600; }
.combo-list li.none { color: var(--muted); cursor: default; background: none; }
.combo-note { font-size: 12.5px; color: var(--accent-ink); margin-top: 4px; }
.combo-note:empty { display: none; }
.selbar .combo { flex: 1 1 240px; }
.selbar .combo-note { position: absolute; top: calc(100% + 6px); left: 2px; right: 0; }
.selbar:has(.combo-note:not(:empty)) .help { visibility: hidden; }  /* the note takes its place */
.add-row > input, .tag-edit .row > input { flex: 1 1 180px; }
.act-row, .tag-edit { scroll-margin-top: 170px; }  /* keep the row you clicked in view */
@media (max-width: 600px) {
  .assign-table tr { display: grid; grid-template-columns: 110px 1fr; border-bottom: 1px solid var(--line); }
  .assign-table tr > * { border-bottom: 0; }
  .assign-table th[scope=row] { width: auto; }
  .assign-table td.acts, .act-row > td { grid-column: 1 / -1; }
  .assign-table td.acts { padding-top: 0; }
  .assign-table td.acts > div { justify-content: flex-start; padding-left: 10px; }
  .act-row .row > .field { flex-basis: 100%; }
  .selbar .combo-note { position: static; }
  .selbar:has(.combo-note:not(:empty)) .help { display: none; }
}
.assign-table th[scope=row] { width: 140px; padding-left: 20px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); }
.assign-table td.acts > div { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; padding-right: 10px; }
.assign-table tr:last-child > * { border-bottom: 0; }
.act-row:not(:target) { display: none; }
.act-row > td { background: var(--subtle); padding: 2px 20px 18px; }
.act-buttons { display: flex; gap: 14px; align-items: center; margin-top: 14px; }
.dir details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; padding: 9px 0; }
.dir summary::-webkit-details-marker { display: none; }
.dir summary .dot { margin-right: 0; }
.dir details[open] > summary > .chev { transform: rotate(90deg); }
.card.dir:has(.dir-building) { background: none; box-shadow: none; padding: 0; }  /* the tree: each building is its own section */
.dir-landlord + .dir-landlord { margin-top: 28px; }
.dir-landlord > summary { font-size: 22px; letter-spacing: -.02em; padding: 0 0 4px; }
.dir-landlord > summary strong { font-weight: 750; }
.dir-landlord > summary .count { font-size: 14px; margin-left: 4px; }
.dir-landlord > summary > a:not(.chip, .edit-link), .dir-building > summary > a:not(.chip, .edit-link) { color: var(--text); }
.dir-buildings { margin: 0 0 6px; }
.dir-building { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 22px 8px; margin-top: 16px; }
.dir-building > summary { font-size: 17px; padding: 12px 0 10px; }
.dir-building > summary strong { font-weight: 650; }
.dir-tenants { margin: 0; }
.dir-tenant { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding: 11px 0; border-top: .5px solid var(--line); }
.dir-tenant .who { min-width: 330px; }
.dir-tenant .meters { flex: 1; min-width: 200px; }
.dir .count { color: var(--muted); font-size: 13px; }
.dir .edit-link { font-size: 13px; margin-left: 6px; }
.dir .note { font-size: 12.5px; color: var(--muted); font-style: italic; margin: -4px 0 6px 26px; }
.dir-tenant .note { margin: 2px 0 0 15px; }
.unused-kind { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 12px 0 2px; }
a.chip { color: var(--text); }
a.chip:hover { text-decoration: none; background: var(--fill-strong); }
.tag-edit:not(:target) { display: none; }
.tag-edit { background: var(--inset); border-radius: 14px; padding: 10px 12px; margin: 2px 0 10px; }

/* labels (stickers) and panels */
.label-no { display: inline-block; font: 600 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; padding: 1px 7px; border-radius: 6px; background: var(--fill); color: var(--text); white-space: nowrap; vertical-align: 1px; }
.label-no.big { font-size: 15px; padding: 2px 9px; vertical-align: 6px; }
.chip .label-no { font-size: 11px; padding: 0 4px; margin-left: 2px; }
.dot.pnl { background: var(--building); border-radius: 2px; }  /* a panel: square, in its building's colour */
.dot.sticker { background: var(--muted); border-radius: 2px; }
.chip.panel-chip::before { background: var(--building); border-radius: 2px; }
.chip.suite-chip::before { background: var(--tenant); border-radius: 2px; }
.chip.suite-chip.vacant { border: 1px dashed var(--muted); padding: 2px 8px 2px 7px; background: none; }
.chip.suite-chip.vacant::before { background: none; border: 1.5px solid var(--tenant); width: 5px; height: 5px; }
.dir-panels { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: -2px 0 6px 26px; }
.label-stats { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.label-stats .value small { font-size: 13px; }
.order-grid { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; }
.label-preview { margin: 14px 0 0; text-align: center; }
.label-preview img { display: block; width: 2in; max-width: 100%; height: auto; margin: 0 auto 6px; background: #fff; border: 1px solid #c8ccd2; border-radius: 6px; box-shadow: var(--shadow); }
.label-preview figcaption { max-width: 2.6in; }
td.files, .nowrap { white-space: nowrap; }
.seg-links { display: flex; gap: 4px; flex-wrap: wrap; }
.seg-links a { padding: 4px 10px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg-links a.on { background: var(--accent-soft); color: var(--accent-ink); }
.pager { display: flex; gap: 14px; justify-content: center; margin-top: 12px; }
.pick-list { display: flex; flex-direction: column; background: var(--inset); border-radius: 14px; max-height: 420px; overflow: auto; }
.pick-list > label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 13px; border-bottom: .5px solid var(--line); cursor: pointer; font-size: 14px; margin: 0; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 400; }
.pick-list > label:last-child { border-bottom: 0; }
.pick-list > label:has(input:checked) { background: var(--accent-soft); }
.pick-list > label > input { margin-top: 3px; flex: none; }
.pick-list.big > label { padding: 12px 14px; }
.assign-card { max-width: 640px; }
@media (max-width: 600px) {
  .order-grid { grid-template-columns: 1fr; }
  .btn.block-phone { width: 100%; }
}
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
h1 .dot { width: 12px; height: 12px; vertical-align: 7px; }
.pick-list .pick-group { padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: var(--soft); border-bottom: 1px solid var(--line); }
.card .flush { margin: 4px -22px -20px; }  /* a table running to the card's edges */
.facts { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
.user-grid { grid-template-columns: minmax(0, 720px) minmax(0, 1fr); }
@media (max-width: 900px) { .user-grid { grid-template-columns: minmax(0, 1fr); } }  /* phones: boxes stack */
.add-panel:not(:target) { display: none; }  /* opened by its "+ Add" button */
.add-panel { scroll-margin-top: 90px; }
.field-error { color: var(--danger); font-size: 13px; margin-top: 4px; }
input[aria-invalid="true"] { border-color: var(--danger); }
.steps { margin: 0; padding-left: 20px; } .steps li { margin: 4px 0; }
.js .js-hide { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* list pages' building filter + search: stack on phones so the search box keeps its width */
@media (max-width: 600px) { .list-bar > select, .list-bar > input[type=search] { flex: 1 1 100% !important; width: 100% !important; max-width: none !important; } }
/* Connector configuration: one block per network port */
.net-iface { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.net-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 8px; }
.net-head .badge { margin-left: auto; }
/* Energy Cost: common area electric per building, and share rows in the table */
.common-summary { margin-top: 16px; }
.common-summary h3 { font-size: 14px; margin: 0 0 6px; }
/* Building page: Common Area Electric */
h3.sub { font-size: 14px; margin: 16px 0 6px; }
/* Removed meters and connectors; a new computer's settings file */
.retired-note { border-left: 4px solid var(--muted); margin-bottom: 16px; }
.settings-file { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; white-space: pre; overflow-x: auto; }
.steps { padding-left: 20px; margin: 12px 0 0; }
.steps li { margin: 6px 0; }

/* One chain: "Connected to" boxes, the Overview tree and Needs attention (relations.py) */
.chip.connector-chip::before { background: var(--accent); border-radius: 2px; transform: rotate(45deg); width: 6px; height: 6px; }
dl.links { display: grid; grid-template-columns: minmax(84px, max-content) 1fr; gap: 6px 12px; margin: 0; }
dl.links dt { color: var(--muted); font-size: 13px; padding-top: 3px; }
dl.links dd { margin: 0; min-width: 0; }
dl.links dd .chip { white-space: normal; }
.attention { margin-top: 14px; padding: 10px 12px; border-radius: 14px; background: var(--warn-soft); }
.attention .plain-list li { margin: 4px 0; }
.attention-bar { padding: 12px 16px; border-radius: 14px; background: var(--warn-soft); }
.attention-list { list-style: none; margin: 0 0 10px 5px; padding: 0 0 0 20px; border-left: 2px solid var(--line); }
.attention-list li { padding: 6px 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.dir-panel { margin: 2px 0; }
.dir-panel + .dir-panel { margin-top: 4px; }
.warn-mark { color: var(--warn); font-weight: 700; margin-left: 2px; }

/* Home: Create Monthly Tenant Billing */
.billing .field .row { align-items: center; }
.billing .row.unit { flex-wrap: nowrap; gap: 8px; max-width: 320px; }
.billing .tou-fields { display: none; background: var(--inset); border-radius: 14px; padding: 4px 14px 12px; margin-top: 10px; }
.billing:has(#bill-tou:checked) .tou-fields { display: block; }
@media (max-width: 600px) { .billing .rates { flex-direction: column; align-items: stretch !important; gap: 0; } }
/* Billing (administrators): the landlords' metering service */
.warn-text { color: var(--warn); }
.group-sum { display: flex; align-items: center; gap: 14px; }
.group-card tfoot td { border-bottom: 0; }
.billing-stats { grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); }
@media (max-width: 600px) { .billing-stats { grid-template-columns: 1fr 1fr; } }
.pricing .group-head { cursor: default; flex-wrap: wrap; }
.price-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.price-field label, .phone-label { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: -.003em; }
.fee-error { flex-basis: 100%; text-align: right; margin-top: -4px; }
.price-box { display: flex; align-items: center; gap: 6px; max-width: 170px; }
.price-box input { min-width: 0; }
.price-row { display: grid; grid-template-columns: minmax(0, 2fr) 110px minmax(0, 1.3fr) minmax(0, 1.3fr); gap: 6px 14px; align-items: start; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.price-row .who, .price-row .meters { padding-top: 9px; }
.price-row.head { padding-top: 9px; padding-bottom: 9px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.phone-label { display: none; }
.pricing-foot { display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 12px 20px; flex-wrap: wrap; }
.pricing-foot .help { margin: 0 auto 0 0; }
.invoice-form .row { max-width: 440px; }
@media (max-width: 700px) {
  .price-row { grid-template-columns: 1fr 1fr; }
  .price-row.head { display: none; }
  .price-row .who { grid-column: 1 / -1; padding-top: 0; }
  .price-row .meters { grid-column: 1 / -1; text-align: left; padding-top: 0; color: var(--muted); font-size: 13px; }
  .price-row .meters .phone-label { display: inline; margin-right: 6px; }
  .phone-label { display: block; margin-bottom: 4px; }
  .fee-error { text-align: left; }
}
/* Energy Incentives (Home, under Show Usage; administrators and landlords) */
.cols-usage.with-side { grid-template-rows: auto 1fr; }
.cols-usage.with-side > section { grid-column: 2; grid-row: 1 / span 2; }
.cols-usage.with-side > .side-extra { grid-column: 1; grid-row: 2; }
@media (max-width: 900px) { .cols-usage.with-side > section, .cols-usage.with-side > .side-extra { grid-column: auto; grid-row: auto; } }
.incentives h2 { margin-bottom: 4px; }
.incentives > p.muted { margin: 0 0 6px; }
.inc-state { border-top: .5px solid var(--line); }
.inc-state > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; padding: 9px 0; }
.inc-state > summary::-webkit-details-marker { display: none; }
.inc-state[open] > summary > .chev { transform: rotate(90deg); }
.inc-state:not([open]) > summary > .chev { transform: none; }  /* a folded state inside an open one */
.inc-rest .inc-state { border-top: 0; margin-left: 14px; }
.inc-rest .inc-state > summary { padding: 5px 0; font-size: 14px; }
.inc-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 12px; }
.inc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 600; }
.inc-head .badge { flex-shrink: 0; font-size: 11px; }
.inc-text { font-size: 13px; line-height: 1.45; margin-top: 2px; }
.inc-data { font-size: 12.5px; color: var(--accent-ink); margin-top: 3px; }
.inc-data::before { content: "Your data: "; font-weight: 600; }
.inc-note { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.inc-foot { font-size: 12px; color: var(--muted); border-top: .5px solid var(--line); padding-top: 10px; margin: 6px 0 0; }
/* Home: Energy by End Use (bars are magnitude: one hue) */
.end-use-card { margin-bottom: 18px; }
.end-use-table .bar-col { width: 45%; }
.end-use-bar { height: 10px; min-width: 2px; border-radius: 0 5px 5px 0; background: var(--c0); }
@media (max-width: 600px) { .end-use-table .bar-col { width: 30%; } }
/* Reports: equal tiles; each opens its form in a wide panel underneath, one at a time */
.premade.tiles { align-items: stretch; }
.tile { display: flex; flex-direction: column; padding: 22px; }
.tile h2 { font-size: 19px; }
.tile > .muted.small { margin-bottom: 18px; }
.tile[data-for]::before { content: ""; flex: none; align-self: flex-start; width: 44px; height: 44px; margin-bottom: 16px; border-radius: 12px; background: var(--ico) center / 24px no-repeat, var(--ico-bg); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .08); }
.tile[data-for="open-billing"] { --ico-bg: linear-gradient(180deg, #19a394, #0f766e); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h9l4 4v14H6z'/%3E%3Cpath d='M12.5 9.2c-.6-.5-1.3-.7-2-.6-1 .2-1.5.9-1.4 1.6.2 1.6 3.6 1 3.7 2.8.1.8-.6 1.5-1.6 1.6-.8.1-1.6-.2-2.2-.8M11 7.5v1.1m0 6.6v1.1'/%3E%3C/svg%3E"); }
.tile[data-for="open-building"] { --ico-bg: linear-gradient(180deg, #3d9bff, #0a6fe0); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21V4h9v17M14 9h5v12M3 21h18M8 8h3M8 12h3M8 16h3'/%3E%3C/svg%3E"); }
.tile[data-for="open-pm"] { --ico-bg: linear-gradient(180deg, #5ac15f, #2f9a3a); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 14.4 8.6l5.6.6-4.2 3.8 1.2 5.5L12 15.7l-5 2.8 1.2-5.5L4 9.2l5.6-.6z'/%3E%3C/svg%3E"); }
.tile[data-for="open-tenant"] { --ico-bg: linear-gradient(180deg, #ffad33, #f08a00); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.6'/%3E%3Cpath d='M5 20c.8-3.6 3.6-5.6 7-5.6s6.2 2 7 5.6'/%3E%3C/svg%3E"); }
.tile > .btn, .tile > .tile-none { margin-top: auto; }
.tile > .btn { align-self: flex-start; }
.tile.active { box-shadow: 0 0 0 2.5px var(--accent), var(--shadow); }
.tile.active > .btn { background: var(--accent); color: #fff; }
.report-panel { display: none; margin-top: 18px; scroll-margin-top: 80px; border-radius: 24px; padding: 24px 26px; box-shadow: var(--sheet); }
.report-panels > .card + .card { margin-top: 16px; }
.report-panel.open { display: block; }
/* without JavaScript the tile's link (#open-…) opens its panel */
html:not(.js) .report-panel:target { display: block; }
html:not(.js) .report-panels:has(.report-panel:target) .report-panel.open:not(:target) { display: none; }
html:not(.js) .report-start:has(#open-billing:target) [data-for="open-billing"],
html:not(.js) .report-start:has(#open-building:target) [data-for="open-building"],
html:not(.js) .report-start:has(#open-tenant:target) [data-for="open-tenant"],
html:not(.js) .report-start:has(#open-pm:target) [data-for="open-pm"] { box-shadow: 0 0 0 2.5px var(--accent), var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.panel-head h2 { margin: 0; font-size: 22px; }
.panel-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; }
@media (max-width: 700px) { .panel-cols { grid-template-columns: minmax(0, 1fr); } }

/* Motion, the iOS way: things move on spring curves. Page changes are cross-document
   view transitions (the browser animates from one page to the next): the top bar
   stays put, the chosen menu item and tab glide to their new place, the old page
   eases back and the new page's cards rise in one after another. A report's form
   unfolds under its tile, and tables further down come into view as you scroll.
   Nothing moves for people whose device asks for less motion; browsers without
   these features simply show the pages. */
@media (prefers-reduced-motion: no-preference) {
  :root { interpolate-size: allow-keywords; }
  @view-transition { navigation: auto; }
  .topbar { view-transition-name: topbar; }
  .nav a.on { view-transition-name: menu-pill; }
  .tabs a.on { view-transition-name: tab-pill; }
  ::view-transition-group(*) { animation-duration: .5s; animation-timing-function: var(--spring); }
  ::view-transition-group(topbar) { animation: none; }
  ::view-transition-old(topbar), ::view-transition-new(topbar) { animation-duration: .2s; }
  ::view-transition-old(root) { animation: page-out .28s ease-in both; }
  ::view-transition-new(root) { animation: page-in .2s ease-out both; }
  @keyframes page-out { to { opacity: 0; transform: scale(.985); } }
  @keyframes page-in { from { opacity: 0; } }

  /* cards rise in, one after another; "backwards" leaves nothing behind once they land,
     so drop-down lists still open over the cards below */
  @keyframes rise { from { opacity: 0; translate: 0 18px; scale: .985; } }
  main > *, .cols-usage > aside > .card, .cols-usage > section > :is(.result-head, .stats, .card:not(.group-card)), .premade > .tile, .dir-building {
    animation: rise .55s var(--spring) backwards; animation-delay: calc(var(--d, 0) * 1ms); }
  main > :is(.cols-usage, .report-start), main > .card.dir:has(.dir-building) { animation: none; }  /* their parts rise instead */
  main > :nth-child(2) { --d: 40; } main > :nth-child(3) { --d: 80; } main > :nth-child(4) { --d: 120; } main > :nth-child(n+5) { --d: 160; }
  #usage-form { --d: 60; } .result-head { --d: 90; } .cols-usage .stats { --d: 120; } .forecast-card { --d: 140; }
  .side-extra > .card { --d: 170; } .cost-card { --d: 190; } .card:has(#daily-chart) { --d: 230; }
  .premade > .tile:nth-child(2) { --d: 50; } .premade > .tile:nth-child(3) { --d: 100; } .premade > .tile:nth-child(4) { --d: 150; }
  .dir-building:nth-of-type(2) { --d: 60; } .dir-building:nth-of-type(3) { --d: 120; } .dir-building:nth-of-type(n+4) { --d: 160; }
  @supports (animation-timeline: view()) {
    @keyframes come-into-view { from { opacity: 0; translate: 0 40px; scale: .96; } }
    .group-card { animation: come-into-view linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }
  }

  /* a report's form unfolds under its tile (and folds away when closed) */
  .js .report-panel { overflow: clip; opacity: 0; translate: 0 -10px; height: 0; padding-block: 0;
    transition: height .5s var(--spring), padding-block .5s var(--spring), opacity .3s ease, translate .5s var(--spring), display .5s allow-discrete; }
  .js .report-panel.open { opacity: 1; translate: none; height: auto; padding-block: 24px; }
  @starting-style { .js .report-panel.open { opacity: 0; translate: 0 -10px; height: 0; padding-block: 0; } }
  @keyframes settle { from { opacity: 0; translate: 0 10px; } }
  .report-panel.open .panel-cols > div, .report-panel.open > .btn { animation: settle .45s var(--spring) backwards; }
  .report-panel.open .panel-cols > div:first-child { animation-delay: 70ms; }
  .report-panel.open .panel-cols > div:last-child { animation-delay: 120ms; }
  .report-panel.open > .btn { animation-delay: 170ms; }

  /* touch feedback: things give a little when pressed, and spring back */
  .btn, .nav a, .tabs a, .theme-toggle, .tile { transition: transform .4s var(--spring), background-color .2s, box-shadow .35s var(--spring); }
  :is(.btn, .nav a, .tabs a, .theme-toggle):active { transform: scale(.95); transition-duration: .1s; }
  .seg span { transition: background-color .3s var(--spring), box-shadow .3s var(--spring); }
  input, select, textarea { transition: box-shadow .3s var(--spring), background-color .2s, border-color .2s; }
  .chev { transition: transform .45s var(--spring); }
}
