:root {
  --dark: #15354d;
  --ink: #173045;
  --muted: #526679;
  --blue: #0964ac;
  --line: #dce6ec;
  --soft: #f3f8fa;
  --green: #e7f6ef;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
  background: #f0f5f7;
  color: var(--ink);
  font: 18px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: 100px;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

button,
input,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--blue);
}

:focus-visible {
  outline: 3px solid #f3a715;
  outline-offset: 3px;
}

.container {
  max-width: 970px;
  margin: auto;
  padding: 0 17px;
  width: 100%;
}

.compact-header {
  background: linear-gradient(135deg, #0c2336, #134c5e);
  color: white;
  padding: 14px 0 16px;
  border-bottom: 1px solid #1c5b6e;
  box-shadow: 0 4px 20px rgba(10, 31, 48, 0.15);
}

.header-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.route-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.header-title-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #187053;
  color: #e8fbf3;
  padding: 3px 9px;
  border-radius: 20px;
}

.header-route {
  font-size: clamp(16px, 4vw, 22px);
  font-weight: 800;
  margin: 0;
  color: #ffffff;
  line-height: 1.2;
}

.header-route .arrow {
  color: #64dfdf;
  margin: 0 2px;
}

.header-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.meta-pill {
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 3px 9px;
  border-radius: 20px;
  color: #e9f4f8;
}

.meta-carryon {
  background: rgba(24, 112, 83, 0.35);
  border-color: #2ea880;
  color: #b2fad9;
}

.clocks-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  width: 100%;
}

.clock-card {
  background: rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 9px 12px;
  color: white;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease;
  min-width: 0;
  overflow: hidden;
}

.clock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 3px;
}

.clock-city {
  font-size: 12px;
  font-weight: 750;
  color: #d4e9f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clock-code {
  font-size: 10px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.22);
  padding: 1px 6px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}

.clock-time {
  font-size: clamp(18px, 4.2vw, 24px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  line-height: 1.18;
}

.clock-date {
  font-size: 11px;
  color: #badcf0;
  margin-top: 2px;
}

.clock-role {
  font-size: 10px;
  color: #a6edd4;
  font-weight: 750;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dashboard-hub {
  margin: 16px 0 20px;
  outline: none;
  scroll-margin-top: 14px;
  border-radius: 18px;
  transition: box-shadow 0.3s ease;
}

.dashboard-hub:focus,
.dashboard-hub.hub-highlight {
  box-shadow: 0 0 0 3px rgba(243, 167, 21, 0.9), 0 8px 30px rgba(18, 59, 87, 0.15);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.dash-tile {
  background: white;
  border: 1.5px solid #d4e3ed;
  border-radius: 16px;
  padding: 12px 14px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 3px 12px rgba(18, 59, 87, 0.04);
  transition: all 0.18s ease;
  position: relative;
}

.dash-tile:hover {
  border-color: #0964ac;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(9, 100, 172, 0.14);
}

.dash-tile:active {
  transform: translateY(0);
  background: #f6fafd;
}

.dash-tile-icon {
  font-size: 24px;
  line-height: 1;
  background: #ebf4fa;
  padding: 7px;
  border-radius: 12px;
  flex: none;
}

.dash-tile-info {
  flex: 1;
  min-width: 0;
}

.dash-tile-title {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #123955;
  line-height: 1.2;
}

.dash-tile-desc {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-arrow {
  font-size: 15px;
  color: #0964ac;
  font-weight: 800;
  transition: transform 0.15s ease;
}

.dash-tile:hover .dash-arrow {
  transform: translateX(3px);
}

.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid #d8e5ee;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  z-index: 90;
  box-shadow: 0 -4px 20px rgba(18, 59, 87, 0.09);
}

.mob-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #456073;
  padding: 5px 2px;
  border-radius: 10px;
  transition: all 0.15s ease;
}

.mob-tab:active {
  background: #e7f3fa;
  transform: scale(0.95);
  color: #0964ac;
}

.mob-tab-icon {
  font-size: 20px;
  line-height: 1;
}

.mob-tab-label {
  font-size: 11px;
  font-weight: 750;
  margin-top: 2px;
}

main {
  padding: 15px 0 50px;
}

.notice {
  background: #fff8e8;
  border: 1px solid #eedcb7;
  border-left: 6px solid #d39118;
  padding: 15px 18px;
  border-radius: 13px;
}

.notice p {
  margin: 5px 0 0;
}

.title {
  font-size: 24px;
  margin: 22px 0 12px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.step {
  border: 2px solid var(--line);
  border-radius: 15px;
  background: #fff;
  padding: 12px;
  min-height: 77px;
  text-align: left;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 11px;
}

.step.active {
  background: #e6f5ef;
  border-color: #187053;
}

.number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  font-weight: 800;
  background: #e2edf3;
}

.step.active .number {
  background: #187053;
  color: white;
}

.step b,
.step small {
  display: block;
}

.step small {
  font-size: 13px;
  color: var(--muted);
}

.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 19px;
  box-shadow: 0 9px 30px #123b5712;
  padding: 24px;
  margin-top: 18px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.card h2 {
  font-size: clamp(25px, 4vw, 34px);
  margin: 6px 0 12px;
  line-height: 1.18;
}

.card h3 {
  font-size: 20px;
  margin: 22px 0 12px;
}

.tag {
  background: var(--green);
  color: #16583c;
  border-radius: 50px;
  padding: 5px 12px;
  font-size: 14px;
  font-weight: 800;
}

.lead {
  font-size: 19px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
  width: 100%;
}

.fact {
  background: var(--soft);
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  padding: 12px 14px;
  border-radius: 12px;
}

.fact small {
  color: var(--muted);
  display: block;
}

.fact b {
  display: block;
}

.task {
  display: flex;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 13px;
  border-radius: 12px;
  margin: 9px 0;
  cursor: pointer;
}

.task:has(input:checked) {
  background: #eff9f2;
}

.task input {
  width: 23px;
  height: 23px;
  flex: none;
  margin-top: 2px;
  accent-color: #187053;
}

.buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--blue);
  background: var(--blue);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 750;
  padding: 10px 15px;
}

.button.alt {
  background: white;
  color: var(--blue);
}

.tip {
  background: #ebf5fa;
  border-left: 5px solid #267fa3;
  border-radius: 9px;
  padding: 15px 17px;
  margin-top: 18px;
}

.tip p {
  margin: 7px 0;
}

.highlight {
  background: #fff8e8;
  border-left: 5px solid #d39118;
  border-radius: 9px;
  padding: 12px 16px;
  margin-top: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  width: 100%;
}

.grid .card {
  margin-top: 0;
}

.small {
  font-size: 15px;
  color: var(--muted);
}

details {
  background: white;
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 14px;
  margin-top: 24px;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

label.field {
  display: block;
  margin: 16px 0 5px;
  font-weight: 700;
}

input[type="tel"],
input[type="text"] {
  border: 2px solid #b7c9d5;
  border-radius: 10px;
  padding: 12px;
  width: 100%;
  background: white;
  color: var(--ink);
}

#toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #15354d;
  color: white;
  border-radius: 10px;
  padding: 10px 16px;
  display: none;
  z-index: 95;
}

details#settings {
  background: linear-gradient(145deg, #ffffff, #f5f9fc);
  border: 2px solid #b7d6ea;
  border-radius: 20px;
  padding: 0;
  margin-top: 28px;
  box-shadow: 0 10px 30px rgba(18, 59, 87, 0.08);
  overflow: hidden;
  transition: all 0.25s ease;
}

details#settings[open] {
  border-color: #5ea8db;
  box-shadow: 0 14px 38px rgba(18, 59, 87, 0.12);
}

summary.family-summary {
  padding: 20px 24px;
  background: linear-gradient(90deg, #f0f7fb, #ffffff);
  border-bottom: 1px solid #dce8ef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}

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

.family-summary-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.family-icon {
  font-size: 32px;
  line-height: 1;
  background: #e2f1fc;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid #c2e1f5;
}

.family-title {
  margin: 0;
  font-size: 22px;
  color: #123e62;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.family-subtitle {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

.family-badge {
  font-size: 13px;
  font-weight: 800;
  background: #0964ac;
  color: white;
  padding: 6px 14px;
  border-radius: 50px;
  white-space: nowrap;
}

.family-body {
  padding: 22px 24px 26px;
}

.family-intro {
  margin: 0 0 18px;
  color: #486173;
  font-size: 15px;
  line-height: 1.5;
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
  width: 100%;
}

.family-card-box {
  background: white;
  border: 1.5px solid #dbe6ee;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 3px 12px rgba(18, 59, 87, 0.03);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.family-card-box.full-width {
  grid-column: 1 / -1;
}

.family-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px dashed #e2edf3;
  padding-bottom: 10px;
}

.family-card-head h4 {
  margin: 0;
  font-size: 17px;
  color: #133954;
}

.badge-role {
  font-size: 12px;
  font-weight: 750;
  background: #e6f5ef;
  color: #16583c;
  padding: 3px 10px;
  border-radius: 12px;
}

.badge-gold {
  background: #fff4db;
  color: #8c6007;
}

.field-group {
  margin-bottom: 12px;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-group label.field {
  margin: 0 0 5px;
  font-size: 14px;
  color: #344c5e;
}

.field-group input {
  border: 1.5px solid #bcd1df;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field-group input:focus {
  border-color: #0964ac;
  box-shadow: 0 0 0 3px rgba(9, 100, 172, 0.15);
  outline: none;
}

.family-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.family-quick-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #e9f6ef;
  border: 1.5px solid #a8dfc2;
  border-radius: 14px;
  padding: 12px 16px;
  text-decoration: none;
  color: #125437;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s;
  min-width: 0;
  max-width: 100%;
}

.family-quick-card:hover {
  background: #d8f1e2;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 112, 83, 0.15);
}

.family-quick-card small {
  display: block;
  font-size: 12px;
  color: #2b7050;
  font-weight: 600;
}

.family-quick-card b {
  font-size: 16px;
  color: #0d432b;
}

.family-quick-btn-tag {
  background: #187053;
  color: white;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 10px;
}

.family-footer-actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.save-btn {
  background: #0964ac;
  border: 2px solid #0964ac;
  box-shadow: 0 4px 14px rgba(9, 100, 172, 0.25);
  font-size: 16px;
  padding: 12px 22px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.save-btn:hover {
  background: #07508a;
  border-color: #07508a;
}

.save-btn.is-hidden,
.family-footer-actions.is-hidden {
  display: none !important;
}

.save-status-hint {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
}

.phrase-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0 20px;
}

.phrase-filter-btn {
  background: white;
  border: 1.5px solid #c9dae5;
  color: #1d394e;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.phrase-filter-btn.active {
  background: #0964ac;
  color: white;
  border-color: #0964ac;
  box-shadow: 0 3px 10px rgba(9, 100, 172, 0.25);
}

.phrases {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 14px;
}

.phrase-card {
  background: linear-gradient(180deg, #ffffff, #f9fcfd);
  border: 1.5px solid #d3e2ec;
  border-radius: 16px;
  padding: 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 0 3px 10px rgba(18, 59, 87, 0.04);
  width: 100%;
  font: inherit;
}

.phrase-card:hover {
  transform: translateY(-3px);
  border-color: #0964ac;
  box-shadow: 0 8px 24px rgba(9, 100, 172, 0.15);
}

.phrase-card:active {
  transform: translateY(0);
}

.phrase-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.phrase-badge {
  background: #e7f3fa;
  color: #0964ac;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
}

.phrase-zoom-hint {
  font-size: 12px;
  font-weight: 700;
  color: #2c7453;
  background: #e7f6ef;
  padding: 3px 9px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.phrase-card .en {
  font-size: 18px;
  font-weight: 800;
  color: #0f324d;
  line-height: 1.35;
  margin: 0 0 8px;
}

.phrase-card .ru {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}

.clickable-tip {
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.clickable-tip:hover {
  background: #dbebf5;
  transform: translateY(-1px);
}

.clickable-tip::after {
  content: '🔍 Нажмите для крупного текста на весь экран';
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #0964ac;
  margin-top: 8px;
}

dialog.phrase-modal {
  border: none;
  border-radius: 24px;
  padding: 0;
  max-width: 580px;
  width: calc(100% - 32px);
  box-shadow: 0 25px 60px rgba(14, 38, 59, 0.4);
  animation: popModal 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  background: white;
}

dialog.phrase-modal::backdrop {
  background: rgba(14, 38, 59, 0.72);
  backdrop-filter: blur(6px);
}

@keyframes popModal {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-card {
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: #f2f7fb;
  border-bottom: 1px solid #dce8ef;
}

.modal-tag {
  font-size: 14px;
  font-weight: 800;
  color: #0964ac;
  background: #e1f0fa;
  padding: 5px 14px;
  border-radius: 20px;
}

.modal-close-btn {
  border: none;
  background: #e2edf4;
  color: #173045;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: #d0e2ed;
  transform: scale(1.05);
}

.modal-body {
  padding: 26px 24px;
}

.modal-hint-banner {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0d5939;
  background: #e7f6ef;
  padding: 7px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: inline-block;
}

.modal-en {
  font-size: clamp(24px, 5.5vw, 34px);
  font-weight: 800;
  color: #0e2f49;
  line-height: 1.32;
  margin: 0 0 18px;
  word-wrap: break-word;
}

.modal-divider {
  height: 1px;
  background: #e4edf3;
  margin: 16px 0;
}

.modal-ru {
  font-size: 18px;
  color: #506575;
  line-height: 1.45;
  margin: 0;
}

.modal-footer {
  padding: 16px 24px 20px;
  background: #f9fcfd;
  border-top: 1px solid #e7eff4;
  display: flex;
  justify-content: stretch;
}

.modal-done-btn {
  width: 100%;
  font-size: 16px;
  font-weight: 800;
}

/* Return-to-start button: brings the page back to the route menu */
.home-fab {
  position: fixed;
  z-index: 96;
  right: 14px;
  bottom: 22px;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.home-fab.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: none;
}

.home-fab-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 86px;
  min-height: 86px;
  padding: 8px 6px 10px;
  border: 0;
  border-radius: 22px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(160deg, #0c2336 0%, #0e5c68 100%);
  box-shadow: 0 12px 28px rgba(12, 35, 54, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font: inherit;
  text-align: center;
  line-height: 1.05;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.home-fab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(12, 35, 54, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.home-fab-btn:active {
  transform: translateY(0) scale(0.96);
}

.home-fab-arrow {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #0c2336;
}

.home-fab.is-homing .home-fab-arrow {
  animation: homeNudge 0.55s ease;
}

@keyframes homeNudge {
  0% { transform: translateY(0); }
  45% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

.home-fab-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-fab-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.home-fab-sub {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .home-fab-btn,
  .home-fab-arrow {
    transition: none;
    animation: none !important;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
    font-size: 16px;
  }
  .container {
    padding: 0 15px;
    width: 100%;
  }
  .compact-header {
    padding: 12px 0 14px;
  }
  .header-main-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .route-badge-group {
    width: 100%;
  }
  .header-route {
    font-size: clamp(16px, 4.6vw, 20px);
    line-height: 1.25;
    word-break: normal;
    overflow-wrap: break-word;
  }
  .header-meta {
    width: 100%;
    gap: 6px;
  }
  .clocks-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
    width: 100%;
  }
  .clock-card {
    padding: 7px 4px;
    border-radius: 12px;
    min-width: 0;
    overflow: hidden;
  }
  .clock-head {
    gap: 2px;
    margin-bottom: 2px;
  }
  .clock-city {
    font-size: 10.5px;
    letter-spacing: -0.01em;
  }
  .clock-code {
    font-size: 8.5px;
    padding: 1px 3px;
    border-radius: 4px;
  }
  .clock-time {
    font-size: clamp(13px, 3.8vw, 17px);
    letter-spacing: -0.02em;
    white-space: nowrap;
  }
  .clock-date {
    font-size: 9.5px;
  }
  .clock-role {
    display: none;
  }
  .mobile-bottom-bar {
    display: grid;
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
  }
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }
  .dash-tile {
    padding: 10px 10px;
    gap: 8px;
    border-radius: 14px;
    min-width: 0;
    overflow: hidden;
  }
  .dash-tile-icon {
    font-size: 20px;
    padding: 6px;
    border-radius: 10px;
    flex-shrink: 0;
  }
  .dash-tile-info {
    min-width: 0;
    flex: 1;
  }
  .dash-tile-title {
    font-size: 13.5px;
    line-height: 1.25;
    word-break: break-word;
  }
  .dash-tile-desc {
    font-size: 11px;
    line-height: 1.2;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .dash-arrow {
    display: none;
  }
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }
  .step {
    min-height: 58px;
    padding: 9px 10px;
    gap: 8px;
    min-width: 0;
    border-radius: 14px;
  }
  .step .number {
    width: 28px;
    height: 28px;
    font-size: 13px;
    flex-shrink: 0;
  }
  .step span:last-child {
    min-width: 0;
    flex: 1;
  }
  .step b {
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
  .step small {
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
  .card {
    padding: 16px;
    border-radius: 16px;
    margin-top: 14px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .card h2 {
    font-size: clamp(21px, 5.2vw, 26px);
  }
  .card h3 {
    font-size: 18px;
    margin: 18px 0 10px;
  }
  .lead {
    font-size: 16px;
    line-height: 1.45;
  }
  .facts {
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 14px 0;
    width: 100%;
  }
  .fact {
    padding: 10px 12px;
    border-radius: 10px;
    min-width: 0;
  }
  .task {
    padding: 11px 12px;
    gap: 10px;
    font-size: 15px;
    border-radius: 11px;
    min-width: 0;
    word-break: break-word;
  }
  .task span:first-child {
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1.2;
  }
  .task input[type="checkbox"] {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
  }
  .buttons {
    flex-direction: column;
    width: 100%;
    gap: 8px;
    margin-top: 16px;
  }
  .buttons .button,
  .buttons a.button,
  .buttons button.button {
    width: 100%;
    text-align: center;
    justify-content: center;
    min-height: 48px;
    box-sizing: border-box;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
  }
  .grid .card {
    margin-top: 0;
  }
  .phrase-filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    margin: 12px -15px 16px;
    padding-left: 15px;
    padding-right: 15px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .phrase-filters::-webkit-scrollbar {
    display: none;
  }
  .phrase-filter-btn {
    flex-shrink: 0;
    padding: 7px 14px;
    font-size: 13px;
    white-space: nowrap;
  }
  .phrases {
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
  }
  .phrase-card {
    padding: 15px;
    border-radius: 14px;
    min-width: 0;
    max-width: 100%;
  }
  .phrase-card .en {
    font-size: 16.5px;
    line-height: 1.35;
  }
  .phrase-card .ru {
    font-size: 14px;
    line-height: 1.35;
  }
  summary.family-summary {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .family-summary-left {
    gap: 10px;
    width: 100%;
  }
  .family-icon {
    font-size: 26px;
    padding: 6px;
    border-radius: 10px;
    flex-shrink: 0;
  }
  .family-title {
    font-size: 18px;
    line-height: 1.25;
  }
  .family-subtitle {
    font-size: 12.5px;
    line-height: 1.35;
  }
  .family-badge {
    align-self: flex-start;
    font-size: 11.5px;
    padding: 4px 10px;
  }
  .family-body {
    padding: 14px 16px 18px;
  }
  .family-quick-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
  }
  .family-quick-card {
    padding: 10px 12px;
    gap: 8px;
    border-radius: 12px;
    min-width: 0;
    max-width: 100%;
  }
  .family-quick-card span:first-child {
    min-width: 0;
    flex: 1;
  }
  .family-quick-card b {
    font-size: 14px;
    word-break: break-all;
    display: block;
  }
  .family-quick-btn-tag {
    font-size: 12px;
    padding: 5px 10px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .family-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
  }
  .family-card-box {
    padding: 14px;
    border-radius: 14px;
    min-width: 0;
    max-width: 100%;
  }
  .save-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  dialog.phrase-modal {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 32px);
    border-radius: 20px;
    margin: auto;
  }
  .modal-head {
    padding: 14px 16px;
  }
  .modal-body {
    padding: 18px 16px;
    max-height: calc(100dvh - 145px);
    overflow-y: auto;
  }
  .modal-en {
    font-size: clamp(20px, 5.5vw, 26px);
    line-height: 1.3;
  }
  .modal-ru {
    font-size: 15.5px;
  }
  .modal-footer {
    padding: 12px 16px 16px;
  }
  .home-fab {
    right: 12px;
    bottom: calc(64px + env(safe-area-inset-bottom));
  }
  .home-fab-btn {
    width: 46px;
    height: 46px;
    min-height: 46px;
    border-radius: 50%;
    padding: 0;
    box-shadow: 0 8px 22px rgba(12, 35, 54, 0.35);
  }
  .home-fab-arrow {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
  }
  .home-fab-copy {
    display: none;
  }
}

@media (max-width: 440px) {
  .container {
    padding: 0 12px;
  }
  .phrase-filters {
    margin: 12px -12px 16px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .card {
    padding: 14px 12px;
    border-radius: 14px;
  }
  .notice {
    padding: 12px 13px;
    border-radius: 12px;
    font-size: 15px;
  }
  .dash-tile-desc {
    display: none;
  }
  .dash-tile {
    padding: 9px 8px;
    gap: 6px;
  }
  .dash-tile-icon {
    font-size: 18px;
    padding: 5px;
  }
  .dash-tile-title {
    font-size: 12.5px;
  }
  .steps {
    gap: 6px;
  }
  .step {
    padding: 8px 7px;
    min-height: 52px;
    gap: 6px;
  }
  .step .number {
    width: 25px;
    height: 25px;
    font-size: 12px;
  }
  .step b {
    font-size: 12.5px;
  }
  .step small {
    font-size: 10.5px;
  }
  .clock-time {
    font-size: 13px;
  }
  .task {
    padding: 10px 11px;
    font-size: 14.5px;
  }
}

@media print {
  body {
    background: white;
    font-size: 14px;
  }
  .compact-header {
    background: white;
    color: black;
  }
  .compact-header p,
  .overline {
    color: black;
  }
  .toplinks,
  .steps,
  .buttons,
  details,
  #toast,
  dialog,
  .phrase-filters,
  .dashboard-hub,
  .mobile-bottom-bar,
  .home-fab {
    display: none !important;
  }
  .card {
    box-shadow: none;
    break-inside: avoid;
  }
  .phrase-card {
    break-inside: avoid;
  }
}
