:root {
  --bg: #f3f6fa;
  --panel: #ffffff;
  --text: #172234;
  --muted: #59687c;
  --line: #d9e2ec;
  --line-strong: #c8d4e1;
  --blue: #276fe8;
  --blue-soft: #eaf2ff;
  --dark: #142131;
  --alarm: #dc3f46;
  --alarm-soft: #fff0f1;
  --appeal: #e28b25;
  --appeal-soft: #fff6e9;
  --out: #238a57;
  --out-soft: #eefaf3;
  --in: #7546bb;
  --in-soft: #f6f0fc;
  --night: #334d92;
  --shadow: 0 10px 28px rgba(18, 38, 63, .065);
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-xs: 10px;
  --font-sm: 11.5px;
  --font-md: 13px;
  --font-lg: 14.5px;
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 12px;
  --icon-sm: 16px;
  --icon-md: 18px;
  --control-height: 36px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
svg { display: block; }

.messages { position: fixed; right: 24px; top: 24px; z-index: 99; }
.message { background: #173954; color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); }

/* Публичная часть */
.public-layout {
  display: grid;
  width: 100%;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  max-width: 1660px;
  margin: 0 auto;
}
.public-sidebar,
.timeline-main {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow);
}
.public-sidebar {
  padding: 18px;
  align-self: start;
  position: sticky;
  top: 14px;
  max-height: none;
  overflow: visible;
}
.brand { display: flex; gap: 11px; align-items: center; }
.brand-icon {
  width: 38px;
  height: 44px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  background: var(--alarm);
  color: #fff;
  border-radius: 9px 9px 16px 16px;
}
.brand-icon svg { width: 22px; height: 22px; fill: currentColor; }
.brand h1 { font-size: 20px; line-height: 1.15; margin: 0; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.intro { font-size: 13px; line-height: 1.55; margin-top: 20px; }
.intro p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.compact { margin: 6px 0; }

.stats-list {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  margin-top: 14px;
  background: #fbfcfe;
}
.stat-row {
  min-height: 39px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 11px;
  border-bottom: 1px solid #e7edf4;
}
.stat-row:last-child { border-bottom: 0; }
.stat-row span { color: var(--muted); font-size: 11.5px; line-height: 1.25; }
.stat-row strong { font-size: 18px; white-space: nowrap; }

.timeline-main { padding: 20px; min-width: 0; }
.timeline-header {
  display: block;
  margin-bottom: 12px;
}
.timeline-header h2 { margin: 0; font-size: 23px; }
.timeline-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.filter-check {
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 12.5px;
  white-space: nowrap;
}

.month-group { margin: 0 0 28px; }
.month-title {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 10px 14px;
  margin: 0 0 10px;
  color: #1d385d;
  background: #e6f0ff;
  border: 1px solid #d3e3fa;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(35, 72, 117, .04);
}
.month-group:nth-child(even) .month-title { background: #edf5f2; border-color: #d9e9e2; color: #285346; }
.month-title strong { display: block; font-size: 17px; text-transform: capitalize; }
.month-title > div:first-child span { color: var(--muted); font-size: 11.5px; }
.month-metrics { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.month-metrics > span { background: rgba(255, 255, 255, .7); border: 1px solid rgba(110, 139, 177, .22); padding: 4px 7px; border-radius: 999px; font-size: 11px; }

.day-group {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  margin: 0 0 9px;
  padding: 8px;
  border: 1px solid #e3eaf2;
  border-radius: 11px;
  background: #fbfcfe;
}
.day-title { padding: 7px 5px 5px; border-right: 1px solid #e1e8f0; }
.day-title strong { display: block; font-size: 14px; text-transform: capitalize; }
.day-title span { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.day-events { min-width: 0; }

.event-card {
  position: relative;
  scroll-margin-top: 82px;
  transition: box-shadow .18s ease, border-color .18s ease;
  background: #fff;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 9px;
  margin: 0 0 6px;
  overflow: hidden;
}
.event-card:last-child { margin-bottom: 0; }
.event-alarm { border-left-color: var(--alarm); }
.event-appeal { border-left-color: var(--appeal); }
.event-card summary {
  display: grid;
  grid-template-columns: 28px 96px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 9px 82px 9px 12px;
  cursor: pointer;
  list-style: none;
}
.event-card[open] { box-shadow: 0 4px 14px rgba(30, 50, 78, .06); }
.event-card[open] summary { background: #fcfdff; }
.event-type-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.event-alarm .event-type-icon { color: var(--alarm); background: var(--alarm-soft); }
.event-appeal .event-type-icon { color: var(--appeal); background: var(--appeal-soft); }
.event-type-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.event-time { display: flex; gap: 7px; align-items: center; min-width: 0; }
.event-time strong { font-size: 18px; }
.night-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 6px;
  color: #fff;
  background: var(--night);
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
}
.night-badge.mini { min-height: 18px; padding: 2px 5px; font-size: 8px; vertical-align: middle; }
.event-summary { min-width: 0; }
.event-summary h3 { margin: 0; font-size: 14.5px; line-height: 1.3; }
.event-summary p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.doc-badges { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-size: 10.5px; padding: 4px 6px; border-radius: 6px; white-space: nowrap; }
.badge.out { background: #e5f5ec; color: #177445; }
.badge.in { background: #f0e8fa; color: #6635a8; }
.event-details { border-top: 1px solid var(--line); padding: 14px; background: #fbfcfe; }
.event-description { margin: 0 0 12px; line-height: 1.5; font-size: 13px; }
.document-section-public + .document-section-public { margin-top: 13px; }
.document-section-public h4 { margin: 0 0 7px; font-size: 13px; }
.document-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid;
  border-radius: 8px;
  padding: 11px 12px;
  margin-bottom: 7px;
}
.document-card.outgoing { border-left-color: var(--out); }
.document-card.incoming { border-left-color: var(--in); }
.document-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.document-head strong { font-size: 13px; }
.document-head span { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.document-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.document-card p { font-size: 12.5px; margin: 7px 0; color: #49576a; line-height: 1.45; }
.attachment-list { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.attachment-list a { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #d9e4f0; border-radius: 7px; padding: 6px 8px; background: #fff; font-size: 11.5px; font-weight: 600; }
.empty-state { padding: 44px; text-align: center; color: var(--muted); }

/* Административная часть */
.control-layout { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.control-sidebar { background: var(--dark); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.control-sidebar .brand h1 { font-size: 18px; }
.control-sidebar .brand p { color: #98a9bd; }
.control-sidebar nav { margin-top: 30px; display: flex; flex-direction: column; gap: 7px; }
.control-sidebar nav a,
.logout-link { color: #dce5ef; padding: 11px 12px; border-radius: 8px; background: transparent; border: 0; text-align: left; cursor: pointer; }
.control-sidebar nav a.active,
.control-sidebar nav a:hover { background: #22405f; color: #fff; text-decoration: none; }
.control-sidebar form { margin-top: auto; }
.logout-link { width: 100%; }
.control-main { padding: 26px; min-width: 0; }
.control-main.form-page { max-width: 1220px; }
.control-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 18px; }
.control-heading h2 { margin: 0; }
.control-heading p { margin: 5px 0 0; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 8px; padding: 10px 14px; cursor: pointer; }
.btn:hover { text-decoration: none; border-color: var(--line-strong); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.control-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.control-stats > div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.control-stats span { font-size: 13px; color: var(--muted); }
.control-stats b { display: block; font-size: 24px; margin-top: 4px; }
.control-filters { display: flex; gap: 8px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); padding: 12px; border-radius: 10px; margin-bottom: 14px; }
.control-filters input,
.control-filters select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; }
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.control-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.control-table th,
.control-table td { padding: 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.control-table th { color: var(--muted); font-weight: 600; background: #f9fbfd; }
.type-label { font-size: 11px; padding: 4px 6px; border-radius: 5px; }
.type-label.type-alarm { background: var(--alarm-soft); color: #a7282f; }
.type-label.type-appeal { background: var(--appeal-soft); color: #9a5b12; }
.status { display: inline-block; padding: 5px 8px; border-radius: 6px; font-size: 12px; }
.status.published { background: #e6f5ec; color: #167341; }
.status.draft { background: #fff1d9; color: #975f05; }
.actions { display: flex; gap: 8px; }
.actions form { display: inline; }
.actions button { border: 0; background: none; color: #b93238; cursor: pointer; padding: 0; }
.export-panel,
.form-section { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-top: 16px; }
.export-panel h3,
.form-section h3 { margin-top: 0; }
.export-panel .btn { margin-right: 8px; }
.record-form { padding-bottom: 90px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.event-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field.wide { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.form-control { width: 100%; border: 1px solid #cbd6e2; border-radius: 8px; padding: 10px; background: #fff; }
.form-check-input { width: 18px; height: 18px; }
.checkbox-field { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; }
.checkbox-field label { width: 100%; }
.error { color: #b93238; font-size: 12px; margin-top: 4px; }
.help-text { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
.document-form { border: 1px solid var(--line); padding: 14px; border-radius: 10px; margin-top: 12px; }
.outgoing-form { background: #f7fcf9; border-left: 4px solid var(--out); }
.incoming-form { background: #fbf8ff; border-left: 4px solid var(--in); }
.document-form-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.document-form-title span { color: var(--muted); font-size: 12px; }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.section-heading p { color: var(--muted); font-size: 13px; margin: 4px 0; }
.existing-files { margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line-strong); }
.existing-files h4 { margin: 0 0 7px; font-size: 12.5px; }
.existing-file { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 8px; margin-top: 5px; background: #fff; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; }
.existing-file.legacy-file { align-items: flex-start; flex-direction: column; }
.existing-file.legacy-file span { color: var(--muted); font-size: 11px; }
.delete-file { color: #9f3036; font-size: 11px; white-space: nowrap; }
.delete-document { display: inline-flex; align-items: center; gap: 6px; color: #9f3036; font-size: 12px; margin-top: 12px; }
.export-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.export-form label { font-size: 13px; color: var(--muted); }
.export-form input { display: block; margin-top: 5px; border: 1px solid var(--line); border-radius: 7px; padding: 9px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.sticky-actions { position: sticky; bottom: 0; padding: 12px; background: rgba(243, 246, 250, .94); border-top: 1px solid var(--line); backdrop-filter: blur(8px); z-index: 5; }
.cards-list { display: grid; gap: 10px; }
.org-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; justify-content: space-between; }
.org-card h3 { margin: 0; }
.org-card p { margin: 5px 0; color: var(--muted); }
.org-card span { font-size: 12px; margin-right: 8px; }
.control-login-page { display: grid; place-items: center; min-height: 100vh; background: #eef3f9; }
.login-card { width: min(430px, 90vw); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.login-card h2 { margin-top: 30px; }
.login-card p label { display: block; margin-bottom: 6px; }
.login-card input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.login-card .btn { width: 100%; }
.back-link { display: block; margin-top: 18px; text-align: center; }

@media (max-width: 1100px) {
  .event-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .control-layout { grid-template-columns: 1fr; }
  .control-sidebar { position: static; height: auto; }
  .control-sidebar nav { flex-direction: row; overflow: auto; }
  .control-sidebar form { margin-top: 10px; }
  .control-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 650px) {
  .intro { font-size: 12.5px; }
  .day-group { min-width: 0; grid-template-columns: 1fr; padding: 6px; }
  .day-title { border-right: 0; border-bottom: 1px solid #e1e8f0; padding: 5px 6px 7px; display: flex; justify-content: space-between; }
  .day-title span { margin-top: 0; }
  .event-time { flex-direction: column; align-items: flex-start; gap: 2px; }
  .event-time strong { font-size: 16px; }
  .event-summary h3 { font-size: 13.5px; }
  .badge { font-size: 9.5px; }
  .form-grid, .event-fields { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .control-main { padding: 14px; }
  .control-heading { align-items: flex-start; flex-direction: column; }
  .control-stats { grid-template-columns: 1fr 1fr; }
  .section-heading { flex-direction: column; }
  .section-heading .btn { width: 100%; }
  .existing-file { align-items: flex-start; flex-direction: column; flex-wrap: wrap; }
}


.multi-file-picker { display: grid; gap: 8px; }
.pending-files {
  border: 1px solid #cfe0f1;
  border-radius: 8px;
  padding: 9px;
  background: #f7fbff;
}
.pending-files > strong { display: block; margin-bottom: 6px; font-size: 12px; }
.pending-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid #e2ebf4;
  font-size: 12px;
}
.pending-file:first-of-type { border-top: 0; }
.pending-file span { overflow-wrap: anywhere; }
.remove-pending-file {
  border: 0;
  background: transparent;
  color: #a32f36;
  cursor: pointer;
  font-size: 11px;
  padding: 3px 5px;
}
.settings-form { max-width: 700px; }

.version-footer {
  margin-top: auto;
  padding: 14px 10px 4px;
  color: #91a6bc;
  font-size: 11px;
}
.system-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid #2f8f5b;
  border-radius: 12px;
}
.system-summary.status-error { border-left-color: #c83b42; }
.system-summary span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.system-summary strong { font-size: 15px; }
.operation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.operation-card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid #8a9aac;
  border-radius: 12px;
  padding: 16px;
}
.operation-card.status-ok { border-top-color: #2f8f5b; }
.operation-card.status-error { border-top-color: #c83b42; }
.operation-card.status-unknown { border-top-color: #d29a2e; }
.operation-card h3 { margin: 0 0 8px; }
.operation-state { font-weight: 700; margin: 0 0 12px; }
.operation-card dl { margin: 0; }
.operation-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.operation-card dt { color: var(--muted); }
.operation-card dd { margin: 0; text-align: right; }
.operation-card .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.operation-help { margin-top: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.operation-help pre { overflow: auto; background: #111c2a; color: #e9f1fa; padding: 12px; border-radius: 8px; }
@media (max-width: 900px) {
  .system-summary, .operation-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 650px) {
  .system-summary, .operation-grid { grid-template-columns: 1fr; }
}
.operation-card.status-warning { border-top-color: #d29a2e; }
.system-summary.status-warning { border-left-color: #d29a2e; }

/* 1.4.0 — публичный интерфейс и защита от дублей */
.intro-compact { margin-top: 16px; }
.intro-compact > p { margin-bottom: 10px; }
/* UI foundation 1.4.3.4 — единые раскрытия, иконки и геометрия */
.disclosure-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}
.disclosure-summary > :first-child { min-width: 0; margin-right: auto; }
.disclosure-summary::-webkit-details-marker,
.floor-map-toggle::-webkit-details-marker,
.event-card > summary::-webkit-details-marker { display: none; }
.disclosure-summary-meta {
  flex: 0 1 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.disclosure-indicator {
  flex: 0 0 var(--icon-md);
  width: var(--icon-md);
  height: var(--icon-md);
  display: inline-grid;
  place-items: center;
  color: #718092;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}
.disclosure-indicator::before { content: "＋"; }
details[open] > summary .disclosure-indicator::before { content: "−"; }

.about-portal {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
  overflow: hidden;
}
.about-portal > summary {
  min-height: 38px;
  padding: 8px 10px;
  color: #31516f;
  font-size: 12px;
  font-weight: 700;
}
.about-portal-body { padding: 0 10px 10px; border-top: 1px solid var(--line); }
.about-portal-body p { margin: 9px 0 0; }
.stat-row.stat-date strong { font-size: 12px; text-align: right; }
.stats-note { margin: 10px 2px 0; color: var(--muted); font-size: 10.8px; line-height: 1.45; }

.month-group:nth-child(even) .month-title,
.month-title { background: #e6f0ff; border-color: #d3e3fa; color: #1d385d; }
.event-card summary:focus-visible { outline: 3px solid rgba(39, 111, 232, .25); outline-offset: -3px; }
.event-card > summary .disclosure-indicator {
  position: absolute;
  top: 18px;
  right: 13px;
}
.event-card:target,
.event-card.hash-target { box-shadow: 0 0 0 3px rgba(39, 111, 232, .22), 0 8px 22px rgba(18, 38, 63, .1); }
.copy-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  border-radius: 9px;
  background: #173954;
  color: #fff;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  font-size: 12px;
}

.duplicate-live-panel,
.duplicate-review-panel {
  margin-top: 14px;
  border: 1px solid #e3bd65;
  border-left: 5px solid #d99a20;
  border-radius: 10px;
  background: #fffaf0;
  padding: 13px;
}
.duplicate-review-panel { margin-top: 16px; }
.duplicate-panel-heading,
.duplicate-review-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.duplicate-panel-heading strong,
.duplicate-review-title h3 { display: block; margin: 0; }
.duplicate-panel-heading span,
.duplicate-review-title p { display: block; margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.duplicate-review-title > span {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #f3d99f;
  color: #714d08;
  font-weight: 800;
}
.duplicate-check-state { white-space: nowrap; }
.duplicate-candidate-list { display: grid; gap: 8px; }
.duplicate-candidate {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px;
  border: 1px solid #ead9b4;
  border-left: 4px solid #d99a20;
  border-radius: 8px;
  background: #fff;
}
.duplicate-candidate.confidence-exact { border-left-color: var(--alarm); }
.duplicate-candidate.confidence-likely { border-left-color: #d78a19; }
.duplicate-candidate.confidence-possible { border-left-color: #75869a; }
.duplicate-candidate-main { min-width: 0; }
.duplicate-confidence {
  display: inline-block;
  margin: 0 7px 5px 0;
  padding: 3px 6px;
  border-radius: 5px;
  background: #fff0d4;
  color: #7c5207;
  font-size: 10px;
  font-weight: 800;
}
.confidence-exact .duplicate-confidence { background: var(--alarm-soft); color: #a7282f; }
.duplicate-candidate h4 { margin: 5px 0 2px; font-size: 13.5px; }
.duplicate-candidate p { margin: 0; color: var(--muted); font-size: 11.5px; }
.duplicate-candidate-actions { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 7px; min-width: 185px; }
.duplicate-candidate-actions .btn { padding: 8px 10px; font-size: 11.5px; }
.duplicate-candidate-actions > a:not(.btn) { font-size: 11.5px; }
.duplicate-review-note { margin: 10px 0 0; color: var(--muted); font-size: 11.5px; }
.duplicate-confirm { background: #9a680b; border-color: #9a680b; color: #fff; }
.form-error-summary { margin-bottom: 12px; padding: 10px; border-radius: 8px; background: var(--alarm-soft); color: #9d2b31; }

@media (max-width: 650px) {
  .intro-compact > p { font-size: 12.5px; }
  .duplicate-candidate { flex-direction: column; }
  .duplicate-candidate-actions { min-width: 0; align-items: stretch; }
  .duplicate-candidate-actions .btn { width: 100%; }
}
.duplicate-live-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 10px;
  border-top: 1px solid #ead9b4;
  color: #5f430e;
  font-size: 12px;
  font-weight: 700;
}
.duplicate-live-confirm input { margin-top: 2px; }


/* 1.4.0.1 — исправление публичной адаптивной вёрстки */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.stats-disclosure > summary,
.filters-disclosure > summary { display: none; }
.stats-disclosure { margin: 0; }
.timeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.filters-disclosure {
  min-width: 0;
  flex: 1 1 auto;
}
.filters-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.filter-field {
  display: block;
  flex: 0 1 180px;
  min-width: 150px;
}
.filter-field select {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 8px;
  padding: 6px 9px;
}
.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  grid-column: auto;
}
.filters-reset {
  grid-column: auto;
  justify-self: auto;
  padding: 7px 4px;
}
.filter-result {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.copy-event-link {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 40px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.copy-event-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.copy-event-link:hover {
  border-color: var(--line);
  background: #f2f6fb;
  color: var(--blue);
  text-decoration: none;
}
.copy-event-link:focus-visible {
  outline: 3px solid rgba(39, 111, 232, .25);
  outline-offset: 1px;
}

@media (max-width: 1100px) {
  .public-layout { grid-template-columns: 238px minmax(0, 1fr); }
  .event-card summary { grid-template-columns: 28px 82px minmax(0, 1fr) auto; }
}

@media (max-width: 900px) {
  .public-layout { grid-template-columns: minmax(0, 1fr); }
  .public-sidebar {
    position: static;
    width: 100%;
    max-height: none;
  }
  .timeline-main { width: 100%; }
  .timeline-toolbar { align-items: flex-start; }
  .filters-panel { width: 100%; }
}

@media (max-width: 650px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .public-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 6px;
  }
  .public-sidebar,
  .timeline-main {
    width: 100%;
    min-width: 0;
    padding: 12px;
  }
  .brand h1 { font-size: 18px; }
  .intro-compact { margin-top: 13px; }
  .stats-disclosure { margin-top: 12px; }
  .stats-disclosure > summary,
  .filters-disclosure > summary {
    display: flex;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f8fafc;
    color: #31516f;
    font-size: 12.5px;
    font-weight: 700;
  }
  .stats-disclosure[open] > summary,
  .filters-disclosure[open] > summary {
    border-radius: 9px 9px 0 0;
  }
  .stats-content,
  .filters-panel {
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 9px 9px;
    background: #fff;
  }
  .stats-content { padding: 0 10px 10px; }
  .stats-list { margin-top: 0; border-radius: 0 0 8px 8px; }
  .timeline-header { margin-bottom: 10px; }
  .timeline-header h2 { font-size: 20px; }
  .timeline-toolbar {
    display: block;
    margin-bottom: 10px;
  }
  .filters-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    padding: 9px;
  }
  .filter-field,
  .filter-options,
  .filters-reset {
    width: 100%;
    min-width: 0;
  }
  .filter-field { flex: none; }
  .filter-options { display: grid; grid-template-columns: minmax(0, 1fr); }
  .filter-check { width: 100%; white-space: normal; }
  .filters-reset { padding: 5px 2px 1px; }
  .filter-result {
    margin: 7px 2px 0;
    white-space: normal;
  }
  .event-card summary {
    grid-template-columns: 28px minmax(62px, 74px) minmax(0, 1fr);
    gap: 7px;
    padding: 9px 77px 9px 9px;
  }
  .doc-badges { grid-column: 3; justify-content: flex-start; }
  .copy-event-link { top: 10px; right: 34px; }
  .event-card > summary .disclosure-indicator { top: 18px; right: 10px; }
  .event-details { padding: 11px; }
  .document-head { gap: 8px; }
  .attachment-list a { max-width: 100%; overflow-wrap: anywhere; }
}

@media (max-width: 380px) {
  .public-layout { padding: 4px; }
  .public-sidebar,
  .timeline-main { padding: 10px; }
  .event-card summary {
    grid-template-columns: 26px 58px minmax(0, 1fr);
    padding-right: 70px;
  }
  .copy-event-link { right: 31px; width: 29px; height: 29px; }
  .event-card > summary .disclosure-indicator { right: 8px; }
}

/* 1.4.1 — вложения и подтверждённые возгорания */
.fire-stat strong { color: #b53624; }
.badge.files { background: #e9f1fb; color: #315d8c; }
.badge.fire-confirmed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff0e8;
  color: #a13b1f;
}
.badge.fire-confirmed svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}
.admin-fire-mark { margin-left: 4px; font-size: 14px; }
.attachment-list .attachment-link {
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.attachment-list .attachment-link:hover {
  border-color: #bfd0e1;
  background: #f8fbfe;
  color: #245fae;
  text-decoration: none;
}
.attachment-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  background: #eef4fb;
  color: #315d8c;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}
.attachment-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.attachment-icon-image { color: #8a4b39; background: #fff0ed; }
.attachment-icon-pdf { color: #a13b1f; background: #fff0ed; }
.attachment-icon-download { color: #315d8c; background: #eef4fb; }
.existing-file-info span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
html.gallery-open,
body.gallery-open {
  overflow: hidden;
  max-width: 100%;
  overscroll-behavior: none;
}
.image-gallery[hidden] { display: none !important; }
.image-gallery {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: hidden;
}
.image-gallery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 29, .86);
}
.image-gallery-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1120px, calc(100vw - 40px));
  height: min(840px, calc(100vh - 40px));
  height: min(840px, calc(100dvh - 40px));
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #111a26;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .42);
  color: #fff;
}
.image-gallery-head,
.image-gallery-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: #172334;
}
.image-gallery-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.image-gallery-head strong { font-size: 16px; }
.image-gallery-head span { color: #b9c5d4; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-close,
.gallery-nav {
  border: 0;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  cursor: pointer;
}
.gallery-close {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  font-size: 27px;
  line-height: 1;
}
.image-gallery-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 18px 64px;
  overflow: hidden;
}
.image-gallery-stage img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  background: transparent;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
  border-radius: 10px;
  font-size: 42px;
  line-height: 1;
}
.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }
.gallery-close:hover,
.gallery-nav:hover { background: rgba(255, 255, 255, .2); }
.gallery-download {
  min-width: 0;
  max-width: 72%;
  overflow: hidden;
  color: #fff;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.image-gallery-footer span { flex: 0 0 auto; color: #cbd5e1; }

@media (max-width: 650px) {
  .badge.fire-confirmed { max-width: 100%; }
  .image-gallery {
    inset: 0;
    width: auto;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    padding: 0;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
  }
  .image-gallery-dialog {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    min-width: 0;
    min-height: 0;
    border-radius: 0;
  }
  .image-gallery-head,
  .image-gallery-stage,
  .image-gallery-footer {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .image-gallery-stage {
    width: auto;
    padding: 10px 40px;
  }
  .image-gallery-stage img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
  }
  .gallery-nav { width: 36px; height: 54px; font-size: 34px; }
  .gallery-prev { left: 2px; }
  .gallery-next { right: 2px; }
  .image-gallery-head {
    padding:
      max(10px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      10px
      max(12px, env(safe-area-inset-left));
  }
  .image-gallery-footer {
    padding:
      10px
      max(12px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }
  .image-gallery-footer span { min-width: 0; }
  .gallery-download {
    flex: 1 1 auto;
    width: 0;
    max-width: none;
  }
}

/* 1.4.2 — последствия срабатывания и сведения из ответов */
.badge.lift-disabled {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff4d9;
  color: #7b580e;
}
.badge.lift-disabled > span { font-size: 14px; font-weight: 900; }
.event-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #40556a;
  font-size: 12px;
}
.event-facts .lift-fact.yes { color: #7b580e; }
.response-facts-public {
  margin: 10px 0;
  padding: 10px 12px;
  border-left: 4px solid #5a82aa;
  border-radius: 6px;
  background: #f1f6fb;
}
.attachment-list-compact { margin-top: 6px; }
.attachment-summary {
  margin: 8px 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.attachment-list .attachment-link > span:last-child {
  display: inline-flex;
  flex-direction: column;
  min-width: 0;
}
.attachment-list .attachment-link small {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 500;
}
.response-facts {
  min-width: 0;
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid #cbd9e6;
  border-radius: 9px;
  background: #f7fafc;
}
.response-facts legend {
  padding: 0 7px;
  color: #31516f;
  font-size: 13px;
  font-weight: 800;
}
.response-facts > .help-text { display: block; margin: -2px 0 10px; }
.response-facts-grid { margin-top: 0; }
.attachment-position {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.attachment-position input {
  width: 62px;
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.admin-lift-mark {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  margin-left: 3px;
  border-radius: 5px;
  background: #fff4d9;
  color: #7b580e;
  font-size: 12px;
  font-weight: 900;
}
.quality-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-width: 108px;
}
.quality-dot {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
}
.quality-dot.present { background: #e5f3e9; color: #27643b; }
.quality-dot.missing { background: #f1f3f5; color: #8793a0; }
.control-filters input[name="q"] { min-width: min(360px, 100%); }

@media (max-width: 650px) {
  .event-facts { display: grid; gap: 5px; }
  .response-facts { padding: 10px; }
  .attachment-position { margin-left: auto; }
  .quality-indicators { min-width: 0; }
}

/* 1.4.3.1 — compact quiet-period counter and restrained duration stopwatch */
.timeline-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}
.timeline-header-row h2 { min-width: 0; }
.quiet-period-inline {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.3;
  white-space: nowrap;
}
.quiet-period-inline strong {
  color: #31516f;
  font-size: 12.5px;
  font-weight: 800;
}
.quiet-period-empty strong { color: var(--muted); font-weight: 700; }
.event-title-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.event-title-line h3 { min-width: 0; }
.duration-indicator {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.duration-indicator svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.duration-gray { color: #8a96a5; }
.duration-orange { color: #bf792d; }
.duration-red { color: #c24b54; }

@media (max-width: 650px) {
  .timeline-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
  .quiet-period-inline {
    white-space: normal;
    font-size: 11px;
  }
  .quiet-period-inline strong { font-size: 11.5px; }
  .duration-indicator { width: 17px; height: 17px; }
  .duration-indicator svg { width: 14px; height: 14px; }
}

.existing-file-info { min-width: 0; display: grid; gap: 3px; }
.existing-file-links { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.existing-file-info > span { color: var(--muted); font-size: 11px; }
.subtle-link { color: var(--muted); font-size: 11px; font-weight: 500; }
.compact-hash { overflow-wrap: anywhere; }
.metadata-status { font-weight: 600; }
.metadata-cleaned { color: #177445 !important; }
.metadata-signed, .metadata-unsupported { color: #9b6419 !important; }
.metadata-error { color: #b93238 !important; }

/* 1.4.3.2 — floor map, lift completeness, monthly known duration, community links */
.community-disclosure {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfe;
  overflow: hidden;
}
.community-disclosure > summary {
  min-height: 42px;
  padding: 9px 11px;
  color: #31516f;
  font-size: 12px;
  font-weight: 700;
}
.telegram-mark svg { width: 16px; height: 16px; fill: currentColor; }
.community-links {
  border-top: 1px solid #e7edf4;
  padding: 4px 10px 10px;
}
.community-links > a {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 14px;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 9px 2px;
  border-bottom: 1px solid #edf1f5;
  color: #365874;
  text-decoration: none;
}
.community-links > a:hover { color: var(--blue); text-decoration: none; }
.community-links > a > span:nth-child(2) { min-width: 0; }
.community-links strong,
.community-links small { display: block; min-width: 0; overflow-wrap: anywhere; }
.community-links strong { font-size: 11.5px; line-height: 1.25; }
.community-links small { margin-top: 2px; color: var(--muted); font-size: 9.5px; line-height: 1.3; font-weight: 500; }
.telegram-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf7fd;
  color: #3d98cf;
}
.external-mark { color: #9aa8b7; font-size: 12px; }
.community-links > p {
  margin: 9px 2px 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.4;
}

.toolbar-meta {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.floor-map-disclosure {
  position: relative;
  flex: 0 0 auto;
}
.floor-map-toggle {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #52667b;
  cursor: pointer;
  list-style: none;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.floor-map-toggle:hover { border-color: #c7d6e6; background: #f8fbfe; color: #31516f; }
.floor-map-toggle:focus-visible { outline: 2px solid rgba(39, 111, 232, .24); outline-offset: 2px; }
.floor-map-toggle-icon {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  color: #6f8ba7;
}
.floor-map-toggle-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.floor-map-toggle strong {
  min-width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: #eef4fb;
  color: #4e6f91;
  font-size: 9px;
  line-height: 1;
}
.floor-map-content {
  position: absolute;
  z-index: 45;
  right: 0;
  top: calc(100% + 7px);
  width: min(520px, calc(100vw - 44px));
  padding: 11px;
  border: 1px solid #d7e2ed;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(18, 38, 63, .14);
}
.floor-map-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}
.floor-map-popover-head > div { min-width: 0; }
.floor-map-popover-head > div > strong,
.floor-map-popover-head > div > span { display: block; }
.floor-map-popover-head > div > strong { font-size: 12px; color: #31516f; }
.floor-map-popover-head > div > span { margin-top: 2px; color: var(--muted); font-size: 9.5px; }
.floor-map-grid {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 4px;
}
.floor-cell {
  position: relative;
  min-width: 0;
  height: 31px;
  display: grid;
  place-items: center;
  padding: 2px;
  border: 1px solid #e2e9f1;
  border-radius: 6px;
  background: #f6f8fb;
  color: #788797;
}
.floor-cell:disabled { opacity: 1; cursor: default; }
.floor-cell.has-data { cursor: pointer; color: #284f78; font-weight: 700; }
.floor-cell strong { font-size: 10px; line-height: 1; }
.floor-cell small {
  position: absolute;
  right: 3px;
  top: 2px;
  min-width: 11px;
  height: 11px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  color: #365f89;
  font-size: 6.5px;
  font-weight: 800;
  line-height: 1;
}
.floor-cell.floor-level-1 { background: #e8f1fd; border-color: #d8e6f8; }
.floor-cell.floor-level-2 { background: #d6e7fb; border-color: #c5d9f1; }
.floor-cell.floor-level-3 { background: #b8d5f6; border-color: #a8c6e9; }
.floor-cell.floor-level-4 { background: #8eb9e8; border-color: #7fa9d9; }
.floor-cell.floor-level-5 { background: #679bd5; border-color: #5d8fc8; color: #163e68; }
.floor-cell.has-data:hover,
.floor-cell.is-selected { box-shadow: inset 0 0 0 2px rgba(43, 91, 144, .22); }
.floor-map-detail {
  margin-top: 9px;
  border-top: 1px solid #e8eef4;
  padding-top: 7px;
}
.floor-map-detail[hidden] { display: none !important; }
.floor-map-panel > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 5px;
}
.floor-map-panel > header strong { font-size: 11.5px; color: #31516f; }
.floor-map-panel > header span { color: var(--muted); font-size: 9.5px; }
.floor-event-links { display: grid; gap: 2px; }
.floor-event-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 6px 5px;
  border-radius: 6px;
  color: #365874;
  text-decoration: none;
}
.floor-event-link:hover { background: #f4f8fc; color: var(--blue); text-decoration: none; }
.floor-event-link > span:first-child { min-width: 0; }
.floor-event-link strong,
.floor-event-link small { display: block; min-width: 0; }
.floor-event-link strong { font-size: 10px; }
.floor-event-link small { margin-top: 1px; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.floor-event-link > span:last-child { color: #8ca0b4; }
.floor-map-empty { margin: 6px 0 0; color: var(--muted); font-size: 9.5px; }

.month-duration-metric {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
  cursor: help;
}
.ui-info-icon {
  flex: 0 0 var(--icon-sm);
  width: var(--icon-sm);
  height: var(--icon-sm);
  display: inline-grid;
  place-items: center;
  color: #637a91;
  line-height: 0;
  vertical-align: middle;
  cursor: help;
}
.ui-info-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lift-status-indicator {
  position: relative;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  color: #98a5b2;
  cursor: help;
}
.lift-status-indicator svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lift-status-unknown { color: #b0bac4; }
.lift-question {
  position: absolute;
  right: -1px;
  top: -2px;
  min-width: 9px;
  height: 9px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #9ba7b2;
  font-size: 7.5px;
  font-weight: 800;
  line-height: 1;
}

.ui-tooltip {
  position: fixed;
  z-index: 500;
  max-width: min(340px, calc(100vw - 20px));
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  background: rgba(26, 36, 48, .96);
  color: #fff;
  box-shadow: 0 7px 22px rgba(18, 28, 40, .18);
  font-size: 10.5px;
  line-height: 1.45;
  white-space: pre-line;
  pointer-events: none;
}
.ui-tooltip[hidden] { display: none !important; }
[data-tooltip]:focus-visible {
  outline: 2px solid rgba(39, 111, 232, .26);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (max-width: 900px) {
  .community-disclosure { margin-top: 10px; }
}

@media (max-width: 650px) {
  .community-disclosure > summary { min-height: 40px; }
  .community-disclosure:not([open]) .community-links { display: none; }
  .toolbar-meta { width: 100%; margin-top: 7px; justify-content: space-between; }
  .floor-map-toggle { min-height: 34px; }
  .floor-map-content {
    left: 0;
    right: auto;
    width: min(420px, calc(100vw - 36px));
    padding: 10px;
  }
  .floor-map-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
  .floor-cell { height: 36px; }
  .floor-cell strong { font-size: 11px; }
  .floor-cell small { min-width: 12px; height: 12px; font-size: 7px; }
  .month-title { position: static; align-items: center; }
  .month-metrics { display: flex; margin-left: auto; }
  .month-metrics > span:not(.month-duration-metric) { display: none; }
  .month-duration-metric { font-size: 9.5px !important; padding: 3px 6px !important; }
  .ui-tooltip { font-size: 10px; }
}

@media (max-width: 380px) {
  .floor-map-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
