* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family:
    "DM Sans",
    "Segoe UI",
    system-ui,
    sans-serif;
  background: #f0f4f8;
  color: #1e293b;
}

/* ── Nav ── */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: clamp(72px, 9.5vh, 104px);
  padding: 0 clamp(16px, 1.8vw, 32px);
  background: transparent;
}
.nav-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: clamp(48px, 6.6vh, 72px);
  padding: 0 clamp(16px, 1.8vw, 36px);
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  font-size: clamp(16px, 1.35vw, 26px);
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
  user-select: none;
  white-space: nowrap;
  background: #fff;
  color: #475569;
  text-decoration: none;
}
.btn:active {
  opacity: 0.85;
}

.btn-lang {
  min-width: clamp(120px, 9.4vw, 180px);
}
.btn-lang .flag {
  width: clamp(24px, 2vw, 36px);
  height: clamp(24px, 2vw, 36px);
  object-fit: contain;
  margin-right: 6px;
  flex-shrink: 0;
}
.btn-lang.active,
.btn-lang:hover {
  background: #0077b6;
  border-color: #0077b6;
  color: #fff;
}

.btn-topic {
  min-width: clamp(140px, 11.5vw, 220px);
  font-size: clamp(17px, 1.45vw, 28px);
}
.btn-topic.active,
.btn-topic:hover {
  background: #0077b6;
  border-color: #0077b6;
  color: #fff;
}

/* ── Arrow buttons (in nav) ── */
.btn-arrow {
  width: clamp(48px, 6.6vh, 72px);
  height: clamp(48px, 6.6vh, 72px);
  aspect-ratio: 1 / 1;
  padding: 0;
  min-width: unset;
  border-radius: 50%;
  background: #0077b6;
  border: 2px solid #0077b6;
  color: #fff;
  font-size: clamp(18px, 1.6vw, 30px);
  transition:
    background 0.15s,
    border-color 0.15s;
}
.btn-arrow:hover {
  background: #005f8f;
  border-color: #005f8f;
}
.btn-arrow:active {
  opacity: 0.85;
}
.btn-arrow svg {
  width: 42%;
  height: 42%;
  display: block;
  flex-shrink: 0;
}

/* ── Content area ── */
.main {
  width: 100%;
  height: calc(100vh - clamp(72px, 9.5vh, 104px));
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0 clamp(10px, 1.1vw, 20px) clamp(10px, 1.1vw, 20px);
}
.content-area {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  overflow-y: auto;
  padding: clamp(14px, 1.4vw, 28px) clamp(20px, 2vw, 36px) clamp(20px, 2vw, 36px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.2vw, 22px);
}

/* ── Typography ── */
.screen-title {
  font-size: clamp(26px, 2.2vw, 42px);
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}
.screen-subtitle {
  font-size: clamp(15px, 1.2vw, 22px);
  color: #64748b;
}
.section-heading {
  font-size: clamp(18px, 1.5vw, 28px);
  font-weight: 700;
  color: #0077b6;
}

/* ── Grid layouts ── */
.row-top {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: clamp(12px, 1.2vw, 22px);
  margin-top: 40px;
}
.row-top > .col {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 0.8vw, 14px);
}
.row-top > .col > .info-card {
  flex: 1;
}
.row-bottom {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(12px, 1.2vw, 22px);
  margin-top: 30px;
}
.col {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 0.8vw, 14px);
}

/* ── Info card ── */
.info-card {
  background: #f8fafc;
  border-radius: 10px;
  padding: clamp(10px, 1vw, 18px) clamp(16px, 1.4vw, 26px);
  border: 1px solid #e2e8f0;
}
.info-card p,
.info-card li {
  font-size: clamp(16px, 1.15vw, 22px);
  color: #334155;
  line-height: 1.5;
}
.info-card ul {
  list-style: none;
  padding: 0;
}
.info-card li {
  padding: 3px 0;
}
.info-card a {
  color: #0077b6;
  font-size: clamp(16px, 1.15vw, 22px);
  text-decoration: none;
}
.info-card a:hover {
  text-decoration: underline;
}

/* ── Table ── */
.dest-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(14px, 1.15vw, 22px);
}
.dest-table th {
  text-align: left;
  color: #64748b;
  font-weight: 600;
  padding: 6px 10px;
  border-bottom: 2px solid #e2e8f0;
  font-size: clamp(14px, 1.05vw, 20px);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dest-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}
.dest-table tr:hover td {
  background: #f8fafc;
}

/* ── QR images ── */
.qr-img {
  display: block;
  width: clamp(80px, 6vw, 120px);
  height: clamp(80px, 6vw, 120px);
  border-radius: 8px;
  margin: 0 auto;
  flex-shrink: 0;
}
.route-qr .qr-img {
  width: clamp(80px, 7vw, 130px);
  height: clamp(80px, 7vw, 130px);
}

/* ── QR placeholder (fallback) ── */
.qr-placeholder {
  width: clamp(80px, 6vw, 120px);
  height: clamp(80px, 6vw, 120px);
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  margin-top: 8px;
}

/* ── Ferry route cards ── */
.routes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 1.2vw, 22px);
  flex: 1;
  margin-top: 40px;
}
.route-card {
  background: #f8fafc;
  border-radius: 16px;
  padding: clamp(12px, 1.2vw, 22px) clamp(18px, 1.6vw, 30px);
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1vw, 18px);
  border: 1px solid #e2e8f0;
}
.route-name {
  font-size: clamp(24px, 2vw, 40px);
  font-weight: 800;
  color: #0f172a;
}
.route-carrier {
  font-size: clamp(16px, 1.2vw, 24px);
  color: #0077b6;
  font-weight: 600;
}
.route-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 0.8vw, 14px);
}
.detail-item {
  background: #fff;
  border-radius: 10px;
  padding: clamp(10px, 1vw, 18px) clamp(16px, 1.4vw, 26px);
  border: 1px solid #e2e8f0;
}
.detail-label {
  font-size: clamp(11px, 0.8vw, 15px);
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 4px;
}
.detail-value {
  font-size: clamp(18px, 1.4vw, 28px);
  font-weight: 700;
  color: #0f172a;
}
.route-note {
  font-size: clamp(14px, 1.05vw, 20px);
  color: #64748b;
  line-height: 1.5;
}
.route-qr {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1vw, 18px);
  margin-top: auto;
  padding-top: clamp(10px, 1vw, 18px);
  border-top: 2px solid #e2e8f0;
}
.route-qr .qr-placeholder {
  width: clamp(80px, 7vw, 130px);
  height: clamp(80px, 7vw, 130px);
  margin-top: 0;
}
.qr-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.qr-text .qr-label {
  font-size: clamp(14px, 1.05vw, 20px);
  font-weight: 700;
  color: #1e293b;
}
.qr-text a {
  color: #0077b6;
  font-size: clamp(13px, 0.95vw, 18px);
  text-decoration: none;
  word-break: break-all;
}
.qr-text a:hover {
  text-decoration: underline;
}
.footer-info {
  font-size: clamp(15px, 1.1vw, 22px);
  color: #94a3b8;
  text-align: center;
  padding-top: clamp(8px, 0.8vh, 14px);
  border-top: 1px solid #e2e8f0;
}

/* ── City bus client placeholder (unused once real content replaces it) ── */
.client-section {
  flex: 1;
  background: #f8fafc;
  border-radius: 16px;
  border: 3px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}
.client-section .placeholder-label {
  font-size: clamp(20px, 1.6vw, 30px);
  font-weight: 700;
  color: #94a3b8;
}
.client-section .placeholder-hint {
  font-size: clamp(14px, 1vw, 20px);
  color: #cbd5e1;
}

/* ── TTS reader badge – fixed bottom-right on all pages ── */
.reader-badge {
  position: fixed;
  bottom: 20px;
  right: 24px;
  background: #03834A;
  color: #fff;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: clamp(13px, 1.1vw, 18px);
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  user-select: none;
  cursor: pointer;
}
.reader-badge.active {
  display: flex;
}
.reader-badge .pulse {
  width: 10px;
  height: 10px;
  background: #FED500;
  border-radius: 50%;
  flex-shrink: 0;
  animation: reader-pulse 1s ease-in-out infinite;
}
@keyframes reader-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(1.5); }
}
