* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: #f4f6fa;
  color: #0f172a;
  font-family: 'IBM Plex Sans Thai', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: #1f5fd6; }
a:hover { color: #1a4fb0; }
[hidden] { display: none !important; }

.demo-bar {
  background: #0f172a; color: #cbd5e1; text-align: center;
  font-size: 11.5px; padding: 5px 16px;
}

/* ---------- layout ---------- */
.app { display: flex; min-height: calc(100vh - 27px); }
.sidebar {
  width: 214px; flex: none; background: #fff; border-right: 1px solid #e8ecf4;
  padding: 18px 0 20px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .nav {
  padding: 9px 12px; border-radius: 9px; font-size: 13.5px; color: #475569;
  text-decoration: none; display: flex; align-items: center; gap: 6px;
}
.sidebar .nav:hover { background: #f4f6fa; color: #0f172a; }
.sidebar .nav.active { font-weight: 600; color: #1f5fd6; background: #eaf1fe; }
.sidebar .soon {
  margin-left: auto; font-size: 10px; color: #94a3b8; border: 1px solid #e2e8f0;
  border-radius: 999px; padding: 1px 6px; font-weight: 400;
}
.sidebar .only-cars { display: none; }
body[data-route="cars"] .sidebar .only-cars { display: block; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.desk, .wide { display: flex; flex-direction: column; flex: 1; }
.scroll-x { overflow-x: auto; flex: 1; display: flex; }
.wide { min-width: 1100px; }

.m-topbar { display: none; }
.hov:hover { background: #fafbfd; }
[data-expand] { cursor: pointer; }
[data-seg] > * { cursor: pointer; user-select: none; }

/* ---------- mobile frames ---------- */
.phone { min-height: 100vh; display: flex; justify-content: center; background: #e9edf4; }
.phone-inner {
  width: 100%; max-width: 440px; min-width: 0; min-height: 100vh; background: #f4f6fa;
  display: flex; flex-direction: column; box-shadow: 0 0 40px -20px rgba(15,23,42,.35);
}

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .desk [style*="repeat(5,minmax(0,1fr))"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .desk [style*="grid-template-columns:minmax(0,1.62fr) minmax(0,1fr)"] { grid-template-columns: minmax(0, 1fr) !important; }
  .desk header { height: auto !important; flex-wrap: wrap; padding: 12px 24px !important; }
}
@media (max-width: 900px) {
  .sidebar { width: 180px; }
  .desk [style*="repeat(5,minmax(0,1fr))"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 768px) {
  .demo-bar { display: none; }
  .sidebar { display: none; }
  .app { min-height: 100vh; }
  .m-topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 5; padding: 12px 16px;
    background: #fff; border-bottom: 1px solid #e8ecf4; font-size: 13px; font-weight: 600;
  }
  .m-topbar a { text-decoration: none; }
}
