:root { --bg: #f0f2f5; --card: #ffffff; --text: #333; --primary: #095797; --border: #ddd; }
        @media (prefers-color-scheme: dark) { :root { --bg: #1a1a1b; --card: #272729; --text: #e5e5e5; --primary: #4da3ff; --border: #444; } }

        body { font-family: -apple-system, system-ui, sans-serif; background: var(--bg); color: var(--text); padding: 10px; margin: 0; }
        .container { max-width: 500px; margin: auto; background: var(--card); padding: 15px; border-radius: 15px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); min-height: 94vh; display: flex; flex-direction: column; }
        h1 { color: var(--primary); text-align: center; letter-spacing: -1.5px; margin: 10px 0; }

        .search-box { background: rgba(0,0,0,0.03); padding: 15px; border-radius: 10px; margin-bottom: 20px; border: 1px solid var(--border); }
        input, select { padding: 12px; border: 1px solid var(--border); border-radius: 8px; width: 100%; box-sizing: border-box; margin-bottom: 10px; background: var(--card); color: var(--text); font-size: 16px; }
        .btn-row { display: flex; gap: 8px; }
        .btn-row button   { flex: 3; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; }
        .btn-row .loc-btn { flex: 1; background: transparent; color: var(--primary); border: 1px solid var(--primary); font-weight: bold; }
        .btn-row .loc-btn, .btn-row .opt-btn { flex: 1; }
        .btn-row .opt-btn { background: transparent; color: var(--text); border: 1px solid var(--border); font-weight: normal; opacity: 0.7; }
        .btn-row .opt-btn.has-options { color: var(--primary); border-color: var(--primary); opacity: 1; }

        .station-card { border-bottom: 1px solid var(--border); padding: 15px 0; display: flex; justify-content: space-between; align-items: center; color: inherit; cursor: pointer; }
        .station-best { border-left: 3px solid #2e9e5b; padding-left: 12px; margin-left: -12px; }
        .brand      { font-size: 0.75rem; color: #ff4d4d; font-weight: 800; text-transform: uppercase; }
        .name       { font-size: 1rem; font-weight: bold; display: block; margin: 2px 0; }
        .addr       { font-size: 0.85rem; opacity: 0.7; display: block; }
        .dist-badge { display: inline-block; margin-top: 4px; padding: 2px 8px; background: rgba(9,87,151,0.1); border-radius: 10px; font-size: 0.75rem; color: var(--primary); font-weight: bold; border: 1px solid var(--primary); }
        .price      { font-size: 1.4rem; font-weight: 900; }
        .delta-up   { font-size: 0.72rem; font-weight: 700; color: #e05252; display: block; }
        .delta-down { font-size: 0.72rem; font-weight: 700; color: #2e9e5b; display: block; }
        .delta-age  { font-weight: 400; opacity: 0.7; }

        footer { margin-top: auto; font-size: 0.75rem; opacity: 0.6; text-align: center; padding-top: 25px; line-height: 1.6; }
        footer a, footer a:visited { color: rgba(128,128,128,0.7); }

        .fav-btn { padding: 0 13px; background: var(--card); border: 1px solid var(--border); border-left: none; border-radius: 0 8px 8px 0; cursor: pointer; font-size: 18px; color: #ccc; line-height: 1; transition: color 0.15s, border-color 0.15s, background 0.15s; }
        .fav-btn.has-active { color: #f5a623; border-color: #f5a623; background: rgba(245,166,35,0.07); }
        .fav-badge { display: none; font-size: 10px; font-weight: 800; background: var(--primary); color: #fff; border-radius: 8px; padding: 1px 5px; vertical-align: middle; margin-left: 3px; }
        .fav-badge.visible { display: inline; }

        .fav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 100; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
        .fav-overlay.open { display: flex; }
        .fav-modal { background: var(--card); border-radius: 14px; padding: 20px; width: 100%; max-width: 380px; color: var(--text); max-height: 85vh; overflow-y: auto; }
        .fav-modal h2 { font-size: 15px; font-weight: 700; margin: 0 0 3px; }
        .fav-hint { font-size: 12px; opacity: 0.5; margin: 0 0 14px; }
        .fav-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 0.5px solid var(--border); }
        .fav-item:last-of-type { border-bottom: none; }
        .fav-chip { flex: 1; border-radius: 20px; padding: 7px 14px; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; border: 1.5px solid var(--border); background: var(--bg); color: var(--text); opacity: 0.6; transition: all 0.15s; }
        .fav-chip.on { background: rgba(9,87,151,0.08); border-color: var(--primary); color: var(--primary); opacity: 1; }
        .fav-chip.on::before { content: '✓ '; font-size: 11px; }
        .fav-del { background: none; border: none; color: var(--border); cursor: pointer; font-size: 15px; padding: 4px 7px; border-radius: 6px; line-height: 1; }
        .fav-del:hover { color: #e05252; }
        .fav-add-row { display: flex; gap: 8px; margin-top: 14px; }
        .fav-add-input { flex: 2; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--card); color: var(--text); margin: 0; width: auto; }
        .fav-save-btn { flex: 1; padding: 9px 14px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
        .fav-actions { display: flex; gap: 8px; margin-top: 10px; }
        .fav-search-btn { flex: 2; padding: 10px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }
        .fav-close-btn { flex: 1; padding: 10px; background: none; border: 0.5px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text); cursor: pointer; opacity: 0.7; }

        .opt-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text); opacity: 0.4; margin: 16px 0 8px; }
        .opt-type-row { display: flex; gap: 6px; margin-bottom: 4px; }
        .opt-type-chip { flex: 1; padding: 9px 4px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--bg); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; transition: all 0.15s; opacity: 0.6; }
        .opt-type-chip.on { background: rgba(9,87,151,0.08); border-color: var(--primary); color: var(--primary); opacity: 1; }
        .opt-brand-list { max-height: 150px; overflow-y: auto; margin-bottom: 4px; }
        .opt-brand-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 0.5px solid var(--border); cursor: pointer; }
        .opt-brand-item:last-child { border-bottom: none; }
        .opt-brand-item input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
        .opt-brand-name { font-size: 14px; flex: 1; color: var(--text); }
        .opt-brand-count { font-size: 11px; opacity: 0.4; }
        .opt-selectall { font-size: 12px; color: var(--primary); cursor: pointer; text-decoration: underline; margin-bottom: 8px; display: inline-block; }

        .veh-row { display: flex; gap: 10px; margin-bottom: 4px; }
        .veh-field { flex: 1; }
        .veh-label { font-size: 11px; opacity: 0.5; margin-bottom: 4px; display: block; }
        .veh-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--card); color: var(--text); box-sizing: border-box; margin: 0; }

        .trip-badge { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 4px 8px; border-radius: 10px; font-size: 0.70rem; font-weight: 700; border: 1px solid; line-height: 1.4; margin-top: 4px; }
        .trip-badge-row { display: flex; gap: 4px; align-items: center; }
        .trip-badge-muted { opacity: 0.7; font-weight: 400; }
        .trip-ok { color: #2e9e5b; border-color: #2e9e5b; background: rgba(46,158,91,0.08); }
        .trip-no { color: #e05252; border-color: #e05252; background: rgba(224,82,82,0.08); }

        .trip-detail { background: var(--bg); border-radius: 10px; padding: 12px; margin-bottom: 14px; font-size: 13px; }
        .trip-detail-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 0.5px solid var(--border); }
        .trip-detail-row:last-child { border-bottom: none; font-weight: 700; }

        .opt-tip-item { padding: 8px 0; border-bottom: 0.5px solid var(--border); font-size: 13px; }
        .opt-tip-item:last-child { border-bottom: none; }
        .opt-tip-row { display: flex; align-items: center; gap: 10px; }
        .opt-tip-icon { font-size: 16px; width: 24px; text-align: center; flex-shrink: 0; }
        .opt-tip-label { flex: 1; color: var(--text); }
        .opt-tip-done { font-size: 15px; color: #2e9e5b; }
        .pwa-steps { display: none; margin: 8px 0 4px 34px; padding: 10px 12px; background: rgba(9,87,151,0.06); border-radius: 8px; }
        .pwa-steps.open { display: block; }
        .pwa-step { font-size: 12px; opacity: 0.85; padding: 3px 0; display: flex; gap: 8px; line-height: 1.4; }
        .pwa-step-num { font-weight: 700; color: var(--primary); flex-shrink: 0; min-width: 16px; }
        .pwa-how-btn { font-size: 11px; color: var(--primary); background: none; border: none; cursor: pointer; padding: 0; text-decoration: underline; margin-top: 5px; display: inline-block; }

        .ob-banner { background: rgba(9,87,151,0.08); border: 1px solid rgba(9,87,151,0.2); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; position: relative; }
        .ob-banner-title { font-size: 13px; font-weight: 700; color: var(--primary); margin: 0 0 8px; }
        .ob-close { position: absolute; top: 10px; right: 10px; background: none; border: none; color: var(--text); opacity: 0.4; cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; }
        .ob-tip { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
        .ob-tip-icon { font-size: 16px; flex-shrink: 0; width: 24px; text-align: center; }
        .ob-tip-text { flex: 1; opacity: 0.8; }
        .ob-tip-btn { font-size: 11px; font-weight: 700; color: var(--primary); background: none; border: 1px solid var(--primary); border-radius: 12px; padding: 3px 10px; cursor: pointer; white-space: nowrap; }

        .st-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 200; align-items: flex-end; justify-content: center; }
        .st-overlay.open { display: flex; }
        .st-sheet { background: var(--card); border-radius: 14px 14px 0 0; padding: 20px; width: 100%; max-width: 500px; max-height: 85vh; overflow-y: auto; box-sizing: border-box; }
        .st-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 16px; }
        .st-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
        .st-brand { font-size: 0.75rem; color: #ff4d4d; font-weight: 800; text-transform: uppercase; margin: 0 0 2px; }
        .st-name  { font-size: 1rem; font-weight: 700; margin: 0; color: var(--text); }
        .st-close { background: none; border: none; color: var(--text); font-size: 20px; cursor: pointer; padding: 0; line-height: 1; opacity: 0.5; }
        .st-addr  { font-size: 0.85rem; opacity: 0.6; margin: 4px 0 12px; }
        .st-maps  { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--primary); text-decoration: none; padding: 5px 12px; border: 1px solid var(--primary); border-radius: 20px; margin-bottom: 16px; }
        .st-prices { display: flex; gap: 8px; margin-bottom: 16px; }
        .st-price-chip { flex: 1; background: var(--bg); border-radius: 10px; padding: 10px 8px; text-align: center; }
        .st-chip-type  { font-size: 11px; opacity: 0.5; margin-bottom: 4px; }
        .st-chip-val   { font-size: 1.1rem; font-weight: 900; }
        .st-chip-delta { font-size: 11px; font-weight: 700; margin-top: 3px; min-height: 16px; }
        .st-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.4; margin: 0 0 10px; }
        .st-chart-wrap { position: relative; width: 100%; height: 120px; margin-bottom: 14px; }
        .st-hist-item { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 0.5px solid var(--border); font-size: 13px; }
        .st-hist-item:last-child { border-bottom: none; }
        .st-hist-date { opacity: 0.5; }
        .st-hist-val  { font-weight: 700; }
        .st-hist-chg  { font-size: 11px; font-weight: 700; min-width: 60px; text-align: right; }
        .st-loading { text-align: center; padding: 40px 0; opacity: 0.5; font-size: 14px; }
        .st-type-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
        .st-tab { flex: 1; padding: 7px 4px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--bg); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; text-align: center; opacity: 0.6; transition: all 0.15s; }
        .st-tab.on { background: rgba(9,87,151,0.08); border-color: var(--primary); color: var(--primary); opacity: 1; }
        .station-card::after { content: '›'; font-size: 1.2rem; opacity: 0.2; margin-left: 8px; flex-shrink: 0; }
        .station-card:active { background: rgba(0,0,0,0.04); border-radius: 8px; }
        .fab-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    background: var(--card);
    padding: 8px 10px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    transform: translateX(-50%) translateY(10px);
}
.fab-bar.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}
.fab-bar button {
    padding: 10px 14px;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.fab-bar .fab-search { background: var(--primary); color: #fff; }
.fab-bar .fab-opt    { background: var(--bg); color: var(--text); }
.fab-bar .fab-gps    { background: var(--bg); color: var(--primary); border: 1px solid var(--primary); }
.fab-bar .fab-best   { background: rgba(46,158,91,0.1); color: #2e9e5b; border: 1px solid #2e9e5b; }
.fab-bar.visible { display: flex; }
.fab-bar .fab-top { background: rgba(9,87,151,0.1); color: var(--primary); border: 1px solid var(--primary); }
@keyframes pulse {
    0%, 100% { transform: scale(1);   opacity: 0.6; }
    50%       { transform: scale(1.2); opacity: 1;   }
}
.share-btn {
    background: none;
    border: none;
    font-size: 0.72rem;
    color: #888;
    cursor: pointer;
    padding: 0;
    margin-top: 3px;
    display: block;
    margin-left: auto;
}
.share-btn:hover { color: var(--primary); }