:root {
  color-scheme: dark;
  --bg: #090909;
  --bg-soft: #11100f;
  --panel: #1a1917;
  --panel-strong: #24211e;
  --text: #fff7ec;
  --muted: #aaa29a;
  --muted-strong: #d3cbc0;
  --accent: #d9771f;
  --accent-bright: #f39a32;
  --accent-dark: #9f5014;
  --border: #34302b;
  --danger: #ff7777;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(217, 119, 31, 0.16), transparent 32rem),
    linear-gradient(180deg, #10100f 0%, var(--bg) 42%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(9, 9, 9, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--accent-bright), var(--accent-dark));
  color: #160d06;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-name,
.brand-subtitle {
  display: block;
}

.brand-name {
  overflow: hidden;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.header-action,
.button-primary,
.button-secondary,
.button-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 16px;
  font-weight: 900;
  text-align: center;
}

.header-action,
.button-primary {
  border: 0;
  background: var(--accent);
  color: #160d06;
  box-shadow: 0 12px 24px rgba(217, 119, 31, 0.22);
  cursor: pointer;
}

.header-action {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.button-primary {
  width: 100%;
}

.button-secondary {
  border: 1px solid rgba(243, 154, 50, 0.42);
  background: rgba(217, 119, 31, 0.14);
  color: var(--text);
}

.button-disabled {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.header-action:active,
.button-primary:active,
.button-secondary:active {
  transform: translateY(1px);
}

.page {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 22px 16px 104px;
}

.dashboard-hero,
.detail-hero,
.form-hero {
  margin-bottom: 20px;
}

.dashboard-hero {
  display: grid;
  gap: 18px;
  padding: 8px 0 2px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-bright);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 10vw, 3.5rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.08rem;
  letter-spacing: 0;
}

.hero-copy,
.vehicle-nickname,
.muted,
.detail-hero p {
  color: var(--muted);
}

.hero-copy {
  max-width: 34rem;
  margin-bottom: 0;
  font-size: 1rem;
}

.vehicle-grid,
.detail-grid {
  display: grid;
  gap: 16px;
}

.vehicle-card,
.empty-state,
.form-card,
.info-card,
.vehicle-profile {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(36, 33, 30, 0.96), rgba(24, 23, 21, 0.98));
  box-shadow: var(--shadow);
}

.vehicle-card {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.vehicle-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.vehicle-year,
.vehicle-card h2,
.vehicle-nickname {
  margin-bottom: 4px;
}

.vehicle-year {
  color: var(--accent-bright);
  font-size: 0.82rem;
  font-weight: 900;
}

.vehicle-card h2 {
  font-size: 1.3rem;
  line-height: 1.12;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(243, 154, 50, 0.34);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(217, 119, 31, 0.12);
  color: var(--accent-bright);
  font-size: 0.76rem;
  font-weight: 900;
}

.quick-specs,
.hero-stats {
  display: grid;
  gap: 10px;
}

.quick-specs div,
.hero-stats div {
  display: grid;
  gap: 2px;
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.quick-specs span,
.hero-stats span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-specs strong,
.hero-stats strong {
  color: var(--text);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.empty-state {
  padding: 24px;
}

.empty-state p {
  color: var(--muted);
}

.form-card {
  display: grid;
  gap: 18px;
  padding: 16px;
}

.form-section {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.form-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.form-section h2 {
  margin: 0;
  color: var(--muted-strong);
}

.field-row {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px 14px;
  background: #11100f;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

textarea {
  min-height: 132px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent-bright);
  outline: 3px solid rgba(217, 119, 31, 0.22);
}

.flash-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.flash {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px 14px;
  background: var(--panel-strong);
}

.flash-error {
  border-color: var(--danger);
  color: #ffd1d1;
}

.flash-success {
  border-color: var(--accent);
}

.vehicle-profile {
  padding: 20px;
}

.hero-stats {
  margin-top: 18px;
  grid-template-columns: 1fr;
}

.info-card {
  padding: 18px;
}

dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

dl div {
  display: grid;
  gap: 3px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

dl div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

dd {
  margin: 0;
  color: var(--muted-strong);
  overflow-wrap: anywhere;
}

.notes {
  margin-bottom: 0;
  color: var(--muted-strong);
  white-space: pre-wrap;
}

.bottom-nav {
  position: fixed;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto;
  padding: 8px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(18, 17, 16, 0.92);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px);
}

.bottom-nav a {
  display: grid;
  min-height: 48px;
  place-items: center;
  border-radius: 16px;
  color: var(--muted-strong);
  font-size: 0.92rem;
  font-weight: 900;
}

.bottom-nav .nav-add {
  background: var(--accent);
  color: #160d06;
}

@media (min-width: 720px) {
  .app-header {
    padding-inline: 28px;
  }

  .page {
    padding-inline: 28px;
    padding-bottom: 56px;
  }

  .dashboard-hero {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .hero-button,
  .button-primary {
    width: auto;
    justify-self: start;
  }

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

  .quick-specs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .field-row,
  .detail-grid,
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .full-width {
    grid-column: 1 / -1;
  }

  .bottom-nav {
    display: none;
  }
}
