/* ===== Flowtix City v2.0 — styles for the AI chat, team chat, City Desk, transit, 3D map, signal designer, knowledge base, documents ===== */
.nav-badge { display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 6px; border-radius: 999px; background: #d64545; color: #fff; font-size: 11px; font-weight: 800; text-align: center; vertical-align: middle; }
.nav-badge:empty { display: none; }
.seg { display: inline-flex; border: 1px solid rgba(94,129,163,.3); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.7); }
.seg button { margin: 0; border-radius: 0; box-shadow: none; padding: 7px 12px; font-size: 12.5px; font-weight: 650; background: transparent; color: var(--ink); border-right: 1px solid rgba(94,129,163,.2); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: #fff; }
.seg button:hover:not(.on) { background: rgba(31,111,178,.08); transform: none; }
html[data-theme="dark"] .seg { background: #13263a; border-color: #24405c; } html[data-theme="dark"] .seg button { color: #d6e1eb; border-color: #24405c; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.chk input { width: auto; margin: 0; }
button.icon { padding: 8px 11px; margin: 0; font-size: 15px; line-height: 1; }
.toasts { position: fixed; right: 16px; top: 16px; z-index: 5000; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast { background: #0b2b49; color: #fff; padding: 11px 14px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 13.5px; cursor: pointer; animation: toast-in .25s ease; }
.toast b { display: block; margin-bottom: 2px; }
.toast.urgent { background: #a93226; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.cd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.cd-head > div:last-child { display: flex; gap: 8px; flex-wrap: wrap; }
.cd-head button { margin-top: 0; }
.modal-back { position: fixed; inset: 0; background: rgba(5,20,35,.55); z-index: 4000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; color: var(--ink); border-radius: 16px; max-width: 760px; width: 100%; max-height: 92vh; overflow: auto; padding: 22px 24px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal h3 { margin: 0 0 12px; }
.modal .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 10px; }
.modal label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.modal input, .modal select, .modal textarea { width: 100%; padding: 9px 10px; border: 1px solid #b9cbdb; border-radius: 8px; box-sizing: border-box; font: inherit; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
html[data-theme="dark"] .modal { background: #111f2e; }
.md p { margin: 6px 0; } .md ul, .md ol { margin: 6px 0 6px 20px; } .md h1, .md h2, .md h3, .md h4 { margin: 12px 0 6px; font-size: 15px; } .md h1 { font-size: 17px; } .md code { background: rgba(31,111,178,.1); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; } .md pre { background: #0f1d2b; color: #d6e1eb; padding: 10px 12px; border-radius: 10px; overflow: auto; font-size: 12.5px; } .md table { min-width: 0; margin: 6px 0; font-size: 13px; } .md th, .md td { padding: 5px 8px; white-space: normal; } .md blockquote { border-left: 3px solid var(--accent); margin: 6px 0; padding: 2px 10px; color: var(--muted); } .md a.kbref { background: #e3effa; color: #1f4f8a; padding: 1px 6px; border-radius: 6px; font-weight: 700; text-decoration: none; font-size: 12px; } .md hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
html[data-theme="dark"] .md a.kbref { background: #11293d; color: #8cc8ef; }

/* ---- AI chat ---- */
.aichat-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; min-height: 640px; }
@media (max-width: 1000px) { .aichat-layout { grid-template-columns: 1fr; } .aichat-side { order: 2; } }
.aichat-side { display: flex; flex-direction: column; gap: 10px; border-right: 1px solid var(--line); padding-right: 14px; }
.aichat-side-head { display: flex; flex-direction: column; gap: 6px; } .aichat-side-head button { margin: 0; width: 100%; }
.aichat-side input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #b9cbdb; border-radius: 8px; }
.aichat-convs { display: flex; flex-direction: column; gap: 4px; max-height: 520px; overflow: auto; }
.aichat-conv { padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 13px; line-height: 1.3; border: 1px solid transparent; }
.aichat-conv:hover { background: rgba(31,111,178,.08); } .aichat-conv.on { background: rgba(31,111,178,.14); border-color: rgba(31,111,178,.3); }
.aichat-conv .t { font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .aichat-conv .m { color: var(--muted); font-size: 11.5px; }
.aichat-conv.guide .t::before { content: "📹 "; } .aichat-conv.pinned .t::before { content: "📌 "; }
.aichat-main { display: flex; flex-direction: column; min-height: 0; }
.aichat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; } .aichat-head h2 { margin: 0 0 4px; } .aichat-head-actions button { margin: 0; }
.aichat-messages { flex: 1; overflow: auto; padding: 14px 6px; display: flex; flex-direction: column; gap: 14px; min-height: 360px; max-height: 60vh; }
.msg { max-width: 92%; display: flex; flex-direction: column; gap: 4px; }
.msg.user { align-self: flex-end; align-items: flex-end; } .msg.assistant { align-self: flex-start; }
.msg .bubble { padding: 11px 14px; border-radius: 14px; line-height: 1.5; font-size: 14px; }
.msg.user .bubble { background: linear-gradient(180deg, #2d75a5 0%, #245f8a 100%); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.assistant .bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
html[data-theme="dark"] .msg.assistant .bubble { background: #16283a; border-color: #26405a; }
.msg .meta { font-size: 11px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.msg .thumbs { display: flex; gap: 6px; flex-wrap: wrap; } .msg .thumbs img { max-height: 110px; border-radius: 8px; border: 1px solid var(--line); }
.tooltrace { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); padding: 6px 10px; border-left: 3px solid rgba(31,111,178,.35); margin: 2px 0 2px 2px; }
.tooltrace .tl { display: flex; gap: 6px; align-items: baseline; } .tooltrace .tl .n { font-weight: 700; color: var(--accent); font-family: ui-monospace, Menlo, monospace; font-size: 11px; } .tooltrace .tl.err .n { color: #c0392b; }
.tooltrace .tl.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
details.thinking { font-size: 12.5px; color: var(--muted); } details.thinking summary { cursor: pointer; } details.thinking pre { white-space: pre-wrap; font: inherit; background: rgba(31,111,178,.06); padding: 8px 10px; border-radius: 8px; }
.aichat-suggestions { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0; }
.aichat-suggestions button { margin: 0; padding: 6px 10px; font-size: 12.5px; font-weight: 600; background: rgba(31,111,178,.08); color: var(--accent); box-shadow: none; }
.aichat-form { border-top: 1px solid var(--line); padding-top: 10px; }
.aichat-input-row { display: flex; gap: 8px; align-items: flex-end; } .aichat-input-row textarea { flex: 1; resize: vertical; min-height: 44px; padding: 10px 12px; border: 1px solid #b9cbdb; border-radius: 12px; font: inherit; } .aichat-input-row button { margin: 0; }
.aichat-input-row button.icon.on { background: #d64545; color: #fff; }
.aichat-attach { display: flex; gap: 6px; flex-wrap: wrap; } .aichat-attach img { height: 60px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.aichat-hint { margin-top: 4px; font-size: 12px; } .aichat-status { padding: 6px 0; }
.ai-fab { position: fixed; right: 20px; bottom: 20px; z-index: 3500; border-radius: 999px; padding: 12px 18px; background: linear-gradient(135deg, #1f6fb2, #0b2b49); color: #fff; font-weight: 800; box-shadow: 0 10px 30px rgba(11,43,73,.35); margin: 0; }
.ai-fab.hidden { display: none; }
.ai-drawer { position: fixed; right: 20px; bottom: 20px; width: 420px; max-width: calc(100vw - 40px); height: 600px; max-height: calc(100vh - 40px); z-index: 3600; background: #fff; color: var(--ink); border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden; }
html[data-theme="dark"] .ai-drawer { background: #0f1d2b; }
.ai-drawer-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); } .ai-drawer-head .small { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-drawer .aichat-messages { max-height: none; min-height: 0; padding: 10px; } .ai-drawer .aichat-form { padding: 8px 10px 10px; }
.ai-call { position: fixed; inset: 0; z-index: 4500; background: #06111c; color: #e6eef6; display: grid; grid-template-columns: 1fr 380px; }
@media (max-width: 900px) { .ai-call { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } }
.ai-call .stage { position: relative; display: flex; align-items: center; justify-content: center; background: #000; }
.ai-call video { max-width: 100%; max-height: 100%; } .ai-call canvas { display: none; }
.ai-call .stage .badge-live { position: absolute; left: 14px; top: 14px; background: rgba(214,69,69,.9); color: #fff; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.ai-call .panel { display: flex; flex-direction: column; background: #0f1d2b; border-left: 1px solid #1c3247; min-height: 0; }
.ai-call .panel .head { padding: 12px 14px; border-bottom: 1px solid #1c3247; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ai-call .panel .head b { font-size: 15px; } .ai-call .panel .head button { margin: 0; }
.ai-call .transcript { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.ai-call .transcript .u { align-self: flex-end; background: #245f8a; padding: 8px 12px; border-radius: 12px 12px 4px 12px; max-width: 90%; white-space: pre-wrap; }
.ai-call .transcript .a { align-self: flex-start; background: #16283a; padding: 8px 12px; border-radius: 12px 12px 12px 4px; max-width: 95%; line-height: 1.45; }
.ai-call .transcript .s { color: #93a7ba; font-size: 12px; text-align: center; }
.ai-call .controls { padding: 10px 12px; border-top: 1px solid #1c3247; display: flex; flex-wrap: wrap; gap: 6px; }
.ai-call .controls button { margin: 0; padding: 9px 12px; font-size: 13px; } .ai-call .controls button.on { background: #d64545; color: #fff; }
.ai-call .controls .neutral { background: #16283a; color: #e6eef6; border-color: #2a4560; }
.ai-call .say { display: flex; gap: 6px; padding: 0 12px 12px; } .ai-call .say input { flex: 1; padding: 9px 10px; border-radius: 10px; border: 1px solid #2a4560; background: #0d1a27; color: #e6eef6; } .ai-call .say button { margin: 0; }
.ai-call .listening { color: #8fe0b6; font-size: 12px; padding: 0 14px 6px; min-height: 16px; }

/* ---- Team chat ---- */
.teamchat-layout { display: grid; grid-template-columns: 270px 1fr; gap: 16px; min-height: 640px; }
@media (max-width: 1000px) { .teamchat-layout { grid-template-columns: 1fr; } }
.tc-side { border-right: 1px solid var(--line); padding-right: 12px; display: flex; flex-direction: column; gap: 6px; max-height: 78vh; overflow: auto; }
.tc-side-head { display: flex; gap: 6px; } .tc-side-head input { flex: 1; padding: 8px 10px; border: 1px solid #b9cbdb; border-radius: 8px; min-width: 0; }
.tc-group-title { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 8px 0 2px; font-weight: 800; }
.tc-list { display: flex; flex-direction: column; gap: 2px; }
.tc-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.tc-item:hover { background: rgba(31,111,178,.08); } .tc-item.on { background: rgba(31,111,178,.14); font-weight: 700; }
.tc-item .ic { width: 20px; text-align: center; } .tc-item .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tc-item .un { background: #d64545; color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; font-weight: 800; } .tc-item .un.m { background: #e67e22; }
.tc-item .live { color: #d64545; font-size: 11px; font-weight: 800; }
.tc-people .tc-item .dot { width: 9px; height: 9px; border-radius: 50%; background: #bdc3c7; } .tc-people .tc-item .dot.online { background: #2e9e5b; } .tc-people .tc-item .dot.busy { background: #d64545; } .tc-people .tc-item .dot.away { background: #f2c94c; }
.tc-main { display: flex; flex-direction: column; min-height: 0; }
.tc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 8px; } .tc-head h2 { margin: 0; } .tc-head-actions button { margin: 0; }
.tc-meeting { background: linear-gradient(135deg, #0b2b49, #1f6fb2); color: #fff; border-radius: 12px; padding: 10px 14px; margin: 8px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; } .tc-meeting button { margin: 0; }
.tc-pinned { font-size: 12.5px; background: #fff7e6; border: 1px solid #f4dfa6; border-radius: 10px; padding: 6px 10px; margin: 6px 0; }
.tc-messages { flex: 1; overflow: auto; min-height: 380px; max-height: 58vh; padding: 10px 4px; display: flex; flex-direction: column; gap: 2px; }
.tc-msg { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 6px 8px; border-radius: 10px; position: relative; }
.tc-msg:hover { background: rgba(31,111,178,.05); } .tc-msg.cont { grid-template-columns: 36px 1fr; } .tc-msg.cont .av { visibility: hidden; height: 0; }
.tc-msg .av { width: 34px; height: 34px; border-radius: 10px; background: #1f6fb2; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.tc-msg .hd { display: flex; gap: 8px; align-items: baseline; } .tc-msg .hd b { font-size: 13.5px; } .tc-msg .hd .tm { color: var(--muted); font-size: 11px; }
.tc-msg .tx { font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; } .tc-msg .tx .mention { background: #e3effa; color: #1f4f8a; border-radius: 5px; padding: 0 4px; font-weight: 700; }
.tc-msg.system { grid-template-columns: 1fr; font-size: 12.5px; color: var(--muted); text-align: center; padding: 4px; } .tc-msg.system .tx { white-space: normal; }
.tc-msg.urgent .tx { border-left: 3px solid #d64545; padding-left: 8px; }
.tc-msg .acts { position: absolute; right: 8px; top: -10px; display: none; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 2px; } .tc-msg:hover .acts { display: flex; } .tc-msg .acts button { margin: 0; padding: 3px 7px; font-size: 12px; box-shadow: none; background: transparent; }
html[data-theme="dark"] .tc-msg .acts { background: #16283a; }
.tc-msg .reacts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; } .tc-msg .reacts span { background: rgba(31,111,178,.1); border-radius: 999px; padding: 1px 7px; font-size: 12px; cursor: pointer; } .tc-msg .reacts span.me { background: rgba(31,111,178,.25); }
.tc-msg .reply { font-size: 12px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 6px; margin-bottom: 2px; }
.tc-msg .file a { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; } .tc-msg .file img { max-width: 320px; max-height: 240px; border-radius: 10px; display: block; margin-top: 4px; }
.card-ref { display: inline-flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 8px 12px; margin-top: 4px; background: #fff; cursor: pointer; min-width: 220px; max-width: 420px; font-size: 13px; }
.card-ref b { font-size: 13.5px; } .card-ref .sub { color: var(--muted); font-size: 12px; } .card-ref.ticket { border-left-color: #e67e22; } .card-ref.incident { border-left-color: #d64545; } .card-ref.document { border-left-color: #6a4fb3; } .card-ref.meeting { border-left-color: #2e9e5b; }
html[data-theme="dark"] .card-ref { background: #16283a; }
.tc-typing { min-height: 16px; padding: 2px 8px; }
.tc-form { border-top: 1px solid var(--line); padding-top: 8px; } .tc-input-row { display: flex; gap: 8px; align-items: flex-end; } .tc-input-row textarea { flex: 1; resize: vertical; min-height: 42px; padding: 10px 12px; border: 1px solid #b9cbdb; border-radius: 12px; font: inherit; } .tc-input-row button { margin: 0; } .tc-input-row button.on { background: #d64545; color: #fff; }
.tc-replyto { font-size: 12px; color: var(--muted); padding: 4px 8px; display: flex; justify-content: space-between; }
.meet-room { position: fixed; inset: 0; z-index: 4400; background: #06111c; color: #e6eef6; display: flex; flex-direction: column; }
.meet-room .mr-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid #1c3247; } .meet-room .mr-head b { font-size: 16px; }
.meet-room .mr-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; padding: 12px; align-content: center; overflow: auto; }
.meet-room .tile { position: relative; background: #0f1d2b; border-radius: 14px; overflow: hidden; aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center; border: 1px solid #1c3247; }
.meet-room .tile video { width: 100%; height: 100%; object-fit: cover; } .meet-room .tile.screen video { object-fit: contain; background: #000; }
.meet-room .tile .nm { position: absolute; left: 10px; bottom: 8px; background: rgba(0,0,0,.55); padding: 3px 9px; border-radius: 999px; font-size: 12.5px; } .meet-room .tile .ph { font-size: 44px; font-weight: 800; color: #5aa7e6; }
.meet-room .mr-bar { display: flex; justify-content: center; gap: 8px; padding: 12px; border-top: 1px solid #1c3247; flex-wrap: wrap; } .meet-room .mr-bar button { margin: 0; background: #16283a; color: #e6eef6; border: 1px solid #2a4560; } .meet-room .mr-bar button.on { background: #1f6fb2; } .meet-room .mr-bar button.danger { background: #a93226; border-color: #a93226; }
.meet-room .mr-side { position: absolute; right: 0; top: 52px; bottom: 64px; width: 320px; background: #0f1d2b; border-left: 1px solid #1c3247; display: none; flex-direction: column; } .meet-room.chat .mr-side { display: flex; }

/* ---- City Desk ---- */
.cd-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0 12px; } .cd-filters input, .cd-filters select { padding: 8px 10px; border: 1px solid #b9cbdb; border-radius: 8px; } .cd-filters input { min-width: 260px; }
.cd-list { display: flex; flex-direction: column; gap: 6px; }
.tk { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.tk:hover { border-color: var(--accent); } html[data-theme="dark"] .tk { background: #111f2e; border-color: #1f354b; }
.tk .pr { font-weight: 900; font-size: 13px; text-align: center; border-radius: 8px; padding: 6px 0; color: #fff; } .pr.P1 { background: #c0392b; } .pr.P2 { background: #e67e22; } .pr.P3 { background: #2d75a5; } .pr.P4 { background: #7f8c8d; }
.tk .ti { font-weight: 700; font-size: 14px; } .tk .sub { color: var(--muted); font-size: 12.5px; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.tk .st { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; }
.status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-weight: 700; font-size: 11.5px; background: #eef3f7; color: #34495e; }
.status.new { background: #e3effa; color: #1f4f8a; } .status.triaged, .status.assigned { background: #efe7fb; color: #5b3a9a; } .status.in_progress { background: #fdf3df; color: #7a5312; } .status.waiting { background: #f4f6f7; color: #566573; } .status.resolved, .status.closed { background: #e6f5ec; color: #176a45; } .status.rejected { background: #fde7e7; color: #8b2727; }
.sla { font-size: 11.5px; color: var(--muted); } .sla.bad { color: #c0392b; font-weight: 800; }
.cd-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; align-items: start; }
.cd-col { background: rgba(31,111,178,.05); border-radius: 12px; padding: 8px; min-height: 120px; } .cd-col h4 { margin: 2px 4px 8px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.cd-col .tk { grid-template-columns: 40px 1fr; margin-bottom: 6px; padding: 8px; } .cd-col .tk .st { display: none; }
.cd-map { height: 520px; border-radius: 12px; border: 1px solid var(--line); }
.tk-view { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; } @media (max-width: 1000px) { .tk-view { grid-template-columns: 1fr; } }
.tk-view h2 { margin: 0 0 6px; } .tk-view .desc { white-space: pre-wrap; background: rgba(31,111,178,.05); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.tk-props { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .tk-props label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; } .tk-props select, .tk-props input { padding: 7px 9px; border: 1px solid #b9cbdb; border-radius: 8px; font: inherit; }
.tk-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; } .tk-actions button { margin: 0; padding: 8px 12px; font-size: 13px; }
.timeline { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 420px; overflow: auto; } .timeline .e { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: 13px; padding: 6px 8px; border-left: 3px solid var(--line); } .timeline .e.comment { border-left-color: var(--accent); } .timeline .e.status { border-left-color: #2e9e5b; } .timeline .e.ai { border-left-color: #6a4fb3; } .timeline .e.public { border-left-color: #e67e22; } .timeline .e .w { color: var(--muted); font-size: 11.5px; } .timeline .e .pub { font-size: 10px; color: #e67e22; font-weight: 800; }
.tk-attach { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; } .tk-attach a img { height: 90px; border-radius: 8px; border: 1px solid var(--line); } .tk-attach a { font-size: 12.5px; }
.kpi-mini { display: flex; gap: 10px; flex-wrap: wrap; } .kpi-mini div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 110px; } .kpi-mini b { display: block; font-size: 18px; } .kpi-mini span { font-size: 11.5px; color: var(--muted); }
html[data-theme="dark"] .kpi-mini div { background: #111f2e; border-color: #1f354b; }

/* ---- Transit ---- */
.transit-panel { position: absolute; right: 12px; top: 12px; z-index: 850; width: 300px; max-height: calc(100% - 24px); overflow: auto; background: rgba(255,255,255,.96); border-radius: 12px; box-shadow: 0 2px 14px rgba(0,0,0,.2); padding: 10px 12px; font-size: 13px; }
html[data-theme="dark"] .transit-panel { background: rgba(17,31,46,.96); color: #d6e1eb; }
.transit-panel h4 { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; } .transit-panel .ln { display: inline-block; min-width: 26px; text-align: center; padding: 2px 8px; border-radius: 7px; color: #fff; font-weight: 900; }
.transit-panel .stops { max-height: 260px; overflow: auto; margin: 6px 0; } .transit-panel .stop { padding: 3px 0 3px 12px; border-left: 2px solid #ccc; font-size: 12.5px; cursor: pointer; } .transit-panel .stop:hover { background: rgba(31,111,178,.08); }
.transit-panel .veh { display: flex; justify-content: space-between; font-size: 12px; padding: 2px 0; border-bottom: 1px dashed var(--line); }
.veh-marker { display: flex; align-items: center; justify-content: center; border-radius: 8px; color: #fff; font-weight: 900; font-size: 11px; padding: 2px 6px; box-shadow: 0 1px 4px rgba(0,0,0,.4); border: 2px solid #fff; white-space: nowrap; transform-origin: center; }
.veh-marker.est { opacity: .75; border-style: dashed; } .veh-marker .arr { display: inline-block; margin-left: 3px; font-size: 10px; }
.stop-marker { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #1f6fb2; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.tk-marker { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; } .tk-marker span { transform: rotate(45deg); font-size: 13px; }
.tr-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; } @media (max-width: 1000px) { .tr-layout { grid-template-columns: 1fr; } }
.tr-detail { border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-height: 200px; background: #fff; } html[data-theme="dark"] .tr-detail { background: #111f2e; }
.tr-line { display: inline-block; min-width: 30px; text-align: center; padding: 3px 8px; border-radius: 8px; color: #fff; font-weight: 900; }
#map3dCanvas { height: 620px; border-radius: 12px; }
#mapCanvas.hidden { display: none; }
.maplibregl-popup-content { color: #1f2d3d; font-size: 13px; }
.ml-level-note { position: absolute; left: 12px; top: 12px; z-index: 850; background: rgba(11,43,73,.9); color: #fff; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; max-width: 320px; }

/* ---- Signal designer ---- */
/* v2.11.6 — the columns may shrink below their content (minmax(0, …)): a "1fr" column grows to its widest unbreakable child, so one long line in the result
   made the whole page wider than the screen (the header then covered only part of it and half of the window was empty). Wide content scrolls inside its own panel. */
.sd-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; } @media (max-width: 1100px) { .sd-layout { grid-template-columns: minmax(0, 1fr); } }
.sd-layout > * { min-width: 0; }
.sd-result { max-width: 100%; overflow-x: auto; }
.sd-geo-grid > * { min-width: 0; }
.sd-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 6px 0; } .sd-row label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); } .sd-row input, .sd-row select { padding: 7px 9px; border: 1px solid #b9cbdb; border-radius: 8px; font: inherit; }
.sd-app { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; background: #fff; } html[data-theme="dark"] .sd-app { background: #111f2e; }
.sd-app .hd { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }   /* v2.11.6 — on a narrower column the header wraps instead of being cut off */ .sd-app .hd input { font-weight: 700; } .sd-app .hd button { margin: 0; }
.sd-mv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; } .sd-mv > div { background: rgba(31,111,178,.05); border-radius: 8px; padding: 6px 8px; } .sd-mv b { font-size: 12px; display: block; margin-bottom: 4px; } .sd-mv label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; } .sd-mv input { padding: 5px 7px; border: 1px solid #b9cbdb; border-radius: 6px; width: 100%; box-sizing: border-box; }
.sd-adv { margin: 8px 0; } .sd-adv summary { cursor: pointer; font-weight: 700; font-size: 13.5px; }
.sd-result { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; min-height: 300px; } html[data-theme="dark"] .sd-result { background: #111f2e; }
.sd-result h3 { margin: 8px 0 6px; } .sd-phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.sd-phase { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; } .sd-phase b { display: block; margin-bottom: 4px; } .sd-phase .bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 4px 0; } .sd-phase .bar i { display: block; height: 100%; } .sd-phase .bar .g { background: #2e9e5b; } .sd-phase .bar .a { background: #f2c94c; } .sd-phase .bar .r { background: #d64545; }
.sd-ring { display: flex; height: 22px; border-radius: 8px; overflow: hidden; margin: 8px 0; border: 1px solid var(--line); } .sd-ring div { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; }
.sd-warn { background: #fff7e6; border: 1px solid #f4dfa6; border-radius: 8px; padding: 6px 10px; font-size: 13px; margin: 4px 0; } .sd-ok { background: #e6f5ec; border: 1px solid #b7e1c6; border-radius: 8px; padding: 6px 10px; font-size: 13px; margin: 4px 0; }
.sd-math { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; white-space: pre-wrap; background: rgba(31,111,178,.05); border-radius: 8px; padding: 8px 10px; max-height: 320px; overflow: auto; }
.los { display: inline-block; width: 24px; height: 24px; border-radius: 6px; color: #fff; font-weight: 900; text-align: center; line-height: 24px; } .los.A, .los.B { background: #2e9e5b; } .los.C { background: #8bc34a; } .los.D { background: #f2c94c; color: #333; } .los.E { background: #ef8a2b; } .los.F { background: #d64545; }
.sd-explain { background: linear-gradient(180deg, rgba(31,111,178,.06), transparent); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.sd-diagram { width: 100%; max-width: 360px; display: block; margin: 6px auto; }

/* ---- Knowledge base ---- */
.kb-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; } @media (max-width: 1000px) { .kb-layout { grid-template-columns: 1fr; } }
.kb-list { display: flex; flex-direction: column; gap: 4px; max-height: 70vh; overflow: auto; }
.kb-it { padding: 8px 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; } .kb-it:hover { background: rgba(31,111,178,.08); } .kb-it.on { background: rgba(31,111,178,.14); border-color: rgba(31,111,178,.3); }
.kb-it b { display: block; font-size: 13.5px; } .kb-it .s { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; } .kb-it .ref { font-family: ui-monospace, monospace; font-size: 11px; color: var(--accent); }
.kb-article { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: #fff; min-height: 300px; } html[data-theme="dark"] .kb-article { background: #111f2e; }
.kb-article .head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; } .kb-article .head button { margin: 0; }
.kb-article textarea { width: 100%; min-height: 420px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; padding: 10px; border: 1px solid #b9cbdb; border-radius: 10px; box-sizing: border-box; }
.kb-gaps { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.gap { border: 1px solid var(--line); border-left: 4px solid #e67e22; border-radius: 10px; padding: 8px 12px; margin: 6px 0; background: #fff; } .gap.update { border-left-color: #6a4fb3; } .gap.drafted { border-left-color: #2e9e5b; } .gap b { font-size: 14px; } .gap .small { margin-top: 2px; } .gap button { margin: 6px 6px 0 0; padding: 6px 10px; font-size: 12.5px; }
html[data-theme="dark"] .gap { background: #111f2e; }
.tagchip { display: inline-block; background: rgba(31,111,178,.1); color: var(--accent); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; margin-right: 4px; }

/* ---- Documents ---- */
.doc-layout { display: grid; grid-template-columns: 360px 1fr; gap: 16px; margin-top: 10px; } @media (max-width: 1000px) { .doc-layout { grid-template-columns: 1fr; } }
.doc-list { display: flex; flex-direction: column; gap: 4px; max-height: 70vh; overflow: auto; }
.doc-it { padding: 8px 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; display: grid; grid-template-columns: 1fr auto; gap: 6px; } .doc-it:hover { background: rgba(31,111,178,.08); } .doc-it.on { background: rgba(31,111,178,.14); border-color: rgba(31,111,178,.3); }
.doc-it b { display: block; font-size: 13.5px; } .doc-it .s { font-size: 12px; color: var(--muted); }
.doc-view { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: #fff; min-height: 300px; } html[data-theme="dark"] .doc-view { background: #111f2e; }
.doc-view .head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; } .doc-view .head button { margin: 0 4px 4px 0; }
.docform { font-family: Georgia, 'Times New Roman', serif; max-width: 760px; margin: 10px auto; background: #fff; color: #111; padding: 26px 30px; border: 1px solid #ccc; box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.docform h1 { font-size: 20px; text-align: center; margin: 4px 0 14px; } .docform p { margin: 6px 0; line-height: 1.5; }
.docform .f { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; } .docform .f label { min-width: 200px; font-weight: 600; } .docform .f input, .docform .f select, .docform .f textarea { flex: 1; min-width: 200px; padding: 6px 8px; border: 0; border-bottom: 1px solid #333; background: #fcfcf4; font: inherit; } .docform .f textarea { min-height: 60px; }
.docform .f.req label::after { content: " *"; color: #c0392b; } .docform .f.unc input { background: #fff3cd; } .docform .f.sig input { font-style: italic; }
.docform .f .note { width: 100%; font-size: 12px; color: #7a5312; }
.docform table { border-collapse: collapse; width: 100%; margin: 6px 0; } .docform th, .docform td { border: 1px solid #333; padding: 2px; } .docform td input { width: 100%; border: 0; padding: 4px; box-sizing: border-box; font: inherit; }
.docform .apr { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 18px; } .docform .apr div { min-width: 170px; border-top: 1px solid #333; padding-top: 4px; font-size: 12px; } .docform .apr .ok { color: #176a45; font-weight: 700; } .docform .apr .no { color: #8b2727; font-weight: 700; } .docform .apr .pending { color: #7a5312; font-weight: 700; }
.doc-pages { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; } .doc-pages img { height: 100px; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.doc-steps { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; } .doc-step { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; } .doc-step .n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; text-align: center; line-height: 24px; font-weight: 800; font-size: 12px; } .doc-step.approved .n { background: #2e9e5b; } .doc-step.rejected .n { background: #d64545; } .doc-step.pending .n { background: #e67e22; } .doc-step.cancelled .n { background: #95a5a6; }
.doc-step input, .doc-step select { padding: 4px 6px; border: 1px solid #b9cbdb; border-radius: 6px; font-size: 12px; }
.docmeta { font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.scan-drop { border: 2px dashed rgba(31,111,178,.45); border-radius: 14px; padding: 26px; text-align: center; color: var(--muted); margin: 10px 0; background: rgba(31,111,178,.04); }
.progress-line { height: 4px; background: linear-gradient(90deg, #1f6fb2, #5aa7e6, #1f6fb2); background-size: 200% 100%; animation: slide 1.2s linear infinite; border-radius: 2px; margin: 6px 0; } @keyframes slide { to { background-position: -200% 0; } }

/* ---- signal designer: evidence panel & objective scoring (v2.0.1) */
.sd-evidence { border: 1px solid var(--line, #dfe7ee); border-radius: 12px; padding: 12px 14px; margin: 8px 0 12px; background: rgba(31,111,178,.04); }
.sd-evidence h3 { margin: 0 0 6px; font-size: 15px; }
.sd-ev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.sd-ev-app { border: 1px solid var(--line, #dfe7ee); border-radius: 10px; padding: 8px 10px; background: var(--card, #fff); font-size: 12.5px; }
.sd-ev-app b { font-size: 13.5px; }
.sd-conf { display: inline-block; min-width: 46px; text-align: center; padding: 1px 7px; border-radius: 999px; font-weight: 700; font-size: 11.5px; color: #fff; }
.sd-conf.hi { background: #2e9e5b; } .sd-conf.md { background: #e0a12b; } .sd-conf.lo { background: #d64545; }
.sd-spark { display: flex; align-items: flex-end; gap: 1px; height: 34px; margin: 6px 0 2px; }
.sd-spark i { flex: 1; background: #1f6fb2; opacity: .75; border-radius: 2px 2px 0 0; min-height: 1px; }
.sd-spark i.peak { background: #d64545; opacity: 1; }
.sd-spark i.dh { outline: 2px solid #0b2b49; }
.sd-src { font-size: 11.5px; color: var(--muted, #5d6d7e); }
.sd-risk { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.sd-risk span { background: var(--card, #fff); border: 1px solid var(--line, #dfe7ee); border-radius: 999px; padding: 3px 9px; font-size: 12px; }
.sd-risk span.bad { border-color: #e9b3b3; background: #fde7e7; color: #8b2727; } .sd-risk span.warn { border-color: #f4dfa6; background: #fff7e6; color: #7a5312; }
.sd-periods { display: flex; flex-wrap: wrap; gap: 6px; }
.sd-periods span { border: 1px solid var(--line, #dfe7ee); border-radius: 8px; padding: 4px 8px; font-size: 12px; background: var(--card, #fff); }
.sd-periods span.on { border-color: #1f6fb2; background: rgba(31,111,178,.1); font-weight: 700; }
.sd-score td.bar { min-width: 120px; } .sd-score .pi { display: inline-block; height: 8px; background: #1f6fb2; border-radius: 4px; vertical-align: middle; }
.sd-score tr.best td { background: rgba(46,158,91,.08); } .sd-score tr.infeasible td { opacity: .6; text-decoration: line-through; }
.sd-score tr.infeasible td.reason { text-decoration: none; opacity: 1; color: #8b2727; }
.sd-plans table td, .sd-plans table th { font-size: 12.5px; }
html[data-theme="dark"] .sd-evidence { background: rgba(90,167,230,.06); }

.sd-mode { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #e3effa; color: #1f4f8a; vertical-align: middle; }
.sd-mode.ai { background: #efe7fb; color: #5b3a9a; }
.sd-ai { border: 1px solid #d9c9f2; background: rgba(123,63,160,.05); border-radius: 12px; padding: 10px 14px; margin: 10px 0; }
.sd-ai details { margin: 4px 0; } .sd-ai summary { cursor: pointer; }
.sd-live { padding: 8px 0; } .sd-live-status { margin: 6px 0; }
.sd-think { font-style: italic; color: var(--muted, #5d6d7e); border-left: 3px solid #d9c9f2; padding: 4px 8px; margin: 4px 0; white-space: pre-wrap; }
.sd-note { border-left: 3px solid #1f6fb2; padding: 4px 8px; margin: 4px 0; }


/* ---- v2.0.8 signal designer: geometry & lanes, benchmark, new-intersection dialog ---- */
.sd-geo { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.sd-geo-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .sd-geo-grid { grid-template-columns: 1fr; } }
.sd-geo-map { height: 300px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #eef2f6; }
/* v2.11.7 — the map shows only the real routes; the sketch of the junction (centre box, straight arms at the angles in the table) sits under it */
.sd-geo-left { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sd-geo-sketch { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 6px 8px 2px; }
.sd-sketch { width: 100%; height: auto; display: block; }
/* v2.11.7 — the exits of each approach, per direction: a list with ticks that opens in place */
.sd-exit-table td { vertical-align: top; }
.sd-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.sd-pick > summary { cursor: pointer; list-style: none; border: 1px solid #b9cbdb; border-radius: 8px; padding: 4px 8px; background: #fff; min-width: 110px; max-width: 230px; font-size: 12.5px; white-space: normal; }
.sd-pick > summary::-webkit-details-marker { display: none; }
.sd-pick > summary::after { content: ' ▾'; color: var(--muted); }
.sd-pick.chosen > summary { border-color: #1f6fb2; box-shadow: inset 3px 0 0 #1f6fb2; font-weight: 700; }
.sd-pick-menu { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; margin-top: 3px; border: 1px solid var(--line); border-radius: 8px; background: #f6f9fc; max-width: 230px; }
.sd-pick-menu label { display: flex; align-items: flex-start; justify-content: flex-start; gap: 6px; font-size: 12.5px; font-weight: 400; text-align: left; margin: 0; cursor: pointer; }
.sd-pick-menu label input { width: auto; margin: 2px 0 0; flex: none; }
html[data-theme="dark"] .sd-pick > summary { background: #111f2e; } html[data-theme="dark"] .sd-pick-menu { background: #142537; }
/* v2.11.9 — a direction with no exit, in the form: says so and leads to the list where it is opened */
/* v2.11.10 — changes typed but not saved yet, beside each Save button */
.sd-dirty { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 700; color: #b45309; white-space: nowrap; }
html[data-theme="dark"] .sd-dirty { color: #fbbf24; }
.sd-closed { display: block; margin-top: 6px; font-size: 11.5px; font-weight: 700; color: #8a5a00; background: #fff7e6; border: 1px solid #f4dfa6; border-radius: 8px; padding: 4px 6px; text-decoration: none; line-height: 1.3; }
.sd-closed:hover { background: #ffefc7; }
.sd-route-arrow { width: 16px; height: 16px; line-height: 16px; text-align: center; font-size: 15px; text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 0 4px #fff; }
.sd-geo-table { width: 100%; font-size: 13px; }
.sd-geo-table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
.sd-geo-table td { vertical-align: top; padding: 5px 6px; }
.sd-geo-table input[type=number], .sd-geo-table input[type=text], .sd-geo-table input:not([type]) { padding: 3px 5px; font-size: 13px; }
.sd-leg-lbl { display: inline-block; white-space: nowrap; background: #fff; border-left: 4px solid #1f6fb2; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; color: #1f2d3d; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.sd-leg-lbl.exit { border-left-color: #7f8c8d; color: #5d6d7e; }
.sd-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: #eef3f7; border: 1px solid #d5e0ea; color: #1f2d3d; }
.sd-chip.ok { background: #e6f5ec; border-color: #bfe3cf; color: #176a45; }
.sd-chip.warn { background: #fdf3df; border-color: #f1d9a3; color: #7a5312; }
.sd-chip.bad { background: #fadede; border-color: #e09c9c; color: #8a2020; }
.chk-inline { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 4px; white-space: nowrap; }
.sd-bench { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; background: #f6f9fc; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
.sd-bench .arrow { font-weight: 800; color: #0b2b49; text-align: center; }
html[data-theme="dark"] .sd-bench { background: #142537; }
html[data-theme="dark"] .sd-leg-lbl { background: #1b2b40; color: #e6eef7; }
.modal.wide { max-width: 1100px; }
.sd-new { background: #f6f9fc; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
html[data-theme="dark"] .sd-new { background: #142537; }
.sd-diagram { width: 100%; max-width: 380px; height: auto; display: block; margin: 4px auto; }

/* ---- v2.0.9 documents: structure editor ---- */
.fe-list { display: flex; flex-direction: column; gap: 6px; max-height: 58vh; overflow: auto; padding-right: 4px; }
.fe-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: #f6f9fc; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
html[data-theme="dark"] .fe-row { background: #142537; }
.fe-row input, .fe-row select { padding: 5px 7px; font-size: 13px; margin: 0; }
.fe-n { width: 22px; text-align: center; font-weight: 800; color: var(--muted); font-size: 12px; }
.fe-tools { margin-left: auto; display: inline-flex; gap: 2px; }
.fe-tools .icon { padding: 2px 7px; margin: 0; }

/* ---- v2.0.9 calendar ---- */
.cal-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 10px; }
.cal-toolbar .seg { display: inline-flex; align-items: center; gap: 4px; }
.cal-toolbar .seg button { margin: 0; padding: 6px 10px; }
.cal-layout { display: grid; grid-template-columns: 1fr 360px; gap: 14px; align-items: start; }
@media (max-width: 1200px) { .cal-layout { grid-template-columns: 1fr; } }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); text-align: center; padding: 2px 0 4px; }
.cal-day { min-height: 92px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 4px 5px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: box-shadow .12s; }
.cal-day:hover { box-shadow: 0 2px 10px rgba(11,43,73,.12); }
.cal-day.other { opacity: .5; }
.cal-day.today .cal-num { color: #fff; background: #1f6fb2; }
.cal-day.sel { border-color: #1f6fb2; box-shadow: inset 0 0 0 2px #1f6fb2; }
.cal-num { font-size: 12px; font-weight: 800; width: 22px; height: 22px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; }
.cal-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; vertical-align: middle; }
.cal-dot.over { background: #d64545; }
.cal-chip { font-size: 11px; line-height: 1.25; padding: 2px 5px; border-radius: 5px; background: #eef3f7; border-left: 3px solid #9aa7b4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.over, .cal-item.over { background: #fadede; border-left-color: #d64545; }
.cal-chip.today, .cal-item.today { background: #fdebd0; border-left-color: #e67e22; }
.cal-chip.soon, .cal-item.soon { background: #fdf3df; border-left-color: #f1c40f; }
.cal-chip.apr, .cal-item.apr { background: #efe3fb; border-left-color: #8e44ad; }
.cal-chip.ev, .cal-item.ev { background: #e3f0fb; border-left-color: #1f6fb2; }
.cal-chip.tk, .cal-item.tk { background: #eef3f7; }
.cal-chip.done, .cal-item.done { opacity: .55; text-decoration: line-through; }
.cal-more { font-size: 11px; color: var(--muted); }
.cal-side { background: #f6f9fc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 300px; }
.cal-item { border-left: 4px solid #9aa7b4; border-radius: 8px; padding: 8px 10px; margin: 6px 0; background: #fff; }
.cal-item-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-item-h .ico { font-size: 15px; }
.cal-item-a { display: flex; gap: 10px; align-items: center; margin-top: 4px; font-size: 13px; }
.cal-dep { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
html[data-theme="dark"] .cal-day, html[data-theme="dark"] .cal-item { background: #111f2e; }
html[data-theme="dark"] .cal-side { background: #142537; }
html[data-theme="dark"] .cal-chip.tk { background: #1b2b40; }

/* v2.0.10 — signal designer: form actions, saved-inputs banner */
.sd-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sd-actions button.ai { background: linear-gradient(135deg, #6a3fb5, #1f6fb2); border-color: transparent; }
.sd-saved { margin-top: 6px; padding: 7px 10px; border-radius: 8px; background: rgba(46,158,91,.10); border: 1px solid rgba(46,158,91,.35); color: #1e6b3d; }
html[data-theme="dark"] .sd-saved { background: rgba(46,158,91,.16); color: #a9e3bf; }
.sd-dialog-hint { margin: 6px 0 0; padding: 6px 9px; border-radius: 8px; background: rgba(31,111,178,.08); }

/* v2.0.10 — ticket edit: mini map to pick the point */
.et-map { height: 260px; border-radius: 10px; border: 1px solid rgba(94,129,163,.3); margin: 8px 0; }

/* v2.8 — live transit feeds form */
.tl-box { border: 1px solid #d5e0ea; border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; background: #f8fbfd; }
.tl-box summary { cursor: pointer; }
.tl-feed { border-top: 1px solid #e3ebf2; margin-top: 10px; padding-top: 10px; }
.tl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 8px 0; }
.tl-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: #40566b; }
.tl-grid input { padding: 7px 9px; border: 1px solid #b9cbdb; border-radius: 7px; font-size: 13px; }
@media (max-width: 900px) { .tl-grid { grid-template-columns: 1fr; } }

/* v2.11.11 — a recommendation against the previous one, and the history of the recommendations */
.rc-box { margin: 10px 0; padding: 10px 12px; border-radius: 10px; border: 1px solid #c9d8e6; background: #f6f9fc; font-size: 13px; }
.rc-box.changed { border-color: #f0c36a; background: #fffaf0; }
.rc-box.kept { border-color: #9cc7a6; background: #f3faf5; }
.rc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.rc-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e7eef6; color: #2a4a6b; white-space: nowrap; }
.rc-chip.same { background: #e6f4ea; color: #1f6b35; } .rc-chip.changed { background: #fff1d6; color: #8a5a00; } .rc-chip.kept { background: #dff3e6; color: #1f6b35; } .rc-chip.first { background: #e7eef6; color: #2a4a6b; }
.rc-list { margin: 4px 0 4px 18px; padding: 0; } .rc-list li { margin: 2px 0; }
.rc-ai { margin-top: 4px; } .rc-rejected { margin-top: 4px; color: #8a3b12; }
.rc-open { margin: 0 0 0 6px; padding: 2px 8px; font-size: 12px; }
.rc-table td { vertical-align: top; font-size: 12.5px; }
html[data-theme="dark"] .rc-box { background: #13202d; border-color: #2c4258; } html[data-theme="dark"] .rc-box.changed { background: #2a2312; border-color: #6b5420; } html[data-theme="dark"] .rc-box.kept { background: #132a1b; border-color: #2d5e3c; }
html[data-theme="dark"] .rc-chip { background: #22364b; color: #cfe0f2; } html[data-theme="dark"] .rc-rejected { color: #f0a27a; }
/* v2.11.12 — download links shown as buttons (system → cloud) */
a.button-link { display: inline-block; padding: 8px 12px; border: 1px solid #b9cbdb; border-radius: 8px; text-decoration: none; font-size: 13px; }
