:root {
  color-scheme: light;
  --bg: #edf3f8;
  --bg-accent: #e4ebf3;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-soft: rgba(247, 250, 253, 0.96);
  --surface-field: rgba(251, 253, 255, 0.98);
  --line: rgba(20, 34, 48, 0.08);
  --line-strong: rgba(20, 34, 48, 0.14);
  --text: #152434;
  --muted: #697b8d;
  --primary: #2f5bdb;
  --primary-strong: #2449b0;
  --primary-soft: rgba(47, 91, 219, 0.1);
  --danger: #c95151;
  --danger-soft: rgba(201, 81, 81, 0.12);
  --success: #2f9165;
  --warning: #d79d26;
  --shadow: 0 18px 44px rgba(31, 45, 61, 0.14);
  --shadow-soft: 0 10px 24px rgba(31, 45, 61, 0.08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-height: 100vh;
  --keyboard-offset: 0px;
  font-family: "Avenir Next", "Segoe UI", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app,
#map {
  margin: 0;
  width: 100%;
  height: 100%;
}

body {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 100%);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
textarea {
  font: inherit;
}

button {
  appearance: none;
  -webkit-appearance: none;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

button:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(47, 91, 219, 0.22);
  outline-offset: 2px;
}

.topbar {
  position: fixed;
  top: calc(var(--safe-top) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(94vw, 560px);
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.topbar > button {
  flex: 1 1 0;
  min-width: 0;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.tab-btn,
.small-btn,
.action-btn,
.danger-btn,
.icon-btn {
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: 14px;
  transition:
    transform 0.14s ease,
    background-color 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease,
    color 0.14s ease,
    opacity 0.14s ease;
}

.primary-btn,
.secondary-btn {
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(47, 91, 219, 0.22);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(20, 34, 48, 0.08);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(31, 45, 61, 0.08);
}

.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active,
.small-btn:active,
.action-btn:active,
.danger-btn:active,
.icon-btn:active,
.tab-btn:active {
  transform: translateY(1px) scale(0.99);
}

.banner {
  position: fixed;
  top: calc(var(--safe-top) + 74px);
  left: 50%;
  right: auto;
  bottom: auto;
  z-index: 890;
  width: min(calc(100vw - 24px), 560px);
  transform: translateX(-50%);
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(20, 34, 48, 0.9);
  color: #ffffff;
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.35;
  backdrop-filter: blur(14px);
}

.banner.warn {
  background: rgba(138, 97, 20, 0.92);
}

.banner.error {
  background: rgba(126, 37, 37, 0.92);
}

.crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 800;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  margin-top: -20px;
  pointer-events: none;
}

.crosshair.crosshair-raised {
  top: calc(50% - var(--crosshair-offset-y, 0px));
}

.crosshair span {
  position: absolute;
  background: rgba(26, 42, 63, 0.9);
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.crosshair span:first-child {
  top: 19px;
  left: 0;
  right: 0;
  height: 2px;
}

.crosshair span:last-child {
  left: 19px;
  top: 0;
  bottom: 0;
  width: 2px;
}

.loading {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(237, 243, 248, 0.8);
  backdrop-filter: blur(12px);
}

.loading-card {
  width: min(92vw, 360px);
  padding: 24px 22px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  text-align: center;
}

.loading-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.loading-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 1150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(237, 243, 248, 0.84);
  backdrop-filter: blur(12px);
}

.gate-card {
  width: min(92vw, 360px);
  padding: 24px 22px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  text-align: center;
}

.gate-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.gate-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.gate-btn {
  width: 100%;
  margin-top: 16px;
}

.sheet {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 950;
  padding: 8px 14px calc(var(--safe-bottom) + 14px + var(--keyboard-offset));
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px 28px 22px 22px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  max-height: min(calc(var(--app-height) - var(--safe-top) - 20px), 680px);
  overflow-y: auto;
  scroll-padding-bottom: calc(var(--keyboard-offset) + 24px);
  scroll-behavior: smooth;
}

.sheet.sheet-create-mode {
  padding: 8px 12px calc(var(--safe-bottom) + 12px + var(--keyboard-offset));
  max-height: min(calc(var(--app-height) - var(--safe-top) - 20px), 430px);
}

.sheet.sheet-detail-mode {
  padding: 8px 12px calc(var(--safe-bottom) + 12px + var(--keyboard-offset));
  max-height: min(calc(var(--app-height) - var(--safe-top) - 20px), 540px);
}

.sheet.sheet-filter-mode {
  padding: 8px 12px calc(var(--safe-bottom) + 12px + var(--keyboard-offset));
  max-height: min(calc(var(--app-height) - var(--safe-top) - 20px), 440px);
}

.sheet.sheet-create-mode .sheet-handle {
  margin: 0 auto 10px;
}

.sheet.sheet-detail-mode .sheet-handle {
  margin: 0 auto 10px;
}

.sheet-handle {
  width: 54px;
  height: 5px;
  margin: 2px auto 14px;
  border-radius: 999px;
  background: rgba(105, 123, 141, 0.26);
}

#sheetContent {
  padding-bottom: 2px;
}

.hidden {
  display: none !important;
}

.sheet h2,
.admin-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sheet p,
.admin-header p,
.meta,
.hint,
.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.panel-header,
.form-section,
.comment-form,
.comment-list,
.admin-card,
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-header {
  margin-bottom: 6px;
  gap: 8px;
}

.detail-title-group {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.detail-title-line {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-vote-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.relevance-vote-group {
  margin-top: 0;
}

.detail-vote-btn {
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
}

.detail-vote-btn-positive {
  background: rgba(47, 145, 101, 0.12);
  border-color: rgba(47, 145, 101, 0.12);
  color: var(--success);
}

.detail-vote-btn-positive.active {
  background: rgba(47, 145, 101, 0.22);
  border-color: rgba(47, 145, 101, 0.26);
  box-shadow: 0 10px 22px rgba(47, 145, 101, 0.16);
}

.detail-vote-btn-negative {
  background: rgba(201, 81, 81, 0.12);
  border-color: rgba(201, 81, 81, 0.12);
  color: var(--danger);
}

.detail-vote-btn-negative.active {
  background: rgba(201, 81, 81, 0.22);
  border-color: rgba(201, 81, 81, 0.26);
  box-shadow: 0 10px 22px rgba(201, 81, 81, 0.16);
}

.compact-panel-header {
  margin-bottom: 0;
}

.compact-panel-header h2 {
  font-size: 17px;
}

.compact-panel-header .meta {
  font-size: 12px;
}

.compact-form {
  gap: 6px;
}

.close-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  background: rgba(243, 247, 251, 0.92);
  border-color: rgba(20, 34, 48, 0.08);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.type-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.type-grid::-webkit-scrollbar {
  display: none;
}

.type-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  gap: 4px;
  min-height: 72px;
  padding: 8px 6px;
  background: rgba(246, 249, 252, 0.94);
  border: 1px solid rgba(20, 34, 48, 0.06);
  border-radius: 18px;
  color: var(--text);
  text-align: center;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(31, 45, 61, 0.05);
}

.type-option.active {
  background: rgba(47, 91, 219, 0.1);
  border-color: rgba(47, 91, 219, 0.18);
  box-shadow: 0 12px 24px rgba(47, 91, 219, 0.12);
}

.type-option small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.type-option-head {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}

.type-option-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.type-option-label {
  display: inline-block;
  line-height: 1.1;
  text-transform: uppercase;
}

.compact-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  overflow: visible;
}

.compact-type-option {
  min-height: 52px;
  padding: 4px 1px;
  font-size: 8px;
  line-height: 1.1;
}

.compact-type-option small {
  display: none;
}

.compact-type-option .type-option-head {
  flex-direction: column;
  gap: 2px;
}

.compact-type-option .type-option-icon {
  width: 24px;
  height: 24px;
}

.compact-type-option .type-option-label {
  font-size: 6.5px;
  line-height: 1;
  word-break: break-word;
}

textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid rgba(20, 34, 48, 0.08);
  border-radius: 16px;
  background: var(--surface-field);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

textarea:focus {
  border-color: rgba(47, 91, 219, 0.22);
}

.compact-textarea {
  min-height: 44px;
  height: 44px;
  padding: 11px 12px;
  border-radius: 16px;
  font-size: 13px;
  resize: none;
}

.compact-selected-type {
  font-size: 11px;
  line-height: 1.2;
}

.compact-note {
  font-size: 11px;
  line-height: 1.2;
}

.compact-entry-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.compact-entry-row .compact-textarea {
  flex: 1 1 auto;
}

.compact-entry-row .action-btn {
  flex: 0 0 132px;
  min-height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.1;
  font-size: 12px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compact-actions {
  gap: 6px;
}

.compact-actions-center {
  justify-content: center;
}

.compact-actions .ghost-btn,
.compact-actions .action-btn {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.compact-actions-center .action-btn {
  flex: 0 1 224px;
}

.ghost-btn,
.action-btn,
.danger-btn,
.small-btn {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
}

.ghost-btn {
  background: rgba(243, 247, 251, 0.9);
  border-color: rgba(20, 34, 48, 0.08);
  color: var(--text);
}

.action-btn {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(47, 91, 219, 0.2);
}

.danger-btn {
  background: var(--danger-soft);
  border-color: rgba(201, 81, 81, 0.12);
  color: var(--danger);
}

.small-btn {
  background: var(--primary-soft);
  border-color: rgba(47, 91, 219, 0.08);
  color: var(--primary-strong);
}

.marker-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.detail-summary {
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 0;
}

.detail-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-summary-row .detail-summary {
  flex: 1 1 auto;
  min-width: 0;
}

.detail-summary-row .pill {
  width: 100%;
  padding: 8px 10px;
  border-radius: 14px;
  font-size: 13px;
}

.detail-close-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  font-size: 20px;
}

.detail-share-btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.detail-report-btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  background: rgba(255, 238, 240, 0.95);
  border-color: rgba(213, 75, 91, 0.12);
  color: #b43b47;
  white-space: nowrap;
}

.detail-admin-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.detail-admin-actions .small-btn,
.detail-admin-actions .danger-btn {
  flex: 1 1 0;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.detail-admin-delete-btn {
  background: rgba(255, 244, 246, 0.96);
  border-color: rgba(213, 75, 91, 0.12);
  color: #b43b47;
}

.detail-admin-block-btn {
  box-shadow: none;
}

.telegram-logo-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: block;
}

.detail-share-label {
  display: inline-block;
  line-height: 1;
}

.relevance-card {
  padding: 8px 10px;
  border: 1px solid rgba(20, 34, 48, 0.06);
  border-radius: 16px;
  background: rgba(246, 249, 252, 0.92);
  box-shadow: 0 8px 20px rgba(31, 45, 61, 0.05);
}

.relevance-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.relevance-top-copy {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.relevance-top-copy strong {
  font-size: 13px;
}

.relevance-subtitle {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}

.relevance-percent {
  color: var(--primary-strong);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.relevance-bar {
  position: relative;
  width: 100%;
  height: 7px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(201, 81, 81, 0.18);
}

.relevance-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(47, 145, 101, 0.86), rgba(47, 145, 101, 1));
}

.relevance-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
}

.relevance-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
}

.relevance-stat {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  background: rgba(255, 255, 255, 0.7);
}

.relevance-stat.positive {
  color: var(--success);
}

.relevance-stat.negative {
  color: var(--danger);
}

.relevance-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 34, 48, 0.06);
  border-radius: 16px;
  background: rgba(246, 249, 252, 0.92);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.detail-type-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.detail-type-label {
  line-height: 1.1;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dot.jam {
  background: var(--danger);
}

.dot.police {
  background: var(--primary);
}

.dot.tcka {
  background: var(--success);
}

.dot.tckp {
  background: #48a75b;
}

.dot.ask {
  background: #2aa85f;
}

.dot.clean {
  background: #1f9a55;
}

.dot.dtp {
  background: #c82828;
}

.dot.repair {
  background: #e7a126;
}

.comment-card,
.admin-card {
  padding: 14px 15px;
  border: 1px solid rgba(20, 34, 48, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(31, 45, 61, 0.05);
}

.admin-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-card strong,
.admin-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.admin-card strong {
  margin-bottom: 0;
}

.comment-card p,
.admin-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-time,
.admin-meta,
.meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.detail-list {
  gap: 6px;
}

.filter-list {
  gap: 10px;
}

.filter-actions {
  display: flex;
  justify-content: flex-start;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 12px;
  border: 1px solid rgba(20, 34, 48, 0.06);
  border-radius: 16px;
  background: rgba(246, 249, 252, 0.92);
  color: var(--text);
  text-align: left;
  box-shadow: 0 8px 18px rgba(31, 45, 61, 0.05);
}

.filter-option.active {
  background: rgba(47, 91, 219, 0.1);
  border-color: rgba(47, 91, 219, 0.18);
  box-shadow: 0 12px 24px rgba(47, 91, 219, 0.12);
}

.filter-option-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.filter-option-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.detail-note {
  font-size: 12px;
  line-height: 1.3;
}

.detail-form {
  gap: 8px;
}

.detail-form-title,
.compact-comment-title {
  font-size: 13px;
  margin: 0;
}

.detail-entry-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.detail-textarea {
  min-height: 44px;
  height: 44px;
  padding: 11px 12px;
  border-radius: 16px;
  font-size: 13px;
  resize: none;
}

.detail-entry-row .detail-textarea {
  flex: 1 1 auto;
}

.detail-entry-row .action-btn {
  flex: 0 0 144px;
  min-height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.1;
  font-size: 12px;
}

.comment-thread {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 11px;
  border: 1px solid rgba(20, 34, 48, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(31, 45, 61, 0.05);
}

.comment-thread-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(20, 34, 48, 0.05);
}

.comment-thread-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.comment-thread-time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.comment-thread-text {
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-panel {
  position: fixed;
  inset: calc(var(--safe-top) + 8px) 8px calc(var(--safe-bottom) + 8px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(22px);
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(20, 34, 48, 0.06);
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(20, 34, 48, 0.06);
}

.tab-btn {
  min-height: 40px;
  background: rgba(246, 249, 252, 0.92);
  border-color: rgba(20, 34, 48, 0.06);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tab-btn.active {
  background: rgba(47, 91, 219, 0.1);
  border-color: rgba(47, 91, 219, 0.16);
  color: var(--primary-strong);
}

.admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 16px;
}

.admin-list {
  gap: 12px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-relevance-card {
  gap: 12px;
}

.admin-relevance-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 34, 48, 0.06);
  border-radius: 16px;
  background: rgba(246, 249, 252, 0.92);
}

.admin-relevance-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-relevance-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.admin-relevance-percent {
  color: var(--primary-strong);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.admin-relevance-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 34, 48, 0.08);
}

.admin-relevance-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8d5c 0%, #f3c848 48%, #2fb46e 100%);
}

.admin-relevance-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.leaflet-control-attribution {
  font-size: 10px;
  padding: 4px 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px 0 0 0;
  background: rgba(255, 255, 255, 0.82) !important;
  color: var(--muted) !important;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.leaflet-container {
  background: #dce8f2;
}

.leaflet-bar {
  border: 0 !important;
  box-shadow: none !important;
}

.leaflet-bar a,
.leaflet-bar a:hover {
  width: 36px;
  height: 36px;
  line-height: 34px;
  border: 1px solid rgba(20, 34, 48, 0.08) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow-soft);
}

.jam-marker-icon,
.police-marker-icon,
.tck-auto-marker-icon,
.tck-walk-marker-icon,
.ask-marker-icon,
.clean-marker-icon,
.dtp-marker-icon,
.repair-marker-icon {
  filter: drop-shadow(0 6px 12px rgba(16, 35, 59, 0.18));
}

@media (max-width: 560px) {
  .topbar {
    width: calc(100vw - 18px);
    gap: 6px;
    padding: 6px;
  }

  .primary-btn,
  .secondary-btn {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }

  .sheet {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 6px 10px calc(var(--safe-bottom) + 10px);
    border-radius: 24px 24px 20px 20px;
    max-height: 82vh;
  }

  .sheet.sheet-create-mode {
    padding: 6px 10px calc(var(--safe-bottom) + 10px);
    max-height: min(54vh, 368px);
  }

  .sheet.sheet-detail-mode {
    padding: 6px 10px calc(var(--safe-bottom) + 10px);
    max-height: min(62vh, 460px);
  }

  .sheet.sheet-filter-mode {
    padding: 6px 10px calc(var(--safe-bottom) + 10px);
    max-height: min(62vh, 420px);
  }

  .sheet-handle {
    margin-bottom: 10px;
  }

  .compact-form {
    gap: 4px;
  }

  .compact-type-grid {
    gap: 4px;
  }

  .compact-type-option {
    min-height: 48px;
    padding: 4px 1px;
    font-size: 7px;
  }

  .compact-type-option .type-option-head {
    flex-direction: column;
    gap: 1px;
  }

  .compact-type-option .type-option-icon {
    width: 22px;
    height: 22px;
  }

  .compact-type-option .type-option-label {
    font-size: 6px;
    line-height: 1;
    word-break: break-word;
  }

  .compact-textarea,
  .detail-textarea {
    min-height: 40px;
    height: 40px;
    padding: 9px 10px;
    font-size: 12px;
  }

  .filter-grid {
    gap: 6px;
  }

  .filter-option {
    gap: 8px;
    padding: 10px;
  }

  .filter-option-icon {
    width: 22px;
    height: 22px;
  }

  .filter-option-label {
    font-size: 12px;
  }

  .detail-title-line {
    gap: 6px;
  }

  .detail-admin-actions {
    gap: 6px;
  }

  .detail-vote-group {
    width: 100%;
    gap: 6px;
  }

  .detail-vote-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 27px;
    padding: 0 7px;
    font-size: 10px;
  }

  .relevance-card {
    padding: 7px 8px;
  }

  .relevance-top {
    gap: 6px;
  }

  .relevance-percent {
    font-size: 15px;
  }

  .relevance-note,
  .relevance-subtitle,
  .relevance-stat {
    font-size: 10px;
  }

  .relevance-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .relevance-stats {
    justify-content: space-between;
  }

  .compact-entry-row,
  .detail-entry-row {
    gap: 6px;
  }

  .compact-entry-row .action-btn {
    flex-basis: 104px;
    min-height: 40px;
    font-size: 10px;
    padding: 0 8px;
  }

  .detail-entry-row .action-btn {
    flex-basis: 112px;
    min-height: 40px;
    font-size: 10px;
    padding: 0 8px;
  }

  .compact-note {
    font-size: 10px;
  }

  .admin-panel {
    inset: calc(var(--safe-top) + 6px) 6px calc(var(--safe-bottom) + 6px);
    border-radius: 24px;
  }

  .admin-header {
    padding: 16px 14px 12px;
  }

  .admin-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 12px 8px;
  }

  .tab-btn {
    min-height: 38px;
    padding: 0 8px;
    font-size: 12px;
  }

  .admin-body {
    padding: 12px;
  }

  .admin-relevance-box {
    gap: 7px;
    padding: 9px 10px;
  }

  .admin-relevance-percent {
    font-size: 16px;
  }

  .admin-relevance-summary,
  .admin-relevance-stats {
    font-size: 11px;
  }

  .marker-summary {
    grid-template-columns: 1fr;
  }

  .compact-comment-card {
    padding: 10px 11px;
  }
}
