* {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

body {
    background: #000;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    min-height: 100vh;
    overflow: hidden;
}

/* ---- Views ---- */
.view {
    display: none;
    min-height: 100vh;
}
.view.active {
    display: block;
}

/* ---- Main board ---- */
#main-view {
    padding: 12px 16px 60px;
    position: relative;
}

.dep-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 14px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    min-height: 82px;
}

.product-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    margin-right: 14px;
}

.product-logo.small {
    width: 28px;
    height: 28px;
    margin-right: 8px;
}

.dep-line {
    font-weight: bold;
    font-size: 26px;
    min-width: 72px;
    margin-right: 14px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    color: #fff;
    letter-spacing: -0.5px;
}

.dep-direction {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    font-size: 22px;
    color: rgba(255,255,255,0.75);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 10px;
}

.dep-time {
    font-size: 34px;
    font-weight: bold;
    color: #fff;
    text-align: right;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    min-width: 76px;
}

.dep-time.delayed {
    color: #FF6B6B;
}

.dep-time.now {
    color: #6BCB6B;
}

.empty-board {
    text-align: center;
    padding: 80px 20px;
    font-size: 20px;
    opacity: 0.4;
    line-height: 1.7;
}

/* ---- Status bar ---- */
#status-bar {
    position: fixed;
    bottom: 8px;
    left: 10px;
    font-size: 11px;
    color: rgba(255,255,255,0.25);
}

#error-msg {
    color: #FF8888;
    margin-left: 8px;
}

/* ---- Bottom-right buttons ---- */
#settings-btn,
#fullscreen-btn {
    position: fixed;
    bottom: 8px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    font-size: 22px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
}

#settings-btn   { right: 10px; }
#fullscreen-btn { right: 64px; }

#fullscreen-btn.active {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.5);
}

/* ---- Settings panel ---- */
#settings-view {
    background: #000;
    padding: 20px 16px;
    overflow-y: auto;
    min-height: 100vh;
}

.settings-header {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.settings-header h1 {
    font-size: 26px;
}

#close-settings {
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 18px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
}

.settings-section {
    margin-bottom: 28px;
}

.settings-section h2 {
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
    color: rgba(255,255,255,0.4);
}

/* ---- Search row ---- */
.search-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 10px;
}

.search-row input {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    background: #111;
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 4px;
    margin-right: 8px;
    -webkit-appearance: none;
}

.search-row input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.5);
}

.btn {
    background: #111;
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
}

.btn:active {
    background: rgba(255,255,255,0.12);
}

#search-btn,
#save-interval,
#save-maxresults {
    background: #111;
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
}

/* ---- Search results ---- */
.search-result-item {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 15px;
    color: rgba(255,255,255,0.85);
}

/* ---- Station list ---- */
.station-item {
    background: #0d0d0d;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    margin-bottom: 10px;
}

.station-header {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 12px;
}

.station-name {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    font-size: 17px;
    font-weight: bold;
}

.station-header .btn {
    margin-left: 6px;
    padding: 6px 12px;
    font-size: 13px;
}

.btn-danger {
    border-color: rgba(255,80,80,0.35);
    color: #FF9090;
}

.station-meta {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 0 12px 10px;
    font-size: 13px;
}

.walk-label {
    color: rgba(255,255,255,0.4);
    margin-right: 6px;
}

.walk-input {
    width: 52px;
    background: #111;
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 4px 6px;
    font-size: 13px;
    border-radius: 3px;
    text-align: center;
    -webkit-appearance: none;
}

.walk-unit {
    color: rgba(255,255,255,0.4);
    margin-left: 4px;
}

.filters-summary {
    font-size: 12px;
    color: rgba(255,255,255,0.3);
}

.setting-label {
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    margin-right: 8px;
    white-space: nowrap;
    line-height: 40px;
}

/* ---- Line filter panel ---- */
.line-filters-panel {
    padding: 10px 12px 12px;
    background: rgba(255,255,255,0.02);
    border-top: 1px solid rgba(255,255,255,0.08);
}

.line-filters-panel p {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 8px;
}

.filter-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 5px 0;
    cursor: pointer;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

.filter-row input[type=checkbox] {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}
