/* ===== Original look (QEW 90K calculator) ===== */
:root{--p:#2563eb;--s:#10b981;--g:#6b7280;--d:#ef4444;--cot-ok:#10b981;--cot-fail:#ef4444;--warn:#d97706}
body{font-family:Segoe UI,sans-serif;background:#f3f4f6;margin:0;padding:20px;color:#1f2937}
.c{max-width:900px;margin:auto;background:#fff;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,.1);overflow:hidden;position:relative}
header{background:var(--p);color:#fff;padding:1.5rem;text-align:center;position:relative}
h1{margin:0;font-size:1.8rem}
.i{font-size:.9rem;opacity:.9;margin-top:.5rem}
.n{padding:2rem}
.g{margin-bottom:1.2rem}
label{display:block;margin-bottom:.4rem;font-weight:600;color:var(--g);font-size:0.95rem}
input,select{border:1px solid #d1d5db;border-radius:8px;font-size:1rem;box-sizing:border-box;font-family:inherit;background:#fff;color:inherit}
input.e{border-color:var(--d)}
button{background:var(--p);color:#fff;border:none;padding:.75rem 1.5rem;border-radius:8px;font-size:1rem;cursor:pointer;margin-top:1rem;width:100%;font-family:inherit}
button:hover{background:#1d4ed8}
button:disabled{opacity:.6;cursor:wait}
.share-btn{background:#10b981;color:#fff;margin-top:.5rem}
.share-btn:hover{background:#059669}
table{width:100%;border-collapse:collapse;margin-top:1.5rem;font-size:1rem;min-width:700px}
th{background:#f8fafc;padding:.8rem;text-align:left;border-bottom:2px solid #e5e7eb;color:var(--g);font-weight:600}
td{padding:.8rem;border-bottom:1px solid #e5e7eb;font-size:0.95rem}
tr:hover{background:#f9fafb}
.h{font-weight:bold}
.cot-ok{color:var(--cot-ok)}
.cot-fail{color:var(--cot-fail);font-weight:bold}
.cot-tight{color:var(--warn);font-weight:bold}
.t{background:#ecfdf5;font-weight:bold}
.total-left{text-align:left}
.total-center{text-align:center}
.total-right{text-align:right}
.o{font-size:.85rem;color:var(--g);margin-top:1rem}
.lang-switch{position:absolute;top:10px;right:10px;font-size:0.9rem;z-index:10;color:#fff}
.lang-link{color:#fff;text-decoration:underline;cursor:pointer;margin:0 5px;font-weight:600}
.lang-link.active{color:#fbbf24}

.input-row{display:flex;gap:1.5rem;align-items:flex-end;margin-bottom:1.8rem;flex-wrap:wrap}
.input-group{flex:1;min-width:220px;display:flex;flex-direction:column}
.input-group label{margin-bottom:0.35rem}

.pace-row{display:flex;gap:0.5rem;align-items:center}
.pace-input{flex:1;min-width:0;padding:0.65rem 0.8rem;font-size:0.95rem}
.pace-row .pace-input{flex:1 1 auto;width:auto;font-variant-numeric:tabular-nums}
.pace-row .name-input{flex:1.4 1 auto}
.unit-box{box-sizing:border-box;flex:none;white-space:nowrap;padding:0.65rem 0.8rem;font-size:0.85rem;background:#f3f4f6;border:1px solid #d1d5db;border-radius:8px;text-align:center;color:#6b7280}

.result-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem;padding:0 8px;font-weight:600}
.team-name{color:var(--p);font-size:1.25rem;font-weight:700}
.by-arj{font-size:0.9rem;color:#4b5563;text-align:right;line-height:1.3}

#capture-area{padding:15px;background:#fff;border:1px solid #e5e7eb;border-radius:10px;box-shadow:0 2px 8px rgba(0,0,0,.05);overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}

.pace-head{display:flex;justify-content:space-between;align-items:center;gap:.5rem;margin-bottom:.4rem}
.pace-head label{margin:0}
.unit-switch{display:inline-flex;gap:2px;padding:3px;background:#e5e7eb;border-radius:8px;flex:none}
.unit-switch button{width:auto;margin:0;padding:.3rem .85rem;background:transparent;color:var(--g);font-size:.85rem;font-weight:600;border-radius:6px}
.unit-switch button:hover{background:rgba(0,0,0,.06)}
.unit-switch button[aria-pressed=true]{background:#fff;color:var(--p);box-shadow:0 1px 2px rgba(0,0,0,.12)}
.theme-toggle{position:absolute;top:6px;left:8px;z-index:10;width:36px;height:36px;margin:0;padding:0;border-radius:50%;background:transparent;color:#fff;display:grid;place-items:center}
.theme-toggle:hover{background:rgba(255,255,255,.18)}
.theme-toggle svg{width:22px;height:22px}

/* ===== Additions for the paid version ===== */
.plan-pill{width:auto;margin:.8rem 0 0;padding:.25rem .9rem;border-radius:999px;font-size:.8rem;font-weight:700;letter-spacing:.04em;background:rgba(255,255,255,.18);color:#fff}
.plan-pill:hover{background:rgba(255,255,255,.3)}
.plan-pill.pro{background:#fbbf24;color:#1f2937}
.tag{font-size:.65rem;background:#fbbf24;color:#1f2937;padding:1px 6px;border-radius:5px;vertical-align:middle;font-weight:700}
body.is-pro .tag{display:none}
select.pace-input,.pace-input.full{width:100%}
.ghost{background:transparent;color:var(--p);border:1px solid #c7d2fe}
.ghost:hover{background:#eef2ff}
.slim{width:auto}
.btn-row{display:flex;gap:.5rem;flex-wrap:wrap}
.btn-row>button,.btn-row>label{flex:1;margin-top:.5rem}
.file-btn{display:flex;align-items:center;justify-content:center;border-radius:8px;padding:.75rem 1rem;cursor:pointer;font-size:1rem;font-weight:400;margin-bottom:0}
.pro{border:1px dashed #c7d2fe;border-radius:10px;padding:.8rem 1rem;margin-bottom:.5rem}
.pro summary{cursor:pointer;font-weight:600;color:var(--g)}
.pro[open] summary{margin-bottom:1rem}
.input-row.tight{margin-bottom:1rem;gap:1rem}
.input-row.tight .input-group{min-width:140px}
.check{display:flex;align-items:center;gap:.5rem;font-weight:500;margin-bottom:.8rem}
.check input{width:auto;margin:0}
.check.live{margin-top:1rem}
.cot-note{color:#dc2626;font-weight:600}
.msg{color:var(--p);min-height:1.1em}
.msg.err{color:var(--d)}
.cot-box{display:flex;flex-direction:column;gap:.35rem;padding:0 8px;font-size:.92rem}
.cot-box .tip{font-size:.82rem;color:var(--g);font-weight:400}
.temp{display:block;font-size:.75rem;color:var(--g)}
tr.actual td{background:#eff6ff}
td input[type=time]{padding:.3rem .4rem;font-size:.85rem}
.gps{border:1px solid #bbf7d0;background:#f0fdf4;border-radius:10px;padding:.2rem 1rem 1rem;margin-bottom:.5rem}
.gps .check{margin-top:.8rem}
.gps-status{background:#fff;border-radius:8px;padding:.8rem;font-size:.95rem;line-height:1.5;border:1px solid #d1fae5}
.gps-status b{color:var(--p)}
.gps-status .warn{color:var(--warn);font-weight:600}
.bar{height:8px;background:#e5e7eb;border-radius:99px;overflow:hidden;margin:.4rem 0}
.bar>i{display:block;height:100%;background:var(--s)}
tr.live-now td{background:#ecfdf5}
.saved{margin-top:2rem;border-top:1px solid #e5e7eb;padding-top:1.2rem}
.saved h2{margin:0;font-size:1.1rem}
.teams{list-style:none;padding:0;margin:.8rem 0 0}
.teams li{display:flex;justify-content:space-between;align-items:center;gap:.5rem;padding:.4rem 0;border-bottom:1px solid #e5e7eb}
.teams li button{width:auto;margin:0;padding:.4rem .8rem;font-size:.85rem}
.teams .empty{color:var(--g);font-size:.9rem}
dialog{border:none;border-radius:12px;padding:1.5rem;width:min(440px,calc(100% - 32px));box-shadow:0 10px 40px rgba(0,0,0,.3)}
dialog::backdrop{background:rgba(15,23,42,.55)}
dialog h2{margin-top:0;color:var(--p)}
.perks{padding-left:1.2rem;color:var(--g);font-size:.92rem}
.buy{color:var(--p);font-size:.9rem}

/* ===== Dark mode ===== */
html[data-theme=dark]{color-scheme:dark}
html[data-theme=dark] body{background:#0b1220;color:#e5e7eb}
html[data-theme=dark] .c{background:#1e293b;box-shadow:0 4px 20px rgba(0,0,0,.5)}
html[data-theme=dark] header{background:#1e40af}
html[data-theme=dark] label{color:#94a3b8}
html[data-theme=dark] input,html[data-theme=dark] select{background:#0f172a;color:#e5e7eb;border-color:#334155}
html[data-theme=dark] input::placeholder{color:#64748b}
html[data-theme=dark] input.e{border-color:var(--d)}
html[data-theme=dark] .unit-box{background:#334155;border-color:#334155;color:#cbd5e1}
html[data-theme=dark] .o{color:#94a3b8}
html[data-theme=dark] .cot-note{color:#f87171}
html[data-theme=dark] .msg{color:#93c5fd}
html[data-theme=dark] #capture-area{background:#1e293b;border-color:#334155}
html[data-theme=dark] th{background:#0f172a;color:#94a3b8;border-bottom-color:#334155}
html[data-theme=dark] td{border-bottom-color:#334155}
html[data-theme=dark] tr:hover{background:#273449}
html[data-theme=dark] tr.actual td{background:#172554}
html[data-theme=dark] .t{background:#064e3b}
html[data-theme=dark] .team-name{color:#60a5fa}
html[data-theme=dark] .by-arj{color:#94a3b8}
html[data-theme=dark] .unit-switch{background:#0f172a}
html[data-theme=dark] .unit-switch button{color:#94a3b8}
html[data-theme=dark] .unit-switch button:hover{background:rgba(255,255,255,.06)}
html[data-theme=dark] .unit-switch button[aria-pressed=true]{background:#334155;color:#93c5fd}
html[data-theme=dark] .cot-ok{color:#34d399}
html[data-theme=dark] .cot-fail{color:#f87171}
html[data-theme=dark] .cot-tight{color:#fbbf24}
html[data-theme=dark] .ghost{color:#93c5fd;border-color:#334155}
html[data-theme=dark] .ghost:hover{background:#273449}
html[data-theme=dark] .pro{border-color:#334155}
html[data-theme=dark] .gps{background:#052e16;border-color:#14532d}
html[data-theme=dark] .gps-status{background:#0f172a;border-color:#14532d}
html[data-theme=dark] .gps-status b{color:#93c5fd}
html[data-theme=dark] .bar{background:#334155}
html[data-theme=dark] tr.live-now td{background:#064e3b}
html[data-theme=dark] .saved,html[data-theme=dark] .teams li{border-color:#334155}
html[data-theme=dark] dialog{background:#1e293b;color:#e5e7eb}
html[data-theme=dark] dialog h2,html[data-theme=dark] .buy{color:#93c5fd}

@media(max-width:600px){
  .n{padding:1.2rem}
  td,th{padding:.5rem;font-size:0.85rem}
  .input-row{flex-direction:column;gap:1rem}
  .input-group{min-width:100%}
  .input-row.tight{flex-direction:row}
  .input-row.tight .input-group{min-width:0}
  body{padding:12px}
  header{padding-top:2.2rem}
  .pace-row{gap:0.4rem}
  .pace-input{padding:0.6rem 0.7rem;font-size:0.9rem}
  .unit-box{padding:0.6rem 0.7rem;font-size:0.8rem}
  .result-header{flex-direction:column;text-align:center;gap:.4rem}
  .team-name{font-size:1.15rem}
  .by-arj{font-size:0.85rem}
  .t{font-size:0.85rem}
  .total-center,.total-right{font-size:0.85rem}
  table{min-width:650px}
}

/* ===== Weather (Pro) ===== */
.wx{margin:.2rem 0 1rem}
.wx .ghost{width:100%;margin-top:0}
.wx-chip{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-top:.5rem;padding:.5rem .7rem;border-radius:8px;background:#eff6ff;color:#1e40af;font-size:.88rem}
.icon-x{width:auto;margin:0;padding:.1rem .5rem;background:transparent;color:inherit;font-size:.9rem}
.icon-x:hover{background:rgba(0,0,0,.06)}
input:disabled{opacity:.5}
.wx-table{overflow-x:auto;margin-top:.5rem}
.wx-table table{min-width:0;margin-top:0;font-size:.82rem}
.wx-table th,.wx-table td{padding:.35rem .4rem;text-align:center;white-space:nowrap}
.wx-table td:first-child,.wx-table th:first-child{text-align:left}
.wx-table .feels{display:block;font-size:.72rem;color:var(--g)}
.wx-table .hot{color:#dc2626;font-weight:600}
.wx-note{font-size:.8rem;color:var(--g);padding:0 8px}
html[data-theme=dark] .wx-chip{background:#172554;color:#bfdbfe}
html[data-theme=dark] .wx-table .hot{color:#f87171}

/* ===== Custom event (Pro) ===== */
.custom-box{margin-top:.8rem;padding:1rem;border:1px dashed #c7d2fe;border-radius:10px}
.custom-box>.ghost{margin-top:.4rem}
.leg-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(90px,1fr));gap:.5rem;margin-bottom:1rem}
.leg-grid label{font-size:.78rem;margin:0 0 .2rem;font-weight:500}
.leg-grid input{width:100%}
.cot-list{display:flex;flex-direction:column;gap:.4rem}
.cot-row{display:flex;gap:.4rem;align-items:center}
.cot-row select,.cot-row input{flex:1;padding:.55rem .6rem}
.cot-row .icon-x{flex:none}
html[data-theme=dark] .custom-box{border-color:#334155}
.cot-ctl{margin-top:.5rem}
.cot-ctl select{margin-bottom:.4rem}
.cot-ctl .ghost{margin-top:.4rem}
.mode-row{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.mode-row label{margin:0}
.mode-switch button{padding:.35rem 1rem}
.name-input:disabled{opacity:.6}

/* ===== Live tracking ===== */
.live-box{margin-top:2rem;border:1px solid #bbf7d0;border-radius:12px;padding:.9rem 1rem}
.live-box summary{cursor:pointer;font-weight:700;color:var(--s);font-size:1.05rem}
.live-box h3{font-size:1rem;margin:1.2rem 0 .6rem}
.live-box .share-btn{display:block}
#ltOwner{border-top:1px solid #e5e7eb;margin-top:1.2rem}
.lt-code{font:700 1.1rem/1.2 ui-monospace,Consolas,monospace;letter-spacing:.06em}
.teams li .lt-actions{display:flex;gap:.3rem;flex-wrap:wrap;justify-content:flex-end}
a.ghost{text-decoration:none;text-align:center}
html[data-theme=dark] .live-box{border-color:#14532d}
html[data-theme=dark] #ltOwner{border-color:#334155}

/* ===== Live dashboard ===== */
.lb-tools{display:flex;gap:.5rem;margin-bottom:.6rem}
.lb-tools input{flex:2}.lb-tools select{flex:1}
.lb-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:.8rem;margin-top:.8rem}
.lb-card{border:1px solid #e5e7eb;border-radius:12px;padding:.8rem .9rem;background:#fff}
.lb-card.stale{opacity:.6}
.lb-card.wait{border-style:dashed}
.lb-who{margin-bottom:.3rem}
.lb-leg{font-size:.92rem}
.lb-badge{display:inline-block;background:var(--p);color:#fff;border-radius:6px;padding:0 .45rem;font-size:.8rem;font-weight:700;margin-right:.25rem}
.lb-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.4rem;margin-top:.4rem}
.lb-grid small{display:block;font-size:.72rem}
.lb-seen{margin-top:.4rem;font-size:.78rem}
html[data-theme=dark] .lb-card{background:#0f172a;border-color:#334155}
.lb-map{height:340px;border-radius:12px;border:1px solid #e5e7eb;margin:.4rem 0 .3rem;z-index:0}
.lb-card{cursor:pointer}
.lb-card .gmaps{font-size:.8rem;color:var(--p)}
.leaflet-tooltip.lb-tip{font-weight:600;font-size:11px;padding:1px 5px}
html[data-theme=dark] .lb-map{border-color:#334155}
@media(max-width:600px){.lb-map{height:280px}}

/* ---------- Q&A page ---------- */
.foot-links{margin-top:2rem;text-align:center;font-size:.9rem}
.foot-links a{color:var(--p);text-decoration:none;font-weight:600}
.fq-chips{display:flex;flex-wrap:wrap;gap:.4rem;margin:.9rem 0 .4rem}
.fq-chip{width:auto;margin:0;padding:.35rem .75rem;font-size:.82rem;border-radius:999px;background:#eef2ff;color:var(--p);border:1px solid #c7d2fe;font-weight:600}
.fq-chip.on{background:var(--p);color:#fff;border-color:var(--p)}
.fq-sec{font-size:1rem;margin:1.4rem 0 .5rem;color:var(--p)}
.fq-item{border:1px solid #e5e7eb;border-radius:10px;margin:.45rem 0;background:rgba(255,255,255,.6)}
.fq-item summary{cursor:pointer;padding:.75rem .9rem;font-weight:600;font-size:.95rem;list-style:none;position:relative;padding-right:2rem}
.fq-item summary::-webkit-details-marker{display:none}
.fq-item summary::after{content:"+";position:absolute;right:.9rem;top:.65rem;font-size:1.1rem;color:var(--g)}
.fq-item[open] summary::after{content:"–"}
.fq-a{padding:0 .9rem .85rem;font-size:.92rem;line-height:1.55}
.fq-a ol,.fq-a ul{margin:.4rem 0;padding-left:1.2rem}
.fq-a code{background:#f1f5f9;padding:0 .3rem;border-radius:4px;font-size:.85em}
.fq-tw{overflow-x:auto}
.fq-table{width:100%;min-width:0;margin-top:.3rem;border-collapse:collapse;font-size:.85rem}
.fq-table th,.fq-table td{border-bottom:1px solid #e5e7eb;padding:.45rem .4rem;text-align:left;vertical-align:top}
.fq-table th:not(:first-child),.fq-table td:not(:first-child){text-align:center;width:26%;font-size:.8rem}
.fq-table thead th{background:#eef2ff;color:var(--p)}
html[data-theme=dark] .fq-item{background:rgba(15,23,42,.5);border-color:#334155}
html[data-theme=dark] .fq-table th,html[data-theme=dark] .fq-table td{border-color:#334155}
html[data-theme=dark] .fq-table thead th,html[data-theme=dark] .fq-chip:not(.on){background:#1e293b;color:#93c5fd;border-color:#334155}
html[data-theme=dark] .fq-a code{background:#1e293b}
html[data-theme=dark] .fq-sec,html[data-theme=dark] .foot-links a{color:#93c5fd}
