:root {
  --page-bg: radial-gradient(circle at top left, #f4efe7 0%, #f6f4ef 40%, #fbfaf8 100%);
  --ink: #1f2329;
  --muted: #6a6f76;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-border: rgba(103, 89, 72, 0.12);
  --shadow: 0 24px 60px rgba(40, 29, 13, 0.12);
  --primary: #dc3545;
  --primary-dark: #b71f33;
  --chip-bg: #f4f6f8;
  --chip-border: #d4dbe3;
  --badge-size: 3.4rem;
}

body {
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.app-shell {
  padding: 2rem 0 4rem;
}

.hero-shell {
  margin-bottom: 1.5rem;
}

.hero-copy {
  max-width: 52rem;
}

.hero-kicker,
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8e4d00;
}

.hero-copy h1 {
  margin-top: 0.7rem;
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.hero-lead {
  margin-top: 1rem;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.glass-panel {
  border: 1px solid var(--panel-border);
  border-radius: 1.75rem;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.session-shell {
  margin-top: 1.5rem;
}

.session-code-input {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

.form-status {
  color: var(--muted);
  font-size: 0.95rem;
}

.status-success {
  color: #1f7a47;
}

.status-error {
  color: #b42318;
}

.status-info {
  color: #0c6c8c;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.settings-card {
  padding: 1rem;
  border: 1px solid rgba(33, 37, 41, 0.08);
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.7);
}

.advanced-settings {
  border-top: 1px solid rgba(103, 89, 72, 0.12);
  padding-top: 1.5rem;
}

.advanced-settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.advanced-settings-title {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.advanced-settings-chevron {
  width: 0.9rem;
  height: 0.9rem;
  border-right: 2px solid rgba(31, 35, 41, 0.55);
  border-bottom: 2px solid rgba(31, 35, 41, 0.55);
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.advanced-settings-toggle[aria-expanded="true"] .advanced-settings-chevron {
  transform: rotate(225deg);
}

.advanced-settings .collapsing {
  transition: none;
}

.search-input {
  min-height: 4rem;
  border-radius: 1.35rem;
  padding-inline: 1.4rem;
  font-size: 1.15rem;
}

.search-stage .autoComplete_wrapper {
  display: block;
  width: 100%;
}

.search-stage .autoComplete_wrapper > input {
  width: 100%;
  min-height: 4.3rem;
  padding: 0.65rem 1.4rem 0.65rem 4rem;
  border: 1px solid rgba(33, 37, 41, 0.12);
  border-radius: 1.35rem;
  background-color: white;
  background-position: left 1.35rem center;
  color: var(--ink);
  font-size: 1.05rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-stage .autoComplete_wrapper > input::placeholder {
  color: var(--muted);
}

.search-stage .autoComplete_wrapper > input:hover {
  color: var(--ink);
  border-color: rgba(33, 37, 41, 0.18);
}

.search-stage .autoComplete_wrapper > input:focus {
  color: var(--ink);
  border: 1px solid rgba(33, 37, 41, 0.18);
  box-shadow: 0 0 0 0.2rem rgba(33, 37, 41, 0.06);
}

.search-stage .autoComplete_wrapper > input:focus::placeholder,
.search-stage .autoComplete_wrapper > input:hover::placeholder {
  color: var(--muted);
  padding: 0;
  font-size: inherit;
}

.selected-search-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem;
  border: 1px solid rgba(33, 37, 41, 0.08);
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.68);
}

.selected-search-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--badge-size);
  height: var(--badge-size);
  border-radius: 1.15rem;
  color: #fff;
  background: #5f6b7a;
}

.selected-search-kind.kind-stop {
  color: #4d5a6b;
  background: #e6eaef;
}

.selected-search-name {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
}

.selected-search-kind-text,
.selected-search-meta,
.line-choice-meta,
.stop-option-meta,
.selected-line-meta {
  color: var(--muted);
}

.line-chip,
.selected-search-kind {
  flex: 0 0 auto;
}

.line-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--badge-size);
  min-height: var(--badge-size);
  height: auto;
  border-radius: 1.1rem;
  color: white;
}

.line-choice > .line-chip,
.selected-choice-pill > .line-chip {
  border-radius: 1.1rem 0 0 1.1rem;
}

.mode-bus { background: #eb1427; }
.mode-tram { background: #0d9488; }
.mode-metro { background: #155bb8; }
.mode-train { background: #3f51b5; }
.mode-ferry { background: #0b7285; }
.mode-other { background: #495057; }

.mode-icon {
  width: 1.7rem;
  height: 1.7rem;
}

.choices {
  margin-bottom: 0;
}

.choices__inner {
  min-height: 4.3rem;
  border-radius: 1.35rem;
  border: 1px solid rgba(33, 37, 41, 0.12);
  padding: 0.65rem 0.75rem;
  background: white;
}

.choices__list--multiple .choices__item {
  display: inline-flex;
  align-items: center;
  padding: 0;
  margin: 0.3rem;
  border: 0;
  background: transparent;
  border-radius: 999px;
  color: var(--ink);
}

.line-choice {
  display: inline-flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--chip-bg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.line-choice-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.55rem 1.15rem;
  background: transparent;
}

.line-choice-destination {
  font-weight: 800;
  color: var(--ink);
}

.selected-choice-pill {
  display: inline-flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--chip-bg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.selected-choice-pill .line-choice-copy {
  padding-right: 1rem;
}

.selected-chip-remove {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  min-width: 2.9rem;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-left: 1px solid var(--chip-border) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #756b64 !important;
  font-size: 2rem !important;
  line-height: 1 !important;
  text-indent: 0 !important;
  cursor: pointer !important;
  flex: 0 0 auto;
}

.selected-chip-remove:hover,
.selected-chip-remove:focus-visible {
  background: rgba(31, 35, 41, 0.05) !important;
  color: var(--ink) !important;
}

.choices__list--dropdown,
.choices__list[aria-expanded] {
  border-radius: 1.25rem;
  border: 1px solid rgba(33, 37, 41, 0.12);
  box-shadow: 0 22px 44px rgba(26, 18, 7, 0.12);
  overflow: hidden;
}

.choices__list--dropdown .choices__item,
.choices__list[aria-expanded] .choices__item {
  padding: 0.5rem 0.75rem !important;
  border: 0 !important;
  background: transparent !important;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background: rgba(31, 35, 41, 0.05) !important;
}

.choices__list--dropdown .line-choice,
.choices__list[aria-expanded] .line-choice {
  display: inline-flex;
  max-width: 100%;
}

.search-result-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.15rem 0;
}

.search-result-copy,
.selected-line-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.selected-lines-stage.is-empty::after {
  content: "Ingen linjer valgt ennå.";
  display: block;
  margin-top: 1rem;
  color: var(--muted);
}

.selected-lines-list {
  display: grid;
  gap: 1rem;
}

.selected-line-item {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(33, 37, 41, 0.08);
  border-radius: 1.25rem;
  background: white;
}

.selected-line-stop {
  margin-bottom: 0.7rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a5f2c;
}

.selected-line-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.selected-line-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.autocomplete-result {
  background: white;
}

@media (max-width: 991px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

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

  .selected-line-row {
    flex-direction: column;
    align-items: stretch;
  }

  .selected-line-actions {
    justify-content: stretch;
  }

  .selected-line-actions .btn {
    width: 100%;
  }
}
