:root {
  --calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
  --clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235d7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --bg: #f4f7f9;
  --surface: #ffffff;
  --surface-2: #eef3f6;
  --border: #dde5eb;
  --text: #13232e;
  --muted: #5d7280;
  --accent: #0e7490;
  --accent-strong: #0b5d73;
  --accent-soft: #e0f2f6;
  --nx: #b45309;
  --nx-soft: #fdf1e3;
  --danger: #b42318;
  --ok-soft: #e7f6ee;
  --ok: #17663a;
  --err-soft: #fdecea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 35, 46, .06), 0 1px 3px rgba(16, 35, 46, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238ea3ae' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
    --clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238ea3ae' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238ea3ae' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --bg: #0b1419;
    --surface: #111e25;
    --surface-2: #17262e;
    --border: #22343e;
    --text: #e3edf2;
    --muted: #8ea3ae;
    --accent: #38b2cc;
    --accent-strong: #5cc6dc;
    --accent-soft: #123341;
    --nx: #f0a94b;
    --nx-soft: #3a2a14;
    --danger: #f07167;
    --ok-soft: #12301f;
    --ok: #7dd3a0;
    --err-soft: #3a1714;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* beats display rules such as label { display: flex } */
html { -webkit-text-size-adjust: 100%; touch-action: pan-x pan-y; }  /* no double-tap or pinch zoom */
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .9rem; }
h3 { font-size: .95rem; margin: 1.2rem 0 .5rem; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 5px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
/* safe-area insets keep content clear of the notch and home indicator when installed on an iPhone home screen */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
main.wrap { padding-top: 24px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

/* top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top); }
.topbar-inner { display: flex; align-items: center; gap: 20px; min-height: 58px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.logo { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); position: relative; overflow: hidden; flex: none; }
.logo::after { content: ""; position: absolute; left: -4px; right: -4px; top: 11px; height: 6px; border-top: 2.5px solid #fff; border-radius: 50%; }
.logo.lg { width: 36px; height: 36px; }
.logo.lg::after { top: 16px; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 8px; white-space: nowrap; font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .72rem; line-height: 18px; text-align: center; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-right form { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 4px; }
.linkbtn:hover { color: var(--text); }
@media (max-width: 720px) {
  .topbar-inner { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: 6px; }
  .topbar-right { margin-left: auto; }
  /* with JavaScript the nav becomes a dropdown behind the menu button */
  .js .menu-btn { display: inline-flex; }
  .js .nav { display: none; }
  .js .topbar.nav-open .nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 10px; }
  .js .topbar.nav-open .nav a { padding: 11px 12px; font-size: 1.02rem; }
}
.menu-btn { display: none; position: relative; align-items: center; justify-content: center; width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); cursor: pointer; padding: 0; }
.menu-btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.nav-open .menu-btn { background: var(--surface-2); }
.menu-btn .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
@media (prefers-color-scheme: dark) { .btn-primary { color: #06222b; } }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: .85rem; }
.btn-block { width: 100%; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-gap form { margin: 0; }

/* layout */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; font-weight: 700; color: var(--accent); margin: 0 0 4px !important; }
.back { display: inline-block; margin-bottom: 12px; font-size: .9rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 16px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.empty { text-align: center; padding: 40px 20px; }

/* flash */
.flash { padding: 10px 14px; border-radius: 9px; margin-bottom: 16px; background: var(--ok-soft); color: var(--ok); font-weight: 500; }
.flash-error { background: var(--err-soft); color: var(--danger); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; box-shadow: var(--shadow); min-width: 0; }
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 500; }
.stat-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .8rem; }

/* bars */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 64px 1fr 36px; align-items: center; gap: 10px; font-size: .88rem; }
.bar-label { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-track { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; }
.bar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* dive list */
.dive-list { list-style: none; margin: 0; padding: 0; }
.dive-list li + li { border-top: 1px solid var(--border); }
.dive-item { display: flex; align-items: center; gap: 14px; padding: 12px 4px; color: var(--text); }
a.dive-item:hover { text-decoration: none; background: var(--surface-2); border-radius: 8px; }
.dive-item form { margin: 0; }
.dive-no { color: var(--muted); font-variant-numeric: tabular-nums; width: 38px; flex: none; font-size: .9rem; }
.dive-main { display: flex; flex-direction: column; flex: 1; min-width: 0; color: var(--text); }
.dive-main .muted { font-size: .85rem; }
.dive-meta { display: flex; gap: 12px; align-items: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) { .dive-meta .chip:not(.chip-user) { display: none; } }  /* hide gas chips, keep status chips */

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); margin: 0 4px 4px 0; }
.chip-nx { background: var(--nx-soft); color: var(--nx); }
.chip-user { background: var(--accent-soft); color: var(--accent); }

/* table */
.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input[type=search] { flex: 1; min-width: 200px; }
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
@media (max-width: 640px) { .hide-sm { display: none; } }

/* forms */
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 11px; width: 100%;
  font-size: 16px; /* below 16px iOS Safari zooms in on focus */
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
select { width: auto; }
.fields select { width: 100%; }
/* Own look for dropdowns (iOS draws a grey bevelled box otherwise); the chevron colour follows the theme. */
select {
  -webkit-appearance: none; appearance: none; cursor: pointer; line-height: 1.3;
  padding-right: 36px; background-image: var(--chevron); background-repeat: no-repeat;
  background-position: right 12px center; background-size: 12px 8px;
}
select::-ms-expand { display: none; }
.select-sm { padding: 5px 30px 5px 10px; background-position: right 10px center; border-radius: 8px; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: .9rem; }
.form { display: flex; flex-direction: column; gap: 18px; }
.form .row-gap { margin-top: 4px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
legend { font-weight: 700; margin-bottom: 10px; font-size: 1rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.self-end { align-self: end; padding-bottom: 10px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--accent); margin-bottom: 12px; }
details.more > :not(summary) + :not(summary) { margin-top: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 180px; }
.drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 26px; text-align: center; cursor: pointer; font-weight: 400; background: var(--surface-2); }
.drop:hover { border-color: var(--accent); }
.drop input { border: 0; background: transparent; padding: 0; max-width: 360px; margin: 0 auto 8px; }

/* detail */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.dl dt { color: var(--muted); font-size: .9rem; }
.dl dd { margin: 0; font-variant-numeric: tabular-nums; }
.notes { white-space: pre-wrap; margin: 0; }

/* people */
.people { list-style: none; padding: 0; margin: 0; }
.people li { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.people li + li { border-top: 1px solid var(--border); }
.people form { margin: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.avatar { object-fit: cover; }
.avatar.sm { width: 30px; height: 30px; font-size: .85rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 2.2rem; }
.profile-link { display: flex; border-radius: 50%; outline-offset: 2px; }
.profile-link.active .avatar, .profile-link:hover .avatar { box-shadow: 0 0 0 2px var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.plain { padding-left: 18px; margin: 0 0 12px; }

/* public front page */
main.home { padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: 32px; }
.home-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 0 12px; }
.home-bar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; align-items: center; padding: 32px 0 40px; }
.hero h1 { font-size: 2.4rem; letter-spacing: -.02em; margin-bottom: 12px; }
.hero-lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 20px; max-width: 34em; }
.hero-card { margin: 0; }
.demo-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.demo-stats > div { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; }
.demo-stats b { display: block; font-size: 1.3rem; white-space: nowrap; }
.demo-dives { list-style: none; margin: 0; padding: 0; }
.demo-dives li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.demo-dives li > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.demo-dives .chip { white-space: nowrap; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.feature { margin: 0; }
.feature h2 { margin-bottom: .4rem; }
.feature p { margin: 0; color: var(--muted); }
.home-cta { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.home-cta h2 { margin-bottom: .3rem; }
.home-cta p { margin: 0; max-width: 36em; }
.home-foot { padding: 8px 0 0; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 16px 0 24px; gap: 20px; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .hero h1 { font-size: 1.9rem; }
  .demo-stats b { font-size: 1.1rem; }
  .features { grid-template-columns: 1fr; }
}

/* privacy statement and terms */
.legal { max-width: 760px; line-height: 1.6; }
.legal h2 { font-size: 1.05rem; margin: 24px 0 6px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }

/* auth */
main.auth { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding-top: env(safe-area-inset-top); }
.auth-card { width: 100%; max-width: 380px; padding: 28px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.auth-brand h1 { margin: 0; }
.btn-provider { gap: 10px; }
.btn-provider svg { width: 18px; height: 18px; flex: none; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 18px 0 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* small-screen and spacing refinements */
.result details { margin-bottom: 14px; }
@media (max-width: 560px) {
  .dive-item { gap: 10px; align-items: flex-start; }
  .dive-no { width: 30px; padding-top: 2px; }
  .dive-meta { flex-direction: column; align-items: flex-end; gap: 0; font-size: .9rem; }
  .dive-item form .btn { white-space: normal; }
}
.nowrap { white-space: nowrap; }
@media (max-width: 640px) { .table td, .table th { padding: 10px 8px; } }

/* profile & schools */
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: 2px 0 0; }
.photo-pick { position: relative; display: block; cursor: pointer; border-radius: 50%; flex: none; }
.photo-pick .avatar.xl { width: 84px; height: 84px; }
.photo-edit { position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%; display: grid;
  place-items: center; background: var(--accent); color: #fff; font-size: .8rem; border: 2px solid var(--bg); }
.photo-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.photo-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.photo-actions form { margin: 0; }
.photo-actions .linkbtn { padding: 0; font-size: .85rem; color: var(--accent); }
.role-group + .role-group { margin-top: 18px; }
.people .inline-form select { width: auto; }
.section-title { margin: 28px 0 12px; font-size: 1.2rem; }

/* dashboard tiles: links are raised and show a chevron; key figures are tinted */
a.stat { color: var(--text); text-decoration: none; }
.stat-link { position: relative; padding-right: 30px; box-shadow: 0 1px 2px rgba(16, 35, 46, .08), 0 4px 12px rgba(16, 35, 46, .08);
  transition: transform .12s ease, box-shadow .12s ease; }
.stat-link::after { content: "›"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 1.4rem;
  line-height: 1; color: var(--muted); }
.stat-link:hover { text-decoration: none; box-shadow: 0 2px 4px rgba(16, 35, 46, .1), 0 8px 20px rgba(16, 35, 46, .12); }
.stat-link:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(16, 35, 46, .08); }
.stat-key { background: var(--accent-soft); border-color: transparent; }
.stat-key .stat-label { color: var(--accent-strong); }
.stat-sub { color: var(--accent); }
.stat-sub.muted { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  .stat-link { box-shadow: 0 0 0 1px var(--border), 0 4px 14px rgba(0, 0, 0, .35); }
}

/* clickable chart rows */
a.bar-row { color: var(--text); border-radius: 6px; margin: -3px -6px; padding: 3px 6px; }
a.bar-row:hover { background: var(--surface-2); text-decoration: none; }
.more-years { margin-top: 10px; }
.more-years summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.filter-note { margin: -6px 0 14px; font-size: .9rem; color: var(--muted); }

/* ⋯ dropdown menu */
.dropdown { position: relative; }
.dropdown summary { list-style: none; font-size: 1.2rem; line-height: 1; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown .menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; display: flex; flex-direction: column;
  min-width: 160px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(16, 35, 46, .15); }
.menu-pop a, .menu-pop .linkbtn { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 7px; color: var(--text); }
.menu-pop a:hover, .menu-pop .linkbtn:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop .btn-danger { color: var(--danger); }
.menu-pop form { margin: 0; }
.dive-head { flex-wrap: nowrap; align-items: flex-start; }

/* dive form */
.fields-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
/* date/time: left-aligned (iOS centres them) with a calendar/clock icon at the end */
input[type=date], input[type=time] {
  -webkit-appearance: none; appearance: none; text-align: left; min-height: 44px; padding-right: 40px;
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px 18px;
}
input[type=date] { background-image: var(--calendar); }
input[type=time] { background-image: var(--clock); }
input::-webkit-date-and-time-value { text-align: left; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator { opacity: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips:empty { display: none; }
.buddy-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 6px; border-radius: 999px;
  background: var(--accent-soft); color: var(--text); font-weight: 500; }
.chip-remove { border: 0; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%; }
.chip-remove:hover { background: var(--surface); color: var(--danger); }
.avatar.xs { width: 24px; height: 24px; font-size: .75rem; }
.gear-details { margin: 0; }

/* dive list: one line per dive; on phones in portrait only date, time and site (site gets an ellipsis) */
.dive-table .col-date { width: 7.8em; }
.dive-table .col-time { width: 4.6em; }
.dive-table td { white-space: nowrap; }
.dive-table .col-site { overflow: hidden; text-overflow: ellipsis; max-width: 0; width: 100%; }
@media (max-width: 900px) { .hide-md { display: none; } }
@media (max-width: 560px) {
  .hide-xs { display: none; }
  .dive-table { table-layout: fixed; }
}
.menu-summary { padding: 7px 9px; }
.menu-summary svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; display: block; }
.cert-line { display: block; }
.count-list { list-style: none; margin: 0; padding: 0; }
.count-list li + li { border-top: 1px solid var(--border); }
.count-list a { display: flex; justify-content: space-between; padding: 9px 6px; color: var(--text); border-radius: 6px;
  font-variant-numeric: tabular-nums; }
.count-list a:hover { background: var(--surface-2); text-decoration: none; }
/* group dive rental */
.rental-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; align-items: center;
  margin-bottom: 12px; }
.rental-item { font-weight: 500; }
.join-form { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.join-form details.more summary { margin-bottom: 8px; }
.ready-list li { display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; }
.rental-line { color: var(--accent-strong); }
/* group dive buddy pairs */
.buddy-ask { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.buddy-pick { margin: 12px 0 6px; }
.buddy-pick select { width: auto; min-width: 140px; }
.pair-avatars { display: flex; flex: none; }
.pair-avatars .avatar + .avatar { margin-left: -10px; box-shadow: 0 0 0 2px var(--surface); }

/* training dives per course on the profile */
.course-head { font-size: 1rem; margin: 16px 0 4px; }
.course-head:first-of-type { margin-top: 0; }

/* rental prices (school settings, group dive) */
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; }
.price-input { display: flex; align-items: center; gap: 6px; }
.price-input input { min-width: 0; }
.rental-total, .rental-due { margin: 4px 0 0; }

/* waking page while the database resumes */
.waking .auth-brand { justify-content: center; }
.waking-spinner { width: 36px; height: 36px; margin: 8px auto 16px; border-radius: 50%; border: 3px solid var(--border);
  border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .waking-spinner { animation-duration: 3s; } }
.discount-field { max-width: 200px; margin-top: 14px; }

/* buddy suggestions on the dive form (a datalist barely works in iOS Safari) */
.suggest-wrap { position: relative; }
.suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; list-style: none; margin: 0; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  max-height: 280px; overflow-y: auto; }
.suggest li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--surface-2); }
.suggest li .muted { margin-left: auto; }
.club-toggle { margin: 0; }
.club-toggle .check { margin: 0; font-size: .9rem; white-space: nowrap; }
@media (max-width: 560px) {  /* owner's member rows: name on top, club / role / remove below it */
  .people li:has(.club-toggle) { flex-wrap: wrap; row-gap: 6px; }
  .people li:has(.club-toggle) > .grow { flex: 1 1 calc(100% - 42px); }
  .people li:has(.club-toggle) > .club-toggle { margin-left: 42px; margin-right: auto; }
}
