@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: only light;
  --bg-primary: #f5f6f8;
  --bg: var(--bg-primary);
  --card-bg: #ffffff;
  --surface: #ffffff;
  --accent: #114f68;
  --ink: #1c1c1e;
  --ink-muted: #6b6b6f;
  --stroke: rgba(0, 0, 0, 0.08);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  --panel-border: rgba(0, 0, 0, 0.08);
  --panel-muted: rgba(0, 0, 0, 0.04);
  --chip-bg: rgba(0, 0, 0, 0.06);
  --overlay-bg: rgba(0, 0, 0, 0.04);
  --on-accent: #ffffff;
  --radius-lg: 16px;
  --radius-md: 12px;
  --status-ok: #27ae60;
  --status-warn: #f2c94c;
  --status-bad: #eb5757;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-primary: #0f1114;
  --bg: var(--bg-primary);
  --card-bg: #15181d;
  --surface: #15181d;
  --accent: #114f68;
  --ink: #f2f3f5;
  --ink-muted: #9aa0a6;
  --stroke: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-muted: rgba(255, 255, 255, 0.06);
  --chip-bg: rgba(255, 255, 255, 0.08);
  --overlay-bg: rgba(255, 255, 255, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-primary: #0f1114;
    --bg: var(--bg-primary);
    --card-bg: #15181d;
    --surface: #15181d;
    --accent: #114f68;
    --ink: #f2f3f5;
    --ink-muted: #9aa0a6;
    --stroke: rgba(255, 255, 255, 0.08);
    --shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-muted: rgba(255, 255, 255, 0.06);
    --chip-bg: rgba(255, 255, 255, 0.08);
    --overlay-bg: rgba(255, 255, 255, 0.05);
  }
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", "SF Pro Text", "Roboto", "Segoe UI", sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg-primary);
}

body.sheet-open {
  overflow: hidden;
  touch-action: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 24px 22px 32px;
  gap: 18px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  animation: slide-down 160ms ease-out;
}

.top-bar-fixed {
  position: fixed;
  top: 18px;
  left: 22px;
  right: 22px;
  z-index: 10;
}

.car-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}

.car-select-trigger {
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 10px;
  border-radius: 10px;
  font: inherit;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.car-name {
  font-size: 1.05rem;
}

.car-caret {
  color: var(--ink-muted);
  display: inline-flex;
  transition: transform 160ms ease-out;
}

.car-select.is-open .car-caret {
  transform: rotate(180deg);
}

.car-select-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 140ms ease-out, transform 140ms ease-out;
  z-index: 20;
}

.car-select.is-open .car-select-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.car-option {
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.car-option.is-active {
  border-color: rgba(47, 128, 237, 0.3);
  background: rgba(47, 128, 237, 0.08);
}

.car-option-add {
  color: var(--ink-muted);
}

.car-option:focus-visible,
.car-select-trigger:focus-visible {
  outline: 2px solid rgba(47, 128, 237, 0.35);
  outline-offset: 2px;
}

.car-settings {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.car-settings:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.car-settings-menu {
  position: absolute;
  top: 70px;
  right: 22px;
  min-width: 240px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 140ms ease-out, transform 140ms ease-out;
  z-index: 15;
}

.car-settings-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.settings-option {
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.settings-danger {
  color: var(--status-bad);
}

.content {
  display: block;
  background: transparent;
  border-radius: 0;
  border: none;
  min-height: 320px;
  position: relative;
  overflow: hidden;
  animation: fade-in 160ms ease-out 60ms both;
}

.content-offset {
  margin-top: 84px;
  margin-bottom: 110px;
}

.auto-cards {
  display: grid;
  gap: 18px;
  padding: 16px 12px;
  transition: gap 360ms ease-in-out, padding 360ms ease-in-out;

}

.auto-cards.is-single .auto-card {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.auto-cards.is-single {
  gap: 0;
  padding: 0 12px 26px;
}

.auto-cards.is-single .auto-card.is-selected {
  max-height: 2000px;
  opacity: 1;
  transform: translateY(0);
  cursor: default;
  pointer-events: auto;
}


.auto-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 15em;
  transition: max-height 360ms ease-out, opacity 180ms ease-out,
    transform 180ms ease-out;
}

.auto-cards .auto-card {
  cursor: pointer;
}


.auto-card.is-selected {
  /* border-color: rgba(47, 128, 237, 0.35); */
  box-shadow: 0 10px 22px rgba(47, 128, 237, 0.12);
}

.auto-card-media {
  position: absolute;
  inset: 0;
  background-image: var(--card-image);
  background-repeat: no-repeat;
  background-position: left 180% top -20px;;
  background-size: 14em auto;
  opacity: 0.12;
  pointer-events: none;
  filter: saturate(0.85);
  transition: background-position 480ms ease-out, opacity 480ms ease-out;
}

.auto-card.is-selected .auto-card-media {
  opacity: 0.38;
  background-position: left 150% top -10px;;

}

.auto-card > *:not(.auto-card-media) {
  position: relative;
  z-index: 1;
}

.auto-card-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 10px;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.auto-id {
  text-align: left;
}

.auto-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.auto-meta {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.auto-anchor {
  font-size: 0.85rem;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 140ms ease-out;
}

.auto-card-header[aria-expanded="true"] .auto-anchor {
  transform: rotate(90deg);
}

.auto-card-main {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0 16px 16px;
}

.auto-mileage,
.auto-status,
.auto-action,
.criteria,
.maintenance-status,
.reminders,
.last-service {
  display: grid;
  gap: 8px;
}

.label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.value {
  font-size: 1rem;
  font-weight: 700;
}

.status-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auto-mileage .value {
  font-size: 2.1rem;
  line-height: 1.1;
  color: var(--accent);
}

.auto-action {
  justify-items: start;
}

.action-btn {
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auto-card-extra {
  border-top: 1px solid var(--panel-border);
  background: var(--card-bg);
  overflow: hidden;
  max-height: 900px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 320ms ease-out, opacity 320ms ease-out,
    transform 320ms ease-out;
}

.auto-card-extra-inner {
  padding: 16px;
  display: grid;
  gap: 18px;
  transition: padding 320ms ease-out;
}

.auto-card.is-collapsed .auto-card-extra {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  border-top-color: transparent;
}

.auto-card.is-collapsed .auto-card-extra-inner {
  padding-top: 0;
  padding-bottom: 0;
}

.criteria-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.criteria-tags span {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  font-size: 0.82rem;
}

.status-list {
  display: grid;
  gap: 10px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel-muted);
  font-size: 0.92rem;
}

.status-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
  font-weight: 600;
  text-wrap-mode: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.status-dot.status-ok {
  background: var(--status-ok);
}

.status-dot.status-warn {
  background: var(--status-warn);
}

.status-dot.status-bad {
  background: var(--status-bad);
}

.reminders ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.last-service .sub {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: slide-up 160ms ease-out 80ms both;
}

.bottom-nav-fixed {
  position: fixed;
  left: 22px;
  right: 22px;
  bottom: 18px;
  z-index: 10;
}

.nav-item {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  cursor: pointer;
}

.nav-item.is-active {
  background: rgba(47, 128, 237, 0.12);
  border-color: rgba(47, 128, 237, 0.25);
  color: var(--ink);
}

.nav-icon {
  display: inline-flex;
}

.nav-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.nav-main {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  box-shadow: none;
  transform: translateY(-6px);
}

.nav-main .nav-icon {
  display: inline-flex;
}

.nav-main .nav-label {
  font-size: 0.9rem;
}

.history-view {
  display: grid;
  gap: 16px;
  padding: 16px 12px;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.history-sort {
  position: relative;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.history-sort-btn {
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  padding: 6px 10px;
  font: inherit;
  cursor: pointer;
}

.history-sort-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 140ms ease-out, transform 140ms ease-out;
  z-index: 5;
}

.history-sort.is-open .history-sort-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.history-sort-option {
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 8px;
  border-radius: 8px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.history-sort-option.is-active {
  border-color: rgba(47, 128, 237, 0.35);
  background: rgba(47, 128, 237, 0.08);
}

.history-filter-btn {
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-group {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-top: 6px;
}

.history-card {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.history-date {
  font-size: 0.85rem;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.history-badge {
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: var(--ink);
  background: var(--surface);
}

.history-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.history-lock {
  color: var(--ink-muted);
  display: inline-flex;
}

.history-service {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.history-attachments {
  display: flex;
  gap: 10px;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.attach {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.history-detail {
  display: grid;
  gap: 16px;
  padding: 16px 12px;
}

.history-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-back-btn {
  border: 1px solid var(--stroke);
  background: var(--surface);
  border-radius: 10px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}

.history-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.history-detail-card {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.history-detail-row {
  display: grid;
  gap: 6px;
}

.detail-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.detail-value {
  font-size: 0.95rem;
  color: var(--ink);
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}

.gallery-item {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--panel-muted);
  padding: 12px;
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-align: center;
}

.history-detail-actions {
  display: grid;
  gap: 6px;
}

.edit-button {
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}

.edit-hint {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.service-settings-view {
  display: grid;
  gap: 16px;
  padding: 16px 12px;
}

.service-settings-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.service-settings-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.service-settings-back {
  border: 1px solid var(--stroke);
  background: var(--surface);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.service-settings-list {
  display: grid;
  gap: 12px;
}

.service-interval-card {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  text-align: left;
  cursor: pointer;
}

.interval-name {
  font-weight: 600;
  color: var(--ink);
}

.interval-sub {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.service-settings-footer {
  border-top: 1px solid var(--panel-border);
  padding-top: 12px;
}

.add-interval-btn {
  border: 1px dashed var(--stroke);
  background: transparent;
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  width: 100%;
}

.interval-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.interval-inline .unit {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.interval-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 12px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.interval-label {
  font-size: 0.9rem;
  color: var(--ink);
}

.interval-preview {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}

.interval-preview-name {
  font-weight: 600;
  color: var(--ink);
}

.interval-preview-text {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.interval-name-input,
.interval-mileage-input,
.interval-time-input {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}

.profile-view {
  display: grid;
  gap: 16px;
  padding: 16px 12px;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
}

.profile-name {
  margin: 0;
  font-size: 1.1rem;
}

.profile-meta {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.profile-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card-bg);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--stroke);
}

.profile-logout {
  border: 1px solid var(--stroke);
  background: transparent;
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.profile-section {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.profile-section h3 {
  margin: 0;
  font-size: 0.95rem;
}

.profile-item {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 8px 10px;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.profile-subsection {
  display: grid;
  gap: 8px;
  padding: 8px 0;
}

.profile-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.profile-value {
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.profile-action {
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.dev-panel {
  gap: 12px;
}

.dev-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.dev-form {
  display: grid;
  gap: 8px;
}

.dev-records {
  display: grid;
  gap: 12px;
}

.dev-output {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--card-bg);
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--ink);
  white-space: pre-wrap;
  max-height: 240px;
  overflow: auto;
}

.auto-empty {
  border: 1px dashed var(--stroke);
  border-radius: 12px;
  background: var(--surface);
  padding: 16px;
  display: grid;
  gap: 10px;
  text-align: center;
}

.detail-attachments {
  display: grid;
  gap: 10px;
}

.detail-attachments-list {
  display: grid;
  gap: 8px;
}

.attachment-item {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface);
  display: grid;
  gap: 6px;
}

.attachment-link {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.attachment-actions {
  display: flex;
  gap: 8px;
}

.attachment-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.45);
  z-index: 60;
}

.attachment-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 70;
  padding: 16px;
}

.attachment-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.profile-select {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 6px 8px;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--stroke);
  border-radius: 999px;
}

.auth-tab {
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  transition: color 150ms ease, background 150ms ease;
}

.auth-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-grid {
  display: grid;
  gap: 10px;
}

.auth-form .profile-action {
  width: 100%;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--ink-muted);
  flex-direction: row;
}

.auth-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
}

.password-field {
  display: grid;
}

.auth-pane {
  display: grid;
  gap: 8px;
}

.auth-error {
  color: var(--status-bad);
  margin: 0;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.5);
  z-index: 80;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-bg {
  position: absolute;
  inset: 0;
  filter: blur(18px) saturate(120%);
  transform: scale(1.05);
  z-index: 0;
  overflow: hidden;
}

.auth-bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 900ms ease;
}

.auth-bg-layer.is-active {
  opacity: 1;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 0px 20px 20px;
  display: grid;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.auth-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.auth-reason {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.auth-close {
  border: 1px solid var(--stroke);
  background: transparent;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  font: inherit;
}

.interval-name-input:disabled,
.interval-mileage-input:disabled,
.interval-time-input:disabled {
  color: var(--ink-muted);
  background: rgba(0, 0, 0, 0.02);
}

.car-info-view {
  display: grid;
  gap: 16px;
  padding: 16px 12px;
}

.car-info-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.car-info-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.car-info-back {
  border: 1px solid var(--stroke);
  background: var(--surface);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.info-block {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.info-block h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.info-block label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-input {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--card-bg);
}

.info-hint {
  margin: 0;
}

.info-hint-small {
  font-size: 0.75rem;
  color: var(--ink-muted);

}

.danger-block {
  border-color: rgba(235, 87, 87, 0.35);
}

.danger-button {
  border: 1px solid rgba(235, 87, 87, 0.4);
  color: var(--status-bad);
  background: transparent;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}

.info-actions {
  display: grid;
  gap: 6px;
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease-out;
  z-index: 20;
}

.sheet-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.filter-overlay {
  background: rgba(0, 0, 0, 0.2);
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card-bg);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -16px 30px rgba(0, 0, 0, 0.18);
  transform: translateY(110%);
  transition: transform 180ms ease-out;
  z-index: 30;
  max-height: 88vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  pointer-events: none;
}

.bottom-sheet.is-open {
  transform: translateY(0);
  pointer-events: auto;
}

.bottom-sheet.is-dragging {
  transition: none;
}

.filter-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card-bg);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -16px 30px rgba(0, 0, 0, 0.18);
  transform: translateY(110%);
  transition: transform 180ms ease-out;
  z-index: 30;
  max-height: 70vh;
  display: grid;
  grid-template-rows: auto 1fr;
  pointer-events: none;
}

.filter-sheet.is-open {
  transform: translateY(0);
  pointer-events: auto;
}

.car-sheet {
  z-index: 30;
}

.car-overlay {
  background: rgba(0, 0, 0, 0.2);
}

.car-body-select,
.car-year-select {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
}

.car-save-button {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1rem;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  opacity: 1;
  transition: opacity 160ms ease-out;
}

.car-save-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.filter-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface);
  font-size: 0.9rem;
  cursor: pointer;
}

.sheet-handle {
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: var(--panel-muted);
  justify-self: center;
  margin: 10px 0 4px;
  position: relative;
}

.sheet-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -65px;
  width: 100vw;
  height: calc(100% + 70px);
  transform: translateX(-50%);
  background: transparent;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--panel-border);
}

.sheet-title-wrap {
  display: grid;
  gap: 4px;
}

.sheet-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.sheet-subtitle {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.sheet-close {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  color: var(--ink-muted);
}

.sheet-body {
  padding: 16px;
  overflow-y: auto;
  display: grid;
  gap: 18px;
}

.sheet-field {
  display: grid;
  gap: 8px;
}

.is-hidden {
  display: none !important;
}

.maintenance-checklist {
  display: grid;
  gap: 10px;
}

.check-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.95rem;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.check-text {
  color: var(--ink);
}

.status-meta-bad {
  color: var(--status-bad);
}
.note-card {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface);
  display: grid;
  gap: 6px;
}

.note-title {
  margin: 0;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.note-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.field-label {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.field-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.service-types {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.service-type {
  position: relative;
  display: block;
}

.service-type input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.service-type-box {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px 8px;
  display: grid;
  gap: 8px;
  place-items: center;
  font-size: 0.85rem;
  color: var(--ink-muted);
  background: var(--surface);
  min-height: 78px;
  cursor: pointer;
}

.service-type input:checked + .service-type-box {
  border-color: rgba(47, 128, 237, 0.4);
  color: var(--ink);
  background: rgba(47, 128, 237, 0.08);
}

.date-input,
.mileage-input,
.text-input,
.location-input,
.text-area,
.car-name-input,
.car-mileage-input,
.car-engine-input {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  max-width: 100%;
}

.mileage-input {
  font-size: 1.2rem;
  font-weight: 600;
}

.car-mileage-input {
  font-size: 1.1rem;
  font-weight: 600;
}

.photo-uploader {
  display: grid;
  gap: 10px;
}

.info-photo-input,
.car-photo-input,
.photo-input {
  display: none;
}

.photo-button {
  border: 1px dashed var(--stroke);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  background: transparent;
  cursor: pointer;
  color: var(--ink-muted);
}

.photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.photo-item {
  position: relative;
}

.photo-list img {
  width: 100%;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  cursor: pointer;
}

.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.next-time-toggle {
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.toggle-caret {
  transition: transform 160ms ease-out;
}

.next-time-toggle[aria-expanded="true"] .toggle-caret {
  transform: rotate(180deg);
}

.next-time-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 160ms ease-out, opacity 160ms ease-out;
}

.next-time-content.is-open {
  max-height: 200px;
  opacity: 1;
}

.bullet-field {
  position: relative;
}

.bullet-display {
  position: absolute;
  inset: 0;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  pointer-events: none;
  overflow: hidden;
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
}

.bullet-line {
  display: flex;
  gap: 8px;
}

.bullet {
  color: var(--ink-muted);
}

.bullet-input {
  position: relative;
  z-index: 1;
  background: transparent;
  color: transparent;
  caret-color: var(--ink);
  line-height: 1.4;
}

.bullet-input::placeholder {
  color: var(--ink-muted);
  opacity: 0.7;
}

.sheet-footer {
  border-top: 1px solid var(--panel-border);
  padding: 12px 16px 16px;
}

.save-button {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1rem;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  opacity: 1;
  transition: opacity 160ms ease-out;
}

.save-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sheet-car-pick {
  position: absolute;
  inset: 18px 0 0 0;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  background: var(--card-bg);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease-out;
}

.sheet-car-pick.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.sheet-pick-card {
  width: min(420px, 92%);
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
}

.sheet-car-list {
  display: grid;
  gap: 8px;
}

.sheet-car-option {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 18px 16px 26px;
  }

  .content {
    min-height: 240px;
  }

  .top-bar-fixed {
    top: 12px;
    left: 16px;
    right: 16px;
  }

  .bottom-nav-fixed {
    left: 16px;
    right: 16px;
    bottom: 12px;
  }

  .content-offset {
    margin-top: 78px;
    margin-bottom: 104px;
  }

  .auto-card-main {
    grid-template-columns: 1fr;
  }
}
