/* Final clean adaptive layout loaded after base styles */

#heroVehicleName,
#diagnosticsButton,
#diagnosticsPanel,
#refreshPlanButton {
  display: none !important;
}

.session-table-wrap {
  margin-top: 14px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.session-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.session-table th,
.session-table td {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  text-align: left;
  white-space: nowrap;
}

.session-table th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.session-table th:nth-child(2),
.session-table th:nth-child(3),
.session-table td:nth-child(2),
.session-table td:nth-child(3) {
  text-align: right;
}

.session-table tr:last-child td {
  border-bottom: 0;
}

.charging-history-card h2 {
  margin-top: 2px;
  font-size: 1.15rem;
}

@media (max-width: 820px) {
  body {
    background:
      radial-gradient(circle at 50% 0%, rgba(47, 78, 170, 0.24), transparent 32rem),
      radial-gradient(circle at 50% 58%, rgba(52, 245, 166, 0.10), transparent 28rem),
      #05070b;
  }

  .app {
    max-width: none;
    width: 100%;
    padding: max(12px, env(safe-area-inset-top)) 12px 18px;
  }

  .topbar {
    margin-bottom: 10px;
    gap: 10px;
  }

  .topbar h1 {
    font-size: 1.55rem;
    letter-spacing: -0.05em;
  }

  .topbar .eyebrow {
    font-size: 0.58rem;
    margin-bottom: 2px;
  }

  .topbar-actions {
    display: flex !important;
    width: 100%;
    gap: 7px;
    overflow-x: auto;
    padding: 2px 0 6px;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .topbar-actions::-webkit-scrollbar {
    display: none;
  }

  .topbar-actions .status-pill,
  .topbar-actions .ghost-button,
  .topbar-actions button {
    width: auto !important;
    min-width: max-content;
    min-height: 34px;
    padding: 8px 13px;
    font-size: 0.78rem;
    border-radius: 999px;
    white-space: nowrap;
  }

  .topbar-actions .status-pill {
    min-width: 132px;
    justify-content: center;
  }

  .dashboard-grid {
    display: block;
  }

  .main-stack {
    display: block;
  }

  .hero-card {
    min-height: auto !important;
    margin-top: 0;
    margin-bottom: 10px;
  }

  .hero-background-glow {
    inset: 8% 10% auto !important;
    height: 360px !important;
    opacity: 0.7;
  }

  .polestar-image-stage {
    height: 405px !important;
    min-height: 405px !important;
    overflow: visible;
  }

  .polestar-image-stage::before {
    inset: 2% 0 5% !important;
    border-radius: 28px;
    opacity: 0.45;
  }

  .polestar-image-stage::after {
    left: 25% !important;
    right: 10% !important;
    bottom: 4% !important;
    height: 90px !important;
    filter: blur(24px) !important;
  }

  .polestar-image-model {
    width: min(238px, 62vw) !important;
    left: 61% !important;
    top: 4% !important;
    filter: drop-shadow(0 18px 26px rgba(0,0,0,0.62));
  }

  .polestar-top-image {
    image-rendering: auto;
  }

  .charge-port-image {
    width: 18px !important;
    height: 15px !important;
    border-radius: 5px;
  }

  .polestar-image-stage .charger-unit {
    left: 4px !important;
    top: 42% !important;
    transform: scale(0.50) !important;
    transform-origin: left top;
  }

  .polestar-image-stage .charge-cable path {
    stroke-width: 6 !important;
  }

  .hero-info {
    padding: 0 2px 0;
    margin-top: -22px;
  }

  .clean-hero-info h2 {
    font-size: 1.45rem !important;
  }

  .clean-hero-info .muted {
    font-size: 0.88rem;
    margin-top: 4px;
  }

  .glass-card,
  .card {
    border-radius: 22px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 16px 55px rgba(0, 0, 0, 0.30);
  }

  .chart-card {
    min-height: 222px;
    margin-top: 8px !important;
  }

  .chart-card .section-header {
    align-items: center;
    gap: 10px;
  }

  .chart-card .section-header h2 {
    display: none !important;
  }

  .chart-card .section-header .ghost-button {
    display: none !important;
  }

  .legend {
    gap: 12px;
    margin: 10px 0;
    font-size: 0.72rem;
  }

  .charging-graph {
    height: 140px;
    gap: 4px;
    padding: 8px 2px 30px;
  }

  .slot {
    min-width: 14px;
  }

  .slot-label {
    bottom: -24px;
    font-size: 8px;
  }

  .side-panel {
    display: block !important;
  }

  .battery-row strong,
  .metric-row strong {
    font-size: 1.62rem;
  }

  .battery-row,
  .metric-row {
    align-items: flex-start;
  }

  .card-label {
    font-size: 0.64rem;
    letter-spacing: 0.13em;
  }

  .muted {
    font-size: 0.88rem;
  }

  .rule-item,
  .item {
    border-radius: 17px;
    padding: 13px;
  }
}

@media (max-width: 390px) {
  .polestar-image-stage {
    height: 370px !important;
    min-height: 370px !important;
  }

  .polestar-image-model {
    width: min(220px, 62vw) !important;
    left: 63% !important;
  }

  .polestar-image-stage .charger-unit {
    transform: scale(0.44) !important;
  }

  .chart-card .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-card .section-header .ghost-button {
    width: 100%;
  }
}

@media (min-width: 821px) and (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rules-card,
  .charging-history-card {
    grid-column: 1 / -1;
  }
}
