/* ==========================================================================
   SDN 24 Flugbuch – lean Apple-style design system
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f2f2f7;
  --bg-elev: #ffffff;
  --bg-elev-2: #f2f2f7;
  --bg-solid: #ffffff;
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.2);
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.62);
  --label-3: rgba(60, 60, 67, 0.32);
  --sep: rgba(60, 60, 67, 0.18);
  --bar: rgba(249, 249, 249, 0.8);
  --bar-line: rgba(0, 0, 0, 0.12);
  --seg-active: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.18);

  --blue: #007aff;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --yellow: #ffcc00;
  --teal: #30b0c7;
  --indigo: #5856d6;
  --purple: #af52de;
  --pink: #ff2d55;
  --mint: #00c7be;

  /* Validated categorical chart palette (light) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #6250d6;
  --series-8: #e34948;
  --grid: rgba(60, 60, 67, 0.12);

  --radius-s: 10px;
  --radius: 14px;
  --radius-l: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 50px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --bg-elev: #1c1c1e;
    --bg-elev-2: #2c2c2e;
    --bg-solid: #1c1c1e;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.32);
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, 0.62);
    --label-3: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.55);
    --bar: rgba(22, 22, 24, 0.8);
    --bar-line: rgba(255, 255, 255, 0.1);
    --seg-active: #636366;
    --shadow: none;
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
    --blue: #0a84ff;
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --yellow: #ffd60a;
    --teal: #40c8e0;
    --indigo: #5e5ce6;
    --purple: #bf5af2;
    --pink: #ff375f;
    --mint: #63e6e2;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
    --grid: rgba(235, 235, 245, 0.12);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-elev: #1c1c1e;
  --bg-elev-2: #2c2c2e;
  --bg-solid: #1c1c1e;
  --fill: rgba(118, 118, 128, 0.24);
  --fill-2: rgba(118, 118, 128, 0.32);
  --label: #ffffff;
  --label-2: rgba(235, 235, 245, 0.62);
  --label-3: rgba(235, 235, 245, 0.3);
  --sep: rgba(84, 84, 88, 0.55);
  --bar: rgba(22, 22, 24, 0.8);
  --bar-line: rgba(255, 255, 255, 0.1);
  --seg-active: #636366;
  --shadow: none;
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.6);
  --blue: #0a84ff;
  --green: #30d158;
  --orange: #ff9f0a;
  --red: #ff453a;
  --yellow: #ffd60a;
  --teal: #40c8e0;
  --indigo: #5e5ce6;
  --purple: #bf5af2;
  --pink: #ff375f;
  --mint: #63e6e2;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
  --grid: rgba(235, 235, 245, 0.12);
}

/* ------------------------------------------------------------------ base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

body.noscroll {
  overflow: hidden;
}

a {
  color: var(--blue);
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

img,
svg {
  display: block;
}

h1,
h2,
h3,
p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  display: inline-block;
  vertical-align: -0.125em;
}

.muted {
  color: var(--label-2);
}

.faint {
  color: var(--label-3);
}

.num {
  font-variant-numeric: tabular-nums;
}

.rounded {
  font-family: var(--font-rounded);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

/* ---------------------------------------------------------------- shell */

.shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.main {
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px);
}

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
  animation: page-in 0.32s var(--ease);
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* Navigation bar (small title appears once the large title scrolls away) */
.navbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: calc(44px + var(--safe-t));
  padding: var(--safe-t) 8px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 0 -16px;
  transition: background-color 0.2s, border-color 0.2s;
  border-bottom: 0.5px solid transparent;
}

.navbar.scrolled {
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--bar-line);
}

.navbar .nav-title {
  font-size: 17px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 56vw;
}

.navbar.scrolled .nav-title {
  opacity: 1;
  transform: none;
}

.navbar .nav-left,
.navbar .nav-right {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.navbar .nav-right {
  justify-content: flex-end;
}

.nav-btn {
  border: 0;
  background: none;
  color: var(--blue);
  height: 44px;
  min-width: 44px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 17px;
  border-radius: 10px;
}

.nav-btn .icon {
  font-size: 22px;
}

.nav-btn.back .icon {
  font-size: 24px;
  margin-left: -6px;
}

.nav-btn:active {
  opacity: 0.4;
}

.large-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 14px;
}

.large-title h1 {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.large-title .subtitle {
  font-size: 15px;
  color: var(--label-2);
  margin-top: 2px;
  font-weight: 500;
}

/* Tab bar (phones) */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--bar-line);
}

.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #8e8e93;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding-top: 4px;
}

.tabbar a .icon {
  font-size: 25px;
}

.tabbar a.active {
  color: var(--blue);
}

/* Sidebar (iPad / desktop) */
.sidebar {
  display: none;
}

@media (min-width: 1000px) {
  .tabbar {
    display: none;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    padding: 20px 12px;
    background: var(--bar);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-right: 0.5px solid var(--bar-line);
    z-index: 40;
    overflow-y: auto;
  }

  .main {
    margin-left: 264px;
    padding-bottom: 48px;
  }

  .page {
    padding: 0 32px;
  }

  .navbar {
    margin: 0 -32px;
    padding-left: 20px;
    padding-right: 20px;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: none;
  background: linear-gradient(160deg, #3aa0ff, #0060df);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 96, 223, 0.35);
}

.brand-mark .icon {
  font-size: 21px;
}

.brand small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--label-2);
}

.side-group {
  margin-bottom: 16px;
}

.side-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--label-2);
  padding: 4px 12px 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--label);
  font-size: 15px;
  font-weight: 500;
}

.sidebar a .icon {
  font-size: 20px;
  color: var(--blue);
}

.sidebar a:hover {
  background: var(--fill);
}

.sidebar a.active {
  background: var(--blue);
  color: #fff;
}

.sidebar a.active .icon {
  color: #fff;
}

.side-foot {
  margin-top: auto;
  padding: 12px;
  font-size: 12px;
  color: var(--label-2);
}

/* --------------------------------------------------------------- blocks */

.section {
  margin-top: 28px;
}


.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: 0.005em;
}

.section-head .link,
.link-btn {
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 15px;
  padding: 0;
}

.list-header {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--label-2);
  margin: 22px 16px 7px;
}

.list-footer {
  font-size: 13px;
  color: var(--label-2);
  margin: 7px 16px 0;
  line-height: 1.4;
}

.card {
  background: var(--bg-elev);
  border-radius: var(--radius-l);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 12px;
}

.grid {
  display: grid;
  gap: 12px;
}

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

@media (min-width: 720px) {
  .grid-4-md {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

/* Inset grouped list */
.list {
  background: var(--bg-elev);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 16px;
  color: var(--label);
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
}

.row + .row::before,
.row + .flight-row::before,
.flight-row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: var(--sep-inset, 16px);
  height: 0.5px;
  background: var(--sep);
}

.list.inset-icons .row {
  --sep-inset: 58px;
}

a.row:active,
button.row:active,
.row.tappable:active {
  background: var(--fill);
}

/* Takes the remaining space in any flex row (list rows, news rows, notices …) */
.grow {
  flex: 1;
  min-width: 0;
}

.row .title {
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row .sub {
  font-size: 13px;
  color: var(--label-2);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row .value {
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.row .chev {
  color: var(--label-3);
  font-size: 15px;
  margin-right: -4px;
}

.row-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
  font-size: 17px;
}

.row.destructive {
  color: var(--red);
  justify-content: center;
}

.row.action {
  color: var(--blue);
}

/* Form rows */
.row label.lbl {
  flex: none;
  min-width: 96px;
}

.row input:not([type="checkbox"]):not([type="radio"]),
.row select,
.row textarea {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  text-align: right;
  color: var(--label-2);
  padding: 0;
  height: 24px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.row select {
  text-align-last: right;
  cursor: pointer;
  padding-right: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 20' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 7.5 6 4l3.5 3.5M2.5 12.5 6 16l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 10px 16px;
}

.row input::placeholder,
.row textarea::placeholder {
  color: var(--label-3);
}

.row input[type="date"],
.row input[type="time"] {
  flex: none;
  min-width: 0;
  max-width: 60%;
  text-align: right;
  display: inline-flex;
  justify-content: flex-end;
}

.row input[type="date"]::-webkit-date-and-time-value,
.row input[type="time"]::-webkit-date-and-time-value {
  text-align: right;
}

.row.stack {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.row textarea {
  text-align: left;
  color: var(--label);
  height: auto;
  min-height: 88px;
  resize: vertical;
  line-height: 1.4;
}

.row input.left:not([type="checkbox"]):not([type="radio"]),
.row input.full:not([type="checkbox"]):not([type="radio"]) {
  text-align: left;
  color: var(--label);
}

.row > .switch {
  margin-left: auto;
}

/* Standalone inputs */
.field {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 0;
  background: var(--bg-elev);
  color: var(--label);
  outline: none;
  box-shadow: inset 0 0 0 0.5px var(--sep);
}

.field:focus {
  box-shadow: inset 0 0 0 2px var(--blue);
}

textarea.field {
  height: auto;
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.4;
}

.search {
  position: relative;
  margin-bottom: 12px;
}

.search input {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 0;
  background: var(--fill);
  padding: 0 12px 0 34px;
  outline: none;
  font-size: 17px;
}

.search .icon {
  position: absolute;
  z-index: 1; /* above the glass input (backdrop-filter creates its own layer) */
  pointer-events: none;
  left: 10px;
  top: 9px;
  color: var(--label-2);
  font-size: 17px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 20px;
  border-radius: 14px;
  border: 0;
  font-size: 17px;
  font-weight: 600;
  background: var(--blue);
  color: #fff;
  transition: transform 0.12s, opacity 0.12s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
  opacity: 0.85;
}

.btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.btn.block {
  width: 100%;
}

.btn.small {
  height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  font-size: 15px;
}

.btn.tinted {
  background: color-mix(in srgb, var(--blue) 15%, transparent);
  color: var(--blue);
}

.btn.gray {
  background: var(--fill);
  color: var(--label);
}

.btn.danger {
  background: color-mix(in srgb, var(--red) 14%, transparent);
  color: var(--red);
}

.btn .icon {
  font-size: 1.1em;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  display: inline-grid;
  place-items: center;
  background: var(--fill);
  color: var(--blue);
  font-size: 17px;
}

.icon-btn.filled {
  background: var(--blue);
  color: #fff;
}

.icon-btn:active {
  opacity: 0.6;
}

/* Segmented control */
.seg {
  display: flex;
  background: var(--fill);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
  position: relative;
}

.seg button {
  flex: 1;
  border: 0;
  background: none;
  height: 30px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--label);
  padding: 0 10px;
  white-space: nowrap;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.seg button.active {
  background: var(--seg-active);
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
}

.seg.scroll {
  overflow-x: auto;
  scrollbar-width: none;
}

.seg.scroll::-webkit-scrollbar {
  display: none;
}

.seg.scroll button {
  flex: 1 0 auto;
}

/* Chips */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  border: 0;
  height: 32px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--bg-elev);
  color: var(--label);
  font-size: 15px;
  font-weight: 500;
  box-shadow: var(--shadow);
}

.chip.active {
  background: var(--blue);
  color: #fff;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  background: var(--fill);
  color: var(--label-2);
  white-space: nowrap;
  vertical-align: middle;
}

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

.badge.green {
  background: color-mix(in srgb, var(--green) 18%, transparent);
  color: color-mix(in srgb, var(--green) 75%, var(--label));
}

.badge.orange {
  background: color-mix(in srgb, var(--orange) 18%, transparent);
  color: color-mix(in srgb, var(--orange) 80%, var(--label));
}

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

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

/* Switch */
.switch {
  position: relative;
  width: 51px;
  height: 31px;
  flex: none;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: var(--fill-2);
  transition: background-color 0.25s;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s var(--ease);
}

.switch input:checked + span {
  background: var(--green);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

/* Avatar */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  background: linear-gradient(160deg, var(--a1, #8e8e93), var(--a2, #636366));
}

.avatar.lg {
  width: 72px;
  height: 72px;
  font-size: 28px;
}

.avatar.sm {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

/* Stat tiles */
.stat {
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 14px 16px 15px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.stat .stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--label-2);
}

.stat .stat-label .icon {
  color: var(--tint, var(--blue));
  font-size: 15px;
}

.stat .stat-value {
  font-family: var(--font-rounded);
  font-size: 28px;
  line-height: 1.15;
  font-weight: 700;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat .stat-value small {
  font-size: 15px;
  font-weight: 600;
  color: var(--label-2);
  margin-left: 2px;
}

.stat .stat-sub {
  font-size: 13px;
  color: var(--label-2);
  margin-top: 2px;
}

/* Empty state */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--label-2);
}

.empty-badge {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: radial-gradient(circle at 32% 26%, color-mix(in srgb, var(--blue) 30%, transparent), color-mix(in srgb, var(--blue) 10%, transparent) 72%);
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--blue) 35%, transparent), 0 10px 30px color-mix(in srgb, var(--blue) 14%, transparent);
}

.empty-badge.warn {
  color: var(--orange);
  background: radial-gradient(circle at 32% 26%, color-mix(in srgb, var(--orange) 30%, transparent), color-mix(in srgb, var(--orange) 10%, transparent) 72%);
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--orange) 35%, transparent);
}

.empty-badge .icon {
  font-size: 40px;
}

/* Empty-state actions: equal width, stacked */
.empty .btn-row {
  flex-direction: column;
  align-items: stretch;
  max-width: 300px;
  margin: 0 auto;
}

.empty h3 {
  font-size: 20px;
  color: var(--label);
  font-weight: 600;
  margin-bottom: 6px;
}

.empty p {
  font-size: 15px;
  max-width: 340px;
  margin: 0 auto 18px;
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--fill) 0%, var(--fill-2) 50%, var(--fill) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
  border-radius: var(--radius);
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid var(--fill-2);
  border-top-color: var(--label-2);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.center-load {
  display: grid;
  place-items: center;
  padding: 60px 0;
}

/* ---------------------------------------------------------------- sheet */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.sheet-backdrop.open {
  opacity: 1;
}

.sheet {
  position: fixed;
  z-index: 101;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: calc(100% - var(--safe-t) - 12px);
  background: var(--bg);
  border-radius: 13px 13px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.45s var(--ease);
  box-shadow: var(--shadow-lg);
  overscroll-behavior: contain;
}

.sheet.open {
  transform: none;
}

.sheet.tall {
  height: calc(100% - var(--safe-t) - 12px);
}

.sheet-grabber {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--label-3);
  margin: 6px auto 0;
  flex: none;
}

.sheet-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 2px 8px;
  min-height: 50px;
  flex: none;
}

.sheet-head .sheet-title {
  font-weight: 600;
  font-size: 17px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}

.sheet-head .nav-btn:last-child {
  justify-self: end;
}

.sheet-head .nav-btn.done {
  font-weight: 600;
}

.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px calc(28px + var(--safe-b));
  flex: 1;
}

@media (min-width: 700px) {
  .sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(580px, calc(100vw - 48px));
    max-height: min(88vh, 900px);
    border-radius: 16px;
    transform: translate(-50%, -46%) scale(0.96);
    opacity: 0;
    transition: transform 0.3s var(--ease), opacity 0.25s;
  }

  .sheet.open {
    transform: translate(-50%, -50%);
    opacity: 1;
  }

  .sheet.tall {
    height: min(88vh, 900px);
  }

  .sheet.wide {
    width: min(820px, calc(100vw - 48px));
  }

  .sheet-grabber {
    display: none;
  }

  .sheet-body {
    padding-bottom: 28px;
  }
}

/* Alert dialog */
.alert {
  position: fixed;
  z-index: 201;
  left: 50%;
  top: 50%;
  width: 270px;
  transform: translate(-50%, -50%) scale(1.1);
  opacity: 0;
  transition: transform 0.25s var(--ease), opacity 0.2s;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  border-radius: 14px;
  overflow: hidden;
  text-align: center;
}

.alert.open {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.alert .alert-body {
  padding: 19px 16px 18px;
}

.alert h3 {
  font-size: 17px;
  font-weight: 600;
}

.alert p {
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.38;
}

.alert input {
  margin-top: 12px;
  height: 34px;
  border-radius: 8px;
  font-size: 15px;
}

.alert .alert-actions {
  display: flex;
  border-top: 0.5px solid var(--sep);
}

.alert .alert-actions button {
  flex: 1;
  height: 44px;
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 17px;
}

.alert .alert-actions button + button {
  border-left: 0.5px solid var(--sep);
}

.alert .alert-actions button.primary {
  font-weight: 600;
}

.alert .alert-actions button.destructive {
  color: var(--red);
}

.alert-backdrop {
  z-index: 200;
}

/* Toast */
.toast-wrap {
  position: fixed;
  z-index: 300;
  top: calc(var(--safe-t) + 10px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px 11px 14px;
  border-radius: 24px;
  background: rgba(30, 30, 32, 0.92);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  animation: toast-in 0.4s var(--ease);
}

.toast .icon {
  font-size: 20px;
}

.toast.ok .icon {
  color: #30d158;
}

.toast.err .icon {
  color: #ff453a;
}

.toast.out {
  opacity: 0;
  transform: translateY(-12px) scale(0.96);
  transition: all 0.3s var(--ease);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.92);
  }
}

/* --------------------------------------------------------------- flights */

.month-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: var(--label-2);
  margin: 22px 16px 7px;
}

.month-head b {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.flight-row {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 2px 12px;
  padding: 12px 16px;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  color: var(--label);
}

.flight-row + .flight-row::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 72px;
  height: 0.5px;
  background: var(--sep);
}

.flight-row:active {
  background: var(--fill);
}

.flight-date {
  grid-row: span 3;
  text-align: center;
  padding-top: 2px;
}

.flight-date .d {
  font-family: var(--font-rounded);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.flight-date .m {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--red);
  margin-top: 3px;
  letter-spacing: 0.04em;
}

.flight-date .no {
  font-size: 11px;
  color: var(--label-3);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

.flight-route {
  font-size: 17px;
  font-weight: 600;
  min-width: 0;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flight-route .icon {
  display: inline-block;
  color: var(--label-3);
  font-size: 13px;
  margin: 0 5px;
  vertical-align: 0.05em;
}

.flight-meta {
  font-size: 14px;
  color: var(--label-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flight-figs {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
  flex-wrap: wrap;
}

.flight-figs span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.flight-figs .icon {
  font-size: 14px;
}

.flight-figs .dur {
  color: var(--label);
  font-weight: 600;
  margin-left: auto;
}

/* Duration picker in the form */
.dur-pick {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex: 1;
}

.dur-pick select {
  flex: none !important;
  width: auto !important;
}

/* --------------------------------------------------------------- charts */

.chart-card {
  position: relative;
}

.chart-wrap {
  position: relative;
  width: 100%;
}

.chart-wrap svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-wrap .axis text,
.chart-wrap text.axis {
  fill: var(--label-2);
  font-size: 11px;
  font-family: var(--font);
}

.chart-wrap .gridline {
  stroke: var(--grid);
  stroke-width: 1;
}

.chart-wrap .baseline {
  stroke: var(--label-3);
  stroke-width: 1;
}

.chart-wrap .bar-hit {
  fill: transparent;
  cursor: pointer;
}

.chart-wrap .bar-col.hover .bar-seg {
  filter: brightness(1.08);
}

.chart-wrap .bar-col.dim .bar-seg {
  opacity: 0.35;
}

.chart-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: var(--bg-solid);
  color: var(--label);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18), 0 0 0 0.5px var(--sep);
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
  transition: opacity 0.12s;
}

.chart-tip b {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.chart-tip .tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.chart-tip .tip-row span:last-child {
  margin-left: auto;
  padding-left: 12px;
  font-weight: 600;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--label-2);
  margin-top: 12px;
}

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

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
  display: inline-block;
}

.meter {
  height: 6px;
  border-radius: 3px;
  background: var(--fill);
  overflow: hidden;
  margin-top: 6px;
}

.meter > i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--tint, var(--blue));
}

/* ----------------------------------------------------------------- today */

.hero {
  position: relative;
  border-radius: 24px;
  padding: 20px;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(165deg, #4ea8ff 0%, #2878e8 55%, #1d5fc4 100%);
  box-shadow: 0 10px 30px rgba(18, 90, 200, 0.25);
  isolation: isolate;
}

.hero.cloudy {
  background: linear-gradient(165deg, #8a9bb0 0%, #607189 60%, #4b5a70 100%);
  box-shadow: 0 10px 30px rgba(60, 75, 95, 0.25);
}

.hero.rain {
  background: linear-gradient(165deg, #5d6b85 0%, #3e4a63 60%, #2c3549 100%);
}

.hero.night {
  background: linear-gradient(165deg, #23305a 0%, #141c3a 60%, #0b1026 100%);
}

.hero.sunset {
  background: linear-gradient(165deg, #ffb26b 0%, #f0755a 50%, #8a4d9e 100%);
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 70%);
}

.hero .place {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.95;
}

.hero .temp {
  font-family: var(--font-display);
  font-size: 72px;
  line-height: 1;
  font-weight: 200;
  letter-spacing: -0.03em;
  margin: 6px 0 2px;
}

.hero .cond {
  font-size: 17px;
  font-weight: 500;
}

.hero .hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.3);
}

.hero .hero-grid div {
  min-width: 0;
}

.hero .hero-grid small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.hero .hero-grid b {
  display: block;
  font-size: 17px;
  font-weight: 600;
  margin-top: 2px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hero .hero-icon {
  position: absolute;
  right: 18px;
  top: 18px;
  font-size: 64px;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
}

.score-ring {
  position: relative;
  width: 46px;
  height: 46px;
  flex: none;
}

.score-ring svg {
  width: 46px;
  height: 46px;
  transform: rotate(-90deg);
}

.score-ring .track {
  stroke: var(--fill);
}

.score-ring b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-rounded);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.wind {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.wind .arrow {
  display: inline-block;
  transition: transform 0.3s;
}

.spot-score-row .grow .sub {
  white-space: normal;
}

.hours-strip {
  display: flex;
  gap: 3px;
  margin-top: 8px;
}

.hours-strip i {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--fill);
}

.facts {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 2px 16px 6px;
  scroll-padding-inline: 16px; /* snapped cards keep the page gutter */
}

.facts::-webkit-scrollbar {
  display: none;
}

.fact {
  scroll-snap-align: start;
  background: var(--bg-elev);
  border-radius: var(--radius-l);
  padding: 14px;
  box-shadow: var(--shadow);
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.fact .fact-icon {
  font-size: 22px;
  line-height: 1;
}

.fact .fact-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--label-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 10px;
}

.fact .fact-value {
  font-family: var(--font-rounded);
  font-size: 22px;
  font-weight: 700;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.fact .fact-sub {
  font-size: 13px;
  color: var(--label-2);
  margin-top: auto;
  padding-top: 4px;
}

.dyk {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.dyk .dyk-emoji {
  font-size: 34px;
  line-height: 1;
}

.dyk p {
  font-size: 15px;
  line-height: 1.45;
}

.game-teaser {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-l);
  padding: 20px;
  color: #fff;
  background: linear-gradient(135deg, #5e5ce6 0%, #bf5af2 55%, #ff375f 100%);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(94, 92, 230, 0.25);
}

.game-teaser .gt-emoji {
  font-size: 46px;
  line-height: 1;
}

.game-teaser h3 {
  font-size: 20px;
  font-weight: 700;
}

.game-teaser p {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 2px;
}

.game-teaser .btn {
  background: rgba(255, 255, 255, 0.95);
  color: #5e5ce6;
  margin-left: auto;
}

.gauge {
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--blue), var(--fill-2) 35%, var(--fill-2) 65%, var(--orange));
  margin: 14px 0 6px;
}

.gauge i {
  position: absolute;
  top: -5px;
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--label);
  transform: translateX(-50%);
  box-shadow: 0 0 0 2px var(--bg-elev);
}

.gauge-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--label-2);
}

/* ---------------------------------------------------------------- groups */

.group-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-l);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  color: var(--label);
}

.group-card:active {
  transform: scale(0.985);
}

.group-emoji {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 30px;
  flex: none;
  background: color-mix(in srgb, var(--gc, var(--blue)) 18%, transparent);
}

.group-hero {
  text-align: center;
  padding: 4px 0 8px;
}

.group-hero .group-emoji {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  font-size: 46px;
  margin: 0 auto 12px;
}

.group-hero h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
}

.group-hero p {
  color: var(--label-2);
  font-size: 15px;
  margin-top: 4px;
}

.rank {
  width: 28px;
  text-align: center;
  font-family: var(--font-rounded);
  font-weight: 700;
  font-size: 17px;
  color: var(--label-2);
  flex: none;
}

.rank.medal {
  font-size: 22px;
}

.code-box {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 22px;
  letter-spacing: 0.18em;
  font-weight: 600;
  padding: 12px;
  border-radius: 12px;
  background: var(--fill);
  text-align: center;
}

/* --------------------------------------------------------------- training */

.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.dots i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--tint, var(--blue));
}

.dots i.empty {
  background: var(--fill);
}

.req {
  display: flex;
  align-items: center;
  gap: 14px;
}

.req .ring {
  flex: none;
}

/* ------------------------------------------------------------------ map */

.map {
  height: 360px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--fill);
  z-index: 0;
}

.map.small {
  height: 240px;
}

.leaflet-container {
  font-family: var(--font) !important;
}

.leaflet-popup-content-wrapper {
  border-radius: 12px !important;
}

.pin {
  width: 26px;
  height: 26px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--blue);
  border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.pin.landing {
  background: var(--green);
}

.pin.both {
  background: var(--purple);
}

/* ---------------------------------------------------------------- auth */

.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(24px + var(--safe-t)) 16px calc(24px + var(--safe-b));
  background:
    radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--blue) 22%, transparent), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--purple) 16%, transparent), transparent 60%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  animation: page-in 0.4s var(--ease);
}

.auth-logo {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  margin: 0 auto 18px;
  background: linear-gradient(160deg, #3aa0ff, #0060df);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 96, 223, 0.35);
}

.auth-logo .icon {
  font-size: 50px;
}

.auth h1 {
  text-align: center;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
}

.auth .lead {
  text-align: center;
  color: var(--label-2);
  margin: 6px 0 24px;
  font-size: 16px;
}

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

.auth .alt {
  text-align: center;
  margin-top: 18px;
  font-size: 15px;
  color: var(--label-2);
}

.form-error {
  color: var(--red);
  font-size: 14px;
  min-height: 20px;
  text-align: center;
}

/* ---------------------------------------------------------------- misc */

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 15px;
}

.kv dt {
  color: var(--label-2);
}

.kv dd {
  margin: 0;
  text-align: right;
}

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

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.tbl th,
.tbl td {
  padding: 9px 10px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 0.5px solid var(--sep);
}

.tbl th {
  font-size: 12px;
  color: var(--label-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tbl tr.bad td {
  color: var(--red);
}

.tbl td.r,
.tbl th.r {
  text-align: right;
}

.dropzone {
  border: 2px dashed var(--label-3);
  border-radius: var(--radius-l);
  padding: 32px 20px;
  text-align: center;
  background: var(--bg-elev);
  transition: border-color 0.2s, background-color 0.2s;
  cursor: pointer;
}

.dropzone.over {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 8%, var(--bg-elev));
}

.dropzone .icon {
  font-size: 44px;
  color: var(--blue);
  margin: 0 auto 10px;
}

.steps {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.steps i {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--fill-2);
}

.steps i.on {
  background: var(--blue);
}

.notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--blue) 10%, var(--bg-elev));
  font-size: 14px;
  line-height: 1.45;
}

.notice .icon {
  color: var(--blue);
  font-size: 20px;
  margin-top: 1px;
}

.notice.warn {
  background: color-mix(in srgb, var(--orange) 12%, var(--bg-elev));
}

.notice.warn .icon {
  color: var(--orange);
}

.pw-box {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 18px;
  padding: 12px;
  background: var(--fill);
  border-radius: 10px;
  text-align: center;
  user-select: all;
  -webkit-user-select: all;
  margin: 10px 0;
}

.compass {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
}

.compass button {
  height: 34px;
  border-radius: 9px;
  border: 0;
  background: var(--fill);
  font-weight: 600;
  font-size: 14px;
}

.compass button.on {
  background: var(--blue);
  color: #fff;
}

.game-host {
  position: relative;
  height: min(78vh, 720px);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #87b8e8;
}

@media (max-width: 699px) {
  .game-host.full {
    position: fixed;
    inset: 0;
    height: auto;
    border-radius: 0;
    z-index: 90;
  }
}

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.center { text-align: center; }
.small { font-size: 13px; }
.strong { font-weight: 600; }

.alert p {
  white-space: pre-line;
}

.center > .avatar {
  margin: 0 auto;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.offline-pill {
  position: fixed;
  z-index: 250;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  background: rgba(30, 30, 32, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

@media (min-width: 1000px) {
  .offline-pill {
    bottom: 20px;
    left: calc(50% + 132px);
  }
}

/* Achievements */
.badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}

.ach {
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 14px 10px 12px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ach-emoji {
  position: relative;
  width: 54px;
  height: 54px;
  margin: 0 auto 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: radial-gradient(circle at 30% 25%, #fff7d6, #ffd60a 55%, #ff9f0a);
  box-shadow: 0 4px 12px rgba(255, 159, 10, 0.35), inset 0 -3px 6px rgba(0, 0, 0, 0.12);
}

.ach-level {
  position: absolute;
  right: -4px;
  bottom: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px var(--bg-elev);
}

.ach-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.ach-desc {
  font-size: 11px;
  color: var(--label-2);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ach.locked .ach-emoji {
  background: var(--fill);
  box-shadow: none;
  filter: grayscale(1);
  opacity: 0.55;
}

.ach.locked .ach-title {
  color: var(--label-2);
}

/* Events */
.event-card {
  padding: 14px 16px;
}

.event-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  color: inherit;
}

.event-head .chev {
  align-self: center;
  color: var(--label-3);
}

.event-date {
  flex: none;
  width: 52px;
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  background: var(--bg-elev-2);
  display: flex;
  flex-direction: column;
  padding-bottom: 4px;
}

.event-date small:first-child {
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 0;
}

.event-date b {
  font-family: var(--font-rounded);
  font-size: 22px;
  line-height: 1.15;
}

.event-date small:last-child {
  font-size: 11px;
  color: var(--label-2);
}

.event-people {
  display: flex;
  align-items: center;
  margin-top: 10px;
  padding-left: 66px;
}

.event-people .avatar {
  margin-left: -6px;
  box-shadow: 0 0 0 2px var(--bg-elev);
}

.event-people .avatar:first-child {
  margin-left: 0;
}

.event-people span {
  margin-left: 8px;
}

/* Print */
.print-sheet .tbl td,
.print-sheet .tbl th {
  white-space: normal;
}

.sign-line {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 48px;
}

.sign-line div {
  border-top: 1px solid var(--label-2);
  padding-top: 6px;
  font-size: 12px;
  color: var(--label-2);
}

@media print {
  @page {
    margin: 14mm;
  }

  :root {
    --bg: #fff;
    --bg-elev: #fff;
    --label: #000;
    --label-2: #444;
    --sep: #bbb;
    --shadow: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .sidebar,
  .tabbar,
  .navbar,
  .no-print,
  .toast-wrap,
  .offline-pill {
    display: none !important;
  }

  .main {
    margin: 0 !important;
    padding: 0 !important;
  }

  .page {
    max-width: none;
    padding: 0 !important;
    animation: none;
  }

  .large-title {
    display: none !important;
  }

  .print-sheet .tbl {
    font-size: 9pt;
  }

  .print-sheet .tbl th,
  .print-sheet .tbl td {
    padding: 4px 6px;
  }

  .print-sheet tr {
    break-inside: avoid;
  }

  .card,
  .stat {
    box-shadow: none !important;
    border: 1px solid #ddd;
  }
}

/* Brand logo */
.sdn-logo {
  display: block;
  color: var(--label);
}

.brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  color: var(--label);
  padding: 4px 12px 20px;
}

.sidebar a.brand,
.sidebar a.brand:hover {
  height: auto;
  background: none;
}

.brand .brand-logo {
  width: 112px;
  height: auto;
}

.brand small {
  font-size: 12px;
  font-weight: 500;
  color: var(--label-2);
  margin-left: 2px;
}

.auth-brand {
  width: 190px;
  margin: 0 auto 14px;
}

.auth-brand .sdn-logo {
  width: 100%;
  height: auto;
}

.group-emoji .in-mark {
  width: auto;
  height: 80%;
  color: #111;
}

.group-hero .group-emoji .in-mark {
  height: 82%;
}

.mark-inline {
  display: inline-flex;
  align-items: center;
}

.mark-inline .in-mark {
  width: auto;
  height: 26px;
}

.small .mark-inline .in-mark {
  height: 20px;
}

.compass .in-mark {
  width: auto;
  height: 34px;
  margin: 0 auto;
  color: inherit;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .group-emoji .in-mark {
    color: #f2f2f7;
  }
}

:root[data-theme="dark"] .group-emoji .in-mark {
  color: #f2f2f7;
}

/* News */
.news-row {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 16px;
  color: var(--label);
}

.news-row + .news-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 0.5px;
  background: var(--sep);
}

.news-row:active {
  background: var(--fill);
}

.news-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--label-2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.news-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.news-thumb,
.news-hero-img {
  position: relative;
  flex: none;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, color-mix(in srgb, var(--blue) 22%, var(--bg-elev)), color-mix(in srgb, var(--purple) 18%, var(--bg-elev)));
}

.news-thumb {
  width: 84px;
  height: 84px;
  border-radius: 12px;
}

.news-thumb img,
.news-hero-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-thumb-emoji {
  font-size: 32px;
}

.news-hero {
  display: block;
  background: var(--bg-elev);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--label);
}

.news-hero-img {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.news-hero-img .news-thumb-emoji {
  font-size: 64px;
}

.news-hero-body {
  padding: 14px 16px 16px;
}

.news-hero-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.22;
  margin-top: 4px;
}

.news-excerpt {
  color: var(--label-2);
  font-size: 15px;
  line-height: 1.4;
  margin-top: 6px;
}

.news-post {
  background: var(--bg-elev);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.news-post-img {
  aspect-ratio: 4 / 3;
  background: var(--fill);
}

.news-post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-fill {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #e2e2e2, #b6b6b6);
  color: #111;
  height: 100%;
}

.brand-fill .sdn-logo {
  width: 46%;
  height: auto;
  color: #111;
}

.news-post-body {
  padding: 14px 16px 16px;
}

.news-post-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-top: 8px;
  line-height: 1.2;
}

.news-post-text {
  margin-top: 6px;
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.45;
  color: var(--label);
}

/* Boot screen */
.boot {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
}

.boot img {
  width: 150px;
  height: auto;
}

@media (prefers-color-scheme: dark) {
  .boot img {
    filter: invert(1);
  }
}

/* Grid children must be allowed to shrink (long single-line texts otherwise overflow). */
.grid > * {
  min-width: 0;
}

/* ==========================================================================
   Glass layer – lean "liquid glass" look (iOS 26 inspired)
   Translucent surfaces on a very soft ambient background; real blur only
   where it matters (bars, buttons, sheets) to stay fast on phones.
   ========================================================================== */

:root {
  --bg: #eef0f5;
  --bg-elev: rgba(255, 255, 255, 0.72);
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(250, 250, 252, 0.82);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-edge: rgba(15, 23, 42, 0.06);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 10px 30px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.05);
  --glass-blur: saturate(180%) blur(22px);
  --glass-active: rgba(10, 132, 255, 0.12);
  --ambient-1: rgba(10, 132, 255, 0.13);
  --ambient-2: rgba(191, 90, 242, 0.10);
  --ambient-3: rgba(48, 209, 88, 0.08);
  --shadow: var(--glass-hi), var(--glass-shadow);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #050608;
    --bg-elev: rgba(36, 36, 40, 0.62);
    --glass: rgba(40, 40, 44, 0.5);
    --glass-strong: rgba(28, 28, 31, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-edge: rgba(255, 255, 255, 0.06);
    --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --glass-active: rgba(10, 132, 255, 0.22);
    --ambient-1: rgba(10, 132, 255, 0.2);
    --ambient-2: rgba(191, 90, 242, 0.14);
    --ambient-3: rgba(48, 209, 88, 0.08);
    --shadow: var(--glass-hi), var(--glass-shadow);
  }
}

:root[data-theme="dark"] {
  --bg: #050608;
  --bg-elev: rgba(36, 36, 40, 0.62);
  --glass: rgba(40, 40, 44, 0.5);
  --glass-strong: rgba(28, 28, 31, 0.8);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-edge: rgba(255, 255, 255, 0.06);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --glass-active: rgba(10, 132, 255, 0.22);
  --ambient-1: rgba(10, 132, 255, 0.2);
  --ambient-2: rgba(191, 90, 242, 0.14);
  --ambient-3: rgba(48, 209, 88, 0.08);
  --shadow: var(--glass-hi), var(--glass-shadow);
}

/* Soft ambient light behind everything – this is what the glass "refracts". */
body::before {
  content: "";
  position: fixed;
  inset: -10vmax;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42vmax 42vmax at 8% -4%, var(--ambient-1), transparent 62%),
    radial-gradient(46vmax 46vmax at 104% 28%, var(--ambient-2), transparent 62%),
    radial-gradient(40vmax 40vmax at 26% 104%, var(--ambient-3), transparent 62%);
}

/* Surfaces: translucent with a hairline light edge */
.card,
.list,
.stat,
.fact,
.group-card,
.news-hero,
.news-post,
.ach,
.chip,
.dropzone {
  border: 0.5px solid var(--glass-border);
  box-shadow: var(--glass-hi), var(--glass-shadow);
}

.chip:not(.active) {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

/* Floating glass tab bar (phones) */
.tabbar {
  left: 12px;
  right: 12px;
  bottom: max(10px, calc(var(--safe-b) - 4px));
  height: 64px;
  padding: 6px;
  border-radius: 32px;
  border: 0.5px solid var(--glass-border);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-hi), 0 12px 36px rgba(15, 23, 42, 0.16);
  gap: 2px;
}

.tabbar a {
  border-radius: 26px;
  padding-top: 0;
  color: var(--label-2);
  transition: background-color 0.25s var(--ease), color 0.2s;
}

.tabbar a.active {
  background: var(--glass-active);
  color: var(--blue);
}

.tabbar a:active {
  transform: scale(0.94);
}

.main {
  padding-bottom: calc(64px + max(10px, var(--safe-b)) + 32px);
}

.offline-pill {
  bottom: calc(64px + max(10px, var(--safe-b)) + 14px);
}

/* Navigation bar: content scrolls under it, buttons are glass capsules */
.navbar.scrolled {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom-color: var(--glass-edge);
}

.navbar .nav-btn {
  height: 38px;
  min-width: 38px;
  padding: 0 11px;
  margin: 0 3px;
  border-radius: 19px;
  background: var(--glass);
  border: 0.5px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-hi), 0 4px 14px rgba(15, 23, 42, 0.08);
  font-size: 16px;
}

.navbar .nav-btn .icon {
  font-size: 19px;
}

.navbar .nav-btn.back {
  padding-left: 8px;
}

.navbar .nav-btn.back .icon {
  font-size: 20px;
  margin-left: 0;
}

.navbar .nav-btn:active {
  opacity: 1;
  transform: scale(0.94);
}

/* Segmented controls & search: frosted tracks */
.seg {
  background: var(--glass);
  border: 0.5px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: 12px;
  padding: 3px;
}

.seg button {
  border-radius: 9px;
}

.seg button.active {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1), var(--glass-hi);
}

.search input {
  background: var(--glass);
  border: 0.5px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  height: 40px;
  border-radius: 12px;
}

.search .icon {
  top: 11px;
}

/* Buttons: prominent with a soft glass sheen */
.btn:not(.tinted):not(.gray):not(.danger) {
  background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 82%, #fff), var(--blue));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 18px color-mix(in srgb, var(--blue) 35%, transparent);
}

.btn.tinted,
.btn.gray,
.icon-btn {
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 0.5px solid var(--glass-border);
}

/* Sheets & dialogs: milk glass */
.sheet {
  background: var(--glass-strong);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  border: 0.5px solid var(--glass-border);
}

.sheet-backdrop {
  background: rgba(10, 12, 20, 0.28);
}

@media (min-width: 700px) {
  .sheet {
    border-radius: 24px;
  }
}

@media (max-width: 699px) {
  .sheet {
    border-radius: 24px 24px 0 0;
  }
}

/* Weather hero: glass panel for the figures */
.hero .hero-grid {
  border-top: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  border: 0.5px solid rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.game-teaser .btn {
  background: rgba(255, 255, 255, 0.85) !important;
  box-shadow: inset 0 1px 0 #fff, 0 6px 16px rgba(0, 0, 0, 0.12) !important;
}

/* iPad / desktop: floating glass sidebar */
@media (min-width: 1000px) {
  .sidebar {
    inset: 12px auto 12px 12px;
    width: 256px;
    border-radius: 24px;
    border: 0.5px solid var(--glass-border);
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-hi), var(--glass-shadow);
  }

  .main {
    margin-left: 280px;
    padding-bottom: 48px;
  }

  .sidebar a {
    border-radius: 12px;
  }

  .sidebar a.active {
    background: var(--glass-active);
    color: var(--blue);
  }

  .sidebar a.active .icon {
    color: var(--blue);
  }

  .offline-pill {
    bottom: 20px;
  }
}

/* Tooltips & toasts in glass too */
.chart-tip {
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.toast {
  border: 0.5px solid rgba(255, 255, 255, 0.12);
}

@media (prefers-reduced-transparency: reduce) {
  :root,
  :root[data-theme="dark"] {
    --bg-elev: var(--bg-solid);
    --glass: var(--bg-solid);
    --glass-strong: var(--bg-solid);
  }

  body::before {
    display: none;
  }
}

@media print {
  body::before {
    display: none;
  }
}
