:root {
  --primary: #183b5d;
  --primary-hover: #285b88;
  --primary-soft: #eaf1f7;
  --primary-ring: rgb(24 59 93 / 18%);
  --surface: #ffffff;
  --surface-subtle: #f7f9fc;
  --surface-muted: #eef2f6;
  --page-bg: #f4f7fa;
  --text: #172334;
  --text-muted: #657386;
  --border: #dfe5ec;
  --border-strong: #cdd6e0;
  --success: #14734a;
  --success-soft: #ecf9f2;
  --warning: #9a5c08;
  --warning-soft: #fff8e8;
  --danger: #b42332;
  --danger-soft: #fff0f1;
  --info: #2466a5;
  --info-soft: #edf6ff;
  --shadow-sm: 0 8px 24px rgb(26 48 72 / 6%);
  --shadow-md: 0 16px 40px rgb(26 48 72 / 10%);
  --radius-sm: 0.75rem;
  --radius-md: 1rem;
  --radius-lg: 1.25rem;
}

html[data-theme="dark"] {
  --primary: #79b9f1;
  --primary-hover: #9acbfa;
  --primary-soft: #172d42;
  --primary-ring: rgb(121 185 241 / 22%);
  --surface: #121c29;
  --surface-subtle: #172330;
  --surface-muted: #1d2b3a;
  --page-bg: #09121d;
  --text: #edf4fb;
  --text-muted: #9caec0;
  --border: #26384a;
  --border-strong: #385069;
  --success: #64d69d;
  --success-soft: #102e25;
  --warning: #f0bc63;
  --warning-soft: #352713;
  --danger: #ff8b98;
  --danger-soft: #35191e;
  --info: #82c2fb;
  --info-soft: #122b43;
  --shadow-sm: 0 8px 24px rgb(0 0 0 / 18%);
  --shadow-md: 0 18px 45px rgb(0 0 0 / 28%);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 10% -20%, rgb(67 126 179 / 10%), transparent 34rem),
    var(--page-bg);
  color: var(--text);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  transition: background-color 180ms ease, color 180ms ease;
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-hover);
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  border-bottom: 1px solid rgb(205 214 224 / 75%);
  background: rgb(255 255 255 / 84%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 65%);
  backdrop-filter: blur(16px);
}

html[data-theme="dark"] .site-header {
  border-bottom-color: rgb(38 56 74 / 90%);
  background: rgb(9 18 29 / 84%);
  box-shadow: none;
}

.site-header .navbar {
  min-height: 68px;
  padding-block: 0;
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-brand {
  order: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.site-brand:hover {
  color: var(--primary);
}

.brand-logo {
  display: block;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 0.75rem;
  box-shadow: 0 8px 18px rgb(24 59 93 / 22%);
}

.site-header .navbar-collapse {
  order: 2;
  min-width: 0;
}

.site-nav {
  margin-inline: auto;
  gap: 0.25rem;
}

.site-nav .nav-link {
  padding: 0.6rem 0.9rem;
  border-radius: 0.65rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.site-nav .nav-link:hover,
.site-nav .nav-link:focus-visible {
  background: var(--primary-soft);
  color: var(--primary);
}

.header-tools {
  order: 3;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.theme-toggle {
  display: inline-grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.theme-toggle:hover {
  background: var(--surface-muted);
  color: var(--primary);
  transform: rotate(8deg);
}

.theme-toggle:focus-visible,
.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 0.25rem var(--primary-ring);
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 1rem;
}

.user-name {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.user-name > span {
  color: var(--success);
  font-size: 0.55rem;
}

.btn-header-action {
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.65rem;
  background: var(--surface);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
}

.btn-header-action:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.navbar-toggler {
  width: 42px;
  height: 42px;
  padding: 0.4rem;
  border-color: var(--border);
}

html[data-theme="dark"] .navbar-toggler-icon {
  filter: invert(1);
}

.site-main {
  flex: 1;
  padding-block: 2.25rem 4rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  text-align: center;
}

.site-footer .container {
  padding-block: 1.75rem;
}

.site-footer p {
  margin: 0;
  font-size: 0.85rem;
}

.site-footer span {
  font-size: 0.76rem;
}

.payment-flow-page {
  max-width: 1040px;
  margin-inline: auto;
}

.payment-flow-wide {
  max-width: 1180px;
}

.page-intro {
  margin-bottom: 1.65rem;
}

.page-eyebrow {
  margin: 0 0 0.25rem;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-intro h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.75rem, 3vw, 2.2rem);
  font-weight: 850;
  letter-spacing: -0.035em;
}

.page-intro > p:last-child {
  max-width: 680px;
  margin: 0.45rem 0 0;
  color: var(--text-muted);
}

.payment-progress {
  margin-bottom: 2.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 55%);
}

html[data-theme="dark"] .payment-progress {
  background: rgb(18 28 41 / 72%);
}

.payment-progress ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0;
  margin: 0;
  list-style: none;
}

.payment-progress li {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.payment-progress li:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: -12%;
  width: 24%;
  height: 1px;
  background: var(--border-strong);
  content: "";
}

.payment-progress .step-marker {
  position: relative;
  z-index: 1;
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.83rem;
  font-weight: 850;
}

.payment-progress .is-current {
  color: var(--primary);
}

.payment-progress .is-current .step-marker {
  border-color: #183b5d;
  background: #183b5d;
  box-shadow: 0 0 0 5px rgb(24 59 93 / 12%);
  color: #fff;
}

html[data-theme="dark"] .payment-progress .is-current .step-marker {
  border-color: #79b9f1;
  background: #79b9f1;
  box-shadow: 0 0 0 5px rgb(121 185 241 / 14%);
  color: #09121d;
}

.payment-progress .is-complete {
  color: var(--success);
}

.payment-progress .is-complete .step-marker {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.payment-progress .is-complete:not(:last-child)::after {
  background: color-mix(in srgb, var(--success) 50%, var(--border));
}

.flow-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.flow-card + .flow-card {
  margin-top: 1.25rem;
}

.flow-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.flow-card-body {
  padding: 1.5rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.section-title h2,
.action-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 800;
}

.section-title p {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.section-icon {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 0.7rem;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 900;
}

.section-icon-muted {
  background: var(--surface-muted);
  color: var(--text-muted);
}

.search-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem;
}

.field-group {
  min-width: 0;
}

.form-label {
  margin-bottom: 0.45rem;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 750;
}

.form-control,
.form-select,
.input-group-text {
  min-height: 46px;
  border-color: var(--border-strong);
  border-radius: 0.75rem;
  background-color: var(--surface-subtle);
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.form-control::placeholder {
  color: color-mix(in srgb, var(--text-muted) 72%, transparent);
}

.form-control:hover,
.form-select:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border-strong));
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  background-color: var(--surface);
  color: var(--text);
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
  background: var(--surface-muted);
  color: var(--text-muted);
}

html[data-theme="dark"] .form-select {
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239caec0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.plate-field {
  font-weight: 800;
  letter-spacing: 0.06em;
}

.field-error,
.text-danger {
  display: block;
  margin-top: 0.35rem;
  color: var(--danger) !important;
  font-size: 0.78rem;
  font-weight: 650;
}

.field-help,
.form-text {
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.search-form-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.search-form-hint > span {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--info-soft);
  color: var(--info);
  font-size: 0.72rem;
  font-weight: 800;
}

.form-actions,
.page-bottom-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  min-height: 44px;
  padding: 0.58rem 1.1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 750;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-color: #183b5d;
  background: #183b5d;
  box-shadow: 0 8px 18px rgb(24 59 93 / 17%);
  color: #fff;
}

.btn-primary-action:hover,
.btn-primary-action:focus-visible {
  border-color: #285b88;
  background: #285b88;
  color: #fff;
}

html[data-theme="dark"] .btn-primary-action {
  border-color: #79b9f1;
  background: #79b9f1;
  box-shadow: 0 8px 20px rgb(121 185 241 / 14%);
  color: #09121d;
}

html[data-theme="dark"] .btn-primary-action:hover {
  border-color: #9acbfa;
  background: #9acbfa;
  color: #09121d;
}

.btn-primary-action:disabled {
  border-color: var(--border-strong);
  background: var(--surface-muted);
  box-shadow: none;
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
}

.btn-secondary-action:hover,
.btn-secondary-action:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.btn-block {
  width: 100%;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.notice:empty,
.validation-summary-valid {
  display: none;
}

.notice ul {
  margin: 0;
  padding-left: 1.1rem;
}

.notice strong {
  display: block;
  margin-bottom: 0.1rem;
}

.notice p {
  margin: 0;
}

.notice-icon {
  display: inline-grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 900;
}

.notice-warning {
  border-color: color-mix(in srgb, var(--warning) 35%, transparent);
  background: var(--warning-soft);
  color: var(--warning);
}

.notice-danger {
  border-color: color-mix(in srgb, var(--danger) 34%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}

.notice-info {
  border-color: color-mix(in srgb, var(--info) 30%, transparent);
  background: var(--info-soft);
  color: var(--info);
}

.compact-notice {
  margin-bottom: 1.25rem;
  padding: 0.9rem 1rem;
}

.result-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.result-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 800;
}

.query-meta {
  display: flex;
  flex-direction: column;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: right;
}

.query-meta strong {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 650;
}

.vehicle-result-list {
  display: grid;
  gap: 1rem;
}

.vehicle-card {
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.vehicle-card:hover {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--border));
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.vehicle-visual {
  position: relative;
  min-height: 235px;
  overflow: hidden;
  background: var(--surface-muted);
}

.vehicle-visual img {
  width: 100%;
  height: 100%;
  min-height: 235px;
  object-fit: cover;
}

.photo-link {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgb(9 18 29 / 72%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 650;
  text-decoration: none;
  backdrop-filter: blur(8px);
}

.photo-link:hover {
  background: rgb(9 18 29 / 88%);
  color: #fff;
}

.vehicle-photo-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 235px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--text-muted);
}

.vehicle-photo-placeholder > span {
  display: grid;
  width: 68px;
  height: 52px;
  margin-bottom: 0.6rem;
  place-items: center;
  border: 3px solid var(--border-strong);
  border-radius: 0.65rem;
  font-size: 1.4rem;
  font-weight: 900;
}

.vehicle-card-content {
  display: flex;
  min-width: 0;
  padding: 1.4rem;
  flex-direction: column;
}

.vehicle-card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.data-label,
.vehicle-data-grid dt,
.summary-list dt,
.time-preview-grid dt,
.result-summary-grid dt {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.035em;
}

.vehicle-card h3 {
  margin: 0.1rem 0 0;
  color: var(--primary);
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: 0.045em;
}

.vehicle-data-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  margin: 1.2rem 0;
}

.vehicle-data-grid div {
  min-width: 0;
}

.vehicle-data-grid dd,
.summary-list dd,
.time-preview-grid dd,
.result-summary-grid dd {
  margin: 0.2rem 0 0;
  color: var(--text);
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-weight: 600;
}

.vehicle-card-actions {
  padding-top: 1rem;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.vehicle-card-actions form {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.status-badge {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 0.35rem;
  padding: 0.23rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.status-success {
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
  background: var(--success-soft);
  color: var(--success);
}

.status-danger {
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}

.status-warning {
  border-color: color-mix(in srgb, var(--warning) 34%, transparent);
  background: var(--warning-soft);
  color: var(--warning);
}

.status-info {
  border-color: color-mix(in srgb, var(--info) 32%, transparent);
  background: var(--info-soft);
  color: var(--info);
}

.status-muted {
  border-color: var(--border-strong);
  background: var(--surface-muted);
  color: var(--text-muted);
}

.inline-message {
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
}

.inline-message-success {
  background: var(--success-soft);
  color: var(--success);
}

.inline-message-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.empty-state {
  padding: 3.75rem 1.5rem;
  text-align: center;
}

.empty-state-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--primary);
  font-size: 1.75rem;
}

.empty-state h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 800;
}

.empty-state p {
  margin: 0.35rem 0 1.2rem;
  color: var(--text-muted);
}

.confirmation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  align-items: start;
  gap: 1.25rem;
}

.confirmation-main {
  min-width: 0;
}

.confirmation-sidebar {
  display: grid;
  gap: 1rem;
}

.action-card {
  position: sticky;
  top: 88px;
}

.action-card h2 {
  margin-bottom: 1rem;
}

.vehicle-confirmation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.65fr);
  align-items: stretch;
  gap: 1.5rem;
}

.summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1.5rem;
  margin: 0;
}

.summary-list > div {
  min-width: 0;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.summary-list > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.plate-number {
  color: var(--primary) !important;
  font-size: 1.35rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.055em;
}

.plate-number-small {
  font-size: 1rem !important;
}

.amount-panel {
  display: flex;
  min-height: 220px;
  padding: 1.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 50% 0, rgb(50 104 154 / 12%), transparent 70%),
    var(--surface-subtle);
  flex-direction: column;
  text-align: center;
}

.amount-panel > span {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.amount-panel > div {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0.4rem 0 0.6rem;
  color: var(--primary);
}

.amount-panel small {
  font-size: 0.85rem;
  font-weight: 800;
}

.amount-panel strong {
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.amount-panel hr {
  width: 100%;
  border-color: var(--border);
  opacity: 1;
}

.amount-panel p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.amount-panel p strong {
  color: var(--text);
  font-size: inherit;
  letter-spacing: normal;
}

.payment-time-field {
  max-width: 470px;
}

.time-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.time-preview-grid > div {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.payment-warning {
  margin: 1.25rem 0 0;
}

.confirmation-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem;
  margin-bottom: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.84rem;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.confirmation-check:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  background: var(--primary-soft);
}

.confirmation-check .form-check-input {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 1.1rem;
  margin: 0.15rem 0 0;
  border-color: var(--border-strong);
}

.confirmation-check .form-check-input:checked {
  border-color: #183b5d;
  background-color: #183b5d;
}

.action-card .btn-primary-action {
  margin-top: 1rem;
}

.action-card .btn-secondary-action {
  margin-top: 0.65rem;
}

.rule-card {
  padding: 1.25rem;
  border: 1px solid color-mix(in srgb, var(--info) 24%, var(--border));
  border-radius: var(--radius-lg);
  background: var(--info-soft);
  color: var(--info);
}

.rule-card h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 800;
}

.rule-card h2 span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.7rem;
}

.rule-card ul {
  padding-left: 1.1rem;
  margin: 0;
  font-size: 0.78rem;
}

.rule-card li + li {
  margin-top: 0.4rem;
}

.result-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid;
  border-radius: var(--radius-lg);
}

.result-success {
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
  background: var(--success-soft);
  color: var(--success);
}

.result-danger {
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}

.result-warning {
  border-color: color-mix(in srgb, var(--warning) 30%, transparent);
  background: var(--warning-soft);
  color: var(--warning);
}

.result-info {
  border-color: color-mix(in srgb, var(--info) 30%, transparent);
  background: var(--info-soft);
  color: var(--info);
}

.result-icon {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 900;
}

.result-kicker {
  margin: 0;
  font-size: 0.72rem !important;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-hero h2 {
  margin: 0.1rem 0;
  color: currentColor;
  font-size: 1.35rem;
  font-weight: 850;
}

.result-hero p {
  margin: 0;
  font-size: 0.88rem;
}

.result-summary-grid,
.operation-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
}

.result-summary-grid > div,
.operation-summary-grid > div {
  min-width: 0;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.result-summary-grid > div:nth-child(odd):not(.summary-wide),
.operation-summary-grid > div:nth-child(odd):not(.summary-wide) {
  padding-right: 1.25rem;
}

.result-summary-grid > div:nth-child(even),
.operation-summary-grid > div:nth-child(even) {
  padding-left: 1.25rem;
  border-left: 1px solid var(--border);
}

.result-summary-grid .summary-wide,
.operation-summary-grid .summary-wide {
  grid-column: 1 / -1;
}

.result-actions {
  margin-top: 1.25rem;
}

.user-form-page {
  max-width: 1180px;
}

.permission-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.permission-table {
  min-width: 680px;
  vertical-align: middle;
}

.permission-table thead th {
  padding: 0.8rem 1rem;
  border-bottom-color: var(--border);
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.permission-table tbody td {
  padding: 0.8rem 1rem;
}

.permission-table tbody td:not(:first-child) {
  width: 145px;
  text-align: center;
}

.permission-table .form-check-input {
  width: 1.15rem;
  height: 1.15rem;
}

[data-user-permission-section="true"] {
  transition: opacity 160ms ease, border-color 160ms ease;
}

[data-user-permission-section="true"].is-system-admin {
  border-color: color-mix(in srgb, var(--info) 35%, var(--border));
  opacity: 0.68;
}

.vehicle-binding-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.vehicle-binding-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.vehicle-binding-option:hover {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
  background: var(--primary-soft);
}

.vehicle-binding-option > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.vehicle-binding-option strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vehicle-binding-option small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.new-vehicle-panel {
  padding: 1rem;
  margin-top: 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.new-vehicle-panel h3 {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
}

.account-security-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(240px, 1.5fr);
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.account-security-summary > div {
  display: flex;
  flex-direction: column;
}

.account-security-summary span {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.account-security-summary strong {
  color: var(--text);
  font-size: 0.86rem;
}

.account-security-summary .form-check {
  margin: 0;
}

.settings-page {
  max-width: 1180px;
  margin-inline: auto;
}

.settings-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.settings-intro > div:first-child > p:last-child {
  max-width: 680px;
  margin: 0.45rem 0 0;
  color: var(--text-muted);
}

.settings-overview {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
}

.settings-overview > span {
  display: flex;
  min-width: 112px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.settings-overview strong {
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 900;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  align-items: start;
  gap: 1.25rem;
}

.settings-primary-stack {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.settings-primary-stack > .flow-card + .flow-card {
  margin-top: 0;
}

.settings-security {
  position: sticky;
  top: 88px;
}

.settings-empty-state {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.settings-empty-state > span {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.settings-empty-state h3,
.favorite-mode-form h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
}

.settings-empty-state p {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.favorite-mode-list {
  display: grid;
  gap: 0.65rem;
}

.bound-vehicle-list {
  display: grid;
  gap: 0.65rem;
}

.bound-vehicle-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.bound-vehicle-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 0.7rem;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 900;
}

.bound-vehicle-identity {
  min-width: 0;
}

.bound-vehicle-identity h3 {
  margin: 0;
  color: var(--primary);
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0.055em;
}

.bound-vehicle-identity p {
  margin: 0.08rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.favorite-mode-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.favorite-mode-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 0.65rem;
  background: #183b5d;
  color: #fff;
  font-weight: 900;
}

.favorite-mode-card h3 {
  margin: 0;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.favorite-mode-card p {
  margin: 0.1rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.settings-divider {
  height: 1px;
  margin-block: 1.35rem;
  background: var(--border);
}

.favorite-mode-form > h3 {
  margin-bottom: 0.85rem;
}

.settings-form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.settings-form-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
}

.settings-form-heading p {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.login-card {
  max-width: 480px;
  margin: 7vh auto 0;
}

.login-card .card,
.operation-card,
.admin-filter-card,
.admin-table-card,
.admin-empty-state,
.admin-form-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.card {
  --bs-card-bg: var(--surface);
  --bs-card-color: var(--text);
  --bs-card-border-color: var(--border);
}

.text-muted {
  color: var(--text-muted) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.alert {
  border-radius: var(--radius-sm);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
}

.table > :not(caption) > * > * {
  color: var(--text);
}

.breadcrumb {
  font-size: 0.875rem;
}

.breadcrumb-item.active {
  color: var(--text-muted);
}

.admin-page {
  max-width: 1440px;
  margin-inline: auto;
}

.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-primary-action {
  min-width: 120px;
}

.admin-table thead th {
  padding: 0.85rem 1rem;
  border-bottom-width: 1px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-table tbody td {
  padding: 0.9rem 1rem;
}

.admin-table code {
  color: var(--text-muted);
  font-size: 0.875em;
}

.admin-empty-state .card-body {
  padding-block: 4rem;
}

.admin-form-section {
  margin-bottom: 1.25rem;
}

.admin-form-section .card-body {
  padding: 1.5rem;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.admin-form-narrow {
  max-width: 360px;
}

.admin-form-actions {
  position: sticky;
  z-index: 10;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 0;
  background: linear-gradient(transparent, var(--page-bg) 28%);
}

.admin-form-actions .btn {
  min-width: 120px;
}

.high-risk-card {
  border: 1px solid var(--warning);
  background: var(--warning-soft);
}

.high-risk-card .table {
  --bs-table-bg: transparent;
}

.font-monospace.form-control {
  overflow-x: auto;
  white-space: nowrap;
}

@media (max-width: 991.98px) {
  .search-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .confirmation-layout {
    grid-template-columns: 1fr;
  }

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

  .action-card {
    position: static;
  }

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

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-security {
    position: static;
  }

  .admin-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-table tr {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
  }

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

  .admin-table tbody td {
    display: grid;
    grid-template-columns: minmax(110px, 35%) minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.35rem 0;
    border: 0;
    text-align: left !important;
  }

  .admin-table tbody td::before {
    color: var(--text-muted);
    content: attr(data-label);
    font-size: 0.8125rem;
    font-weight: 700;
  }
}

@media (max-width: 767.98px) {
  .settings-intro {
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
  }

  .settings-overview {
    width: 100%;
  }

  .settings-overview > span {
    min-width: 0;
    flex: 1;
  }

  .site-header .navbar {
    padding-block: 0.65rem;
  }

  .site-header-inner {
    gap: 0.7rem;
  }

  .header-tools {
    order: 2;
  }

  .site-header .navbar-collapse {
    order: 3;
    flex-basis: 100%;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
  }

  .site-nav {
    gap: 0.15rem;
  }

  .site-nav .nav-link {
    padding-inline: 0.75rem;
  }

  .user-actions {
    align-items: stretch;
    justify-content: space-between;
    padding: 0.75rem 0 0.25rem;
    margin: 0;
    border-top: 1px solid var(--border);
  }

  .site-main {
    padding-block: 1.5rem 3rem;
  }

  .page-intro {
    margin-bottom: 1.25rem;
  }

  .payment-progress {
    padding: 0.9rem 0.6rem;
    margin-bottom: 1.5rem;
  }

  .payment-progress li {
    gap: 0.35rem;
    flex-direction: column;
    font-size: 0.7rem;
    line-height: 1.25;
    text-align: center;
  }

  .payment-progress li:not(:last-child)::after {
    top: 15px;
    right: -25%;
    width: 50%;
  }

  .payment-progress .step-marker {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .flow-card-header,
  .flow-card-body {
    padding: 1.15rem;
  }

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

  .vehicle-visual,
  .vehicle-visual img,
  .vehicle-photo-placeholder {
    min-height: 220px;
    max-height: 300px;
  }

  .vehicle-confirmation-grid {
    grid-template-columns: 1fr;
  }

  .summary-list {
    grid-template-columns: 1fr;
  }

  .summary-list > div:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .summary-list > div:last-child {
    border-bottom: 0;
  }

  .amount-panel {
    min-height: 190px;
  }

  .confirmation-sidebar {
    grid-template-columns: 1fr;
  }

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

  .account-security-summary {
    grid-template-columns: 1fr 1fr;
  }

  .account-security-summary .form-check {
    grid-column: 1 / -1;
  }
}

@media (max-width: 575.98px) {
  .site-main > .container {
    padding-inline: 1rem;
  }

  .search-field-grid,
  .vehicle-data-grid,
  .time-preview-grid,
  .result-summary-grid,
  .operation-summary-grid {
    grid-template-columns: 1fr;
  }

  .result-summary-grid > div,
  .operation-summary-grid > div,
  .result-summary-grid > div:nth-child(odd):not(.summary-wide),
  .operation-summary-grid > div:nth-child(odd):not(.summary-wide),
  .result-summary-grid > div:nth-child(even),
  .operation-summary-grid > div:nth-child(even) {
    padding-inline: 0;
    border-left: 0;
  }

  .result-summary-grid .summary-wide,
  .operation-summary-grid .summary-wide {
    grid-column: auto;
  }

  .result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .query-meta {
    text-align: left;
  }

  .vehicle-card-content {
    padding: 1.15rem;
  }

  .vehicle-card-topline {
    align-items: flex-start;
    flex-direction: column-reverse;
    gap: 0.6rem;
  }

  .vehicle-card-actions form,
  .form-actions,
  .page-bottom-actions {
    flex-direction: column-reverse;
  }

  .vehicle-card-actions .btn,
  .form-actions .btn,
  .page-bottom-actions .btn {
    width: 100%;
  }

  .result-hero {
    align-items: flex-start;
    padding: 1.2rem;
  }

  .result-icon {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    font-size: 1.1rem;
  }

  .admin-page-header {
    display: block;
  }

  .admin-primary-action {
    width: 100%;
    margin-top: 1rem;
  }

  .admin-form-section .card-body {
    padding: 1rem;
  }

  .admin-form-actions {
    margin-inline: -0.75rem;
    padding-inline: 0.75rem;
  }

  .admin-form-actions .btn {
    flex: 1;
    min-width: 0;
  }

  .vehicle-binding-grid {
    grid-template-columns: 1fr;
  }

  .account-security-summary {
    grid-template-columns: 1fr;
  }

  .account-security-summary .form-check {
    grid-column: auto;
  }

  .favorite-mode-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .favorite-mode-card form {
    grid-column: 1 / -1;
  }

  .favorite-mode-card form .btn {
    width: 100%;
  }

  .bound-vehicle-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .bound-vehicle-card > .status-badge {
    justify-self: start;
  }

  .bound-vehicle-card form {
    grid-column: 1 / -1;
  }

  .bound-vehicle-card form .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
