@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800&display=swap');

:root {
    --primary-color: #059669; /* A rich, deep green */
    --accent-color: #D92E1C; /* Singapore Red for accents */
    --background-color: #F0FDF4; /* Very light green, like a misty morning */
    --card-background: rgba(255, 255, 255, 0.65);
    --text-color: #064E3B; /* Darker Green for text */
    --subtle-text-color: #34D399;
    --light-text-color: #FFFFFF;
    --border-color: rgba(255, 255, 255, 0.4);
    --shadow-color: rgba(0,0,0,0.07);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body { height: 100%; }

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    background-image: url('https://www.transparenttextures.com/patterns/xv.png') !important;
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* soft page gradient to feel like a park morning */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 10% 10%, rgba(16,185,129,0.06), transparent 15%), radial-gradient(circle at 90% 90%, rgba(3,105,85,0.02), transparent 20%);
    pointer-events: none;
    z-index: 0;
}

#refresh-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background-color: var(--accent-color);
    width: 0%;
    z-index: 9999;
    transition: width 0.5s ease-out;
}

.content-wrapper { flex-grow: 1; overflow-y: auto; padding-bottom: 2rem; }

.container { 
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem; 
    padding: 1.5rem; 
    max-width: 1400px; 
    margin: 0 auto;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    background: var(--card-background);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow-color);
    height: 52px;
    flex-shrink: 0;
    overflow: visible;
}

/* header-left block and silhouette trees */
.header-left { display:flex; align-items:center; gap:0.6rem; }
.header-left h1 { margin:0; font-weight:800; font-size:0.98rem; color:var(--primary-color); letter-spacing:-0.5px; }
.header-left .logo-icon { height:28px; width:auto; display:inline-block; margin-right:6px; }

.brand { display:flex; align-items:center; gap:0.5rem; margin-right:0.25rem; }
.brand-text { font-weight:800; color:var(--primary-color); font-size:0.9rem; letter-spacing: -0.6px; }
.header-trees { display:flex; gap:8px; align-items:flex-end; pointer-events:none; margin-left:6px; }
.hdr-silhouette { display:block; fill: rgba(0,0,0,0.12); opacity:1; filter: blur(0.6px) drop-shadow(0 2px 4px rgba(0,0,0,0.04)); transform-origin: center bottom; transition: transform 2s ease-in-out, opacity 180ms ease; }
.hdr-silhouette.small { width: 16px; height: auto; }
.hdr-silhouette.med { width: 22px; height: auto; }
.hdr-silhouette.large { width: 28px; height: auto; }
.hdr-silhouette:nth-child(1) { animation: hdr-sway 6s ease-in-out infinite; }
.hdr-silhouette:nth-child(2) { animation: hdr-sway 5.5s ease-in-out infinite; }
.hdr-silhouette:nth-child(3) { animation: hdr-sway 6.8s ease-in-out infinite; }

@keyframes hdr-sway {
    0% { transform: rotate(-0.6deg); }
    50% { transform: rotate(0.6deg); }
    100% { transform: rotate(-0.6deg); }
}

.header-bar { background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.55)); }
.header-bar h1 { margin: 0; font-weight: 800; font-size: 1.05rem; color: var(--primary-color); letter-spacing: -0.5px; }

.header-right-panel { display: flex; align-items: center; gap: 0.75rem; }
.header-weather { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.header-weather .weather-emoji { font-size: 1.5rem; }
.weather-main { display:flex; align-items:center; gap:0.75rem; }
.weather-text { display:flex; flex-direction: column; align-items: flex-start; }
.weather-forecast { font-weight: 700; }
.weather-location { font-size: 0.78rem; color: rgba(6,78,59,0.6); margin-top: 2px; line-height: 1.1; }
/* make header weather clickable but inherit header styles */
.header-weather .header-weather-link { display: inline-flex; flex-direction: column; color: inherit; text-decoration: none; align-items: flex-start; }
.header-weather .header-weather-link:focus { outline: 2px solid rgba(5,150,105,0.18); outline-offset: 2px; border-radius: 6px; }
.header-icons { display: flex; align-items: center; gap: 0.5rem; }
.header-icon-btn {
    background: none; border: none; color: var(--subtle-text-color); font-size: 1.1rem;
    cursor: pointer; padding: 0.4rem; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; width: 40px; height: 40px;
    transition: all 0.18s ease;
}
.header-icon-btn:hover { color: var(--accent-color); background-color: rgba(255,255,255,0.5); }


.card {
    background-color: var(--card-background);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
    flex: 1 1 400px;
    display: flex;
    flex-direction: column;
}

/* slight glass uplift for cards */
.card { transform: translateZ(0); transition: transform 180ms ease, box-shadow 180ms ease; }
.card:hover { transform: translateY(-6px); box-shadow: 0 10px 30px rgba(6,78,59,0.08); }

.news-card { flex-grow: 2; }
.bus-snapshot { flex-grow: 3; }

/* News list styling */
.news-item { padding: 0.6rem 0.5rem; border-bottom: 1px dashed rgba(6,78,59,0.06); display: flex; flex-direction: column; gap: 0.25rem; }
.news-item a { color: rgba(6,78,59,0.95); font-weight: 600; text-decoration: none; border-left: 3px solid transparent; padding-left: 0.55rem; transition: color 150ms ease, border-color 150ms ease, transform 150ms ease; }
.news-item a:hover { color: var(--primary-color); border-color: rgba(5,150,105,0.15); transform: translateX(3px); }
.news-item small {
    display: block;
    margin-top: 6px;
    color: var(--muted-text-color, #6b6b6b);
    font-weight: 500;
    font-size: 12px;
}
.source-badge {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 6px;
    font-size: 11px;
    color: #444;
    background: rgba(0,0,0,0.06);
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.news-item small { color: rgba(6,78,59,0.55); font-size: 0.8rem; }
.news-item .source-badge { display:inline-block; background: rgba(6,78,59,0.06); color: rgba(6,78,59,0.8); padding: 0.12rem 0.45rem; border-radius: 999px; font-size: 0.75rem; margin-right: 0.5rem; }

.bus-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Other styles will be inherited and should look good with the new theme.
   I will not repeat them here for brevity, but the file will be written completely.
*/

/* EV Charging card styles */
.settings-search-results,
.nearby-bus-stops {
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid rgba(38,162,196,0.08);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(15,41,48,0.06);
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
}
.settings-search-results { width: 100%; }
.settings-search-results .top-bus-result { padding: 8px; border-radius:8px; display:flex; justify-content:space-between; align-items:center; gap:8px; cursor:pointer; }
.settings-search-results .top-bus-result:hover, .settings-search-results .top-bus-result:focus { background: rgba(38,162,196,0.04); }
.settings-search-results .top-bus-result .nearby-meta { font-size:0.8rem; color: #556; }

.nearby-no-map { padding: 10px; color: #254b4a; background: rgba(255,255,255,0.95); border-radius: 8px; }
.nearby-no-map a { color: var(--primary-color); font-weight:700; text-decoration: none; }

/* Distinguish bus stop items with subtle card styling */
.settings-search-results .top-bus-result {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,252,250,0.98));
    border: 1px solid rgba(6,78,59,0.10);
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(6,78,59,0.04);
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
    position: relative;
    overflow: hidden;
}
.settings-search-results .top-bus-result::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color), #0ea5a0);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.settings-search-results .top-bus-result:hover, .settings-search-results .top-bus-result:focus {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(6,78,59,0.09);
    background: linear-gradient(180deg, #ffffff, rgba(245,252,250,0.98));
}

.nearby-bus-stops .nearby-item {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,252,250,0.98));
    border: 1px solid rgba(6,78,59,0.10);
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 8px 22px rgba(6,78,59,0.04);
    transition: transform 140ms ease, box-shadow 140ms ease;
    position: relative;
}
.nearby-bus-stops .nearby-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(6,78,59,0.09);
}

.nearby-bus-stops .nearby-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: rgba(6,78,59,0.12);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

/* Slightly enlarge the stop code for emphasis */
.settings-search-results .top-bus-result strong,
.nearby-bus-stops .nearby-item .nearby-main strong {
    font-weight: 800;
    color: var(--primary-color);
    min-width: 60px;
}
.ev-charging-card { flex-grow: 2; }
.settings-search-results .top-search-result,
.nearby-bus-stops .nearby-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
}
.ev-location-item { padding: 0.6rem 0.5rem; border-bottom: 1px dashed rgba(6,78,59,0.06); display: flex; flex-direction: column; gap: 0.35rem; }
.settings-search-results .top-search-result:focus,
.settings-search-results .top-search-result:hover,
.nearby-bus-stops .nearby-item:hover {
    background: rgba(38,162,196,0.04);
}
.ev-location-header { display:flex; justify-content:space-between; align-items:center; gap:0.5rem; }
.nearby-item .nearby-main { display:flex; gap:8px; align-items:center; }
.nearby-item .nearby-name { color:#123; font-weight:600; }
.nearby-item .nearby-meta { font-size:0.85em; color:#556; }
.nearby-item .nearby-actions { margin-left: 12px; }
.add-nearby-btn {
    background: #26a2c4;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
}
.add-nearby-btn:hover { background: #1e819d; }
.nearby-added { animation: flash 1.0s ease; }
@keyframes flash { 0% { background: #e6fff9 } 100% { background: transparent } }
.ev-name { font-weight:700; color: var(--text-color); }
.nearby-loading, .nearby-empty, .nearby-error { padding: 8px; color: #35525a; }

/* mini-map preview inside nearby item */
.nearby-map-container {
    display: none;
    margin-top: 8px;
}
.nearby-mini-map {
    width: 100%;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
}
.ev-distance { font-size: 0.85rem; color: rgba(6,78,59,0.6); }
.ev-meta { display:flex; gap:0.6rem; align-items:center; }
.availability-badge { padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight:600; }
.availability-badge.available { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.availability-badge.occupied { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }
.availability-badge.unavailable { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.plug-count { color: rgba(6,78,59,0.6); font-weight:500; font-size: 0.9rem; }
.availability-badge.unknown { background: rgba(0,0,0,0.04); color: rgba(6,78,59,0.6); border: 1px solid rgba(0,0,0,0.04); }
.ev-location-item { text-decoration: none; color: inherit; display: block; }

/* Modal styles */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 10000; }
.modal.is-open { display: flex; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.45); backdrop-filter: blur(4px); }
.modal-content { position: relative; background: var(--card-background); border-radius: 12px; width: min(780px, 96%); max-height: 90vh; overflow: auto; padding: 1rem; box-shadow: 0 8px 40px rgba(0,0,0,0.25); border: 1px solid var(--border-color); z-index: 10001; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 0.5rem; border-bottom: 1px solid rgba(0,0,0,0.04); }
.modal-body { padding: 0.75rem 0; }
.modal-footer { display: flex; gap: 0.5rem; justify-content: flex-end; padding-top: 0.5rem; border-top: 1px solid rgba(0,0,0,0.04); }
.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-color); }

/* Improved modal action buttons */
#reset-settings-btn {
    background: transparent;
    color: var(--text-color);
    border: 1px solid rgba(6,78,59,0.12);
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}
#reset-settings-btn:hover {
    background: rgba(6,78,59,0.04);
    border-color: rgba(6,78,59,0.18);
}
#reset-settings-btn:focus {
    outline: 3px solid rgba(5,150,105,0.12);
    outline-offset: 2px;
}

#save-settings-btn {
    background: linear-gradient(90deg, var(--primary-color), #0ea5a0);
    color: var(--light-text-color);
    border: none;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(5,150,105,0.12);
    cursor: pointer;
}
#save-settings-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(5,150,105,0.14);
}
#save-settings-btn:active { transform: translateY(0); }
#save-settings-btn:focus {
    outline: 3px solid rgba(5,150,105,0.16);
    outline-offset: 2px;
}

/* Settings modal improved layout */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.settings-column { display: flex; flex-direction: column; gap: 1rem; }
.field-card { background: rgba(255,255,255,0.75); border-radius: 10px; padding: 0.9rem; border: 1px solid rgba(6,78,59,0.06); }
.field-card.small { padding: 0.6rem; }
.field-card legend { font-weight: 700; color: var(--primary-color); margin-bottom: 0.25rem; }
.muted { color: rgba(6,78,59,0.6); font-size: 0.9rem; margin: 0 0 0.5rem 0; }
.setting-row { display:flex; gap:0.6rem; align-items:center; margin-bottom:0.5rem; }
.setting-row.compact { gap:0.5rem; }
.setting-row.align-center { align-items:center; justify-content:space-between; }
.current-location { font-weight:600; color:var(--text-color); }
.input-text { width:100%; padding:8px 10px; border-radius:8px; border:1px solid rgba(6,78,59,0.06); background:white; }
.input-select { padding:8px 10px; border-radius:8px; border:1px solid rgba(6,78,59,0.06); background:white; }
.btn { padding:8px 10px; border-radius:8px; border: none; cursor: pointer; font-weight:600; }
.btn-primary { background: var(--primary-color); color: white; }
.btn-outline { background: transparent; border: 1px solid rgba(6,78,59,0.08); color: var(--text-color); }
.btn-ghost { background: transparent; border: 1px dashed rgba(6,78,59,0.06); color: var(--primary-color); }
.add-bus-stop-form { display:flex; gap:0.6rem; align-items:center; margin-top:0.6rem; }
.add-actions { display:flex; gap:0.5rem; }
.bus-stops-list { display:flex; flex-wrap:wrap; gap:0.5rem; margin: 0.5rem 0; }
.bus-stop-setting { background: white; padding: 6px 10px; border-radius: 999px; display:flex; gap:8px; align-items:center; border:1px solid rgba(6,78,59,0.06); }
.bus-stop-setting .bus-stop-name { font-weight:600; color:var(--text-color); }
.remove-bus-stop-btn { background: transparent; border:none; color:rgba(6,78,59,0.5); font-weight:700; cursor:pointer; padding:4px; border-radius:6px; }
.remove-bus-stop-btn:hover { background: rgba(6,78,59,0.04); color:var(--accent-color); }

/* Adjustments for smaller screens */
@media (max-width: 900px) {
    .settings-grid { grid-template-columns: 1fr; }
    .modal-content { width: 96%; padding: 0.8rem; }
}

/* Responsive header tweaks for small screens */
@media (max-width: 720px) {
    .header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        height: auto;
        padding: 0.45rem 0.8rem;
    }
    .header-left {
        display:flex;
        align-items:center;
        gap:0.5rem;
        width:100%;
        flex-wrap:wrap;
    }
    .header-left h1 { font-size: 1rem; margin: 0; }
    .header-left .logo-icon { height:24px; margin-right:6px; }
    .header-right-panel {
        width:100%;
        display:flex;
        justify-content:space-between;
        align-items:center;
        gap:0.5rem;
    }
    .header-icons { gap: 0.25rem; }
    .header-icon-btn { width:36px; height:36px; padding:0.3rem; font-size:0.95rem; }
    .header-weather { order: 2; width: auto; }
    .header-location { width:100%; font-size:0.85rem; color: rgba(6,78,59,0.8); }
}

/* Make the small address/location less prominent */
.header-location { font-size: 0.72rem; color: rgba(6,78,59,0.6); margin-left: 2px; }

/* Prevent inputs from overflowing their container */
.modal-content, .modal-content * {
    box-sizing: border-box;
}
.setting-row, .add-bus-stop-form, .settings-column, .field-card {
    width: 100%;
}
.input-text, .input-select {
    max-width: 100%;
    box-sizing: border-box;
}
.settings-search-results { width: 100%; max-width: 100%; box-sizing: border-box; }

/* Bus snapshot/card styles */
.bus-stop-group { margin-bottom: 1rem; }
.bus-stop-group {
    padding-bottom: 0.6rem;
    border-bottom: 2px solid rgba(0,0,0,0.06);
}
.bus-stop-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.bus-stop-group h4 {
    margin: 0 0 0.35rem 0;
    font-size: 0.95rem;
}

/* Emphasize bus stop heading and add bus icon */
.bus-stop-group h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.35rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-color, #1464a0);
}
.bus-stop-group h4::before {
    content: "🚌";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    font-size: 1rem;
    background: rgba(20,100,160,0.08);
    border-radius: 4px;
}
.bus-stop-group h4 { margin: 0 0 0.5rem 0; font-size: 1rem; }
.bus-services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.75rem; }

/* QR code for quick access to bus stop page */
.bus-stop-qr-link { margin-left: auto; display: inline-block; }
.bus-stop-qr { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(0,0,0,0.06); box-shadow: 0 6px 18px rgba(6,78,59,0.06); }

@media (max-width: 720px) {
    .bus-stop-qr { width: 44px; height: 44px; }
}
.bus-info-card-link { text-decoration: none; color: inherit; display: block; }
.bus-info-card { background: rgba(255,255,255,0.8); border-radius: 10px; padding: 0.6rem; border: 1px solid rgba(0,0,0,0.04); display: flex; flex-direction: column; height: 100%; }
.bus-info-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.service-no-box { background: var(--primary-color); color: var(--light-text-color); padding: 0.25rem 0.6rem; border-radius: 6px; font-weight: 700; min-width: 48px; text-align: center; }
.destination { font-size: 0.95rem; color: var(--text-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bus-arrivals-container {
    display: flex;
    flex-wrap: wrap; /* allow later arrival rows to sit beside each other */
    gap: 0.35rem;
    align-items: flex-start;
}
.bus-arrival-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(0,0,0,0.02);
    flex: 0 1 auto; /* default: don't force full width */
    min-width: 72px; /* keep small arrival chips from collapsing */
}
/* Make the first arrival take the full width (first line) */
.bus-arrival-row:first-child {
    flex: 1 1 100%;
}
/* Second and later arrival rows will evenly share remaining width on their line */
.bus-arrival-row:nth-child(n+2) {
    flex: 1 1 0; /* allow chips to grow so their combined width equals container */
}
.bus-arrival-row.no-data { opacity: 0.8; }
.arrival-time { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.arrival-type { font-size: 0.8rem; color: var(--subtle-text-color); }

/* load indicators */
.low-load { border-left: 4px solid #10b981; }
.medium-load { border-left: 4px solid #f59e0b; }
.high-load { border-left: 4px solid #ef4444; }

/* Footer */
.footer { padding: 1rem 0; text-align: center; color: rgba(6,78,59,0.8); font-size: 0.9rem; }

/* Incident card styles */
.bulletin-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,252,250,0.98));
    border: 1px solid rgba(6,78,59,0.08);
    box-shadow: 0 8px 20px rgba(6,78,59,0.03);
}
.bulletin-card:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(6,78,59,0.08); }
.bulletin-emoji { font-size: 1.6rem; width: 44px; height: 44px; display:flex; align-items:center; justify-content:center; background: rgba(6,78,59,0.04); border-radius:10px; flex-shrink:0; }

/* Incident-specific modifier */
.incident-card { background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,252,250,0.98)); border-color: rgba(6,78,59,0.08); }
.incident-card .bulletin-emoji { background: rgba(6,78,59,0.04); }

/* Train-specific modifier */
.train-bulletin-card { display:flex; gap:12px; align-items:flex-start; background: linear-gradient(180deg, rgba(255,250,240,0.98), rgba(255,255,255,0.98)); border:1px solid rgba(255,159,67,0.12); box-shadow: 0 8px 20px rgba(255,159,67,0.03); }
.train-bulletin-card:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(255,159,67,0.06); }
.train-bulletin-card .bulletin-emoji { background: rgba(255,159,67,0.06); }

/* QR modal image sizing */
.qr-modal-image {
    width: 300px;
    max-width: 90%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    background: white;
}

/* Minimal QR modal layout: center the image and position a small close button */
.qr-modal-content { display:flex; align-items:center; justify-content:center; padding: 1rem; width: min(420px, 94%); }
.qr-modal-content .qr-modal-image { display:block; }
.qr-modal-content .close-btn { position: absolute; top: 10px; right: 12px; background: rgba(255,255,255,0.7); border-radius: 999px; width:36px; height:36px; display:flex; align-items:center; justify-content:center; font-size:20px; }

@media (max-width: 480px) {
    .qr-modal-content { width: 92%; padding: 0.75rem; }
    .qr-modal-content .close-btn { width:32px; height:32px; font-size:18px; top:8px; right:10px; }
}
.incident-body, .train-bulletin-body { display:flex; flex-direction:column; gap:6px; }
.incident-title, .train-bulletin-title { font-weight:800; color: var(--primary-color); margin:0; }
.incident-desc, .train-bulletin-message, .train-bulletin-summary { font-size: 0.95rem; color: rgba(6,78,59,0.8); }

/* Train bulletin styles */
.train-bulletin-card { display:block; text-decoration:none; color:inherit; padding:10px 12px; border-radius:10px; background: linear-gradient(180deg, rgba(255,250,240,0.98), rgba(255,255,255,0.98)); border:1px solid rgba(255,159,67,0.12); box-shadow: 0 8px 20px rgba(255,159,67,0.03); }
.train-bulletin-card:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(255,159,67,0.06); }
.train-bulletin-notice { margin-bottom: 6px; }
.train-bulletin-notice strong { color: #92400e; display:block; font-weight:800; margin-bottom:6px; }
.train-bulletin-message { color: #7a2b11; font-weight:600; margin: 3px 0; }
.train-bulletin-summary { color: rgba(0,0,0,0.8); font-weight:600; margin-top:6px; }
.train-bulletin-summary a { margin-left: 8px; color: var(--primary-color); text-decoration: underline; }

/* Bulletin type / severity pills (LTA-inspired semantics)
   - ok: green / normal
   - minor: amber / advisory
   - major: red / disruption
   - unknown: gray
*/
.bulletin-type {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.04);
}
.severity-pill { box-shadow: inset 0 -2px 0 rgba(0,0,0,0.03); }
.severity-pill.ok { background: linear-gradient(180deg,#dcfce7,#bbf7d0); color: #065f46; border-color: rgba(4,120,87,0.12); }
.severity-pill.minor { background: linear-gradient(180deg,#fff7ed,#ffedd5); color: #92400e; border-color: rgba(245,158,11,0.12); }
.severity-pill.major { background: linear-gradient(180deg,#fff1f2,#fee2e2); color: #7f1d1d; border-color: rgba(239,68,68,0.12); }
.severity-pill.unknown { background: linear-gradient(180deg,#f8fafc,#eef2ff); color: #334155; border-color: rgba(99,102,241,0.06); }

/* Ensure bulletin-type aligns nicely in the body */
.bulletin-body-top { display:flex; align-items:center; gap:0.75rem; justify-content:space-between; }
.bulletin-body-top .left { display:flex; align-items:center; gap:0.6rem; }
.bulletin-body-top .right { display:flex; align-items:center; gap:0.6rem; }

/* Responsive tweaks */
@media (max-width: 800px) {
    .container { padding: 1rem; }
    .header-bar h1 { font-size: 1.05rem; }
    .bus-services-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* City garden decorative SVG container */
.city-garden { width: 100%; display: block; overflow: hidden; line-height: 0; z-index: 0; }
.city-garden svg { width: 100%; height: 140px; display: block; }
.city-garden .tree { transform-origin: center 6px; }
.city-garden .tree { transition: transform 1.6s ease-in-out; }
.city-garden .tree:nth-child(1) { animation: sway 4s ease-in-out infinite; }
.city-garden .tree:nth-child(2) { animation: sway 3.6s ease-in-out infinite; }
.city-garden .tree:nth-child(3) { animation: sway 4.4s ease-in-out infinite; }

@keyframes sway {
    0% { transform: rotate(-1deg); }
    50% { transform: rotate(1.2deg); }
    100% { transform: rotate(-1deg); }
}

/* ensure decorative element doesn't block clicks */
.city-garden { pointer-events: none; }

/* Respect hidden attribute: remove element from layout when hidden */
[hidden] { display: none !important; }