* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
}

a { color: inherit; }

/* ---------- Gedeelde header ---------- */
header.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: #111827;
    border-bottom: 1px solid #1f2937;
    flex-wrap: wrap;
}

header.topbar h1 {
    font-size: 16px;
    margin: 0;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #1f2937;
}

.fs-btn {
    background: #1f2937;
    border: 1px solid #334155;
    color: #e2e8f0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
}

.dot.ok { background: #22c55e; }
.dot.error { background: #ef4444; }
.dot.warn { background: #f59e0b; }

/* ---------- Mobiele zender ---------- */
.mobile-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 40px;
    gap: 20px;
    min-height: calc(100% - 56px);
}

.banner {
    width: 100%;
    max-width: 420px;
    background: #78350f;
    border: 1px solid #b45309;
    color: #fde68a;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.card {
    width: 100%;
    max-width: 420px;
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 16px;
    padding: 20px;
}

.big-button {
    width: 100%;
    max-width: 420px;
    padding: 22px;
    font-size: 20px;
    font-weight: 700;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    color: white;
    background: #16a34a;
    transition: background .15s ease;
}

.big-button.sharing { background: #dc2626; }
.big-button:active { transform: scale(0.98); }

.readout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.readout {
    background: #0f172a;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.readout .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #94a3b8;
}

.readout .value {
    font-size: 22px;
    font-weight: 700;
    margin-top: 4px;
}

.readout.speed .value { color: #38bdf8; }

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

.token-row input {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 14px;
}

.token-row button {
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    background: #334155;
    color: white;
    cursor: pointer;
}

.hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 10px;
    line-height: 1.5;
}

/* ---------- Website viewer ---------- */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: calc(100% - 56px);
}

@media (max-width: 800px) {
    .split { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
}

.pane {
    position: relative;
    height: 100%;
    width: 100%;
    border-right: 1px solid #1f2937;
}

.pane:only-child {
    border-right: none;
}

.full-map {
    height: calc(100% - 56px);
}

#map, #pano {
    height: 100%;
    width: 100%;
}

.overlay-stats {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 500;
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    min-width: 150px;
}

.overlay-stats.large {
    padding: 16px 22px;
    min-width: 180px;
}

.overlay-stats.large .speed-value {
    font-size: 48px;
}

.overlay-stats.large .speed-unit {
    font-size: 16px;
}

.overlay-stats .speed-value {
    font-size: 26px;
    font-weight: 800;
    color: #38bdf8;
}

.overlay-stats .speed-unit {
    font-size: 12px;
    color: #94a3b8;
}

.follow-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 500;
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid #1f2937;
    color: #e2e8f0;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
}

.follow-btn.active { border-color: #22c55e; color: #22c55e; }

.highway-badge {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    z-index: 500;
    display: none;
    align-items: center;
    gap: 6px;
    background: #7c2d12;
    border: 1px solid #f97316;
    color: #fed7aa;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.highway-badge.active { display: inline-flex; }

#panoEmpty {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 400;
    text-align: center;
    max-width: 260px;
}

.arrow-icon {
    width: 22px;
    height: 22px;
    display: block;
}

/* ---------- Ritgeschiedenis ---------- */
.history-layout {
    display: flex;
    height: calc(100% - 56px);
}

@media (max-width: 800px) {
    .history-layout { flex-direction: column; }
    .trip-sidebar { width: 100% !important; max-height: 35%; }
}

.trip-sidebar {
    width: 300px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid #1f2937;
    padding: 12px;
}

.history-map {
    flex: 1;
    position: relative;
}

.trip-item {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
}

.trip-item:hover { border-color: #334155; }
.trip-item.active { border-color: #38bdf8; }

.trip-item .trip-date {
    font-weight: 700;
    font-size: 14px;
}

.trip-item .trip-stats {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* ---------- Bovenbalk verbergen: bij fullscreen, of automatisch op snelheid (carmap.html) ---------- */
.hide-topbar header.topbar {
    display: none;
}

.hide-topbar .full-map,
.hide-topbar .split,
.hide-topbar .history-layout {
    height: 100%;
}

.icon-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
