:root{
      --bg:#081225;
      --panel:#111f36;
      --panel2:#0d1a2f;
      --line:#2f466f;
      --text:#ecf3ff;
      --muted:#a9bbd6;
      --accent:#1957bd;
      --accent2:#2c7cff;
      --green:#3df08b;
      --red:#ff6b81;
      --yellow:#ffb84d;
    }

    *{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
    html,body{margin:0;height:100%;background:var(--bg);color:var(--text);font-family:Inter,"Segoe UI",Arial,sans-serif}
    body{display:flex;flex-direction:column;overflow:hidden}

    .top-cards{
      display:grid;
      grid-template-columns:repeat(3,1fr);
      gap:8px;
      padding:8px;
      flex-shrink:0;
    }

    @media (orientation: landscape) and (max-height: 520px){
      .top-cards{display:none}
    }

    .card{
      background:linear-gradient(180deg,var(--panel),var(--panel2));
      border:1px solid var(--line);
      border-radius:12px;
      padding:10px;
      text-align:center;
      cursor:pointer;
    }
    .card.active{
      border-color:var(--accent2);
      box-shadow:inset 0 0 0 1px rgba(44,124,255,.25);
    }
    .card h4{
      margin:0 0 4px 0;
      font-size:11px;
      letter-spacing:.06em;
      text-transform:uppercase;
      color:var(--muted);
    }
    .card .p{
      color:var(--green);
      font-weight:900;
      font-size:20px;
      line-height:1.1;
    }
    .card .s{
      color:var(--muted);
      font-size:10px;
      margin-top:3px;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }

    .tabs{
      display:flex;
      border-top:1px solid rgba(255,255,255,.03);
      border-bottom:1px solid var(--line);
      background:#08101f;
      flex-shrink:0;
    }
    .tab{
      flex:1;
      text-align:center;
      padding:13px 6px;
      font-size:11px;
      font-weight:800;
      letter-spacing:.03em;
      color:var(--muted);
      cursor:pointer;
      user-select:none;
    }
    .tab.active{
      color:#fff;
      border-bottom:3px solid var(--accent2);
      background:rgba(44,124,255,.08);
    }

    .filters{
      display:grid;
      grid-template-columns:1fr 1fr 1fr;
      gap:6px;
      padding:8px;
      flex-shrink:0;
      border-bottom:1px solid var(--line);
    }

    @media (max-width:600px){
      .filters{grid-template-columns:1fr 1fr 1fr}
    }

    select,input,button{
      font:inherit;
    }

    select,input{
      width:100%;
      background:#09162b;
      color:#fff;
      border:1px solid #7a6e53;
      border-radius:10px;
      padding:11px 12px;
      outline:none;
    }

    .content{
      flex:1;
      overflow-y:auto;
      padding:10px 6px 14px;
    }

    .page{display:none}
    .page.active{display:block}
.station-card{
      background:linear-gradient(180deg,rgba(255,255,255,.03),rgba(255,255,255,.015));
      border:1px solid var(--line);
      border-radius:14px;
      overflow:hidden;
      margin-bottom:10px;
    }

    .station-main{
      display:grid;
      grid-template-columns:28px 1fr auto;
      gap:10px;
      align-items:start;
      padding:14px;
    }

    .station-check{
      width:19px;
      height:19px;
      margin-top:4px;
      accent-color:var(--accent2);
    }

    .station-name{
      font-size:14px;
      font-weight:900;
      margin-bottom:4px;
      line-height:1.2;
    }

    .station-address,
    .station-place{
      font-size:12px;
      color:var(--muted);
      line-height:1.35;
    }

    .badge-row{
      display:flex;
      flex-wrap:wrap;
      gap:6px;
      margin-top:8px;
    }

    .badge{
      display:inline-flex;
      align-items:center;
      gap:4px;
      border-radius:999px;
      padding:4px 10px;
      font-size:10px;
      font-weight:800;
      border:1px solid var(--line);
      background:#09162b;
      color:#dbe7f8;
    }

    .badge.open{
      color:#d9ffe8;
      border-color:rgba(61,240,139,.4);
      background:rgba(61,240,139,.12);
    }

    .badge.closed{
      color:#ffd7de;
      border-color:rgba(255,107,129,.4);
      background:rgba(255,107,129,.10);
    }

    .station-right{
      text-align:right;
      min-width:88px;
    }

    .station-price{
      color:var(--green);
      font-size:18px;
      font-weight:900;
      line-height:1.1;
    }

    .station-distance{
      color:#7eb1ff;
      font-size:12px;
      font-weight:700;
      margin-top:4px;
      min-height:15px;
    }

    .details-row{
      display:flex;
      justify-content:flex-end;
      padding:0 14px 12px;
    }

    .details-btn{
      border:1px solid var(--accent2);
      background:transparent;
      color:#fff;
      border-radius:999px;
      padding:7px 12px;
      font-size:11px;
      font-weight:800;
      cursor:pointer;
    }

    .station-details{
      display:none;
      border-top:1px solid rgba(255,255,255,.06);
      padding:10px 12px 12px;
      background:rgba(0,0,0,.08);
    }

    .station-details.open{display:block}

    .detail-grid{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:10px;
    }

    @media (max-width:700px){
      .detail-grid{grid-template-columns:1fr}
    }

    .detail-box{
      border:1px solid #45618f;
      background:#07152b;
      border-radius:12px;
      padding:12px 10px;
    }

    .detail-label{
      font-size:10px;
      text-transform:uppercase;
      letter-spacing:.06em;
      color:var(--muted);
      font-weight:800;
      margin-bottom:6px;
    }

    .detail-value{
      font-size:14px;
      font-weight:900;
      color:#fff;
      line-height:1.3;
    }

    .detail-sub{
      margin-top:3px;
      font-size:12px;
      color:var(--muted);
      line-height:1.35;
    }

    .map-toolbar{
      display:flex;
      gap:8px;
      margin-bottom:10px;
    }

    .map-toggle{
      flex:1;
      border:1px solid var(--line);
      background:#12213c;
      color:#fff;
      border-radius:10px;
      padding:10px 12px;
      font-size:12px;
      font-weight:800;
      cursor:pointer;
    }

    .map-toggle.active{
      border-color:var(--accent2);
      background:rgba(44,124,255,.15);
    }

    #map{
      width:100%;
      height:460px;
      border-radius:14px;
      border:1px solid var(--line);
      overflow:hidden;
      background:#000;
    }

   .map-price-tag{
  display:inline-block;
  background:#fff;
  color:#0a1a30;
  font-weight:900;
  border-radius:8px;
  padding:3px 7px;
  border:2px solid rgba(0,0,0,0.15);
  box-shadow:0 2px 8px rgba(0,0,0,0.45);
  font-size:12px;
  line-height:1.1;
  white-space:nowrap;
}

    
    .map-price-tag.best  { border-color: var(--green);  color: #003316; }
    .map-price-tag.mid   { border-color: var(--yellow); color: #332000; }
    .map-price-tag.worst { border-color: var(--red);    color: #330008; }

    .distance-label{
      background:rgba(8,18,37,.94);
      color:#fff;
      border:1px solid #6784b5;
      border-radius:999px;
      padding:2px 7px;
      font-size:10px;
      font-weight:900;
      white-space:nowrap;
    }

    .chart-wrap{
      background:rgba(0,0,0,.08);
      border:1px solid var(--line);
      border-radius:14px;
      padding:8px;
    }

    .chart-head{
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:10px;
      margin-bottom:8px;
    }

    .chart-head select{
      width:auto;
      min-width:90px;
    }

    #trend-box{
      font-size:12px;
      font-weight:900;
      color:#fff;
      text-align:right;
    }

    .chart-box{
      position:relative;
      height:420px;
    }

    .section-card{
      background:linear-gradient(180deg,var(--panel),var(--panel2));
      border:1px solid var(--line);
      border-radius:14px;
      padding:16px;
      margin-bottom:12px;
    }

    .calc-title{
      margin:0 0 14px 0;
      color:#fff;
      font-size:22px;
      font-weight:900;
      line-height:1.15;
      letter-spacing:.01em;
    }

    .calc-grid{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:10px;
    }

    @media (max-width:700px){
      .calc-grid{grid-template-columns:1fr}
    }

    .field-label{
      display:block;
      margin-bottom:6px;
      font-size:10px;
      text-transform:uppercase;
      letter-spacing:.06em;
      color:var(--muted);
      font-weight:800;
    }

    #calc-res,#v-res{
      margin-top:14px;
      font-size:24px;
      font-weight:900;
      text-align:center;
    }

    #calc-res-sub{
      margin-top:5px;
      text-align:center;
      color:var(--muted);
      font-size:12px;
      font-weight:700;
    }

    #full-res{
      margin-top:14px;
      font-size:13px;
      line-height:1.5;
      color:var(--muted);
    }

    .legal-box{
      background:linear-gradient(180deg,var(--panel),var(--panel2));
      border:1px solid var(--line);
      border-radius:14px;
      padding:15px;
      line-height:1.6;
      color:var(--muted);
      font-size:13px;
    }

    
    .border-best { border-left: 5px solid var(--green) !important; }
    .border-mid  { border-left: 5px solid var(--yellow) !important; }
    .border-worst{ border-left: 5px solid var(--red) !important; }

    

    
    .station-card.is-closed { opacity: .52; }

    
    .filter-open-wrap{
      display:flex;
      align-items:center;
      gap:6px;
      background:#09162b;
      border:1px solid #7a6e53;
      border-radius:10px;
      padding:0 12px;
      cursor:pointer;
      user-select:none;
      font-size:12px;
      font-weight:800;
      color:var(--muted);
      white-space:nowrap;
    }
    .filter-open-wrap input{ width:auto; border:none; background:transparent; padding:0; }
    .filter-open-wrap.on{ border-color:var(--green); color:var(--green); background:rgba(61,240,139,.08); }

    
    .poi-toolbar{
      display:flex;
      gap:6px;
      margin-top:8px;
      flex-wrap:wrap;
    }
    .poi-btn{
      border:1px solid var(--line);
      background:#12213c;
      color:var(--muted);
      border-radius:10px;
      padding:8px 12px;
      font-size:11px;
      font-weight:800;
      cursor:pointer;
      transition: border-color .15s, color .15s, background .15s;
    }
    .poi-btn.active{
      border-color:var(--accent2);
      color:#fff;
      background:rgba(44,124,255,.18);
    }

    
    footer{
      flex-shrink:0;
      display:flex;
      align-items:center;
      justify-content:center;
      gap:10px;
      padding:6px 10px;
      background:#060f1e;
      border-top:1px solid var(--line);
      font-size:10px;
      color:var(--muted);
      flex-wrap:wrap;
    }
    footer a{ color:var(--muted); text-decoration:underline; }
    #last-update-status{
      display:inline-flex;
      align-items:center;
      gap:4px;
      font-weight:800;
    }
    #last-update-status::before{
      content:'';
      display:inline-block;
      width:7px; height:7px;
      border-radius:50%;
      background:var(--green);
      box-shadow:0 0 4px var(--green);
    }
    #last-update-status.stale::before{ background:var(--yellow); box-shadow:0 0 4px var(--yellow); }
    #last-update-status.error::before{ background:var(--red); box-shadow:0 0 4px var(--red); }

    
    .loc-search-wrap{
      display:flex;
      gap:6px;
      padding:8px;
      border-bottom:1px solid var(--line);
      flex-shrink:0;
    }
    .loc-search-wrap input{
      flex:1;
      background:#09162b;
      color:#fff;
      border:1px solid #7a6e53;
      border-radius:10px;
      padding:10px 12px;
      font:inherit;
      outline:none;
    }
    .loc-search-wrap input:focus{ border-color:var(--accent2); }
    .loc-search-btn{
      border:1px solid var(--line);
      background:#12213c;
      color:#fff;
      border-radius:10px;
      padding:10px 13px;
      font-size:13px;
      cursor:pointer;
      white-space:nowrap;
      font-weight:800;
    }
    .loc-search-btn:active{ background:rgba(44,124,255,.2); }
    .loc-suggestions{
      position:absolute;
      z-index:9000;
      background:#0d1a2f;
      border:1px solid var(--line);
      border-radius:10px;
      width:calc(100% - 16px);
      left:8px;
      margin-top:2px;
      overflow:hidden;
      box-shadow:0 8px 24px rgba(0,0,0,.5);
    }
    .loc-suggestion-item{
      padding:10px 14px;
      font-size:13px;
      cursor:pointer;
      border-bottom:1px solid rgba(255,255,255,.04);
    }
    .loc-suggestion-item:hover{ background:rgba(44,124,255,.12); }
    .loc-suggestion-item:last-child{ border-bottom:none; }

    
    .move-up   { color: var(--red);    font-weight:900; font-size:11px; }
    .move-down { color: var(--green);  font-weight:900; font-size:11px; }
    .move-same { color: var(--muted);  font-weight:700; font-size:11px; }

    .today-range{
      display:flex;
      gap:6px;
      font-size:10px;
      color:var(--muted);
      margin-top:3px;
      justify-content:flex-end;
    }
    .today-range .tmin{ color:var(--green); font-weight:800; }
    .today-range .tmax{ color:var(--red);   font-weight:800; }

    
    .brand-table{
      width:100%;
      border-collapse:collapse;
      font-size:12px;
      margin-top:10px;
    }
    .brand-table th{
      text-align:left;
      color:var(--muted);
      font-size:10px;
      text-transform:uppercase;
      letter-spacing:.05em;
      padding:6px 8px;
      border-bottom:1px solid var(--line);
    }
    .brand-table td{
      padding:7px 8px;
      border-bottom:1px solid rgba(255,255,255,.04);
    }
    .brand-table tr:last-child td{ border-bottom:none; }
    .brand-table .best-brand td{ background:rgba(61,240,139,.06); }
    .brand-rank{ color:var(--muted); font-size:10px; }

    
    .alert-wrap{
      position:relative;
    }
    .alert-btn{
      border:1px solid var(--line);
      background:#12213c;
      color:var(--muted);
      border-radius:10px;
      padding:10px 13px;
      font-size:16px;
      cursor:pointer;
      line-height:1;
    }
    .alert-btn.active{
      border-color:var(--yellow);
      color:var(--yellow);
      background:rgba(255,184,77,.1);
    }
    .alert-panel{
      display:none;
      position:absolute;
      right:0;
      top:calc(100% + 6px);
      background:#0d1a2f;
      border:1px solid var(--line);
      border-radius:14px;
      padding:14px;
      width:260px;
      z-index:8000;
      box-shadow:0 8px 24px rgba(0,0,0,.6);
    }
    .alert-panel.open{ display:block; }
    .alert-panel h4{
      margin:0 0 10px;
      font-size:12px;
      text-transform:uppercase;
      letter-spacing:.06em;
      color:var(--muted);
    }
    .alert-row{
      display:flex;
      gap:6px;
      align-items:center;
      margin-bottom:8px;
    }
    .alert-row input[type=number]{
      flex:1;
      padding:8px 10px;
      font-size:13px;
    }
    .alert-row select{
      width:auto;
      padding:8px 10px;
      font-size:13px;
    }
    .alert-save{
      width:100%;
      padding:9px;
      background:var(--accent);
      color:#fff;
      border:none;
      border-radius:10px;
      font-weight:800;
      font-size:13px;
      cursor:pointer;
      margin-top:4px;
    }
    .alert-save:active{ background:var(--accent2); }
    .alert-status{
      margin-top:8px;
      font-size:11px;
      color:var(--muted);
      text-align:center;
      min-height:16px;
    }
    .alert-clear{
      background:none;
      border:none;
      color:var(--red);
      font-size:11px;
      cursor:pointer;
      padding:0;
      margin-top:6px;
      display:block;
      width:100%;
      text-align:center;
    }

    .empty-state{
      border:1px dashed #4a628f;
      border-radius:14px;
      padding:24px 14px;
      text-align:center;
      color:var(--muted);
      background:rgba(255,255,255,.02);
    }

    #error-overlay{
      display:none;
      position:fixed;
      inset:0;
      z-index:9999;
      background:rgba(4,10,22,.96);
      align-items:center;
      justify-content:center;
      flex-direction:column;
      padding:20px;
      text-align:center;
    }