:root {
  --navy: #232D4B;
  --navy-2: #2f3c63;
  --navy-ink: #141a2e;
  --orange: #E57200;
  --orange-ink: #b85b00;
  --paper: #eef1f6;
  --card: #ffffff;
  --line: #d9dee8;
  --ink: #1d2433;
  --muted: #5d6679;
  --good: #2e7d5b;
  --warn: #a35a00;
  --bad: #b3261e;
  --tag: #e6eaf2;
  --radius: 14px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: radial-gradient(1200px 800px at 20% 0%, #34426c 0%, var(--navy) 45%, var(--navy-ink) 100%) fixed;
  background-color: var(--navy);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--navy); }
svg { fill: currentColor; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ---------- Layout ---------- */
.shell { height: 100dvh; display: flex; justify-content: center; align-items: stretch; }
.pane { display: none; }
.app {
  width: 100%; max-width: 460px; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--paper); position: relative; overflow: hidden;
}
@media (min-width: 520px) {
  .shell { padding: 24px; align-items: center; }
  .app { height: min(900px, calc(100dvh - 48px)); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
}
/* Desktop: details pane beside chat */
@media (min-width: 900px) {
  .shell { gap: 20px; padding: 24px; }
  .app { max-width: 480px; flex: 0 1 480px; }
  .pane-details { display: flex; flex-direction: column; flex: 0 1 400px; min-width: 320px; height: min(900px, calc(100dvh - 48px));
    background: var(--paper); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
  .info-btn { display: none; }
}
/* Wide desktop: directory pane too */
@media (min-width: 1280px) {
  .pane-directory { display: flex; flex-direction: column; flex: 0 1 320px; min-width: 280px; height: min(900px, calc(100dvh - 48px));
    background: var(--paper); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
  .change-btn { display: none; }
}

/* ---------- Header ---------- */
.hdr { background: var(--navy); color: #fff; padding: calc(12px + var(--safe-t)) 16px 12px; flex: none; }
.hdr-top { display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 12px; letter-spacing: .14em; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.demo-badge.live { background: var(--good); }
.demo-badge { background: var(--orange); color: #fff; font-size: 10px; letter-spacing: .1em; padding: 3px 7px; border-radius: 6px; }
.icon-btn { background: transparent; border: 0; color: inherit; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; position: relative; }
.icon-btn svg { width: 22px; height: 22px; }
.hdr .icon-btn:hover { background: rgba(255,255,255,.1); }
.badge { position: absolute; top: 3px; right: 2px; background: var(--orange); color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }

.seg { margin-top: 8px; display: inline-flex; background: rgba(255,255,255,.12); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; color: #cfd6e6; padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.seg button[aria-checked="true"] { background: #fff; color: var(--navy); }

.plate { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.avatar { width: 52px; height: 52px; border-radius: 14px; background: var(--navy-2); flex: none; overflow: hidden; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.25); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar svg { width: 34px; height: 34px; fill: #fff; }
.plate-text { flex: 1; min-width: 0; }
.plate-name { font-family: var(--serif); font-size: 21px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate-note { font-size: 12.5px; color: #c6cde0; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #48d597; vertical-align: middle; margin-left: 2px; box-shadow: 0 0 0 0 rgba(72,213,151,.7); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(72,213,151,.6); } 70% { box-shadow: 0 0 0 8px rgba(72,213,151,0); } 100% { box-shadow: 0 0 0 0 rgba(72,213,151,0); } }
.plate-btn { background: rgba(255,255,255,.12); border: 0; color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; display: grid; place-items: center; }
.plate-btn svg { width: 20px; height: 20px; }
.plate-btn:hover { background: rgba(255,255,255,.2); }
.user-line { font-size: 12px; color: #aeb7cc; margin-top: 10px; }
.user-line b { color: #fff; font-weight: 600; }

/* ---------- Chat ---------- */
.chat { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.row { display: flex; gap: 8px; align-items: flex-end; animation: fadeUp .25s ease both; }
.row.user { justify-content: flex-end; }
.row .mini { width: 28px; height: 28px; border-radius: 9px; background: var(--navy); flex: none; display: grid; place-items: center; overflow: hidden; }
.row .mini svg { width: 18px; height: 18px; fill: #fff; }
.row .mini img { width: 100%; height: 100%; object-fit: cover; }
.bubble { max-width: 84%; padding: 10px 13px; border-radius: 16px; font-size: 15px; line-height: 1.42; white-space: pre-wrap; word-wrap: break-word; }
.row.building .bubble { background: var(--card); border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(20,26,46,.08); }
.row.user .bubble { background: var(--navy); color: #fff; border-bottom-right-radius: 5px; }
.bubble .from { display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted); margin-bottom: 3px; text-transform: uppercase; }
.sys { align-self: center; font-size: 12px; color: var(--muted); background: #e2e7f0; padding: 6px 12px; border-radius: 999px; text-align: center; max-width: 92%; animation: fadeUp .25s ease both; }
.sys.warn { background: #fff1e0; color: var(--warn); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.typing { display: inline-flex; gap: 4px; padding: 14px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa3b5; 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: .3; } 40% { opacity: 1; } }

/* Rich cards inside bubbles */
.card { margin-top: 9px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; white-space: normal; font-size: 14px; }
.card h4 { margin: 0 0 6px; font-family: var(--serif); font-size: 16px; font-weight: normal; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; font-size: 13.5px; }
.mock { color: var(--orange-ink); font-weight: 700; margin-left: 1px; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list li { border-top: 1px solid var(--line); padding-top: 8px; }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .t { font-weight: 600; }
.list .s { color: var(--muted); font-size: 13px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--tag); color: var(--navy); margin-right: 6px; vertical-align: 1px; }
.tag.planned { background: #fff1e0; color: var(--warn); }
.tag.construction { background: #fde7e5; color: var(--bad); }
.tag.design { background: #e6eefc; color: #2550a0; }
.tag.planning { background: #eaf4ee; color: var(--good); }
.tag.pub { background: #eaf4ee; color: var(--good); }
.tag.nb { background: #e6eaf2; color: var(--navy); }
.card-foot { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.card a.link { font-weight: 600; text-decoration: none; }
.card a.link:hover { text-decoration: underline; }
.card.emergency { background: #fdecea; border-color: #f3b8b2; }
.card.emergency h4 { color: var(--bad); }
.wo-id { font-family: var(--mono); font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.btn { border: 0; border-radius: 10px; padding: 9px 13px; font-size: 14px; font-weight: 600; background: var(--tag); color: var(--navy); }
.btn:hover { filter: brightness(.96); }
.btn.primary { background: var(--orange); color: #fff; }
.btn.navy { background: var(--navy); color: #fff; }
.btn.block { width: 100%; padding: 13px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Chips & composer ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 14px 8px; flex: none; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid #c9d1df; background: #fff; color: var(--navy); border-radius: 999px; padding: 7px 12px; font-size: 13.5px; white-space: nowrap; }
.chip:hover { border-color: var(--navy); }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px calc(10px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line); flex: none; }
.composer textarea { flex: 1; resize: none; border: 1px solid #c9d1df; border-radius: 14px; padding: 10px 12px; font-size: 16px; line-height: 1.35; max-height: 120px; background: #f7f9fc; }
.composer textarea:focus { outline: none; border-color: var(--navy); background: #fff; }
.send { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--orange); color: #fff; display: grid; place-items: center; flex: none; }
.send svg { width: 20px; height: 20px; }

/* ---------- Sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10,14,28,.55); z-index: 40; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 520px; max-height: 88dvh;
  background: #fff; border-radius: 20px 20px 0 0; z-index: 50; display: flex; flex-direction: column; animation: slideUp .28s cubic-bezier(.2,.8,.2,1) both;
  padding-bottom: var(--safe-b); }
@media (min-width: 900px) { .sheet { bottom: 50%; transform: translate(-50%, 50%); border-radius: 20px; max-height: 84dvh; animation: pop .22s ease both; } }
@keyframes slideUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 52%) scale(.98); } }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: #d3d8e2; margin: 8px auto 0; }
@media (min-width: 900px) { .sheet-grab { display: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 6px 20px; }
.sheet-head h2 { font-family: var(--serif); font-weight: normal; font-size: 22px; margin: 0; }
.sheet-head .close { color: var(--muted); }
.sheet-body { overflow-y: auto; padding: 4px 20px 20px; }

/* Form */
.field { margin-bottom: 14px; }
.field label, .field .lbl { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #c9d1df; border-radius: 10px; padding: 10px 12px; font-size: 16px; background: #fff; }
.field input[readonly] { background: #f2f4f8; color: var(--muted); }
.field textarea { min-height: 84px; resize: vertical; }
.radio-row { display: flex; gap: 6px; }
.radio-row label { flex: 1; text-align: center; border: 1px solid #c9d1df; border-radius: 10px; padding: 9px 4px; font-size: 14px; font-weight: 600; color: var(--navy); margin: 0; cursor: pointer; }
.radio-row input { position: absolute; opacity: 0; pointer-events: none; }
.radio-row input:checked + span { color: #fff; }
.radio-row label:has(input:checked) { background: var(--navy); border-color: var(--navy); color: #fff; }
.radio-row label:has(input[value="Emergency"]:checked) { background: var(--bad); border-color: var(--bad); }
.radio-row label:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 2px; }
.callout { border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; }
.callout.demo { background: #fff4e6; color: #7a4300; border: 1px solid #f6d3a8; }
.callout.danger { background: #fdecea; color: #8c1d16; border: 1px solid #f3b8b2; }
.callout.info { background: #eef2fa; color: var(--navy); border: 1px solid #d3dbec; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #c9d1df; border-radius: 10px; }
.toggle .tt { font-weight: 600; font-size: 14px; }
.toggle .ts { font-size: 12.5px; color: var(--muted); }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #c4cad6; border-radius: 14px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }

/* Building picker / directory */
.search { position: relative; margin-bottom: 10px; }
.search input { width: 100%; border: 1px solid #c9d1df; border-radius: 12px; padding: 11px 12px 11px 38px; font-size: 16px; background: #fff; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: var(--muted); }
.filters { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.filters button { border: 1px solid #c9d1df; background: #fff; color: var(--navy); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; }
.filters button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.group-h { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
.bl { list-style: none; margin: 0; padding: 0; }
.bl li + li { border-top: 1px solid #e7eaf0; }
.bl button { width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 6px; display: flex; gap: 10px; align-items: center; border-radius: 10px; }
.bl button:hover { background: #f1f4f9; }
.bl button[aria-current="true"] { background: #e8edf7; }
.bl .g { width: 34px; height: 34px; border-radius: 10px; background: var(--navy); display: grid; place-items: center; flex: none; }
.bl .g svg { width: 22px; height: 22px; fill: #fff; }
.bl .g.generic { background: #8590a8; }
.bl .nm { font-weight: 600; font-size: 14.5px; }
.bl .ad { font-size: 12.5px; color: var(--muted); }
.bl .dist { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; padding-left: 8px; }
.more { text-align: center; font-size: 13px; color: var(--muted); padding: 10px; }
.loc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }

/* Desktop panes */
.pane-h { padding: 18px 18px 10px; background: #fff; border-bottom: 1px solid var(--line); flex: none; }
.pane-h h2 { margin: 0; font-family: var(--serif); font-weight: normal; font-size: 20px; }
.pane-h p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.pane-b { overflow-y: auto; padding: 14px 16px 20px; flex: 1; }

/* Details panel */
.photo { width: 100%; aspect-ratio: 16/9; border-radius: 14px; background: linear-gradient(135deg, var(--navy), var(--navy-2)); display: grid; place-items: center; overflow: hidden; margin-bottom: 12px; position: relative; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo svg { width: 72px; height: 72px; fill: rgba(255,255,255,.85); }
.photo .cap { position: absolute; left: 8px; bottom: 8px; background: rgba(20,26,46,.7); color: #fff; font-size: 11px; padding: 3px 7px; border-radius: 6px; }
.d-name { font-family: var(--serif); font-size: 22px; margin: 0; }
.d-sub { color: var(--muted); font-size: 13.5px; margin: 2px 0 10px; }
.d-links { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.d-links a { font-size: 13px; font-weight: 600; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; color: var(--navy); }
.d-links a:hover { border-color: var(--navy); }
.section { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 12px; }
.section h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.section .empty { color: var(--muted); font-size: 13.5px; }
.legend { font-size: 11.5px; color: var(--muted); margin-top: 12px; }
table.util { width: 100%; border-collapse: collapse; font-size: 13px; }
table.util th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 4px 6px 4px 0; }
table.util td { padding: 5px 6px 5px 0; border-top: 1px solid #edf0f5; vertical-align: top; }
.locked { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13.5px; }

/* Work order tracker */
.wo-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.wo-card .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wo-card .meta { font-size: 13px; color: var(--muted); margin: 6px 0 10px; }
.status { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--tag); color: var(--navy); white-space: nowrap; }
.status.s3 { background: #e3f3ea; color: var(--good); }
.status.s2 { background: #fff1e0; color: var(--warn); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 34px; min-height: 26px; }
.timeline li::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: #dfe3ea; }
.timeline li:last-child::before { display: none; }
.timeline li.done::before { background: var(--good); }
.timeline .dot { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #c9d0dc; background: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.timeline li.done .dot { background: var(--good); border-color: var(--good); color: #fff; }
.timeline li.current .dot { border-color: var(--orange); color: var(--orange); box-shadow: 0 0 0 4px rgba(229,114,0,.15); }
.timeline .pt { font-weight: 600; font-size: 14px; line-height: 24px; }
.timeline .pd { font-size: 12.5px; color: var(--muted); }
.wo-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wo-tools .auto { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* Toasts */
.toasts { position: fixed; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast { pointer-events: auto; background: var(--navy-ink); color: #fff; border-radius: 14px; padding: 11px 14px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); display: flex; gap: 10px; align-items: center; animation: fadeUp .25s ease both; }
.toast b { color: #ffb366; }
.toast button { margin-left: auto; background: rgba(255,255,255,.15); border: 0; color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 600; }

/* ---------- Header additions ---------- */
.hdr-top { gap: 6px; }
.brand { margin-right: auto; }
.tour-btn { border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; }
.tour-btn:hover { background: rgba(255,255,255,.12); }

.role-chip { border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; }
.role-chip[aria-pressed="true"] { background: rgba(46,125,91,.9); border-color: transparent; }
.role-chip.signin { background: var(--orange); border-color: transparent; }
.locked-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: #f2f4f8; border: 1px dashed #c4cbd8; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; color: var(--muted); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
a.btn { text-decoration: none; display: inline-block; }
.mono { font-family: var(--mono); font-size: 12px; }
.docs .actions { margin-top: 6px; }
.ada-line { font-size: 13px; font-weight: 600; color: var(--good); background: #eef7f1; border: 1px solid #cfe7d8; border-radius: 8px; padding: 6px 9px; margin-bottom: 8px; }
.ada-line.part { color: var(--warn); background: #fff4e6; border-color: #f6d3a8; }
.ada-line.no { color: var(--bad); background: #fdecea; border-color: #f3b8b2; }
.wf-sec + .wf-sec { margin-top: 9px; }
.wf-h { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
.wf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13.5px; }
.wf-list .s { color: var(--muted); font-size: 12.5px; }
.seg .soon { font-size: 9.5px; font-weight: 700; letter-spacing: .03em; padding: 1px 5px; border-radius: 5px; background: rgba(229,114,0,.9); color: #fff; vertical-align: 1px; margin-left: 2px; }
.future-note { margin: 12px 14px 0; flex: none; background: #fff4e6; border: 1px solid #f6d3a8; color: #6b3b00; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; line-height: 1.4; }
.future-note b { color: #4d2a00; }

/* ---------- Inline work-order progress ---------- */
.wo-mini .steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 9px; }
.wo-mini .steps span { height: 5px; border-radius: 3px; background: #dfe3ea; }
.wo-mini .steps span.on { background: var(--good); }

/* ---------- FM staff view ---------- */
.console { display: none; }
.staff-view .chat, .staff-view .chips, .staff-view .composer, .staff-view .plate-btn, .staff-view .live-dot { display: none !important; }
.staff-view .pane { display: none !important; }
.staff-view .console { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.staff-view .avatar { background: var(--orange); border-color: rgba(255,255,255,.4); }
@media (min-width: 900px) { .staff-view .app { max-width: 1080px; flex: 0 1 1080px; } }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px 14px 4px; flex: none; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; }
.kv-n { font-size: 20px; font-weight: 700; color: var(--navy); line-height: 1.1; white-space: nowrap; }
.kv-l { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.25; }
@media (max-width: 520px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cgrid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .cgrid { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); } }
.queue-col { overflow-y: auto; padding: 8px 14px 16px; min-height: 0; }
.q-filters { margin: 4px 0 10px; }
.q-filters .n { opacity: .7; font-weight: 500; margin-left: 2px; }
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.q-item { width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; }
.q-item:hover { border-color: #b9c2d3; }
.q-item[aria-current="true"] { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(35,45,75,.15); }
.q-item.is-new { border-left: 4px solid var(--orange); }
.q-top { display: flex; align-items: center; gap: 6px; }
.q-age { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.q-title { font-weight: 600; font-size: 14.5px; }
.q-sub { font-size: 12.5px; color: var(--muted); }
.tag.pri-urgent { background: #fff1e0; color: var(--warn); }
.tag.pri-emergency { background: #fde7e5; color: var(--bad); }
.ticket { overflow-y: auto; min-height: 0; padding: 14px 18px 20px; background: #fff; border-left: 1px solid var(--line); }
.ticket-empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.te-glyph svg { width: 56px; height: 56px; fill: #c4cbd8; }
.t-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.t-title { font-family: var(--serif); font-weight: normal; font-size: 21px; margin: 10px 0 4px; }
.t-desc { margin: 0 0 12px; font-size: 15px; font-style: italic; color: #3a4256; }
.t-kv { margin-bottom: 12px; }
.complete { background: #eef7f1; border: 1px solid #cfe7d8; border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.c-h { width: 100%; font-weight: 700; font-size: 13px; color: var(--good); }
.c-chip { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: #fff; border: 1px solid #cfe7d8; color: var(--good); }
.c-chip.no { color: var(--warn); border-color: #f6d3a8; }
.t-action { margin-bottom: 14px; }
.t-msg-row { display: flex; gap: 6px; }
.t-msg-row input { flex: 1; }
.t-sent { margin: -4px 0 14px; font-size: 13.5px; }
.t-tl { margin-top: 4px; }

/* ---------- Guided tour bar ---------- */
.tour { position: relative; z-index: 55; flex: none; background: #fff; border-top: 3px solid var(--orange); padding: 10px 14px 12px; box-shadow: 0 -8px 24px rgba(20,26,46,.12); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.t-step { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--orange-ink); }
.t-body { font-size: 14.5px; line-height: 1.4; }
.t-btns { display: flex; gap: 6px; align-items: center; }
.t-dots { grid-column: 1 / -1; display: flex; gap: 4px; }
.t-dots span { flex: 1; height: 3px; border-radius: 2px; background: #e3e7ee; }
.t-dots span.on { background: var(--orange); }
.touring .chips { display: none; }
.btn.link { background: transparent; color: var(--muted); padding: 9px 6px; font-weight: 500; }
.btn.link:empty { display: none; }
@media (max-width: 520px) { .tour { grid-template-columns: minmax(0, 1fr); } .t-btns { justify-content: flex-end; } }

/* ---------- Welcome ---------- */
.welcome { padding-bottom: 4px; }
.w-art { position: relative; height: 120px; border-radius: 16px; background: linear-gradient(135deg, var(--navy), var(--navy-2)); display: flex; align-items: flex-end; padding: 0 0 14px 22px; margin-bottom: 14px; overflow: hidden; }
.w-art > svg { width: 84px; height: 84px; fill: #fff; }
.w-bubble { position: absolute; left: 116px; top: 22px; right: 16px; background: #fff; color: var(--ink); border-radius: 14px 14px 14px 4px; padding: 9px 12px; font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.w-lead { font-size: 16.5px; line-height: 1.45; margin: 0 0 10px; }
.w-points { margin: 0 0 14px; padding-left: 18px; display: grid; gap: 6px; font-size: 14.5px; }
.w-skip { margin-top: 8px; }

/* Photos sit on top of the glyph fallback; if the image fails it's removed and the glyph shows */
.avatar, .photo, .row .mini { position: relative; }
.avatar img, .photo img { position: absolute; inset: 0; }

/* Responsive visibility (kept last so it wins over base rules) */
@media (min-width: 900px) { .info-btn { display: none; } }
@media (min-width: 1280px) { .change-btn { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
