/* ECU_BY_Bank_Online — สไตล์ร่วมทุกหน้า (ธีมแดง-ดำคาร์บอน) · แยกจาก index.html 10 ต.ค. 2569 */
  :root {
    --bg:#060606; --panel:#0c0c0e; --line:#3a1a1d;
    --red:#ff1e2d; --red2:#c8101c; --glow:rgba(255,30,45,.45);
    --txt:#f4f4f5; --dim:#9a9ca3; --mute:#5e6068; --amber:#ffb020; --green:#3dff8a;
  }
  * { box-sizing:border-box; }
  html,body { margin:0; min-height:100%; color:var(--txt); font-family:Sarabun,system-ui,sans-serif; }
  /* พื้นคาร์บอน + เรืองแดงที่ขอบ */
  body {
    background:
      radial-gradient(60% 40% at 0% 100%, rgba(255,30,45,.18), transparent 70%),
      radial-gradient(60% 40% at 100% 100%, rgba(255,30,45,.14), transparent 70%),
      radial-gradient(80% 30% at 50% 0%, rgba(255,30,45,.10), transparent 70%),
      repeating-linear-gradient(45deg, #0b0b0c 0 3px, #070708 3px 6px),
      var(--bg);
    background-attachment:fixed;
    display:flex; flex-direction:column; min-height:100vh;
  }
  .wrap { width:100%; max-width:1400px; margin:0 auto; }

  /* ── หัว ── */
  .top { position:sticky; top:0; z-index:1000; background:linear-gradient(180deg, rgba(6,6,6,.97), rgba(10,6,7,.93)); backdrop-filter:blur(6px); }
  header { display:flex; align-items:center; gap:16px; padding:12px 24px; border-bottom:1px solid var(--red2);
    box-shadow:0 1px 18px rgba(255,30,45,.35); }
  header .logo { height:44px; width:auto; display:block; filter:drop-shadow(0 0 6px rgba(255,255,255,.15)); }
  header .sep { width:1px; align-self:stretch; background:linear-gradient(180deg, transparent, #555, transparent); }
  header .who { flex:1; min-width:0; }
  header .who b { display:block; font-family:'Exo 2'; font-style:italic; font-weight:800; font-size:20px; letter-spacing:.5px;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  header .who span { display:block; font-size:13px; color:var(--dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .live { display:flex; align-items:center; gap:10px; }
  .live .dot { width:12px; height:12px; border-radius:50%; background:var(--mute); }
  .live.on .dot { background:var(--red); box-shadow:0 0 10px var(--red); animation:pulse 1.2s infinite; }
  .live.stale .dot { background:var(--amber); }
  .eye { display:none; align-items:center; gap:7px; padding:5px 12px; border:1px solid #3a2226; border-radius:22px; background:rgba(10,10,12,.7); }
  .eye.on { display:flex; }
  .eye svg { width:20px; height:20px; stroke:#fff; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
  .eye b { font-family:'Exo 2'; font-style:italic; font-weight:800; font-size:17px; color:#fff; min-width:1ch; }
  .live .pill { font-family:'Exo 2'; font-style:italic; font-weight:900; font-size:18px; padding:5px 18px; border-radius:22px;
    border:2px solid var(--mute); color:var(--dim); white-space:nowrap; }
  .live.on .pill { border-color:var(--red); color:#fff; background:rgba(200,16,28,.35); box-shadow:0 0 14px var(--glow); }
  .live.stale .pill { border-color:var(--amber); color:var(--amber); }
  @keyframes pulse { 50% { opacity:.35; } }

  /* ── แท็บ ── */
  nav { display:grid; grid-template-columns:repeat(4,1fr); margin:14px auto 0; width:calc(100% - 48px); max-width:1352px;
    border:1px solid var(--line); background:var(--panel); }
  nav button { -webkit-appearance:none; appearance:none; position:relative; display:flex; align-items:center; justify-content:center; gap:10px;
    min-height:50px; background:transparent; border:0; color:var(--dim); cursor:pointer;
    font-family:'Exo 2'; font-style:italic; font-weight:600; font-size:16px; letter-spacing:.6px; }
  nav button + button::before { content:''; position:absolute; left:0; top:8px; bottom:8px; width:1px; background:#2b2b30; transform:skewX(-25deg); }
  nav button svg { width:22px; height:22px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
  nav button.on { color:#fff; font-weight:800;
    background:linear-gradient(180deg, #3a070b, #8d0c15); clip-path:polygon(0 0,100% 0,calc(100% - 26px) 100%,0 100%);
    box-shadow:inset 0 -3px 0 var(--red); }

  main { flex:1; padding:16px 24px 20px; }
  .page { display:none; } .page.on { display:block; }

  /* ── กรอบแผง: ขอบแดง + มุมสามเหลี่ยมแดง ── */
  .panel { position:relative; background:linear-gradient(180deg, rgba(18,18,21,.92), rgba(9,9,11,.92)); border:1px solid var(--red2);
    box-shadow:0 0 22px rgba(255,30,45,.10) inset; padding:16px 18px; min-width:0;
    clip-path:polygon(0 0,calc(100% - 14px) 0,100% 14px,100% 100%,14px 100%,0 calc(100% - 14px)); }
  .panel::before, .panel::after { content:''; position:absolute; width:22px; height:22px; background:var(--red); opacity:.9; pointer-events:none; }
  .panel::before { top:0; right:0; clip-path:polygon(0 0,100% 0,100% 100%); }
  .panel::after { bottom:0; left:0; clip-path:polygon(0 0,0 100%,100% 100%); }
  .head { display:flex; align-items:center; gap:12px; }
  .head svg { width:30px; height:30px; stroke:var(--red); fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex:none;
    filter:drop-shadow(0 0 4px var(--glow)); }
  .head .lbl, .lbl { font-family:'Exo 2'; font-style:italic; font-weight:600; font-size:16px; letter-spacing:.8px; color:#e8e8ea; }
  .num { font-family:'Exo 2'; font-style:italic; font-weight:900; line-height:1; color:#fff; white-space:nowrap;
    text-shadow:0 0 18px rgba(255,255,255,.12); }
  .num small { font-weight:600; font-size:.36em; color:var(--dim); margin-left:8px; letter-spacing:.5px; }
  .bar { height:8px; background:#26272b; margin-top:12px; border-radius:2px; overflow:hidden; }
  .bar i { display:block; height:100%; width:0; background:linear-gradient(90deg, var(--red2), var(--red)); box-shadow:0 0 8px var(--glow); transition:width .45s; }

  /* ── HOME ── */
  .home { display:grid; grid-template-columns:1fr 1fr; gap:18px; align-items:stretch; }
  .mapbox { position:relative; padding:0; min-height:560px; }
  #map { position:absolute; inset:0; }
  .compass { position:absolute; top:16px; left:16px; z-index:2; width:44px; height:54px; border:1px solid #333; background:rgba(10,10,12,.85);
    border-radius:6px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; font-family:'Exo 2'; font-weight:700; font-size:12px; }
  .compass i { width:0; height:0; border-left:7px solid transparent; border-right:7px solid transparent; border-bottom:16px solid var(--red); }
  .coords { position:absolute; left:16px; bottom:16px; z-index:2; display:flex; gap:10px; align-items:center; padding:10px 14px;
    background:rgba(10,10,12,.88); border:1px solid #333; border-radius:6px; font-family:'Exo 2'; font-size:15px; }
  .coords svg { width:22px; height:22px; fill:var(--red); }
  .coords span { display:block; font-size:12px; color:var(--dim); font-family:Sarabun; }
  .zoom { position:absolute; right:16px; bottom:40px; z-index:2; display:flex; flex-direction:column; border:1px solid #333; border-radius:6px; overflow:hidden; }
  .zoom button { width:40px; height:38px; background:rgba(10,10,12,.88); color:#ddd; border:0; font-size:22px; cursor:pointer; }
  .zoom button + button { border-top:1px solid #333; }
  .zoom #follow { display:flex; align-items:center; justify-content:center; }
  .zoom #follow svg { width:22px; height:22px; fill:none; stroke:#8a8c93; stroke-width:2; stroke-linecap:round; }
  .zoom #follow.on svg { stroke:var(--red); filter:drop-shadow(0 0 4px var(--glow)); }
  .right { display:grid; grid-template-rows:auto auto 1fr; gap:18px; min-width:0; }
  .rpm .num { font-size:clamp(52px,6vw,84px); margin-top:8px; }
  .shift { position:absolute; top:18px; right:22px; text-align:right; }
  .shift .t { font-family:'Exo 2'; font-style:italic; font-size:13px; color:#ddd; letter-spacing:.6px; }
  .shift .d { display:flex; gap:7px; margin-top:6px; justify-content:flex-end; }
  .shift .d b { width:11px; height:11px; border-radius:50%; border:1px solid #555; }
  .shift .d b.on { background:var(--red); border-color:var(--red); box-shadow:0 0 8px var(--red); }
  .shift.flash .d b.on { animation:pulse .25s infinite; }
  .seg { display:flex; gap:3px; height:28px; margin-top:14px; padding:4px 6px; border:1px solid #3a2226; border-radius:6px; transform:skewX(-14deg); background:#0d0d10; }
  .seg i { flex:1; background:#222327; border-radius:1px; }
  .seg i.on { background:linear-gradient(180deg, #ff4b55, var(--red2)); box-shadow:0 0 6px var(--glow); }
  .two { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
  .two .num { font-size:clamp(44px,5vw,70px); margin-top:6px; padding-left:42px; }
  .grid4 { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
  .grid4 .num { font-size:clamp(32px,3.4vw,46px); margin-top:8px; padding-left:42px; }

  /* ── SENSOR ── */
  .sgrid { display:grid; grid-template-columns:repeat(auto-fill, minmax(230px,1fr)); gap:16px; }
  .sgrid .num { font-size:clamp(30px,3vw,40px); margin-top:8px; padding-left:42px; }
  /* ── GRAPH (แบบเดียวกับหน้ากราฟในแอป: กราฟรวมกรอบเดียว + ติ๊กเปิด/ปิดเส้น + การ์ดค่าด้านขวา) ── */
  .gwrap { display:flex; flex-direction:column; gap:12px; }
  .legend { display:flex; flex-wrap:wrap; align-items:center; gap:10px 26px; }
  .lg { display:flex; align-items:center; gap:9px; cursor:pointer; user-select:none; -webkit-tap-highlight-color:transparent; }
  .lg .bx { width:26px; height:26px; border:2px solid var(--c); border-radius:5px; display:flex; align-items:center; justify-content:center; flex:none; }
  .lg .bx i { width:14px; height:14px; border-radius:2px; background:var(--c); }
  .lg b { display:block; font-family:'Exo 2'; font-style:italic; font-weight:800; font-size:14px; color:var(--c); letter-spacing:.5px; line-height:1.1; }
  .lg span { display:block; font-family:'Exo 2'; font-size:10px; color:var(--dim); }
  .lg.off .bx { border-color:#3a3b40; } .lg.off .bx i { background:transparent; }
  .lg.off b { color:var(--mute); } .lg.off span { color:#3a3b40; }
  .ghint { margin-left:auto; font-size:12px; color:var(--dim); text-align:right; }
  .gbody { display:grid; grid-template-columns:1fr 220px; gap:14px; height:clamp(340px, calc(100vh - 290px), 640px); }
  .plotcol { display:flex; flex-direction:column; min-width:0; }
  .plotrow { flex:1; display:flex; min-height:0; }
  .ticks { position:relative; width:38px; flex:none; }
  .ticks b { position:absolute; right:6px; transform:translateY(-50%); font-family:'Exo 2'; font-size:11px; font-weight:600; color:#00ffff; }
  .plot { position:relative; flex:1; border:1px solid #3a2226; background:#050505; touch-action:none; cursor:crosshair; min-width:0; }
  .plot canvas { position:absolute; inset:0; width:100%; height:100%; display:block; }
  .tlabel { display:flex; justify-content:space-between; padding:5px 0 0 38px; font-family:'Exo 2'; font-size:12px; color:var(--dim); }
  .rail { display:grid; grid-template-rows:repeat(6,1fr); gap:6px; min-height:0; }
  .rc { position:relative; display:flex; flex-direction:column; justify-content:center; padding:4px 10px 4px 20px; min-height:0;
    background:#0b0b0b; border:1.6px solid var(--c); clip-path:polygon(0 0,calc(100% - 9px) 0,100% 9px,100% 100%,9px 100%,0 calc(100% - 9px)); }
  .rc.off { --c:#3a3b40 !important; }
  .rc .top2 { display:flex; justify-content:space-between; gap:6px; font-family:'Exo 2'; font-size:12px; color:var(--dim); }
  .rc .top2 em { font-style:normal; font-size:10px; color:var(--mute); } .rc.scr .top2 em { color:var(--c); }
  .rc .v { font-family:'Exo 2'; font-style:italic; font-weight:900; font-size:clamp(18px,2vw,26px); color:var(--c); line-height:1.05; white-space:nowrap; }
  .rc .lv { position:absolute; left:6px; top:7px; bottom:7px; width:7px; display:flex; flex-direction:column-reverse; gap:3px; }
  .rc .lv i { flex:1; border-radius:50%; border:1px solid var(--c); opacity:.35; }
  .rc .lv i.on { background:var(--c); opacity:1; box-shadow:0 0 5px var(--c); }
  /* ── DTC ── */
  .dtcs { display:grid; gap:14px; }
  .code { font-family:'Exo 2'; font-style:italic; font-weight:900; font-size:34px; color:#fff; }
  .ok { text-align:center; padding:48px 10px; }
  .ok .num { font-size:44px; color:var(--green); text-shadow:0 0 18px rgba(61,255,138,.35); }

  .note { font-size:13px; color:var(--mute); text-align:center; padding:10px 0 4px; }
  .car { width:22px; height:22px; border-radius:50%; background:var(--red); border:4px solid #fff; box-shadow:0 0 0 3px rgba(255,30,45,.35), 0 0 18px var(--red); }
  .maplibregl-ctrl-attrib { font-size:10px; }

  /* ── จอแคบ: แท็บเล็ตตั้ง / มือถือ ── */
  @media (max-width:1000px) {
    .home { grid-template-columns:1fr; } .mapbox { min-height:46vh; }
    .gbody { grid-template-columns:1fr; height:auto; } .plotcol { height:52vh; min-height:260px; }
    .rail { grid-template-columns:repeat(3,1fr); grid-template-rows:none; } .rc { min-height:58px; }
    .ghint { margin-left:0; width:100%; text-align:left; }
  }
  @media (max-width:640px) {
    header { padding:10px 14px; gap:10px; } header .logo { height:28px; } header .sep { display:none; }
    header .who b { font-size:16px; } header .who span { font-size:12px; }
    .live .pill { font-size:14px; padding:4px 12px; } .live .dot { display:none; }
    .eye { padding:4px 9px; gap:5px; } .eye svg { width:16px; height:16px; } .eye b { font-size:14px; }
    nav { width:calc(100% - 24px); margin-top:10px; } nav button { min-height:44px; font-size:12px; gap:5px; } nav button svg { width:17px; height:17px; }
    nav button.on { clip-path:polygon(0 0,100% 0,calc(100% - 12px) 100%,0 100%); }
    main { padding:12px; }
    .two, .grid4, .right, .home, .sgrid { gap:12px; }
    .legend { gap:10px 16px; } .lg .bx { width:22px; height:22px; } .lg .bx i { width:11px; height:11px; }
    .panel { padding:12px 14px; }
    .head svg { width:24px; height:24px; } .head .lbl { font-size:14px; }
    .two .num, .grid4 .num, .sgrid .num { padding-left:0; }
    .sgrid { grid-template-columns:1fr 1fr; }
    .shift { top:12px; right:14px; } .shift .t { font-size:11px; } .shift .d { gap:5px; } .shift .d b { width:9px; height:9px; }
    .coords { font-size:12px; padding:8px 10px; }
  }
  @media (prefers-reduced-motion: reduce) { * { transition:none !important; animation:none !important; } }

  /* ══ ปุ่ม / ฟอร์มเข้าห้อง ของหน้า live (10 ต.ค. 2569) · หน้าแรกใช้ site.css แยก ══ */
  a { color:inherit; }
  .btn { -webkit-appearance:none; appearance:none; display:inline-flex; align-items:center; justify-content:center; gap:10px;
    min-height:48px; padding:0 26px; border:1px solid var(--red); color:#fff; text-decoration:none; cursor:pointer;
    font-family:'Exo 2'; font-style:italic; font-weight:800; font-size:16px; letter-spacing:.6px;
    background:linear-gradient(180deg, #3a070b, #8d0c15); box-shadow:0 0 18px rgba(255,30,45,.25);
    clip-path:polygon(0 0,100% 0,calc(100% - 14px) 100%,0 100%); }
  .btn.ghost { background:rgba(12,12,14,.8); border-color:#4a2a2e; }
  .btn:disabled { opacity:.4; cursor:not-allowed; }
  .join { display:grid; gap:14px; }
  .join .row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
  .join label { display:block; font-family:'Exo 2'; font-style:italic; font-size:13px; color:var(--dim); margin-bottom:6px; letter-spacing:.6px; }
  .join input { width:100%; height:56px; padding:0 14px; background:#08080a; border:1px solid #3a2226; color:#fff; border-radius:4px;
    font-family:'Exo 2'; font-style:italic; font-weight:800; font-size:26px; letter-spacing:6px; text-transform:uppercase; }
  .join input:focus { outline:none; border-color:var(--red); box-shadow:0 0 0 3px rgba(255,30,45,.2); }
  .join input::placeholder { color:#3a3b40; letter-spacing:6px; }
  .join .msg { min-height:20px; font-size:14px; color:var(--amber); }
  .join .msg.bad { color:var(--red); }
  .join .hint { font-size:13px; color:var(--mute); }

  /* หน้า live: กล่องเข้าห้องทับหน้าจอ (แทน .gate เดิม) */
  .gate { position:fixed; inset:0; background:rgba(6,6,6,.94); display:none; align-items:center; justify-content:center; padding:20px; z-index:3000; }
  .gate.on { display:flex; }
  .gate .panel { width:min(460px, 100%); }
  .gate .logo2 { display:block; width:min(300px, 70%); margin:4px auto 14px; }
  .gate h2 { margin:0 0 6px; font-family:'Exo 2'; font-style:italic; font-weight:800; font-size:20px; text-align:center; }
  .gate .back { display:block; text-align:center; margin-top:12px; font-size:13px; color:var(--dim); }
  .rtag { font-family:'Exo 2'; font-style:italic; font-weight:700; font-size:13px; color:var(--dim); padding:5px 12px;
    border:1px solid #3a2226; border-radius:22px; white-space:nowrap; }
  .rtag:empty { display:none; }
  header a.home { display:block; }

  @media (max-width:640px) {
    .join input { font-size:22px; letter-spacing:4px; height:52px; } .rtag { display:none; }
  }

