.kompass-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 3rem 0 5rem;
  overflow-anchor: none;
}

.kompass-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 2rem;
  align-items: center;
  min-height: calc(100vh - 150px);
}

.kompass-home {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
  gap: 2rem;
  align-items: start;
  min-height: calc(100vh - 150px);
  padding-top: clamp(1rem, 6vh, 4rem);
}

.kompass-copy h1,
.admin-card h1 {
  margin: 0.2rem 0 1rem;
  font-size: clamp(2.4rem, 8vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.kompass-note {
  max-width: 46rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(242, 201, 111, 0.28);
  border-radius: 8px;
  background: rgba(242, 201, 111, 0.08);
  color: #f8e7b9;
  font-weight: 700;
}

.orientation-lock {
  display: none;
}

.compass-panel,
.admin-card {
  border: 1px solid rgba(190, 210, 220, 0.2);
  border-radius: 8px;
  background: rgba(6, 12, 16, 0.74);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

.compass-panel {
  padding: clamp(1rem, 4vw, 1.5rem);
}

.guidance-line {
  margin: 0 0 1rem;
  min-height: 4.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(114, 230, 188, 0.26);
  border-radius: 8px;
  background: rgba(114, 230, 188, 0.09);
  color: #dffdf4;
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.compass-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  justify-items: center;
}

.compass-unit {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
}

.compass-unit-fused {
  justify-items: center;
  margin-bottom: 0.25rem;
}

.compass-unit h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.compass-unit:not(.compass-unit-fused) h2 {
  text-align: center;
}

.compass-unit p {
  min-height: 2.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.compass-unit-fused p {
  max-width: 28rem;
  min-height: 1.7rem;
  text-align: center;
}

.compass-dial {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid rgba(190, 210, 220, 0.25);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(114, 230, 188, 0.14) 0 18%, transparent 19%),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01) 58%, rgba(114, 230, 188, 0.12));
}

.compass-unit-fused .compass-dial {
  width: min(100%, 430px);
}

.compass-dial::after {
  content: "";
  position: absolute;
  inset: 7%;
  border: 0.35rem solid transparent;
  border-top-color: rgba(242, 201, 111, 0.82);
  border-radius: 50%;
  pointer-events: none;
}

.compass-dial.is-walk-mode::after {
  border-top-color: rgba(118, 184, 255, 0.9);
}

.compass-dial.is-fused-mode::after {
  border-top-color: rgba(114, 230, 188, 0.95);
}

.compass-dial.is-map-mode::after {
  border-top-color: rgba(255, 141, 122, 0.9);
}

.compass-dial.is-arrived {
  border-color: rgba(114, 230, 188, 0.78);
  box-shadow: 0 0 0 0.45rem rgba(114, 230, 188, 0.1), 0 0 42px rgba(114, 230, 188, 0.2);
}

.compass-ring {
  position: absolute;
  inset: 13%;
  border: 1px dashed rgba(245, 247, 242, 0.24);
  border-radius: 50%;
}

.compass-cardinals {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform-origin: 50% 50%;
  transition: transform 180ms ease;
}

.tick {
  position: absolute;
  z-index: 2;
  color: var(--muted);
  font-weight: 900;
}

.north {
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--coral);
}

.east {
  top: 50%;
  right: 1.2rem;
  transform: translateY(-50%);
}

.south {
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
}

.west {
  top: 50%;
  left: 1.2rem;
  transform: translateY(-50%);
}

.target-arrow,
.heading-arrow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(1rem, 4vw, 1.35rem);
  height: 38%;
  transform-origin: 50% 92%;
  transition: transform 180ms ease;
}

.target-arrow::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 100%;
  clip-path: polygon(50% 0, 100% 72%, 58% 62%, 50% 100%, 42% 62%, 0 72%);
  background: linear-gradient(180deg, var(--gold), #ff8d7a);
  filter: drop-shadow(0 0 22px rgba(242, 201, 111, 0.36));
}

.compass-dial.is-arrived .target-arrow::before {
  background: linear-gradient(180deg, var(--mint), var(--gold));
}

.heading-arrow {
  width: 0.55rem;
  height: 31%;
}

.heading-arrow::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(118, 184, 255, 0.7);
}

.compass-dial.is-map-mode .heading-arrow {
  opacity: 0.28;
}

.compass-center {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.12rem;
  width: 7.6rem;
  height: 7.6rem;
  padding: 0.6rem;
  border: 1px solid rgba(190, 210, 220, 0.25);
  border-radius: 50%;
  background: rgba(8, 16, 22, 0.9);
  transform: translate(-50%, -50%);
  text-align: center;
}

.compact-center {
  width: clamp(4.9rem, 34%, 6.2rem);
  height: clamp(4.9rem, 34%, 6.2rem);
}

.compass-unit:not(.compass-unit-fused) .compass-center {
  width: clamp(4.3rem, 48%, 5.8rem);
  height: clamp(4.3rem, 48%, 5.8rem);
  padding: 0.45rem;
}

.compass-center strong {
  max-width: 100%;
  font-size: clamp(1rem, 3.4vw, 1.65rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.compass-unit:not(.compass-unit-fused) .compass-center strong {
  font-size: clamp(0.9rem, 2.2vw, 1.18rem);
}

.compass-center span,
.kompass-stats dt,
.coordinate-form span,
.route-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.compass-center span {
  line-height: 1.05;
}

.compass-unit:not(.compass-unit-fused) .compass-center span {
  font-size: 0.66rem;
}

.kompass-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 900;
  cursor: pointer;
}

.primary-action {
  background: var(--mint);
  color: #061014;
}

.primary-action:disabled {
  cursor: default;
  opacity: 0.72;
}

.secondary-action {
  border-color: rgba(190, 210, 220, 0.24);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.compact-action {
  min-height: 2.75rem;
  padding-inline: 0.95rem;
  white-space: normal;
}

.kompass-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1.2rem 0 0;
}

.kompass-stats div {
  min-width: 0;
  min-height: 5rem;
  padding: 0.8rem;
  border: 1px solid rgba(190, 210, 220, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.kompass-stats dd {
  margin: 0.28rem 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.kompass-stats dd.is-good {
  color: var(--mint);
}

.kompass-stats dd.is-warn {
  color: var(--gold);
}

.kompass-stats dd.is-bad {
  color: #ffb4a8;
}

.status-line,
.form-message {
  margin: 1rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

.status-line {
  min-height: 2.8rem;
}

.admin-card {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(1.2rem, 4vw, 2rem);
}

.admin-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
}

.admin-new-action {
  margin-top: 0.25rem;
  white-space: nowrap;
}

.admin-new-action[aria-current="page"] {
  cursor: default;
}

.coordinate-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.4rem;
}

.share-box {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(190, 210, 220, 0.18);
}

.share-box h2,
.target-history h2,
.route-card h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.share-box p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

.share-qr {
  display: grid;
  justify-items: start;
  gap: 0.65rem;
  margin-top: 1rem;
}

.share-qr img {
  width: min(100%, 15rem);
  height: auto;
  padding: 0.7rem;
  border: 1px solid rgba(190, 210, 220, 0.22);
  border-radius: 8px;
  background: #fff;
}

.share-qr span {
  color: var(--muted);
  font-weight: 800;
}

.share-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.copy-status {
  min-height: 1.4rem;
}

.target-history {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(190, 210, 220, 0.18);
}

.target-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.category-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.category-group {
  border: 1px solid rgba(190, 210, 220, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.category-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem;
  cursor: pointer;
  font-weight: 900;
}

.category-group summary small {
  color: var(--muted);
  font-weight: 800;
}

.route-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0 0.9rem 0.9rem;
}

.target-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 0.9rem;
  border: 1px solid rgba(190, 210, 220, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.target-item.is-active {
  border-color: rgba(114, 230, 188, 0.38);
  background: rgba(114, 230, 188, 0.08);
}

.target-item h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.target-item p {
  margin: 0.35rem 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-weight: 750;
}

.target-item small {
  display: block;
  margin-top: 0.45rem;
  color: rgba(245, 247, 242, 0.62);
  font-weight: 800;
}

.target-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.target-item-actions form {
  margin: 0;
}

.target-active-label {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1rem;
  border-radius: 6px;
  background: rgba(114, 230, 188, 0.14);
  color: var(--mint);
  font-weight: 900;
}

.route-card {
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px solid rgba(242, 201, 111, 0.32);
  border-radius: 8px;
  background: rgba(242, 201, 111, 0.08);
}

.route-card[hidden] {
  display: none;
}

.route-picker {
  display: grid;
  gap: 0.9rem;
}

.route-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(190, 210, 220, 0.2);
  border-radius: 8px;
  background: rgba(6, 12, 16, 0.74);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
}

.route-tile h2 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  letter-spacing: 0;
}

.route-tile p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-weight: 800;
}

.category-picker {
  grid-template-columns: 1fr;
}

.category-picker summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  font-weight: 900;
}

.category-picker summary small {
  color: var(--muted);
}

.category-picker .primary-action {
  width: fit-content;
  margin-top: 0.9rem;
}

.public-point-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.public-point {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem;
  border: 1px solid rgba(190, 210, 220, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
}

.public-point span {
  color: var(--muted);
  font-weight: 800;
}

.route-card p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-weight: 750;
}

.route-card form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.route-card label {
  display: grid;
  gap: 0.45rem;
}

.route-next {
  margin-top: 0.9rem;
}

.route-complete {
  color: var(--mint) !important;
}

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

.coordinate-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1rem;
}

.map-import {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: end;
}

.admin-map-tool {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(190, 210, 220, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-map-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
}

.admin-map-head h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.admin-map-head p,
.map-status {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

.map-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: end;
}

.admin-map-canvas {
  min-height: 22rem;
  overflow: hidden;
  border: 1px solid rgba(190, 210, 220, 0.22);
  border-radius: 8px;
  background: rgba(6, 12, 16, 0.74);
}

.admin-map-canvas p {
  display: grid;
  min-height: 22rem;
  place-items: center;
  margin: 0;
  padding: 1rem;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.admin-map-canvas .leaflet-control-attribution {
  color: #061014;
}

.geo-status {
  min-width: min(100%, 18rem);
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.coordinate-form label {
  display: grid;
  gap: 0.45rem;
}

.coordinate-form input,
.coordinate-form select,
.share-row input,
.route-actions input,
.route-card input,
.coordinate-form textarea {
  width: 100%;
  border: 1px solid rgba(190, 210, 220, 0.25);
  border-radius: 6px;
  background: rgba(6, 12, 16, 0.74);
  color: var(--text);
  font: inherit;
  padding: 0.9rem 1rem;
}

.coordinate-form select {
  appearance: none;
}

.coordinate-form textarea {
  resize: vertical;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 0.7rem;
}

.check-row input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--mint);
}

.admin-invites {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(190, 210, 220, 0.18);
}

.admin-invites h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.admin-invites p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

.compact-form {
  margin-top: 1rem;
}

.admin-invite-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
}

.admin-invite-list p {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(190, 210, 220, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-invite-list small {
  display: block;
  margin-top: 0.2rem;
  color: rgba(245, 247, 242, 0.62);
}

.form-message {
  padding: 0.9rem 1rem;
  border-radius: 8px;
}

.form-message.success {
  border: 1px solid rgba(114, 230, 188, 0.3);
  background: rgba(114, 230, 188, 0.1);
  color: var(--mint);
}

.form-message.error {
  border: 1px solid rgba(255, 141, 122, 0.35);
  background: rgba(255, 141, 122, 0.1);
  color: #ffb4a8;
}

.form-message p {
  margin: 0.2rem 0;
}

@media (max-width: 820px) {
  .kompass-layout,
  .kompass-home,
  .admin-heading,
  .form-grid,
  .share-row,
  .route-tile,
  .route-actions,
  .map-import,
  .map-search,
  .admin-map-head,
  .target-item {
    grid-template-columns: 1fr;
  }

  .route-tile .primary-action {
    width: 100%;
  }

  .admin-new-action {
    width: 100%;
    margin-top: 0;
  }

  .target-item-actions {
    justify-content: flex-start;
  }

  .kompass-layout {
    align-items: start;
    min-height: 0;
  }

  .kompass-copy h1,
  .admin-card h1 {
    font-size: clamp(2.2rem, 14vw, 4.4rem);
  }

  .kompass-stats {
    grid-template-columns: 1fr;
  }

  .compass-board {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.45rem;
  }

  .compass-unit {
    gap: 0.4rem;
  }

  .compass-unit h2 {
    font-size: clamp(0.72rem, 3.2vw, 0.92rem);
    text-align: center;
  }

  .compass-unit-fused h2 {
    font-size: 1rem;
  }

  .compass-unit p {
    min-height: 3.4rem;
    font-size: clamp(0.62rem, 2.8vw, 0.76rem);
    text-align: center;
  }

  .compass-unit-fused p {
    min-height: 1.7rem;
    font-size: 0.82rem;
  }

  .compass-board .compass-center {
    width: clamp(3.35rem, 42%, 4.6rem);
    height: clamp(3.35rem, 42%, 4.6rem);
    padding: 0.35rem;
  }

  .compass-board .compass-unit-fused .compass-center {
    width: clamp(4.9rem, 34%, 6.2rem);
    height: clamp(4.9rem, 34%, 6.2rem);
    padding: 0.55rem;
  }

  .compass-board .compass-center strong {
    font-size: clamp(0.8rem, 3.2vw, 1.05rem);
  }

  .compass-board .compass-unit-fused .compass-center strong {
    font-size: clamp(1rem, 3.4vw, 1.65rem);
  }

  .compass-board .compass-center span {
    font-size: clamp(0.48rem, 2.1vw, 0.62rem);
  }

  .compass-board .compass-unit-fused .compass-center span {
    font-size: 0.78rem;
  }

  .compass-board .tick {
    font-size: clamp(0.58rem, 2.4vw, 0.72rem);
  }

  .compass-board .compass-unit-fused .tick {
    font-size: 0.82rem;
  }

  .compass-board .north {
    top: 0.35rem;
  }

  .compass-board .compass-unit-fused .north {
    top: 0.65rem;
  }

  .compass-board .east {
    right: 0.42rem;
  }

  .compass-board .compass-unit-fused .east {
    right: 0.8rem;
  }

  .compass-board .south {
    bottom: 0.35rem;
  }

  .compass-board .compass-unit-fused .south {
    bottom: 0.65rem;
  }

  .compass-board .west {
    left: 0.42rem;
  }

  .compass-board .compass-unit-fused .west {
    left: 0.8rem;
  }
}

@media (min-width: 821px) {
  .compass-board .tick {
    font-size: 0.82rem;
  }

  .compass-board .north {
    top: 0.65rem;
  }

  .compass-board .east {
    right: 0.8rem;
  }

  .compass-board .south {
    bottom: 0.65rem;
  }

  .compass-board .west {
    left: 0.8rem;
  }
}

@media (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  body {
    overflow: hidden;
  }

  .portrait-only .kompass-layout {
    visibility: hidden;
    pointer-events: none;
  }

  .orientation-lock {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.7rem;
    padding: 2rem;
    background: #061014;
    color: var(--text);
    text-align: center;
  }

  .orientation-lock::before {
    content: "";
    width: 4.5rem;
    height: 7rem;
    border: 0.35rem solid var(--mint);
    border-radius: 1rem;
    box-shadow: 0 0 28px rgba(114, 230, 188, 0.22);
  }

  .orientation-lock strong {
    max-width: 24rem;
    font-size: clamp(1.6rem, 7vw, 2.4rem);
    line-height: 1;
  }

  .orientation-lock span {
    max-width: 24rem;
    color: var(--muted);
    font-weight: 800;
  }
}
