:root,
[data-theme="dark"] {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-2: #243044;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #3d8bfd;
  --danger: #f07178;
  --base: #7fd962;
  --consumable: #ebc06d;
  --worn: #9d8cff;
  --border: #3a4a5e;
}

[data-theme="light"] {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #e8ecf1;
  --text: #1a2332;
  --muted: #5c6b7f;
  --accent: #2563eb;
  --danger: #dc2626;
  --base: #16a34a;
  --consumable: #ca8a04;
  --worn: #7c3aed;
  --border: #d1d9e6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

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

.site-nav {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-dropdown {
  position: relative;
}

.nav-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.6rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
}

.nav-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: min(14rem, 55vw);
}

.nav-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-menu-burger {
  display: block;
  width: 1.125rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 0 5px 0 currentColor, 0 -5px 0 currentColor;
  flex-shrink: 0;
}

.nav-user-avatar {
  flex-shrink: 0;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  background: linear-gradient(
    145deg,
    var(--accent),
    color-mix(in srgb, var(--accent), var(--muted) 45%)
  );
  opacity: 0.9;
}

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  min-width: 12.5rem;
  max-width: min(100vw - 2rem, 17rem);
  padding: 0.35rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 32px rgb(0 0 0 / 0.22);
  z-index: 400;
}

.nav-dropdown-panel--left {
  left: 0;
  right: auto;
}

.nav-dropdown-panel--right {
  right: 0;
  left: auto;
}

[data-theme="light"] .nav-dropdown-panel {
  box-shadow: 0 12px 40px rgb(26 35 50 / 0.12);
}

.nav-dropdown-links {
  display: flex;
  flex-direction: column;
  padding: 0.2rem 0;
}

.nav-dropdown-link {
  display: block;
  padding: 0.5rem 0.95rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9375rem;
}

.nav-dropdown-link:hover,
.nav-dropdown-link:focus-visible {
  background: var(--surface-2);
  outline: none;
}

.nav-dropdown-link-muted {
  color: var(--muted);
}

.nav-dropdown-link-accent {
  color: var(--accent);
  font-weight: 600;
}

.nav-dropdown-section {
  padding: 0.65rem 0.95rem 0.75rem;
  border-top: 1px solid var(--surface-2);
}

.nav-dropdown-heading {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.nav-dropdown-select {
  width: 100%;
}

.nav-dropdown-theme {
  margin-top: 0.25rem;
}

.nav-dropdown-theme.theme-toggle {
  display: flex;
  width: 100%;
}

.nav-dropdown-theme .theme-toggle-btn {
  flex: 1;
  justify-content: center;
}

.nav-dropdown-footer {
  border-top: 1px solid var(--surface-2);
  padding: 0.5rem 0.65rem;
}

.nav-dropdown-logout-form {
  margin: 0;
}

.nav-dropdown-logout {
  width: 100%;
  justify-content: center;
}

.nav-user {
  color: var(--muted);
  font-size: 0.875rem;
}

.nav-link-muted {
  color: var(--muted);
  font-size: 0.875rem;
}

.theme-toggle {
  display: inline-flex;
  border: 1px solid var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
}

.theme-toggle-btn {
  border: none;
  border-radius: 0;
  margin: 0;
}

.theme-toggle-btn[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--text);
}

.theme-toggle-btn + .theme-toggle-btn {
  border-left: 1px solid var(--surface-2);
}

.locale-select-label {
  display: inline-flex;
  align-items: center;
}

.locale-select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--surface-2);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.logo-icon {
  flex-shrink: 0;
  display: block;
  width: 2.75rem;
  height: 2.75rem;
}

.logo-text {
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.site-main {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.site-main:has(.trip-detail-layout) {
  max-width: 72rem;
}

.trip-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
  gap: 1.5rem;
  align-items: start;
}

.trip-detail-main {
  min-width: 0;
}

.garage-pane {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 12rem;
  max-height: calc(100vh - 5rem);
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 8px;
}

.garage-pane-head {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.garage-pane-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.garage-pane-filter {
  max-width: none;
  flex-shrink: 0;
}

.garage-pane-tree {
  margin: 0.5rem 0 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  gap: 0.35rem;
}

.garage-pane-tree .category-tree-node {
  background: var(--bg);
}

.garage-pane-category-header {
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}

.garage-pane-category-header::before {
  margin-right: 0.35rem;
}

.garage-pane-category--hidden {
  display: none !important;
}

.garage-pane-list {
  list-style: none;
  margin: 0;
  padding: 0 0.35rem 0.35rem;
}

.garage-pane-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--surface-2);
}

.garage-pane-item:last-child {
  border-bottom: none;
}

.garage-pane-item--hidden {
  display: none !important;
}

.garage-pane-item-on-pack {
  opacity: 0.85;
}

.garage-pane-toggle {
  display: inline;
  margin: 0;
  flex-shrink: 0;
}

.garage-pane-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--surface-2);
  border-radius: 4px;
  background: var(--bg);
  color: var(--accent);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.garage-pane-arrow:hover {
  background: var(--surface-2);
}

.garage-pane-arrow-on-pack {
  color: var(--muted);
}

.garage-pane-name {
  font-size: 0.9375rem;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.garage-pane-empty {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 52rem) {
  .trip-detail-layout {
    grid-template-columns: 1fr;
  }

  .garage-pane {
    position: static;
    max-height: 20rem;
  }
}

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

.page-head h1 {
  margin: 0;
  font-size: 1.75rem;
}

.page-head-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.error-page {
  max-width: 36rem;
  margin: 2rem auto;
  padding: 0 1rem;
  text-align: center;
}

.error-page-heading {
  font-size: 1.75rem;
  margin: 0 0 0.75rem;
}

.error-page-desc {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 1.5rem;
}

.error-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.new-trip-hub-intro {
  font-size: 1rem;
  line-height: 1.5;
  margin: 0 0 1.25rem;
  max-width: 36rem;
  color: var(--muted);
}

.new-trip-section {
  margin-bottom: 2.25rem;
}

.new-trip-section-heading {
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0 0 0.85rem;
  letter-spacing: -0.02em;
}

.new-trip-template-card .card-title,
.new-trip-choice-card .card-title {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.new-trip-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.new-trip-template-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 5rem;
}

.new-trip-section-foot {
  margin: 0.65rem 0 0;
  font-size: 0.875rem;
}

.new-trip-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
  align-items: stretch;
}

.new-trip-choice-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
}

.new-trip-choice-body {
  margin: 0;
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.45;
}

.subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.trip-meta {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.trip-meta li::before {
  content: "·";
  margin-right: 0.35rem;
  color: var(--border);
}

.trip-meta li:first-child::before {
  content: none;
  margin: 0;
}

.subtitle a {
  color: var(--muted);
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9375rem;
  cursor: pointer;
}

.btn-small {
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--surface-2);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.card-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.card-row .card {
  flex: 1;
  min-width: 0;
}

.card-row-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
  flex-shrink: 0;
}

.card-row-actions form {
  margin: 0;
}

.card {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  background: var(--surface-2);
}

.card-title {
  display: block;
  font-weight: 600;
}

.card-meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
  padding: 2rem;
  text-align: center;
  background: var(--surface);
  border-radius: 8px;
}

.weight-summary {
  background: var(--surface);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.weight-summary-compact {
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
}

.weight-summary-compact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.weight-summary-total-block {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex-shrink: 0;
}

.weight-summary-head {
  margin-bottom: 0.75rem;
}

.weight-summary-total {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.weight-summary-compact .weight-summary-total {
  font-size: 1.25rem;
  line-height: 1.1;
}

.weight-summary-caption {
  margin: 0.2rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.weight-summary-compact .weight-summary-caption {
  margin: 0;
  font-size: 0.75rem;
}

.weight-summary-compact .weight-chart-bar {
  flex: 1 1 8rem;
  min-width: 6rem;
  max-width: 14rem;
  margin-bottom: 0;
}

.weight-chart-legend-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  flex: 1 1 auto;
}

.weight-chart-legend-compact li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  grid-template-columns: none;
  font-size: 0.8125rem;
}

.weight-chart-legend-compact .weight-chart-legend-pct {
  min-width: auto;
}

.weight-chart-bar {
  box-sizing: border-box;
  width: 100%;
  height: 1.35rem;
  min-height: 1.35rem;
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--surface-2);
  background-repeat: no-repeat;
  margin-bottom: 0.85rem;
  border: 1px solid var(--border);
}

.weight-summary-compact .weight-chart-bar {
  height: 0.85rem;
  min-height: 0.85rem;
}

.weight-chart-bar-empty {
  min-height: 1.35rem;
}

.weight-chart-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.weight-chart-legend li {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.weight-chart-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.weight-chart-swatch-base {
  background: var(--base);
}

.weight-chart-swatch-consumable {
  background: var(--consumable);
}

.weight-chart-swatch-worn {
  background: var(--worn);
}

.weight-chart-legend-label {
  color: var(--text);
}

.weight-chart-legend-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.weight-chart-legend-pct {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
  text-align: right;
}

.category-tree {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-tree-node {
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
}

.category-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  list-style: none;
}

.category-drag-handle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  margin-right: 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: -0.12em;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.category-drag-handle:active {
  cursor: grabbing;
}

.item-drag-handle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  margin-right: 0.2rem;
  color: var(--muted);
  font-size: 0.6875rem;
  letter-spacing: -0.12em;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.item-drag-handle:active {
  cursor: grabbing;
}

.gear-item-row.is-dragging {
  opacity: 0.55;
}

.gear-item-list {
  min-height: 0.35rem;
}

.category-tree--saving-items .item-drag-handle {
  opacity: 0.45;
  pointer-events: none;
}

.category-tree-node.is-dragging {
  opacity: 0.55;
}

.category-tree--saving .category-drag-handle {
  opacity: 0.45;
  pointer-events: none;
}

.category-tree-header::-webkit-details-marker {
  display: none;
}

.category-tree-header::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.5rem;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.category-tree-node[open] > .category-tree-header::before {
  transform: rotate(90deg);
}

.category-tree-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  flex: 1;
  min-width: 0;
}

.category-tree-name {
  font-weight: 600;
}

.category-tree-meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.category-tree-add {
  flex-shrink: 0;
}

.category-tree-items {
  padding: 0 0.35rem 0.45rem;
}

.category-tree-items .gear-table th {
  font-size: 0.8125rem;
}

/* Trip list gear table: compact rows, name + description inline */
.trip-gear-table {
  table-layout: fixed;
}

.trip-gear-table .col-item-name {
  width: 52%;
}

.trip-gear-table .col-item-worn {
  width: 5%;
}

.trip-gear-table .col-item-consumable {
  width: 8%;
}

.trip-gear-table .col-item-qty {
  width: 7%;
}

.trip-gear-table .col-item-weight {
  width: 14%;
}

.trip-gear-table .col-item-actions {
  width: 4.5rem;
}

.trip-gear-table .item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  padding-right: 0.15rem;
}

.action-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid var(--surface-2);
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.action-icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.action-icon-btn--danger:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--surface-2));
}

.action-icon-btn svg {
  width: 0.85rem;
  height: 0.85rem;
}

.trip-gear-table th,
.trip-gear-table td {
  padding: 0.3rem 0.35rem;
  vertical-align: middle;
}

.trip-gear-table th {
  padding-top: 0.25rem;
  padding-bottom: 0.35rem;
}

.trip-gear-table .item-name-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem 0.65rem;
  min-width: 0;
}

.trip-gear-table .item-name {
  flex: 0 0 auto;
  white-space: nowrap;
}

.trip-gear-table .item-desc {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
  color: var(--muted);
}

.trip-gear-table th.item-flag-col,
.trip-gear-table .item-flag-cell {
  text-align: center;
}

.trip-gear-table .item-flag-input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
}

.trip-gear-table .item-qty-input {
  width: 100%;
  max-width: 3.25rem;
  padding: 0.15rem 0.25rem;
  font-size: 0.8125rem;
  text-align: right;
  border: 1px solid var(--surface-2);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
}

[data-theme="dark"] .trip-gear-table .item-qty-input {
  color-scheme: dark;
}

[data-theme="light"] .trip-gear-table .item-qty-input {
  color-scheme: light;
}

.trip-gear-table .item-qty-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.gear-item-row--saving {
  opacity: 0.65;
}

.trip-gear-table .actions {
  font-size: 0.8125rem;
}

.gear-table--with-cost .col-item-cost {
  width: 14%;
}

@media (max-width: 52rem) {
  .trip-gear-table .col-item-name {
    width: 50%;
  }

  .trip-gear-table .col-item-worn {
    width: 6%;
  }

  .trip-gear-table .col-item-consumable {
    width: 9%;
  }
}

@media (max-width: 36rem) {
  .trip-gear-table .col-item-name {
    width: 40%;
  }

  .trip-gear-table .col-item-worn {
    width: 7%;
  }

  .trip-gear-table .col-item-consumable {
    width: 9%;
  }

  .trip-gear-table .col-item-qty {
    width: 8%;
  }

  .trip-gear-table .col-item-weight {
    width: 18%;
  }
}

.category-tree-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  padding: 0.75rem 0.85rem;
  margin-top: 0.25rem;
  border-top: 2px solid var(--border, #444);
}

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.8125rem;
}

.table-wrap {
  overflow-x: auto;
}

.gear-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.gear-table th,
.gear-table td {
  padding: 0.65rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--surface);
}

.gear-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8125rem;
}

.gear-table .num {
  text-align: right;
  white-space: nowrap;
}

.gear-table .desc {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: capitalize;
}

.badge-base {
  background: color-mix(in srgb, var(--base) 25%, transparent);
  color: var(--base);
}

.badge-consumable {
  background: color-mix(in srgb, var(--consumable) 25%, transparent);
  color: var(--consumable);
}

.badge-worn {
  background: color-mix(in srgb, var(--worn) 25%, transparent);
  color: var(--worn);
}

.actions {
  white-space: nowrap;
}

.actions form {
  display: inline;
}

.link-danger {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}

.form-panel {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 8px;
  max-width: 32rem;
}

.form-panel label,
.form-panel legend {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.form-panel label:first-of-type {
  margin-top: 0;
}

.form-panel input[type="text"],
.form-panel input[type="number"],
.form-panel textarea,
.form-panel select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--surface-2);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.form-panel select option {
  background: var(--surface);
  color: var(--text);
}

[data-theme="dark"] .form-panel input,
[data-theme="dark"] .form-panel textarea,
[data-theme="dark"] .form-panel select {
  color-scheme: dark;
}

[data-theme="light"] .form-panel input,
[data-theme="light"] .form-panel textarea,
[data-theme="light"] .form-panel select {
  color-scheme: light;
}

.category-field {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
}

.category-field .category-input {
  flex: 1;
  min-width: 0;
  width: auto;
}

.category-field .category-suggest {
  width: auto;
  flex-shrink: 0;
  min-width: 5.5rem;
  max-width: 9rem;
  padding-right: 1.75rem;
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row.form-row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 40rem) {
  .form-row.form-row-3 {
    grid-template-columns: 1fr;
  }
}

.trip-fieldset,
.flag-fieldset {
  border: none;
  padding: 0;
  margin: 1rem 0 0;
}

.trip-fieldset legend,
.flag-fieldset legend {
  margin-bottom: 0.5rem;
}

.gps-picker {
  margin-top: 1rem;
}

.gps-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}

.gps-search-input {
  flex: 1;
}

.gps-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.35rem;
  position: relative;
  z-index: 500;
}

.gps-search-result {
  text-align: left;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--surface-2);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.gps-search-result:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

.gps-map {
  height: 280px;
  margin-top: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--surface-2);
  z-index: 0;
}

.gps-picker-status {
  margin: 0.5rem 0 0;
  min-height: 1.25rem;
}

.gps-coords-row {
  margin-top: 0.75rem;
}

.gps-attribution {
  margin-top: 0.35rem;
  font-size: 0.8rem;
}

.packing-style-fieldset {
  border: none;
  padding: 0;
  margin: 1.25rem 0 0;
}

.packing-style-fieldset legend {
  margin-bottom: 0.35rem;
}

.packing-style-option {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--surface-2);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.packing-style-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--surface-2);
}

.packing-style-option input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.packing-style-option-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.packing-style-title {
  font-weight: 600;
}

.packing-style-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.unit-system-fieldset {
  border: none;
  padding: 0;
  margin: 1.25rem 0 0;
}

.unit-system-fieldset legend {
  margin-bottom: 0.35rem;
}

.unit-system-option {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--surface-2);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.unit-system-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--surface-2);
}

.unit-system-option input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.unit-system-option-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.unit-system-title {
  font-weight: 600;
}

.gps-map .leaflet-control-attribution {
  font-size: 0.65rem;
  background: rgba(26, 35, 50, 0.85) !important;
  color: var(--muted) !important;
}

[data-theme="light"] .gps-map .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.9) !important;
}

.gps-map .leaflet-control-attribution a {
  color: var(--accent);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  color: var(--text);
}

.field-error {
  margin: 0.25rem 0 0;
  color: var(--danger);
  font-size: 0.8125rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.admin-zone,
.danger-zone {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--surface);
}

.admin-zone h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.inline-form {
  display: inline;
  margin-left: 0.5rem;
}

.flash {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: color-mix(in srgb, var(--base) 15%, var(--surface));
  border-radius: 8px;
  color: var(--base);
}

.info-panel {
  background: var(--surface);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
}

.info-panel.warn {
  border: 1px solid var(--consumable);
}

.info-panel .muted {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 0;
}

.mapping-intro {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.mapping-form select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--surface-2);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  margin-bottom: 0.5rem;
}

.required {
  color: var(--danger);
}

.pick-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.pick-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--surface-2);
  cursor: pointer;
}

.pick-name {
  font-weight: 600;
  flex: 0 1 auto;
}

.pick-meta {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.875rem;
}

.garage-pick-filter {
  display: block;
  width: 100%;
  max-width: 24rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--surface);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
}

.garage-pick-filter-empty {
  margin: 0 0 0.75rem;
}

.garage-pick-tree {
  margin-top: 0.5rem;
}

.category-tree-pick-list {
  margin: 0;
  padding: 0 1rem 0.75rem 2rem;
}

.category-tree-pick-list .pick-row {
  align-items: center;
}

.pick-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
}

.pick-desc {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  color: var(--muted);
}

.garage-pick-summary {
  margin: 0.5rem 0 0;
}

.garage-pick-status {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--surface-2);
}

.pick-item-on-list {
  opacity: 0.72;
}


.pick-on-list-badge {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.form-panel input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 0.35rem;
  color: var(--text);
  font: inherit;
}

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

.summary-hint {
  margin: 0 0 1rem;
}

.gear-table .muted {
  color: var(--muted);
}

.cost-estimate-panel {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--surface-2);
}

.cost-estimate-disclaimer {
  margin: 0 0 0.5rem;
}

.cost-estimate-status {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.cost-estimate-status-error {
  color: var(--danger);
}

.profile-feedback-link {
  margin-top: 2rem;
  font-size: 0.9375rem;
}

.feedback-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feedback-entry {
  background: var(--surface);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.feedback-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.feedback-message {
  margin: 0;
  white-space: pre-wrap;
}

.feedback-page-link {
  font-size: 0.875rem;
  flex-shrink: 0;
}
