@import url("/assets/inter-local.css");

:root {
  --ink: #17211d;
  --muted: #69746e;
  --line: #dfe5e1;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --green: #187451;
  --green-2: #23946a;
  --green-soft: #e5f3ec;
  --amber: #bd7b18;
  --navy: #182a32;
  --shadow: 0 18px 50px rgba(25, 53, 42, .12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  overflow: hidden;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell {
  display: grid;
  grid-template: 72px minmax(0, 1fr) / 310px minmax(400px, 1fr);
  height: 100%;
  height: 100dvh;
}

.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 310px 1fr auto;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  position: relative;
  z-index: 10;
}
.brand { height: 100%; display: flex; align-items: center; gap: 12px; padding: 0 22px; color: inherit; text-decoration: none; border-right: 1px solid var(--line); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--navy); display: flex; align-items: end; justify-content: center; gap: 3px; padding: 8px 7px; }
.brand-mark i { display: block; width: 4px; border-radius: 3px; background: #62d0a2; }
.brand-mark i:nth-child(1) { height: 8px; opacity: .6; }
.brand-mark i:nth-child(2) { height: 16px; }
.brand-mark i:nth-child(3) { height: 12px; opacity: .8; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 10px; margin-top: 2px; text-transform: uppercase; letter-spacing: .08em; }
.topbar-center { justify-self: center; display: flex; align-items: center; gap: 8px; color: #4e5c55; font-size: 12px; }
.topbar-center code { font-family: "SFMono-Regular", Consolas, monospace; color: var(--ink); background: #f0f3f1; border: 1px solid var(--line); border-radius: 5px; padding: 4px 7px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.pulse-dot, .status-light { width: 7px; height: 7px; background: #28a976; box-shadow: 0 0 0 4px rgba(40,169,118,.12); border-radius: 50%; }
body[data-status="running"] .pulse-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(189,123,24,.14); }
body[data-status="error"] .pulse-dot { background: #a1aaa5; box-shadow: 0 0 0 4px rgba(161,170,165,.14); }
.top-actions { display: flex; align-items: center; gap: 10px; padding-right: 18px; }
.view-tabs { display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f5f8f6; }
.view-tabs button { min-height: 30px; border: 0; border-radius: 6px; padding: 0 10px; background: transparent; color: #647069; cursor: pointer; font-size: 11px; font-weight: 700; }
.view-tabs button:hover { color: #245b45; background: #eaf1ed; }
.view-tabs button[aria-selected="true"] { color: white; background: var(--green); box-shadow: 0 2px 6px rgba(24,116,81,.18); }
.local-badge { display: flex; align-items: center; gap: 6px; color: var(--green); background: var(--green-soft); border: 1px solid #cce6d9; border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 650; }
.local-badge svg { width: 14px; }
.icon-button { border: 0; background: transparent; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border-radius: 8px; cursor: pointer; color: #617069; }
.icon-button:hover { background: #f0f4f2; color: var(--ink); }
.icon-button.soft { background: #eef3f0; border: 1px solid #e0e7e3; }
.copy-id { width: 26px; height: 26px; }
.copy-id svg { width: 14px; }
.mobile-menu, .mobile-sidebar-heading, .navigation-backdrop { display: none; }

.sidebar { background: #f8faf9; border-right: 1px solid var(--line); min-height: 0; position: relative; display: flex; flex-direction: column; }
.sidebar-scroll { flex: 1; min-height: 0; overflow: auto; padding: 15px 10px; }
.sidebar-section { padding: 10px 0 12px; border-bottom: 1px solid var(--line); }
.sidebar-section:last-child { border-bottom: 0; }
.compact-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 9px 7px; color: #7c8982; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.mini-add { width: 25px; height: 25px; border: 1px solid #dbe3df; border-radius: 7px; background: #edf3f0; color: #557067; cursor: pointer; font-size: 17px; line-height: 1; }
.nav-list { display: grid; gap: 2px; }
.nav-item { border: 0; background: transparent; width: 100%; min-height: 36px; border-radius: 8px; display: grid; grid-template-columns: 25px minmax(0,1fr) auto; align-items: center; gap: 7px; padding: 6px 9px; text-align: left; cursor: pointer; }
.nav-item:hover { background: #edf3f0; }
.nav-item.active { background: #e3eee8; color: #185f44; }
.nav-item-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: #e4ebe7; font-size: 11px; font-weight: 800; }
.nav-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.nav-item small { color: var(--muted); font-size: 10px; }
.contact-item { grid-template-columns: 29px minmax(0,1fr) auto; }
.contact-item:focus-visible { outline: 2px solid #6dac8e; outline-offset: -2px; }
.contact-qr-button { width: 28px; height: 28px; border: 1px solid #d7e1dc; border-radius: 7px; background: #f7faf8; color: #356651; padding: 4px; cursor: pointer; }
.contact-qr-button:hover { background: #deeee6; }
.contact-qr-button svg { width: 18px; height: 18px; }
.contact-actions { display: flex; align-items: center; gap: 4px; }
.contact-call-button { width: 28px; height: 28px; border: 1px solid #d7e1dc; border-radius: 7px; background: #f7faf8; color: #356651; padding: 5px; cursor: pointer; }
.contact-call-button:hover { background: #deeee6; }
.contact-call-button svg { width: 16px; height: 16px; }
.contact-item[draggable="true"], #local-id[draggable="true"],
.strong-id-value[draggable="true"] { cursor: grab; }
.contact-item.dragging { opacity: .55; }
.contacts-section.drag-over { border-radius: 10px; background: #e3f1e9; box-shadow: inset 0 0 0 2px #6dac8e; }
.contacts-section.drag-over #contact-drop-hint { color: #176847; font-weight: 750; }
.contact-item .nav-item-icon { border-radius: 50%; width: 29px; height: 29px; background: #dfeee6; color: #267055; }
.contact-copy strong, .contact-copy small { display: block; }
.relation-tag { display: inline-block !important; margin-left: 5px; padding: 1px 5px; border: 1px solid #dfe4e1; border-radius: 999px; background: #eef1ef; color: #7d8782; font-family: "SFMono-Regular", Consolas, monospace; font-size: .78em !important; font-weight: 650; letter-spacing: .04em; vertical-align: .08em; }
.contact-copy small { margin-top: 2px; font-family: monospace; font-size: 11px; }
.contact-presence, .room-presence { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; }
.contact-presence { margin-top: 2px; }
.presence-dot { width: 7px; height: 7px; border-radius: 50%; background: #9ba49f; box-shadow: 0 0 0 2px rgba(155,164,159,.14); }
.contact-presence.online, .room-presence.online { color: #18704f; }
.contact-presence.online .presence-dot, .room-presence.online .presence-dot { background: #25a472; box-shadow: 0 0 0 2px rgba(37,164,114,.15); }
.contact-presence.offline, .room-presence.offline { color: #6f7974; }
.room-presence { font-size: inherit; }
.empty-nav, .sidebar-hint { color: #89938e; font-size: 10px; margin: 5px 9px; }
.adjacency-section .adjacency-list { padding: 0; overflow: visible; }
.section-heading { display: flex; align-items: center; justify-content: space-between; padding: 25px 20px 0; }
.section-heading span, .eyebrow { color: #87918c; font-size: 10px; letter-spacing: .13em; font-weight: 750; }
.section-heading h2 { margin: 4px 0 0; font-size: 19px; letter-spacing: -.035em; }
.section-copy { font-size: 11px; line-height: 1.55; color: var(--muted); margin: 9px 20px 16px; }
.adjacency-list { padding: 0 11px; overflow: auto; flex: 1; }
.adjacency-card { width: 100%; border: 1px solid transparent; border-radius: 10px; background: transparent; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 11px 10px; text-align: left; cursor: pointer; margin-bottom: 4px; }
.adjacency-card:hover { background: #f0f5f2; }
.adjacency-card.active { background: white; border-color: #dbe4df; box-shadow: 0 4px 16px rgba(38,74,58,.06); }
.adjacency-avatar, .peer-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #28684f; background: #ddefe6; font-size: 11px; font-weight: 800; }
.adjacency-card strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adjacency-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.adjacency-card .state-dot { width: 7px; height: 7px; border-radius: 50%; background: #25a472; }
.adjacency-card.closed { opacity: .65; }
.adjacency-card.closed .state-dot { background: #9ba49f; }
.skeleton-card { pointer-events: none; }
.skeleton-card > span { width: 38px; height: 38px; border-radius: 10px; background: #e7ece9; }
.skeleton-card b, .skeleton-card i { display: block; height: 8px; border-radius: 8px; background: #e7ece9; width: 110px; }
.skeleton-card i { width: 70px; margin-top: 8px; }
.sidebar-footer { min-height: 82px; border-top: 1px solid var(--line); padding: 15px 18px; }
.sidebar-footer > div { display: flex; align-items: center; gap: 10px; }
.sidebar-footer b, .sidebar-footer small { display: block; }
.sidebar-footer b { font-size: 10px; }
.sidebar-footer small { color: var(--muted); margin-top: 3px; font-size: 9px; }
.text-button { border: 0; background: none; color: var(--green); font-size: 10px; padding: 9px 0 0 17px; cursor: pointer; }

.conversation { min-width: 0; background: var(--surface); display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.view-panel[hidden] { display: none; }
.local-view { min-width: 0; min-height: 0; background: var(--surface); display: grid; grid-template-rows: auto minmax(0,1fr); }
.local-view-header { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 28px; border-bottom: 1px solid var(--line); }
.local-view-header h1 { margin: 4px 0 3px; font-size: 22px; letter-spacing: -.035em; }
.local-view-header p { margin: 0; color: var(--muted); font-size: 13px; }
.local-view-content { min-height: 0; overflow: auto; padding: 24px clamp(22px, 4vw, 64px) 38px; }
.local-view-actions { display: flex; align-items: center; gap: 16px; }
.local-view-actions > span { min-width: 64px; text-align: center; }
.local-view-actions b, .local-view-actions small { display: block; }
.local-view-actions b { font-size: 16px; }
.local-view-actions small { margin-top: 3px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.compact-action { min-height: 34px; padding: 0 12px; white-space: nowrap; }
.file-library { display: grid; align-content: start; gap: 10px; }
.file-record { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfb; }
.file-record .file-type { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 9px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 800; }
.file-record-copy { min-width: 0; }
.file-record-copy b, .file-record-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-record-copy b { font-size: 13px; }
.file-record-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.file-record a, .file-record .file-record-state { min-width: 92px; border: 1px solid #c9d8d0; border-radius: 7px; padding: 7px 9px; color: #1b6849; background: #edf5f1; text-align: center; text-decoration: none; font-size: 10px; font-weight: 700; }
.file-record .file-record-state { color: var(--muted); background: #f4f6f5; }
.search-content { display: grid; align-content: start; gap: 18px; }
.search-service-card { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf9; }
.search-service-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 11px; color: var(--green); background: var(--green-soft); }
.search-service-icon svg { width: 23px; }
.search-service-card small, .search-service-card code, .search-service-card p { display: block; }
.search-service-card small { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.search-service-card code { margin-top: 4px; color: #245b45; font-size: 13px; font-weight: 700; }
.search-service-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.search-service-card strong { border-radius: 999px; padding: 6px 9px; color: #6d7973; background: #edf1ef; font-size: 10px; }
.search-form { padding: clamp(22px, 4vw, 40px); border: 1px solid var(--line); border-radius: 12px; background: white; }
.search-form label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 750; }
.search-form > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; }
.search-form input { min-width: 0; min-height: 42px; border: 1px solid #cfd8d3; border-radius: 8px; padding: 0 13px; background: #fbfcfb; outline: none; }
.search-form input:focus { border-color: #6dac8e; box-shadow: 0 0 0 3px rgba(109,172,142,.12); }
.search-form > small { display: block; margin-top: 9px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.search-result-heading { display: flex; align-items: center; justify-content: space-between; min-height: 32px; color: #52635b; font-size: 11px; }
.search-result-heading .text-button { padding: 0; }
.search-results { display: grid; align-content: start; gap: 10px; }
.search-result { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfb; }
.search-result .file-type { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 800; }
.search-result a, .search-result .file-record-state { min-width: 92px; border: 1px solid #c9d8d0; border-radius: 7px; padding: 7px 9px; color: #1b6849; background: #edf5f1; text-align: center; text-decoration: none; font-size: 10px; font-weight: 700; }
.search-result .file-record-state { color: var(--muted); background: #f4f6f5; }
.local-empty { display: grid; place-items: center; min-height: 220px; border: 1px dashed #cad5cf; border-radius: 12px; color: var(--muted); text-align: center; }
.local-empty b, .local-empty span { display: block; }
.local-empty b { color: #42554c; font-size: 14px; }
.local-empty span { margin-top: 5px; font-size: 12px; }
.read-only-badge { border: 1px solid #c9d8d0; border-radius: 999px; padding: 6px 9px; color: #356651; background: #f0f6f3; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.call-content { display: grid; align-content: start; gap: 18px; }
.call-peer-card { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf9; }
.call-avatar { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: #dfeee6; color: #267055; font-size: 13px; font-weight: 800; }
.call-peer-card small { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.call-peer-card h2 { margin: 4px 0; font-size: 17px; }
.call-peer-card code { display: block; overflow: hidden; text-overflow: ellipsis; color: #52635b; font-size: 10px; white-space: nowrap; }
.call-status { border-radius: 999px; padding: 6px 9px; background: #edf1ef; color: #6d7973; font-size: 10px; font-weight: 700; }
.call-stage { display: grid; justify-items: center; padding: clamp(32px, 7vw, 80px) 24px; border: 1px dashed #cad5cf; border-radius: 12px; text-align: center; }
.call-stage-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.call-stage-icon svg { width: 26px; }
.call-stage h2 { margin: 18px 0 7px; font-size: 18px; }
.call-stage p { max-width: 590px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.call-actions { display: flex; gap: 9px; margin-top: 20px; }
.call-actions button { min-width: 140px; }
.call-actions button:disabled { opacity: .55; cursor: not-allowed; }
.room-conference-button { flex: 0 0 34px; margin-left: 7px; }
.conference-content { display: grid; align-content: start; gap: 18px; }
.conference-room-card { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf9; }
.conference-room-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; color: var(--green); background: var(--green-soft); }
.conference-room-card small { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.conference-room-card h2 { margin: 4px 0; font-size: 17px; }
.conference-room-card p { margin: 0; color: var(--muted); font-size: 10px; }
.conference-room-card > strong { border-radius: 999px; padding: 6px 9px; color: #6d7973; background: #edf1ef; font-size: 10px; }
.conference-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.conference-participant { min-width: 0; min-height: 116px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: end; gap: 11px; padding: 16px; border-radius: 12px; color: white; background: linear-gradient(145deg, #263b34, #14231e); }
.conference-participant > span:first-child { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #dff5e9; background: #315c4b; font-size: 11px; font-weight: 800; }
.conference-participant b, .conference-participant small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conference-participant b { font-size: 12px; }
.conference-participant small { margin-top: 4px; color: #a9bdb4; font: 9px "SFMono-Regular", Consolas, monospace; }
.conference-participant em { align-self: start; border-radius: 999px; padding: 4px 6px; color: #b9d5c8; background: rgba(255,255,255,.08); font-size: 8px; font-style: normal; text-transform: uppercase; }
.conference-controls { display: flex; justify-content: center; gap: 9px; }
.conference-controls button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #d6dfda; border-radius: 50%; color: #65736d; background: #f2f5f3; }
.conference-controls button:disabled { opacity: .55; }
.conference-controls .conference-leave { color: #9e4545; background: #f7eaea; border-color: #eed4d4; }
.conference-boundary { display: grid; justify-items: center; padding: 24px; border: 1px dashed #cad5cf; border-radius: 12px; text-align: center; }
.conference-boundary b { font-size: 14px; }
.conference-boundary p { max-width: 640px; margin: 7px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.social-content { width: min(100%, 760px); margin-inline: auto; padding-inline: clamp(16px, 3vw, 34px); display: grid; align-content: start; gap: 0; border-inline: 1px solid var(--line); }
.social-filters { display: grid; grid-template-columns: repeat(2,1fr); border-bottom: 1px solid var(--line); }
.social-filters button { min-height: 42px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 750; }
.social-filters button.active { color: var(--ink); box-shadow: inset 0 -2px var(--green); }
.social-compose { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 12px; padding: 18px 4px; border-bottom: 1px solid var(--line); }
.social-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #267055; background: #dfeee6; font-size: 9px; font-weight: 800; }
.social-compose textarea { width: 100%; resize: none; border: 0; padding: 6px 0; color: #66736c; background: transparent; outline: none; font-size: 15px; }
.social-compose > div > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.social-compose small { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font: 9px "SFMono-Regular", Consolas, monospace; white-space: nowrap; }
.social-compose button { min-height: 34px; padding: 0 17px; border-radius: 999px; }
.social-compose button:disabled { opacity: .55; }
.social-protocol-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf9; }
.social-protocol-card small, .social-protocol-card b, .social-protocol-card p { display: block; }
.social-protocol-card small { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.social-protocol-card b { margin-top: 5px; font-size: 10px; line-height: 1.5; }
.social-protocol-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.social-protocol-card > strong { border-radius: 999px; padding: 6px 9px; color: #6d7973; background: #edf1ef; font-size: 9px; white-space: nowrap; }
.social-feed { margin-top: 14px; }
.debug-layout { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(430px,1fr) 344px; }
.debug-content { display: grid; align-content: start; gap: 24px; }
.debug-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.debug-summary article { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf9; }
.debug-summary small, .debug-summary b, .debug-summary code { display: block; }
.debug-summary small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.debug-summary b { margin: 8px 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.debug-summary code { overflow: hidden; text-overflow: ellipsis; color: #52635b; font-size: 10px; white-space: nowrap; }
.debug-routes h2 { margin: 4px 0 0; font-size: 17px; }
.tpa-panel { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf9; }
.tpa-panel h2 { margin: 4px 0 0; font-size: 17px; }
.tpa-panel p, .tpa-connection-note p { font-size: 12px; line-height: 1.6; color: var(--muted); }
.tpa-panel summary { cursor: pointer; font-size: 12px; font-weight: 600; }
.tpa-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr)); gap: 14px; margin: 18px 0; }
.tpa-fields div { min-width: 0; }
.tpa-fields dt { font-size: 11px; font-weight: 600; }
.tpa-fields dd { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.tpa-boundary { border-top: 1px solid var(--line); padding-top: 12px; }
.tpa-connection-note { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.tpa-connection-note strong, .tpa-connection-note a { font-size: 12px; }
.debug-route-list { display: grid; gap: 8px; margin-top: 12px; }
.debug-route { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.debug-route b, .debug-route small { display: block; }
.debug-route b { font-size: 12px; }
.debug-route small { margin-top: 4px; color: var(--muted); font: 10px "SFMono-Regular", Consolas, monospace; }
.debug-route code { align-self: center; color: #356651; font-size: 10px; }
.room-header { min-height: 92px; display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; border-bottom: 1px solid var(--line); }
.room-header h1 { margin: 4px 0 3px; font-size: 20px; letter-spacing: -.035em; }
.room-header p { margin: 0; color: var(--muted); font-size: 11px; }
.room-members-strip { display: flex; align-items: center; gap: 6px; max-width: min(54vw, 680px); margin-top: 8px; overflow-x: auto; scrollbar-width: thin; }
.room-member { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; background: #f8faf9; font-size: 10px; }
.room-member b { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-member small { padding: 2px 5px; border-radius: 999px; background: #edf1ef; color: #78827d; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.room-member.offline { color: #78827d; }
.reconnect-button { border: 0; border-radius: 999px; padding: 3px 8px; background: #e3eee8; color: #185f44; font: inherit; font-weight: 750; cursor: pointer; }
.reconnect-button:hover { background: #d5e7dd; }
.reconnect-button:disabled { opacity: .62; cursor: wait; }
.route-progress { color: #65736d; font-weight: 700; }
.room-stats { display: flex; align-items: center; gap: 2px; }
.room-stats > span { min-width: 72px; text-align: center; padding: 4px 14px; border-left: 1px solid var(--line); }
.room-stats b, .room-stats small { display: block; }
.room-stats b { font-size: 14px; }
.room-stats small { color: var(--muted); font-size: 8px; margin-top: 3px; text-transform: uppercase; letter-spacing: .06em; }
.mobile-inspector { display: none; }
.messages { overflow: auto; padding: 20px clamp(22px, 4vw, 64px) 32px; scroll-behavior: smooth; }
.day-divider { display: flex; align-items: center; gap: 12px; color: #9ca5a0; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 20px; }
.day-divider::before, .day-divider::after { content: ""; height: 1px; background: #e8ece9; flex: 1; }
.system-message { display: flex; align-items: center; gap: 12px; background: #f4f8f6; border: 1px solid #e0e9e4; border-radius: 10px; padding: 12px 15px; margin-bottom: 25px; }
.system-icon { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; background: var(--green-soft); color: var(--green); }
.system-icon svg { width: 17px; }
.system-message b { font-size: 11px; }
.system-message p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.message { display: grid; grid-template-columns: 35px minmax(0, 1fr); gap: 11px; margin: 18px 0; animation: arrive .22s ease-out; }
@keyframes arrive { from { opacity: 0; transform: translateY(5px); } }
.message-avatar { width: 35px; height: 35px; border-radius: 9px; display: grid; place-items: center; background: #e7eeea; color: #415c50; font-size: 10px; font-weight: 800; }
.message.mine .message-avatar { background: var(--navy); color: #d5f5e8; }
.message-head { display: flex; gap: 8px; align-items: baseline; }
.message-head strong { font-size: 11px; }
.message-head time { color: #9aa39f; font-size: 9px; }
.message-body { margin: 4px 0 0; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.delivery { color: var(--green); font-size: 9px; margin-left: 6px; }
.file-card { max-width: 390px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); background: #fbfcfb; border-radius: 9px; padding: 10px; margin-top: 7px; text-decoration: none; color: inherit; }
.file-card:hover { border-color: #b9d2c6; background: #f6faf8; }
.file-card .file-type, .pending-file .file-type { width: 36px; height: 38px; display: grid; place-items: center; background: #e2f0e9; color: var(--green); border-radius: 7px; font-size: 8px; font-weight: 800; }
.file-card span:nth-child(2) { min-width: 0; flex: 1; }
.file-card b, .file-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card b { font-size: 10px; }
.file-card small { color: var(--muted); font-size: 9px; margin-top: 4px; }
.file-card svg { width: 17px; color: var(--green); }

.composer-wrap { padding: 9px clamp(20px, 3vw, 44px) 18px; border-top: 1px solid #edf0ee; background: white; }
.composer { min-height: 58px; border: 1px solid #ced7d2; border-radius: 11px; display: grid; align-items: center; grid-template-columns: 48px minmax(0, 1fr) auto 48px; padding: 7px; box-shadow: 0 3px 12px rgba(31,55,44,.04); }
.composer:focus-within { border-color: #72a991; box-shadow: 0 0 0 3px rgba(35,148,106,.08); }
.attach-button, .send-button { border: 0; cursor: pointer; display: grid; place-items: center; }
.attach-button { background: transparent; color: #637069; }
.send-button { width: 38px; height: 38px; border-radius: 9px; background: var(--green); color: white; }
.send-button:hover { background: #125f42; }
.send-button:disabled { opacity: .45; cursor: not-allowed; }
.composer textarea { border: 0; outline: 0; resize: none; padding: 9px 4px; max-height: 110px; color: var(--ink); }
.composer textarea::placeholder { color: #9ca5a0; }
.composer-meta { display: flex; gap: 9px; align-items: center; color: #909a95; font-size: 8px; white-space: nowrap; }
kbd { font: inherit; border: 1px solid #d8dedb; border-bottom-width: 2px; background: #f7f8f7; border-radius: 4px; padding: 2px 5px; }
.pending-file { align-items: center; max-width: 370px; gap: 9px; border: 1px solid var(--line); border-bottom: 0; border-radius: 9px 9px 0 0; padding: 8px 10px; margin-left: 10px; background: #f8faf9; }
.pending-file:not([hidden]) { display: flex; }
.pending-file .file-type { width: 30px; height: 30px; }
.pending-file span:nth-child(2) { min-width: 0; flex: 1; }
.pending-file b, .pending-file small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 9px; }
.pending-file small { color: var(--muted); margin-top: 2px; }
.pending-file button { border: 0; background: transparent; cursor: pointer; color: #7f8984; font-size: 18px; }

.inspector { background: #f9fbfa; border-left: 1px solid var(--line); min-height: 0; display: flex; flex-direction: column; }
.inspector-scroll { overflow: auto; flex: 1; }
.inspector section { padding: 22px 20px; border-bottom: 1px solid var(--line); }
.inspector-frame { border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.inspector-frame > summary { min-height: 48px; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; }
.inspector-frame > summary::-webkit-details-marker { display: none; }
.inspector-frame > summary::after { content: "+"; color: #728078; font-size: 16px; }
.inspector-frame[open] > summary::after { content: "−"; }
.inspector-frame-body { padding: 0 20px 20px; }
.peer-profile { display: flex; align-items: center; gap: 11px; margin: 15px 0; }
.peer-avatar { width: 42px; height: 42px; }
.peer-profile h2 { font-size: 13px; margin: 0 0 4px; }
.peer-profile span:not(.peer-avatar) { color: var(--green); font-size: 9px; }
.peer-profile span i { display: inline-block; width: 6px; height: 6px; background: #23a16f; border-radius: 50%; margin-right: 5px; }
#peer-status[data-state="unavailable"] { color: #7e8983; }
#peer-status[data-state="unavailable"] i { background: #a1aaa5; }
.details-list { margin: 0; }
.details-list div { display: flex; justify-content: space-between; padding: 7px 0; font-size: 9px; border-top: 1px dotted #dce2df; }
.details-list dt { color: var(--muted); }
.details-list dd { margin: 0; font-family: "SFMono-Regular", Consolas, monospace; font-size: 8px; }
.section-row { display: flex; justify-content: space-between; align-items: center; }
.live-label { font-size: 8px; color: var(--green); }
.live-label i { width: 5px; height: 5px; display: inline-block; margin-right: 4px; background: var(--green-2); border-radius: 50%; }
.traffic-grid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 14px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.traffic-grid > div { padding: 12px; }
.traffic-grid > div + div { border-left: 1px solid var(--line); }
.traffic-grid small, .traffic-grid b, .traffic-grid span { display: block; }
.traffic-grid small { color: var(--muted); font-size: 8px; }
.traffic-grid b { font-size: 13px; margin: 4px 0 6px; }
.traffic-grid em { color: var(--muted); font-size: 8px; font-style: normal; display: inline; }
.traffic-grid i { display: inline-block; width: 5px; height: 5px; border-right: 1px solid; border-bottom: 1px solid; margin-right: 4px; transform: rotate(-135deg); color: var(--green); }
.traffic-grid i.down { transform: rotate(45deg); color: #4676a1; }
.route-visual { margin-top: 16px; }
.route-visual > div { display: flex; align-items: center; gap: 10px; }
.route-node { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: #eaf0ed; color: #476157; }
.route-node svg { width: 16px; }
.path-node { background: #e3eee8; color: #176847; }
.trajectory-heading { gap: 8px; }
.trajectory-heading select { min-width: 0; max-width: 155px; border: 1px solid #d5dfda; border-radius: 6px; background: #f7faf8; color: #345347; padding: 4px 6px; font-size: 10px; }
.remote-node { background: var(--green-soft); color: var(--green); }
.route-visual p { margin: 0; }
.route-visual p b, .route-visual p small { display: block; font-size: 9px; }
.route-visual p small { color: var(--muted); margin-top: 3px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.route-line { display: flex; flex-direction: column; gap: 3px; margin: 4px 0 4px 14px; }
.route-line i { width: 3px; height: 3px; background: #87b29f; border-radius: 50%; }
.policy-select { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.policy-select select { width: 100%; border: 1px solid #d5dfda; border-radius: 7px; background: white; color: #29493c; padding: 7px 8px; }
.trajectory-graph { margin-top: 12px; display: grid; gap: 8px; }
.graph-origin { display: grid; gap: 2px; padding: 9px 10px; border-radius: 8px; background: #e9efec; }
.graph-origin b { font-size: 11px; }
.graph-origin small { color: var(--muted); font: 9px monospace; }
.graph-session, .graph-empty { position: relative; margin-left: 18px; border: 1px solid #dce4e0; border-radius: 8px; background: white; }
.graph-session::before, .graph-empty::before { content: ""; position: absolute; left: -19px; top: -9px; width: 17px; height: 26px; border-left: 2px solid #9fc2b1; border-bottom: 2px solid #9fc2b1; border-radius: 0 0 0 7px; }
.graph-session > summary { display: grid; grid-template-columns: 8px minmax(0,1fr); gap: 8px; align-items: center; padding: 9px; cursor: pointer; list-style: none; }
.graph-session > summary::-webkit-details-marker { display: none; }
.graph-session summary span b, .graph-session summary span small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graph-session summary span b { font-size: 11px; }
.graph-session summary span small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.graph-session .state-dot { width: 7px; height: 7px; border-radius: 50%; background: #25a472; }
.graph-session.closed .state-dot, .graph-session.failed .state-dot { background: #9ba49f; }
.graph-session.selected { border-color: #79aa92; box-shadow: 0 0 0 2px rgba(44,132,92,.08); }
.graph-session-body { display: grid; gap: 6px; padding: 0 9px 9px 25px; }
.graph-session-body p { margin: 0; color: var(--muted); font-size: 9px; }
.graph-session-body code { color: #365b4b; font-size: 9px; }
.graph-select-path { border: 1px solid #c9d8d0; border-radius: 6px; background: #edf5f1; color: #1b6849; padding: 6px; cursor: pointer; font-size: 9px; }
.graph-empty { display: grid; gap: 4px; padding: 11px; border-style: dashed; }
.graph-empty span { color: #9a5c42; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.graph-empty b { font-size: 11px; }
.graph-empty small, .section-copy-inline { color: var(--muted); font-size: 9px; }
.event-section ol { list-style: none; padding: 0; margin: 12px 0 0; }
.event-section li { display: grid; grid-template-columns: 43px 1fr; padding: 5px 0; color: #515f58; font-size: 8px; line-height: 1.4; }
.event-section time { color: #98a19d; font-family: monospace; }
.event-section button { border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: 8px; }
.disconnect-button { margin: 13px 18px 18px; min-height: 38px; border: 1px solid #dbdfdd; background: white; border-radius: 8px; color: #6b7771; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; }
.disconnect-button:hover:not(:disabled) { color: #a5423f; border-color: #e3bdbb; }
.disconnect-button:disabled { opacity: .45; cursor: not-allowed; }
.disconnect-button svg { width: 15px; }

dialog { border: 0; background: transparent; padding: 20px; max-width: none; }
dialog::backdrop { background: rgba(20,33,28,.48); backdrop-filter: blur(3px); }
.dialog-card { width: min(420px, calc(100vw - 32px)); background: white; border-radius: 15px; padding: 28px; box-shadow: var(--shadow); position: relative; }
.dialog-close { position: absolute; top: 13px; right: 13px; width: 30px; height: 30px; border: 0; background: #f1f4f2; color: #6c7772; border-radius: 8px; font-size: 20px; cursor: pointer; }
.dialog-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 11px; margin-bottom: 18px; }
.dialog-card h2 { font-size: 21px; margin: 5px 0 8px; letter-spacing: -.035em; }
.dialog-card > p { color: var(--muted); font-size: 11px; line-height: 1.6; }
.dialog-card label { display: block; margin-top: 20px; color: #59665f; font-size: 10px; font-weight: 650; }
.dialog-card input { width: 100%; display: block; border: 1px solid #ccd6d1; border-radius: 8px; padding: 10px 11px; outline: 0; margin-top: 6px; }
.dialog-card select, .dialog-card textarea { width: 100%; display: block; border: 1px solid #ccd6d1; border-radius: 8px; padding: 10px 11px; outline: 0; margin-top: 6px; background: white; resize: vertical; }
.dialog-card label + label { margin-top: 12px; }
.dialog-card input:focus { border-color: #65a98b; box-shadow: 0 0 0 3px rgba(35,148,106,.08); }
.mode-card { display: flex; align-items: center; justify-content: space-between; border: 1px solid #bad8ca; background: #f5faf7; border-radius: 9px; padding: 12px; margin: 13px 0 20px; }
.mode-card b, .mode-card small { display: block; }
.mode-card b { font-size: 10px; }
.mode-card small { color: var(--muted); font-size: 9px; margin-top: 4px; }
.field-note { margin: 9px 0 18px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.radio-dot { width: 14px; height: 14px; background: var(--green); border: 4px solid white; box-shadow: 0 0 0 1px var(--green); border-radius: 50%; }
.primary-button { border: 0; width: 100%; border-radius: 8px; background: var(--green); color: white; padding: 11px; font-size: 11px; font-weight: 700; cursor: pointer; }
.primary-button:hover { background: #125f42; }
.info-card code { background: #eef2f0; padding: 2px 4px; border-radius: 4px; font-size: 10px; }
.identity-card { width: min(440px, calc(100vw - 32px)); text-align: center; }
.identity-card > p { max-width: 350px; margin-left: auto; margin-right: auto; }
.contact-qr { width: min(260px, 68vw); aspect-ratio: 1; margin: 18px auto 12px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.contact-qr-svg { display: block; width: 100%; height: 100%; shape-rendering: crispEdges; }
.strong-id-value { display: block; margin: 0 auto 14px; max-width: 350px; padding: 8px 10px; border-radius: 7px; background: #f0f4f2; color: #335045; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.identity-metadata { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafcfb; text-align: left; }
.identity-metadata div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; }
.identity-metadata div + div { border-top: 1px solid var(--line); }
.identity-metadata dt { color: var(--muted); font-size: 11px; }
.identity-metadata dd { margin: 0; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; }
.identity-note { font-size: 10px !important; }
.scanner-card { width: min(470px, calc(100vw - 32px)); }
.camera-frame { aspect-ratio: 16 / 9; margin: 15px 0 10px; border-radius: 11px; overflow: hidden; background: #17251f; position: relative; display: grid; place-items: center; }
.camera-frame video { width: 100%; height: 100%; object-fit: cover; }
.camera-frame span { position: absolute; bottom: 9px; left: 50%; transform: translateX(-50%); background: rgba(15,27,22,.82); color: white; border-radius: 999px; padding: 5px 9px; font-size: 10px; white-space: nowrap; }
.scanner-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.contact-detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.danger-button { width: 100%; margin-top: 8px; min-height: 36px; border: 1px solid #e1c2bd; border-radius: 8px; background: #fff6f4; color: #8a3e36; cursor: pointer; font-size: 11px; }
.danger-button:hover { background: #fbe8e4; }
.danger-button:disabled { opacity: .6; cursor: wait; }
.reset-note { margin: 7px auto 0 !important; color: var(--muted); font-size: 10px !important; line-height: 1.45; }
.secondary-button { min-height: 36px; border: 1px solid #cad6d0; border-radius: 8px; background: #f7faf8; display: grid; place-items: center; color: #3e5f51; cursor: pointer; font-size: 11px; }
.file-picker input { display: none; }
.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { background: #1c2e26; color: white; box-shadow: var(--shadow); border-radius: 8px; padding: 11px 14px; font-size: 10px; animation: arrive .2s ease; }
.toast.error { background: #773b37; }

/* Readability pass: the workbench favors inspection over maximum chat area. */
.brand strong { font-size: 16px; }
.brand small { font-size: 11px; }
.topbar-center { font-size: 13px; }
.local-badge { font-size: 12px; }
.section-heading span, .eyebrow { font-size: 11px; }
.section-heading h2 { font-size: 21px; }
.section-copy { font-size: 13px; }
.adjacency-card strong { font-size: 14px; }
.adjacency-card small { font-size: 11px; }
.sidebar-footer b { font-size: 12px; }
.sidebar-footer small, .text-button { font-size: 11px; }
.room-header h1 { font-size: 22px; }
.room-header p { font-size: 13px; }
.room-stats b { font-size: 16px; }
.room-stats small { font-size: 10px; }
.day-divider { font-size: 10px; }
.system-message b { font-size: 13px; }
.system-message p { font-size: 12px; }
.message-head strong { font-size: 13px; }
.message-head time { font-size: 11px; }
.message-body { font-size: 15px; }
.delivery { font-size: 10px; }
.file-card b { font-size: 12px; }
.file-card small { font-size: 11px; }
.composer textarea { font-size: 14px; }
.composer-meta { font-size: 10px; }
.peer-profile h2 { font-size: 15px; }
.peer-profile span:not(.peer-avatar) { font-size: 11px; }
.details-list div { font-size: 11px; }
.details-list dd { font-size: 10px; }
.traffic-grid small, .traffic-grid em, .live-label { font-size: 10px; }
.traffic-grid b { font-size: 15px; }
.route-visual p b, .route-visual p small { font-size: 11px; }
.event-section li, .event-section button { font-size: 10px; }
.disconnect-button { font-size: 12px; }
.dialog-card > p { font-size: 13px; }
.dialog-card > .adjacency-error { color: #7a1717; background: #fff0ef; border: 2px solid #a52b2b; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.adjacency-diagnostics { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.dialog-card label { font-size: 12px; }
.mode-card b { font-size: 12px; }
.mode-card small { font-size: 11px; }
.primary-button { font-size: 13px; }
.toast { font-size: 12px; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 270px minmax(390px, 1fr); }
  .topbar { grid-template-columns: 270px 1fr auto; }
  .debug-layout { grid-template-columns: minmax(390px,1fr) 300px; }
}
@media (max-width: 1250px) {
  .local-badge { display: none; }
  .topbar-center > span:not(.pulse-dot), .topbar-center code, .topbar-center .copy-id { display: none; }
  .view-tabs button { padding-inline: 7px; font-size: 10px; }
}
@media (max-width: 760px) {
  .app-shell { display: block; height: 100vh; height: 100dvh; padding-top: 60px; }
  .topbar { position: fixed; z-index: 30; inset: 0 0 auto; height: 60px; display: flex; justify-content: space-between; }
  .mobile-menu { display: grid; flex: 0 0 42px; margin-left: 6px; }
  .brand { min-width: 0; flex: 0 0 48px; border: 0; padding: 0 8px; }
  .brand > span:last-child { display: none; }
  .topbar-center, .local-badge { display: none; }
  .top-actions { min-width: 0; gap: 5px; padding-right: 6px; }
  .view-tabs { max-width: calc(100vw - 148px); gap: 1px; padding: 2px; overflow-x: auto; scrollbar-width: none; }
  .view-tabs::-webkit-scrollbar { display: none; }
  .view-tabs button { min-height: 28px; padding: 0 7px; font-size: 9px; }
  .sidebar { position: fixed; z-index: 28; inset: 60px auto 0 0; width: min(300px, 88vw); transform: translateX(-102%); transition: transform .2s ease; box-shadow: 15px 0 40px rgba(20,43,33,.12); }
  .sidebar.open { transform: translateX(0); }
  .mobile-sidebar-heading { min-height: 48px; padding: 7px 8px 7px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: white; font-size: 12px; font-weight: 750; }
  .mobile-sidebar-heading .icon-button { font-size: 24px; }
  .navigation-backdrop { position: fixed; z-index: 27; inset: 60px 0 0; border: 0; background: rgba(16, 29, 23, .28); }
  .sidebar.open + .navigation-backdrop { display: block; }
  .conversation { height: calc(100vh - 60px); height: calc(100dvh - 60px); min-height: 0; }
  .local-view { height: calc(100vh - 60px); height: calc(100dvh - 60px); }
  .local-view-header { min-height: 78px; padding: 12px 16px; }
  .local-view-header p { display: none; }
  .local-view-content { padding: 16px; }
  .debug-summary { grid-template-columns: 1fr; }
  .debug-layout { display: block; overflow: auto; }
  .debug-content { overflow: visible; }
  .debug-layout .inspector { border-top: 1px solid var(--line); border-left: 0; }
  .debug-layout .inspector-scroll { overflow: visible; }
  .call-peer-card { grid-template-columns: 44px minmax(0,1fr); }
  .call-avatar { width: 44px; height: 44px; }
  .call-status { grid-column: 2; justify-self: start; }
  .call-actions { width: 100%; flex-direction: column; }
  .conference-room-card { grid-template-columns: 42px minmax(0,1fr); }
  .conference-room-icon { width: 42px; height: 42px; }
  .conference-room-card > strong { grid-column: 2; justify-self: start; }
  .conference-grid { grid-template-columns: 1fr; }
  .conference-participant { min-height: 96px; }
  .social-content { padding-inline: 14px; border-inline: 0; }
  .social-protocol-card { grid-template-columns: 1fr; }
  .social-protocol-card > strong { justify-self: start; }
  .search-service-card { grid-template-columns: 40px minmax(0,1fr); }
  .search-service-icon { width: 40px; height: 40px; }
  .search-service-card strong { grid-column: 2; justify-self: start; }
  .search-form { padding: 18px; }
  .search-form > div { grid-template-columns: 1fr; }
  .search-result { grid-template-columns: 38px minmax(0,1fr); }
  .search-result .file-type { width: 38px; height: 38px; }
  .search-result > :last-child { grid-column: 2; justify-self: start; }
  .file-record { grid-template-columns: 38px minmax(0,1fr); }
  .file-record .file-type { width: 38px; height: 38px; }
  .file-record > :last-child { grid-column: 2; justify-self: start; }
  .room-header { min-height: 78px; padding: 12px 16px; }
  .room-header p { display: none; }
  .room-header > div:first-child { min-width: 0; }
  .room-members-strip { max-width: calc(100vw - 78px); margin-top: 6px; }
  .room-member { min-height: 22px; }
  .room-stats > span { display: none; }
  .messages { padding: 16px; }
  .composer-wrap { position: relative; z-index: 1; padding: 8px 10px max(12px, env(safe-area-inset-bottom)); }
  .composer { grid-template-columns: 38px minmax(0,1fr) 42px; }
  .composer-meta { display: none; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
:root { --demo-guide-width: 42rem; }
.demo-guide { margin-top: .6rem; font-size: .85rem; max-width: var(--demo-guide-width); }
.demo-guide summary, .delivery-evidence summary { cursor: pointer; }
.demo-guide[open] { max-height: 40vh; overflow: auto; padding: .6rem; background: #f0f5f3; border-radius: .5rem; }
.demo-guide li { margin: .5rem 0; line-height: 1.5; }
.demo-guide-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.delivery-evidence { margin-top: .5rem; font-size: .75rem; }
.delivery-evidence pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.5; }
.calendar-content { overflow: auto; }
.calendar-form { display: grid; gap: .75rem; max-width: 44rem; }
.calendar-form label { display: grid; gap: .3rem; }
.calendar-form input, .calendar-form textarea, .calendar-form select { min-width: 0; padding: .6rem; border: 1px solid var(--line); border-radius: .4rem; background: white; }
.calendar-form p, #calendar-timezone { color: var(--muted); line-height: 1.5; }
.calendar-event { margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: .6rem; overflow-wrap: anywhere; }
.calendar-event h2 { font-size: 1rem; }
.calendar-event button { margin-right: .6rem; }

/* Shared application hierarchy: readable labels and a bounded local launcher. */
:root { --muted: #56665d; }
.view-tabs { overflow: visible; }
.view-tabs button, .more-views summary { min-height: 40px; font-size: 12px; }
.more-views { position: relative; }
.more-views summary { display: flex; align-items: center; gap: 6px; padding: 0 12px; cursor: pointer; font-weight: 700; list-style: none; }
.more-views summary::after { content: "⌄"; }
.more-views:has([aria-selected="true"]) > summary { color: var(--green); background: var(--green-soft); border-radius: 6px; }
.more-views summary::-webkit-details-marker { display: none; }
.more-views-list { position: absolute; right: 0; top: calc(100% + 10px); width: 230px; padding: 8px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); z-index: 30; }
.more-views-list button { text-align: left; }
button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.section-copy, .sidebar-hint, .empty-nav, .adjacency-card small, .sidebar-footer small,
.delivery, .file-card small { font-size: 12px; line-height: 1.5; color: var(--muted); }
.local-view-header .eyebrow, .compact-heading { color: #596c60; }
.calendar-content { max-width: 1100px; width: 100%; }
.calendar-day { margin: 28px 0 8px; font-size: 14px; color: var(--muted); }
.calendar-empty { padding: 28px; border: 1px dashed #b9cbc0; border-radius: 12px; background: #f8fbf9; line-height: 1.7; max-width: 48rem; }
.calendar-event { border-left: 4px solid var(--green); background: #fbfdfc; }
.calendar-event p { line-height: 1.5; color: var(--muted); font-size: 13px; }
.calendar-event button { min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); background: white; border-radius: 8px; cursor: pointer; }
.calendar-editor { max-width: 48rem; margin-top: 24px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbf9; }
.calendar-editor > summary { padding: 18px; cursor: pointer; font-weight: 650; }
.calendar-form { max-width: none; padding: 4px 20px 20px; gap: 16px; }
.calendar-form label { font-size: 14px; gap: 7px; }
.calendar-form input, .calendar-form textarea { font: inherit; min-height: 44px; }
.calendar-form p, #calendar-timezone { font-size: 13px; }
.calendar-people { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
#calendar-people { display: grid; gap: 8px; max-height: 200px; overflow: auto; font-size: 13px; }
#calendar-people label { display: flex; align-items: center; gap: 10px; min-height: 40px; overflow-wrap: anywhere; }
#calendar-people input { min-height: 20px; width: 20px; height: 20px; accent-color: var(--green); }
.calendar-form > div:last-child { display: flex; flex-wrap: wrap; gap: 10px; }
.calendar-form .primary-button { width: auto; min-width: 140px; margin: 0; }
.calendar-form .secondary-button { min-height: 40px; padding: 8px 14px; }
@media (max-width: 760px) {
  .view-tabs { max-width: none; overflow: visible; }
  .view-tabs button, .more-views summary { min-height: 44px; font-size: 12px; padding-inline: 7px; }
  .more-views summary { max-width: 86px; overflow: hidden; white-space: nowrap; }
  .top-actions { min-width: 0; gap: 4px; padding-right: 4px; }
  .local-view-header { flex-wrap: wrap; gap: 12px; }
  .calendar-content { padding: 16px; }
  .calendar-form { padding: 4px 12px 16px; }
  .calendar-empty { padding: 18px; }
}
@media (max-width: 360px) {
  .topbar .brand { display: none; }
}
