/* Flowtix City — public app & site. One stylesheet, mobile first, light/dark. */
:root {
  --navy: #0b2b49; --accent: #1f6fb2; --accent-2: #19a7a0; --ink: #16222e; --muted: #5d6d7e; --line: #dfe7ee;
  --bg: #eef2f6; --card: #ffffff; --card-2: #f6f9fc; --ok: #2e9d5b; --warn: #e0a12b; --bad: #d64545; --info: #1f6fb2;
  --shadow: 0 8px 28px rgba(11, 43, 73, .08); --r: 16px; --r-s: 10px;
  --tab-h: 62px; --top-h: 58px; --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
html[data-theme="dark"] {
  --navy: #0a1f36; --accent: #5aa7e6; --accent-2: #3ec6bf; --ink: #e8eef4; --muted: #9fb0c0; --line: #233449;
  --bg: #0d1724; --card: #152233; --card-2: #1b2b3f; --shadow: 0 8px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.skip { position: absolute; left: -999px; top: 0; background: var(--card); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
[hidden] { display: none !important; }

/* top bar */
.top { position: sticky; top: 0; z-index: 30; background: linear-gradient(135deg, var(--navy) 0%, #1a5a95 100%); color: #fff; box-shadow: 0 2px 14px rgba(0, 0, 0, .18); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: var(--top-h); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { border-radius: 9px; flex: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand b { font-size: 16px; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { font-size: 11.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.icon-btn { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); color: #fff; border-radius: 10px; min-width: 36px; height: 36px; padding: 0 9px; font-weight: 700; font-size: 13px; }
.icon-btn:hover { background: rgba(255, 255, 255, .24); }
.city-sel { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); color: #fff; border-radius: 10px; height: 36px; padding: 0 8px; max-width: 150px; font-weight: 600; }
.city-sel option { color: #111; }
.install-btn { background: #fff; color: var(--navy); border: 0; border-radius: 10px; height: 36px; padding: 0 12px; font-weight: 700; }
.offline { background: #7a5312; color: #fff; text-align: center; font-size: 13px; padding: 5px 10px; }

/* tabs: bottom bar on phones, top strip on wide screens */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(6, 1fr); background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); height: calc(var(--tab-h) + var(--safe-b)); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; }
.tabs a .ico { font-size: 20px; line-height: 1; }
.tabs a.on { color: var(--accent); }
.tabs a.on::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .tabs { position: sticky; top: var(--top-h); bottom: auto; height: 46px; padding: 0; display: flex; justify-content: center; gap: 4px; border-top: 0; border-bottom: 1px solid var(--line); }
  .tabs a { flex-direction: row; gap: 7px; padding: 0 16px; font-size: 13.5px; }
  .tabs a .ico { font-size: 16px; }
  .tabs a.on::before { top: auto; bottom: 0; left: 10px; right: 10px; border-radius: 3px 3px 0 0; }
}

/* layout */
.view { max-width: 1180px; margin: 0 auto; padding: 14px 14px 24px; }
.view:focus { outline: none; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(12, 1fr); }
.c12 { grid-column: span 12; } .c8 { grid-column: span 8; } .c6 { grid-column: span 6; } .c4 { grid-column: span 4; }
@media (max-width: 900px) { .c8, .c6, .c4 { grid-column: span 12; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.card h2 .more { font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.lead { font-size: 19px; font-weight: 700; color: var(--navy); margin: 0 0 8px; line-height: 1.3; letter-spacing: -.2px; }
html[data-theme="dark"] .lead { color: #dbe9f7; }
.muted, .small { color: var(--muted); } .small { font-size: 12.5px; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .n { font-weight: 600; } .row .m { font-size: 12.5px; color: var(--muted); }
.row.link { cursor: pointer; } .row.link:hover .n { color: var(--accent); }
.lv { font-weight: 700; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; white-space: nowrap; }
.free { background: #e6f5ec; color: #176a45; } .light { background: #e8f4ec; color: #2f7a4e; } .busy { background: #fdf3df; color: #7a5312; } .congested { background: #fde7e7; color: #8b2727; } .no-data { background: #eef3f7; color: #5d6d7e; }
html[data-theme="dark"] .free, html[data-theme="dark"] .light { background: #163826; color: #8fe0b1; }
html[data-theme="dark"] .busy { background: #3d2f12; color: #f5cf7a; }
html[data-theme="dark"] .congested { background: #4a1f1f; color: #ff9b9b; }
html[data-theme="dark"] .no-data { background: #1f2d3d; color: #9fb0c0; }
.bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; border-radius: 999px; }
.tip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: #fff7e6; border: 1px solid #f4dfa6; margin: 8px 0 0; font-size: 14px; color: #3d2f12; }
html[data-theme="dark"] .tip { background: #3d2f12; border-color: #5c4719; color: #f5e5c0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.k { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 2px 8px; border-radius: 6px; background: #e3effa; color: #1f4f8a; margin-right: 6px; }
.k.closure, .k.roadworks, .k.critical, .k.bad { background: #fde7e7; color: #8b2727; } .k.event { background: #efe7fb; color: #5b3a9a; } .k.warning, .k.hazard { background: #fdf3df; color: #7a5312; } .k.ok { background: #e6f5ec; color: #176a45; }
html[data-theme="dark"] .k { background: #1d3a5c; color: #bcdcff; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px; transition: .15s; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.field { display: flex; flex-direction: column; gap: 5px; margin: 0 0 12px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line); background: var(--card-2); border-radius: 10px; padding: 10px 12px; width: 100%; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
.field .hint { font-size: 12px; color: var(--muted); }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search { display: flex; gap: 8px; align-items: center; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px 6px 4px 12px; }
.search input { flex: 1; border: 0; background: transparent; padding: 8px 0; min-width: 0; }
.search input:focus { outline: none; }
.seg { display: inline-flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 7px 12px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.seg button .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* hero (home) */
.hero { background: linear-gradient(135deg, var(--navy) 0%, #1f6fb2 100%); color: #fff; border-radius: var(--r); padding: 20px 20px 18px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.hero h1 { margin: 0 0 4px; font-size: 26px; line-height: 1.15; letter-spacing: -.3px; }
.hero .sub { opacity: .92; font-size: 14px; }
.hero .wx { display: inline-flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); border-radius: 14px; padding: 8px 12px; margin-top: 12px; font-size: 13.5px; }
.hero .wx .t { font-size: 22px; font-weight: 700; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
@media (min-width: 620px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.kpi .v { font-size: 22px; font-weight: 800; line-height: 1.1; }
.kpi .l { font-size: 12px; opacity: .9; }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 620px) { .quick { grid-template-columns: repeat(4, 1fr); } }
.quick a { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.quick a:hover { border-color: var(--accent); }
.quick .ico { font-size: 24px; }
.quick b { font-size: 14px; } .quick small { color: var(--muted); font-size: 12px; }

/* map */
.map-wrap { position: relative; height: calc(100vh - var(--top-h) - var(--tab-h) - var(--safe-b) - 28px); min-height: 420px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--card-2); }
@media (min-width: 900px) { .map-wrap { height: calc(100vh - var(--top-h) - 46px - 28px); } }
#map2d, #map3d { position: absolute; inset: 0; }
#map3d .maplibregl-canvas { outline: none; }
.map-tools { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.map-tools > * { pointer-events: auto; }
.map-tools .seg, .map-tools .search { background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(6px); box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.map-tools .search { flex: 1; min-width: 180px; max-width: 360px; }
.map-legend { position: absolute; left: 10px; bottom: 10px; z-index: 5; background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 11.5px; display: flex; gap: 10px; flex-wrap: wrap; }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.map-panel { position: absolute; right: 10px; top: 56px; bottom: 10px; z-index: 6; width: min(360px, calc(100% - 20px)); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: auto; padding: 12px 14px; }
@media (max-width: 640px) { .map-panel { top: auto; left: 10px; right: 10px; width: auto; max-height: 48%; } }
.map-panel .x { float: right; border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--muted); }
.leaflet-container { font: inherit; background: var(--card-2); }
.leaflet-popup-content { font-size: 13.5px; line-height: 1.4; }
.leaflet-popup-content-wrapper, .maplibregl-popup-content { border-radius: 12px; color: #16222e; }
.veh-icon { width: 30px; height: 18px; border-radius: 5px; color: #fff; font: 700 11px/18px system-ui; text-align: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); white-space: nowrap; }
.veh-icon.est { opacity: .72; border-style: dashed; }
.pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); display: flex; align-items: center; justify-content: center; }
.pin span { transform: rotate(45deg); font-size: 13px; }
.ml-note { position: absolute; left: 10px; right: 10px; bottom: 44px; z-index: 5; background: rgba(6, 17, 28, .82); color: #dbe9f7; font-size: 12px; padding: 8px 12px; border-radius: 10px; }

/* transit */
.mode-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.line-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 26px; padding: 0 8px; border-radius: 7px; color: #fff; font-weight: 800; font-size: 13px; }
.routes { display: flex; flex-wrap: wrap; gap: 6px; }
.routes button { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 4px 6px; display: inline-flex; align-items: center; gap: 6px; }
.routes button.on { outline: 2px solid var(--accent); }
.routes button small { color: var(--muted); }
.dep { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dep:last-child { border-bottom: 0; }
.dep .in { font-weight: 800; font-size: 16px; text-align: right; }
.dep .in small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.dep .live { color: var(--ok); }
.stops-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.stops-list .row { padding: 8px 10px; }

/* reports */
.ticket { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: var(--card); }
.ticket .hd { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ticket .num { font-size: 12px; color: var(--muted); font-weight: 700; }
.st { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.st.new, .st.triaged { background: #e3effa; color: #1f4f8a; } .st.assigned, .st.in_progress { background: #fdf3df; color: #7a5312; } .st.waiting { background: #efe7fb; color: #5b3a9a; } .st.resolved, .st.closed { background: #e6f5ec; color: #176a45; } .st.rejected { background: #fde7e7; color: #8b2727; }
.timeline { list-style: none; margin: 10px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 10px 12px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: -19px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline li small { display: block; color: var(--muted); font-size: 11.5px; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photos img, .photos .ph { width: 86px; height: 86px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.photos .ph { position: relative; }
.photos .ph button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; font-size: 13px; line-height: 1; }
.stars { display: inline-flex; gap: 4px; }
.stars button { border: 0; background: transparent; font-size: 24px; color: #c9d3dd; padding: 0 2px; }
.stars button.on { color: #e0a12b; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.cat-grid button { border: 1px solid var(--line); background: var(--card-2); border-radius: 12px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; text-align: center; }
.cat-grid button .ico { font-size: 22px; }
.cat-grid button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.mini-map { height: 220px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
.dup { background: #fff7e6; border: 1px solid #f4dfa6; border-radius: 12px; padding: 12px; color: #3d2f12; }
html[data-theme="dark"] .dup { background: #3d2f12; border-color: #5c4719; color: #f5e5c0; }

/* AI chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - var(--top-h) - var(--tab-h) - var(--safe-b) - 28px); min-height: 460px; }
@media (min-width: 900px) { .chat { height: calc(100vh - var(--top-h) - 46px - 28px); } }
.chat .log { flex: 1; overflow: auto; padding: 4px 2px 10px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; border-radius: 16px; padding: 10px 14px; font-size: 14.5px; line-height: 1.5; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg.ai { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.msg.ai p { margin: 0 0 8px; } .msg.ai p:last-child { margin: 0; }
.msg.ai ul, .msg.ai ol { margin: 4px 0 8px; padding-left: 20px; }
.msg.ai h1, .msg.ai h2, .msg.ai h3, .msg.ai h4 { font-size: 15px; margin: 8px 0 4px; }
.msg.ai table { border-collapse: collapse; font-size: 13px; margin: 6px 0; width: 100%; } .msg.ai td, .msg.ai th { border: 1px solid var(--line); padding: 4px 6px; text-align: left; }
.msg.ai code { background: var(--card-2); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.msg.ai pre { background: var(--card-2); padding: 8px 10px; border-radius: 8px; overflow: auto; }
.msg .steps { font-size: 12px; color: var(--muted); margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 6px; }
.msg .steps span { display: inline-block; margin-right: 10px; }
.msg .cites { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; }
.msg .cites a { font-size: 11.5px; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; text-decoration: none; }
.typing { align-self: flex-start; color: var(--muted); font-size: 13px; padding: 4px 6px; }
.typing i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin-right: 3px; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat .composer { display: flex; gap: 8px; align-items: flex-end; padding-top: 8px; }
.chat .composer textarea { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 12px; min-height: 44px; max-height: 140px; resize: none; }
.chat .suggest { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 6px; scrollbar-width: none; }
.chat .suggest button { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.chat .suggest button:hover { border-color: var(--accent); color: var(--accent); }
.ai-note { font-size: 12px; color: var(--muted); text-align: center; padding: 4px 0 0; }

/* KB & forms */
.article { max-width: 760px; }
.article h1 { font-size: 24px; margin: 0 0 6px; line-height: 1.2; }
.article .body { font-size: 15.5px; }
.article .body h2 { font-size: 18px; margin: 18px 0 6px; text-transform: none; letter-spacing: 0; color: var(--ink); display: block; }
.article .body h3 { font-size: 16px; margin: 14px 0 4px; }
.article .body ul, .article .body ol { padding-left: 22px; }
.article .body table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 14px; } .article .body td, .article .body th { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.article .body blockquote { border-left: 3px solid var(--accent); margin: 8px 0; padding: 4px 12px; color: var(--muted); }
.article .body code { background: var(--card-2); padding: 1px 5px; border-radius: 5px; }
.vote { display: flex; gap: 8px; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
.form-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.form-steps span { font-size: 12px; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.form-steps span.approved { background: #e6f5ec; color: #176a45; } .form-steps span.rejected { background: #fde7e7; color: #8b2727; } .form-steps span.pending { background: #fdf3df; color: #7a5312; }
.table-field { border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
.table-field table { border-collapse: collapse; width: 100%; font-size: 13px; }
.table-field td, .table-field th { border-bottom: 1px solid var(--line); padding: 4px; } .table-field input { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 5px; background: var(--card-2); }
.checkbox { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.sig { border: 1px dashed var(--line); border-radius: 10px; background: #fff; touch-action: none; width: 100%; height: 120px; }

/* misc */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + var(--safe-b) + 12px); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
@media (min-width: 900px) { .toasts { bottom: 20px; } }
.toast { background: #16222e; color: #fff; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; box-shadow: 0 8px 28px rgba(0, 0, 0, .3); animation: up .2s ease-out; }
.toast.err { background: #8b2727; } .toast.ok { background: #176a45; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .sheet { align-items: center; } }
.sheet-bd { position: absolute; inset: 0; background: rgba(6, 17, 28, .5); }
.sheet-card { position: relative; background: var(--card); border-radius: 18px 18px 0 0; width: 100%; max-width: 640px; max-height: 88vh; overflow: auto; padding: 18px 18px 22px; box-shadow: 0 -8px 40px rgba(0, 0, 0, .3); animation: up .18s ease-out; }
@media (min-width: 700px) { .sheet-card { border-radius: 18px; } }
.sheet-x { position: absolute; top: 8px; right: 10px; border: 0; background: transparent; font-size: 26px; line-height: 1; color: var(--muted); }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 40px 0; justify-content: center; }
.spinner { width: 20px; height: 20px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.foot { max-width: 1180px; margin: 0 auto; padding: 6px 14px 26px; text-align: center; color: var(--muted); font-size: 12px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.sr { position: absolute; left: -9999px; }
.hdr { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.hdr h1 { margin: 0; font-size: 22px; letter-spacing: -.2px; }
.hdr h1 small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; white-space: nowrap; }      /* v2.11.1 — "Flo · the city assistant" */
.two { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .two { grid-template-columns: 1.1fr .9fr; } }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; }
@media print { .top, .tabs, .foot, .toasts { display: none !important; } body { padding: 0; background: #fff; } .card { box-shadow: none; } }

/* compact map toolbar on phones: segments scroll sideways instead of stacking */
@media (max-width: 640px) {
  .map-tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; -webkit-overflow-scrolling: touch; right: 0; padding-right: 10px; }
  .map-tools::-webkit-scrollbar { display: none; }
  .map-tools .seg { flex: none; flex-wrap: nowrap; }
  .map-tools .seg button { padding: 6px 9px; font-size: 12px; white-space: nowrap; }
  .map-tools .search { flex: none; min-width: 200px; }
  .map-legend { font-size: 10.5px; }
}

.upd-bar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 60; display: flex; gap: 10px; align-items: center; background: #0b2b49; color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.3); font-weight: 600; }
.upd-bar .btn { background: #fff; color: #0b2b49; border: 0; border-radius: 8px; padding: 6px 12px; font-weight: 800; cursor: pointer; }

/* ===================== v2.2 — city status, showcase, element record, following an address ===================== */
button.chip { cursor: pointer; font-family: inherit; color: inherit; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.icon-btn.bell { position: relative; }
.bell-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #d64545; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center; }
ol.steps { list-style: none; display: flex; margin: 12px 0 4px; padding: 0; counter-reset: st; }
ol.steps li { flex: 1; text-align: center; position: relative; padding-top: 24px; font-size: 11.5px; color: var(--muted); min-width: 0; }
ol.steps li::before { counter-increment: st; content: counter(st); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; line-height: 18px; border-radius: 50%; background: var(--card-2); border: 1.5px solid var(--line); font-size: 10.5px; font-weight: 700; z-index: 1; }
ol.steps li::after { content: ''; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: var(--line); }
ol.steps li:first-child::after { display: none; }
ol.steps li.done::before { background: #2e9d5b; border-color: #2e9d5b; color: #fff; content: '✓'; }
ol.steps li.done::after { background: #2e9d5b; }
ol.steps li.cur b { color: var(--ink, inherit); }
ol.steps li b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; }
table.kv td { border: 0; }

/* ===================== v2.11 — the traffic plan of an event ===================== */
.ev-banner { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: var(--r); background: #fff4f2; border: 1px solid #f1c4bd; color: #5a1c14; text-decoration: none; box-shadow: var(--shadow); }
.ev-banner.now { background: #fde8e5; border-color: #e9a59b; }
html[data-theme="dark"] .ev-banner { background: #3a1d19; border-color: #6b2f27; color: #f8d6d0; }
.ev-banner .ico { font-size: 24px; } .ev-banner .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; } .ev-banner .tx small { font-size: 12.5px; opacity: .85; } .ev-banner .go { font-weight: 700; white-space: nowrap; font-size: 13px; }
.ev-ul { margin: 8px 0 0; padding-left: 20px; } .ev-ul li { margin-bottom: 6px; line-height: 1.45; font-size: 14.5px; }
.ev-h3 { margin: 14px 0 4px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.ev-line { display: inline-block; min-width: 26px; padding: 1px 7px; border-radius: 6px; color: #fff; font-weight: 700; font-size: 12.5px; text-align: center; }
.ev-sw { display: inline-block; width: 16px; height: 6px; border-radius: 3px; margin: 0 6px 2px 10px; vertical-align: middle; } .ev-sw:first-child, .n > .ev-sw { margin-left: 0; }
.ev-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 6px 0 10px; vertical-align: middle; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
#evA, #evB { border: 1px solid var(--line); background: var(--card-2); border-radius: 10px; padding: 10px 12px; width: 100%; }

/* ===================== v2.11 — the assistant: a photo with the question, the position, the video call ===================== */
.attach { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin: 0 0 6px; border: 1px dashed var(--line); border-radius: 12px; font-size: 13px; color: var(--muted); }
.attach img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; } .attach span { flex: 1; }
.msg-photo { display: block; max-width: 220px; max-height: 180px; border-radius: 10px; margin: 0 0 6px; }
.call-video { position: relative; background: #0b1622; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; max-height: 46vh; }
.call-video.off { aspect-ratio: auto; height: 64px; }
.call-video video { width: 100%; height: 100%; object-fit: cover; display: block; } .call-video.off video { display: none; }
.call-state { position: absolute; left: 10px; bottom: 10px; right: 54px; color: #fff; font-weight: 700; font-size: 13.5px; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-state[data-k="listening"]::before { content: "● "; color: #ff5b4d; } .call-state[data-k="thinking"]::before { content: "✦ "; } .call-state[data-k="speaking"]::before { content: "🔊 "; }
.call-left { position: absolute; top: 8px; left: 10px; color: #fff; font-size: 12px; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.call-flip { position: absolute; right: 8px; bottom: 8px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .22); color: #fff; font-size: 18px; } .call-video.off .call-flip { display: none; }
.call-note { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.call-log { max-height: 26vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; margin: 10px 0 8px; }
.call-msg { font-size: 14.5px; line-height: 1.45; padding: 8px 12px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); } .call-msg b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 2px; }
.call-msg.user { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.call-ex { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; } .call-ex button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 11px; font-size: 12.5px; color: var(--ink); }
.call-ctl { display: flex; align-items: center; gap: 8px; margin: 6px 0; } .call-ctl .btn { flex: 1; }
.call-mic { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); font-size: 24px; flex: none; }
.call-mic.on { background: #d64545; border-color: #d64545; box-shadow: 0 0 0 6px rgba(214, 69, 69, .18); }
.btn.call-end { background: #d64545; border-color: #d64545; color: #fff; } .btn.call-end:hover { color: #fff; border-color: #b93838; }
.call-title { margin: 0 34px 8px 0; font-size: 17px; line-height: 1.25; }
.call-type { display: flex; gap: 8px; margin: 6px 0; } .call-type input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--card-2); border-radius: 12px; padding: 10px 12px; }
.call-opt { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; margin: 8px 0 0; } .call-opt input { width: auto; margin-top: 3px; } .call-opt small { display: block; color: var(--muted); font-size: 12px; }
.call-priv { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
