:root {
    /* لون هوية الدولة: يُعرَّف في <style> كل صفحة، وهذه القيم الافتراضية */
    --brand: #8A1538;
    --brand-rgb: 138, 21, 56;
    --brand-dark: #5A0E25;
    /* لون النص الملوّن على الخلفيات الفاتحة (يختلف عن --brand لدولة يحدد دليلها لوناً للنص) */
    --brand-text: var(--brand);
    --primary-brand: #ffffff;
    --primary-brand-text: var(--primary-brand);
    /* صبغات الهوية (rgba) تتبع لون الدولة في المظهرين، بينما --primary-brand أبيض في المظهر الداكن */
    --primary-brand-rgb: var(--brand-rgb);
    --primary-dark: #1e1e1e;
    --gold: #D4AF37;
    --gold-glow: rgba(212, 175, 55, 0.15);
    --bg-dark: #121212;
    --card-bg: #1e1e1e;
    --card-border: rgba(255, 255, 255, 0.06);
    --inner-bg: rgba(255, 255, 255, 0.03);
    --inner-border: rgba(255, 255, 255, 0.05);
    --text-light: #e0e0e0;
    --text-muted: #aaaaaa;
    --border-radius: 16px;
}

body.light-mode {
    --primary-brand: var(--brand);
    --primary-brand-text: var(--brand-text);
    --primary-brand-rgb: var(--brand-rgb);
    --primary-dark: var(--brand-dark);
    --bg-dark: #F9F7F1;
    --card-bg: #FFFFFF;
    --card-border: rgba(0, 0, 0, 0.08);
    --inner-bg: #fafafa;
    --inner-border: rgba(0, 0, 0, 0.05);
    --text-light: #1A1A1A;
    --text-muted: #505050;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    padding-bottom: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* الهيدر وشريط التنقل العلوي */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    width: 100%;
    padding: 10px 0 15px 0;
    margin-bottom: 18px;
    border-bottom: none;
}

.header-h1 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

.header-logo {
    font-size: 1.35rem;
    font-weight: 900;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}

.quick-actions-row {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

#themeToggleBtn,
.quick-access-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    padding: 0;
    line-height: 1;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    flex-shrink: 0;
}

#themeToggleBtn:hover,
.quick-access-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.15);
}

#themeToggleBtn:active,
.quick-access-btn:active {
    transform: scale(0.95);
}

/* البار العلوي (معلومات الطقس والصلاة) */
.top-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-top: 0;
    margin-bottom: 18px;
    border: 1px solid var(--card-border);
    width: 100%;
    gap: 10px;
    transition: background-color 0.3s, border-color 0.3s;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
}

.info-item.prayer {
    color: var(--primary-brand-text);
}

body:not(.light-mode) .info-item.prayer {
    color: var(--gold);
}

.info-item.weather {
    color: #d35400;
    flex-shrink: 0;
}

body:not(.light-mode) .info-item.weather {
    color: var(--gold);
}

.info-icon {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

.info-item.prayer {
    gap: 6px;
}

.info-item.weather {
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.prayer-lines {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.prayer-lines span {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.95;
    line-height: 1.25;
}

.weather-now {
    display: flex;
    align-items: center;
    gap: 4px;
}

.weather-city {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.9;
}

/* الأكورديون المخصص */
details.custom-accordion {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    margin-bottom: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    scroll-margin-top: 16px;
}

details.custom-accordion summary {
    padding: 16px 18px;
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--gold);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    user-select: none;
}

body.light-mode details.custom-accordion:not(.hero-section) > summary {
    color: var(--primary-brand-text);
}

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

.chevron-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

details.custom-accordion[open] > summary .chevron-icon {
    transform: rotate(-180deg);
}

details.custom-accordion .accordion-content {
    padding: 0 18px 18px 18px;
    color: var(--text-light);
}

/* البانر الرئيسي الفاخر */
.hero-section,
details.custom-accordion.hero-section {
    background: linear-gradient(135deg, var(--primary-dark), #121212);
    border-radius: var(--border-radius);
    padding: 0;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hero-section::before {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    height: 120px;
    background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.12) 0%, transparent 70%);
    opacity: 0.6;
    pointer-events: none;
}

.hero-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--gold);
    margin: 0;
    letter-spacing: -0.3px;
}

/* حاسبة الرحلة والتخطيط */
.trip-planner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 14px;
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 14px;
}

.planner-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.planner-group span,
.planner-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.planner-group strong {
    font-size: 1.05rem;
    color: #fff;
}

.planner-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    outline: none;
    text-align: center;
    width: 100%;
    font-size: 1rem;
    min-height: 44px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.planner-input:focus-visible {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.35);
}

.planner-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

.btn-launch {
    background: var(--gold);
    color: #121212;
    font-weight: 900;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    font-size: 1rem;
    min-height: 48px;
}

.btn-launch:hover {
    background: #b39025;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* العناوين والأقسام */
.section-header {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    margin-top: 20px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-inline-start: 4px solid var(--gold);
    padding-inline-start: 12px;
}

/* كروت المسارات التفاعلية */
.carousel-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.route-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 18px;
    transition: transform 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.route-card:hover {
    transform: translateY(-3px);
    border-color: rgba(212, 175, 55, 0.3);
}

.route-card h3 {
    font-size: 1.05rem;
    color: #fff;
    margin-bottom: 10px;
    font-weight: 800;
}

.route-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.route-badge {
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1.5px solid rgba(212, 175, 55, 0.2);
    display: inline-block;
}

.route-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(212, 175, 55, 0.25);
    transition: all 0.3s ease;
    min-height: 40px;
}

.route-card-link:hover {
    background: var(--gold);
    color: #121212;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* شبكة المحطات المفصلة */
.stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 16px;
    margin-top: 8px;
}

.station-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s;
}

.station-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
}

.station-card h3 {
    font-size: 1.05rem;
    color: #fff;
    margin-bottom: 6px;
    font-weight: 800;
}

.station-card p {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.distance-badge-dark {
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
    align-self: flex-start;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.btn-station-map {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
    margin-top: auto;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-station-map:hover {
    background: var(--gold);
    color: #121212;
    border-color: var(--gold);
}

/* أنماط البطاقات المميزة (مطعم البيك / الميقات) بدون inline styles */
.station-card.station-card-food {
    border: 2px solid #e74c3c;
    background: rgba(231, 76, 60, 0.05);
}

.station-card.station-card-food h3 {
    color: #e74c3c;
}

.station-card.station-card-food .btn-station-map {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #ffffff;
}

.distance-badge-dark.badge-food {
    background: rgba(231, 76, 60, 0.12);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.25);
}

.distance-badge-dark.badge-miqat {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.2);
}

/* مجموعات محطات الرياض */
.riyadh-inner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 15px;
    margin-top: 12px;
}

/* قائمة الفحص الذكية بسحّابات (Switches) */
.checklist-wrapper {
    background: transparent;
    padding: 0;
    margin-top: 10px;
}

.progress-container {
    margin-bottom: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.progress-bar-bg {
    background: rgba(255, 255, 255, 0.06);
    height: 10px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--gold), #ffe596);
    width: 0%;
    height: 100%;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 12px;
}

.checklist-section-title {
    grid-column: 1 / -1;
    font-size: 1.02rem;
    color: var(--gold);
    font-weight: bold;
    margin-top: 14px;
    margin-bottom: 4px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
}

.switch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.3s;
    cursor: pointer;
    min-height: 50px;
}

.switch-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.switch-item.completed .switch-label {
    text-decoration: line-through;
    color: var(--text-muted);
}

.switch-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    line-height: 1.4;
}

/* سويتش الـ iOS الأنيق */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: .3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    inset-inline-start: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

input:checked + .slider:before {
    transform: translateX(-20px);
}

[dir="ltr"] input:checked + .slider:before {
    transform: translateX(20px);
}

.switch input:focus-visible + .slider {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* أزرار تحديد الكل بقائمة المهام */
.checklist-btn-group {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.checklist-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.3s;
    flex: 1;
    min-height: 42px;
}

.checklist-btn:hover {
    background: var(--gold);
    color: #121212;
}

/* قسم التطبيقات المهمة */
.apps-section .app-item {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.apps-section .app-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.apps-section .app-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.apps-section .app-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    flex-shrink: 0;
}

.apps-section .app-title {
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--gold);
    margin-bottom: 3px;
}

body.light-mode .apps-section .app-title {
    color: var(--primary-brand-text);
}

.apps-section .app-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.app-links {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.app-store-btn {
    background: var(--text-light);
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.app-store-btn:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.app-store-btn svg path {
    fill: var(--card-bg);
}

/* الأماكن التاريخية: دبوس ثم اسم المكان رابطاً إلى الخريطة */
.place-pin {
    margin-inline-end: 6px;
}

.place-link {
    color: var(--text-light);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(212, 175, 55, 0.6);
    text-underline-offset: 4px;
}

.place-link:hover {
    color: var(--gold);
}

body.light-mode .place-link:hover {
    color: var(--primary-brand-text);
}

/* أرقام الطوارئ */
.emergency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: 14px;
}

.emergency-box {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 18px 14px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.emergency-box.saudi {
    border-color: rgba(46, 204, 113, 0.2);
    background: rgba(46, 204, 113, 0.03);
}

.emergency-box.country-local {
    border-color: rgba(var(--primary-brand-rgb), 0.25);
    background: rgba(var(--primary-brand-rgb), 0.04);
}

.emergency-box h3 {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.emergency-number {
    font-size: 1.75rem;
    font-weight: 900;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 10px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.emergency-number:hover {
    transform: scale(1.04);
    background: rgba(255, 255, 255, 0.06);
}

.saudi .emergency-number {
    color: #2ecc71;
}

.country-local .emergency-number {
    color: var(--gold);
}

.flag-img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.25);
}

/* تنسيقات نموذج الاقتراحات (Suggestions Form) */
.suggestions-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: border-color 0.3s;
}

.suggestions-header {
    margin-bottom: 16px;
    text-align: center;
}

.suggestions-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.suggestion-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--text-light);
    margin-bottom: 6px;
}

.form-input,
.form-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 1rem; /* 16px يمنع التقريب التلقائي في iOS Safari */
    outline: none;
    transition: all 0.3s;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 110px;
}

.captcha-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin: 6px 0;
    max-width: 100%;
    overflow: hidden;
}

.btn-submit-container {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 6px;
}

.btn-submit-suggestion {
    background: var(--gold);
    color: #121212;
    font-weight: 900;
    border: none;
    padding: 12px 32px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit-suggestion:hover {
    background: #b39025;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.btn-submit-suggestion:disabled {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    box-shadow: none;
}

.suggestion-status {
    grid-column: 1 / -1;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.suggestion-status.success {
    display: block;
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.25);
}

.suggestion-status.error {
    display: block;
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.25);
}

/* الفوتر */
footer {
    text-align: center;
    padding: 28px 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 10px;
}

footer p {
    margin-bottom: 10px;
}

/* ====== أصناف دلالية (بديلة عن الأنماط الداخلية inline) ====== */
.hidden {
    display: none;
}

.accordion-title {
    font: inherit;
    color: inherit;
}

.summary-with-icon {
    display: flex;
    align-items: center;
}

.summary-with-icon svg {
    width: 22px;
    height: 22px;
    margin-inline-end: 8px;
}

details.custom-accordion.accordion-bypass {
    border-color: rgba(212, 175, 55, 0.35);
}

.hero-section .chevron-icon {
    color: var(--gold);
}

.header-title-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.last-updated {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: normal;
    margin-top: 2px;
}

.header-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
    line-height: 1.4;
    max-width: 92%;
}

.text-block {
    margin-bottom: 10px;
}

.text-block:last-child {
    margin-bottom: 0;
}

/* الصفحة الإنجليزية: نص الدعاء بالعربية ثم معناه */
.dua-arabic {
    display: block;
    margin-top: 6px;
    font-size: 1.05em;
    line-height: 1.9;
}

.dua-translation {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
}

/* زر تبديل اللغة (EN / ع) */
.lang-toggle {
    font-size: 0.82rem;
    font-weight: 800;
}

.coming-soon-actions > a[hreflang] {
    flex: 0 0 auto;
    min-width: 56px;
}

.section-intro {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.inline-link {
    text-decoration: underline;
    color: inherit;
    font-weight: bold;
}

.info-tip {
    margin-bottom: 8px;
}

.info-tip:last-child {
    margin-bottom: 0;
}

.info-divider {
    border-color: var(--card-border);
    margin: 14px 0;
    opacity: 0.5;
}

/* الحاسبة */
.planner-group .planner-highlight {
    color: var(--gold);
}

.planner-group .planner-total {
    font-size: 1.15rem;
}

.planner-group .planner-note {
    font-size: 0.72rem;
    opacity: 0.85;
    margin-top: 4px;
}

.planner-group .fuel-liters {
    font-size: 0.75rem;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.8);
}

.trip-planner-fuel {
    margin-bottom: 18px;
}

.btn-locate {
    margin-top: 6px;
    padding: 5px 12px;
    min-height: 32px;
    font-size: 0.78rem;
}

/* بطاقات المسارات */
.route-card .route-desc {
    margin-top: 6px;
}

.route-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

/* الأماكن التاريخية */
.places-wrap {
    margin-top: 8px;
}

.places-group {
    margin-bottom: 20px;
}

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

.places-title {
    margin: 0 0 12px 0;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.places-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.place-note {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 6px;
    margin-inline-start: 10px;
}

.place-extra {
    margin-top: 6px;
    margin-inline-start: 10px;
    font-size: 0.92em;
}

.place-extra-note {
    font-size: 0.9em;
    color: var(--text-muted);
}

/* أيقونات التطبيقات */
.apps-section .app-icon.app-icon-emoji {
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.apps-section .app-icon.app-icon-contain {
    background-color: #fff;
    padding: 6px;
    object-fit: contain;
}

/* قسم الطوارئ */
.emergency-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    margin-bottom: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    scroll-margin-top: 14px;
}

.emergency-body {
    padding: 18px;
}

.emergency-number.emergency-number-long {
    font-size: 1.4rem;
}

.emergency-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.required-mark {
    color: #e74c3c;
}

/* الفوتر */
.footer-greeting {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.footer-dua {
    font-size: 0.98rem;
    color: var(--gold);
    font-weight: bold;
    margin-bottom: 12px;
}

.footer-credit {
    opacity: 0.75;
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* صفحات «قريباً» */
.container.coming-soon {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.route-card.coming-soon-card {
    max-width: 480px;
    width: 100%;
    align-items: center;
    text-align: center;
    padding: 32px 24px;
}

.coming-soon-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.coming-soon-title {
    font-size: 1.4rem;
    color: var(--gold);
    margin-bottom: 12px;
}

.route-card .coming-soon-text {
    margin-bottom: 24px;
}

.coming-soon-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.coming-soon-actions > a {
    flex: 0 0 auto;
    text-decoration: none;
}

/* عناوين مراحل الرحلة (قبل السفر / في الطريق / في مكة والمدينة / العودة) */
.phase-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--gold);
    margin: 30px 0 14px;
    scroll-margin-top: 14px;
}

.phase-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

.phase-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gold);
    color: #121212;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

body.light-mode .phase-header {
    color: var(--primary-brand-text);
}

body.light-mode .phase-num {
    background: var(--primary-brand);
    color: #ffffff;
}

.section-header {
    scroll-margin-top: 14px;
}

/* بطاقة «رحلتي الآن»: ظاهرة دائماً أعلى الصفحة */
.hero-section.trip-now {
    padding: 16px 18px 18px;
    scroll-margin-top: 14px;
}

.trip-now .hero-title {
    margin-bottom: 12px;
}

.trip-now .trip-planner {
    grid-template-columns: 1fr 1fr;
    padding: 14px;
}

.trip-now .planner-group {
    justify-content: flex-start;
}

.trip-now .planner-group strong {
    font-size: 1rem;
}

.trip-now .trip-loc {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    text-align: start;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.trip-now .trip-loc-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 100px;
    min-width: 0;
}

.trip-now .btn-locate {
    flex: 0 0 auto;
    margin-top: 0;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.85rem;
}

/* زر تحديد الموقع فوق خلفية البانر الداكنة/الملوّنة في المظهرين */
.hero-section .btn-locate,
body.light-mode .hero-section .btn-locate {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.hero-section .btn-locate:hover,
body.light-mode .hero-section .btn-locate:hover {
    background: var(--gold);
    color: #121212;
    border-color: var(--gold);
}

/* تمييز الميقات: بطاقة المحطة وتنبيه أعلى القسم */
.station-card.station-card-miqat {
    border: 2px solid #2ecc71;
    background: rgba(46, 204, 113, 0.05);
}

.section-intro.miqat-note {
    color: var(--text-light);
    font-weight: 700;
    background: rgba(46, 204, 113, 0.08);
    border-inline-start: 4px solid #2ecc71;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

body.light-mode .station-card.station-card-miqat {
    border-color: #1b5e20;
    background: rgba(27, 94, 32, 0.04);
}

body.light-mode .section-intro.miqat-note {
    background: rgba(27, 94, 32, 0.06);
    border-inline-start-color: #1b5e20;
}

/* شريط التنقل السفلي الذكي للجوال (Mobile Sticky Bottom Nav) وقوائمه */
.mobile-bottom-nav,
.nav-sheet,
.nav-sheet-backdrop {
    display: none;
}

/* خيارات الثيم النهاري (Light Mode) */
body.light-mode .header-logo {
    color: var(--primary-brand-text);
    text-shadow: none;
}

body.light-mode #themeToggleBtn,
body.light-mode .quick-access-btn {
    background: #ffffff;
    color: var(--primary-brand-text);
    border: 1.5px solid var(--primary-brand);
    box-shadow: 0 2px 10px rgba(var(--primary-brand-rgb), 0.1);
}

body.light-mode #themeToggleBtn:hover,
body.light-mode .quick-access-btn:hover {
    background: rgba(var(--primary-brand-rgb), 0.06);
}

body.light-mode .hero-section,
body.light-mode details.custom-accordion.hero-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-brand));
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 30px rgba(var(--primary-brand-rgb), 0.15);
}

.emergency-header-title {
    padding: 16px 18px;
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--gold);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body.light-mode .emergency-header-title {
    color: var(--primary-brand-text);
}

body.light-mode .hero-title {
    color: #fff;
}

body.light-mode .hero-section .planner-group span,
body.light-mode .hero-section .planner-group label {
    color: rgba(255, 255, 255, 0.78);
}

body.light-mode .hero-section .planner-group strong,
body.light-mode .hero-section #currentLocationName,
body.light-mode .hero-section #remDist {
    color: #ffffff;
}

body.light-mode .hero-section #remTime {
    color: rgba(255, 255, 255, 0.9);
}

body.light-mode .section-header {
    color: var(--primary-brand-text);
    border-inline-start-color: var(--gold);
}

body.light-mode .route-card h3,
body.light-mode .station-card h3 {
    color: var(--primary-dark);
}

body.light-mode .route-card p strong,
body.light-mode .station-card p strong {
    color: var(--text-light);
}

body.light-mode .route-badge,
body.light-mode .distance-badge-dark {
    background: rgba(var(--primary-brand-rgb), 0.06);
    color: var(--primary-brand-text);
    border-color: rgba(var(--primary-brand-rgb), 0.2);
}

body.light-mode .distance-badge-dark.badge-miqat {
    color: #1b5e20;
    background: rgba(27, 94, 32, 0.06);
    border-color: rgba(27, 94, 32, 0.2);
}

body.light-mode .station-card.station-card-food h3 {
    color: #c0392b;
}

body.light-mode .btn-station-map,
body.light-mode .route-card-link,
body.light-mode .checklist-btn {
    background: rgba(var(--primary-brand-rgb), 0.05);
    color: var(--primary-brand-text);
    border: 1px solid rgba(var(--primary-brand-rgb), 0.18);
}

body.light-mode .btn-station-map:hover,
body.light-mode .route-card-link:hover,
body.light-mode .checklist-btn:hover {
    background: var(--primary-brand);
    color: #ffffff;
    border-color: var(--primary-brand);
}

body.light-mode .progress-bar-bg {
    background: rgba(0, 0, 0, 0.06);
}

body.light-mode .progress-bar-fill {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-brand));
    box-shadow: 0 0 8px rgba(var(--primary-brand-rgb), 0.3);
}

body.light-mode input:checked + .slider {
    background-color: var(--primary-brand);
    box-shadow: 0 0 8px rgba(var(--primary-brand-rgb), 0.3);
}

body.light-mode .checklist-section-title {
    color: var(--primary-brand-text);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .emergency-box.country-local {
    background: rgba(var(--primary-brand-rgb), 0.06);
    border-color: rgba(var(--primary-brand-rgb), 0.2);
}

body.light-mode .emergency-box.country-local h3 {
    color: var(--primary-brand-text);
}

body.light-mode .emergency-box.saudi {
    background: rgba(27, 94, 32, 0.04);
    border-color: rgba(27, 94, 32, 0.15);
}

body.light-mode .emergency-box.country-local .emergency-number {
    color: var(--primary-brand-text);
}

body.light-mode .emergency-box.saudi .emergency-number {
    color: #1b5e20;
}

body.light-mode .switch-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.04);
}

body.light-mode .slider {
    background-color: rgba(0, 0, 0, 0.15);
}

body.light-mode .suggestions-wrapper {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

body.light-mode .form-input,
body.light-mode .form-textarea {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--primary-dark);
}

body.light-mode .form-input:focus,
body.light-mode .form-textarea:focus {
    border-color: var(--primary-brand);
    background: #fff;
    box-shadow: 0 0 10px rgba(var(--primary-brand-rgb), 0.1);
}

body.light-mode .btn-submit-suggestion {
    background: var(--primary-brand);
    color: #fff;
}

body.light-mode .btn-submit-suggestion:hover {
    background: var(--primary-dark);
    box-shadow: 0 0 15px rgba(var(--primary-brand-rgb), 0.25);
}

body.light-mode footer {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-brand));
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 30px rgba(var(--primary-brand-rgb), 0.15);
}

body.light-mode .footer-credit {
    color: rgba(255, 255, 255, 0.75);
}

/*
 * تبديل المظهر: تُعطَّل الحركات الانتقالية لحظة التبديل حتى يتغير المظهر فوراً
 * بدل أن تتحرك ألوان مئات العناصر معاً. !important هنا مقصودة لأنها قاعدة مؤقتة تغلب كل transition.
 */
body.theme-switching,
body.theme-switching *,
body.theme-switching *::before,
body.theme-switching *::after {
    transition: none !important;
}

/* ====== تجاوب شاشات الجوال ====== */
@media (max-width: 768px) {
    body {
        padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    }

    .container {
        padding: 14px 12px;
    }

    details.custom-accordion {
        scroll-margin-top: 12px;
    }

    details.custom-accordion summary {
        padding: 14px 14px;
        font-size: 1rem;
    }

    details.custom-accordion .accordion-content {
        padding: 0 14px 16px 14px;
    }

    .hero-section.trip-now {
        padding: 14px 12px;
    }

    .trip-now .trip-planner {
        padding: 12px 10px;
        gap: 12px 8px;
    }

    .phase-header {
        font-size: 1.15rem;
        margin-top: 26px;
    }

    .suggestion-form {
        grid-template-columns: 1fr;
    }

    .btn-submit-suggestion {
        width: 100%;
    }

    /* شريط التنقل السفلي للجوال */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--card-bg);
        border-top: 1px solid var(--card-border);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
        padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px)) 8px;
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
    }

    .mobile-nav-btn {
        background: none;
        border: none;
        color: var(--text-muted);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        font-size: 0.72rem;
        font-weight: 700;
        cursor: pointer;
        padding: 6px 4px;
        border-radius: 10px;
        flex: 1 1 0;
        min-width: 0;
        min-height: 46px;
        transition: all 0.2s ease;
        text-decoration: none;
    }

    .mobile-nav-btn .nav-icon {
        font-size: 1.2rem;
        line-height: 1;
    }

    .mobile-nav-btn .nav-label {
        white-space: nowrap;
    }

    .mobile-nav-btn.active,
    .mobile-nav-btn[aria-expanded="true"] {
        color: var(--gold);
        background: rgba(212, 175, 55, 0.1);
    }

    body.light-mode .mobile-nav-btn.active,
    body.light-mode .mobile-nav-btn[aria-expanded="true"] {
        color: var(--primary-brand-text);
        background: rgba(var(--primary-brand-rgb), 0.08);
    }

    /* الطوارئ بلون أحمر ثابت ليُعثر عليها فوراً */
    .mobile-nav-btn.nav-emergency,
    body.light-mode .mobile-nav-btn.nav-emergency {
        color: #e74c3c;
    }

    body.light-mode .mobile-nav-btn.nav-emergency {
        color: #c0392b;
    }

    .mobile-nav-btn.nav-emergency.active,
    body.light-mode .mobile-nav-btn.nav-emergency.active {
        background: rgba(231, 76, 60, 0.12);
    }

    /* قوائم «المحطات» و«المزيد»: تظهر فوق الشريط وتُغلق بالضغط خارجها */
    .nav-sheet-backdrop.is-open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 998;
    }

    .nav-sheet.is-open {
        display: block;
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: calc(70px + env(safe-area-inset-bottom, 0px));
        max-height: 65vh;
        overflow-y: auto;
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: var(--border-radius);
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
        padding: 10px 12px;
        z-index: 999;
    }

    .nav-sheet-title {
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--text-muted);
        padding: 4px 4px 8px;
    }

    .nav-sheet-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        min-height: 48px;
        padding: 12px 4px;
        background: none;
        border: none;
        border-top: 1px solid var(--card-border);
        color: var(--text-light);
        font-family: inherit;
        font-size: 0.92rem;
        font-weight: 700;
        line-height: 1.4;
        text-align: start;
        cursor: pointer;
    }

    .nav-sheet-item.nav-sheet-sep {
        border-top: 2px solid var(--gold);
    }

    body.light-mode .nav-sheet-item.nav-sheet-sep {
        border-top-color: var(--primary-brand);
    }

    .nav-sheet-item.is-current::after {
        content: attr(data-here);
        flex-shrink: 0;
        font-size: 0.72rem;
        color: #2ecc71;
        white-space: nowrap;
    }

    body.light-mode .nav-sheet-item.is-current::after {
        color: #1b5e20;
    }
}

/* الشاشات الضيقة: تصغير خط وحشوات الشريط حتى تتسع أطول تسمية («مكة والمدينة») */
@media (max-width: 360px) {
    .mobile-bottom-nav {
        padding-inline: 4px;
    }

    .mobile-nav-btn {
        font-size: 0.66rem;
        padding-inline: 2px;
    }
}

@media (max-width: 420px) {
    .top-info-bar {
        padding: 10px 12px;
    }

    .info-item {
        font-size: 0.76rem;
        gap: 5px;
    }

    .apps-section .app-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .apps-section .app-links {
        width: 100%;
        justify-content: flex-end;
    }

    .apps-section .app-store-btn {
        flex: 1;
    }

    .captcha-container .h-captcha {
        transform: scale(0.9);
        transform-origin: center;
    }
}

/* ====== الطباعة ====== */
.print-only {
    display: none;
}

@media print {
    /*
     * ورق أبيض وحبر داكن أياً كان المظهر المختار على الشاشة (نهاري أو داكن).
     * !important هنا مقصودة: هذه القاعدة العامة يجب أن تغلب كل ألوان الشاشة مهما كانت خصوصية محدداتها،
     * وإلا طُبع نص أبيض على ورق أبيض (كما في قسم الحاسبة والفوتر).
     */
    *,
    *::before,
    *::after {
        color: #1a1a1a !important;
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        padding-bottom: 0;
    }

    .container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    /* عناصر تفاعلية لا معنى لها على الورق */
    .quick-actions-row,
    .mobile-bottom-nav,
    .nav-sheet,
    .nav-sheet-backdrop,
    .suggestions-wrapper,
    .checklist-btn-group,
    .progress-container,
    .btn-station-map,
    .route-card-link,
    .route-switch,
    .route-card-select,
    .btn-launch,
    .btn-locate,
    .app-links,
    .chevron-icon,
    .switch,
    .hero-section::before {
        display: none;
    }

    .print-only {
        display: block;
        text-align: center;
        margin-bottom: 20px;
        padding-bottom: 12px;
        border-bottom: 2px solid var(--brand);
    }

    .print-only .print-title {
        font-size: 1.5rem;
        font-weight: 900;
        margin-bottom: 4px;
    }

    /* العناوين بلون هوية الدولة */
    .print-only .print-title,
    .header-logo,
    .phase-header,
    .section-header,
    .accordion-title,
    .hero-title,
    .checklist-section-title,
    .route-card h3,
    .station-card h3 {
        color: var(--brand) !important;
    }

    .section-header {
        border-inline-start-color: var(--brand);
        margin-top: 24px;
        break-after: avoid;
    }

    .phase-header {
        break-after: avoid;
    }

    details.custom-accordion,
    .emergency-section,
    .top-info-bar,
    .trip-planner,
    .route-card,
    .station-card,
    .emergency-box,
    .planner-input,
    footer {
        border: 1px solid #ccc !important;
    }

    details.custom-accordion {
        overflow: visible;
        margin-bottom: 14px;
    }

    details.custom-accordion summary {
        min-height: 0;
        break-after: avoid;
    }

    /* الشبكات تُطبع كقائمة عمودية حتى لا تنقسم البطاقات بين الصفحات */
    .carousel-container,
    .stations-grid,
    .riyadh-inner-grid,
    .emergency-grid {
        display: block;
    }

    .route-card,
    .station-card,
    .emergency-box {
        margin-bottom: 10px;
        padding: 12px;
        break-inside: avoid;
    }

    /* قائمة الفحص: مربع يُطبع بدل المفتاح، وعلامة ✓ لما أُنجز */
    .checklist-grid {
        gap: 4px;
    }

    .switch-item {
        justify-content: flex-start;
        min-height: 0;
        padding: 4px 0;
        border: none;
        break-inside: avoid;
    }

    .switch-item::before {
        content: '☐';
    }

    .switch-item.completed::before {
        content: '☑';
    }

    .switch-item.completed .switch-label {
        text-decoration: none;
    }

    footer {
        margin-top: 24px;
    }
}


/* تقليل الحركة لمن فعّل هذا التفضيل في نظامه (حساسية الحركة) */
/* مبدّل المسار (للدول ذات المنافذ المختلفة): الزر المختار يُلوَّن بقاعدة مولّدة في كل صفحة حسب body[data-route] */
:root {
    --route-on-bg: var(--gold);
    --route-on-fg: #121212;
}

body.light-mode {
    --route-on-bg: var(--brand);
    --route-on-fg: #FFFFFF;
}

.route-switch {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 0 0 14px;
}

.route-switch-stations {
    margin: 4px 0 16px;
    padding: 12px 14px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
}

.route-switch-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-light);
}

.route-switch-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.route-switch-btn {
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--card-border);
    background: var(--inner-bg);
    color: var(--text-light);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* زر اعتماد المسار في بطاقته: نص «المسار المعتمد» يظهر للمسار المختار فقط (أنماط body[data-route] في الصفحة) */
.route-inuse-label {
    display: none;
}

/* على الجوال: أزرار المسارات شبكة عمودين متساوية بدل أسطر متفاوتة الطول */
@media (max-width: 480px) {
    .route-switch-options {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
    }
}

.route-switch-btn:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* داخل بطاقة «رحلتي الآن» الملوّنة: نصوص فاتحة والاختيار بالذهبي في المظهرين */
.trip-now .route-switch {
    --route-on-bg: var(--gold);
    --route-on-fg: #121212;
    justify-content: center;
}

.trip-now .route-switch-label {
    color: rgba(255, 255, 255, 0.9);
}

.trip-now .route-switch-btn {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
}

.route-card-select {
    border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* تنبيه «تثبيت التطبيق» أعلى الصفحة (يُنشئه js/app.js حين يعرض المتصفح التثبيت).
   النمط نفسه في css/style.css و css/home.css: لكل صفحة ملف أنماط واحد */
.install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    background: #121212;
    color: #ffffff;
    border-bottom: 2px solid #D4AF37;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    font-family: 'Tajawal', sans-serif;
}

.install-banner-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.4;
}

.install-banner-text strong {
    font-size: 0.95rem;
    color: #D4AF37;
}

.install-banner-text span {
    font-size: 0.82rem;
    color: #d8d8d8;
}

.install-banner-btn,
.install-banner-close {
    font-family: inherit;
    cursor: pointer;
    border: none;
    flex-shrink: 0;
}

.install-banner-btn {
    background: #D4AF37;
    color: #121212;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 9px 16px;
    border-radius: 999px;
    min-height: 40px;
}

.install-banner-close {
    background: transparent;
    color: #ffffff;
    font-size: 1.1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.install-banner-btn:focus-visible,
.install-banner-close:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

@media print {
    .install-banner {
        display: none !important;
    }
}

/* صفحة «قريباً»: زر العودة للرئيسية بعرض محتواه (لا يتمدد) */
.coming-soon-actions > .btn-launch {
    width: auto;
}
