/* The Platform (Forman Transit Map) dashboard.
 * Styled to the Forman Consulting Services brand guide (MMXXVI): Maison Noir header bar with the
 * split-flap logo, Alabaster ground, Champagne rules, Grande Dame Rose accents, Maison Yellow
 * "reserved for moments of consequence" (active tab, the editing switch, the editor pill, selection).
 * Serif for voice (Cormorant Garamond), sans for function (Jost).
 * Map symbols keep the project's own palette (RapidRide crimson etc.) so the map reads as the client's line.
 */
.ftm {
  /* project (map symbol) palette */
  --rr-crimson: #96172E;
  --rr-yellow: #FCBA30;
  --rr-teal: #00665C;
  --rr-orange: #E87722;
  --rr-navy: #001871;
  --rr-purple: #4E1F70;
  --rr-gray: #626568;
  --rr-silver: #C8C9C7;

  /* Forman brand */
  --fcs-yellow: #F4C430;     /* Maison Yellow */
  --fcs-noir: #1A1714;       /* Maison Noir */
  --fcs-rose: #A8746F;       /* Grande Dame Rose */
  --fcs-alabaster: #FBF7EF;
  --fcs-blush: #F7D9D4;
  --fcs-gold: #B89A3A;       /* Antique Gold */
  --fcs-champagne: #EFE7D6;
  --fcs-warm-ink: #4A443B;
  --fcs-taupe: #8A8378;
  --fcs-espresso: #3A342C;

  --bg: var(--fcs-alabaster);
  --surface: #FFFFFF;
  --surface-2: #F7F2E8;
  --fg: var(--fcs-noir);
  --muted: #625B51;          /* taupe, darkened to pass 4.5:1 on white and alabaster */
  --line: var(--fcs-champagne);
  --line-strong: #D6CCB6;
  --bar: var(--fcs-noir);
  --bar-fg: var(--fcs-alabaster);
  --accent: #8F5D58;         /* Grande Dame Rose, deepened for text and fills under white */
  --accent-soft: #FBEAE6;    /* Blush, lightened */
  --hi: var(--fcs-yellow);
  --hi-soft: #FCF1CF;
  --label: #8A6E1E;          /* Antique Gold, deepened for small caps labels */
  --ok: #2F6B45;
  --ok-soft: #E4EFE5;
  --warn: #8A5A00;
  --warn-soft: #FBEFD3;
  --bad: #A3322A;
  --bad-soft: #F9E1DD;
  --focus: #C49330;
  --shadow: 0 1px 2px rgba(26, 23, 20, .06), 0 6px 20px rgba(26, 23, 20, .08);

  --font-ui: "Jost", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-head: "Cormorant Garamond", Georgia, "Times New Roman", serif;

  --ftm-h: 86vh;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ftm.ftm-auto {
    --bg: #1A1714; --surface: #24201B; --surface-2: #2C2722; --fg: #FBF7EF; --muted: #B5AC9E;
    --line: #3A342C; --line-strong: #4A443B; --bar: #110F0D; --accent: #D9A39D; --accent-soft: #3A2826;
    --hi-soft: #3B3218; --label: #D2B65A; --ok: #7CC596; --ok-soft: #1F3024; --warn: #F2B860; --warn-soft: #3A2D16;
    --bad: #F08A80; --bad-soft: #3D2120; --focus: #F4C430; color-scheme: dark;
  }
}
:root[data-theme="dark"] .ftm.ftm-auto {
  --bg: #1A1714; --surface: #24201B; --surface-2: #2C2722; --fg: #FBF7EF; --muted: #B5AC9E;
  --line: #3A342C; --line-strong: #4A443B; --bar: #110F0D; --accent: #D9A39D; --accent-soft: #3A2826;
  --hi-soft: #3B3218; --label: #D2B65A; --ok: #7CC596; --ok-soft: #1F3024; --warn: #F2B860; --warn-soft: #3A2D16;
  --bad: #F08A80; --bad-soft: #3D2120; --focus: #F4C430; color-scheme: dark;
}

.ftm, .ftm * { box-sizing: border-box; }
.ftm [hidden], .ftm[hidden] { display: none !important; }
.ftm {
  font: 400 15px/1.45 var(--font-ui); color: var(--fg); background: var(--bg);
  height: var(--ftm-h); min-height: 560px; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: relative;
  font-variant-numeric: lining-nums tabular-nums;
}
.ftm button, .ftm input, .ftm select, .ftm textarea { font: inherit; color: inherit; }
.ftm :focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ftm h2, .ftm h3 { font-family: var(--font-head); font-variant-numeric: lining-nums; font-weight: 500; margin: 0; line-height: 1.1; text-wrap: balance; letter-spacing: .01em; }
.ftm h4 { font-family: var(--font-ui); margin: 0; line-height: 1.2; }
.ftm b, .ftm strong { font-weight: 500; }

/* ---------- header bar (from the logo guide: Maison Noir, cream nav, yellow pill) ---------- */
.ftm-bar { background: var(--bar); color: var(--bar-fg); display: flex; align-items: center; gap: 10px 20px;
  padding: 0 22px; min-height: 84px; flex-wrap: wrap; }
/* The Platform logo. Built-in: split-flap tiles (#4A443B tiles, Alabaster letters, a
   Maison Noir split line), "THE" in yellow. Uploaded image: on a white tile unless set to "bare". */
.ftm { --flap-ink: #1A1714; --flap-tile: #4A443B; --flap-paper: #FBF7EF; }
.ftm-logo { display: flex; align-items: center; flex: none; }
.ftm-logo.img { justify-content: center; margin-left: -22px; padding: 6px 16px; background: #fff; align-self: stretch; max-width: 240px; }
.ftm-logo.img.bare { background: none; margin-left: 0; padding-inline: 0; }
.ftm-logo img { display: block; max-height: 40px; max-width: 208px; width: auto; height: auto; }
.ftm-logo.flap { flex-direction: column; align-items: flex-end; gap: 8px; padding-block: 14px; }
.ftm-logo.flap .mark { display: flex; align-items: center; gap: 12px; }
.ftm-logo.flap .byline { display: flex; align-items: center; gap: 10px; width: 213px; font: 500 8.5px/1 "Jost", var(--font-ui); letter-spacing: .38em; text-transform: uppercase; color: #B5AC9E; white-space: nowrap; }
.ftm-logo.flap .byline span { margin-right: -.38em; }
.ftm-logo.flap .byline i { flex: 1; height: 1px; background: var(--fcs-gold); }
.ftm-logo.flap .the { font: 500 9px/1 "Jost", var(--font-ui); letter-spacing: .46em; text-transform: uppercase; color: var(--hi); }
.ftm-logo.flap .tiles { display: flex; gap: 3px; }
.ftm-logo.flap .tiles span { position: relative; width: 24px; height: 33px; border-radius: 4px; background: var(--flap-tile); color: var(--flap-paper);
  display: flex; align-items: center; justify-content: center; font: 500 27px/1 "Cormorant Garamond", Georgia, serif; }
.ftm-logo.flap .tiles span::after { content: ""; position: absolute; left: 0; right: 0; top: 15.5px; height: 1.5px; background: var(--flap-ink); }
.ftm-brand { border-left: 1px solid rgba(251,247,239,.18); padding-left: 20px; }
.ftm-brand { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding-block: 8px; min-width: 0; }
.ftm-brand b { font: 500 22px/1 var(--font-head); letter-spacing: .02em; font-variant-numeric: lining-nums; }
.ftm-brand span { font: 500 10px/1 var(--font-ui); letter-spacing: .32em; text-transform: uppercase; color: var(--fcs-taupe); }
.ftm-bar { --barpad: 22px; }
/* the tabs: their own row under the logo, full names on one line */
.ftm-tabs { display: flex; gap: 4px; align-items: stretch; flex-wrap: nowrap; overflow: hidden; order: 9; flex: 1 0 100%;
  margin: 0 calc(-1 * var(--barpad)); padding: 0 calc(var(--barpad) - 14px); border-top: 1px solid #3A342C; }
.ftm-tab { background: none; border: 0; color: var(--bar-fg); opacity: .78; cursor: pointer; padding: 0 14px; white-space: nowrap; flex: none;
  font: 400 14.5px/1 var(--font-ui); letter-spacing: .05em; position: relative; min-height: 46px; }
.ftm-tab:hover { opacity: 1; }
.ftm-tab.two { white-space: nowrap; }
.ftm-tab.two br { display: none; }
.ftm-bar.stack .ftm-tab.two { line-height: 1.2; text-align: center; }
.ftm-bar.stack .ftm-tab.two br { display: inline; }
/* one-line tabs sit on the same line as the bottom line of the two-line tabs */
.ftm-bar.stack .ftm-tab:not(.two) { line-height: 1.2; padding-top: 1.2em; }
.ftm-tab[aria-selected="true"] { opacity: 1; font-weight: 500; }
.ftm-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 2px 2px 0 0; background: var(--hi); }
.ftm-bar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 10px; }
.ftm-search { position: relative; }
.ftm-search input { width: clamp(150px, 15vw, 240px); max-width: 46vw; border: 1px solid #4A443B; border-radius: 999px; padding: 8px 16px; background: var(--fcs-espresso); color: var(--fcs-alabaster); font: 400 14px var(--font-ui); }
.ftm-search input::placeholder { color: #B5AC9E; }
.ftm-search input:focus { border-color: var(--hi); outline: none; }
.ftm-results { position: absolute; right: 0; top: calc(100% + 6px); width: 340px; max-width: 86vw; max-height: 380px; overflow: auto;
  background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 1200; }
.ftm-results button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ftm-results button:hover, .ftm-results button.on { background: var(--hi-soft); }
.ftm-results small { display: block; color: var(--muted); }
.ftm-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: 400 14px var(--font-ui); letter-spacing: .06em; user-select: none; }
.ftm-switch input { appearance: none; width: 36px; height: 20px; border-radius: 10px; background: #4A443B; position: relative; margin: 0; cursor: pointer; }
.ftm-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--fcs-alabaster); transition: left .15s; }
.ftm-switch input:checked { background: var(--hi); }
.ftm-switch input:checked::after { left: 18px; background: var(--fcs-noir); }
/* the editor's name: the yellow pill from the logo guide header */
.ftm .ftm-iconbtn { border: 0; background: var(--hi); color: var(--fcs-noir); border-radius: 999px; padding: 9px 18px; cursor: pointer; font: 500 14px/1 var(--font-ui); letter-spacing: .02em; }
.ftm .ftm-iconbtn:hover { filter: brightness(1.05); }

.ftm-preview { background: var(--hi-soft); color: var(--fcs-noir); border-bottom: 1px solid var(--line); font-size: 13px; padding: 6px 22px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.ftm-preview b { font-weight: 500; }
.ftm-preview button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 1px 8px; cursor: pointer; font-size: 12px; }

/* ---------- views ---------- */
.ftm-main { flex: 1; min-height: 0; position: relative; display: flex; }
.ftm-view { flex: 1; min-width: 0; min-height: 0; display: flex; }
.ftm-mapview { position: relative; }

/* rail */
.ftm-rail { width: 262px; flex: none; background: var(--surface); border-right: 1px solid var(--line); overflow: auto; padding: 12px 12px 18px; display: flex; flex-direction: column; gap: 16px; }
.ftm-rail h4 { font: 500 11px/1.2 var(--font-ui); letter-spacing: .3em; text-transform: uppercase; color: var(--label); margin-bottom: 8px; }
.ftm-layer { display: grid; grid-template-columns: 18px 22px 1fr auto; align-items: center; gap: 6px; padding: 3px 0; font-size: 14px; }
.ftm-layer input { margin: 0; accent-color: var(--fcs-noir); }
.ftm-layer .n { color: var(--muted); font-size: 12px; }
.ftm-layer .add { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 3px; width: 22px; height: 20px; line-height: 16px; padding: 0; cursor: pointer; color: var(--muted); }
.ftm-layer .add:hover { border-color: var(--accent); color: var(--accent); }
.ftm-sym { width: 22px; height: 22px; display: block; object-fit: contain; }   /* square box: symbols keep their shape */
.ftm-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ftm-chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 13px; padding: 2px 9px 2px 6px; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
.ftm-chip[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.ftm-chip.plain { padding: 2px 10px; }
.ftm-chip i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.ftm-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.ftm-seg button { border: 0; background: var(--surface); padding: 5px 14px; cursor: pointer; font-size: 13px; }
.ftm-seg button[aria-pressed="true"] { background: var(--fcs-noir); color: var(--fcs-alabaster); }
.ftm-legend-note { font-size: 12px; color: var(--muted); }
.ftm-railtoggle { display: none; }

/* map */
.ftm-mapwrap { flex: 1; min-width: 0; position: relative; }
.ftm-map { position: absolute; inset: 0; background: var(--surface-2); }
.ftm-addhint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 900; background: var(--fcs-noir); color: var(--fcs-alabaster); padding: 6px 12px; border-radius: 4px; font-size: 13px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; }
.ftm-addhint button { border: 1px solid currentColor; background: none; color: inherit; border-radius: 3px; cursor: pointer; font-size: 12px; }

/* detail panel */
.ftm-panel { width: 420px; flex: none; background: var(--surface); border-left: 1px solid var(--line); overflow: auto; display: flex; flex-direction: column; }
.ftm-ph { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.ftm-ph .row1 { display: flex; align-items: flex-start; gap: 10px; }
.ftm-ph h2 .part { display: inline-block; }
.ftm-ph h2 { text-wrap: wrap; font-size: 30px; font-weight: 500; flex: 1; min-width: 0; }
.ftm-ph .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.ftm-x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 2px; }
.ftm-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.ftm-tag { font: 500 12px/1 var(--font-ui); padding: 5px 9px; border-radius: 999px; letter-spacing: .02em; border: 1px solid transparent; white-space: nowrap; }
.ftm-tag.tier { color: #fff; border-color: rgba(26,23,20,.12); }
.ftm-tag.plain { background: var(--surface-2); border-color: var(--line); color: var(--fg); }
.ftm-pair { display: inline-flex; margin-top: 10px; }
.ftm-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ftm-btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13px; font-weight: 500; letter-spacing: .02em; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; color: var(--fg); }
.ftm-btn:hover { border-color: var(--accent); color: var(--accent); }
.ftm-btn.primary { background: var(--fcs-noir); border-color: var(--fcs-noir); color: var(--fcs-alabaster); }
.ftm-btn.primary:hover { background: var(--fcs-espresso); color: var(--fcs-alabaster); }
.ftm-btn.danger { color: var(--bad); }
.ftm-btn.danger.armed { background: var(--bad); color: #fff; border-color: var(--bad); }
.ftm-btn:disabled { opacity: .5; cursor: default; }

.ftm-sec { border-bottom: 1px solid var(--line); }
.ftm-sec > summary { list-style: none; cursor: pointer; padding: 12px 16px; display: flex; align-items: center; gap: 8px; font: 500 12px/1.2 var(--font-ui); letter-spacing: .24em; text-transform: uppercase; }
.ftm-sec > summary::-webkit-details-marker { display: none; }
.ftm-sec > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
.ftm-sec[open] > summary::before { transform: rotate(45deg); }
.ftm-sec > summary .cnt { margin-left: auto; font: 600 12px var(--font-ui); color: var(--muted); letter-spacing: 0; text-transform: none; }
.ftm-secb { padding: 2px 16px 14px; display: flex; flex-direction: column; gap: 10px; }

.ftm-kv { display: grid; grid-template-columns: 118px 1fr; gap: 4px 10px; font-size: 14px; }
.ftm-kv dt { color: var(--muted); }
.ftm-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ftm-stat { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ftm-stat div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.ftm-stat b { display: block; font: 400 26px/1.05 var(--font-ui); font-variant-numeric: lining-nums tabular-nums; }
.ftm-stat small { color: var(--muted); font-size: 12px; }
.ftm-bars { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.ftm-barrow { display: grid; grid-template-columns: 72px 1fr 40px; align-items: center; gap: 6px; }
.ftm-barrow span:nth-child(2) { height: 9px; background: var(--surface-2); border-radius: 2px; position: relative; overflow: hidden; }
.ftm-barrow span:nth-child(2) i { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.ftm-barrow.fut span:nth-child(2) i { background: var(--hi); }
.ftm-src { font-size: 12px; color: var(--muted); }

.ftm-amen-g { font: 500 11px var(--font-ui); letter-spacing: .24em; color: var(--label) !important; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.ftm-amen { display: grid; grid-template-columns: 1fr auto auto; gap: 2px 10px; font-size: 14px; align-items: center; }
.ftm-amen .q { font-weight: 500; text-align: right; min-width: 22px; }
.ftm-amen input { width: 56px; text-align: right; }
.ftm-amen.ed { row-gap: 6px; }
.ftm .ftm-qty { width: 64px; text-align: right; }
.ftm-addrow { display: flex; gap: 6px; align-items: center; margin-top: 10px; }
.ftm-addrow select { flex: 1; min-width: 0; }
.ftm-trio { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.ftm-trio-l small { font-size: 11px; color: var(--muted); padding-left: 2px; }

.ftm-rec { border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; background: var(--surface); }
.ftm-rec .top { display: flex; gap: 8px; align-items: baseline; }
.ftm-rec .top b { flex: 1; min-width: 0; }
.ftm-rec .meta { color: var(--muted); font-size: 13px; }
.ftm-rec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.ftm-rec-grid label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; min-width: 0; }
.ftm-rec-grid label.wide { grid-column: 1 / -1; }
.ftm-in, .ftm-rec-grid input, .ftm-rec-grid select, .ftm-rec-grid textarea, .ftm-secb textarea, .ftm-secb select.ftm-in {
  border: 1px solid var(--line-strong); border-radius: 3px; padding: 5px 7px; background: var(--surface); color: var(--fg); font-size: 14px; width: 100%; min-width: 0; }
.ftm-secb textarea { min-height: 90px; resize: vertical; }
.ftm-empty { color: var(--muted); font-size: 14px; font-style: italic; }
.ftm-saved { font-size: 12px; color: var(--muted); }
.ftm-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.ftm-photo { display: block; aspect-ratio: 4 / 3; background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; max-width: 100%; padding: 0; cursor: zoom-in; }
.ftm-photo:hover { border-color: var(--accent); }
.ftm-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ftm-photo-miss { display: flex; align-items: center; justify-content: center; height: 100%; padding: 8px; font-size: 12px; color: var(--muted); text-align: center; }
.ftm-modal.wide { width: 1100px; }
.ftm-lb { align-items: center; }
.ftm-lb img { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 3px; }
.ftm-lb-miss { padding: 40px 20px; color: var(--muted); text-align: center; max-width: 520px; }
.ftm-svwrap { flex: none; }
.ftm-svnew { width: 26px; height: 26px; margin: 10px 4px 0 0; padding: 0; border: 0; border-radius: 2px; background: #222222; color: #E6E6E6; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ftm-svnew:hover { color: #FFFFFF; }
.ftm-sv { flex: none; height: 260px; border-radius: 4px; overflow: hidden; background: var(--surface-2); }

/* status pills */
.ftm-pill { display: inline-block; font: 500 12px/1 var(--font-ui); padding: 4px 8px; border-radius: 11px; white-space: nowrap; border: 1px solid transparent; }
.ftm-pill.s-C, .ftm-pill.s-done { background: var(--ok-soft); color: var(--ok); }
.ftm-pill.s-CO, .ftm-pill.s-bad { background: var(--bad-soft); color: var(--bad); }
.ftm-pill.s-IC, .ftm-pill.s-O, .ftm-pill.s-mid { background: var(--hi-soft); color: var(--warn); }
.ftm-pill.s-H, .ftm-pill.s-E, .ftm-pill.s-V, .ftm-pill.s-open { background: var(--warn-soft); color: var(--warn); }
.ftm-pill.s-na { background: var(--surface-2); color: var(--muted); border-color: var(--line); }

/* ---------- table views ---------- */
.ftm-tview { flex-direction: column; }
.ftm-tool { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.ftm-tool .r { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.ftm-tool h2 { font-size: 30px; font-weight: 500; margin-right: 8px; }
.ftm-tool .grow { flex: 1; }
.ftm-tool label { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.ftm-tool select, .ftm-tool input[type=search] { border: 1px solid var(--line-strong); border-radius: 3px; padding: 4px 7px; background: var(--surface); font-size: 14px; }
.ftm-sum { display: flex; flex-wrap: wrap; gap: 8px; }
.ftm-sum button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; cursor: pointer; text-align: left; min-width: 92px; }
.ftm-sum button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.ftm-sum b { display: block; font: 400 22px/1 var(--font-ui); font-variant-numeric: lining-nums tabular-nums; }
.ftm-sum small { font-size: 12px; color: var(--muted); }
.ftm-meta { font-size: 13px; color: var(--muted); }
.ftm-meta b { color: var(--fg); font-weight: 600; }
.ftm-tablewrap { flex: 1; min-height: 0; overflow: auto; background: var(--surface); }
table.ftm-t { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
.ftm-t th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; font: 500 12px/1.2 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; padding: 8px 10px; border-bottom: 2px solid var(--line-strong); white-space: nowrap; cursor: pointer; user-select: none; color: var(--muted); }
.ftm-t th.sorted { color: var(--fg); }
.ftm-t th.sorted::after { content: " \2193"; }
.ftm-t th.sorted.asc::after { content: " \2191"; }
.ftm-t th.num, .ftm-t td.num { text-align: right; }
.ftm-t td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ftm-t td.wrap { white-space: pre-line; min-width: 180px; max-width: 360px; }
.ftm-t td.nowrap { white-space: nowrap; }
.ftm-t td.link { color: var(--accent); cursor: pointer; font-weight: 500; }
.ftm-t td.link:hover { text-decoration: underline; }
.ftm-t tbody tr:hover td { background: var(--hi-soft); }
.ftm-t tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 500; border-top: 2px solid var(--line-strong); }
.ftm-t td.note { min-width: 220px; }
.ftm-t td.note textarea { width: 100%; min-height: 34px; border: 1px solid var(--line-strong); border-radius: 3px; padding: 4px 6px; background: var(--surface); font-size: 13px; resize: vertical; }
.ftm-t td .by { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.ftm-t td select, .ftm-t td input { border: 1px solid var(--line-strong); border-radius: 3px; padding: 3px 5px; background: var(--surface); font-size: 13px; max-width: 170px; }
.ftm-t .gov { color: var(--muted); font-size: 11px; font-weight: 400; display: block; text-transform: none; letter-spacing: 0; }

/* asset matrix */
.ftm-mx th.g { text-align: center; color: var(--fcs-alabaster); background: var(--fcs-warm-ink); border-left: 2px solid var(--surface); cursor: default; top: 0; }
.ftm-mx thead tr:nth-child(2) th { top: 31px; }
.ftm-mx th.item { white-space: normal; min-width: 84px; max-width: 110px; font-size: 11px; letter-spacing: .04em; vertical-align: bottom; font-weight: 500; }
.ftm-mx td.q { text-align: center; }
.ftm-mx td.q.z { color: var(--line-strong); }
.ftm-mx td.q input { width: 46px; text-align: center; }
.ftm-mx .stick { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.ftm-mx th.stick { z-index: 3; background: var(--surface-2); }
.ftm-mx .stick2 { position: sticky; left: 190px; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line-strong); }
.ftm-mx th.stick2 { z-index: 3; background: var(--surface-2); }
.ftm-mx td.stick { min-width: 190px; max-width: 190px; }
.ftm-mx tfoot td.stick, .ftm-mx tfoot td.stick2 { background: var(--surface-2); z-index: 3; }

/* modal / sheet */
.ftm-scrim { position: absolute; inset: 0; background: rgba(26, 23, 20, .5); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ftm-modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); width: 640px; max-width: 100%; max-height: 92%; overflow: auto; display: flex; flex-direction: column; }
.ftm-modal header { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.ftm-modal header h3 { font-size: 28px; flex: 1; }
.ftm-modal .b { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.ftm-modal footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.ftm-drop { border: 2px dashed var(--line-strong); border-radius: 6px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; }
.ftm-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.ftm-diff { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ftm-diff div { border: 1px solid var(--line); border-radius: 4px; padding: 8px; background: var(--surface-2); }
.ftm-diff b { display: block; font: 400 24px/1 var(--font-ui); font-variant-numeric: lining-nums tabular-nums; }
.ftm-list { margin: 0; padding-left: 18px; max-height: 180px; overflow: auto; font-size: 13px; }
.ftm-warn { background: var(--warn-soft); color: var(--warn); border-radius: 4px; padding: 8px 10px; font-size: 13px; }

.ftm-toast { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--fcs-noir); color: var(--fcs-alabaster); padding: 8px 16px; border-radius: 999px; font-size: 13px; z-index: 3000; box-shadow: var(--shadow); pointer-events: none; }
.ftm-toast.err { background: var(--bad); color: #fff; }

/* map label tooltip (leaflet + google share this class) */
.ftm-tip { font: 500 12px/1.2 var(--font-ui); background: #fff; color: #1A1714; border: 1px solid #D6CCB6; border-radius: 3px; padding: 3px 6px; box-shadow: 0 1px 3px rgba(0,0,0,.2); white-space: nowrap; }
.leaflet-tooltip.ftm-tip::before { display: none; }
.ftm .leaflet-container { font: inherit; background: var(--surface-2); }
.ftm-marker { background: none; border: 0; }

/* ---------- narrow screens ---------- */
/* the client / contract number line stays; it only goes when the header truly cannot fit */
.ftm-bar.tight .ftm-brand span { letter-spacing: .14em; }
@media (max-width: 1540px) {
  .ftm-brand span { letter-spacing: .2em; }
}
/* five tabs: keep the header on one line on laptop screens (logo never shrinks) */
@media (max-width: 1640px) {
  .ftm-bar { gap: 10px 14px; }
  .ftm-tab { padding: 0 11px; }
  .ftm-tab[aria-selected="true"]::after { left: 11px; right: 11px; }
  .ftm-search input { width: 140px; }
}
@media (max-width: 1400px) {
  .ftm-bar { padding: 0 18px; gap: 10px 12px; --barpad: 18px; }
  .ftm-brand { padding-left: 16px; }
  .ftm-search input { width: 130px; }
}
@media (max-width: 1240px) {
  .ftm-brand b { font-size: 19px; }
  .ftm-tab { padding: 0 9px; font-size: 14px; }
  .ftm-tab[aria-selected="true"]::after { left: 9px; right: 9px; }
  .ftm-search input { width: 118px; padding: 7px 12px; font-size: 13px; }
}
@media (max-width: 1100px) {
  .ftm-panel { position: absolute; right: 0; top: 0; bottom: 0; z-index: 1000; box-shadow: var(--shadow); width: min(420px, 100%); }
}
@media (max-width: 760px) {
  .ftm { --ftm-h: 92vh; }
  .ftm-rail { position: absolute; left: 0; top: 0; bottom: 0; z-index: 1001; box-shadow: var(--shadow); transform: translateX(-105%); transition: transform .2s; }
  .ftm-rail.open { transform: none; }
  .ftm-railtoggle { display: block; position: absolute; right: 10px; top: 10px; z-index: 950; }
  .ftm-search input { width: 150px; }
  .ftm-bar { gap: 4px 12px; padding: 4px 12px 0; --barpad: 12px; }
  .ftm-tab { min-height: 40px; }
  .ftm-logo.flap { padding-block: 10px; }
  .ftm-brand span { letter-spacing: .14em; font-size: 9px; }
  .ftm-logo.img { margin-left: -12px; padding: 4px 10px; }
  .ftm-logo img { max-height: 30px; max-width: 130px; }
  .ftm-brand { border-left: 0; padding-left: 0; }
  .ftm-tab { padding: 0 8px; font-size: 14px; }
  .ftm-bar-right { margin-left: 0; width: 100%; }
  .ftm-preview { font-size: 12px; padding: 4px 10px; }
  .ftm-panel { top: auto; height: 62%; width: 100%; border-left: 0; border-top: 1px solid var(--line); }
  .ftm-tool h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .ftm * { transition: none !important; } }
.ftm-mx td.ed { cursor: pointer; }
.ftm-mx td.ed:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.ftm-t td.nowrap { white-space: pre; }
.ftm-tool .r > .ftm-meta { flex: 0 1 auto; min-width: 0; }

/* Inside a WordPress page: break out of the theme's text column to (almost) the full window width. */
.ftm.ftm-full { width: calc(100vw - 48px); max-width: 1800px; position: relative; left: 50%; transform: translateX(-50%); margin-block: 8px; }
@media (max-width: 760px) { .ftm.ftm-full { width: calc(100vw - 24px); } }

/* parcel labels */
.ftm-plabel { background: none; border: 0; }
.ftm-plabel span { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font: 600 11px/1 var(--font-ui); color: #3A3B3D; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; pointer-events: none; }
.ftm-plabel.row span { color: #82534E; background: #fff; border: 1.5px solid #82534E; border-radius: 9px; padding: 2px 6px; text-shadow: none; font-size: 11.5px; }
.ftm-plabel.aerial span { color: #fff; text-shadow: 0 0 2px #000, 0 0 3px #000; }
.ftm-plabel-g { background: #fff; border: 1.5px solid #82534E; border-radius: 9px; padding: 1px 5px; }
.ftm-plabel-g:not(.row) { background: none; border: 0; text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.ftm-help { margin: 0; font-size: 13px; color: var(--muted); }
.ftm-addhint button:disabled { opacity: .45; cursor: default; }
.ftm-addhint button { padding: 3px 9px; }
.ftm-photo-wrap { position: relative; min-width: 0; }
.ftm-photo-wrap .ftm-photo { width: 100%; display: block; }
.ftm .ftm-photo-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(26,23,20,.78); color: #fff; font-size: 16px; line-height: 24px; padding: 0; cursor: pointer; }
.ftm .ftm-photo-x:hover { background: var(--bad); }

/* utilities sub-tabs, relocation marks, tier picker in Station assets */
.ftm-subtabs { padding: 12px 16px 0; }
.ftm-subtabs .ftm-seg button { padding: 7px 18px; font: 500 13px/1 var(--font-ui); }
.ftm-tool .r > .ftm-subtabs, .ftm-tool > .ftm-subtabs.under { padding: 0; }
.ftm-tool > .ftm-subtabs.under { margin: 2px 0 6px; }
.ftm-t td.mark { text-align: center; font-weight: 600; }
.ftm .ftm-tiersel { font: 400 12px/1.2 var(--font-ui); padding: 3px 4px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--fg); max-width: 120px; }

/* Editing switch with "Undo all changes" underneath */
.ftm-editwrap { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ftm .ftm-undoall { border: 1px solid rgba(244,196,48,.55); background: transparent; color: var(--fcs-alabaster); font: 400 11.5px/1 var(--font-ui); letter-spacing: .04em; padding: 4px 9px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.ftm .ftm-undoall:hover:not(:disabled) { background: var(--hi); color: var(--fcs-noir); }
.ftm .ftm-undoall:disabled { opacity: .45; cursor: default; }
.ftm-mx th.item .ftm-colx { display: block; margin: 4px auto 0; font-size: 14px; line-height: 1; }

/* a new map item: not saved until Save */
.ftm-draftbar { position: sticky; top: 0; z-index: 5; display: flex; flex-direction: column; gap: 8px; padding: 12px 18px; background: var(--hi-soft, #FDF3D3); border-bottom: 2px solid var(--hi); font: 400 13.5px/1.35 var(--font-ui); }
.ftm-draftbtns { display: flex; gap: 8px; }

/* panel titles: typed line breaks, and street pairs kept together */
.ftm-ph h2 .line { display: block; }
.ftm-ph h2 .nowrap { white-space: nowrap; }
.ftm-ph textarea#ftm-fname { font: 500 24px/1.15 var(--font-head); width: 100%; min-height: 64px; resize: vertical; }

/* frozen columns on the ROW, Utilities and Electrical Services tables */
.ftm-t td.frz, .ftm-t th.frz { position: sticky; z-index: 2; }
.ftm-t td.frz { background: var(--surface); }
.ftm-t tfoot td.frz { background: var(--surface-2); }
.ftm-t thead th.frz { z-index: 4; }
.ftm-t .frz-last { box-shadow: inset -1px 0 0 var(--line-strong), 6px 0 6px -6px rgba(26,23,20,.25); }

/* Save / Discard while editing an item on the map */
.ftm-pendbar { background: var(--surface-2); border-bottom-color: var(--line-strong); }
.ftm-pendbar.dirty { background: var(--hi-soft); border-bottom-color: var(--hi); }
.ftm-titleedit { display: flex; align-items: flex-start; gap: 8px; width: 100%; }
.ftm-titleedit .dir { font: 500 24px/1.6 var(--font-head); }
.ftm-titleedit textarea { flex: 1; }
.ftm-ph .ftm-titleedit textarea#ftm-fname { font: 500 24px/1.15 var(--font-head); min-height: 40px; resize: vertical; }

.ftm-sum button.zero b { color: var(--muted); }

/* ---------- Cost estimate ---------- */
.ftm-estdash { padding: 4px 16px 8px; display: flex; flex-direction: column; gap: 14px; }
.ftm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.ftm-kpi { background: var(--fcs-noir); color: var(--fcs-alabaster); border-radius: 10px; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 4px; border-top: 3px solid var(--hi); min-width: 0; }
.ftm-kpi b { font: 400 30px/1 var(--font-ui); letter-spacing: -.01em; font-variant-numeric: lining-nums tabular-nums; }
.ftm-kpi span { font: 500 10.5px/1.2 var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: #D2C6A8; }
.ftm-kpi small { font-size: 12px; color: #B5AC9E; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ftm-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.ftm-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.ftm-card h4 { margin: 0 0 10px; font: 500 10.5px/1 var(--font-ui); letter-spacing: .18em; text-transform: uppercase; color: var(--label, var(--fcs-gold)); }
.ftm-bars { display: flex; flex-direction: column; gap: 5px; }
.ftm-barline { display: grid; grid-template-columns: minmax(90px, 42%) 1fr auto; align-items: center; gap: 8px; font-size: 12.5px; }
.ftm-barline.click { cursor: pointer; }
.ftm-barline.click:hover .l { text-decoration: underline; }
.ftm-barline .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ftm-barline .t { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.ftm-barline .t i { display: block; height: 100%; border-radius: 5px; }
.ftm-barline .v { font-variant-numeric: tabular-nums; color: var(--fg); font-weight: 500; min-width: 54px; text-align: right; }
.ftm-share { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: var(--surface-2); }
.ftm-share i { display: block; height: 100%; }
.ftm-sharekey { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12.5px; }
.ftm-sharekey b { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.ftm-sharekey em { color: var(--muted); font-style: normal; }
.ftm-t tr.ftm-exprow { cursor: pointer; }
.ftm-t tr.ftm-exprow.open td { background: var(--surface); font-weight: 500; }
.ftm-t tr.ftm-exprow.open td.exp { box-shadow: inset 4px 0 0 var(--hi); }
.ftm-t td.exp { width: 28px; padding-right: 0; }
.ftm .ftm-expbtn { border: 0; background: none; cursor: pointer; font-size: 13px; color: var(--muted); padding: 0 4px; }
.ftm-t tr.ftm-expbody > td { padding: 0 10px 14px 38px; background: var(--surface); }
.ftm-t.ftm-sub { width: 100%; background: var(--surface); margin-top: 6px; border: 1px solid var(--line); }
.ftm-t.ftm-sub th { font-size: 10.5px; }
/* expanded estimate rows: white, no hover tint; the area name and headings pin under the main heading */
.ftm-t tbody tr.ftm-expbody:hover td, .ftm-t tbody tr.ftm-exprow.open:hover td, .ftm-t.ftm-sub tbody tr:hover td { background: var(--surface); }
.ftm-t.ftm-sub thead tr.cap th { position: sticky; top: var(--mh, 44px); z-index: 3; background: var(--fcs-noir); color: var(--fcs-alabaster); text-transform: none; letter-spacing: 0; font: 400 13px/1.2 var(--font-ui); padding: 8px 10px; border-bottom: 0; cursor: default; }
.ftm-t.ftm-sub thead tr.cap th b { font-weight: 500; margin-right: 10px; }
.ftm-t.ftm-sub thead tr.cap th span { color: #D2C6A8; }
.ftm-t.ftm-sub thead tr.cols th { position: sticky; top: calc(var(--mh, 44px) + 32px); z-index: 3; background: var(--surface-2); cursor: default; }
.ftm-t td.strong { font-weight: 500; }
.ftm-t td.links .link { color: var(--accent); cursor: pointer; display: block; white-space: nowrap; }
.ftm-t td.links .link:hover { text-decoration: underline; }
.ftm-t tr.major td { border-top: 1px solid var(--line-strong); }
.ftm-t tr.minor td { color: var(--fg); font-size: 12.5px; }
.ftm-t td.barcell { width: 22%; min-width: 120px; }
.ftm-t td.barcell i { display: block; height: 10px; border-radius: 5px; background: #4A443B; }
.ftm-t td.barcell.light i { background: #C49330; }
.ftm-t tfoot td { font-weight: 500; }
.ftm-estbig { font: 500 18px/1 var(--font-ui); font-variant-numeric: tabular-nums; }
.ftm-estnote { font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-left: 3px solid var(--hi); padding: 6px 8px; margin: 6px 0 10px; }

/* "Columns" dropdown: show / hide table columns */
.ftm-cols { position: relative; }
.ftm-cols > summary { list-style: none; cursor: pointer; user-select: none; }
.ftm-cols > summary::-webkit-details-marker { display: none; }
.ftm-colmenu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 300px; max-height: 420px; overflow: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); padding: 8px 0; }
.ftm-colhead { display: flex; align-items: center; gap: 10px; padding: 4px 14px 8px; border-bottom: 1px solid var(--line); }
.ftm-colhead b { flex: 1; font: 500 10.5px/1 var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--label, var(--fcs-gold)); }
.ftm .ftm-linkbtn { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 12.5px; padding: 0; }
.ftm-colbody { padding: 6px 0; }
.ftm-colopt { display: flex; align-items: center; gap: 8px; padding: 4px 14px; font-size: 13px; cursor: pointer; }
.ftm-colopt:hover { background: var(--hi-soft); }
.ftm-colopt input { accent-color: var(--fcs-noir); }
.ftm-colopt.g { font-weight: 500; margin-top: 4px; }
.ftm-colgroup .ftm-colopt:not(.g) { padding-left: 34px; }
.ftm .ftm-colmenu .ftm-colbody { display: flex; flex-direction: column; }
.ftm .ftm-colmenu label.ftm-colopt { display: flex; width: auto; margin: 0; flex-direction: row; font-size: 13px; color: var(--fg); letter-spacing: 0; text-transform: none; }

/* ROW: inset map that follows the row you are on */
.ftm-rowsplit { display: flex; flex: 1; min-height: 0; gap: 0; }
.ftm-rowsplit > .ftm-tablewrap { flex: 1; min-width: 0; }
.ftm-inset { flex: none; width: 360px; border-left: 1px solid var(--line); background: var(--surface-2); overflow: auto; display: flex; flex-direction: column; }
.ftm-insethead { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ftm-insethead b { flex: 1; font: 500 10.5px/1 var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--label, var(--fcs-gold)); }
.ftm-insethead label { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; cursor: pointer; }
.ftm-insethead input { accent-color: var(--fcs-noir); }
.ftm-insetmap { height: 270px; flex: none; background: #F3EEE3; }
.ftm-insetinfo { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); flex: 1; }
.ftm-insetinfo .top { display: flex; align-items: flex-start; gap: 8px; }
.ftm-insetinfo .top b { flex: 1; font: 500 19px/1.15 var(--font-head); }
.ftm-insetinfo .meta { font-size: 12.5px; color: var(--muted); }
.ftm-insetinfo .nums { display: flex; gap: 14px; font-size: 12.5px; }
.ftm-insetinfo .acts { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.ftm-t tbody tr.cur td { background: var(--hi-soft); }
.ftm-t tbody tr.cur td:first-child { box-shadow: inset 4px 0 0 var(--hi); }
@media (max-width: 1100px) { .ftm-inset { display: none; } }
.ftm-inset .leaflet-control-attribution { font-size: 9px; line-height: 1.3; }
.ftm-estscroll { flex: 1; min-height: 0; overflow: auto; padding-top: 10px; }
.ftm-estscroll .ftm-charts { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }

.ftm .ftm-tag.est { background: var(--fcs-noir); color: var(--hi); border: 0; cursor: pointer; font-weight: 500; }
.ftm .ftm-tag.est:hover { background: #2C2722; }
.ftm-sched { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 2px 0 8px; }
.ftm-sched > div { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; padding: 6px 10px; font-size: 13px; border-top: 1px solid var(--line); }
.ftm-sched > div:first-child { border-top: 0; }
.ftm-sched b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ftm-sched span { color: var(--muted); font-size: 12px; }
.ftm-sched strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.ftm-secall { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.ftm-secall .ftm-linkbtn { font-size: 12.5px; }

/* Station Assets: thin line where each asset group starts */
.ftm-mx th.item.gs, .ftm-mx td.gs { border-left: 1px solid var(--line-strong); }
.ftm-mx th.g + th.g { border-left: 1px solid var(--line-strong); }

/* ROW table: compact type, matching Station Assets */
table.ftm-rowt { font-size: 12.5px; }
.ftm-rowt th { font-size: 11px; letter-spacing: .04em; padding: 6px 8px; }
.ftm-rowt td { padding: 5px 8px; }
.ftm-rowt .ftm-tag { font-size: 11px; }

/* Estimate: station tier tab */
.ftm-tierdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }

/* Estimate: by AHJ */
.ftm-pies { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; margin-top: 10px; }
.ftm-pie h4, .ftm-ahjtotal h4 { margin: 0; }
.ftm-pie .big, .ftm-ahjtotal .big { font-size: 26px; font-weight: 600; line-height: 1.15; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
#ftm-ahj-by { width: auto; min-width: 220px; }
.ftm-pie .pie { display: flex; align-items: center; justify-content: center; height: 250px; margin: 8px 0; }
.ftm-pie .pie path, .ftm-pie .pie circle { cursor: default; }
.ftm-pie .pie path:hover, .ftm-pie .pie circle:hover { opacity: .85; }
.ftm-pie .rows { display: grid; gap: 4px; font-size: 13px; }
.ftm-pie .pl { display: grid; grid-template-columns: 12px 1fr auto 46px; gap: 8px; align-items: center; }
.ftm-pie .pl b { width: 12px; height: 12px; border-radius: 3px; }
.ftm-pie .pl .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftm-pie .pl .v { font-variant-numeric: tabular-nums; }
.ftm-pie .pl em { font-style: normal; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.ftm-ahjtotal { display: grid; gap: 8px; }
.ftm-ahjtable { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ftm-ahjtable .ftm-t th { position: static; }

/* SCC page: major codes read as headers over their minor codes */
.ftm-t tbody tr.sccmaj td, .ftm-t tbody tr.sccmaj:hover td, .ftm-t tbody tr.sccmaj.ftm-exprow.open td, .ftm-t tbody tr.sccmaj.ftm-exprow.open:hover td { background: rgba(196, 147, 48, .16); border-top: 2px solid var(--line-strong); font-weight: 600; }
.ftm-t tbody tr.sccmaj + tr.minor td { border-top: 0; }
.ftm-t tbody tr.minor td:nth-child(2) { padding-left: 22px; }

/* anything clickable reads as a link: black text, underlined */
.ftm-t td.link, .ftm-t span.link, .ftm-t td.links .link { color: var(--fg); cursor: pointer; font-weight: inherit; text-decoration: underline; text-decoration-color: var(--muted); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ftm-t td.link:hover, .ftm-t span.link:hover, .ftm-t td.links .link:hover { text-decoration-color: var(--fg); text-decoration-thickness: 2px; }
.ftm-barline.click .l { text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.ftm-barline.click:hover .l { text-decoration-color: var(--fg); text-decoration-thickness: 2px; }
.ftm-barline.click:hover { background: var(--surface-2); border-radius: 4px; }

/* narrow screens: the tabs fold into a menu button */
.ftm-navmenu { display: none; position: relative; align-self: center; }
.ftm-bar.menu .ftm-tabs { display: none; }
.ftm-bar.menu .ftm-navmenu { display: block; }
.ftm-navbtn { display: flex; align-items: center; gap: 10px; background: none; border: 1px solid #4A443B; border-radius: 8px; color: var(--bar-fg); padding: 8px 12px; cursor: pointer; font: 500 15px/1 var(--font-ui); letter-spacing: .04em; }
.ftm-navbtn:hover, .ftm-navbtn[aria-expanded="true"] { border-color: var(--hi); }
.ftm-navbtn .burger { display: flex; flex-direction: column; gap: 4px; width: 18px; }
.ftm-navbtn .burger i { display: block; height: 2px; border-radius: 1px; background: currentColor; }
.ftm-navbtn .lbl { border-bottom: 2px solid var(--hi); padding-bottom: 3px; }
.ftm-navbtn .car { font-size: 11px; opacity: .7; }
.ftm-navlist { position: absolute; left: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 1300; padding: 6px; }
.ftm-navlist button { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 10px 12px; font: 400 15px/1.2 var(--font-ui); color: var(--fg); cursor: pointer; }
.ftm-navlist button:hover, .ftm-navlist button:focus-visible { background: var(--surface-2); outline: none; }
.ftm-navlist button[aria-current] { font-weight: 600; box-shadow: inset 3px 0 0 var(--hi); }
.ftm-navlist.right { left: auto; right: 0; }

/* ROW status pills: brand color dot on a light tint of the same color */
.ftm-pill.st { color: var(--fg); display: inline-flex; align-items: center; gap: 6px; }
.ftm-pill.st i { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ======================================================================
   Small windows, tablets and phones.
   When the window is narrow or short, the page scrolls as a whole instead of squeezing
   everything into one screen: the header and tools scroll away, and each table gets
   (almost) a full screen of its own, with its headings still pinned while it scrolls.
   ====================================================================== */
@media (max-width: 900px), (max-height: 700px) {
  .ftm { height: auto; min-height: 0; overflow: visible; }
  .ftm-main { display: block; }
  .ftm-view.ftm-tview { display: block; }
  .ftm-tview .ftm-tablewrap { max-height: calc(100svh - 16px); min-height: 0; overflow: auto; }
  .ftm-rowsplit { display: block; }
  .ftm-estscroll { overflow: visible; }
  .ftm-mapview { display: flex; height: max(440px, calc(100svh - 16px)); }
  .ftm-bar { border-radius: 12px 12px 0 0; }
}
/* tablets and phones */
@media (max-width: 900px) {
  .ftm-tool { padding: 10px 12px; }
  .ftm-tool h2 { font-size: 22px; }
  .ftm-subtabs { padding: 10px 12px 0; }
  .ftm-seg { display: flex; flex-wrap: wrap; border-radius: 12px; }
  .ftm-seg button { white-space: nowrap; flex: 1 1 auto; }
  .ftm-subtabs .ftm-seg button { padding: 8px 12px; }
  .ftm-charts, .ftm-estscroll .ftm-charts { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
  .ftm-pies { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
  .ftm-estdash { padding-inline: 12px; }
  .ftm-panel { width: 100%; }
}
/* phones */
@media (max-width: 600px) {
  .ftm.ftm-full { width: calc(100vw - 12px); margin-block: 4px; }
  .ftm { border-radius: 10px; font-size: 14px; }
  .ftm-preview { padding: 4px 10px; gap: 6px 10px; }
  .ftm-preview button { margin-left: auto; }
  .ftm-tool .r { gap: 8px 10px; }
  .ftm-tool label { flex-wrap: wrap; }
  .ftm-tool input[type=search] { width: 100%; min-width: 0; }
  .ftm-tool .r > label:has(input[type=search]) { flex: 1 1 100%; }
  .ftm-tool .r > label:has(input[type=search]) input { flex: 1; }
  .ftm-btn { padding: 7px 12px; font-size: 14px; }
  /* status / tier tiles: two rows of small tiles instead of a tall stack */
  .ftm-sum { gap: 6px; }
  .ftm-sum button { min-width: 0; flex: 1 1 calc(25% - 6px); padding: 5px 7px; }
  .ftm-sum b { font-size: 18px; }
  .ftm-sum small { font-size: 11px; }
  /* cost estimate headline numbers: two per row */
  .ftm-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ftm-kpi b { font-size: 22px; }
  .ftm-kpi { padding: 10px 12px; }
  .ftm-kpi span { letter-spacing: .14em; font-size: 9.5px; }
  /* station assets: narrower pinned station column */
  .ftm-mx td.stick { min-width: 128px; max-width: 128px; }
  .ftm-mx .stick2 { left: 128px; }
  .ftm-mx th.item { min-width: 66px; }
  .ftm-pie .pie { height: auto; }
  .ftm-pie .pie svg { max-width: 100%; height: auto; }
  .ftm-mapview { height: max(480px, calc(100svh - 12px)); }
  .ftm-panel { height: 58%; }
}
@media (max-width: 600px) {
  /* station assets: only the station column stays pinned on a phone */
  .ftm-mx .stick2, .ftm-mx th.stick2, .ftm-mx tfoot td.stick2 { position: static; box-shadow: none; }
  .ftm-mx td.stick { box-shadow: 1px 0 0 var(--line-strong); }
  /* ROW area totals: three across, no divider */
  .ftm-sum > div { flex: 1 1 30%; padding: 4px 6px !important; }
  .ftm-sum > div[style*="border-left"] { display: none; }
  .ftm-sum > div b { font-size: 18px !important; }
}
.ftm-mx th.loc, .ftm-mx td.loc { text-align: center; white-space: nowrap; color: var(--muted); }
.ftm-mx th.loc { min-width: 54px; }

/* ROW overview */
.ftm-barline .t.stack { display: flex; }
.ftm-barline .t.stack i { border-radius: 0; }
.ftm-barline .t.stack i:first-child { border-radius: 5px 0 0 5px; }
.ftm-barline .t.stack i:last-child { border-radius: 0 5px 5px 0; }
.ftm-card.wide { grid-column: 1 / -1; }
.ftm-mini { font-size: 13px; }
.ftm-mini th { position: static; font-size: 11px; padding: 6px 8px; }
.ftm-mini td { padding: 6px 8px; }
@media (max-width: 600px) { .ftm-card.wide { overflow-x: auto; } }
@media (max-width: 600px) { .ftm-kpi small { white-space: normal; } }

/* ROW by acquisition type */
.ftm-acq { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.ftm-acqt { display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.ftm-acqt b { font: 500 11px/1.2 var(--font-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--label); }
.ftm-acqt .big { font-size: 20px; font-variant-numeric: tabular-nums; }
.ftm-mixst { display: flex; align-items: center; gap: 8px; min-width: 200px; }
.ftm-mixst .bar { display: flex; width: 80px; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-2); flex: none; }
.ftm-mixst .bar i { height: 100%; }
.ftm-mixst .txt { font-size: 12px; color: var(--muted); }
@media (max-width: 600px) { .ftm-acq { grid-template-columns: 1fr; } }

/* ===== Overview chart kit ===== */
.ftm-donutwrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ftm-donut { flex: none; }
.ftm-donut .big { font: 500 22px/1 var(--font-ui); fill: var(--fg); font-variant-numeric: tabular-nums; }
.ftm-donut .sub { font: 400 11px/1 var(--font-ui); fill: var(--muted); }
.ftm-donut path:hover { opacity: .85; }
.ftm-dkey { display: grid; gap: 6px; flex: 1 1 180px; min-width: 0; font-size: 13px; }
.ftm-dkey .kr { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 46px; gap: 8px; align-items: center; padding: 2px 4px; border-radius: 4px; }
.ftm-dkey .kr b { width: 10px; height: 10px; border-radius: 2px; }
.ftm-dkey .kr .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftm-dkey .kr em { font-style: normal; color: var(--muted); text-align: right; font-size: 12px; }
.ftm-dkey .kr.click { cursor: pointer; }
.ftm-dkey .kr.click .l { text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.ftm-dkey .kr.click:hover { background: var(--surface-2); }
.ftm-rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.ftm-rings .rg { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ftm-rings .big { font: 500 20px/1 var(--font-ui); fill: var(--fg); }
.ftm-rings .l { font-size: 13px; }
.ftm-waffle { display: grid; grid-template-columns: repeat(26, 1fr); gap: 3px; }
.ftm-waffle i { aspect-ratio: 1; border-radius: 2px; }
.ftm-waffle i.click { cursor: pointer; }
.ftm-waffle i.click:hover { outline: 2px solid var(--hi); outline-offset: 1px; }
.ftm-sharekey .click { cursor: pointer; text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.ftm-bullets { display: grid; gap: 14px; }
.ftm-bullets .bl { display: grid; grid-template-columns: 120px 1fr 64px; gap: 10px; align-items: center; padding: 2px 4px; border-radius: 6px; }
.ftm-bullets .bl.click { cursor: pointer; }
.ftm-bullets .bl.click:hover { background: var(--surface-2); }
.ftm-bullets .nm { display: flex; flex-direction: column; }
.ftm-bullets .nm b { font-weight: 600; text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.ftm-bullets .nm .over { color: #B0321E; font-size: 12px; } .ftm-bullets .nm .under { color: #2E7D4F; font-size: 12px; }
.ftm-bullets .tr { position: relative; height: 26px; }
.ftm-bullets .tr i { position: absolute; left: 0; display: block; border-radius: 3px; }
.ftm-bullets .tr .cont { top: 0; height: 26px; background: var(--surface-2); }
.ftm-bullets .tr .bud { top: 0; height: 26px; background: #E3DCCD; }
.ftm-bullets .tr .cost { top: 8px; height: 10px; border-radius: 2px; }
.ftm-bullets .tr .tick { top: -3px; width: 2px; height: 32px; background: var(--fg); border-radius: 1px; transform: translateX(-1px); }
.ftm-bullets .v { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.ftm-sharekey b.kb-bud { background: #E3DCCD; } .ftm-sharekey b.kb-cont { background: var(--surface-2); box-shadow: inset 0 0 0 1px #E3DCCD; }
.ftm-dots { display: grid; gap: 7px; }
.ftm-dots .dr { display: grid; grid-template-columns: minmax(120px, 42%) 1fr 54px; gap: 10px; align-items: center; font-size: 12.5px; padding: 1px 4px; border-radius: 4px; }
.ftm-dots .dr.click { cursor: pointer; }
.ftm-dots .dr.click .l { text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.ftm-dots .dr.click:hover { background: var(--surface-2); }
.ftm-dots .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftm-dots .tr { position: relative; height: 16px; }
.ftm-dots .tr i { position: absolute; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; }
.ftm-dots .tr .rng { transform: translateY(-50%); height: 6px; border-radius: 3px; background: var(--surface-2); min-width: 2px; }
.ftm-dots .tr .pt { width: 6px; height: 6px; opacity: .55; }
.ftm-dots .tr .avg { width: 13px; height: 13px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.ftm-dots .v { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.ftm-sharekey b.kb-dot { border-radius: 50%; background: var(--muted); width: 6px; height: 6px; } .ftm-sharekey b.kb-dot.big { width: 12px; height: 12px; }
.ftm-tree { display: block; width: 100%; height: auto; }
.ftm-tree .tn { font: 500 11px/1 var(--font-ui); } .ftm-tree .tv { font: 600 11px/1 var(--font-ui); }
.ftm-tree g:hover rect { opacity: .85; }
.ftm-colchart { display: block; max-height: 240px; }
.ftm-colchart .cv { font: 500 13px/1 var(--font-ui); fill: var(--fg); } .ftm-colchart .cl { font: 400 12px/1 var(--font-ui); fill: var(--muted); }
.ftm-corr { display: block; }
.ftm-corr .cl { font: 400 13px/1 var(--font-ui); fill: var(--muted); }
.ftm-corr g:hover rect[rx] { opacity: .8; }
@media (max-width: 600px) {

  .ftm-waffle { grid-template-columns: repeat(13, 1fr); }
  .ftm-bullets .bl { grid-template-columns: 84px 1fr 54px; gap: 8px; }
  .ftm-rings svg { width: 84px; height: 84px; }
}
.ftm-corr { height: 220px; }
.ftm-corrax { display: flex; gap: 4px; }
.ftm-corrax span { border-top: 3px solid; border-radius: 2px; padding-top: 4px; text-align: center; font-size: 12.5px; color: var(--muted); min-width: 0; overflow: hidden; white-space: nowrap; }
.ftm-tree .tn { font-size: 13px; } .ftm-tree .tv { font-size: 13px; }
@media (max-width: 600px) { .ftm-corr { height: 170px; } }
/* largest work areas: ranked dots */
.ftm-lolli .lr { display: grid; grid-template-columns: minmax(0, 44%) 1fr 58px; gap: 8px; align-items: center; font-size: 12.5px; padding: 3px 4px; border-radius: 4px; }
.ftm-lolli .lr.click { cursor: pointer; } .ftm-lolli .lr.click:hover { background: var(--surface-2); }
.ftm-lolli .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ftm-lolli .l b { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.ftm-lolli .l u { text-decoration-color: var(--muted); text-underline-offset: 3px; }
.ftm-lolli .t { position: relative; height: 12px; margin-right: 8px; }
.ftm-lolli .stem { position: absolute; left: 0; top: 5px; height: 2px; background: var(--line-strong); }
.ftm-lolli .head { position: absolute; top: 0; width: 12px; height: 12px; border-radius: 50%; transform: translateX(-50%); }
.ftm-lolli .v { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.ftm-lolli .lr.rest { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 7px; color: var(--muted); }
/* ROW budget vs current cost: plain labeled bars with the values */
.ftm-bvc { display: grid; gap: 12px; }
.ftm-bvc .blk { display: grid; gap: 4px; padding: 4px 6px; border-radius: 6px; }
.ftm-bvc .blk.click { cursor: pointer; } .ftm-bvc .blk.click:hover { background: var(--surface-2); }
.ftm-bvc .hd { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ftm-bvc .hd b { font-weight: 600; text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.ftm-bvc .df { font-size: 12.5px; font-weight: 500; } .ftm-bvc .df.over { color: #B0321E; } .ftm-bvc .df.under { color: #2E7D4F; }
.ftm-bvc .bar { display: grid; grid-template-columns: 100px 1fr 84px; gap: 8px; align-items: center; font-size: 12.5px; }
.ftm-bvc .bar .k { color: var(--muted); }
.ftm-bvc .bar .t { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.ftm-bvc .bar .t i { display: block; height: 100%; border-radius: 5px; }
.ftm-bvc .bar .v { text-align: right; font-variant-numeric: tabular-nums; } .ftm-bvc .bar .v.strong { font-weight: 600; }
.ftm-bvc .tot { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; border-top: 1px solid var(--line); padding: 8px 6px 0; font-size: 12.5px; }
.ftm-bvc .tot span:not(.df) { color: var(--muted); flex: 1; }
@media (max-width: 600px) { .ftm-bvc .bar { grid-template-columns: 86px 1fr 72px; } }
/* ROW CMOUs signed */
.ftm-rings:has(.rg:nth-child(2):last-child) { grid-template-columns: repeat(2, 1fr); }
.ftm-cmou { margin-bottom: 14px; } .ftm-cmou .big { font-size: 40px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.ftm-cmoub { display: grid; gap: 6px; }
.ftm-cmoub .br { display: grid; grid-template-columns: 64px 1fr 28px; gap: 8px; align-items: center; font-size: 13px; padding: 2px 4px; border-radius: 4px; }
.ftm-cmoub .br.click { cursor: pointer; } .ftm-cmoub .br.click:hover { background: var(--surface-2); }
.ftm-cmoub .br .l { text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.ftm-cmoub .t { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; } .ftm-cmoub .t i { display: block; height: 100%; border-radius: 5px; }
.ftm-cmoub .v { text-align: right; font-weight: 500; }
/* ROW TCE expirations */
.ftm-tce { display: grid; gap: 5px; }
.ftm-tce .br { display: grid; grid-template-columns: 118px 1fr 28px 104px; gap: 8px; align-items: center; font-size: 12.5px; padding: 2px 4px; border-radius: 4px; }
.ftm-tce .br.click { cursor: pointer; } .ftm-tce .br.click:hover { background: var(--surface-2); }
.ftm-tce .br .l { text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.ftm-tce .t { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; } .ftm-tce .t i { display: block; height: 100%; border-radius: 5px; }
.ftm-tce .v { text-align: right; font-weight: 600; } .ftm-tce .x { font-size: 11.5px; color: var(--muted); }
.ftm-tcesoon { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 12.5px; }
.ftm-tcesoon .hd { font: 500 10.5px/1.2 var(--font-ui); letter-spacing: .22em; text-transform: uppercase; color: var(--label); margin-bottom: 4px; }
.ftm-tcesoon .sr { display: grid; grid-template-columns: 96px auto 1fr; gap: 8px; padding: 2px 0; }
.ftm-tcesoon .d { font-weight: 600; font-variant-numeric: tabular-nums; } .ftm-tcesoon .o { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ftm-donut .sub2 { font: 500 12px/1 var(--font-ui); fill: var(--fg); }
.ftm-donut path { transition: opacity .12s; }
.ftm-dkey .kr { transition: opacity .12s; } .ftm-dkey .kr.dim { opacity: .45; }
/* Station Assets overview */
.ftm-keyas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ftm-keyas .ka { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; }
.ftm-keyas .ka b { font-size: 22px; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ftm-keyas .ka span { font-size: 12.5px; color: var(--muted); }
.ftm-heatwrap { overflow-x: auto; }
.ftm-heat td.num { font-variant-numeric: tabular-nums; }
.ftm-heat tr.click { cursor: pointer; } .ftm-heat tr.click:hover td:first-child { background: var(--surface-2); }
/* the Inbound / Outbound switch on a station stays one compact row at every width */
.ftm-seg.ftm-pair { display: inline-flex; flex-wrap: nowrap; border-radius: 999px; }
.ftm-seg.ftm-pair button { flex: 0 0 auto; padding: 5px 16px; }
/* headline tiles use the warm brown of the logo tiles instead of black */
.ftm-kpi { background: var(--flap-tile, #4A443B); }
.ftm-kpi small { color: #D8CFC0; }
/* corridor profile hover box */
.ftm-corrwrap { position: relative; }
.ftm-ctip { position: absolute; z-index: 5; pointer-events: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; font-size: 12.5px; min-width: 170px; max-width: 260px; }
.ftm-ctip b { font-weight: 600; display: block; }
.ftm-ctip .tt { font-size: 18px; font-weight: 500; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ftm-ctip .br { color: var(--muted); font-size: 12px; }
.ftm-corr g.on rect[rx] { opacity: .75; }
.ftm-corr g rect[fill="transparent"] { pointer-events: all; }
.ftm-corrro { min-height: 26px; margin: -2px 0 8px; }
.ftm-corrro .in { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.ftm-corrro b { font-weight: 600; font-size: 14px; }
.ftm-corrro strong { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* two-row headings for grouped columns */
.ftm-t thead.two tr.grp th { padding: 6px 10px 2px; border-bottom: 0; cursor: default; }
.ftm-t thead.two tr.grp th.g { text-align: center; color: var(--fg); font-weight: 600; border-bottom: 2px solid var(--line-strong); }
.ftm-t thead.two tr:last-child th:not(.sub) { border-bottom: 2px solid var(--line-strong); }
/* permits: one line per permit with a status dot */
.ftm-pmcell { min-width: 300px; }
.ftm-pmcell .pm { position: relative; padding: 1px 0 1px 17px; line-height: 1.35; }
.ftm-pmcell .pm > .ftm-pmark { position: absolute; left: 0; top: .2em; }
.ftm-pmark { display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; flex: 0 0 13px; }
.ftm-pmark.ok { color: #C49330; }
.ftm-pmark.ip { color: #C13A24; }
.ftm-pmstat { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ftm-pmcell .pm b { font-weight: 500; white-space: nowrap; }
.ftm-pmcell .pm em { margin-left: 6px; }
.ftm-panel .ftm-pmcell { min-width: 0; margin-top: 6px; }
.ftm-pmcell .pm em { font-style: normal; font-size: 11px; font-weight: 500; color: #C13A24; white-space: nowrap; }
.ftm-pmcell .pm.x span, .ftm-pmcell .pm.x b { text-decoration: line-through; color: var(--muted); }
.ftm-pmcell .pm.x em { color: var(--muted); }
.ftm-pmtodo { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow: auto; }
.ftm-pmtodo .td { display: flex; gap: 10px; align-items: flex-start; }
.ftm-pmtodo .td > .ftm-pmark { margin-top: 4px; }
.ftm-fbl { margin: 0; padding-left: 16px; }
.ftm-fbl li { margin: 2px 0; line-height: 1.4; }
.ftm-t td .ftm-fbl { min-width: 320px; max-width: 520px; }
.ftm-results .grp { padding: 8px 12px 4px; font: 600 10.5px/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--fcs-gold, #B89A3A); background: var(--surface-2, #F5F1EA); border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.ftm-results { width: 400px; max-height: 460px; }
/* Ask (Claude) */
.ftm-askbtn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid #F4C43099; background: transparent; color: #F4C430; font: 500 14px/1 var(--font-ui); letter-spacing: .02em; cursor: pointer; white-space: nowrap; }
.ftm-askbtn:hover { background: #F4C4301F; }
.ftm-askbtn span { font-size: 13px; }
.ftm-ask { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100%); z-index: 1200; background: var(--surface, #fff); border-left: 1px solid var(--line); box-shadow: -8px 0 28px rgba(26,23,20,.18); display: flex; flex-direction: column; }
.ftm-ask .hd { display: flex; align-items: center; gap: 8px; padding: 16px 18px; background: #1A1714; color: #fff; }
.ftm-ask .hd { padding: 12px 18px; }
.ftm-ask .hd b.askword { font: 500 27px/1 'Cormorant Garamond', Georgia, serif; letter-spacing: .08em; text-transform: uppercase; color: var(--flap-paper, #FBF7EF); margin-right: 6px; }
.ftm-ask .hd .ftm-logo.flap { padding-block: 6px; }
.ftm-ask .hd .ftm-logo.flap .byline { display: none; }
.ftm-ask .hd .ftm-logo.img { margin-left: 0; align-self: center; padding: 4px 10px; }
.ftm-ask .hd .grow { flex: 1; }
.ftm-ask .hd .ftm-x { color: #fff; }
.ftm-ask .log { flex: 1; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.ftm-ask .me { align-self: flex-end; max-width: 85%; background: #F4C43033; border: 1px solid #F4C43080; padding: 8px 12px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.ftm-ask .ans { max-width: 100%; line-height: 1.5; }
.ftm-ask .ans p { margin: 0 0 8px; }
.ftm-ask .ans ul { margin: 0 0 8px; padding-left: 18px; }
.ftm-ask .ans.wait { color: var(--muted); font-style: italic; }
.ftm-ask .ans.err { color: var(--bad, #C13A24); }
.ftm-ask .tw { overflow: auto; max-height: 360px; border: 1px solid var(--line); border-radius: 8px; margin: 4px 0 8px; }
.ftm-ask .tw table { width: 100%; }
.ftm-ask .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ftm-ask .acts .ftm-btn { font-size: 13px; padding: 6px 12px; }
.ftm-ask .ft { display: flex; gap: 8px; align-items: flex-end; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.ftm-ask .ft textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: 15px/1.4 var(--font-ui); }
@media (max-width: 900px) { .ftm-askbtn { height: 30px; padding: 0 10px; } }
.ftm-askbtn em { font-style: normal; }
@media (max-width: 760px) { .ftm-askbtn { width: 34px; padding: 0; justify-content: center; } .ftm-askbtn em { display: none; } .ftm-askbtn span { font-size: 15px; } }
.ftm-ort td input.ftm-in { min-width: 170px; width: 100%; }
.ftm-ort td:nth-child(2) input.ftm-in { min-width: 240px; }
.ftm-ort td textarea { min-width: 260px; }
.ftm-ort tr.ftm-newrow td { background: #F4C4301A; border-top: 2px solid #F4C43099; }
.ftm-ort tr.ftm-newrow .ftm-btn { white-space: nowrap; }
/* panel header band (Option E): one taupe for every station and map item */
.ftm-ph.band { background: #8A8378; color: #fff; border-bottom: 0; padding: 14px 16px 12px; }
.ftm-ph.band .row1 { align-items: center; gap: 8px; }
.ftm-ph.band h2 { color: #fff; flex: 0 1 auto; font-size: 28px; }
.ftm-ph.band .row1 .grow { flex: 1; }
.ftm-ph.band .sub { color: #F3EFE8; margin-top: 4px; }
.ftm-ph.band .ftm-x { color: #fff; }
.ftm-ph.band .ftm-tags { align-items: center; }
.ftm-ph.band .ftm-tag.plain, .ftm-ph.band .ftm-tag.tier { background: rgba(255,255,255,.16) !important; border-color: rgba(255,255,255,.4) !important; color: #fff !important; }
.ftm-ph.band .ftm-tag.est { background: #1A1714; color: #F4C430; }
.ftm-ph.band .ftm-pill { border-color: rgba(255,255,255,.4); }
.ftm-ph.band .ftm-actions { margin-top: 0; gap: 6px; flex-wrap: nowrap; }
.ftm-ib { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; padding: 0; text-decoration: none; flex: none; }
.ftm-ib .ic { display: inline-flex; }
.ftm-ph.band .ftm-ib { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.ftm-ph.band .ftm-ib:hover, .ftm-ph.band .ftm-ib[aria-pressed="true"] { background: rgba(255,255,255,.2); }
.ftm-ph.band .ftm-seg.ftm-pair { border-color: rgba(255,255,255,.6); background: transparent; margin-left: 4px; }
.ftm-ph.band .ftm-seg.ftm-pair button { color: #fff; background: transparent; padding: 5px 12px; font-size: 12.5px; }
.ftm-ph.band .ftm-seg.ftm-pair button[aria-pressed="true"] { background: #fff; color: #1A1714; }
.ftm-ph .ftm-secall { margin-left: auto; margin-top: 0; display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: inherit; font: 500 12.5px/1 var(--font-ui); cursor: pointer; padding: 4px 0; opacity: .92; }
.ftm-ph .ftm-secall:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.ftm-ph.band .ftm-titleedit textarea, .ftm-ph.band textarea#ftm-fname { color: var(--fg); }
@media (min-width: 761px) { .ftm-bar { row-gap: 0; } }   /* same space under the logo as above it */
/* editing a name: it gets the whole first line; the switch and buttons move under it */
.ftm-ph.band .row1:has(.ftm-titleedit) { flex-wrap: wrap; }
.ftm-ph.band .row1 h2:has(.ftm-titleedit) { flex: 1 1 100%; }
.ftm-ph.band .ftm-titleedit { display: flex; align-items: flex-start; gap: 8px; }
.ftm-ph.band .ftm-titleedit textarea { flex: 1; }
.ftm-ph.band h2.long { font-size: 23px; line-height: 1.12; }
/* estimate pill in the panel band: same size as the other pills */
.ftm .ftm-ph.band .ftm-tag.est { font: 500 12px/1 var(--font-ui); padding: 5px 10px; letter-spacing: .02em; }
/* no focus ring after a mouse click (keyboard users still get one) */
.ftm :focus:not(:focus-visible) { outline: none; }
.ftm button:focus:not(:focus-visible), .ftm a:focus:not(:focus-visible), .ftm summary:focus:not(:focus-visible) { outline: none; box-shadow: none; }
/* focus: brand gold instead of the browser's blue */
.ftm :focus-visible { outline: 2px solid #C49330; outline-offset: 2px; }
.ftm-bar :focus-visible, .ftm-ph.band :focus-visible { outline-color: #F4C430; }
.ftm input:focus, .ftm textarea:focus, .ftm select:focus { outline: none; border-color: #C49330 !important; box-shadow: 0 0 0 3px rgba(244, 196, 48, .35); }
.ftm { accent-color: #C49330; }
/* the search boxes' clear "x": taupe instead of the browser's blue */
.ftm input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 3l8 8M11 3l-8 8' stroke='%238A8378' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / 12px no-repeat; }
.ftm-bandbtn { display: inline-flex; align-items: center; font: 500 12.5px/1 var(--font-ui); padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.7); color: #fff; text-decoration: none; white-space: nowrap; }
.ftm-bandbtn:hover { background: rgba(255,255,255,.2); }
.ftm-routes { display: flex; flex-wrap: wrap; gap: 4px; }
.ftm-routes .rt { font: 500 12px/1 var(--font-ui); padding: 4px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.ftm-eqlegend .sw { display: flex; gap: 3px; }
.ftm-eqlegend .sw span { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font: 500 11px/1 var(--font-ui); color: var(--muted); }
.ftm-eqlegend .sw b { display: block; width: 100%; height: 12px; border-radius: 2px; border: 1px solid rgba(26,23,20,.12); }
.ftm-eqlegend .ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 3px; }
.ftm-eqlegend .ftm-meta { margin-top: 6px; font-size: 11.5px; }

/* map credits: plain dark links, never Leaflet's default blue */
.leaflet-container .leaflet-control-attribution a { color: #1A1714; text-decoration: underline; }
@media (max-width: 480px) {
  .ftm-ask .hd { padding: 10px 12px; gap: 4px; }
  .ftm-ask .hd b.askword { font-size: 20px; margin-right: 5px; }
  .ftm-ask .hd .ftm-logo.flap .mark { gap: 8px; }
  .ftm-ask .hd .ftm-logo.flap .the { font-size: 7px; letter-spacing: .36em; }
  .ftm-ask .hd .ftm-logo.flap .tiles { gap: 2px; }
  .ftm-ask .hd .ftm-logo.flap .tiles span { width: 18px; height: 25px; border-radius: 3px; font-size: 20px; }
  .ftm-ask .hd .ftm-logo.flap .tiles span::after { top: 11.75px; height: 1px; }
}
