/* =========================================================
   Liquid theme — Apple "Liquid Glass"-style translucent glass
   tiles over an underwater background, bento layout, Manrope.
   Loaded after style.css and overrides it.
   ========================================================= */
:root {
  color-scheme: dark;
  --font: Manrope, Inter, system-ui, -apple-system, sans-serif;
  --bg: #020a16;
  --bg-card: rgba(255,255,255,.07);
  --bg-card-hover: rgba(255,255,255,.11);
  --bg-input: rgba(255,255,255,.07);
  --accent: #9bdcff;
  --accent-bright: #c9ecff;
  --accent-dim: rgba(155,220,255,.12);
  --accent-glow: rgba(155,220,255,.22);
  --coral: #ffb38a;
  --purple: #b8a8ff;
  --purple-dim: rgba(184,168,255,.12);
  --white: #f4f8ff;
  --text: #f4f8ff;
  --text-dim: rgba(226,238,255,.64);
  --text-muted: rgba(226,238,255,.40);
  --border: rgba(255,255,255,.12);
  --border-light: rgba(255,255,255,.20);
  --danger: #ff7a85;
  --gradient: linear-gradient(135deg, #ffffff, #d6ecff);
  --surface: rgba(255,255,255,.07);
  --glass: rgba(255,255,255,.075);
  --glass-strong: rgba(255,255,255,.13);
  --glass-edge: rgba(255,255,255,.18);
  --glass-blur: blur(26px) saturate(180%);
  --r-lg: 28px; --r-md: 20px; --r-sm: 14px;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #020a16; --bg-card: rgba(255,255,255,.07); --bg-card-hover: rgba(255,255,255,.11); --bg-input: rgba(255,255,255,.07);
    --text: #f4f8ff; --text-dim: rgba(226,238,255,.64); --text-muted: rgba(226,238,255,.40);
    --border: rgba(255,255,255,.12); --border-light: rgba(255,255,255,.20); --white: #f4f8ff; --surface: rgba(255,255,255,.07); }
}
html, body { max-width: 100%; overflow-x: hidden; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  -webkit-font-smoothing: antialiased; letter-spacing: -.005em;
}
button, input, select, textarea { font-family: var(--font); }
body::before, body::after { content: none; }

/* Underwater background (one rendered frame from ocean.js) + slow light drift */
#ocean-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(120% 70% at 50% -10%, #1f5f92 0%, #06213f 45%, #020a16 85%);
  background-size: cover; background-position: center top;
}
#ocean-bg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(60% 40% at 30% 10%, rgba(170,225,255,.10), transparent 70%),
              linear-gradient(180deg, rgba(2,10,22,0) 40%, rgba(2,10,22,.65));
  animation: bgBreathe 8s ease-in-out infinite alternate;
}
@keyframes bgBreathe { from { opacity: .7; } to { opacity: 1; } }

/* Glass recipe: translucent fill, blur, light edge and a specular top highlight */
.tile, .card, .shop-panel, .header, .modal, .tabs-bar, .more-menu, .toast, .login-card {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
  box-shadow: 0 20px 50px rgba(0,8,24,.35), inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(255,255,255,.04);
}
.tile, .card { border-radius: var(--r-lg); position: relative; overflow: hidden; }
.tile::before, .card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,0) 38%);
}

/* ---------- Header ---------- */
.header {
  margin: 10px 12px 0; border-radius: var(--r-md); padding: 10px 0; position: sticky; top: 10px;
}
.header-stats { display: none !important; }
.brand-sub { display: none; }
.brand svg { width: 34px; height: 34px; }
.brand svg > rect:nth-of-type(1), .brand svg > rect:nth-of-type(2) { display: none; }
.brand-name { font-weight: 600; font-size: 1rem; letter-spacing: .22em; text-transform: uppercase; color: #fff; }
.brand-name .mr, .brand-name .dot { color: #fff; background: none; -webkit-text-fill-color: currentColor; }
.brand-name .dive { display: none; }
.lang-toggle {
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 999px; color: #fff;
  font-weight: 600; padding: 6px 12px;
}
.lang-toggle:hover { background: var(--glass-strong); color: #fff; border-color: var(--glass-edge); }
.user-avatar { border: 1px solid var(--glass-edge); }
.container { max-width: 1120px; padding-top: 18px; }

/* ---------- Navigation ---------- */
.tabs-bar { border-radius: 999px; padding: 5px; gap: 2px; margin-bottom: 22px; display: flex; align-items: center; }
.tab {
  border-radius: 999px; padding: 9px 15px; font-size: .78rem; font-weight: 600; color: var(--text-dim);
  transition: background .25s, color .25s;
}
.tab::after { content: none; }
.tab.active { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.tab:not(.active):hover { color: #fff; background: rgba(255,255,255,.06); }
.tab-cta { order: 99; margin-left: auto; }
.tab.tab-cta { background: #fff; color: #081320; }
.tab.tab-cta:hover, .tab.tab-cta.active { background: #fff; color: #081320; }

@media (max-width: 600px) {
  .header { margin: 8px 10px 0; top: 8px; }
  .tabs-bar {
    position: fixed; left: 14px; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); top: auto;
    border-radius: 999px; padding: 6px 6px; margin: 0; justify-content: space-around;
  }
  .tab {
    flex: 1; padding: 6px 0; font-size: .58rem; font-weight: 600; gap: 4px;
    display: flex; flex-direction: column; align-items: center;
  }
  .tab.active { background: rgba(255,255,255,.14); }
  .tab::before {
    content: '' !important; display: block; width: 22px; height: 22px; background: currentColor;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: contain; mask-size: contain;
  }
  #tab-home::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11l8-6 8 6v8a1 1 0 0 1-1 1h-4v-6h-6v6H5a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11l8-6 8 6v8a1 1 0 0 1-1 1h-4v-6h-6v6H5a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
  #tab-history::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10'/%3E%3C/svg%3E"); }
  #tab-stats::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 20V11M12 20V5M19 20v-6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 20V11M12 20V5M19 20v-6'/%3E%3C/svg%3E"); }
  #tab-map::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6-5.3-6-11a6 6 0 0 1 12 0c0 5.7-6 11-6 11z'/%3E%3Ccircle cx='12' cy='10' r='2.2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6-5.3-6-11a6 6 0 0 1 12 0c0 5.7-6 11-6 11z'/%3E%3Ccircle cx='12' cy='10' r='2.2'/%3E%3C/svg%3E"); }
  #tab-more::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='5' cy='12' r='1.2'/%3E%3Ccircle cx='12' cy='12' r='1.2'/%3E%3Ccircle cx='19' cy='12' r='1.2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='5' cy='12' r='1.2'/%3E%3Ccircle cx='12' cy='12' r='1.2'/%3E%3Ccircle cx='19' cy='12' r='1.2'/%3E%3C/svg%3E"); }
  #tab-stats { display: none; }
  .tabs-bar #tab-home { order: -3; } .tabs-bar #tab-history { order: -2; } .tabs-bar #tab-log { order: -1; margin: 0; }
  .tabs-bar #tab-log.tab-cta { background: none; box-shadow: none; font-size: 0; gap: 0; flex: 0 0 64px; }
  .tabs-bar #tab-log.tab-cta::before {
    -webkit-mask-image: none; mask-image: none; width: 50px; height: 50px; border-radius: 50%;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23081320' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / 22px no-repeat;
    box-shadow: 0 8px 24px rgba(0,10,30,.45), inset 0 -2px 6px rgba(0,40,80,.15);
  }
  .tab:not(.active) { color: var(--text-dim); }
  .more-menu {
    bottom: calc(86px + env(safe-area-inset-bottom)); left: 14px; right: 14px;
    border-radius: var(--r-md); padding: 8px;
  }
  .more-menu .tab { flex: 0 0 auto; padding: 10px 16px; font-size: .78rem; flex-direction: row; }
  .more-menu .tab::before { display: none; }
  .container { padding: 14px 12px calc(110px + env(safe-area-inset-bottom)) !important; }
}

/* ---------- Generic surfaces & forms ---------- */
.card { padding: 26px 22px; }
.card-title {
  font-size: 1.6rem; font-weight: 600; letter-spacing: -.03em; color: #fff;
  border-bottom: 0; padding-bottom: 0; margin-bottom: 20px;
}
.card-title .accent { color: var(--accent); }
label { font-size: .62rem; letter-spacing: .12em; font-weight: 700; color: var(--text-dim); }
input, select, textarea, .search-input, .filter-select, .login-input, .edit-input {
  background: rgba(255,255,255,.07); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: #fff; padding: 11px 14px;
}
input:focus, select:focus, textarea:focus, .search-input:focus, .login-input:focus, .edit-input:focus {
  border-color: rgba(155,220,255,.6); box-shadow: 0 0 0 4px rgba(155,220,255,.14); background: rgba(255,255,255,.1);
}
select option { background: #0b1e33; }
/* iOS Safari zooms into any field under 16px and stays zoomed (the app then
   opens "too big"). Class rules above beat style.css's generic 16px, so force it. */
@media (max-width: 600px), (pointer: coarse) {
  input, select, textarea, .search-input, .filter-select, .login-input, .edit-input { font-size: 16px !important; }
}
.depth-fill { background: linear-gradient(90deg, var(--accent), #fff); }
.depth-val { color: #fff; font-weight: 600; }
.star { filter: grayscale(1) opacity(.3); }
.star.active, .star:hover { filter: none; }

/* ---------- Buttons ---------- */
.btn-solid, .btn-primary, .btn-email, .btn-shop {
  background: #fff; color: #081320; border: 0; border-radius: 999px;
  font: 700 .86rem/1 var(--font); letter-spacing: .01em; text-transform: none;
  padding: 15px 22px; box-shadow: 0 8px 24px rgba(0,10,30,.35); cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.btn-solid:hover, .btn-primary:hover, .btn-email:hover, .btn-shop:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(0,10,30,.45); background: #fff; }
.btn-solid:active, .btn-primary:active, .btn-email:active, .btn-shop:active { transform: scale(.98); }
.btn-ghost {
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid var(--glass-edge); border-radius: 999px;
  font: 600 .86rem/1 var(--font); padding: 15px 22px; cursor: pointer; transition: background .2s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.btn-ghost:hover { background: rgba(255,255,255,.16); }
.btn-edit {
  background: rgba(255,255,255,.08); border: 1px solid var(--border); color: #fff; border-radius: 999px; font-weight: 600; padding: 11px 14px;
}
.btn-edit:hover { background: rgba(255,255,255,.14); border-color: var(--border-light); }
.btn-delete { border-radius: 999px; border-color: rgba(255,122,133,.4); background: transparent; }
.btn-google { border-radius: 999px; }
.link-btn { background: none; border: 0; color: var(--accent); font: 600 .8rem var(--font); cursor: pointer; padding: 0; }
.eyebrow { font-size: .64rem; letter-spacing: .26em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }

/* ---------- Home: bento grid ---------- */
#panel-home { margin: 0; }
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile { padding: 22px; animation: tileIn .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes tileIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.tile-hero { grid-column: span 2; grid-row: span 2; padding: 26px 26px 22px; cursor: pointer; display: flex; flex-direction: column; }
.tile-stat { animation-delay: calc(.08s + var(--i, 0) * .05s); display: flex; flex-direction: column; justify-content: space-between; min-height: 132px; }
.tile-stat small { font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }
.tile-stat b { font-weight: 300; font-size: clamp(2.2rem, 6vw, 3.4rem); letter-spacing: -.045em; color: #fff; line-height: 1; }
.tile-stat b i { font-style: normal; font-size: .4em; color: var(--text-dim); margin-left: 4px; font-weight: 500; letter-spacing: 0; }
.tile-actions { grid-column: span 4; display: flex; gap: 10px; flex-wrap: wrap; padding: 14px; animation-delay: .3s; }
.tile-actions > * { flex: 1 1 90px; padding-left: 10px; padding-right: 10px; }
.tile-recent { grid-column: span 4; padding: 6px 20px 12px; animation-delay: .36s; }
.home-empty { grid-column: span 4; }
.home-empty .tile-actions, .home-empty .home-actions { display: flex; gap: 10px; margin-top: 24px; }

.hero-site { margin: 12px 0 6px; font-weight: 600; font-size: clamp(2.2rem, 7vw, 3.6rem); line-height: 1; letter-spacing: -.045em; color: #fff; }
.hero-loc { color: var(--text-dim); font-size: .9rem; font-weight: 500; }
.hero-depth { margin-top: auto; padding-top: 22px; display: flex; align-items: baseline; gap: 6px; color: #fff; }
.hero-depth .num { font-weight: 200; font-size: clamp(5rem, 22vw, 8.5rem); line-height: .82; letter-spacing: -.07em; }
.hero-depth .unit { font-weight: 600; font-size: 1.3rem; color: var(--text-dim); }
.hero-profile-wrap { position: relative; margin: 16px -26px 0; }
.hero-profile { display: block; width: 100%; height: 110px; }
.hp-surface { stroke: rgba(255,255,255,.3); stroke-width: 1; stroke-dasharray: 2 6; vector-effect: non-scaling-stroke; }
.hp-line {
  fill: none; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px rgba(155,220,255,.8));
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: hpDraw 1.6s .35s cubic-bezier(.6,0,.2,1) forwards;
}
.hp-fill { opacity: 0; animation: hFade 1s 1.2s forwards; }
@keyframes hpDraw { to { stroke-dashoffset: 0; } }
@keyframes hFade { to { opacity: 1; } }
.hp-note { position: absolute; right: 26px; bottom: 4px; font-size: .55rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.hero-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.hero-facts > div { background: rgba(255,255,255,.07); border-radius: var(--r-sm); padding: 10px 12px; }
.hero-facts b { display: block; font-weight: 700; font-size: .95rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-facts small { display: block; margin-top: 3px; font-size: .55rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 14px 0 6px; }
.section-head h2 { font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em; color: #fff; }

/* ---------- Dive rows ---------- */
.dives-list { display: flex; flex-direction: column; gap: 0; }
#panel-history .dives-list {
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge); border-radius: var(--r-lg); padding: 4px 16px;
  box-shadow: 0 20px 50px rgba(0,8,24,.35), inset 0 1px 0 rgba(255,255,255,.22);
}
.dive-card {
  background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none;
  padding: 15px 2px; display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; cursor: pointer;
  transition: background .2s;
}
.dive-card:last-child { border-bottom: 0; }
.dive-card:hover { background: rgba(255,255,255,.04); border-color: var(--border); box-shadow: none; }
.dive-num { background: none; width: auto; height: auto; color: var(--text-muted); font-weight: 700; font-size: .72rem; font-variant-numeric: tabular-nums; }
.dive-info h3 { font-size: 1rem; font-weight: 700; color: #fff; letter-spacing: -.02em; margin-bottom: 4px; }
.dive-info h3 span { color: var(--text-dim) !important; font-weight: 500 !important; }
.dive-meta { gap: 0; }
.chip { background: none; border: 0; padding: 0; font-size: .74rem; color: var(--text-dim); }
.chip + .chip::before { content: '·'; margin: 0 7px; color: var(--text-muted); }
.chip span { color: var(--text-dim); font-weight: 500; }
.dive-info > div[style*="margin-top"] { color: var(--coral); letter-spacing: .12em; font-size: .68rem !important; }
.dive-depth-col { display: block; text-align: right; min-width: 64px; }
.depth-big { font-size: 1.8rem; font-weight: 300; letter-spacing: -.05em; color: #fff; background: none; -webkit-text-fill-color: currentColor; }
.depth-unit { font-size: .55rem; letter-spacing: .2em; color: var(--text-dim); font-weight: 700; }
.filters .search-input, .filters .filter-select { border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-color: var(--glass-edge); }

/* ---------- Modal: glass bottom sheet ---------- */
.modal-overlay { background: rgba(2,8,20,.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal { border-radius: var(--r-lg); background: rgba(16,30,48,.72); }
.modal::before { content: none; }
.modal-badge { background: none; color: var(--text-dim); padding: 0; font-size: .64rem; font-weight: 700; letter-spacing: .26em; }
.modal h2 { font-size: 1.9rem; font-weight: 700; letter-spacing: -.04em; color: #fff; margin: 6px 0; }
.modal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.modal-stats > div, .m-stat { background: rgba(255,255,255,.07); border: 0; border-radius: var(--r-sm); padding: 14px 10px; }
.m-stat-val { font-weight: 300 !important; font-size: 1.5rem !important; color: #fff !important; letter-spacing: -.04em; }
.m-stat-label { letter-spacing: .14em !important; color: var(--text-dim) !important; font-weight: 700 !important; }
.modal-notes { border-left: 2px solid var(--accent); background: rgba(255,255,255,.05); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.modal-close { background: rgba(255,255,255,.12); border-radius: 50%; color: #fff; }
@media (max-width: 600px) {
  /* the floating tab bar sits over the sheet: leave room so the last buttons (Add photos) clear it */
  .modal { border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0; padding-top: 50px; padding-bottom: calc(120px + env(safe-area-inset-bottom)) !important; }
  .modal::after { content: ''; position: absolute; top: 12px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 5px; background: rgba(255,255,255,.3); }
  .modal-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Login, toast, panels ---------- */
.login-screen { background: transparent; }
.login-card { border-radius: var(--r-lg); padding: 40px 28px; }
.login-card .brand-name { font-size: 1.3rem !important; }
.toast { border-radius: 999px; color: #fff; font-weight: 600; border-left: 1px solid var(--glass-edge); }
.panel.active { animation: panelIn .45s cubic-bezier(.2,.8,.2,1); }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .bento { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tile-hero, .tile-actions, .tile-recent, .home-empty { grid-column: span 2; }
  .tile-hero { grid-row: auto; }
  .tile-stat { min-height: 116px; padding: 18px; }
  .hero-profile-wrap { margin: 16px -26px 0; }
}
@media (max-width: 600px) {
  .tile-hero { padding: 22px 20px 18px; }
  .hero-profile-wrap { margin: 14px -20px 0; }
  .hero-facts { grid-template-columns: repeat(2, 1fr); }
  .tile-recent { padding: 4px 16px 8px; }
}

/* ---------- Log dive form v2 ---------- */
@media (max-width: 600px) { .form-sec .form-grid { grid-template-columns: 1fr 1fr; } }
#panel-log { display: none; }
#panel-log.active { display: flex; flex-direction: column; gap: 14px; }
.log-head .card-title { margin: 4px 4px 0; font-size: 1.9rem; }
.import-tile {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; cursor: pointer;
  background: linear-gradient(135deg, rgba(155,220,255,.22), rgba(255,255,255,.06));
}
.import-tile:active { transform: scale(.99); }
.import-ico {
  flex: 0 0 46px; height: 46px; border-radius: 14px; background: #fff;
  -webkit-mask: none; position: relative;
}
.import-ico::after {
  content: ''; position: absolute; inset: 11px; background: #081320;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V4M7.5 8.5 12 4l4.5 4.5'/%3E%3Cpath d='M5 14v4a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V4M7.5 8.5 12 4l4.5 4.5'/%3E%3Cpath d='M5 14v4a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.import-txt { flex: 1; min-width: 0; text-transform: none; letter-spacing: normal; }
.import-txt b { display: block; font-size: 1rem; font-weight: 700; color: #fff; }
.import-txt small { display: block; margin-top: 3px; font-size: .74rem; color: var(--text-dim); font-weight: 500; }
.import-go { font-size: 1.3rem; color: var(--text-dim); }
.log-or { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; margin: 2px 6px; }
.log-or::before, .log-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.form-sec { padding: 20px; }
.sec-title {
  font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-dim);
  font-weight: 800; margin: 0 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
details.form-sec > summary { list-style: none; cursor: pointer; margin: 0; }
details.form-sec > summary::-webkit-details-marker { display: none; }
details.form-sec > summary::after { content: '+'; font-size: 1.3rem; font-weight: 300; color: #fff; letter-spacing: 0; transition: transform .25s; }
details.form-sec[open] > summary { margin-bottom: 14px; }
details.form-sec[open] > summary::after { transform: rotate(45deg); }
details.form-sec > summary em { font-style: normal; margin-left: auto; color: var(--accent); letter-spacing: .04em; text-transform: none; font-weight: 700; font-size: .8rem; }
.form-sec .form-grid { margin-bottom: 0; gap: 12px; grid-template-columns: 1fr 1fr; }
.form-sec .form-grid > .form-group { min-width: 0; }
.form-sec .form-group { overflow: visible; }
.form-sec .form-group + .form-group.full, .form-sec > .form-group.full + .form-group.full { margin-top: 0; }
.form-sec > .form-group.full { margin-bottom: 12px; }

.depth-hero { margin-bottom: 16px; }
.depth-input { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.depth-input input {
  background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important;
  font: 200 4.2rem/1 var(--font) !important; letter-spacing: -.05em; color: #fff; width: 4.2ch; min-width: 0;
}
.depth-input input::placeholder { color: rgba(255,255,255,.25); }
.depth-input span { font-size: 1.2rem; color: var(--text-dim); font-weight: 600; }
.depth-hero .depth-display { margin-top: 6px; }
.depth-hero .depth-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); }

.gps-row { display: flex; gap: 8px; }
.gps-row input { flex: 1; cursor: pointer; }
.btn-icon {
  flex: 0 0 46px; border-radius: var(--r-sm); border: 1px solid var(--border); background: rgba(255,255,255,.1);
  color: #fff; font-size: 1.2rem; cursor: pointer;
}
.gps-map { height: 220px; border-radius: var(--r-sm); overflow: hidden; margin-top: 10px; border: 1px solid var(--border); }

.stars { gap: 6px; }
.star { font-size: 2rem; line-height: 1; color: rgba(255,255,255,.18); filter: none !important; transition: transform .15s, color .15s; }
.star.active { color: var(--coral); text-shadow: 0 0 14px rgba(255,179,138,.5); }
.star:hover { transform: scale(1.12); }
#f-notes { min-height: 110px; }

.save-bar { position: sticky; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 5; padding-top: 4px; }
.save-bar .btn-primary { width: 100%; margin: 0; padding: 17px; font-size: .95rem; box-shadow: 0 12px 34px rgba(0,10,30,.55); }
@media (min-width: 601px) { .save-bar { bottom: 16px; } }

/* ---------- Reminders ---------- */
.tile-remind { grid-column: span 2; cursor: pointer; animation-delay: .1s; }
.tile-remind small { font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }
.tile-remind ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.tile-push p { margin: 8px 0 12px; color: var(--text-dim); font-size: .85rem; line-height: 1.45; }
.tile-push .btn-solid { width: 100%; }
.tile-remind li, .rem-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-sm); background: rgba(255,255,255,.06);
  box-shadow: inset 3px 0 0 rgba(155,220,255,.6); font-size: .84rem;
}
.tile-remind li b, .rem-row b { color: #fff; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-remind li span { color: var(--text-dim); font-weight: 600; white-space: nowrap; }
.tile-remind li.soon, .rem-row.soon { box-shadow: inset 3px 0 0 #ffc46b; }
.tile-remind li.soon span { color: #ffc46b; }
.tile-remind li.over, .rem-row.over { box-shadow: inset 3px 0 0 #ff5c68; background: rgba(255,92,104,.1); }
.tile-remind li.over span { color: #ff7a85; }
.rem-row { margin-bottom: 6px; }
.rem-row div { min-width: 0; display: flex; flex-direction: column; }
.rem-row small { color: var(--text-dim); font-size: .72rem; font-weight: 600; margin-top: 2px; }
.rem-del { background: none; border: 0; color: var(--text-muted); font-size: .9rem; cursor: pointer; padding: 6px; }
.dates-card { margin-top: 14px; }
.dates-card .muted { color: var(--text-dim); font-size: .84rem; margin-bottom: 10px; }
.rem-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.rem-form #rem-title { grid-column: 1 / -1; order: 2; }
.rem-form #rem-kind { order: 1; } .rem-form #rem-date { order: 1; }
.rem-form .btn-solid { grid-column: 1 / -1; order: 3; }
.svc-btn {
  margin-top: 8px; background: rgba(255,255,255,.1); border: 1px solid var(--border); color: #fff;
  border-radius: 999px; padding: 7px 14px; font: 600 .74rem var(--font); cursor: pointer;
}

.btn-edit.btn-share { background: #fff; color: #081320; border-color: #fff; font-weight: 700; }

/* ---------- Page heads + stats (bento) ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 4px 16px; }
.page-title { font-size: 1.9rem; font-weight: 700; letter-spacing: -.04em; color: #fff; line-height: 1; }
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.seg button { border: 0; background: none; color: var(--text-dim); font: 600 .76rem var(--font); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.tile-wide { grid-column: span 4; }
.tile-half { grid-column: span 2; }
.tile .sec-title em { font-style: normal; color: var(--accent); text-transform: none; letter-spacing: .02em; font-weight: 700; font-size: .78rem; }
.muted { color: var(--text-dim); font-size: .84rem; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.bar i { display: block; width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #fff, var(--accent)); box-shadow: 0 0 14px rgba(155,220,255,.35); }
.bar i.zero { background: rgba(255,255,255,.12); box-shadow: none; }
.bar-n { font-size: .7rem; font-weight: 700; color: #fff; min-height: 1em; }
.bar small { font-size: .6rem; color: var(--text-dim); font-weight: 600; text-transform: capitalize; }

.depth-chart { display: block; width: 100%; height: 170px; overflow: visible; }
.dc-surface { stroke: rgba(255,255,255,.3); stroke-dasharray: 2 6; vector-effect: non-scaling-stroke; }
.dc-line { fill: none; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px rgba(155,220,255,.7)); }
.dc-dot { fill: #fff; stroke: rgba(155,220,255,.9); stroke-width: 2; vector-effect: non-scaling-stroke; cursor: pointer; }
.chart-axis { display: flex; justify-content: space-between; font-size: .66rem; color: var(--text-muted); font-weight: 600; margin-top: 6px; }

.records { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.record { text-align: left; border: 0; cursor: pointer; padding: 14px; border-radius: var(--r-md); background: rgba(255,255,255,.07);
  color: #fff; font-family: var(--font); display: flex; flex-direction: column; gap: 4px; transition: background .2s; }
.record:hover { background: rgba(255,255,255,.12); }
.record small { font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }
.record b { font-size: 1.5rem; font-weight: 300; letter-spacing: -.04em; }
.record span { font-size: .72rem; color: var(--text-dim); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rank-row { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr auto; gap: 10px; align-items: center; padding: 7px 0; font-size: .84rem; }
.rank-row span:first-child { color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), #fff); }
.rank-row b { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 14px; border-radius: 8px; overflow: hidden; gap: 2px; margin-bottom: 14px; }
.stack i { display: block; min-width: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .78rem; color: var(--text-dim); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b, .chip-pill b { color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-pill { padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--border); font-size: .8rem; color: var(--text-dim); font-weight: 600; }
.export-row { display: flex; gap: 10px; margin-top: 14px; }
.export-row > * { flex: 1; }
@media (max-width: 860px) { .tile-wide, .tile-half { grid-column: span 2; } }
@media (max-width: 600px) { .bars { gap: 3px; height: 130px; } .bar small { font-size: .52rem; } .record b { font-size: 1.3rem; } }

/* ---------- Certs, Gear, Planner, Checklist: restyle the inline-styled markup ---------- */
#panel-certs .card, #panel-gear .card, #panel-plan .card, :is(#panel-checklist, #panel-trip) .card { margin-bottom: 14px; }
#panel-certs .card-title, #panel-gear .card-title, #panel-plan .card-title, :is(#panel-checklist, #panel-trip) .card-title { font-size: 1.7rem; }
#panel-certs .card-title .accent, #panel-gear .card-title .accent, #panel-plan .card-title .accent, :is(#panel-checklist, #panel-trip) .card-title .accent { color: #fff; }
#panel-certs div[style*="grid-template-columns:1fr 1fr"], #panel-gear div[style*="grid-template-columns:1fr 1fr"], #panel-plan div[style*="grid-template-columns:1fr 1fr"], :is(#panel-checklist, #panel-trip) div[style*="grid-template-columns:1fr 1fr"] { gap: 10px !important; }
#panel-certs label[style*="font-size:0.7rem"], #panel-gear label[style*="font-size:0.7rem"], #panel-plan label[style*="font-size:0.7rem"], :is(#panel-checklist, #panel-trip) label[style*="font-size:0.7rem"] { font-size: .62rem !important; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; gap: 6px !important; }
#panel-certs div[style*="font-size:0.75rem;font-weight:700"], #panel-gear div[style*="font-size:0.75rem;font-weight:700"], #panel-plan div[style*="font-size:0.75rem;font-weight:700"], :is(#panel-checklist, #panel-trip) div[style*="font-size:0.75rem;font-weight:700"] {
  font-size: .68rem !important; letter-spacing: .2em; text-transform: uppercase; font-weight: 800 !important;
  color: var(--text-dim) !important; margin: 18px 0 10px !important;
}
#panel-certs div[style*="border-top:1px solid var(--border)"], #panel-gear div[style*="border-top:1px solid var(--border)"], #panel-plan div[style*="border-top:1px solid var(--border)"], :is(#panel-checklist, #panel-trip) div[style*="border-top:1px solid var(--border)"] { border-top-color: var(--border) !important; padding-top: 16px !important; margin-top: 16px !important; }
/* primary actions: white pill */
#panel-certs button[style*="background:var(--accent)"], #panel-gear button[style*="background:var(--accent)"], #panel-plan button[style*="background:var(--accent)"], :is(#panel-checklist, #panel-trip) button[style*="background:var(--accent)"], #panel-certs button[style*="background:#8b5cf6"], #panel-gear button[style*="background:#8b5cf6"], #panel-plan button[style*="background:#8b5cf6"], :is(#panel-checklist, #panel-trip) button[style*="background:#8b5cf6"] {
  background: #fff !important; color: #081320 !important; border: 0 !important; border-radius: 999px !important;
  padding: 12px 18px !important; font: 700 .82rem var(--font) !important; box-shadow: 0 6px 18px rgba(0,10,30,.35);
}
/* secondary actions: glass pill */
#panel-certs button[style*="background:transparent"], #panel-gear button[style*="background:transparent"], #panel-plan button[style*="background:transparent"], :is(#panel-checklist, #panel-trip) button[style*="background:transparent"], #panel-certs button[style*="background:var(--accent-dim)"], #panel-gear button[style*="background:var(--accent-dim)"], #panel-plan button[style*="background:var(--accent-dim)"], :is(#panel-checklist, #panel-trip) button[style*="background:var(--accent-dim)"], #panel-certs #cl-cal-btn, #panel-gear #cl-cal-btn, #panel-plan #cl-cal-btn, :is(#panel-checklist, #panel-trip) #cl-cal-btn {
  background: rgba(255,255,255,.1) !important; color: #fff !important; border: 1px solid var(--glass-edge) !important;
  border-radius: 999px !important; padding: 12px 16px !important; font: 600 .8rem var(--font) !important;
}
#panel-certs label[style*="border:1px dashed"], #panel-gear label[style*="border:1px dashed"], #panel-plan label[style*="border:1px dashed"], :is(#panel-checklist, #panel-trip) label[style*="border:1px dashed"] { border-radius: var(--r-sm) !important; border-color: var(--glass-edge) !important; color: #fff !important; font-weight: 600; }
/* list rows (gear, checklist) */
#gear-list > div { border: 0 !important; border-radius: var(--r-md) !important; background: rgba(255,255,255,.07); padding: 14px !important; margin-bottom: 10px !important; }
#cl-shared-items > div, #cl-personal-items > div, #wishlist-items > div, #cl-buddy-sections div[style*="display:flex"] {
  padding: 10px 4px !important; font-size: .9rem !important; border-bottom-color: var(--border) !important; gap: 12px !important;
}
:is(#panel-checklist, #panel-trip) input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; flex: 0 0 24px; width: 24px !important; height: 24px !important; margin: 0;
  border-radius: 8px; border: 1.5px solid rgba(255,255,255,.35); background: rgba(255,255,255,.05); cursor: pointer;
  transition: background .2s, border-color .2s;
}
:is(#panel-checklist, #panel-trip) input[type="checkbox"]:checked { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23081320' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 16px no-repeat; border-color: #fff; }
:is(#panel-checklist, #panel-trip) button[onclick^="remove"], :is(#panel-checklist, #panel-trip) button[onclick^="promote"] { color: var(--text-muted) !important; font-size: .9rem !important; }
#cl-progress > div:first-child { height: 8px !important; border-radius: 8px !important; background: rgba(255,255,255,.08) !important; }
#cl-progress > div:first-child > div { background: linear-gradient(90deg, var(--accent), #fff) !important; border-radius: 8px; }
/* planner results */
#plan-results div[style*="grid-template-columns:1fr 1fr 1fr"] { gap: 8px !important; }
#plan-results div[style*="padding:10px;border-radius:8px"] { border: 0 !important; border-radius: var(--r-md) !important; background: rgba(255,255,255,.07); padding: 14px 8px !important; }
#plan-results div[style*="font-size:1.1rem;font-weight:800"] { font-size: 1.5rem !important; font-weight: 300 !important; letter-spacing: -.04em; }
#plan-results div[style*="color:var(--accent)"] { color: #fff !important; }
#plan-results div[style*="text-transform:uppercase"] { letter-spacing: .14em; font-weight: 700; margin-top: 4px; }

/* ---------- Badges ---------- */
@media (max-width: 600px) { #tab-badges { display: none !important; } }
.medal { position: relative; display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; flex: 0 0 auto;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.35), rgba(155,220,255,.15) 45%, rgba(10,30,50,.6));
  border: 1px solid rgba(255,255,255,.3); box-shadow: 0 0 22px rgba(155,220,255,.35), inset 0 1px 0 rgba(255,255,255,.4); }
.medal-ico { font-size: 30px; line-height: 1; }
.medal.off { background: rgba(255,255,255,.05); border-color: var(--border); box-shadow: none; }
.medal.off .medal-ico { filter: grayscale(1); opacity: .35; }
.medal-ring { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); transform: rotate(-90deg); }
.medal-ring circle { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.medal.sm { width: 40px; height: 40px; } .medal.sm .medal-ico { font-size: 19px; }
.medal.xl { width: 120px; height: 120px; } .medal.xl .medal-ico { font-size: 58px; }
.badges-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.badges-summary b { font-size: 3.2rem; font-weight: 200; color: #fff; letter-spacing: -.05em; line-height: 1; }
.badges-summary span { color: var(--text-dim); font-size: 1.2rem; font-weight: 600; }
.badges-summary small { color: var(--text-dim); font-size: .8rem; font-weight: 600; margin-left: 4px; }
.badges-summary .rank-bar { flex-basis: 100%; margin-top: 12px; height: 8px; }
.badges-h { margin: 22px 6px 12px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 12px; border-radius: var(--r-md);
  background: var(--glass); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.badge-card.on { cursor: pointer; }
.badge-card b { color: #fff; font-size: .92rem; font-weight: 700; margin-top: 6px; }
.badge-card small { color: var(--text-dim); font-size: .72rem; font-weight: 500; line-height: 1.35; }
.badge-card span { color: var(--accent); font-size: .7rem; font-weight: 700; }
.badge-card.off span { color: var(--text-muted); }
.tile-badges { grid-column: span 4; cursor: pointer; animation-delay: .12s; }
.tile-badges small { font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }
.tb-row { display: flex; gap: 8px; margin: 12px 0 8px; align-items: center; }
.tb-more { color: var(--text-dim); font-weight: 700; font-size: .85rem; }
.tb-next { font-size: .78rem; color: var(--text-dim); font-weight: 600; }
.tb-next b { color: #fff; }
@media (max-width: 860px) { .tile-badges { grid-column: span 2; } }

#badge-pop { position: fixed; inset: 0; z-index: 15000; display: grid; place-items: center; background: rgba(2,8,20,.6);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: hFade .3s both; overflow: hidden; }
#badge-pop.out { opacity: 0; transition: opacity .3s; }
.bp-card { position: relative; width: min(320px, calc(100% - 48px)); padding: 36px 24px 24px; border-radius: var(--r-lg); text-align: center;
  background: rgba(16,30,48,.8); border: 1px solid var(--glass-edge); display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: bpIn .6s cubic-bezier(.2,1.4,.4,1) both; overflow: hidden; }
@keyframes bpIn { from { opacity: 0; transform: scale(.7) translateY(30px); } to { opacity: 1; transform: none; } }
.bp-card .medal { animation: bpSpin 1s .2s cubic-bezier(.2,1.2,.4,1) both; }
@keyframes bpSpin { from { transform: rotateY(180deg) scale(.4); } to { transform: none; } }
.bp-rays { position: absolute; top: -60%; left: 50%; width: 520px; height: 520px; margin-left: -260px; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 8%, rgba(155,220,255,.18) 10%, transparent 12% 25%, rgba(155,220,255,.18) 27%, transparent 29% 42%,
    rgba(155,220,255,.18) 44%, transparent 46% 58%, rgba(155,220,255,.18) 60%, transparent 62% 75%, rgba(155,220,255,.18) 77%, transparent 79% 92%, rgba(155,220,255,.18) 94%, transparent 96%);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 60%); mask: radial-gradient(circle, #000 20%, transparent 60%);
  animation: hSpin 12s linear infinite; }
.bp-card small { margin-top: 10px; font-size: .64rem; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); font-weight: 800; }
.bp-card b { font-size: 1.6rem; color: #fff; letter-spacing: -.03em; }
.bp-card span { color: var(--text-dim); font-size: .86rem; }
.bp-card .btn-solid { margin-top: 14px; width: 100%; }
.bp-bubble { position: absolute; bottom: -30px; width: var(--s); height: var(--s); border-radius: 50%; border: 1.5px solid rgba(190,235,255,.6);
  animation: bpBubble 3.2s var(--d) ease-in infinite; }
@keyframes bpBubble { from { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } to { transform: translateY(-110vh); opacity: 0; } }
@keyframes hSpin { to { transform: rotate(360deg); } }

/* ---------- Wrapped (year story) ---------- */
.wrapped-btn { padding: 10px 16px; font-size: .8rem; }
#wrapped { position: fixed; inset: 0; z-index: 16000; background: #020a16; color: #fff; overflow: hidden; user-select: none; -webkit-user-select: none;
  touch-action: manipulation; animation: hFade .35s both; }
#wrapped.out { opacity: 0; transition: opacity .35s; }
#wrapped .w-ocean { position: absolute; inset: 0; width: 100%; height: 100%; }
#wrapped .w-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2,10,22,.35), rgba(2,10,22,.15) 40%, rgba(2,10,22,.65)); }
.w-progress { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 14px; right: 14px; display: flex; gap: 4px; z-index: 2; }
.w-progress i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; }
.w-progress b { display: block; height: 100%; width: 0; background: #fff; }
.w-close { position: absolute; top: calc(26px + env(safe-area-inset-top)); right: 14px; z-index: 3; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1rem; cursor: pointer; }
.w-stage { position: absolute; inset: 0; display: flex; align-items: center; padding: 80px 28px calc(60px + env(safe-area-inset-bottom)); }
.w-slide { width: 100%; max-width: 560px; margin: 0 auto; }
.w-c > * { animation: wIn .7s cubic-bezier(.2,.8,.2,1) both; }
.w-c > *:nth-child(2) { animation-delay: .12s; } .w-c > *:nth-child(3) { animation-delay: .24s; }
.w-c > *:nth-child(4) { animation-delay: .36s; } .w-c > *:nth-child(5) { animation-delay: .48s; }
@keyframes wIn { from { opacity: 0; transform: translateY(24px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.w-center { text-align: center; display: flex; flex-direction: column; align-items: center; }
.w-kicker { display: block; font-size: .7rem; letter-spacing: .26em; text-transform: uppercase; color: rgba(226,238,255,.75); font-weight: 800; margin-bottom: 14px; }
.w-year { font-weight: 200; font-size: clamp(6rem, 34vw, 11rem); line-height: .9; letter-spacing: -.06em; }
.w-big { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-weight: 200; line-height: .9; letter-spacing: -.06em; }
.w-big span { font-size: clamp(5rem, 26vw, 9rem); }
.w-big i { font-style: normal; font-size: 1.3rem; font-weight: 600; letter-spacing: 0; color: rgba(226,238,255,.8); }
.w-big.w-mid span { font-size: clamp(3rem, 15vw, 5rem); }
.w-big.w-mid { margin-top: 18px; }
.w-big.w-huge span { font-size: clamp(7rem, 38vw, 12rem); }
.w-center-big { justify-content: center; }
.w-sub { margin-top: 18px; font-size: 1.05rem; font-weight: 500; color: rgba(240,246,255,.9); line-height: 1.45; }
.w-sub b { color: #fff; }
.w-dim { color: rgba(226,238,255,.65); font-size: .92rem; margin-top: 8px; }
.w-name { font-weight: 700; font-size: clamp(3rem, 15vw, 5.5rem); letter-spacing: -.05em; line-height: 1; word-break: break-word; }
.w-cap { text-transform: capitalize; }
.w-list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; counter-reset: w; }
.w-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-md);
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); counter-increment: w; font-size: 1.05rem; }
.w-list li::before { content: counter(w); color: var(--accent); font-weight: 800; margin-right: 6px; }
.w-list li b { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-list li span { color: rgba(226,238,255,.75); font-weight: 700; }
.w-bars { display: flex; align-items: flex-end; gap: 5px; height: 120px; margin-top: 26px; }
.w-bars i { flex: 1; height: max(4px, var(--h)); border-radius: 6px 6px 3px 3px; background: rgba(255,255,255,.3); animation: wBar .9s .3s cubic-bezier(.2,.8,.2,1) both; transform-origin: bottom; }
.w-bars i.peak { background: #fff; box-shadow: 0 0 18px rgba(155,220,255,.7); }
@keyframes wBar { from { transform: scaleY(0); } to { transform: none; } }
.w-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.w-split > div { padding: 20px 16px; border-radius: var(--r-md); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); }
.w-split small { font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(226,238,255,.75); font-weight: 800; }
.w-split b { display: block; margin-top: 10px; font-size: clamp(3rem, 14vw, 4.5rem); font-weight: 200; letter-spacing: -.05em; }
.w-split b.cold { color: #9bdcff; } .w-split b.warm { color: var(--coral); }
.w-medals { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 22px; }
.w-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; margin: 6px 0 24px; }
.w-grid > div { padding: 18px 12px; border-radius: var(--r-md); background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); }
.w-grid b { display: block; font-size: 2.6rem; font-weight: 200; letter-spacing: -.05em; }
.w-grid small { font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: rgba(226,238,255,.75); font-weight: 800; }
.w-actions { display: flex; gap: 10px; width: 100%; }
.w-actions > * { flex: 1; }

/* ---------- Logbook signature ---------- */
.sig-ask { margin-top: 12px; border-style: dashed !important; }
.sig-box { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); background: rgba(255,255,255,.07); margin-bottom: 8px; }
.sig-box img { width: 150px; height: 60px; object-fit: contain; background: rgba(0,0,0,.2); border-radius: 10px; flex: 0 0 auto; }
.sig-box div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sig-box b { color: #fff; font-weight: 700; }
.sig-box small { color: var(--text-dim); font-size: .74rem; font-weight: 600; }
.sig-clear { background: none; border: 0; color: var(--text-muted); cursor: pointer; font-size: .9rem; padding: 6px; }
.signed-mark { margin-left: 8px; color: var(--accent); letter-spacing: 0; font-size: .72rem; font-weight: 700; }
#sig-sheet { position: fixed; inset: 0; z-index: 14000; display: grid; place-items: center; padding: 16px; background: rgba(2,8,20,.7);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: hFade .25s both; }
.sig-card { width: min(560px, 100%); padding: 22px; border-radius: var(--r-lg); background: rgba(16,30,48,.92); border: 1px solid var(--glass-edge); }
.sig-card h3 { color: #fff; font-size: 1.2rem; margin: 6px 0 14px; letter-spacing: -.02em; }
.sig-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sig-fields #sig-name, .sig-fields #sig-cert { grid-column: 1 / -1; }
.sig-fields #sig-name { grid-column: 1 / 2; }
#sig-pad { display: block; width: 100%; aspect-ratio: 5 / 2; margin-top: 12px; border-radius: var(--r-md); touch-action: none;
  background: rgba(255,255,255,.06); border: 1.5px dashed rgba(255,255,255,.35); cursor: crosshair; }
.sig-hint { text-align: center; color: var(--text-muted); font-size: .72rem; font-weight: 600; margin-top: 6px; }
.sig-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.sig-actions .btn-solid { grid-column: 1 / -1; }

.sig-ask-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.sig-ask-row .sig-ask { margin-top: 0; }
.qr-box { display: grid; place-items: center; margin: 6px auto 4px; width: min(260px, 70vw); aspect-ratio: 1; padding: 14px; border-radius: var(--r-md); background: #fff; }
.qr-box svg { width: 100%; height: 100%; }
.qr-status { text-align: center; color: var(--accent); font-weight: 700; font-size: .86rem; margin-top: 8px; animation: qrPulse 1.6s ease-in-out infinite; }
@keyframes qrPulse { 50% { opacity: .45; } }
#sign-page { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
#sign-page .sig-actions { grid-template-columns: 1fr; }
.sig-dive { color: var(--text-dim); font-size: .84rem; font-weight: 600; margin: -6px 0 14px; }

/* ---------- Trip planning (checklist) ---------- */
.trip-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.trip-fields label { display: flex; flex-direction: column; gap: 6px; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--text-dim); min-width: 0; }
.trip-fields label.full { grid-column: 1 / -1; }
.trip-info p { margin: 6px 0; font-size: .86rem; color: var(--text-dim); line-height: 1.45; }
.trip-info b { color: #fff; }
.trip-info:empty { display: none; }
.trip-legs { margin: 4px 0 12px; }
.legs-h { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; }
.leg { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 12px; background: rgba(255,255,255,.04); margin-bottom: 6px; }
.leg-ic { font-size: 1.1rem; line-height: 1.3; }
.leg > div { flex: 1; min-width: 0; }
.leg b { display: block; color: #fff; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leg small { display: block; color: var(--text-dim); font-size: .74rem; margin-top: 2px; }
.leg em { display: inline-block; font-style: normal; font-size: .68rem; font-weight: 700; margin: 5px 6px 0 0; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--text-dim); }
.leg .leg-tag { display: inline-block; font: inherit; font-size: .68rem; font-weight: 700; margin: 5px 6px 0 0; padding: 2px 8px; border-radius: 999px; border: none; background: rgba(120,200,255,.1); color: var(--accent); text-decoration: none; cursor: pointer; }
.alt-row { display: flex; gap: 6px; text-transform: none; letter-spacing: 0; }
.alt-row input { flex: 1; min-width: 0; }
.alt-row .btn-ghost { white-space: nowrap; font-size: .78rem; padding: 0 12px; }
.leg em.leg-ok { background: rgba(80,220,160,.12); color: #6fe3b0; }
.leg em.leg-warn { background: rgba(255,92,104,.12); color: #ff8a93; }
.legs-add summary { cursor: pointer; color: var(--accent); font-size: .8rem; font-weight: 700; padding: 6px 0; list-style: none; }
.legs-add summary::-webkit-details-marker { display: none; }
.legs-add .trip-fields { margin-top: 8px; }
/* iOS collapses empty date/time inputs and lets them overflow a grid cell */
.trip-fields input[type="date"], .trip-fields input[type="datetime-local"] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%;
  min-height: 48px; box-sizing: border-box; text-align: left;
}
.trip-fields input::-webkit-date-and-time-value { text-align: left; min-height: 1.3em; }
.dt-input.need { border-color: #ff5c68 !important; box-shadow: 0 0 0 3px rgba(255,92,104,.25); }
.legs-add .btn-solid.full, .legs-add .full { grid-column: 1 / -1; }
.trip-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.trip-sum > div { padding: 12px 8px; text-align: center; border-radius: var(--r-sm); background: rgba(255,255,255,.07); }
.trip-sum b { display: block; color: #fff; font-size: 1.4rem; font-weight: 300; letter-spacing: -.03em; }
.trip-sum small { font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }
.tpl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 12px; font-size: .74rem; color: var(--text-dim); font-weight: 600; }
.chip-btn { border: 1px solid var(--glass-edge); background: rgba(255,255,255,.1); color: #fff; border-radius: 999px; padding: 8px 14px; font: 600 .78rem var(--font); cursor: pointer; }
.chip-btn:active { transform: scale(.97); }
.chip-btn.on { background: var(--accent); border-color: var(--accent); color: #001018; }
.chip-btn small { opacity: .7; font-weight: 700; margin-left: 2px; }
/* planner */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pl-sec { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--text-dim); margin: 14px 0 7px; }
.pl-mini { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--text-dim); }
.pl-mini input { width: 62px; padding: 7px 8px; }
.pl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.pl-grid label, .pl-time { display: flex; flex-direction: column; gap: 6px; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--text-dim); min-width: 0; }
.pl-unit { display: flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-size: .8rem; }
.pl-unit input { flex: 1; min-width: 0; }
.pl-note { font-size: .76rem; color: var(--text-dim); line-height: 1.45; margin: 8px 0 0; }
.pl-note b { color: #fff; }
.pl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 18px 0 6px; }
.pl-head b { font-size: 1.05rem; color: #fff; }
.pl-head span { font-size: .72rem; color: var(--text-dim); text-align: right; }
.pl-legend { display: flex; align-items: center; gap: 6px; font-size: .68rem; color: var(--text-dim); margin-bottom: 8px; }
.pl-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.pl-legend i.ndl, .pl-track i.ndl { background: linear-gradient(90deg, #3fb6ff, #6fe3ff); }
.pl-legend i.gas, .pl-track i.gas { background: linear-gradient(90deg, #ffb347, #ffd27a); }
.pl-bars { display: grid; gap: 4px; }
.pl-row { display: grid; grid-template-columns: 44px 1fr 62px; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; border: 1px solid transparent; background: rgba(255,255,255,.03); color: inherit; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.pl-row.sel { border-color: var(--accent); background: rgba(80,200,255,.08); }
.pl-row.off { grid-template-columns: 44px 1fr; cursor: default; opacity: .55; }
.pl-d { font-weight: 800; font-size: .82rem; color: #fff; }
.pl-track { height: 10px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.pl-track i { display: block; height: 100%; border-radius: 999px; }
.pl-t { text-align: right; font-size: .72rem; color: var(--text-dim); }
.pl-t b { font-size: .95rem; color: #fff; }
.pl-off { font-size: .72rem; color: var(--text-dim); }
.pl-detail { margin-top: 14px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid var(--glass-edge); }
.pl-detail .pl-head { margin-top: 0; }
.pl-detail p { font-size: .82rem; color: var(--text-dim); line-height: 1.5; margin: 8px 0; }
.pl-detail p b { color: #fff; }
.pl-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 6px; }
.pl-facts div { padding: 8px 6px; border-radius: 10px; background: rgba(255,255,255,.04); text-align: center; }
.pl-facts b { display: block; color: #fff; font-size: .95rem; }
.pl-facts small { font-size: .6rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }
.pl-time { margin-top: 12px; }
.pl-detail .pl-warn { color: #ff8a93; font-weight: 600; }
.pl-detail .pl-ok { color: #6fe3b0; font-weight: 600; }
.pl-foot { font-size: .64rem; color: var(--text-dim); text-align: center; margin-top: 14px; line-height: 1.4; opacity: .8; }
.cl-group { margin-bottom: 10px; }
.cl-group-h { display: flex; justify-content: space-between; font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 800; color: var(--accent); margin: 12px 4px 2px; }
.cl-group-h span { color: var(--text-dim); letter-spacing: .04em; }
.cl-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); font-size: .9rem; }
.cl-row span { flex: 1; min-width: 0; color: #fff; }
.cl-row span.done { text-decoration: line-through; opacity: .5; }
.cl-row small { color: var(--text-dim); font-weight: 600; margin-left: 6px; }
.cl-row small.auto { color: #8ff0c0; }
.cl-row button { background: none; border: 0; color: var(--text-muted); cursor: pointer; font-size: .9rem; }
.cl-row input[disabled] { opacity: 1; cursor: default; }
.plan-add { display: grid; grid-template-columns: 1fr 70px auto; gap: 8px; margin-top: 8px; }
.sec-select { flex: 0 0 96px !important; max-width: 96px; }
.tile-trip { grid-column: span 4; cursor: pointer; display: flex; flex-direction: column; gap: 6px; animation-delay: .02s;
  background: linear-gradient(135deg, rgba(255,179,138,.22), rgba(255,255,255,.06)); }
.tile-trip small { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: #ffd3bd; font-weight: 800; }
.tile-trip b { font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 300; color: #fff; letter-spacing: -.04em; line-height: 1.05; }
.tile-trip span { font-size: .8rem; color: var(--text-dim); font-weight: 600; }
.tile-trip .rank-bar { height: 6px; margin-top: 4px; }
.trip-warn { color: var(--coral) !important; }
@media (max-width: 860px) { .tile-trip { grid-column: span 2; } }

.saved-chip { display: inline-flex; align-items: center; gap: 2px; padding: 0 6px 0 0; }
.saved-chip button { background: none; border: 0; color: #fff; font: 600 .78rem var(--font); padding: 8px 6px 8px 14px; cursor: pointer; }
.saved-chip button small { color: var(--text-dim); margin-left: 4px; }
.saved-chip button.x { padding: 6px; color: var(--text-muted); font-size: .75rem; }
.chip-save { background: rgba(155,220,255,.16) !important; border-color: rgba(155,220,255,.4) !important; }
#saved-lists { display: contents; }
.archive-box { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.arch-head { display: flex; justify-content: space-between; align-items: center; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 800; color: var(--text-dim); margin-bottom: 8px; }
.arch-trip { border-radius: var(--r-md); background: rgba(255,255,255,.06); margin-bottom: 8px; padding: 12px 14px; }
.arch-trip summary { list-style: none; display: flex; justify-content: space-between; gap: 10px; cursor: pointer; }
.arch-trip summary::-webkit-details-marker { display: none; }
.arch-trip summary b { color: #fff; } .arch-trip summary span { color: var(--text-dim); font-size: .8rem; font-weight: 600; }
.arch-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ---------- Maps: dark OpenStreetMap ---------- */
.map-tiles { filter: invert(1) hue-rotate(185deg) brightness(.85) contrast(.9) saturate(.6); }
.leaflet-container { background: #0b1e33; font-family: var(--font); }
.leaflet-control-attribution { background: rgba(2,10,22,.6) !important; color: var(--text-muted) !important; font-size: 9px; }
.leaflet-control-attribution a { color: var(--text-dim) !important; }
.leaflet-control-attribution .leaflet-attribution-flag { display: none !important; }
.leaflet-container .leaflet-bar a, .leaflet-container .leaflet-bar a:hover { background: rgba(16,30,48,.9); color: #fff; border-color: var(--border); }
.leaflet-container .leaflet-bar { border: 1px solid var(--glass-edge); border-radius: 12px; overflow: hidden; }

/* ---------- Features: surface/no-fly, SAC, profile check, offline ---------- */
.tile-status { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; animation-delay: .05s; }
.tile-status small, .tile-sac small { font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }
.tile-status b { display: block; margin-top: 8px; font-weight: 300; font-size: clamp(1.6rem, 5vw, 2.3rem); letter-spacing: -.04em; color: #fff; line-height: 1; }
.tile-status span { display: block; margin-top: 6px; font-size: .78rem; color: var(--text-dim); font-weight: 600; }
/* Red frame while flying is not allowed yet, green once it is */
.tile-status.is-wait {
  border: 1.5px solid rgba(255,92,104,.85);
  box-shadow: 0 0 0 1px rgba(255,92,104,.25), 0 0 28px rgba(255,92,104,.28), inset 0 1px 0 rgba(255,255,255,.18);
}
.tile-status.is-wait .st-col:last-child small, .tile-status.is-wait .st-col:last-child b { color: #ff7a85; }
.tile-status.is-ok {
  border: 1.5px solid rgba(92,226,150,.85);
  box-shadow: 0 0 0 1px rgba(92,226,150,.25), 0 0 28px rgba(92,226,150,.25), inset 0 1px 0 rgba(255,255,255,.18);
}
.tile-status.is-ok .st-col:last-child small, .tile-status.is-ok .st-col:last-child b { color: #6ff0a8; }
.st-note { grid-column: 1 / -1; margin-top: 8px; font-size: .66rem; color: var(--text-muted); font-weight: 600; line-height: 1.5; }
.tile-sac { grid-column: span 2; cursor: pointer; display: flex; flex-direction: column; animation-delay: .08s; }
.tile-sac b { margin-top: 8px; font-weight: 300; font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -.04em; color: #fff; line-height: 1; display: flex; align-items: baseline; gap: 10px; }
.tile-sac b i { font-style: normal; font-size: .8rem; font-weight: 700; letter-spacing: 0; padding: 3px 8px; border-radius: 999px; }
.tile-sac b i.good { color: #8ff0c0; background: rgba(143,240,192,.12); }
.tile-sac b i.bad { color: var(--coral); background: rgba(255,179,138,.12); }
.tile-sac span { margin-top: auto; padding-top: 8px; font-size: .72rem; color: var(--text-dim); font-weight: 600; }
.sac-spark { width: 100%; height: 34px; margin-top: 10px; overflow: visible; }
.sac-spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(155,220,255,.6)); }

.sac-block { margin: 6px 0 22px; }
.sac-block h3 { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 10px; letter-spacing: -.01em; }
.sac-block .muted { color: var(--text-dim); font-size: .82rem; }
.sac-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 2fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.sac-row:last-child { border-bottom: 0; }
.sac-site { font-size: .82rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sac-site small { display: block; font-size: .66rem; color: var(--text-dim); font-weight: 500; }
.sac-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.sac-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), #fff); }
.sac-row b { font-weight: 600; font-size: .9rem; color: #fff; font-variant-numeric: tabular-nums; }

.prof-check { list-style: none; display: grid; gap: 8px; margin: 4px 0 14px; padding: 0; }
.prof-check li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: rgba(255,255,255,.06); font-size: .82rem; }
.prof-check li b { font-weight: 700; color: #fff; }
.prof-check li span { color: var(--text-dim); font-weight: 600; font-variant-numeric: tabular-nums; }
.prof-check li.ok { box-shadow: inset 3px 0 0 #8ff0c0; }
.prof-check li.warn { box-shadow: inset 3px 0 0 var(--coral); }
.prof-check li.warn b { color: var(--coral); }
.hp-fast { fill: none; stroke: var(--coral); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(255,179,138,.8)); opacity: 0; animation: hFade .4s 1.9s forwards; }

#offline-badge {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top)); z-index: 3000;
  max-width: calc(100% - 32px); padding: 8px 16px; border-radius: 999px; font: 600 .74rem var(--font); color: #081320;
  background: var(--coral); box-shadow: 0 8px 24px rgba(0,0,0,.35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 860px) { .tile-status, .tile-sac { grid-column: span 2; } }

/* =========================================================
   Intro — hi-tech dive computer boot HUD (see intro.js).
   0.1 power-on line · 0.3 rings draw · 0.8 holo scan of the diver
   0.5 telemetry · 1.7 wordmark decodes + glitch · 2.9 stats
   ========================================================= */
#intro {
  --cy: #a9e4ff; --cy-dim: rgba(200,236,255,.62); --cy-faint: rgba(200,236,255,.14);
  --mono: Manrope, Inter, system-ui, sans-serif;
  position: fixed; inset: 0; z-index: 20000; background: #01040b; color: #fff;
  overflow: hidden; cursor: pointer; -webkit-font-smoothing: antialiased;
  transition: opacity .7s cubic-bezier(.4,0,.2,1), transform .7s cubic-bezier(.4,0,.2,1), filter .7s;
}
/* Exit with fade + blur only: scaling a fixed full-screen layer above 100% makes iOS Safari zoom the page out */
#intro.done { opacity: 0; filter: blur(8px); pointer-events: none; }
@keyframes hFade { to { opacity: 1; } }

/* Live water behind the HUD, fading in after the power-on line */
#intro .h-ocean {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  opacity: 0; animation: hFade 1.2s .35s ease-out forwards;
}
/* Darken the centre a touch so the HUD stays legible over bright water */
#intro .h-shade {
  position: absolute; inset: 0;
  background: radial-gradient(60% 45% at 50% 44%, rgba(1,8,22,.42), rgba(1,8,22,0) 75%), linear-gradient(180deg, transparent 55%, rgba(1,6,18,.55));
}

#intro .h-boot {
  position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: #fff;
  box-shadow: 0 0 20px rgba(169,228,255,.9), 0 0 60px rgba(169,228,255,.5);
  transform: scaleX(0); animation: hBoot .55s .05s cubic-bezier(.7,0,.3,1) forwards;
}
@keyframes hBoot {
  0% { transform: scaleX(0); opacity: 1; }
  45% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1) scaleY(60); opacity: 0; }
}

/* Corner brackets framing the screen */
#intro .h-br { position: absolute; width: 22px; height: 22px; border: 0 solid var(--cy-dim); opacity: 0; animation: hFade .3s .4s forwards; }
#intro .h-br.tl { top: 16px; left: 16px; border-top-width: 1px; border-left-width: 1px; }
#intro .h-br.tr { top: 16px; right: 16px; border-top-width: 1px; border-right-width: 1px; }
#intro .h-br.bl { bottom: 16px; left: 16px; border-bottom-width: 1px; border-left-width: 1px; }
#intro .h-br.br { bottom: 16px; right: 16px; border-bottom-width: 1px; border-right-width: 1px; }

/* Telemetry in the corners */
#intro .h-tele {
  position: absolute; font: 500 10px/1.7 var(--mono); letter-spacing: .1em; font-variant-numeric: tabular-nums;
  color: var(--cy-dim); white-space: pre; text-transform: uppercase;
}
#intro .h-tele b { color: #fff; font-weight: 500; }
#intro .h-tele div { opacity: 0; animation: hType .25s steps(3) forwards; }
@keyframes hType { 0% { opacity: 0; transform: translateX(-4px); } 60% { opacity: .4; } 100% { opacity: 1; transform: none; } }
#intro .h-tele.tl { top: calc(26px + env(safe-area-inset-top)); left: 28px; }
#intro .h-tele.tr { top: calc(26px + env(safe-area-inset-top)); right: 28px; text-align: right; }
#intro .h-tele.bl { bottom: calc(26px + env(safe-area-inset-bottom)); left: 28px; }
#intro .h-tele.br { bottom: calc(26px + env(safe-area-inset-bottom)); right: 28px; text-align: right; }

#intro .h-center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
}

/* HUD ring stack */
#intro .h-hud { position: relative; width: min(74vw, 44vh, 400px); aspect-ratio: 1; }
#intro .h-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#intro .h-svg line { stroke: var(--cy-dim); stroke-width: .8; }
#intro .h-svg line.tk-l { stroke: #fff; stroke-width: 1.4; }
#intro .h-ticks { transform-origin: 0 0; opacity: 0; animation: hFade .4s .3s forwards, hSpin 40s .3s linear infinite; }
#intro .h-labels text {
  fill: var(--cy-dim); font: 500 6.5px var(--mono); text-anchor: middle; letter-spacing: .1em;
}
#intro .h-labels { transform-origin: 0 0; opacity: 0; animation: hFade .5s .7s forwards, hSpinR 60s .7s linear infinite; }
@keyframes hSpin { to { transform: rotate(360deg); } }
@keyframes hSpinR { to { transform: rotate(-360deg); } }
#intro .h-arc {
  fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100; transform-origin: 0 0;
  filter: drop-shadow(0 0 5px rgba(169,228,255,.8));
}
#intro .h-arc.a1 { stroke-dasharray: 32 18; animation: hDraw 1s .35s cubic-bezier(.6,0,.2,1) forwards, hSpin 14s 1.3s linear infinite; }
#intro .h-arc.a2 { stroke: var(--cy); stroke-width: .8; stroke-dasharray: 70 30; animation: hDraw 1.1s .5s cubic-bezier(.6,0,.2,1) forwards, hSpinR 20s 1.6s linear infinite; }
#intro .h-arc.a3 { stroke-width: .6; stroke-dasharray: 12 4; opacity: .6; animation: hDraw 1.4s .45s cubic-bezier(.6,0,.2,1) forwards, hSpinR 50s 1.8s linear infinite; }
@keyframes hDraw { to { stroke-dashoffset: 0; } }
#intro .h-dash {
  fill: none; stroke: var(--cy-dim); stroke-width: 3; stroke-dasharray: 1 5; opacity: 0;
  transform-origin: 0 0; animation: hFade .4s .9s forwards, hSpin 9s .9s linear infinite;
}

/* Radar sweep across the ring */
#intro .h-sweep {
  position: absolute; inset: 9%; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 80%, rgba(200,236,255,.04) 88%, rgba(200,236,255,.32) 100%);
  -webkit-mask: radial-gradient(circle, transparent 54%, #000 55%); mask: radial-gradient(circle, transparent 54%, #000 55%);
  opacity: 0; animation: hFade .3s .8s forwards, hSpin 2.2s .8s linear infinite;
}

/* Diver as a hologram: cyan tint, scanlines, revealed by a scan bar */
#intro .h-diver {
  position: absolute; left: 50%; top: 50%; width: 34%; transform: translate(-50%, -50%);
  clip-path: inset(0 0 100% 0); animation: hReveal .9s .85s cubic-bezier(.5,0,.3,1) forwards;
}
#intro .h-diver img {
  display: block; width: 100%; height: auto;
  filter: grayscale(1) brightness(1.35) sepia(.35) hue-rotate(165deg) saturate(1.8) drop-shadow(0 0 14px rgba(169,228,255,.65));
  opacity: .92; animation: hFlicker 3s 1.8s steps(1) infinite, hFloat 3.4s 1.8s ease-in-out infinite;
}
#intro .h-diver::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(1,6,18,.28) 0 1px, transparent 1px 3px); mix-blend-mode: multiply;
}
#intro .h-scanbar {
  position: absolute; left: -10%; right: -10%; height: 3px; top: 0;
  background: #fff; box-shadow: 0 0 14px rgba(169,228,255,.9), 0 0 34px rgba(169,228,255,.6);
  animation: hScan .9s .85s cubic-bezier(.5,0,.3,1) forwards;
}
@keyframes hReveal { to { clip-path: inset(-40% -40% -40% -40%); } }
@keyframes hScan { 0% { top: 0; opacity: 1; } 90% { top: 100%; opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes hFlicker { 0%, 100% { opacity: .92; } 47% { opacity: .55; } 48% { opacity: .92; } 74% { opacity: .7; } 75% { opacity: .92; } }
@keyframes hFloat { 50% { transform: translateY(-5px); } }

/* Wordmark decoding from random glyphs, with an RGB-split glitch */
#intro .h-word {
  margin-top: 30px; font: 200 clamp(2rem, 10vw, 4.4rem)/1 Manrope, Inter, system-ui, sans-serif;
  letter-spacing: .3em; margin-right: -.3em; white-space: nowrap; display: flex;
}
#intro .h-word span { display: inline-block; min-width: .62em; text-align: center; color: var(--cy); text-shadow: 0 0 14px rgba(169,228,255,.7); }
#intro .h-word span.on { color: #fff; text-shadow: 0 0 22px rgba(169,228,255,.45); }
#intro .h-word.glitch { animation: hGlitch .24s steps(2) both; }
#intro .h-word.glitch span { text-shadow: 2px 0 rgba(255,120,150,.7), -2px 0 rgba(169,228,255,.9); }
@keyframes hGlitch {
  0% { transform: translate(0); clip-path: inset(0 0 0 0); }
  25% { transform: translate(-4px, 1px); clip-path: inset(10% 0 55% 0); }
  50% { transform: translate(5px, -1px); clip-path: inset(50% 0 8% 0); }
  75% { transform: translate(-2px, 0); clip-path: inset(0 0 0 0); }
  100% { transform: translate(0); }
}
#intro .h-sub {
  margin-top: 16px; font: 400 9.5px var(--mono); letter-spacing: .38em; margin-right: -.38em;
  text-transform: uppercase; color: var(--cy-dim);
  opacity: 0; animation: hFade .5s 2.7s forwards;
}
#intro .h-specs { display: flex; margin-top: 30px; opacity: 0; animation: hFade .5s 2.9s forwards; }
#intro .h-spec { padding: 0 clamp(14px, 4.5vw, 34px); text-align: center; }
#intro .h-spec + .h-spec { border-left: 1px solid var(--cy-faint); }
#intro .h-spec b {
  display: block; font: 200 clamp(1.5rem, 7vw, 2.4rem)/1 Manrope, Inter, system-ui, sans-serif;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: #fff;
}
#intro .h-spec small {
  display: block; margin-top: 8px; font: 400 8.5px var(--mono); letter-spacing: .3em;
  text-transform: uppercase; color: var(--cy-dim);
}
#intro .h-skip {
  position: absolute; left: 0; right: 0; bottom: calc(80px + env(safe-area-inset-bottom)); text-align: center;
  font: 400 8.5px var(--mono); letter-spacing: .4em; text-transform: uppercase; color: rgba(255,255,255,.25);
  opacity: 0; animation: hFade .4s 1.2s forwards;
}
@media (max-height: 640px) { #intro .h-tele.bl, #intro .h-tele.br { display: none; } }

/* Respect "reduce motion" */
@media (prefers-reduced-motion: reduce) {
  body::after, .dive-card, .panel.active, .login-card { animation: none !important; }
  .dive-card:hover { transform: none; }
}

/* checklist: cards, add rows, route timeline */
.cl-h { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--text-dim); margin: 14px 4px 6px; }
.cl-h-pers { color: #b9a0ff; margin-top: 22px; }
.cl-add { display: flex; gap: 6px; margin: 8px 0 4px; }
.cl-add .edit-input { flex: 1; min-width: 0; }
.cl-add .sec-select { flex: 0 0 96px; }
.cl-invite { margin-top: 10px; }
.cl-invite .btn-ghost { white-space: nowrap; }
.cl-plus { flex: 0 0 auto; background: var(--accent); border: none; border-radius: 10px; padding: 6px 15px; color: #000; font-weight: 800; font-size: .95rem; cursor: pointer; }
.cl-plus-pers { background: #8b5cf6; color: #fff; }
.cl-wide { display: block; width: 100%; margin-top: 14px; }
.trip-info p { margin: 4px 0; }
.trip-info small { display: block; font-size: .74rem; color: var(--text-dim); line-height: 1.45; margin-top: 6px; }
.trip-legs { margin-top: 14px; }
.leg-group { margin-bottom: 8px; }
.leg-gh { font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--accent); margin: 10px 4px 5px; }
.leg.past { opacity: .5; }
.dive-window { margin: 10px 0; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(80,220,160,.14), rgba(80,200,255,.08)); border: 1px solid rgba(111,227,176,.25); }
.dw-h { font-weight: 800; color: #6fe3b0; font-size: .86rem; margin-bottom: 6px; }
.dw-row { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; padding: 3px 0; }
.dw-row span { color: var(--text-dim); }
.dw-row b { color: #fff; text-align: right; }
.dive-window small { display: block; margin-top: 6px; font-size: .72rem; color: var(--text-dim); line-height: 1.4; }
.tile-trip .tt-leg { color: #fff; font-weight: 700; }
/* planner: extra settings folded away */
.pl-more { margin-top: 12px; border-radius: 12px; background: rgba(255,255,255,.03); padding: 2px 12px; }
.pl-more summary { cursor: pointer; list-style: none; padding: 10px 0; font-size: .8rem; font-weight: 700; color: var(--accent); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pl-more summary::-webkit-details-marker { display: none; }
.pl-more summary span { color: var(--text-dim); font-weight: 600; font-size: .72rem; }
.pl-more[open] { padding-bottom: 12px; }
.pl-more .pl-grid { margin-top: 4px; }

/* trip tab: PDF import, program, money */
.pdf-btn { text-align: center; cursor: pointer; }
.imp-box { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(80,200,255,.07); border: 1px solid rgba(120,200,255,.25); font-size: .82rem; color: var(--text-dim); }
.imp-box b { color: #fff; }
.imp-box ul { margin: 8px 0; padding-left: 18px; line-height: 1.5; }
.imp-act { display: flex; gap: 8px; }
.pday { border-radius: 12px; background: rgba(255,255,255,.04); margin-bottom: 6px; padding: 0 12px; }
.pday summary { list-style: none; display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.pday summary::-webkit-details-marker { display: none; }
.pday summary > div { flex: 1; min-width: 0; }
.pday summary b { display: block; color: #fff; font-size: .86rem; }
.pday summary small { display: block; color: var(--text-dim); font-size: .72rem; margin-top: 2px; line-height: 1.4; }
.pd-n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: rgba(120,200,255,.14); color: var(--accent); font-weight: 800; font-size: .78rem; display: grid; place-items: center; }
.pday.today { border: 1px solid rgba(111,227,176,.4); background: rgba(80,220,160,.08); }
.pday.today .pd-n { background: #6fe3b0; color: #000; }
.pday.past { opacity: .55; }
.pday p { font-size: .8rem; color: var(--text-dim); margin: 0 0 6px 36px; line-height: 1.45; }
.pday .pd-note { color: #ffb4a0; }
.pday .pd-desc { color: var(--text-muted); font-size: .76rem; padding-bottom: 8px; }
.plan-calc { font-size: .95rem !important; }
.bud-top { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.bud-top label { display: flex; flex-direction: column; gap: 4px; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--text-dim); }
.bud-line { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.bud-name { grid-column: 1 / -1; padding: 6px 8px !important; font-size: .84rem; background: transparent !important; border-color: transparent !important; color: #fff; }
.bud-calc { display: flex; align-items: center; gap: 6px; }
.bud-calc input { width: 84px; padding: 7px 8px; }
.bud-calc .bud-qty { width: 56px; }
.bud-calc i { font-style: normal; font-size: .76rem; color: var(--text-dim); white-space: nowrap; }
.bud-pay { border: 1px solid var(--border); background: rgba(255,255,255,.05); border-radius: 10px; padding: 6px 10px; font-size: 1rem; cursor: pointer; }
.bud-pay.card { background: rgba(139,92,246,.18); border-color: rgba(139,92,246,.4); }
.bud-act { display: flex; gap: 8px; margin-top: 10px; }
.bud-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 14px 0 10px; }
.bud-sum div { padding: 10px 8px; border-radius: 12px; background: rgba(255,255,255,.05); text-align: center; }
.bud-sum small { display: block; font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.bud-sum b { display: block; color: #fff; font-size: 1rem; margin: 3px 0 1px; }
.bud-sum div > small:last-child { letter-spacing: 0; text-transform: none; font-size: .68rem; }
.bud-order { padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(255,200,90,.14), rgba(255,255,255,.04)); border: 1px solid rgba(255,200,90,.3); }
.bud-order .dw-h { color: #ffd27a; }
.bud-bring { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 8px; font-size: .78rem; color: var(--text-dim); }
.bud-order small { display: block; margin-top: 6px; font-size: .7rem; color: var(--text-dim); }
.bud-mini { width: 64px !important; padding: 4px 6px !important; display: inline-block; text-align: right; }
.bud-tips { margin: 12px 0 0; padding-left: 18px; font-size: .76rem; color: var(--text-dim); line-height: 1.5; }


/* certification cards (certs.js): a real dive card, sized in container units */
#certs-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)) !important; gap: 18px !important; }
.cert-card-wrap { container-type: inline-size; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transform: perspective(900px) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg)); transition: transform .35s ease-out; }
.cert-card-wrap.cc-tilt { transition: transform .08s linear; }
.cc-card { position: relative; width: 100cqw; aspect-ratio: 85.6 / 54; transform-style: preserve-3d; color: #fff; font-family: var(--font); text-align: left; }
.cc-face { position: absolute; inset: 0; border-radius: 4.2cqw; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cc-front { background: radial-gradient(130% 100% at 88% 6%, color-mix(in srgb, var(--ag) 62%, #74d6ff) 0%, var(--ag) 46%, color-mix(in srgb, var(--ag) 50%, #000) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), inset 0 .4cqw 0 rgba(255,255,255,.12), 0 2.4cqw 6cqw rgba(0,0,0,.5); }
.cc-guil { position: absolute; inset: 0; width: 100%; height: 100%; }
.cc-guil path { fill: none; stroke-dasharray: 1; stroke-dashoffset: 0; }
.cc-waves path { stroke: rgba(255,255,255,.075); stroke-width: 1.3; }
.cc-rose path { stroke: rgba(170,232,255,.17); stroke-width: .9; }
.cc-lines { position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,.04) 0 1px, transparent 1px 4px); }
.cc-top { position: absolute; left: 5cqw; top: 4.6cqw; right: 25cqw; display: flex; align-items: center; gap: 2.8cqw; }
.cc-mark { font-size: 8.4cqw; font-weight: 900; letter-spacing: .03em; line-height: 1; color: transparent;
  background: linear-gradient(180deg, #fff 10%, #d4ecff 55%, #8cc3ea); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 .3cqw .5cqw rgba(0,0,0,.35)); }
.cc-kind { min-width: 0; font-size: 2cqw; font-weight: 800; letter-spacing: .2em; line-height: 1.35; color: rgba(255,255,255,.88); border-left: 1px solid rgba(255,255,255,.3); padding-left: 2.6cqw; }
.cc-kind small { display: block; font-size: 1.5cqw; letter-spacing: .05em; font-weight: 600; color: rgba(255,255,255,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@property --ha { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
.cc-seal { position: absolute; right: 4.6cqw; top: 3.4cqw; width: 17cqw; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(from var(--ha), #ff9ad5, #9afff0, #fff3a0, #9ab8ff, #e79aff, #ff9ad5);
  box-shadow: inset 0 0 0 .45cqw rgba(255,255,255,.6), inset 0 0 3cqw rgba(0,0,0,.22), 0 .6cqw 1.6cqw rgba(0,0,0,.35);
  animation: ccHue 9s linear infinite; }
.cc-seal::before { content: ''; position: absolute; inset: 0; border-radius: 50%; mix-blend-mode: overlay;
  background: repeating-radial-gradient(circle, rgba(255,255,255,.4) 0 .22cqw, transparent .22cqw .65cqw), repeating-conic-gradient(rgba(0,0,0,.1) 0 4deg, transparent 4deg 8deg); }
.cc-seal svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cc-seal text { font-size: 7.4px; font-weight: 800; fill: rgba(8,28,58,.7); font-family: var(--font); }
.cc-seal b { position: relative; font-size: 3.4cqw; font-weight: 900; letter-spacing: .04em; color: rgba(8,28,58,.8); text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.cc-ring { position: absolute; inset: 0; border-radius: 50%; border: .5cqw solid rgba(255,255,255,.95); opacity: 0; pointer-events: none; }
.cc-tilt .cc-seal, .cc-view .cc-seal { animation: none; }

.cc-body { position: absolute; left: 5cqw; right: 5cqw; top: 20.5cqw; display: flex; gap: 3.6cqw; }
.cc-portrait { flex: 0 0 18.5cqw; height: 24cqw; border-radius: 1.8cqw; overflow: hidden;
  background: linear-gradient(160deg, rgba(255,255,255,.28), rgba(255,255,255,.06)); box-shadow: inset 0 0 0 .3cqw rgba(255,255,255,.35); }
.cc-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; filter: contrast(1.05) saturate(.95); }
.cc-portrait .cc-noface { object-fit: contain; padding: 2.2cqw; filter: none; mix-blend-mode: normal; opacity: .9; }
.cc-fields { flex: 1; min-width: 0; }
.cc-level { font-size: 4.5cqw; font-weight: 800; line-height: 1.12; letter-spacing: -.01em; margin-bottom: 2cqw; max-width: 64cqw; max-height: 10.2cqw; overflow: hidden; text-shadow: 0 .3cqw .8cqw rgba(0,0,0,.35); }
.cc-fields dl { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4cqw 3cqw; margin: 0; max-width: 44cqw; }
.cc-fields dl > div { min-width: 0; }
.cc-fields .cc-wide { grid-column: 1 / -1; }
.cc-fields dt { font-size: 1.5cqw; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.55); font-weight: 700; margin-bottom: .2cqw; }
.cc-fields dd { margin: 0; font-size: 2.7cqw; font-weight: 700; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.cc-eng { position: relative; display: inline-block; max-width: 100%; vertical-align: top; }
.cc-eng > span { display: inline-block; max-width: 100%; }
.cc-fields dd .cc-eng > span { overflow: hidden; text-overflow: ellipsis; }
.cc-depth { position: absolute; right: 5cqw; bottom: 7.4cqw; display: flex; align-items: baseline; gap: .7cqw; line-height: .8; }
.cc-depth span { font-size: 12cqw; font-weight: 900; color: transparent; -webkit-text-stroke: .26cqw rgba(255,255,255,.9); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cc-depth em { font-style: normal; font-size: 4cqw; font-weight: 800; color: rgba(255,255,255,.85); }
.cc-depth small { order: -1; align-self: center; font-size: 1.5cqw; letter-spacing: .2em; font-weight: 800; color: rgba(255,255,255,.6); writing-mode: vertical-rl; transform: rotate(180deg); }
.cc-micro { position: absolute; left: 0; right: 0; bottom: 2.8cqw; padding: .45cqw 0 .45cqw 5cqw; font-size: 1.2cqw; font-weight: 700; letter-spacing: .12em; white-space: nowrap; overflow: hidden;
  color: rgba(255,255,255,.4); border-top: 1px solid rgba(255,255,255,.1); border-bottom: 1px solid rgba(255,255,255,.1); }
.cc-holo { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0; transition: opacity .3s;
  background: repeating-linear-gradient(120deg, #ff7ad9 0%, #7affe5 6%, #fff27a 12%, #7aa8ff 18%, #ff7ad9 24%); background-size: 300% 300%; background-position: var(--px, 50%) var(--py, 50%);
  -webkit-mask-image: radial-gradient(circle at var(--px, 50%) var(--py, 50%), #000, rgba(0,0,0,.3) 30%, transparent 60%);
  mask-image: radial-gradient(circle at var(--px, 50%) var(--py, 50%), #000, rgba(0,0,0,.3) 30%, transparent 60%); }
.cc-glare { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; mix-blend-mode: overlay;
  background: radial-gradient(circle at var(--px, 50%) var(--py, 0%), rgba(255,255,255,.55), transparent 50%); }
.cc-tilt .cc-holo, .cc-view .cc-holo { opacity: .4; }
.cc-tilt .cc-glare, .cc-view .cc-glare { opacity: 1; }
.cc-front::after { content: ''; position: absolute; inset: 0; pointer-events: none; translate: -120% 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.14) 50%, transparent 60%); animation: ccShine 10s ease-in-out 4s infinite; }

.cc-back { transform: rotateY(180deg); background: linear-gradient(160deg, color-mix(in srgb, var(--ag) 60%, #000), #0b1622);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 2.4cqw 6cqw rgba(0,0,0,.5); }
.cc-scan { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-stripe { position: absolute; left: 0; right: 0; top: 7cqw; height: 11cqw; background: linear-gradient(#070707, #222 50%, #070707); }
.cc-sign { position: absolute; left: 5cqw; right: 30cqw; top: 24cqw; height: 9cqw; border-radius: .8cqw; display: flex; align-items: center; padding: 0 2.5cqw; overflow: hidden;
  background: repeating-linear-gradient(-45deg, #f3efe6 0 1.2cqw, #e4dccb 1.2cqw 2.4cqw); }
.cc-sign span { font-family: 'Snell Roundhand', 'Segoe Script', 'Brush Script MT', cursive; font-size: 5cqw; color: #1b2c55; white-space: nowrap; }
.cc-legal { position: absolute; left: 5cqw; right: 5cqw; top: 38cqw; margin: 0; font-size: 2cqw; line-height: 1.5; color: rgba(255,255,255,.7); }
.cc-backmark { position: absolute; right: 5cqw; top: 24.5cqw; font-size: 7cqw; font-weight: 900; color: rgba(255,255,255,.2); }

/* the assembly */
.cc-canvas { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 50; }
.cc-anim .cc-front { animation: ccMat .9s cubic-bezier(.2,.7,.2,1) var(--t0) backwards; }
.cc-anim .cc-card { animation: ccThunk .45s ease-out calc(var(--t0) + 1000ms); }
.cc-anim .cc-guil path { animation: ccDash 1.8s cubic-bezier(.3,0,.2,1) calc(var(--t0) + 50ms) backwards; }
.cc-anim .cc-mark { animation: ccRise .7s cubic-bezier(.2,.9,.3,1.2) calc(var(--t0) + 120ms) backwards; }
.cc-anim .cc-kind { animation: ccRise .7s cubic-bezier(.2,.9,.3,1.2) calc(var(--t0) + 260ms) backwards; }
.cc-anim .cc-portrait { animation: ccDev 1.1s ease-out calc(var(--t0) + 250ms) backwards; }
.cc-anim .cc-eng > span { animation: ccEng .5s cubic-bezier(.45,0,.3,1) calc(var(--t0) + 380ms + var(--e) * 110ms) backwards; }
.cc-anim .cc-eng::after { content: ''; position: absolute; top: -15%; bottom: -15%; left: 0; width: .35cqw; min-width: 2px; border-radius: 2px; background: #fff; opacity: 0;
  box-shadow: 0 0 .8cqw .3cqw #9bdcff, 0 0 2.6cqw .9cqw rgba(155,220,255,.55);
  animation: ccLaser .5s cubic-bezier(.45,0,.3,1) calc(var(--t0) + 380ms + var(--e) * 110ms); }
.cc-anim .cc-micro { animation: ccType 1.4s linear calc(var(--t0) + 300ms) backwards; }
.cc-anim .cc-depth { animation: ccRise .6s cubic-bezier(.2,.9,.3,1.2) calc(var(--t0) + 800ms) backwards; }
.cc-anim .cc-seal { animation: ccStamp .55s cubic-bezier(.3,1.5,.5,1) calc(var(--t0) + 850ms) backwards, ccHue 9s linear infinite; }
.cc-anim .cc-ring { animation: ccRing .8s ease-out calc(var(--t0) + 1050ms); }
.cc-anim .cc-holo { animation: ccHolo 1.3s ease-in-out calc(var(--t0) + 1250ms); }
.cc-anim .cc-front::before { content: ''; position: absolute; inset: 0; z-index: 5; pointer-events: none; translate: -110% 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.45) 48%, rgba(200,240,255,.15) 55%, transparent 65%);
  animation: ccSweep 1s ease-in-out calc(var(--t0) + 1250ms); }

@keyframes ccMat { 0% { opacity: 0; filter: brightness(3) saturate(0) blur(4px); } 35% { opacity: 1; filter: brightness(2) saturate(.3) blur(1px); } }
@keyframes ccThunk { 40% { scale: 1.025; } }
@keyframes ccDash { from { stroke-dashoffset: 1; } }
@keyframes ccRise { from { opacity: 0; translate: 0 3cqw; filter: blur(4px); } }
@keyframes ccDev { from { opacity: 0; filter: brightness(3) blur(6px); } }
@keyframes ccEng { from { clip-path: inset(-30% 100% -30% 0); color: #e6f8ff; text-shadow: 0 0 1.2cqw #9bdcff; } to { clip-path: inset(-30% 0 -30% 0); } }
@keyframes ccLaser { 0% { left: 0; opacity: 1; } 90% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes ccType { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes ccStamp { from { opacity: 0; scale: 2.6; rotate: -40deg; filter: blur(3px); } }
@keyframes ccRing { from { opacity: .9; scale: 1; } to { opacity: 0; scale: 2.4; } }
@keyframes ccHolo { 0%, 100% { opacity: 0; background-position: 0% 0%; } 50% { opacity: .5; background-position: 100% 100%; } }
@keyframes ccSweep { to { translate: 110% 0; } }
@keyframes ccShine { 0%, 82% { translate: -120% 0; } 100% { translate: 220% 0; } }
@keyframes ccHue { to { --ha: 360deg; } }

/* full screen card */
.cc-view { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 16px;
  background: radial-gradient(circle at 50% 40%, rgba(20,70,120,.55), rgba(2,8,18,.94)); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transition: opacity .35s; touch-action: none; }
.cc-view.on { opacity: 1; }
.cc-stage { width: min(92vw, 560px); container-type: inline-size; perspective: 1400px; touch-action: none; cursor: grab; }
.cc-stage:active { cursor: grabbing; }
.cc-3d { transform-style: preserve-3d; }
.cc-slice { position: absolute; inset: 0; border-radius: 4.2cqw; background: color-mix(in srgb, var(--ag) 45%, #a9bccf); transform: translateZ(calc(var(--z) * .14cqw)); }
.cc-view .cc-front { transform: translateZ(.5cqw); }
.cc-view .cc-back { transform: rotateY(180deg) translateZ(.5cqw); }
.cc-hint { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); transition: opacity .4s; }
.cc-hint.gone { opacity: 0; }
.cc-vbar { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.cc-vbar button, .cc-vbar label { background: var(--glass-strong); border: 1px solid var(--border-light); color: #fff; border-radius: 999px; padding: 10px 18px; font: 700 .85rem var(--font); cursor: pointer; }
.cc-vbar label { letter-spacing: normal; text-transform: none; display: inline-flex; align-items: center; gap: 6px; }
.cc-vbar label b { font-weight: 700; }
.cc-vbar .cc-del { color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  .cert-card-wrap { transform: none !important; }
  .cc-seal, .cc-front::after { animation: none; }
}
.cc-portrait { position: relative; }
.cc-portrait.cc-add::after { content: '📷'; position: absolute; right: .8cqw; bottom: .8cqw; width: 5.6cqw; height: 5.6cqw; border-radius: 50%; display: grid; place-items: center;
  font-size: 2.8cqw; background: rgba(0,0,0,.55); box-shadow: 0 0 0 .3cqw rgba(255,255,255,.6); }

/* ---------- Flights: boarding passes that assemble themselves ---------- */
.fl-seg { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--border); }
.fl-seg button { flex: 1; padding: 10px; border: 0; border-radius: 10px; background: none; color: var(--text-dim); font: 700 14px var(--font); cursor: pointer; }
.fl-seg button.on { background: var(--glass-strong); color: var(--text); }
#flights-view { display: none; }
#panel-trip.fl-on > #flights-view { display: block; }
#panel-trip.fl-on > .card { display: none; }
#flights-view { perspective: 1100px; }

.fl-hero { position: relative; overflow: hidden; border-radius: 20px; padding: 16px; margin-bottom: 14px;
  background: radial-gradient(120% 120% at 80% 0, rgba(70,130,200,.32), transparent 60%), linear-gradient(160deg, #0a1b33, #050d1c); border: 1px solid var(--border); }
.fl-hero-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.fl-title { font-size: 19px; font-weight: 800; line-height: 1.2; color: var(--white); }
.fl-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.fl-stats b { color: var(--white); font-size: 13px; }
.fl-map { display: block; width: 100%; height: auto; margin: 6px 0 4px; overflow: visible; }
.fl-grid line { stroke: rgba(155,220,255,.07); stroke-width: 1; }
.fl-arc { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  filter: drop-shadow(0 0 5px rgba(155,220,255,.7)); animation: flDraw .62s ease-in-out var(--d) forwards; }
.fl-arc.back { stroke: var(--coral); filter: drop-shadow(0 0 5px rgba(255,179,138,.7)); }
@keyframes flDraw { to { stroke-dashoffset: 0; } }
.fl-city { opacity: 0; animation: flCity .4s ease-out var(--d) forwards; }
.fl-city circle { fill: var(--white); }
.fl-city .fl-pulse { fill: none; stroke: var(--accent); stroke-width: 1.4; transform-box: fill-box; transform-origin: center; animation: flPulse 2.8s ease-out var(--d) infinite; }
.fl-city text { fill: var(--white); font: 800 14px var(--font); letter-spacing: .04em; paint-order: stroke; stroke: #050d1c; stroke-width: 3px; }
@keyframes flCity { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes flPulse { from { transform: scale(.7); opacity: .9; } to { transform: scale(3); opacity: 0; } }
.fl-jet path { fill: #fff; filter: drop-shadow(0 0 5px #fff); }
/* Flown part of the route: grey over the coloured arc; a finished flight loses its glow */
.fl-flown { fill: none; stroke: #6c7686; stroke-width: 3.4; stroke-linecap: butt; stroke-dasharray: 0 2; opacity: 0; transition: stroke-dasharray .8s ease; }
.fl-flown.on { animation: flFade .5s ease-out var(--d) forwards; }
.fl-arc.done { filter: none; }
@keyframes flFade { to { opacity: 1; } }
.fl-jet-ring { fill: none; stroke: #fff; stroke-width: 1.4; opacity: 0; transform-box: fill-box; transform-origin: center; }
.fl-jet.live .fl-jet-ring { animation: flPulse 2.4s ease-out infinite; }
.fl-live { display: grid; gap: 8px; padding-top: 10px; }
.fl-live:empty { display: none; }
.fl-prog { height: 6px; border-radius: 99px; background: rgba(155,220,255,.18); overflow: hidden; }
.fl-prog i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8f9aab, var(--accent-bright)); transition: width .8s ease; }
.fl-live-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-dim); }
.fl-live-row b { color: var(--white); }
.fl-live-gps { font-size: 12.5px; font-weight: 700; color: var(--accent-bright); font-variant-numeric: tabular-nums; }
.fl-live .fl-gps { justify-self: start; }
.fl-live-hint { font-size: 11px; color: var(--text-dim); }
.fl-count { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.fl-count small { color: var(--text-dim); font-size: 12px; }
.fl-count b { color: var(--accent-bright); font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.fl-todo { border-radius: 18px; padding: 14px 16px; margin-bottom: 18px; background: var(--glass); border: 1px solid var(--border); }
.fl-todo h3, .fl-sec { margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.fl-todo ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fl-todo li { position: relative; padding: 8px 10px 8px 14px; border-radius: 10px; background: rgba(255,255,255,.04); font-size: 13px; line-height: 1.4;
  animation: flRise .45s ease-out calc(.15s + var(--i) * .08s) both; }
.fl-todo li::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.fl-todo li.buy::before { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.fl-todo li.warn::before { background: var(--coral); }
.fl-todo li b { display: block; color: var(--white); }
.fl-todo li span { color: var(--text-dim); }
.fl-sec { margin: 22px 0 10px; font-size: 13px; color: var(--accent-bright); }

.fl-card { position: relative; overflow: hidden; border-radius: 18px; margin-bottom: 6px; color: #10233a; transform-style: preserve-3d;
  background: linear-gradient(180deg, #fbfdff, #e6eef7); box-shadow: 0 14px 34px rgba(0,0,0,.45); }
.fl-card:not(.in) { visibility: hidden; }
.fl-card.in { animation: flCardIn .7s cubic-bezier(.2,.9,.25,1) both; }
.fl-card.past { filter: saturate(.3) brightness(.72); }
.fl-card.next { box-shadow: 0 0 0 2px var(--accent), 0 0 26px rgba(155,220,255,.45), 0 14px 34px rgba(0,0,0,.45); }
@keyframes flCardIn { from { transform: rotateX(16deg) translateY(30px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.fl-h { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; color: #fff; background: linear-gradient(100deg, var(--air), color-mix(in srgb, var(--air) 62%, #fff 8%)); }
.fl-h b { font-size: 16px; letter-spacing: .03em; }
.fl-h span { font-size: 11.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-card.in .fl-h { animation: flFromTop .55s cubic-bezier(.2,.9,.25,1) .05s both; }
.fl-route { display: flex; align-items: flex-start; gap: 6px; padding: 12px 14px 8px; }
.fl-pt { flex: 0 0 34%; min-width: 0; }
.fl-b { text-align: right; }
.fl-card.in .fl-a { animation: flFromLeft .6s cubic-bezier(.2,.9,.25,1) .12s both; }
.fl-card.in .fl-b { animation: flFromRight .6s cubic-bezier(.2,.9,.25,1) .2s both; }
.fl-code { font-size: clamp(30px, 10vw, 38px); line-height: 1; font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.fl-ch { display: inline-block; min-width: .62em; text-align: center; transform-origin: 50% 50%; animation: flFlip .05s linear; }
@keyframes flFlip { from { transform: rotateX(-70deg); opacity: .4; } to { transform: none; opacity: 1; } }
.fl-time { margin-top: 4px; font-size: 20px; font-weight: 800; color: var(--air); font-variant-numeric: tabular-nums; }
.fl-pt small { display: block; font-size: 11px; line-height: 1.3; color: #4c6078; }
.fl-pt .fl-date { font-weight: 700; color: #233a55; margin-top: 1px; }
.fl-line { flex: 1; min-width: 0; padding-top: 11px; text-align: center; }
.fl-line small { display: block; margin-top: 8px; font-size: 11px; font-weight: 700; color: #4c6078; white-space: nowrap; }
.fl-track { position: relative; display: block; height: 2px; background: repeating-linear-gradient(90deg, #9fb1c6 0 4px, transparent 4px 8px); }
.fl-track i { position: absolute; top: -10px; left: 0; font-style: normal; font-size: 16px; color: var(--air); }
.fl-card.in .fl-track i { animation: flTrack 1.3s cubic-bezier(.45,.05,.3,1) .35s both; }
@keyframes flTrack { from { left: 0; opacity: 0; } 15% { opacity: 1; } to { left: calc(100% - 15px); opacity: 1; } }
/* The flight in the air: the track fills in grey up to the plane */
.fl-card.live { box-shadow: 0 0 0 2px var(--air), 0 10px 30px rgba(0,0,0,.35); }
.fl-card.live .fl-track { background: linear-gradient(90deg, #8f9aab 0 calc(var(--p) * 100%), transparent 0), repeating-linear-gradient(90deg, #9fb1c6 0 4px, transparent 4px 8px); }
.fl-card.live .fl-track i, .fl-card.in.live .fl-track i { animation: none; opacity: 1; left: calc(var(--p) * (100% - 15px)); transition: left .8s ease; }
.fl-card.live .fl-line small { color: var(--air); }
.fl-meta { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 14px 10px; }
.fl-m { flex: 1 1 auto; padding: 5px 8px; border: 0; border-radius: 8px; background: rgba(16,35,58,.06); text-align: left; font-family: inherit; color: inherit; }
.fl-m small { display: block; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: #5b6e85; }
.fl-m b { font-size: 12.5px; }
.fl-m.warn b { color: #a35a00; }
.fl-ref { cursor: pointer; }
.fl-card.in .fl-m { animation: flRise .4s ease-out calc(.5s + var(--i) * .06s) both; }
.fl-etkt { padding: 0 14px 10px; font-size: 10.5px; color: #5b6e85; letter-spacing: .03em; }
.fl-stub { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 2px dashed rgba(16,35,58,.25); background: rgba(16,35,58,.04); transform-origin: top; }
.fl-stub::before, .fl-stub::after { content: ''; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); }
.fl-stub::before { left: -8px; } .fl-stub::after { right: -8px; }
.fl-card.in .fl-stub { animation: flStub .6s cubic-bezier(.2,.9,.25,1) .55s both; }
@keyframes flStub { from { transform: rotateX(-82deg); opacity: 0; } to { transform: none; opacity: 1; } }
.fl-stamp { flex: 0 0 auto; max-width: 42%; padding: 4px 9px; border: 2.5px solid currentColor; border-radius: 7px; font-size: 14px; font-weight: 900; letter-spacing: .03em; text-align: center; transform: rotate(-5deg); color: #0d7a4c; }
.fl-stub.warn .fl-stamp { color: #a35a00; }
.fl-stub.buy .fl-stamp { color: #c8102e; }
.fl-stub.buy { background: rgba(200,16,46,.09); }
.fl-card.in .fl-stamp { animation: flStamp .4s cubic-bezier(.3,1.6,.5,1) 1s both; }
@keyframes flStamp { from { transform: rotate(-16deg) scale(2.5); opacity: 0; } to { transform: rotate(-5deg) scale(1); opacity: 1; } }
.fl-bag { font-size: 12.5px; line-height: 1.35; color: #233a55; }
.fl-bag small { display: block; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: #5b6e85; }
.fl-sheen { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.75) 50%, transparent 62%); transform: translateX(-120%); }
.fl-card.in .fl-sheen { animation: flSheen 1s ease-in-out 1.2s; }
@keyframes flSheen { to { transform: translateX(120%); } }
@keyframes flFromTop { from { transform: translateY(-110%); } to { transform: none; } }
@keyframes flFromLeft { from { transform: translateX(-70px) rotate(-5deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes flFromRight { from { transform: translateX(70px) rotate(5deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes flRise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.fl-wait { display: flex; gap: 10px; margin: 0 0 6px 18px; padding: 10px 0 10px 14px; border-left: 2px dashed var(--border-light); }
.fl-wait-time { flex: 0 0 66px; font-size: 11px; color: var(--text-dim); line-height: 1.3; }
.fl-wait-time b { display: block; color: var(--white); font-size: 14px; }
.fl-wait-box { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--border); }
.fl-wait.yes .fl-wait-box { border-color: rgba(102,220,160,.55); background: rgba(102,220,160,.1); }
.fl-wait.risk .fl-wait-box { border-color: var(--danger); background: rgba(255,122,133,.12); }
.fl-wait-t { font-size: 13.5px; font-weight: 800; color: var(--white); line-height: 1.3; }
.fl-wait ul { margin: 6px 0 0; padding-left: 16px; font-size: 12.5px; line-height: 1.4; color: var(--text-dim); }
.fl-wait li + li { margin-top: 3px; }

.fl-notes { margin-top: 18px; font-size: 12px; color: var(--text-dim); }
.fl-notes summary { cursor: pointer; font-weight: 700; }
.fl-notes ul { padding-left: 16px; line-height: 1.45; }
.fl-foot { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 24px; }
.fl-empty { text-align: center; }
.fl-empty-ic { font-size: 40px; }
@media (prefers-reduced-motion: reduce) {
  .fl-arc, .fl-city, .fl-city .fl-pulse, .fl-todo li, .fl-card.in, .fl-card.in * { animation: none !important; }
  .fl-arc { stroke-dashoffset: 0; } .fl-city { opacity: 1; }
  .fl-flown.on { animation: none; opacity: 1; } .fl-jet.live .fl-jet-ring { animation: none; }
}

.fl-hotel { margin: 0 0 6px 18px; padding: 14px; border-radius: 16px; background: linear-gradient(160deg, rgba(120,190,170,.17), rgba(255,255,255,.05)); border: 1px solid rgba(140,220,190,.32); }
.fl-hotel:not(.in) { visibility: hidden; }
.fl-hotel.in { animation: flCardIn .6s cubic-bezier(.2,.9,.25,1) both; }
.fl-hotel-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.fl-hotel-top small { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.fl-hotel-top h4 { margin: 2px 0 8px; font-size: 17px; line-height: 1.2; color: var(--white); }
.fl-hotel-ic { font-size: 24px; }
.fl-hotel-times { display: flex; gap: 8px; margin-bottom: 8px; }
.fl-hotel-times div { flex: 1; padding: 7px 9px; border-radius: 9px; background: rgba(255,255,255,.06); }
.fl-hotel-times small, .fl-h-copy small { display: block; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); }
.fl-hotel-times b { font-size: 12.5px; color: var(--white); }
.fl-h-copy { display: block; width: 100%; margin-bottom: 6px; padding: 7px 9px; border: 0; border-radius: 9px; background: rgba(255,255,255,.06); color: var(--white); text-align: left; font-family: inherit; cursor: pointer; }
.fl-h-copy b { font-size: 13px; line-height: 1.35; }
.fl-h-tel { display: inline-block; margin: 2px 0 6px; font-size: 13px; color: var(--accent-bright); text-decoration: none; }
.fl-rt { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.fl-rt-t { font-size: 13.5px; font-weight: 800; color: var(--white); margin-bottom: 8px; }
.fl-rt ol { list-style: none; margin: 0; padding: 0; }
.fl-rt li { position: relative; display: flex; gap: 10px; padding-bottom: 12px; }
.fl-rt li:not(:last-child)::before { content: ''; position: absolute; left: 14px; top: 28px; bottom: 0; border-left: 2px dashed var(--border-light); }
.fl-hotel.in .fl-rt li { animation: flRise .4s ease-out calc(.25s + var(--i) * .14s) both; }
.fl-rt-ic { flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.11); font-size: 14px; }
.fl-rt b { display: block; font-size: 13px; line-height: 1.3; color: var(--white); }
.fl-rt li small { display: block; margin-top: 1px; font-size: 12px; line-height: 1.35; color: var(--text-dim); }
.fl-rt-map { display: block; padding: 10px; border-radius: 10px; text-align: center; font-size: 13px; font-weight: 800; color: #04213a; background: var(--accent); text-decoration: none; }
.fl-hotel-notes { margin: 10px 0 0; padding-left: 16px; font-size: 12.5px; line-height: 1.4; color: var(--text-dim); }
.fl-hotel-notes li + li { margin-top: 3px; }
@media (prefers-reduced-motion: reduce) { .fl-hotel.in, .fl-hotel.in * { animation: none !important; } }

/* --- dive briefing (sites.js) --- */
.tile-brief { grid-column: span 4; cursor: pointer; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(135deg, rgba(42,159,216,.28), rgba(4,24,46,.55)); border-color: rgba(155,220,255,.32); }
.tile-brief small { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-bright); font-weight: 800; }
.tile-brief b { font-size: clamp(1.4rem, 5vw, 2.1rem); font-weight: 300; color: #fff; letter-spacing: -.03em; line-height: 1.1; }
.tile-brief span { font-size: .8rem; color: var(--text-dim); font-weight: 600; }
.tile-brief .tb-go { color: var(--accent); font-weight: 800; margin-top: 2px; }
@media (max-width: 860px) { .tile-brief { grid-column: span 2; } }
.pd-brief { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }

.brief-view { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; opacity: 0; transition: opacity .25s ease;
  background: radial-gradient(120% 70% at 50% 0%, #0d4a73 0%, #04182e 55%, #010810 100%); }
.brief-view.on { opacity: 1; }
.brief-bar { display: flex; gap: 6px; align-items: center; padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 10px; overflow-x: auto; flex-shrink: 0; }
.brief-bar button { flex-shrink: 0; border: 1px solid var(--border); background: var(--glass); color: var(--text-dim); border-radius: 999px;
  padding: 8px 14px; font: 700 .8rem var(--font); cursor: pointer; }
.brief-bar button.on { background: var(--accent); color: #032036; border-color: var(--accent); }
.brief-bar .brief-x { margin-left: auto; width: 38px; height: 38px; padding: 0; font-size: 1rem; }
.brief-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 28px); }
.brief-card { max-width: 640px; margin: 0 auto; animation: briefIn .45s cubic-bezier(.2,.8,.2,1); }
@keyframes briefIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .brief-card { animation: none; } .brief-view { transition: none; } }
.brief-eyebrow { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-weight: 800; margin-top: 6px; }
.brief-name { font-size: clamp(2rem, 9vw, 3rem); font-weight: 200; letter-spacing: -.04em; color: #fff; line-height: 1.02; margin: 6px 0 4px; }
.brief-sub { font-size: .86rem; color: var(--text-dim); font-weight: 600; }
.brief-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; align-items: start; margin: 16px 0 6px; }
@media (max-width: 420px) { .brief-top { grid-template-columns: 1fr; } .brief-facts { grid-template-columns: 1fr 1fr; } }
.brief-depth { width: 100%; height: auto; display: block; }
.brief-depth .bd-tick { stroke: rgba(255,255,255,.12); stroke-width: 1; }
.brief-depth .bd-lab { fill: var(--text-muted); font: 700 10px var(--font); text-anchor: end; }
.brief-depth .bd-band { fill: rgba(255,179,138,.22); stroke: rgba(255,179,138,.7); stroke-dasharray: 4 3; }
.brief-depth .bd-ship { fill: rgba(10,30,48,.95); stroke: #ffb38a; stroke-width: 1.5; stroke-linejoin: round; }
.brief-depth .bd-val { fill: #ffd3bd; font: 800 11px var(--font); }
.brief-depth .bd-floor { fill: rgba(194,170,120,.35); }
.brief-facts { display: grid; gap: 8px; }
.brief-facts div { background: var(--glass); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; }
.brief-facts small { display: block; font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); font-weight: 800; }
.brief-facts b { display: block; color: #fff; font-weight: 700; font-size: .92rem; margin-top: 2px; }
.brief-sec { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-bright); font-weight: 800; margin: 18px 0 8px; }
.brief-story { font-size: 1rem; line-height: 1.6; color: var(--text); }
.brief-story::first-letter { font-size: 2.4em; float: left; line-height: .9; margin: 4px 8px 0 0; color: var(--coral); font-weight: 300; }
.brief-see { margin: 0; padding-left: 18px; color: var(--text); line-height: 1.55; font-size: .93rem; }
.brief-see li { margin-bottom: 4px; }
.brief-warn { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(255,122,133,.12); border: 1px solid rgba(255,122,133,.35); color: #ffd0d4; font-size: .88rem; line-height: 1.45; }
.brief-plan { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.brief-plan div { background: var(--glass); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.brief-plan b { display: block; color: #fff; font-size: 1.5rem; font-weight: 300; letter-spacing: -.03em; }
.brief-plan small { color: var(--text-dim); font-size: .74rem; font-weight: 600; }
.brief-note { font-size: .76rem; color: var(--text-dim); line-height: 1.45; margin: 8px 0; }
.brief-notes { width: 100%; resize: vertical; min-height: 80px; }
.brief-src { font-size: .72rem; color: var(--text-muted); margin-top: 14px; }
.brief-src a { color: var(--accent); }

/* --- jet lag plan and reminders (flplan.js) --- */
.fl-jet, .fl-rem { border-radius: 18px; padding: 14px 16px; margin-bottom: 18px; background: var(--glass); border: 1px solid var(--border); }
.fl-jet h3 { margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.fl-jet-j + .fl-jet-j { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.fl-jet-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.fl-jet-head b { font-size: 2rem; font-weight: 300; letter-spacing: -.04em; color: #fff; }
.fl-jet-head span { color: var(--text-dim); font-size: .82rem; font-weight: 600; }
.fl-jet ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fl-jet li { display: flex; gap: 10px; padding: 9px 10px; border-radius: 12px; background: rgba(255,255,255,.04); }
.fl-jet li.sleep, .fl-jet li.part { background: linear-gradient(90deg, rgba(120,110,255,.18), rgba(255,255,255,.03)); }
.fl-jet li.awake { background: linear-gradient(90deg, rgba(255,200,90,.14), rgba(255,255,255,.03)); }
.fl-jet li i { font-style: normal; font-size: 1.2rem; line-height: 1.3; }
.fl-jet li small, .fl-rem li small { display: block; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); font-weight: 800; }
.fl-jet li b, .fl-rem li b { display: block; color: #fff; font-size: .92rem; margin: 1px 0 2px; }
.fl-jet li span, .fl-rem li span { display: block; color: var(--text-dim); font-size: .8rem; line-height: 1.4; }
.fl-jet-src { margin: 10px 0 0; font-size: .7rem; color: var(--text-muted); }
.fl-jet-src a { color: var(--accent); }
.fl-todo summary, .fl-jet summary { cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); list-style: none; }
.fl-todo summary::-webkit-details-marker, .fl-jet summary::-webkit-details-marker { display: none; }
.fl-todo summary span, .fl-jet summary span { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent-dim); color: var(--accent); letter-spacing: 0; }
.fl-todo[open] ul, .fl-jet[open] .fl-jet-j:first-of-type { margin-top: 12px; }
.fl-rem summary { cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); list-style: none; }
.fl-rem summary::-webkit-details-marker { display: none; }
.fl-rem summary span { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent-dim); color: var(--accent); }
.fl-rem-note { font-size: .74rem; color: var(--text-dim); line-height: 1.4; margin: 10px 0; }
.fl-rem ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fl-rem li { padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.04); }
.fl-ask { position: fixed; left: 16px; right: 16px; top: calc(env(safe-area-inset-top, 0px) + 16px); z-index: 2000; max-width: 520px; margin: 0 auto;
  padding: 16px; border-radius: 18px; background: #0d3a5c; border: 1px solid var(--accent); box-shadow: 0 18px 50px rgba(0,0,0,.55);
  display: flex; flex-direction: column; gap: 12px; animation: briefIn .35s ease; }
.fl-ask b { color: #fff; font-size: 1rem; }
.fl-ask div { display: flex; gap: 8px; }
.fl-ask button { flex: 1; }
.leg-src { font-size: .8rem; color: var(--text-dim); margin: 0 0 8px; line-height: 1.4; }
.leg-src .link-btn { padding: 0; font-weight: 800; }
