:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d1d5db;
  --header: #e8eefc;
  --success-bg: #ecfdf5;
  --success-text: #065f46;
  --error-bg: #fef2f2;
  --error-text: #991b1b;
  --info-bg: #eff6ff;
  --info-text: #1d4ed8;
  --negative: #047857;
  --positive: #b91c1c;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 980px;
  margin: 32px auto;
  padding: 20px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

h1,
h2 {
  margin-top: 0;
}

h1 {
  font-size: 28px;
  margin-bottom: 10px;
}

h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.45;
}

.label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  font-size: 14px;
}

textarea,
.smart-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}

textarea {
  min-height: 150px;
  padding: 12px;
  resize: vertical;
  margin-bottom: 14px;
}

.smart-input {
  padding: 11px 12px;
}

button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
}

button:hover {
  background: var(--primary-hover);
}

.small-btn {
  padding: 7px 10px;
  font-size: 13px;
}

.danger-btn {
  background: #b91c1c;
}

.danger-btn:hover {
  background: #991b1b;
}

.save-btn {
  background: #059669;
}

.save-btn:hover {
  background: #047857;
}

.buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.secondary-btn {
  background: #6b7280;
}

.secondary-btn:hover {
  background: #4b5563;
}

.help-box,
.options-box,
.preset-block,
.history-block,
.mode-block,
.supported-block,
.smart-input-block {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.mode-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.mode-tab {
  background: #e5e7eb;
  color: var(--text);
}

.mode-tab:hover {
  background: #d1d5db;
}

.mode-tab.active {
  background: var(--primary);
  color: #ffffff;
}

.mode-description,
.section-note,
.option-note,
.smart-note,
.micro-note {
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.smart-input-head {
  margin-bottom: 8px;
}

.smart-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.smart-input-wrap {
  position: relative;
  flex: 1;
}

.suggestions-box {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.suggestions-box.hidden {
  display: none;
}

.suggestion-item {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  cursor: pointer;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: #eff6ff;
}

.suggestion-main {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 3px;
}

.suggestion-sub {
  font-size: 12px;
  color: var(--muted);
}

.help-box ol {
  margin: 8px 0 0 20px;
  padding: 0;
}

.help-box li {
  margin-bottom: 5px;
  font-size: 14px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 14px;
}

.status-box {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  font-weight: bold;
  font-size: 14px;
}

.status-box.info {
  background: var(--info-bg);
  color: var(--info-text);
  border-color: #bfdbfe;
}

.status-box.success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: #a7f3d0;
}

.status-box.error {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: #fecaca;
}

.dev-info-box {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.45;
}

.dev-info-box code {
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  background: #e8eefc;
  color: #1f2937;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.chip-btn:hover {
  background: #dbe7ff;
}

.chips-compact .chip-btn {
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.empty-chips {
  color: var(--muted);
  font-size: 14px;
}



.trust-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.trust-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.trust-card h2 {
  margin-bottom: 8px;
}

.trust-card-accent {
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
  border-color: #bfdbfe;
}

.trust-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.trust-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.trust-list li + li {
  margin-top: 6px;
}

.summary-strip {
  margin-bottom: 18px;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fbfdff;
  font-size: 13px;
}

.summary-table th,
.summary-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.summary-table th {
  background: var(--header);
  font-size: 12px;
  color: var(--muted);
}

.summary-table td {
  font-weight: bold;
  line-height: 1.3;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.compare-card {

  background: #f9fbff;
}

.summary-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.summary-value {
  font-size: 18px;
  font-weight: bold;
  line-height: 1.2;
}

.result-block {
  margin-top: 22px;
}

.compare-note {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 10px;
  font-size: 13px;
}

th,
td {
  border: 1px solid var(--border);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--header);
  font-size: 12px;
}

.empty-row {
  text-align: center;
  color: var(--muted);
}

.route-order {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
}

.route-order li {
  margin-bottom: 6px;
}

.list-empty {
  list-style: none;
  padding-left: 0;
}

.diff-negative {
  color: var(--negative);
  font-weight: bold;
}

.diff-positive {
  color: var(--positive);
  font-weight: bold;
}

.diff-neutral {
  color: var(--muted);
  font-weight: bold;
}


.route-points-block {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.route-points-head {
  margin-bottom: 10px;
}

.route-points-head h2 {
  margin-bottom: 0;
}

.route-points-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
}

.route-point-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: #1f2937;
  font-size: 13px;
  line-height: 1;
}

.route-point-chip:hover {
  background: #e0e7ff;
}

.route-point-chip-start {
  border-color: #93c5fd;
  background: #dbeafe;
}

.route-point-chip-start {
  border-color: #93c5fd;
  background: #dbeafe;
}

.route-point-badge {
  flex-shrink: 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: bold;
}

.route-point-text {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-point-remove {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: bold;
  opacity: 0.75;
}

.checkbox-line-muted {
  margin-top: 2px;
}

.compact-note {
  margin-bottom: 10px;
}



.launch-strip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
}

.launch-pill {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 12px;
  font-weight: bold;
  line-height: 1.2;
}

.launch-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

.feedback-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}

.feedback-copy {
  min-width: 0;
}

.feedback-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.feedback-hint {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: bold;
}

.feedback-link:hover {
  background: var(--primary-hover);
}

.feedback-link-ghost {
  background: #e8eefc;
  color: var(--text);
  border: 1px solid #c7d2fe;
}

.feedback-link-ghost:hover {
  background: #dbe7ff;
}

@media (max-width: 640px) {
  .route-point-text {
    max-width: 190px;
  }


  .buttons,
  .section-head,
  .smart-input-row {
    flex-direction: column;
    align-items: stretch;
  }

  button {
    width: 100%;
  }

  .trust-grid,
  .summary-grid,
  .compare-grid {
    grid-template-columns: 1fr;
  }
}


.limit-box {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.45;
}

.limit-box.hidden {
  display: none;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.compare-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.status-box.warn {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fdba74;
}


.help-box-embedded {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

.input-format-line {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fbff;
  border: 1px dashed #bfdbfe;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}

.summary-grid,
.compare-grid {
  gap: 8px;
  margin-bottom: 14px;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.compare-grid {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

.summary-card,
.compare-card {
  padding: 8px 10px;
  min-height: 0;
  border-radius: 9px;
}

.summary-card-accent {
  padding: 10px 12px;
}

.summary-title {
  font-size: 11px;
  margin-bottom: 4px;
}

.summary-value {
  font-size: 15px;
  line-height: 1.15;
}

#headlineValue {
  font-size: 16px;
}

.info-drawer {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
}

.info-drawer summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-weight: bold;
  font-size: 14px;
  background: #f8fafc;
}

.info-drawer summary::-webkit-details-marker {
  display: none;
}

.info-drawer summary::after {
  content: '▾';
  float: right;
  color: var(--muted);
}

.info-drawer[open] summary::after {
  content: '▴';
}

.info-drawer-body {
  padding: 0 14px 14px;
}

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

.info-drawer-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.info-drawer-card-accent {
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
  border-color: #bfdbfe;
}

.info-drawer-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.dev-info-box-embedded {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #1e3a8a;
}



.launch-strip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
}

.launch-pill {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 12px;
  font-weight: bold;
  line-height: 1.2;
}

.launch-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

.feedback-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}

.feedback-copy {
  min-width: 0;
}

.feedback-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.feedback-hint {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: bold;
}

.feedback-link:hover {
  background: var(--primary-hover);
}

.feedback-link-ghost {
  background: #e8eefc;
  color: var(--text);
  border: 1px solid #c7d2fe;
}

.feedback-link-ghost:hover {
  background: #dbe7ff;
}

@media (max-width: 640px) {
  .info-drawer-grid {
    grid-template-columns: 1fr;
  }
}

.summary-table td,
.summary-table th {
  word-break: break-word;
}

@media (max-width: 640px) {
  .summary-table,
  .summary-table thead,
  .summary-table tbody,
  .summary-table tr,
  .summary-table th,
  .summary-table td {
    display: block;
    width: 100%;
  }

  .summary-table thead {
    display: none;
  }

  .summary-table tr {
    border-bottom: 1px solid var(--border);
  }

  .summary-table td {
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 8px 10px;
  }

  .summary-table td::before {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: normal;
    color: var(--muted);
  }

  .summary-table td:nth-child(1)::before { content: "Режим"; }
  .summary-table td:nth-child(2)::before { content: "Старт"; }
  .summary-table td:nth-child(3)::before { content: "Точек после старта"; }
  .summary-table td:nth-child(4)::before { content: "Улучшенный маршрут"; }
  .summary-table td:nth-child(5)::before { content: "Время маршрута"; }
  .summary-table td:nth-child(6)::before { content: "Метод расчета"; }
}
