:root {
    --app-font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --success: #16a34a; --warning: #f59e0b; --danger: #dc2626; --inactive: #6b7280;
    --shadow: 0 15px 45px rgba(0,0,0,.35);
}
html[data-theme="dark"] {
    --primary: #a78bfa; --primary-dark: #6d28d9; --background: #07090e;    
    --surface: #0f1322; --surface-accent: #171d34; --border: #242c4c; --grid-line: #3a4673;
    --text: #f3f4f6; --text-strong: #ffffff; --muted: #9ca3af; --fids-amber: #f59e0b; --time-color: #e5e7eb;
}
html[data-theme="light"] {
    --primary: #2563eb; --primary-dark: #1e40af; --background: #d9e0e8;    
    --surface: #f5f7fa; --surface-accent: #e8edf3; --border: #c8d0da; --grid-line: #c3ccd8;
    --text: #334155; --text-strong: #172033; --muted: #64748b; --fids-amber: #8a5a12; --time-color: #243247;
    --shadow: 0 10px 24px rgba(41, 55, 78, 0.11);
}

html[data-theme="light"] #header,
html[data-theme="light"] .footer-bar-container,
html[data-theme="light"] .single-fids-board,
html[data-theme="light"] .routes-card-box,
html[data-theme="light"] .schedule-workspace-board { box-shadow: 0 10px 24px rgba(41, 55, 78, 0.09); }
html[data-theme="light"] .nav-btn.active { background: #ffffff; box-shadow: none; }
html[data-theme="light"] .theme-btn,
html[data-theme="light"] #nextDepartureCard,
html[data-theme="light"] .fids-cycle-indicator-tag { background: #eef2f7; }

* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--app-font); }

body { background: var(--background); color: var(--text); height: 100vh; overflow: hidden; font-size: 14px; line-height: 1.5; }
#app { height: 100vh; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 64px; }

.main-viewport-body { padding-bottom: 64px; }

body.react-home-mode {
    min-height: 100vh;
    height: auto;
    color: #f5f7fb;
    background: #080a10;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}
body.react-home-mode::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(125, 211, 252, 0.11), transparent 30%), linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 42%);
}
.react-home {
    --home-panel: #101624;
    --home-panel-soft: #151c2d;
    --home-panel-lift: #1b2437;
    --home-border: #273149;
    --home-border-strong: #394765;
    --home-muted: #9ca7b8;
    --home-muted-strong: #c6ceda;
    --home-primary: #7dd3fc;
    --home-success: #22c55e;
    --home-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #f5f7fb;
}
.react-home .header { position: relative; z-index: 1; min-height: 72px; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: rgba(16, 22, 36, 0.92); border-bottom: 1px solid var(--home-border); backdrop-filter: blur(12px); }
.react-home .brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.react-home .brand-mark { width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; color: #071018; background: linear-gradient(135deg, var(--home-primary), #dbeafe); font-size: 13px; font-weight: 900; flex: 0 0 42px; }
.react-home .header-title { font-size: 22px; font-weight: 900; line-height: 1; color: #ffffff; }
.react-home .header-kicker { margin-top: 4px; color: var(--home-muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.75px; margin-bottom: 0; }
.react-home .header-clock { min-width: 172px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--home-border); background: rgba(21, 28, 45, 0.82); text-align: right; }
.react-home .clock-time { font-size: 18px; font-weight: 900; color: #ffffff; line-height: 1.1; }
.react-home .clock-date { font-size: 10px; color: var(--home-muted); font-weight: 800; text-transform: uppercase; margin-top: 3px; letter-spacing: 0.4px; }
.react-home .container { position: relative; z-index: 1; flex: 1; width: min(960px, 100%); margin: 0 auto; padding: 34px 24px 28px; display: block; }
.react-home .overview-panel,
.react-home .service-panel { border: 1px solid var(--home-border); background: rgba(16, 22, 36, 0.94); box-shadow: var(--home-shadow); border-radius: 8px; }
.react-home .home-intro { padding: 30px 28px 26px; border-bottom: 1px solid var(--home-border); }
.react-home .eyebrow { color: var(--home-primary); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.react-home .content-title { max-width: 640px; font-size: clamp(34px, 5vw, 56px); font-weight: 900; line-height: 0.98; color: #ffffff; }
.react-home .content-subtitle { max-width: 680px; color: var(--home-muted-strong); font-size: 14px; line-height: 1.65; margin-top: 16px; font-weight: 600; }
.react-home .service-panel { display: flex; flex-direction: column; overflow: hidden; }
.react-home .service-panel-head { padding: 18px 20px; border-bottom: 1px solid var(--home-border); background: var(--home-panel-soft); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.react-home .service-title { color: #ffffff; font-size: 15px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.55px; }
.react-home .service-count { color: var(--home-muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.react-home .grid { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.react-home .operator-card { position: relative; min-height: 82px; background: var(--home-panel); border: 1px solid var(--home-border); border-radius: 8px; padding: 16px 48px 16px 18px; display: flex; align-items: center; text-decoration: none; color: inherit; transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease; }
.react-home .operator-card::before { content: ""; position: absolute; inset: 14px auto 14px 0; width: 3px; border-radius: 0 999px 999px 0; background: var(--home-primary); }
.react-home .operator-card::after { content: ">"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--home-primary); font-size: 26px; font-weight: 700; line-height: 1; }
.react-home .operator-card:hover,
.react-home .operator-card:focus-visible { transform: translateY(-2px); border-color: var(--home-border-strong); background: var(--home-panel-lift); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2); outline: none; }
.react-home .meta { min-width: 0; text-align: left; }
.react-home .name { color: #ffffff; font-size: 16px; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.react-home .desc { color: var(--home-muted); font-size: 11px; margin-top: 6px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.65px; overflow-wrap: anywhere; }
.react-home .empty-state { margin: 14px; text-align: center; padding: 48px 20px; border: 1px dashed var(--home-border-strong); border-radius: 8px; background: rgba(21, 28, 45, 0.6); }
.react-home .empty-title { font-size: 17px; font-weight: 900; color: #ffffff; margin-bottom: 8px; }
.react-home .empty-text { color: var(--home-muted); font-size: 13px; font-weight: 600; }
.react-home .support-link { display: inline-block; margin-top: 12px; color: var(--home-primary); text-decoration: none; font-size: 12px; font-weight: 800; }
.react-home footer { position: relative; z-index: 1; background: rgba(16, 22, 36, 0.94); border-top: 1px solid var(--home-border); padding: 14px 24px; text-align: center; margin-top: auto; }
.react-home .footer-link { color: var(--home-muted); text-decoration: none; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; transition: color 0.2s ease; }
.react-home .footer-link:hover { color: var(--home-primary); }
.react-home .platform-version { color: var(--home-muted); font-weight: 800; }

/* HEADER STYLING */
#header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 24px; display: grid; gap: 16px; align-items: center; position: sticky; top: 0; z-index: 1000; grid-template-columns: minmax(200px, 1fr) auto minmax(200px, 1fr); grid-template-areas: "company view-controls header-right" "announcement announcement announcement"; justify-items: stretch; }
#header .company { grid-area: company; justify-self: start; }
#header .view-controls { grid-area: view-controls; justify-self: center; }
#header .header-right { grid-area: header-right; justify-self: end; }
#announcementBar { grid-area: announcement; width: 100%; }
.company { display: flex; align-items: center; gap: 14px; }
#companyLogo { height: 60px; width: 60px; object-fit: contain; border-radius: 6px; background: transparent; }
.logo-fallback { height: 40px; width: 40px; border-radius: 6px; background: var(--surface-accent); border: 1px solid var(--border); color: var(--text-strong); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; flex-shrink: 0; }
#companyName { font-size: 20px; font-weight: 900; color: var(--text-strong); letter-spacing: 0; line-height: 1.1; text-transform: none; }
#companyTagline { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 1px; text-transform: uppercase; letter-spacing: 0.5px; }

/* NAVIGATION CONTROLS */
.view-controls { display: flex; background: var(--surface-accent); padding: 4px; border-radius: 8px; border: 1px solid var(--border); gap: 4px; }
.nav-btn { background: transparent; border: none; padding: 8px 18px; font-size: 11px; font-weight: 800; color: var(--muted); cursor: pointer; border-radius: 6px; transition: all 0.2s ease; text-transform: uppercase; letter-spacing: 0.5px; }
.nav-btn.active { background: var(--background); color: var(--text-strong); box-shadow: 0 2px 8px rgba(0,0,0,0.15); border: 1px solid var(--border); }

.header-right { display: flex; align-items: center; gap: 14px; }
.refresh-cycle-indicator { appearance: none; position: relative; width: 36px; height: 36px; flex: 0 0 36px; padding: 0; border-radius: 50%; display: grid; place-items: center; color: var(--primary); border: 3px solid var(--primary); background: transparent; font-family: inherit; font-size: 13px; font-weight: 900; line-height: 1; }
.refresh-cycle-indicator.audio-control { cursor: pointer; transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease; }
.refresh-cycle-indicator.audio-control:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); transform: scale(1.05); }
.refresh-cycle-indicator.audio-control:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.refresh-cycle-indicator.audio-control::after { content: "Play"; position: absolute; right: -7px; bottom: -6px; min-width: 17px; height: 13px; padding: 0 3px; border-radius: 999px; display: grid; place-items: center; color: var(--primary-contrast, #fff); background: var(--primary); border: 2px solid var(--background); font-size: 6px; font-weight: 900; line-height: 1; text-transform: uppercase; }
.refresh-cycle-indicator.audio-control.is-playing::after { content: "Pause"; }
.theme-btn { background: var(--surface-accent); border: 1px solid var(--border); padding: 8px 14px; border-radius: 6px; cursor: pointer; color: var(--text); font-size: 11px; font-weight: 700; display: flex; align-items: center; gap: 6px; text-transform: uppercase; }
html[data-theme="dark"] .theme-btn { background: #f3f5f8; border-color: #d8dde6; color: #172033; }
html[data-theme="light"] .theme-btn { background: #1e293b; border-color: #334155; color: #f8fafc; }
html[data-theme="dark"] .moon-icon { display: none; }
html[data-theme="light"] .sun-icon { display: none; }

.clock-display { min-height: 34px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; text-align: right; white-space: nowrap; }
#currentTime { font-size: clamp(15px, 1.45vw, 21px); font-weight: 900; color: var(--text-strong); line-height: 1; letter-spacing: 0.08em; white-space: nowrap; }
#currentDate { font-size: clamp(10px, 0.95vw, 13px); color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.35px; margin-top: 0; white-space: nowrap; }

/* ANNOUNCEMENT TICKER RUNNER */
#announcementBar { background: var(--marquee-bg, var(--primary)); color: var(--marquee-text, #ffffff); height: 32px; display: flex; align-items: center; overflow: hidden; position: relative; border-bottom: 1px solid rgba(0,0,0,0.1); flex-shrink: 0; }
.ticker-title { background: var(--marquee-label-bg, rgba(0, 0, 0, 0.25)); color: var(--marquee-label-text, #ffffff); padding: 0 16px; height: 100%; display: flex; align-items: center; font-size: 11px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; z-index: 10; box-shadow: 5px 0 15px rgba(0,0,0,0.15); }
.ticker-wrap { flex: 1; overflow: hidden; display: flex; align-items: center; }
#ticker { display: inline-block; white-space: nowrap; font-size: 13px; font-weight: 700; color: inherit; padding-left: 100%; animation: marquee 30s linear infinite; }
.ticker-item { display: inline-block; }
.ticker-gap { display: inline-block; width: clamp(80px, 14vw, 220px); }

@keyframes marquee { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-100%, 0, 0); } }

/* VIEWPORT CONTAINER BASE */
.main-viewport-body { flex: 1; padding: 20px; overflow: hidden; background: var(--background); position: relative; }
body.selection-mode .main-viewport-body { overflow-y: auto; }
.view-panel { width: 100%; display: flex; flex-direction: column; }

#dashboardView { height: 100%; overflow: hidden !important; }
#selectionView { overflow: visible !important; height: auto !important; max-height: none !important; }
.view-panel.hidden { display: none !important; }

/* LIVE DASHBOARD VIEWPORT MATRIX */
.single-fids-board { background: var(--surface); border: 1px solid var(--grid-line); border-radius: 8px; height: 100%; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow); container-type: inline-size; container-name: board; width: 100%; }
.single-fids-header { background: var(--surface-accent); border-bottom: 2px solid var(--grid-line); padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 18px; }
.fids-main-title-info { display: flex; align-items: center; gap: 14px; min-width: 0; }
.route-label-pill { color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 10px; font-weight: 900; letter-spacing: 0.5px; text-transform: uppercase; }
.fids-route-title-stack { min-width: 0; display: grid; gap: 4px; }
.single-fids-header h2 { font-size: 22px; font-weight: 900; color: var(--text-strong); letter-spacing: 0; line-height: 1.08; overflow-wrap: anywhere; }
.fids-route-title-stack p { color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.fids-header-meta { display: flex; align-items: stretch; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
.fids-fare-tag { min-width: 148px; display: grid; align-content: center; gap: 4px; color: #ffffff; background: var(--primary); padding: 8px 14px; border-radius: 8px; border: 1px solid var(--primary); white-space: nowrap; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.18); }
.fids-fare-link { text-decoration: none; cursor: pointer; transition: filter 0.15s ease, transform 0.15s ease; }
.fids-fare-link:hover, .fids-fare-link:focus-visible { filter: brightness(1.08); transform: translateY(-1px); outline: none; }
.fids-fare-label { font-size: 9px; font-weight: 900; letter-spacing: 0.5px; text-transform: uppercase; opacity: 0.82; line-height: 1; text-align: left; }
.fids-fare-value-main { font-size: 22px; font-weight: 900; color: #ffffff; line-height: 1; }
.fids-next-departure-card { min-width: 148px; display: grid; align-content: center; gap: 4px; padding: 8px 14px; border-radius: 8px; background: var(--background); color: var(--text-strong); text-align: right; border: 1px solid var(--border); }
.fids-next-departure-card span { color: var(--muted); font-size: 9px; font-weight: 800; line-height: 1; letter-spacing: 0.5px; text-transform: uppercase; text-align: left; }
.fids-next-departure-card strong { color: var(--time-color); font-size: 22px; font-weight: 900; line-height: 1; letter-spacing: 0; white-space: nowrap; }
.fids-fare-tag-mobile { display: none; }
.fids-cycle-indicator-tag { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--background); padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); }

.fids-single-column { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.column-block { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.fids-columns-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr !important; gap: 0; overflow: hidden; width: 100%; }
.fids-columns-grid .column-block { width: 100%; }
.fids-columns-grid .column-block:first-child { border-right: 1px solid var(--border); }

.dashboard-cards-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--dashboard-card-count, 1), minmax(0, 1fr)); gap: 0; overflow: hidden; width: 100%; }
.dashboard-card-block { min-width: 0; border-right: 2px solid var(--grid-line); }
.dashboard-card-block:last-child { border-right: 0; }

/* ==========================================================================
   INTELLIGENT DYNAMIC FILL Blueprints (Max Space Proportions)
   ==========================================================================
*/
.single-fids-table-headings,
.single-fids-row,
.timeline-title,
.schedule-row { 
    display: grid !important;
    padding: 10px var(--schedule-row-padding-x, 18px); 
    gap: var(--schedule-row-gap, 12px); 
    width: 100%;
    align-items: center;
    /* Spreads to maximize absolute boundary width */
    justify-content: stretch;
}

/* SCENARIO A: 2 COLUMNS -> 60% / 40% Ratios */
.single-fids-table-headings:has(> :nth-child(2):last-child),
.single-fids-row:has(> :nth-child(2):last-child),
.timeline-title:has(> :nth-child(2):last-child),
.schedule-row:has(> :nth-child(2):last-child),
.schedule-columns-2 {
    grid-template-columns: 3fr 2fr !important;
}

/* SCENARIO B: 3 COLUMNS -> 30% / 30% / 40% Ratios */
.single-fids-table-headings:has(> :nth-child(3):last-child),
.single-fids-row:has(> :nth-child(3):last-child),
.timeline-title:has(> :nth-child(3):last-child),
.schedule-row:has(> :nth-child(3):last-child),
.schedule-columns-3 {
    grid-template-columns: 3fr 3fr 4fr !important;
}

/* SCENARIO C: 4 COLUMNS -> 20% / 20% / 20% / 40% Ratios */
.single-fids-table-headings:has(> :nth-child(4):last-child),
.single-fids-row:has(> :nth-child(4):last-child),
.timeline-title:has(> :nth-child(4):last-child),
.schedule-row:has(> :nth-child(4):last-child),
.schedule-columns-4 {
    grid-template-columns: 1fr 1fr 1fr 2fr !important;
}

.single-fids-table-headings { background: var(--surface-accent); border-bottom: 2px solid var(--grid-line); flex-shrink: 0; }
.single-fids-table-headings span { font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; min-width: 0; line-height: 1.12; text-align: left; }

.fids-adaptive-flow-container { flex: 1; min-height: 0; overflow: hidden; width: 100%; display: grid; grid-template-rows: repeat(var(--dashboard-row-count, 10), 1fr) !important; }

.single-fids-row { min-height: 0 !important; height: 100% !important; padding: var(--schedule-row-padding-y, 4px) var(--schedule-row-padding-x, 18px); border-bottom: 1px solid var(--grid-line); transition: background 0.15s ease; }
.single-fids-row:hover { background: var(--surface-accent); }
.single-fids-row:last-child { border-bottom: none; }
.single-fids-row-empty { pointer-events: none; opacity: 0.75; }

/* LEFT-ALIGNED TEXT MANAGEMENT TO PREVENT CUTOFFS */
.single-fids-row span,
.single-fids-row strong,
.timeline-title span,
.schedule-row > div {
    font-family: var(--app-font); 
    font-weight: 700 !important; 
    min-width: 0; 
    width: 100%;
    line-height: 1.15; 
    text-align: left; 
    white-space: normal !important; 
    overflow: visible !important; 
    text-overflow: unset !important; 
    word-break: break-word;
}
.single-fids-row strong { font-weight: 900 !important; letter-spacing: 0.03em; }
.single-fids-row .time-col { color: var(--time-color) !important; font-weight: 700 !important; white-space: nowrap !important; text-align: left; }
.single-fids-row .text-col { color: var(--text-strong) !important; text-align: left; }

.fids-text-schedule-panel { flex: 1; min-height: 0; display: flex; align-items: stretch; justify-content: stretch; padding: 0; text-align: center; background: var(--surface); }
.fids-text-schedule-message { flex: 1; display: flex; align-items: center; justify-content: center; padding: clamp(24px, 4vw, 56px); color: var(--time-color); font-size: clamp(28px, 2.5vw, 44px); font-weight: 900; line-height: 1.2; letter-spacing: 0; background: transparent; text-transform: uppercase; }

.selection-grid-layout { display: grid; grid-template-columns: minmax(280px, 320px) minmax(0, 1fr); gap: 20px; align-items: start; min-height: 100%; width: 100%; max-width: none; overflow: visible; }

/* SIDEBAR CHIPS TRACKS */
.sidebar-panel-wrapper { display: flex; flex-direction: column; gap: 20px; height: auto; min-height: 100%; min-width: 0; width: 100%; max-width: none; }
.routes-card-box { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 18px; display: flex; flex-direction: column; overflow: visible; box-shadow: var(--shadow); min-width: 0; width: 100%; max-width: none; }
.sidebar-panel-wrapper .routes-card-box:first-child { flex: 0 0 auto; }
.sidebar-panel-wrapper .routes-card-box:last-child { height: auto; flex-shrink: 0; }

.section-head-title { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.75px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.scroll-chips-track { flex: 1; overflow: visible; display: flex; flex-direction: column; gap: 6px; padding-right: 0; }

.route-chip { background: var(--surface-accent); border: 1px solid var(--border); padding: 12px 16px; border-radius: 8px; cursor: pointer; text-align: left; transition: all 0.2s ease; width: 100%; color: var(--text-strong); font-weight: 600; }
.route-chip:hover { border-color: var(--primary); background: var(--surface); }
.route-chip.active { background: var(--primary); border-color: var(--primary); color: #ffffff !important; font-weight: 700; }

.inactive-route-chip { background: var(--background); border: 1px solid var(--border); padding: 10px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; cursor: pointer; width: 100%; text-align: left; }
.inactive-route-chip:last-child { margin-bottom: 0; }
.inactive-route-chip:hover { border-color: var(--danger); background: var(--surface); color: var(--text); }
.inactive-route-chip.active { border-color: var(--danger); background: rgba(220, 38, 38, 0.12); color: var(--text-strong); }
.inactive-route-chip strong { color: var(--danger); font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; flex-shrink: 0; }
.inactive-route-chip-static { cursor: default; justify-content: flex-start; }

/* SCHEDULE CONFIGURATOR WORKSPACE */
.schedule-workspace-board { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; overflow: visible; box-shadow: var(--shadow); height: auto; flex: 1; min-width: 0; width: 100%; max-width: none; container-type: inline-size; container-name: board; }
.schedule-workspace-board.route-inactive { position: relative; border-color: rgba(220, 38, 38, 0.55); }
.schedule-workspace-board.route-inactive::after { content: attr(data-route-status); position: absolute; inset: 72px 0 0; display: flex; align-items: center; justify-content: center; color: rgba(220, 38, 38, 0.10); font-size: clamp(56px, 10vw, 140px); font-weight: 900; letter-spacing: 0; pointer-events: none; z-index: 0; }
.schedule-workspace-board.route-inactive .workspace-header-hero, .schedule-workspace-board.route-inactive .timeline-title, .schedule-workspace-board.route-inactive .scrollable-content { position: relative; z-index: 1; }
.inactive-route-notice { margin: 0; padding: 10px 24px; background: rgba(220, 38, 38, 0.10); border-bottom: 1px solid rgba(220, 38, 38, 0.35); color: var(--danger); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; }

.workspace-header-hero { background: var(--surface-accent); border-bottom: 1px solid var(--border); padding: 20px 24px; display: flex; justify-content: space-between; align-items: flex-start; flex-shrink: 0; gap: 20px; }
.workspace-meta-details { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; box-shadow: 0 12px 32px rgba(0,0,0,0.08); }
.workspace-meta-details h3 { font-size: 10px; font-weight: 900; color: var(--primary); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 8px; }
.workspace-meta-details h2 { font-size: clamp(18px, 3vw, 24px); font-weight: 900; color: var(--text-strong); letter-spacing: 0; margin-bottom: 2px; word-break: break-word; }

.workspace-header-actions { display: flex; align-items: stretch; justify-content: flex-end; gap: 10px; flex-shrink: 0; }
.route-fare-card { background: var(--background); border: 1px solid var(--border); padding: 12px 16px; border-radius: 10px; text-align: right; min-width: 92px; flex-shrink: 0; }
.route-fare-card .label { font-size: 9px; font-weight: 800; color: var(--muted); letter-spacing: 0.5px; margin-bottom: 2px; }
.route-fare-value { font-size: 20px; font-weight: 900; color: var(--time-color); line-height: 1.1; white-space: nowrap; }
#nextDepartureCard { background: var(--background); border: 1px solid var(--border); padding: 12px 20px; border-radius: 10px; text-align: right; min-width: auto; flex-shrink: 0; }
#nextDepartureCard .label { font-size: 9px; font-weight: 800; color: var(--muted); letter-spacing: 0.5px; margin-bottom: 2px; }
#nextDepartureTime { font-size: 22px; font-weight: 900; color: var(--time-color); line-height: 1.1; }
#nextDepartureStatus { font-size: 10px; font-weight: 800; letter-spacing: 0.5px; margin-top: 2px; text-transform: uppercase; }

.timeline-title { background: var(--background); padding: 12px var(--schedule-row-padding-x, 24px); font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; border-bottom: 1px solid var(--border); flex-shrink: 0; text-align: left; }
.timeline-title span { min-width: 0; overflow: hidden; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; line-height: 1.12; text-align: left; }
.scrollable-content { flex: 1; overflow: visible; padding: 0; width: 100%; }
.schedule-list { display: flex; flex-direction: column; gap: 0; width: 100%; }

.schedule-row { background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: var(--schedule-row-padding-y, 12px) var(--schedule-row-padding-x, 24px); min-height: var(--schedule-row-min-height, 54px); transition: background 0.15s ease; box-sizing: border-box; width: 100%; text-align: left; }
.schedule-row:hover { background: var(--surface-accent); }

.schedule-row div { font-weight: 600 !important; min-width: 0; overflow: hidden; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.schedule-row span, .schedule-row strong { font-family: var(--app-font); overflow: visible !important; text-overflow: unset !important; white-space: normal !important; overflow-wrap: anywhere; word-break: break-word; max-width: 100%; display: inline-block; line-height: 1.15; text-align: left; }
.schedule-row .time-col, .schedule-row strong { white-space: nowrap !important; text-align: left; }

.details-btn { color: var(--muted); cursor: pointer; font-size: 16px; display: inline-block; line-height: 1; transition: color 0.15s ease; width: 24px; text-align: center; }
.details-btn:hover { color: var(--primary); }

/* CONTAINER QUERY INTEL FLUID TYPOGRAPHY BASED ON SCREEN SPACE SCALE */
@container board (min-width: 1px) {
    .single-fids-row span,
    .single-fids-row strong,
    .schedule-row div,
    .schedule-row span,
    .schedule-row strong {
        font-size: clamp(12px, 1.65cqw, 18px) !important;
    }
    .single-fids-table-headings span,
    .timeline-title span {
        font-size: clamp(10px, 1.25cqw, 13px) !important;
    }
}

/* VARIABLE STATUS COLOUR MAPS */
.on-time { color: var(--success) !important; }
.delayed { color: var(--warning) !important; }
.cancelled { color: var(--danger) !important; }
.departed { color: var(--inactive) !important; }

/* GLOBAL CONTROL UTILITY FOOTER */
.footer-bar-container { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 24px; min-height: 56px; display: flex; align-items: center; flex-shrink: 0; }
.footer-bar-inner { display: flex; justify-content: space-between; align-items: center; gap: 18px; width: 100%; font-size: 12px; color: var(--muted); font-weight: 500; min-width: 0; }
.footer-sync, .footer-operator-text, .footer-platform { flex: 1; min-width: 0; }
.footer-sync { text-align: left; }
.footer-sync span { color: var(--text-strong); font-weight: 600; }
.footer-operator-text { text-align: center; text-transform: none; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footer-details-button { appearance: none; border: 0; background: transparent; font: inherit; cursor: pointer; padding: 0; }
.footer-details-button:hover, .footer-details-button:focus-visible { color: var(--primary); text-decoration: underline; outline: none; }
.footer-platform { text-align: right; }
.footer-platform a, .footer-inline-link { color: var(--primary); text-decoration: none; font-weight: 700; }
.footer-platform a:hover, .footer-inline-link:hover { text-decoration: underline; }

.schedule-status-popup-overlay { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(3, 5, 10, 0.72); backdrop-filter: blur(4px); animation: popup-fade-in 0.18s ease-out; }
.schedule-status-popup { width: min(620px, 100%); max-height: min(680px, calc(100vh - 48px)); overflow: hidden; background: var(--surface); border: 1px solid var(--primary); border-top: 6px solid var(--primary); border-radius: 12px; box-shadow: var(--shadow); padding: 24px; color: var(--text); animation: popup-enter 0.2s ease-out; display: flex; flex-direction: column; }
.schedule-status-popup-title { font-size: clamp(22px, 3vw, 34px); font-weight: 900; color: var(--text-strong); text-align: center; line-height: 1.05; margin-bottom: 6px; }
.schedule-status-popup-subtitle { color: var(--primary); font-size: 12px; font-weight: 900; text-transform: uppercase; text-align: center; letter-spacing: 0.7px; margin-bottom: 18px; }
.schedule-status-popup-list { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding-right: 2px; }
.schedule-status-popup-item { background: var(--background); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.schedule-status-popup-route { color: var(--text-strong); font-size: clamp(15px, 2vw, 20px); font-weight: 900; line-height: 1.15; margin-bottom: 10px; }
.schedule-status-popup-details { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.schedule-status-popup-details span { color: var(--time-color); font-size: clamp(22px, 3vw, 34px); font-weight: 900; line-height: 1; }
.schedule-status-popup-details strong { font-size: clamp(16px, 2vw, 24px); font-weight: 900; text-transform: uppercase; letter-spacing: 0.4px; text-align: right; }
.schedule-status-popup-remarks { margin-top: 8px; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.35; }

.sound-permission-overlay { position: fixed; inset: 0; z-index: 130; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(3, 5, 10, 0.58); backdrop-filter: blur(3px); animation: popup-fade-in 0.18s ease-out; }
.sound-permission-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--primary); border-top: 5px solid var(--primary); border-radius: 12px; box-shadow: var(--shadow); padding: 24px; color: var(--text); text-align: center; animation: popup-enter 0.2s ease-out; }
.sound-permission-title { color: var(--text-strong); font-size: clamp(22px, 3vw, 30px); font-weight: 900; line-height: 1.08; margin-bottom: 8px; }
.sound-permission-copy { color: var(--muted); font-size: 14px; font-weight: 700; line-height: 1.35; margin-bottom: 18px; }
.sound-permission-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sound-permission-actions button { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-family: var(--app-font); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.4px; cursor: pointer; }
.sound-permission-primary { background: var(--primary); border-color: var(--primary) !important; color: #ffffff; }
.sound-permission-secondary { background: var(--background); color: var(--text-strong); }

@keyframes popup-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes popup-enter { from { opacity: 0; transform: scale(0.96) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* DATA DIALOG MODAL BASE OVERLAYS */
#modalOverlay { position: fixed; inset: 0; background: rgba(3,5,10,0.85); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 2000; transition: all 0.2s ease; }
#modalOverlay.hidden { opacity: 0; pointer-events: none; }
.modalBox { background: var(--surface); border: 1px solid var(--border); width: min(560px, calc(100% - 32px)); max-height: min(720px, calc(100vh - 48px)); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.modalHeader { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; background: var(--surface-accent); border-bottom: 1px solid var(--border); }
.modalHeader h2 { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--text-strong); }
#closeModal { background: transparent; border: none; font-size: 16px; color: var(--muted); cursor: pointer; font-weight: 700; }
#modalContent { padding: 18px; overflow-y: auto; }
.modal-detail-stack { display: grid; gap: 10px; }
.modal-detail-intro { color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.45; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--background); }
.modal-detail-row { display: grid; grid-template-columns: minmax(112px, 0.34fr) minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--background); }
.modal-detail-label { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; line-height: 1.25; }
.modal-detail-value { min-width: 0; color: var(--text-strong); font-size: 13px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.modal-detail-link { color: var(--primary); text-decoration: none; font-weight: 800; }
.modal-detail-link:hover { text-decoration: underline; }
.modal-detail-empty { color: var(--muted); text-align: center; font-size: 13px; font-weight: 700; padding: 24px; }

/* INTERACTIVE APP FLOW GENERATION SHIELDS */
#loadingScreen { position: fixed; inset: 0; background: #07090e; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 9999; }
#loadingScreen h1 { font-size: 32px; font-weight: 900; color: #fff; margin-bottom: 4px; letter-spacing: 0; }
#loadingScreen p { font-size: 12px; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.startup-message-panel { width: min(620px, calc(100% - 36px)); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: clamp(34px, 8vw, 74px) 20px; }
.startup-message-panel h1 { margin: 0; font-size: 32px !important; line-height: 1.05; }
.startup-message-panel p { max-width: 520px; margin: clamp(28px, 4vw, 42px) 0 0; color: #aeb7c6 !important; font-size: 12px !important; font-weight: 800 !important; line-height: 1.45 !important; letter-spacing: 0 !important; text-transform: none !important; }
.startup-message-panel a { display: inline-block; margin-top: clamp(26px, 4vw, 38px); color: #7dd3fc; font-size: 13px; font-weight: 900; line-height: 1.2; text-decoration: none; }
.startup-message-panel a:hover { text-decoration: underline; }
.support-link { display: inline-flex; margin-top: 12px; color: var(--primary, #7dd3fc); font-size: 13px; font-weight: 800; text-decoration: none; text-transform: none; letter-spacing: 0; }
.support-link:hover { text-decoration: underline; }
.platform-version { color: var(--muted); font-weight: 700; white-space: nowrap; }
.loader { border: 3px solid #171d34; border-top: 3px solid #a78bfa; border-radius: 50%; width: 32px; height: 32px; animation: spin 0.8s linear infinite; margin-bottom: 18px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.hidden { display: none !important; }
.fids-empty-msg { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 40px; }

@media (max-width: 1024px) {
    #header { grid-template-columns: 1fr auto; grid-template-areas: "company company" "view-controls header-right" "announcement announcement"; }
    .view-controls { justify-self: start; }
    .header-right { justify-self: end; }
}

@media (min-width: 1025px) {
    html { height: 100%; }
    body:not(.selection-mode) { height: 100vh; overflow: hidden; }
    body:not(.selection-mode) #app, body:not(.selection-mode) #dashboardView, body:not(.selection-mode) .single-fids-board { height: 100%; overflow: hidden; }
    body.selection-mode, body.selection-mode #app { height: auto; min-height: 100vh; overflow-y: auto; overflow-x: hidden; }
    body.selection-mode .main-viewport-body { overflow: visible; }
    body.selection-mode .selection-grid-layout { height: auto; min-height: 100%; }
    body.selection-mode .sidebar-panel-wrapper, body.selection-mode .schedule-workspace-board { min-height: 0; max-height: none; }
    body.selection-mode .schedule-workspace-board { overflow: visible; }
    body.selection-mode .scrollable-content { overflow: visible; min-height: 0; }
}

@media (max-width: 1024px) {
    body { min-height: 100vh; height: auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    #app { min-height: 100vh; height: auto; display: flex; flex-direction: column; overflow: visible; padding-bottom: 84px; }
    #header { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "company company" "view-controls header-right" "announcement announcement"; gap: 10px 12px; align-items: center; justify-items: stretch; padding: 10px 12px; text-align: center; position: sticky; top: 0; z-index: 1000; height: auto; }
    #header .company { grid-area: company; width: 100%; justify-content: center; gap: 10px; min-width: 0; text-align: center; }
    #companyLogo, .logo-fallback { width: 34px; height: 34px; flex: 0 0 34px; }
    .company > div:last-child { min-width: 0; }
    #companyName { font-size: clamp(15px, 4.4vw, 18px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    #companyTagline { display: none; }
    .view-controls { grid-area: view-controls; width: 100%; min-width: 0; display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 4px; }
    .nav-btn { flex: none; padding: 8px 10px; font-size: 10px; }
    .header-right { grid-area: header-right; width: auto; min-width: 0; display: flex; justify-content: flex-end; align-items: center; flex-wrap: nowrap; gap: 8px; }
    .refresh-cycle-indicator { width: 34px; height: 34px; flex-basis: 34px; border-width: 2px; font-size: 11px; }
    .theme-btn { height: 34px; padding: 8px 10px; white-space: nowrap; }
    .clock-display { display: none; }
    #announcementBar { grid-area: announcement; height: 28px; width: 100%; }
    .ticker-title { padding: 0 10px; font-size: 10px; }
    #ticker { font-size: 12px; }
    .refresh-cycle-indicator { width: 34px; height: 34px; flex-basis: 34px; border-width: 2px; font-size: 11px; }
    .theme-btn { height: 34px; padding: 8px 10px; white-space: nowrap; }
    .clock-display { display: none; }
    #announcementBar { height: 28px; }
    .ticker-title { padding: 0 10px; font-size: 10px; }
    #ticker { font-size: 12px; }

    .main-viewport-body { flex: 1; display: flex; flex-direction: column; padding: 8px; overflow-y: auto !important; -webkit-overflow-scrolling: touch; min-height: 0; }
    #dashboardView, .single-fids-board { height: 100%; overflow: hidden; display: flex; flex-direction: column; }
    .fids-columns-grid { grid-template-columns: 1fr !important; height: 100%; overflow: hidden; }
    .fids-single-column, .column-block { height: 100%; display: flex; flex-direction: column; overflow: hidden; }

    .single-fids-header { padding: 10px 12px; justify-content: center; text-align: center; }
    .fids-main-title-info { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 18px; width: 100%; max-width: 100%; justify-content: center; min-height: 88px; display: grid; align-items: center; }
    .fids-route-title-stack { width: 100%; justify-items: center; gap: 6px; }
    .single-fids-header h2 { font-size: clamp(17px, 5vw, 22px); line-height: 1.18; text-align: center; overflow-wrap: anywhere; }
    body:not(.selection-mode) .single-fids-header { padding: 7px 10px; display: grid; grid-template-columns: 1fr; gap: 8px; }
    .fids-main-title-info { width: 100%; justify-content: center; min-width: 0; display: flex; }
    .route-label-pill, .fids-fare-tag-desktop, .fids-cycle-indicator-tag { display: none; }
    .fids-header-meta { display: flex; flex-direction: column; width: 100%; gap: 8px; }
    .fids-route-title-stack { width: 100%; justify-items: center; gap: 6px; }
    .fids-fare-tag-mobile { display: inline-flex; width: fit-content; max-width: 100%; white-space: normal; justify-content: center; }
    body:not(.selection-mode) .fids-route-title-stack { gap: 4px; }
    body:not(.selection-mode) .fids-fare-tag-mobile { padding: 3px 8px; gap: 6px; }
    body:not(.selection-mode) .fids-fare-tag-mobile .fids-fare-label { font-size: 8px; }
    body:not(.selection-mode) .fids-fare-tag-mobile .fids-fare-value-main { font-size: clamp(12px, 3.6vw, 15px); }
    .single-fids-header h2 { font-size: clamp(17px, 5vw, 22px); line-height: 1.18; text-align: center; overflow-wrap: anywhere; }
    .fids-route-title-stack p { font-size: clamp(10px, 3vw, 12px); line-height: 1.2; text-align: center; }
    body:not(.selection-mode) .single-fids-header h2 { font-size: clamp(10px, calc((100vw - 32px) / var(--route-title-chars, 28) * 1.65), 20px); line-height: 1.08; max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap; }
    body:not(.selection-mode) .fids-fare-tag, body:not(.selection-mode) .fids-next-departure-card { min-width: 0; width: 100%; padding: 8px 10px; justify-content: center; text-align: center; display: grid; }
    body:not(.selection-mode) .fids-next-departure-card span { text-align: center; font-size: 8px; }
    body:not(.selection-mode) .fids-next-departure-card strong { font-size: clamp(15px, 4.2vw, 18px); }
    body:not(.selection-mode) .fids-fare-label { text-align: center; font-size: 8px; }
    body:not(.selection-mode) .fids-fare-value-main { font-size: clamp(15px, 4.2vw, 18px); }

    .dashboard-cards-grid { grid-template-columns: 1fr !important; flex: 1; overflow: hidden; }
    .dashboard-card-block { border-right: 0; border-bottom: 0; height: 100%; overflow: hidden; display: flex; flex-direction: column; }
    .dashboard-card-block:not(:first-child) { display: none; }

    body:not(.selection-mode) .fids-adaptive-flow-container { display: grid !important; grid-template-rows: none !important; grid-auto-rows: auto !important; flex: 1; height: auto; overflow: visible; }
    body:not(.selection-mode) .single-fids-row { height: auto !important; padding: 7px var(--schedule-row-padding-x, 12px) !important; min-height: 0 !important; }
    .schedule-row { height: auto !important; min-height: 0 !important; grid-auto-rows: auto !important; }

    body.selection-mode { overflow-y: auto; height: auto; }
    body.selection-mode #app { height: auto; overflow: visible; padding-bottom: 78px; }
    body.selection-mode .main-viewport-body { overflow: visible; height: auto; }
    .selection-grid-layout { display: flex; flex-direction: column; gap: 12px; min-height: 0; width: 100%; max-width: none; align-items: stretch; overflow: visible; }
    .sidebar-panel-wrapper { display: contents; }
    .sidebar-panel-wrapper .routes-card-box:first-child { order: 1; height: auto; width: 100%; max-width: none; }
    .schedule-workspace-board { order: 2; height: auto; width: 100%; max-width: none; }
    .workspace-header-hero { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; text-align: center; }
    .workspace-meta-details { width: 100%; }
    .workspace-meta-details h3 { font-size: 9px; margin-bottom: 3px; }
    .workspace-meta-details h2 { font-size: clamp(16px, 4.4vw, 20px); line-height: 1.15; overflow-wrap: anywhere; }
    .workspace-header-actions { width: 100%; display: grid; grid-template-columns: 1fr; gap: 6px; align-items: stretch; }
    .route-fare-card, #nextDepartureCard { min-width: 0; text-align: center; padding: 6px 8px; border-radius: 8px; }
    .route-fare-card { width: 100%; min-width: 0; }
    #nextDepartureCard { width: 100%; }
    .route-fare-card:only-child, #nextDepartureCard:only-child { grid-column: 1 / -1; }
    .route-fare-card .label, #nextDepartureCard .label { font-size: 8px; margin-bottom: 1px; }
    .route-fare-value, #nextDepartureTime { font-size: clamp(13px, 3.7vw, 17px); }
    #nextDepartureStatus { font-size: 8px; margin-top: 1px; }
    .sidebar-panel-wrapper .routes-card-box:last-child { order: 3; width: 100%; max-width: none; }
    .routes-card-box, .scroll-chips-track, .scrollable-content { overflow: visible; }

    body:not(.selection-mode) .single-fids-table-headings { padding: 9px var(--schedule-row-padding-x, 12px); }
    body:not(.selection-mode) .single-fids-table-headings span { font-size: var(--schedule-heading-font-size, clamp(8.5px, 2.45vw, 10px)) !important; letter-spacing: 0.3px; text-align: left; }
    body:not(.selection-mode) .single-fids-row span,
    body:not(.selection-mode) .single-fids-row .time-col,
    body:not(.selection-mode) .single-fids-row strong {
        font-size: var(--schedule-cell-font-size, clamp(11px, 3.25vw, 15px)) !important;
        line-height: 1.14;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-align: left;
    }
    
    .schedule-status-popup { width: 100%; max-height: calc(100svh - 32px); padding: 18px 14px; }
    .schedule-status-popup-route { font-size: 14px; margin-bottom: 7px; }
    .schedule-status-popup-details span { font-size: 20px; }
    .schedule-status-popup-details strong { font-size: 14px; }
    .sound-permission-card { padding: 20px 16px; }
    .sound-permission-actions { grid-template-columns: 1fr; }
    
    .schedule-workspace-board,
    .scrollable-content,
    .schedule-list,
    .timeline-title,
    .schedule-row {
        width: 100%;
        max-width: 100%;
    }
    .timeline-title, .schedule-row {
        padding-left: var(--schedule-row-padding-x, 10px);
        padding-right: var(--schedule-row-padding-x, 10px);
        gap: 6px !important;
        text-align: left;
        justify-content: stretch !important;
        align-items: stretch !important;
        grid-auto-columns: minmax(0, 1fr);
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr)) !important;
    }
    .timeline-title { padding-top: 10px; padding-bottom: 10px; font-size: var(--schedule-heading-font-size, clamp(7px, 1.7vw, 9px)) !important; letter-spacing: 0; text-align: left; }
    .timeline-title span { display: inline-block; min-width: 0; max-width: 100%; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.1; }
    .schedule-row { padding-top: var(--schedule-row-padding-y, 10px); padding-bottom: var(--schedule-row-padding-y, 10px); text-align: left; min-height: 54px; }
    .schedule-row > div { min-width: 0; display: inline-block; width: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .schedule-row div { font-size: var(--schedule-cell-font-size, clamp(8.5px, 1.8vw, 10px)) !important; line-height: 1.05; text-align: left; }
    .schedule-row span, .schedule-row strong { font-size: var(--schedule-cell-font-size, clamp(8px, 1.7vw, 9px)) !important; line-height: 1.05; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .schedule-row .time-col { font-size: var(--schedule-cell-font-size, clamp(8px, 1.7vw, 9px)) !important; text-align: left; white-space: nowrap; }
    .footer-bar-container { height: auto; min-height: 0; padding: 8px 12px; }
    .footer-bar-inner { flex-direction: column; gap: 3px; font-size: 10px !important; line-height: 1.25; }
    .footer-sync, .footer-operator-text, .footer-platform { flex: none !important; width: 100%; text-align: center !important; }
    .footer-operator-text { overflow: visible; white-space: normal; overflow-wrap: anywhere; }
}

@media (max-width: 900px) {
    .react-home .container { padding-top: 22px; }
    .react-home .service-panel { min-height: auto; }
}

@media (max-width: 620px) {
    .react-home .header { padding: 12px 14px; align-items: stretch; flex-direction: column; }
    .react-home .brand-lockup { justify-content: center; }
    .react-home .header-clock { width: 100%; text-align: center; }
    .react-home .container { padding: 14px 10px 18px; gap: 12px; }
    .react-home .home-intro { padding: 22px 18px; }
    .react-home .content-title { font-size: 32px; }
    .react-home .content-subtitle { font-size: 13px; }
    .react-home .service-panel-head { align-items: flex-start; flex-direction: column; gap: 4px; }
    .react-home .grid { padding: 10px; }
    .react-home .operator-card { min-height: 78px; padding: 14px 18px; }
    .react-home .name { font-size: 15px; }
    .react-home .desc { font-size: 10px; }
    .react-home .service-panel { min-height: auto; overflow: visible; }
    .react-home .grid { max-height: none; overflow: visible; }
    .react-home .service-panel-head { width: 100%; }
    .react-home footer { padding: 12px 16px; }
    .footer-bar-container { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px; min-height: auto; }
    .footer-bar-inner { flex-direction: column; gap: 8px; align-items: stretch; }
    .footer-sync, .footer-operator-text, .footer-platform { width: 100%; text-align: center !important; }
    .footer-operator-text { overflow: visible; white-space: normal; overflow-wrap: anywhere; }
}
 
