/* Snowly admin, after the Cloudflare dashboard (dash.cloudflare.com, 2026): its own colour
   tokens (sampled from the page and converted from oklch), Inter, a light sidebar with grouped
   navigation, a top bar, light-grey canvas, white panels with a grey header strip, dense tables. */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("inter-latin-wght-normal.woff2") format("woff2");
}

:root {
  --canvas: #fbfbfb;      /* page and sidebar */
  --elevated: #f8f8f8;    /* panel header strip */
  --recessed: #f3f3f3;    /* hover */
  --selected: #f2f2f2;    /* selected nav item */
  --base: #fff;           /* panels, inputs, buttons */
  --fill: #e5e5e5;        /* table row lines */
  --interact: #d4d4d4;
  --line: rgba(10, 10, 10, .1); /* borders */
  --control-line: #8f8f8f; /* inputs and selects: 3:1 on white, so the field can be seen (WCAG 1.4.11) */
  --text: #313131;
  --text-default: #171717;
  --text-strong: #0a0a0a;
  --subtle: #5f5f5f;      /* 6.2:1 on the canvas; #737373 only just passed */
  --placeholder: #737373; /* 4.7:1 on white */
  --link: #193cb8;
  --primary: #056dff;
  --primary-ring: #045ede;
  --primary-hover: #1447e6;
  --danger: #fb2c36; --danger-text: #c10007; --danger-tint: #ffe2e2;
  --success: #009966; --success-text: #006045; --success-tint: #dcfce7;
  --info-text: #193cb8; --info-tint: #dbeafe;
  --warning-text: #8a4600; --warning-tint: #fff4c2;
  --orange-text: #9f2d00; --teal-text: #005f5a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--text);
  font: 14px/1.5 "Inter Variable", ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a.strong { color: var(--text-default); font-weight: 500; }
h1 { font-size: 30px; line-height: 36px; font-weight: 600; color: var(--text-default); margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.lede { color: var(--subtle); font-size: 14px; margin-top: 4px; }
.muted { color: var(--subtle); }
.small { font-size: 12px; }
.hint { color: var(--subtle); font-size: 13px; margin-top: 12px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.danger-text { color: var(--danger-text); font-style: normal; }

/* Shell: sidebar + top bar */
.shell { display: flex; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; width: 259px; flex: none; display: flex; flex-direction: column;
  border-right: 1px solid var(--line); background: var(--canvas);
}
.side-head { height: 58px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.mark { display: inline-flex; width: 28px; height: 28px; }
.mark img { width: 28px; height: 28px; border-radius: 7px; }
.mark:hover { text-decoration: none; }
.account { font-size: 13px; font-weight: 500; color: var(--text-default); }
.side-nav { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 1px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-default);
}
.side-nav a svg { color: var(--subtle); flex: none; }
.side-nav a:hover { background: var(--recessed); text-decoration: none; }
.side-nav a.on { background: var(--selected); }
.side-nav a.on svg { color: var(--text-default); }
.side-nav .group { font-size: 13px; font-weight: 500; color: var(--subtle); padding: 0 12px; margin: 16px 0 6px; }
.side-foot { flex: none; height: 48px; display: flex; align-items: center; padding: 0 26px; border-top: 1px solid var(--line); font-size: 12px; color: var(--subtle); }

.frame { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10; height: 58px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: var(--canvas); border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; padding-left: 16px; font-size: 14px; font-weight: 500; color: var(--text-default); }
.crumb-section { display: inline-flex; align-items: center; gap: 8px; }
.crumb-section svg { color: var(--subtle); flex: none; }
.crumb-section a { color: inherit; }
.crumb-repeats { display: inline-flex; align-items: center; gap: 8px; min-width: 0; transition: opacity .18s ease, transform .18s ease; }
.crumb-sep { color: var(--placeholder); }
.crumb-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* While the page's heading is on screen, the crumb doesn't say it twice. */
.topbar.heading-visible .crumb-repeats { opacity: 0; transform: translateY(6px); pointer-events: none; }
.menu-button, .scrim { display: none; }
.menu-button { width: 36px; padding: 0; justify-content: center; }

/* The account: the avatar, opening a menu with who it is, the profile, security and signing out. */
.account-menu { position: relative; flex: none; }
.account-menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover, .account-menu[open] summary { background: var(--recessed); }
.account-menu summary .avatar { width: 28px; height: 28px; font-size: 12px; }
.account-menu .menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 260px; padding: 6px;
  background: var(--base); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(10, 10, 10, .12);
}
.menu-who { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--fill); min-width: 0; }
.menu-who .avatar { width: 36px; height: 36px; font-size: 15px; }
.menu-who div { display: flex; flex-direction: column; min-width: 0; }
.menu-who b { font-size: 14px; font-weight: 600; color: var(--text-default); }
.menu-who span { font-size: 13px; color: var(--subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu a, .menu button {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; height: 34px; padding: 0 10px;
  border: 0; border-radius: 8px; background: none; font-size: 13px; font-weight: 500; color: var(--text-default);
}
.menu a svg, .menu button svg { color: var(--subtle); }
.menu a:hover, .menu button:hover { background: var(--recessed); text-decoration: none; }
.passkey-add { display: flex; gap: 8px; }
.passkey-add .field { width: 220px; }

main { width: 100%; max-width: 1200px; padding: 32px 32px 64px; }
main.wide { max-width: none; padding: 0; flex: 1; }
main.bare { margin: 0 auto; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.actions { display: flex; gap: 8px; }
.profile { display: flex; align-items: center; gap: 16px; }

/* Banners */
.banner { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; border: 1px solid var(--line); }
.banner.info { background: var(--info-tint); color: var(--info-text); }
.banner.danger { background: var(--danger-tint); color: var(--danger-text); }

/* Panels: a grey header strip over a white body, both inside one 1px line */
.panel { background: var(--elevated); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 20px; overflow: hidden; }
.panel-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-height: 44px; padding: 6px 16px;
  font-size: 14px; font-weight: 500; color: var(--subtle);
}
.panel-head .head-link { margin-left: auto; font-weight: 500; }
.panel-body { background: var(--base); }
.panel-body:has(> table.grid) { overflow-x: auto; } /* a wide table scrolls inside its panel */
.panel-head + .panel-body { border-top: 1px solid var(--line); border-radius: 12px 12px 0 0; }
.panel-body.pad { padding: 16px; }
.panel-body p + .confirm { margin-top: 14px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 20px; }
.cols .panel { display: flex; flex-direction: column; }
.cols .panel-body { flex: 1; }
.empty { color: var(--subtle); text-align: center; padding: 20px 12px; }
.empty.flush { text-align: left; padding: 0; }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--fill); color: var(--text); font-size: 12px; font-weight: 500; }

/* Metrics: like the dashboard's analytics strip */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); }
.metric { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; color: var(--text); border-left: 1px solid var(--line); }
.metric:first-child { border-left: 0; }
a.metric:hover { background: var(--canvas); text-decoration: none; }
.metric .label { font-size: 14px; font-weight: 500; color: var(--text); }
.metric b { font-size: 30px; line-height: 38px; font-weight: 500; color: var(--text-default); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.metric small { font-size: 13px; color: var(--subtle); }

/* Tables */
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th {
  height: 40px; padding: 0 12px; text-align: left; white-space: nowrap;
  font-size: 14px; font-weight: 600; color: var(--text-default); background: var(--base); border-bottom: 1px solid var(--fill);
}
.grid td { height: 44px; padding: 6px 12px; border-bottom: 1px solid var(--fill); color: var(--text); vertical-align: middle; }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: var(--canvas); }
.grid th:first-child, .grid td:first-child { padding-left: 16px; }
.avatar-cell { width: 48px; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
  color: #fff; font-weight: 600; font-size: 11px; object-fit: cover; vertical-align: middle; flex: none;
}
.avatar.big { width: 56px; height: 56px; font-size: 22px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.dot.big { width: 14px; height: 14px; margin-right: 12px; vertical-align: 3px; }

dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; font-size: 14px; }
dt { color: var(--subtle); }
dd { margin: 0; color: var(--text-default); min-width: 0; overflow-wrap: anywhere; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--base); color: var(--text-default); font-size: 13px; font-weight: 500; }
.chip:hover { background: var(--recessed); text-decoration: none; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; white-space: nowrap;
  font-size: 12px; font-weight: 500; background: var(--recessed); color: #262626;
}
.badge.success, .badge.organizer, .badge.joined, .badge.friend_added, .badge.trip_invite { background: var(--success-tint); color: var(--success-text); }
.badge.danger, .badge.offline { background: var(--danger-tint); color: var(--danger-text); }
.badge.invited, .badge.push { background: var(--info-tint); color: var(--info-text); }
.badge.declined { color: var(--subtle); }
.badge.request-pending, .badge.friend_request { background: var(--info-tint); color: var(--info-text); }
.badge.request-accepted { background: var(--success-tint); color: var(--success-text); }
.badge.request-declined, .badge.request-withdrawn, .badge.request-expired { color: var(--subtle); }
.badge.code_sent { background: #e6f4f3; color: var(--teal-text); }
.badge.admin { background: #ffedd4; color: var(--orange-text); }
.badge.pro { background: #1a1a1a; color: #fff; font-weight: 600; letter-spacing: .02em; }

/* Controls: no shadows */
input, button { font: inherit; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.field {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--control-line);
  border-radius: 8px; background: var(--base); color: var(--subtle);
}
.field.grow { flex: 1; min-width: 220px; }
.field:focus-within { border-color: var(--text-default); }
.field input { flex: 1; min-width: 0; border: 0; outline: none; background: none; padding: 0; color: var(--text-default); font-size: 14px; }
.field input::placeholder { color: var(--placeholder); }
.label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-default); }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--base); color: var(--text-default);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
button:hover, .button:hover { background: var(--recessed); text-decoration: none; }
button.primary { background: var(--primary); border-color: var(--primary-ring); color: #fff; font-size: 14px; }
button.primary:hover { background: var(--primary-hover); }
button.destructive { background: var(--danger); border-color: var(--danger-text); color: #fff; }
button.destructive:hover { background: var(--danger-text); }
button.ghost, .button.ghost { border-color: transparent; background: none; }
button.ghost:hover, .button.ghost:hover { background: var(--recessed); }
.button.disabled { color: var(--placeholder); cursor: default; }
.button.disabled:hover { background: var(--base); }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; background: var(--base); overflow: hidden; flex-wrap: wrap; }
.segmented a, .segmented button {
  height: 34px; display: inline-flex; align-items: center; padding: 0 12px; border: 0; border-radius: 0; border-left: 1px solid var(--line);
  background: none; color: var(--text-default); font-size: 13px; font-weight: 500;
}
.segmented > :first-child { border-left: 0; }
.segmented a:hover, .segmented button:hover { background: var(--recessed); text-decoration: none; }
.segmented .on { background: var(--selected); }

.pager { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.pages { display: flex; gap: 8px; }

.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.danger-zone { border-color: #ffc9c9; }
.danger-zone .panel-head { color: var(--danger-text); }

/* Sign in */
main.bare:has(.login) { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login { width: 100%; max-width: 400px; padding: 24px 16px; }
.login-card { background: var(--base); border: 1px solid var(--line); border-radius: 16px; padding: 32px; }
.login-mark { display: block; width: 48px; height: 48px; border-radius: 11px; margin-bottom: 20px; }
.login h1 { font-size: 22px; line-height: 30px; color: var(--text-strong); }
.login-lede { margin: 6px 0 24px; color: var(--subtle); font-size: 14px; line-height: 22px; }
.login-lede b { color: var(--text-default); font-weight: 500; }
.login-lede a { margin-left: 4px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-field { height: 44px; }
.login-field input { font-size: 15px; }
.login-submit { height: 44px; }
.login-error { color: var(--danger-text); font-size: 13px; margin-top: -4px; }
.login-notice { color: var(--subtle); font-size: 13px; margin-top: -4px; }
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-box {
  width: 100%; height: 52px; padding: 0; border: 1px solid var(--interact); border-radius: 10px; background: var(--base);
  text-align: center; font-size: 22px; font-weight: 600; color: var(--text-strong); font-variant-numeric: tabular-nums; outline: none;
  caret-color: var(--primary); transition: border-color .12s, box-shadow .12s;
}
.code-box:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--info-tint); }
.code-boxes.invalid .code-box { border-color: var(--danger); }
.login-form.sending .code-box { opacity: .5; }
.login-resend { display: flex; align-items: center; gap: 4px; margin-top: 20px; font-size: 13px; }
button.link { height: auto; padding: 0; border: 0; background: none; color: var(--link); font-size: 13px; font-weight: 500; }
button.link:hover { background: none; text-decoration: underline; }
button.link:disabled { color: var(--placeholder); cursor: default; text-decoration: none; }
.login-dev { margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: var(--warning-tint); color: var(--warning-text); font-size: 13px; line-height: 20px; }
@media (max-width: 420px) { .login-card { padding: 24px 20px; } .code-box { height: 46px; font-size: 20px; } }

/* Live map */
.map-page { display: flex; height: calc(100vh - 58px); }
.map-side { width: 340px; flex: none; overflow-y: auto; padding: 24px; border-right: 1px solid var(--line); }
.map-side h1 { font-size: 24px; line-height: 32px; }
.map-side .lede { margin-bottom: 16px; }
.map-side .segmented { margin-bottom: 16px; }
#map { flex: 1; position: relative; }
/* Panorama: a pink glow in the sky's upper left, as in a painted panorama. */
#map.panorama::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 45%; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse 70% 100% at 0% 0%, rgba(252, 223, 233, 0.95), rgba(252, 223, 233, 0) 70%); }
.people { list-style: none; margin: 0; padding: 0; background: var(--base); border-top: 1px solid var(--line); }
.people li { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--fill); cursor: pointer; }
.people li:last-child { border-bottom: 0; }
.people li:hover { background: var(--canvas); }
.people .avatar { width: 28px; height: 28px; font-size: 12px; }
.people .name { font-weight: 500; color: var(--text-default); }
.people .meta { color: var(--subtle); font-size: 13px; }
.people li.offline .meta { color: var(--danger-text); }
.people li.empty { cursor: default; color: var(--subtle); justify-content: center; }
.marker { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.marker .pin { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; color: #fff; font-weight: 600; font-size: 12px;
  display: flex; align-items: center; justify-content: center; outline: 1px solid var(--line); }
.marker .label { margin-top: 3px; background: var(--base); color: var(--text-default); font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--line); white-space: nowrap; }
.marker.offline .pin { background: var(--danger) !important; }
.marker.offline .label { color: var(--danger-text); }
.marker.low-battery .label { color: var(--danger-text); }

@media (max-width: 900px) {
  /* The sidebar becomes a drawer, opened from the top bar's menu button. */
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; width: min(280px, 85vw); height: auto;
    transform: translateX(-100%); transition: transform .2s ease; visibility: hidden;
  }
  .shell.menu-open .side { transform: none; visibility: visible; }
  .shell.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(10, 10, 10, .3); }
  .menu-button { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  .crumb { flex: 1; padding-left: 0; }
  main { padding: 20px 16px 48px; }
  h1 { font-size: 24px; line-height: 32px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  .page-head { flex-direction: column; }
  .panel-body { overflow-x: auto; }
  .map-page { flex-direction: column-reverse; height: auto; }
  #map { height: 60vh; }
  .map-side { width: auto; border-right: 0; }
}

/* Overview live cards */
.roll { display: inline-flex; }
.roll .digit { position: relative; display: inline-block; }
.roll .digit > span { display: inline-block; }
.roll .digit > .gone { position: absolute; left: 0; top: 0; }
.metric .spark { margin: auto 0 0; padding-top: 10px; min-height: 62px; }
.spark svg { display: block; overflow: visible; }
.spark .line { fill: none; stroke: var(--primary); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark .now { fill: var(--primary); stroke: var(--base); stroke-width: 1.5; }
.spark .hits rect { fill: transparent; }
.spark .hits rect:hover { fill: var(--recessed); fill-opacity: .6; }
.spark figcaption { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--placeholder); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .spark .area, .spark .line, .spark .now { pointer-events: none; } }

/* Sales */
.metrics.five { grid-template-columns: repeat(5, 1fr); }
.metric b.money { font-size: 24px; line-height: 32px; }
.metric b.danger-text { color: var(--danger-text); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.page-head .segmented { flex-wrap: nowrap; white-space: nowrap; flex: none; }
.legend { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; font-weight: 400; color: var(--subtle); white-space: nowrap; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-left: 8px; }
.legend .new, .bar .new { background: var(--primary); }
.legend .renewal, .bar .renewal { background: #8ab8ff; }
.legend .pass, .bar .pass { background: #f59e0b; }
.legend .upgrade, .bar .upgrade { background: #16a34a; }
.legend .draw, .bar .draw { background: #a78bfa; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.bar { flex: 1; display: flex; flex-direction: column-reverse; height: 100%; border-radius: 3px 3px 0 0; overflow: hidden; }
.bar:hover { background: var(--recessed); }
.bar span { display: block; flex: none; }
.bars-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--placeholder); font-variant-numeric: tabular-nums; }
.badge.sale-purchase, .badge.sale-upgrade { background: var(--success-tint); color: var(--success-text); }
.badge.sale-renewal { background: var(--info-tint); color: var(--info-text); }
.badge.sale-day_pass { background: #ffedd4; color: var(--orange-text); }
.badge.sale-icon_draw { background: #f1eafe; color: #6b3fd0; }
.badge.sale-refund, .badge.sale-auto_renew_off { background: var(--danger-tint); color: var(--danger-text); }
.badge.sale-expired { color: var(--subtle); }
@media (max-width: 900px) {
  .metrics.five { grid-template-columns: repeat(2, 1fr); }
}

/* SOS */
.side-nav .nav-count { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.banner.sos-alert { display: flex; align-items: center; gap: 8px; background: var(--danger); border-color: var(--danger); color: #fff; }
.banner.sos-alert:hover { text-decoration: none; filter: brightness(1.05); }
.banner.calm { background: var(--base); color: var(--subtle); font-weight: 400; }
.sos-live { border-color: var(--danger); }
.sos-live .panel-head { color: var(--danger-text); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: live 1.4s ease-in-out infinite; }
@keyframes live { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
tr.stale td { color: var(--subtle); }
.hint-inline { margin-left: 10px; font-size: 12px; font-weight: 400; color: var(--subtle); }
.badge.sos-fall { background: var(--danger-tint); color: var(--danger-text); }
.badge.sos-manual { background: #ffedd4; color: var(--orange-text); }
.badge.warning { background: var(--warning-tint); color: var(--warning-text); }
.badge.sos { background: var(--danger-tint); color: var(--danger-text); }
.sos-detail { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 0 20px; }
.sos-map-panel { overflow: hidden; }
#sos-map { height: 420px; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 12px; color: var(--subtle); border-top: 1px solid var(--line); }
.map-legend i { display: inline-block; vertical-align: middle; margin-right: 6px; }
.map-legend .dot-sos { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.map-legend .dot-helper { width: 10px; height: 10px; border-radius: 50%; background: var(--success); }
.map-legend .line-track { width: 18px; height: 3px; border-radius: 2px; background: var(--primary); }
.map-legend .head-link { margin-left: auto; }
.marker.sos .pin { background: var(--danger); }
.marker.helper .pin { background: var(--success); }
.timeline { list-style: none; margin: 0 0 16px; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); border: 2px solid var(--base); }
.timeline li.danger::before { background: var(--danger); }
.timeline li.warning::before { background: var(--warning-text); }
.timeline li.success::before { background: var(--success); }
.timeline li.pending::before { background: var(--base); border-color: var(--line); }
.timeline time { font-size: 12px; }
.chip.nearby { border-style: dashed; }
tr.missing td { background: var(--danger-tint); }
@media (max-width: 900px) {
  .sos-detail { grid-template-columns: 1fr; }
}

/* Resorts */
.select, .form input:not([type=radio], [type=checkbox]), .form textarea, .row-form input {
  height: 32px; padding: 0 10px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--base);
  color: var(--text-default); font: inherit; font-size: 13px;
}
.select { padding-right: 6px; }
.toolbar .select { height: 36px; }
.form textarea { height: auto; padding: 6px 10px; width: 100%; resize: vertical; }
.form input:focus, .form textarea:focus, .row-form input:focus, .select:focus { outline: none; border-color: var(--text-default); }
.form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-default); padding-top: 22px; }
.form-fields { display: flex; flex-wrap: wrap; gap: 10px 12px; min-width: 0; }
.form-fields.column { flex-direction: column; }
.form-fields > label { display: flex; flex-direction: column; gap: 3px; }
.form-fields > label.grow { flex: 1; min-width: 220px; }
.form-fields > label.grow input { width: 100%; }
.form-fields.names > label { width: 200px; }
.form-fields .radio { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; }
.form-fields.column { gap: 10px; }
.form-fields .radio input { margin: 0; }
.form-fields .self-end { align-self: flex-end; padding-bottom: 7px; }
.form-row:first-child .form-label { padding-top: 22px; }
.form-fields.column > .radio:first-child { margin-top: 0; }
.form-row .form-fields.column { padding-top: 0; }
.form-row:has(.radio) .form-label { padding-top: 2px; }
.form-note { font-size: 12px; color: var(--subtle); margin: -6px 0 0 108px; }
.form-actions { display: flex; align-items: center; gap: 12px; padding-left: 108px; }
.provenance { padding-top: 14px; border-top: 1px dashed var(--line); }
.row-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-form input.phone { width: 160px; font-variant-numeric: tabular-nums; }
.row-form input.wide { width: 280px; }
.row-form input[name=source_ref] { width: 200px; }
.row-form input[name=note] { width: 140px; }
.grid.seasons thead, .grid.contacts thead th:nth-child(2) { font-weight: 400; }
.grid.seasons thead { display: none; }
tr.new-row td { background: var(--canvas); }
tr.stale-phone td { background: var(--warning-tint); }
tr.foot td { height: 36px; }
.warning-text { color: var(--warning-text); }
.badge.level { background: var(--fill); color: var(--text); font-variant-numeric: tabular-nums; }
.h1-sub { font-weight: 400; font-size: 20px; }
.banner.warning-banner { background: var(--warning-tint); color: var(--warning-text); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
/* Still a table cell (a flex cell drops out of the row and its lines go out of step). */
.marks .mark-item + .mark-item { margin-left: 4px; }
.mark-item { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.mark-item.yes { background: var(--success-tint); color: var(--success-text); }
.mark-item.no { background: var(--recessed); color: #666; text-decoration: line-through; }
.mark-item.stale { background: var(--warning-tint); color: var(--warning-text); }
ul.plain { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
#resort-map { height: 420px; }
#resort-map.pick { height: 360px; }
.map-legend .dot-center { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.map-legend .dot-base { width: 10px; height: 10px; border-radius: 50%; background: var(--success); }
.map-legend .dot-summit { width: 10px; height: 10px; border-radius: 50%; background: #171717; }
.map-legend .box-bounds { width: 14px; height: 10px; border: 1px dashed var(--subtle); }
.map-legend .line-trail { width: 18px; height: 3px; border-radius: 2px; background: #2563eb; }
.map-legend .line-lift { width: 18px; height: 0; border-top: 2px dashed #dc2626; }
.marker.center .pin { background: var(--primary); }
.marker.base .pin { background: var(--success); }
.marker.summit .pin { background: #171717; }
@media (max-width: 900px) {
  .form-row { grid-template-columns: 1fr; gap: 4px; }
  .form-label, .form-row:first-child .form-label { padding-top: 0; }
  .form-note, .form-actions { margin-left: 0; padding-left: 0; }
}

/* Page headings lead with their section's icon, the same one as the sidebar and the crumb. */
h1.with-icon > svg { width: 28px; height: 28px; margin-right: 10px; vertical-align: -4px; color: var(--subtle); }

/* Resort list: the name on a line of its own, the tags in a quieter row under it. */
.resort-cell { min-width: 260px; padding-top: 10px !important; padding-bottom: 10px !important; }
.resort-name { font-size: 15px; font-weight: 600; color: var(--text-strong); }
.resort-en { margin-left: 8px; color: var(--subtle); }
.resort-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.resort-tags:empty { display: none; }
.resort-cell .danger-text { margin: 4px 0 0; }

/* Labs */
.section-title { margin: 32px 0 12px; font-size: 16px; font-weight: 600; color: var(--text-default); }
.page-head + .section-title { margin-top: 0; }
.legend .m-moving, .bar .m-moving { background: var(--primary); }
.legend .m-up, .bar .m-up { background: #f59e0b; }
.legend .m-still, .bar .m-still { background: var(--danger); }
.legend .m-ended, .bar .m-ended { background: var(--placeholder); }
.bars.share { margin-top: 18px; }
.bars.share .bar { position: relative; overflow: visible; background: var(--fill); }
.bars.share .bar::before { content: attr(data-count); position: absolute; bottom: 100%; left: 0; right: 0; margin-bottom: 3px; text-align: center; font-size: 11px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.sim { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.sim label { display: grid; grid-template-columns: 88px 1fr 72px; align-items: center; gap: 12px; font-size: 13px; color: var(--subtle); }
.sim output { text-align: right; font-weight: 500; color: var(--text-default); font-variant-numeric: tabular-nums; }
.sim-result { grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); margin: 0 -16px -16px; }
.sim-result .metric b { font-size: 24px; line-height: 32px; }

/* Icons */
.app-icon { border-radius: 22.5%; border: 1px solid var(--fill); display: block; flex-shrink: 0; }
.icon-cell { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.icon-cell:hover .strong { text-decoration: underline; }
.icon-head { display: flex; align-items: center; gap: 16px; }
.icon-head h1 { margin: 0; }
.badge.unlock-pro { background: #1a1a1a; color: #fff; font-weight: 600; }
.badge.unlock-draw { background: #f1eafe; color: #6b3fd0; }
.badge.unlock-gift { background: #ffedd4; color: var(--orange-text); }

/* Drawers: a page's settings open from a button in its header and slide in from the right,
   so the page itself only shows what's set. */
.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.page-head:has(> .head-actions) { flex-direction: row; } /* the button stays on the right, also on a narrow screen */
.panel-head .head-action { margin-left: auto; height: 30px; padding: 0 10px; }
dialog.drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; width: min(560px, 100vw); height: 100dvh; max-width: none; max-height: none;
  padding: 0; border: 0; border-left: 1px solid var(--line); background: var(--base); color: var(--text);
  transform: translateX(100%); transition: transform .22s ease, overlay .22s allow-discrete, display .22s allow-discrete;
}
dialog.drawer[open] { transform: none; }
dialog.drawer:focus { outline: none; }
@starting-style { dialog.drawer[open] { transform: translateX(100%); } }
dialog.drawer::backdrop { background: rgba(10, 10, 10, 0); transition: background .22s ease, overlay .22s allow-discrete, display .22s allow-discrete; }
dialog.drawer[open]::backdrop { background: rgba(10, 10, 10, .28); }
@starting-style { dialog.drawer[open]::backdrop { background: rgba(10, 10, 10, 0); } }
.drawer-form { display: flex; flex-direction: column; height: 100%; gap: 0; }
.drawer-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 58px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text-default); }
.drawer-head button { width: 36px; padding: 0; color: var(--subtle); }
.drawer-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; padding: 20px; }
.drawer-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--canvas); }
.drawer-foot .danger-text { margin-right: auto; }
.drawer .form-row { grid-template-columns: 1fr; gap: 8px; }
.drawer .form-label, .drawer .form-row:first-child .form-label, .drawer .form-row:has(.radio) .form-label { padding-top: 0; }
.drawer .form-note { margin: -10px 0 0; }
.drawer .form-fields > label.grow { min-width: 100%; }
.drawer .form-fields.names > label { width: calc(50% - 6px); }
.drawer .form-fields.names input { width: 100%; }
.drawer .provenance { padding-top: 20px; }
.drawer-body input.wide { width: 100%; }
.drawer .radio b { white-space: nowrap; }
