/*
 * OnPar — the desktop app shell (design: "OnPar Desktop", Mac and web, light
 * and dark). A floating sidebar for navigation, the map filling the window, an
 * inspector on the right for the course or hole, and a toolbar floating over
 * the map. Plain CSS, no build step.
 *
 * Tokens are light by default; <html data-scheme="dark"> swaps in the dark set.
 * The layout's head script sets data-scheme before first paint, from the
 * golfer's choice in the sidebar (Auto / Light / Dark, kept on the device) and,
 * on Auto, the system setting. The admin loads this file only for the
 * rangefinder and never sets data-scheme, so it stays light.
 */

:root {
    --op-bg: #F2F2F7;
    --op-card: #fff;               /* cards on the page background */
    --op-card-raised: #fff;        /* cards inside the glass panels */
    --op-modal: #F2F2F7;
    --op-text: #000;
    --op-text-2: #6C6C70;
    --op-text-3: #C4C4C7;          /* chevrons */
    --op-sep: #E5E5EA;
    --op-fill: rgba(120,120,128,.14);
    --op-green: #248A3D;
    /* A green fill under text (buttons, badges, the hole you're on): OnPar green and white in
       both modes. --op-green brightens in dark for green text and links; as a fill it glared. */
    --op-green-fill: #248A3D;
    --op-on-green: #fff;
    --op-green-tint: rgba(36,138,61,.14);
    --op-red-tint: rgba(255,59,48,.12);
    --op-blue: #007AFF;
    --op-red: #FF3B30;
    --op-star: #FFCC00;
    --op-chip-on-bg: #000;
    --op-chip-on-text: #F2F2F7;
    --op-seg-on: #fff;
    --op-panel: rgba(250,250,252,.84);
    --op-panel-border: rgba(255,255,255,.8);
    --op-panel-shadow: 0 10px 40px rgba(0,0,0,.22);
    --op-glass: rgba(255,255,255,.66);
    --op-glass-border: rgba(255,255,255,.7);
    --op-glass-shadow: 0 6px 20px rgba(0,0,0,.14);
    --op-logo-filter: invert(1);   /* the logo artwork is white */
    --op-map-bg: #efe6cf;          /* the course book's paper, under every map */

    /* The course book: OnPar's own drawing of a course, a printed yardage book
       by day and a blueprint by night. onpar-coursebook.js reads these for the
       map layers, so a colour changes here and nowhere else. --bk-ink is what
       sits on top of the drawing: the shot line, rings, aim point, callouts. */
    --bk-paper: #efe6cf;
    --bk-land: #e7dcbf;
    --bk-rough: #d3d6a6;
    --bk-fairway: #a8c27a;
    --bk-stripe: #b8cf8a;
    --bk-tee: #92ba68;
    --bk-fringe: #9fc06e;
    --bk-green: #79a957;
    --bk-green-line: #5e8c43;
    --bk-bunker: #f3e6c1;
    --bk-bunker-line: #b6a06d;
    --bk-stipple: #c7b27f;
    --bk-water: #a6c7cc;
    --bk-water-line: #6b979e;
    --bk-border: #b9a982;
    --bk-grounds: #dcd9ae;          /* inside the course boundary */
    --bk-wood: #b9c68f;
    --bk-tree: #5b7d47;
    --bk-tree-shadow: rgba(70,55,25,.3);
    --bk-path: #cbbf9f;
    --bk-ink: #3b3226;
    --bk-ink-soft: rgba(59,50,38,.55);
    --bk-halo: #f7f1e2;

    --op-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --op-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Geometry the floating pieces share. --op-left is where the toolbar and
       hole strip start: clear of the sidebar on the site, the frame's edge in
       the admin. */
    --op-gap: 10px;
    --op-sidebar-w: 260px;
    --op-inspector-w: 360px;
    --op-left: calc(var(--op-gap) + var(--op-sidebar-w) + 16px);
}

:root[data-scheme="dark"] {
    --op-bg: #000;
    --op-card: #1C1C1E;
    --op-card-raised: #2C2C2E;
    --op-modal: #1C1C1E;
    --op-text: #fff;
    --op-text-2: #98989D;
    --op-text-3: #5A5A5E;
    --op-sep: #38383A;
    --op-fill: rgba(118,118,128,.24);
    --op-green: #30D158;
    --op-green-fill: #248A3D;
    --op-on-green: #fff;
    --op-green-tint: rgba(48,209,88,.2);
    --op-red-tint: rgba(255,69,58,.18);
    --op-blue: #0A84FF;
    --op-red: #FF453A;
    --op-star: #FFD60A;
    --op-chip-on-bg: #fff;
    --op-chip-on-text: #000;
    --op-seg-on: #636366;
    --op-panel: rgba(28,28,30,.86);
    --op-panel-border: rgba(255,255,255,.12);
    --op-panel-shadow: 0 10px 40px rgba(0,0,0,.5);
    --op-glass: rgba(44,44,46,.62);
    --op-glass-border: rgba(255,255,255,.14);
    --op-glass-shadow: 0 6px 20px rgba(0,0,0,.35);
    --op-logo-filter: none;
    --op-map-bg: #0d1719;
    --bk-paper: #0d1719;
    --bk-land: #111c1a;
    --bk-rough: #1a3527;
    --bk-fairway: #2f6a44;
    --bk-stripe: #37774e;
    --bk-tee: #2e6443;
    --bk-fringe: #3a7d4d;
    --bk-green: #4fa465;
    --bk-green-line: #9be3a8;
    --bk-bunker: #8c7d56;
    --bk-bunker-line: #c8b27a;
    --bk-stipple: #a8966a;
    --bk-water: #17414b;
    --bk-water-line: #4aa3b0;
    --bk-border: #2a4744;
    --bk-grounds: #152a21;
    --bk-wood: #15301f;
    --bk-tree: #1e4d31;
    --bk-tree-shadow: rgba(0,0,0,.45);
    --bk-path: #2c3d37;
    --bk-ink: #e6efe9;
    --bk-ink-soft: rgba(230,239,233,.55);
    --bk-halo: #0d1719;
    color-scheme: dark;

    /* Tabler, which the account pages are built from, in the same greys. */
    --tblr-body-bg: #000;
    --tblr-bg-surface: #1C1C1E;
    --tblr-bg-surface-secondary: #2C2C2E;
    --tblr-bg-forms: #2C2C2E;
    --tblr-border-color: #38383A;
    --tblr-border-color-translucent: rgba(255,255,255,.12);
    --tblr-body-color: #fff;
    --tblr-secondary: #98989D;
    --tblr-secondary-color: #98989D;
    --tblr-muted: #98989D;
}

/* ── Base ─────────────────────────────────────────────────────────── */

body.op {
    margin: 0;
    background: var(--op-bg);
    color: var(--op-text);
    font-family: var(--op-font);
    -webkit-font-smoothing: antialiased;
}
body.op a { color: var(--op-green); text-decoration: none; }
body.op a:hover { color: var(--op-green); text-decoration: underline; }
.op-num { font-family: var(--op-rounded); font-variant-numeric: tabular-nums; }
.op-muted { color: var(--op-text-2); }
.op-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.op [hidden] { display: none !important; }
.op-icon { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.op-icon-sm { width: 14px; height: 14px; stroke-width: 2.5; }
.op-icon-lg { width: 18px; height: 18px; }

/* Frosted surfaces: the chips and toolbar (glass), the sidebar and inspector (panel). */
.op-glass {
    background: var(--op-glass);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--op-glass-border);
    box-shadow: var(--op-glass-shadow);
    color: var(--op-text);
}
.op-panel {
    background: var(--op-panel);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--op-panel-border);
    box-shadow: var(--op-panel-shadow);
    border-radius: 22px;
    color: var(--op-text);
}

/* ── Sidebar ──────────────────────────────────────────────────────── */

.op-sidebar {
    position: fixed; z-index: 40;
    left: var(--op-gap); top: var(--op-gap); bottom: var(--op-gap);
    width: var(--op-sidebar-w);
    display: flex; flex-direction: column;
    padding: 0 10px;
    overflow-y: auto;
}
.op-sidebar-head { height: 52px; display: flex; align-items: center; gap: 8px; padding-left: 4px; flex: none; }
.op-logo { display: block; height: 26px; width: auto; filter: var(--op-logo-filter); }
.op-sidebar-head .op-logo { height: 30px; }
.op-sidebar-toggle {
    margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 8px;
    background: transparent; color: var(--op-text-2); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.op-sidebar-toggle:hover { background: var(--op-fill); }
.op-side-search {
    height: 32px; margin: 4px 2px; border-radius: 9px; background: var(--op-fill);
    display: flex; align-items: center; gap: 6px; padding: 0 10px; color: var(--op-text-2); flex: none;
}
.op-side-search input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--op-text);
}
.op-side-search input::placeholder { color: var(--op-text-2); }
.op-nav-label { padding: 16px 12px 6px; font-size: 12px; font-weight: 600; color: var(--op-text-2); }
.op-nav a {
    height: 34px; border-radius: 10px; padding: 0 10px; display: flex; align-items: center; gap: 10px;
    font-size: 14px; color: var(--op-text) !important; text-decoration: none !important;
}
.op-nav a .op-icon { color: var(--op-blue); }
.op-nav a:hover { background: var(--op-fill); }
.op-nav a.is-active { background: var(--op-green-tint); color: var(--op-green) !important; font-weight: 600; }
.op-nav a.is-active .op-icon { color: var(--op-green); }
.op-nav a .op-grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-count { font-size: 13px; color: var(--op-text-2); font-family: var(--op-rounded); font-variant-numeric: tabular-nums; font-weight: 400; }
.op-sidebar-foot { margin-top: auto; flex: none; }
.op-account {
    display: flex; align-items: center; gap: 10px; padding: 12px 6px 10px; border-top: 1px solid var(--op-sep);
    color: var(--op-text) !important; text-decoration: none !important;
}
.op-avatar {
    width: 30px; height: 30px; border-radius: 15px; background: var(--op-green-fill); color: var(--op-on-green);
    font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none;
}
.op-avatar.is-guest { background: var(--op-fill); color: var(--op-text-2); }
.op-account-name { font-size: 13px; font-weight: 600; display: block; }
.op-account.is-unavailable { cursor: default; opacity: .6; }
.op-account.is-unavailable:hover { background: none; }
.op-account-sub { font-size: 12px; color: var(--op-text-2); display: block; }
/* Credits sit where the imagery or data they're for is shown (map attribution, under thumbnails) — not in the sidebar. */
/* A course's thumbnail, drawn by App\Support\CourseSketch in the course book's colours. */
.op-sketch { display: block; width: 100%; height: 100%; background: var(--bk-paper); }
.op-sketch .sk-grounds { fill: var(--bk-grounds); }
.op-sketch .sk-rough-area { fill: var(--bk-rough); }
.op-sketch .sk-woods { fill: var(--bk-wood); }
.op-sketch .sk-range { fill: var(--bk-stripe); }
.op-sketch .sk-rough { fill: none; stroke: var(--bk-rough); stroke-linecap: round; stroke-linejoin: round; }
.op-sketch .sk-fairway { fill: var(--bk-fairway); }
.op-sketch .sk-tee { fill: var(--bk-tee); }
.op-sketch .sk-green { fill: var(--bk-green); stroke: var(--bk-fringe); stroke-width: 1.2; paint-order: stroke; }
.op-sketch .sk-water { fill: var(--bk-water); stroke: var(--bk-water-line); stroke-width: .6; }
.op-sketch .sk-bunker { fill: var(--bk-bunker); stroke: var(--bk-bunker-line); stroke-width: .5; }
.op-lrow-thumb { overflow: hidden; }
/* No outlines to draw yet: the paper, with a flag. */
.op-sketch-none { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; background: var(--bk-paper); color: var(--bk-border); }
.op-ccard-thumb .op-sketch-none .op-icon { width: 28px; height: 28px; }
/* Appearance: Auto / Light / Dark, a small segmented control above the account. */
.op-theme { display: flex; gap: 2px; padding: 2px; margin: 0 4px 12px; border-radius: 9px; background: var(--op-fill); }
.op-theme button {
    flex: 1; height: 26px; border: 0; border-radius: 7px; background: none; color: var(--op-text-2); padding: 0;
    font: 500 12px var(--op-font); display: flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
}
.op-theme button .op-icon { width: 13px; height: 13px; }
.op-theme button[aria-pressed="true"] { background: var(--op-seg-on); color: var(--op-text); box-shadow: 0 1px 3px rgba(0,0,0,.14); }

/* The button that brings a hidden sidebar back (phones, or collapsed on desktop). */
button.op-menu-btn { position: fixed; z-index: 41; left: var(--op-gap); top: var(--op-gap); display: none; }
.op-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(0,0,0,.3); display: none; }

html.op-collapsed { --op-left: 60px; }
html.op-collapsed .op-sidebar { display: none; }
html.op-collapsed button.op-menu-btn { display: flex; }
html.op-collapsed .op-main { margin-left: 0; padding-left: 60px; }

/* ── Main area ────────────────────────────────────────────────────── */

/* Page mode: the content sits to the right of the sidebar and scrolls. */
.op-main { margin-left: var(--op-left); padding: var(--op-gap) var(--op-gap) 48px 0; min-height: 100vh; }
.op-main > .container, .op-main > .container-xl { margin-left: 0; }

/* Canvas mode: a map fills the window and everything else floats over it. */
.op-canvas .op-main { margin: 0; padding: 0; min-height: 0; }

/* ── Toolbar ──────────────────────────────────────────────────────── */

.op-toolbar { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.op-stage .op-toolbar { position: absolute; z-index: 24; left: var(--op-left); right: var(--op-gap); top: var(--op-gap); pointer-events: none; }
.op-stage .op-toolbar > * { pointer-events: auto; }
.op-spacer { flex: 1; }
.op-titlechip {
    display: flex; flex-direction: column; justify-content: center; padding: 0 14px; height: 44px;
    border-radius: 22px; min-width: 0; max-width: 100%; color: var(--op-text) !important; text-decoration: none !important;
}
.op-titlechip.is-plain { background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding-left: 4px; }
.op-title { font-size: 15px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-subtitle { font-size: 12px; color: var(--op-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-seg { display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 4px; border-radius: 22px; flex: none; }
.op-seg a, .op-seg button {
    height: 36px; padding: 0 14px; border-radius: 18px; display: flex; align-items: center; gap: 6px; border: 0; background: none;
    font-size: 14px; font-weight: 600; color: var(--op-text-2) !important; text-decoration: none !important; cursor: pointer;
}
.op-seg .is-on { background: var(--op-seg-on); box-shadow: 0 1px 4px rgba(0,0,0,.14); color: var(--op-text) !important; }
.op-iconbtn {
    width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; flex: none;
    cursor: pointer; padding: 0; font: inherit; color: var(--op-text) !important; text-decoration: none !important;
}
.op-iconbtn.is-on { color: var(--op-blue) !important; }
.op-pillchip {
    padding: 0 14px; height: 40px; border-radius: 20px; display: flex; align-items: center; gap: 6px; flex: none;
    font-size: 14px; font-weight: 600; font-family: var(--op-rounded); font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ── Stage (canvas pages and the rangefinder) ─────────────────────── */

.op-stage { position: fixed; inset: 0; overflow: hidden; background: var(--op-map-bg); color: var(--op-text); }
.op-mapwrap { position: absolute; inset: 0; }
/* Two classes: maplibre-gl.css sets .maplibregl-map { position: relative } and loads after this file. */
.op-mapwrap .op-map { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ── Inspector ────────────────────────────────────────────────────── */

.op-inspector {
    position: absolute; z-index: 22; right: var(--op-gap); top: 62px; bottom: var(--op-gap);
    width: var(--op-inspector-w); display: flex; flex-direction: column; overflow: hidden;
}
.op-inspector-body { flex: 1; overflow-y: auto; padding-bottom: 16px; overscroll-behavior: contain; }
/* As tall as what it holds (the course map's picked course), not the window. A phone puts it at the bottom. */
.op-inspector-fit { bottom: auto; }
.op-ins-head { padding: 18px 18px 4px; display: flex; gap: 10px; align-items: flex-start; }
.op-ins-title { font-size: 22px; font-weight: 700; line-height: 1.2; margin: 0; }
.op-ins-sub { font-size: 14px; color: var(--op-text-2); margin-top: 2px; }
.op-ins-text { padding: 10px 18px 0; font-size: 13px; color: var(--op-text-2); }
/* A course's data sources (OpenGolfAPI's ODbL credit), one click away behind an ⓘ. */
.op-sources { padding: 10px 18px 0; }
.op-sources summary { list-style: none; display: inline-flex; cursor: pointer; color: var(--op-text-3); }
.op-sources summary::-webkit-details-marker { display: none; }
.op-sources[open] summary { color: var(--op-text-2); }
.op-sources .op-ins-text { padding: 4px 0 0; font-size: 12px; }
.op-ins-pad { padding: 14px 18px 0; }

/* Setup chips: tee, start hole. A real <select> underneath, so it works with a keyboard and on phones. */
.op-chips { padding: 12px 18px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.op-chip {
    position: relative; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--op-fill); color: var(--op-text);
    display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; border: 0; white-space: nowrap;
}
.op-chip select {
    appearance: none; -webkit-appearance: none; border: 0; outline: 0; background: transparent; color: inherit;
    font: inherit; padding: 0 18px 0 0; margin: 0; cursor: pointer; max-width: 12rem;
}
.op-chip select option { color: #000; }
.op-chip .op-icon-sm { position: absolute; right: 10px; color: var(--op-text-2); pointer-events: none; }
.op-chip:focus-within { box-shadow: 0 0 0 2px var(--op-blue); }

/* Buttons. */
.op-btn {
    height: 46px; border-radius: 23px; padding: 0 18px; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap;
}
.op-btn:disabled, .op-btn.is-disabled { opacity: .45; cursor: default; }
.op-btn-lg { height: 48px; border-radius: 24px; font-size: 16px; }
.op-btn-md { height: 40px; border-radius: 20px; padding: 0 20px; }
.op-btn-sm { height: 34px; border-radius: 17px; padding: 0 12px; font-size: 14px; }
.op-btn-block { display: flex; width: 100%; }
.op-btn-primary { background: var(--op-green-fill); color: var(--op-on-green) !important; }
.op-btn-primary:hover { filter: brightness(1.06); }
.op-btn-tint { background: var(--op-green-tint); color: var(--op-green) !important; }
.op-btn-tint:hover, .op-btn-danger-tint:hover { filter: brightness(.96); }
:root[data-scheme="dark"] .op-btn-tint:hover, :root[data-scheme="dark"] .op-btn-danger-tint:hover { filter: brightness(1.15); }
.op-btn-fill { background: var(--op-fill); color: var(--op-text) !important; }
.op-btn-row { display: flex; gap: 8px; }
.op-btn-row > .op-btn { flex: 1; }

/* Grouped lists, the way settings screens read. */
.op-section-label {
    padding: 16px 28px 6px; font-size: 12px; color: var(--op-text-2); text-transform: uppercase;
    display: flex; align-items: center; gap: 8px;
}
.op-section-label .op-spacer + * { text-transform: none; }
.op-linkbtn { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; color: var(--op-green); cursor: pointer; text-transform: none; }
.op-linkbtn:disabled { color: var(--op-text-3); cursor: default; }
.op-group { margin: 0 14px; background: var(--op-card-raised); border-radius: 18px; overflow: hidden; }
.op-row {
    display: flex; align-items: center; gap: 10px; padding-left: 14px; width: 100%;
    background: none; border: 0; text-align: left; font: inherit; color: var(--op-text) !important; text-decoration: none !important;
}
button.op-row, a.op-row { cursor: pointer; }
button.op-row:hover, a.op-row:hover { background: var(--op-fill); }
.op-row-main {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px 6px 0;
    border-bottom: 1px solid var(--op-sep);
}
.op-row:last-child .op-row-main { border-bottom: 0; }
.op-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.op-row-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-row-sub { font-size: 12px; color: var(--op-text-2); }
.op-row-value { font-size: 14px; color: var(--op-text-2); font-family: var(--op-rounded); font-variant-numeric: tabular-nums; white-space: nowrap; }
.op-row-value.is-green { color: var(--op-green); }
.op-chev { color: var(--op-text-3); display: flex; }
.op-row.is-selected .op-row-title { font-weight: 600; }
.op-row.is-selected .op-chev { color: var(--op-green); }
.op-dot { width: 14px; height: 14px; border-radius: 7px; box-shadow: 0 0 0 1px rgba(0,0,0,.2); flex: none; background: var(--op-fill); }
.op-badge {
    width: 24px; height: 24px; border-radius: 12px; background: var(--op-fill); color: var(--op-text);
    font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none;
}
.op-badge.is-green { background: var(--op-green-fill); color: var(--op-on-green); }
.op-empty { padding: 12px 14px; font-size: 14px; color: var(--op-text-2); }

/* Stepper (− value +), as in iOS. */
.op-stepper { display: flex; align-items: center; height: 28px; border-radius: 8px; background: var(--op-fill); flex: none; }
.op-stepper button {
    width: 38px; height: 28px; border: 0; background: none; font-size: 19px; line-height: 28px; color: var(--op-text);
    cursor: pointer; padding: 0; font-family: var(--op-font);
}
.op-stepper button:disabled { color: var(--op-text-3); cursor: default; }
.op-stepper i { width: 1px; height: 16px; background: var(--op-sep); }
.op-stepval { font-size: 15px; font-weight: 600; font-family: var(--op-rounded); font-variant-numeric: tabular-nums; min-width: 1.5rem; text-align: right; }

/* Hole header and yardages. */
.op-holehead { padding: 14px 16px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.op-roundbtn {
    width: 32px; height: 32px; border-radius: 16px; background: var(--op-fill); border: 0; color: var(--op-text);
    display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; padding: 0;
}
.op-roundbtn:disabled { color: var(--op-text-3); cursor: default; }
.op-holehead-mid { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
.op-holehead-title { font-size: 20px; font-weight: 700; }
.op-holehead-sub { font-size: 12px; color: var(--op-text-2); }
.op-yardages { padding: 16px 16px 2px; display: flex; align-items: flex-end; font-family: var(--op-rounded); font-variant-numeric: tabular-nums; }
.op-yardages > div { flex: 1; display: flex; flex-direction: column; align-items: center; }
.op-yardages .lbl { font-size: 12px; color: var(--op-text-2); font-family: var(--op-font); }
.op-yardages .side { font-size: 28px; font-weight: 600; line-height: 1; }
.op-yardages .big { font-size: 64px; font-weight: 700; line-height: 1; }
.op-advice { text-align: center; font-size: 14px; color: var(--op-text-2); padding: 4px 16px 0; }
.op-advice b { color: var(--op-text); font-weight: 600; }

/* ── Map furniture ────────────────────────────────────────────────── */

.op-mapctl {
    position: absolute; z-index: 20; right: calc(var(--op-gap) + var(--op-inspector-w) + 14px); bottom: 72px;
    width: 40px; border-radius: 20px; display: flex; flex-direction: column; align-items: center;
}
.op-mapctl button {
    width: 40px; height: 40px; border: 0; background: none; display: flex; align-items: center; justify-content: center;
    color: var(--op-text); cursor: pointer; padding: 0;
}
.op-mapctl button.is-live { color: var(--op-blue); }
.op-mapctl i { width: 20px; height: 1px; background: var(--op-sep); }
.op-popover {
    position: absolute; z-index: 30; right: calc(var(--op-gap) + var(--op-inspector-w) + 62px); bottom: 72px;
    border-radius: 16px; padding: 6px; min-width: 190px;
}
.op-popover button {
    display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; border: 0; background: none; border-radius: 10px;
    padding: 0 10px; font: inherit; font-size: 14px; color: var(--op-text); cursor: pointer; text-align: left;
}
.op-popover button:hover { background: var(--op-fill); }
.op-popover button .op-check { margin-left: auto; color: var(--op-green); visibility: hidden; }
.op-popover button.is-on .op-check { visibility: visible; }
.op-mapnote {
    position: absolute; z-index: 20; right: calc(var(--op-gap) + var(--op-inspector-w) + 62px); bottom: 72px;
    padding: 8px 12px; border-radius: 14px; font-size: 13px; max-width: 260px;
}
.op-mapnote:empty { display: none; }
.op-mapnote.is-bad { color: var(--op-red); font-weight: 600; }

.op-strip {
    position: absolute; z-index: 20; left: var(--op-left); right: calc(var(--op-gap) + var(--op-inspector-w) + 16px); bottom: 20px;
    display: flex; justify-content: center; pointer-events: none;
}
.op-strip-inner {
    display: flex; gap: 4px; padding: 5px; border-radius: 24px; pointer-events: auto; max-width: 100%; overflow-x: auto;
    scrollbar-width: none; font-family: var(--op-rounded); font-variant-numeric: tabular-nums;
}
.op-strip-inner::-webkit-scrollbar { display: none; }
.op-strip button {
    width: 34px; height: 34px; border-radius: 17px; flex: none; border: 0; background: none; padding: 0;
    display: flex; align-items: center; justify-content: center; font: inherit; font-size: 14px; font-weight: 600;
    color: var(--op-text); cursor: pointer;
}
.op-strip button.is-todo { color: var(--op-text-2); }
.op-strip button.is-skipped { display: none; }   /* a hole the round's tee doesn't play */
.op-strip button:hover { background: var(--op-fill); }
.op-strip button.is-on { background: var(--op-green-fill); color: var(--op-on-green); }

/* The course page's preview: ‹ Full course ›, then each hole as you'd play it. */
.op-holestep { display: flex; align-items: center; height: 44px; padding: 0 4px; border-radius: 22px; flex: none; }
.op-holestep > button {
    width: 36px; height: 36px; border-radius: 18px; border: 0; padding: 0; background: none; flex: none;
    display: flex; align-items: center; justify-content: center; color: var(--op-text); cursor: pointer;
}
.op-holestep > button:hover:not(:disabled) { background: var(--op-fill); }
.op-holestep > button:disabled { opacity: .35; cursor: default; }
.op-holestep-pick { position: relative; display: flex; flex-direction: column; justify-content: center; min-width: 136px; padding: 0 6px; cursor: pointer; }
/* The hole menu is a real <select> over the title, so it works with a keyboard and a screen reader. */
.op-holestep-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font: inherit; }
.op-holestep-pick:focus-within { outline: 2px solid var(--op-blue); outline-offset: 2px; border-radius: 12px; }

/* Markers (maplibre places these). */
/* A hole number on the course book's overview: an inked disc on the tee. */
.op-holeno {
    min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; pointer-events: none;
    background: var(--bk-ink); color: var(--bk-paper); box-shadow: 0 0 0 2px var(--bk-paper);
    font: 700 11px var(--op-rounded); font-variant-numeric: tabular-nums;
}
.op-holeno.is-on { background: var(--op-green-fill); color: var(--op-on-green); box-shadow: 0 0 0 2px #fff; }
/* The flag on a green, inked on the course book (white on the rangefinder's satellite, via --rf-ink). */
.op-flag { position: relative; width: 17px; height: 32px; pointer-events: none; }
.op-flag::before { content: ""; position: absolute; left: 0; bottom: 0; width: 3px; height: 30px; background: var(--rf-ink, var(--bk-ink)); box-shadow: 0 0 3px rgba(0,0,0,.5); }
.op-flag::after { content: ""; position: absolute; left: 3px; top: 2px; width: 14px; height: 10px; background: #FF3B30; }
.op-yds { pointer-events: none; }
/* An aim point on the course page's hole preview: a plan's is yellow, and moves while the planner is open. */
.op-aim { width: 26px; height: 26px; border-radius: 13px; box-sizing: border-box; border: 3px solid var(--bk-ink); background: color-mix(in srgb, var(--bk-halo) 40%, transparent); box-shadow: 0 1px 6px rgba(0,0,0,.35); }
.op-aim.is-yours { border-color: var(--op-green); background: color-mix(in srgb, #FFD60A 55%, transparent); }
.op-aim.is-live { cursor: grab; }
/* Planning a round (as in the app): the course page's plan card and planner. */
.op-plancard { margin-top: 14px; }
.op-plancard .op-row-main { border-bottom: 0; }
.op-plancard .op-btn-row { padding: 0 14px 12px; }
.op-plancal-status { padding: 0 14px; color: var(--op-green); }
.op-plancal-status:empty { display: none; }
.op-plancal { padding: 0 14px 14px; font-size: 13px; color: var(--op-text-2); }
.op-plancal a { color: var(--op-green); font-weight: 600; text-decoration: none; }
.op-planner-fields { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.op-planfield { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 14px; }
.op-planfield > span { flex: 0 0 64px; color: var(--op-text-2); }
.op-planfield .op-field { flex: 1; min-width: 0; }
.op-planner-tools { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 18px 0; }
#plan-holes .op-row.is-selected { background: var(--op-green-tint); }
#plan-holes .op-row-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A golfer's planned rounds on the home page and the course list: today's leads, with Tee Off. */
.op-plans { display: flex; flex-direction: column; gap: 10px; }
.op-planlist { background: var(--op-card); border-radius: 18px; overflow: hidden; }
.op-planitem { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--op-sep); }
.op-planitem:last-child { border-bottom: 0; }
.op-planitem-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--op-text) !important; text-decoration: none !important; }
.op-planitem.is-today { background: var(--op-green-tint); }
.op-planitem.is-today .op-row-title { font-weight: 700; }
.op-planitem form { margin: 0; flex: none; }
.op-pin { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.op-pin-dot {
    width: 28px; height: 28px; border-radius: 50%; background: #fff; color: #248A3D; border: 3px solid #248A3D;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.35); flex: none;
}
.op-pin-dot .op-icon { width: 15px; height: 15px; }
.op-pin.is-selected .op-pin-dot { width: 36px; height: 36px; background: #248A3D; color: #fff; border-color: #fff; }
.op-pin.is-selected .op-pin-dot .op-icon { width: 17px; height: 17px; }
.op-chiplabel {
    padding: 7px 13px; border-radius: 17px; font-size: 14px; font-weight: 600; white-space: nowrap;
    font-family: var(--op-rounded); font-variant-numeric: tabular-nums; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
/* A course's own name under its club's (1.97.4): Innisbrook Golf Resort / Island */
.op-chiplabel-sub { display: block; font-size: 12px; font-weight: 500; color: var(--op-text-2); overflow: hidden; text-overflow: ellipsis; }
.op-me {
    width: 16px; height: 16px; border-radius: 8px; background: #0A84FF; border: 3px solid #fff;
    box-shadow: 0 0 0 10px rgba(10,132,255,.25); box-sizing: content-box;
}
.op-cluster {
    min-width: 34px; height: 34px; padding: 0 8px; border-radius: 17px; background: #248A3D; color: #fff; border: 3px solid #fff;
    font: 700 13px var(--op-rounded); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: pointer;
}

/* MapLibre's own furniture, moved out from under the floating panels. */
.op-stage .maplibregl-ctrl-bottom-left { left: var(--op-left); }
.op-stage .maplibregl-ctrl-bottom-right { right: calc(var(--op-gap) + var(--op-inspector-w) + 10px); }
.op-stage .maplibregl-ctrl-attrib { font-size: 11px; }

/* A map with no inspector (the course map): the controls go to the edge. */
.op-stage.no-inspector .op-mapctl { right: var(--op-gap); bottom: 40px; }
.op-stage.no-inspector .maplibregl-ctrl-bottom-right { right: 60px; }

/* ── Course list (page mode) ─────────────────────────────────────── */

.op-listpage { padding: 0 14px 0 0; display: flex; flex-direction: column; gap: 14px; }
.op-listpage .op-toolbar { padding-right: 0; }
.op-search {
    height: 48px; border-radius: 14px; background: var(--op-card); display: flex; align-items: center; gap: 10px;
    padding: 0 16px; color: var(--op-text-2); font-size: 16px; margin: 0;
}
.op-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--op-text); }
.op-search input::placeholder { color: var(--op-text-2); }
.op-search:focus-within { box-shadow: 0 0 0 2px var(--op-blue); }
.op-kbd { font-size: 12px; padding: 3px 7px; border-radius: 6px; background: var(--op-fill); font-family: var(--op-rounded); color: var(--op-text-2); }
.op-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.op-filter {
    height: 32px; padding: 0 14px; border-radius: 16px; display: inline-flex; align-items: center; font-size: 14px; font-weight: 500;
    background: var(--op-fill); color: var(--op-text) !important; text-decoration: none !important; border: 0; cursor: pointer;
}
.op-filter.is-on { background: var(--op-chip-on-bg); color: var(--op-chip-on-text) !important; }
.op-h2row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 4px 0; }
.op-h2 { font-size: 20px; font-weight: 700; margin: 0; }
/* Four across, as in the design; fewer as the window narrows. */
.op-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1180px) { .op-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .op-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .op-cards { grid-template-columns: minmax(0, 1fr); } }
.op-ccard { border-radius: 18px; background: var(--op-card); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.op-ccard-thumb { height: 118px; background: var(--op-map-bg) center/cover no-repeat; display: block; }
.op-ccard-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; }
.op-ccard-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--op-text) !important; }
.op-ccard-course { font-weight: 600; color: var(--op-text); }   /* a resort's course, under its name (1.97.4) */
.op-ccard-body > .op-row-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* one line: the cards' buttons stay level */
.op-stats { display: flex; gap: 14px; padding-top: 10px; }
.op-stats div { display: flex; flex-direction: column; }
.op-stats span { font-size: 11px; color: var(--op-text-2); }
.op-stats b { font-size: 17px; font-weight: 600; font-family: var(--op-rounded); font-variant-numeric: tabular-nums; }
.op-list { border-radius: 18px; background: var(--op-card); overflow: hidden; }
.op-lrow { display: flex; align-items: center; gap: 12px; padding-left: 14px; }
.op-lrow:hover { background: var(--op-fill); }
.op-lrow-thumb { width: 40px; height: 40px; border-radius: 10px; flex: none; background: var(--op-map-bg) center/cover no-repeat; }
.op-lrow-main {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 60px; padding-right: 14px;
    border-bottom: 1px solid var(--op-sep);
}
.op-lrow:last-child .op-lrow-main { border-bottom: 0; }
.op-lrow-link {
    flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; gap: 16px;
    color: var(--op-text) !important; text-decoration: none !important;
}
.op-lrow-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-lrow-spec { width: 170px; flex: none; font-size: 14px; color: var(--op-text-2); font-family: var(--op-rounded); font-variant-numeric: tabular-nums; }
.op-lrow-dist { width: 64px; flex: none; text-align: right; font-size: 14px; color: var(--op-text-2); font-family: var(--op-rounded); font-variant-numeric: tabular-nums; }
.op-star {
    width: 32px; height: 32px; border: 0; background: none; padding: 0; display: flex; align-items: center; justify-content: center;
    color: var(--op-text-3); cursor: pointer; flex: none; border-radius: 16px;
}
.op-star svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linejoin: round; }
.op-star[aria-pressed="true"] { color: var(--op-star); }
.op-star[aria-pressed="true"] svg { fill: currentColor; }
.op-star:hover { background: var(--op-fill); }
.op-notice { border-radius: 14px; background: var(--op-card); padding: 12px 16px; font-size: 14px; color: var(--op-text-2); display: flex; gap: 10px; align-items: center; }
.op-pager { display: flex; justify-content: center; gap: 8px; padding: 6px 0 12px; }
.op-pager .op-filter.is-disabled { opacity: .4; pointer-events: none; }

/* ── Sign-in: the card centred on the course illustration ────────── */

.op-main:has(> .op-auth) { padding-bottom: var(--op-gap); }
.op-auth {
    min-height: calc(100vh - 2 * var(--op-gap));
    min-height: calc(100dvh - 2 * var(--op-gap));
    border-radius: 22px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; padding: 40px 16px;
    background:
        linear-gradient(180deg, rgba(8,32,22,.45), rgba(8,32,22,.6)),
        var(--op-map-bg) url('../img/home-hero.webp') center/cover no-repeat;
}
.op-auth-card { width: 100%; max-width: 26rem; padding: 32px 28px 28px; text-align: left; }
.op-auth-logo { display: block; height: 64px; width: auto; margin: 0 auto 18px; filter: var(--op-logo-filter); }
.op-auth-card h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; text-align: center; margin: 0 0 8px; color: var(--op-text); }
.op-auth-lead { font-size: 15px; color: var(--op-text-2); text-align: center; margin: 0 0 22px; line-height: 1.45; }
.op-auth-lead strong { color: var(--op-text); }
.op-auth-card label { display: block; font-size: 13px; font-weight: 600; color: var(--op-text-2); margin: 0 0 6px; }
.op-field {
    display: block; width: 100%; height: 50px; border-radius: 14px; border: 1px solid var(--op-sep);
    background: var(--op-card-raised); color: var(--op-text); padding: 0 16px; font: inherit; font-size: 17px; outline: 0;
}
.op-field::placeholder { color: var(--op-text-3); }
.op-field:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--op-blue) 35%, transparent); border-color: var(--op-blue); }
.op-field.is-invalid { border-color: var(--op-red); }
.op-field.is-code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 26px; letter-spacing: .35em; text-align: center; }
.op-field-error { color: var(--op-red); font-size: 13px; margin-top: 6px; }
.op-auth-note { font-size: 13px; color: var(--op-text-2); text-align: center; margin: 20px 0 0; line-height: 1.45; }
.op-auth-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; font-size: 14px; }
.op-auth-card.is-wide { max-width: 34rem; }
/* Data & licences (1.69.0): a page of prose in the auth card. */
.op-data h2 { font-size: 18px; font-weight: 700; color: var(--op-text); margin: 26px 0 8px; }
.op-data h3 { font-size: 15px; font-weight: 600; color: var(--op-text); margin: 18px 0 6px; }
.op-data p, .op-data li { font-size: 14px; line-height: 1.5; color: var(--op-text-2); }
.op-data p { margin: 0 0 10px; }
.op-data .op-btn { display: inline-flex; gap: 8px; align-items: center; margin: 4px 0 10px; }
.op-data-notice { padding: 10px 12px; border-radius: 12px; background: var(--op-fill); color: var(--op-text) !important; }
.op-data-meta { font-size: 12px !important; color: var(--op-text-3) !important; overflow-wrap: anywhere; }
.op-data-list { padding-left: 18px; margin: 0 0 10px; }
.op-foot-link { display: block; padding: 10px 4px 0; font-size: 12px; color: var(--op-text-3) !important; }
.op-auth-done { background: var(--op-green-tint); color: var(--op-green); border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 500; margin: 0 0 18px; }
.op-form { display: flex; flex-direction: column; gap: 14px; }
.op-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.op-optional { font-weight: 400; color: var(--op-text-3); }
.op-field.is-area { height: auto; padding: 12px 16px; font-size: 15px; resize: vertical; min-height: 84px; }
select.op-field { appearance: auto; }
/* The honeypot: out of sight and out of the tab order, but in the form. */
.op-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 560px) { .op-form-row { grid-template-columns: 1fr; } }
.op-field.is-small { height: 40px; border-radius: 10px; font-size: 14px; padding: 0 12px; background: var(--op-bg); }
.op-field.is-area.is-small { height: auto; min-height: 60px; padding: 8px 12px; }
.op-infoform { padding: 12px 14px 14px; gap: 10px; }

/* An unmapped course's page, while its holes are fetched from OpenStreetMap. */
.op-mapstate { margin: 12px 18px 0; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--op-text-2); }
.op-mapstate-spin {
    width: 14px; height: 14px; flex: none; margin-top: 2px; border-radius: 50%;
    border: 2px solid var(--op-green-tint); border-top-color: var(--op-green); display: none;
}
.op-mapstate[data-state="none"] .op-mapstate-spin, .op-mapstate[data-state="queued"] .op-mapstate-spin { display: block; animation: op-spin .9s linear infinite; }
@keyframes op-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .op-mapstate-spin, .op-mapping-spin { animation: none !important; } }
/* An unmapped course being drawn: a card in the middle of the map you can see, so the wait is plain. */
.op-mapping {
    position: absolute; z-index: 22; top: 0; bottom: 0;
    left: var(--op-left); right: calc(var(--op-gap) + var(--op-inspector-w) + 16px);
    display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.op-mapping-card { position: relative; pointer-events: auto; width: min(340px, 100%); padding: 22px 24px 18px; border-radius: 16px; text-align: center; }
.op-mapping-close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; }
.op-mapping-retry { margin-top: 14px; }
.op-mapping-spin {
    width: 34px; height: 34px; margin: 0 auto 12px; border-radius: 50%;
    border: 3px solid var(--op-green-tint); border-top-color: var(--op-green); animation: op-spin .9s linear infinite;
}
.op-mapping[data-state="not_found"] .op-mapping-spin, .op-mapping[data-state="unavailable"] .op-mapping-spin, .op-mapping[data-state="own"] .op-mapping-spin,
.op-mapping[data-state="waiting"] .op-mapping-spin { display: none; }
.op-mapping-title { font-size: 17px; font-weight: 700; color: var(--op-text); }
.op-mapping-sub { font-size: 13px; line-height: 1.45; color: var(--op-text-2); margin-top: 6px; }
.op-mapping-time { font-size: 12px; color: var(--op-text-2); margin-top: 10px; font-variant-numeric: tabular-nums; }
.op-mapping-time:empty { display: none; }
@media (max-width: 900px) { .op-mapping { left: 12px; right: 12px; bottom: auto; height: var(--op-maph); } }
.op-auth-links form { margin: 0; }
@media (max-width: 900px) {
    .op-auth { min-height: calc(100vh - 70px); min-height: calc(100dvh - 70px); padding: 24px 12px; }
    .op-auth-card { padding: 26px 20px 22px; }
}

/* ── Account ─────────────────────────────────────────────────────── */

.op-account-page { max-width: 44rem; }
.op-account-hero { display: flex; align-items: center; gap: 14px; padding: 16px; }
.op-avatar-lg { width: 48px; height: 48px; border-radius: 24px; font-size: 18px; }
.op-account-hero-name { font-size: 17px; font-weight: 600; }
.op-account-label { font-size: 15px; margin: 6px 4px -6px; color: var(--op-text-2); font-weight: 600; }
.op-account-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; }
.op-account-form .op-field { flex: 1; min-width: 12rem; }
.op-account-danger { padding: 0; }
.op-account-danger summary { padding: 14px 16px; cursor: pointer; font-size: 15px; color: var(--op-red); list-style: none; }
.op-account-danger summary::-webkit-details-marker { display: none; }
.op-account-danger form { padding: 0 16px 16px; }
.op-btn-danger { background: var(--op-red); color: #fff !important; }
/* A destructive action that isn't the page's main one (Delete round): red on a red tint. */
.op-btn-danger-tint { background: var(--op-red-tint); color: var(--op-red) !important; }

/* ── Modal (Round Complete) ───────────────────────────────────────── */

/* Fixed, and moved to <body> when it opens: the stage is position:fixed, a stacking context the sidebar sits above. */
.op-modal-wrap { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding: 80px 16px 16px; overflow-y: auto; }
.op-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.38); }
.op-modal {
    position: relative; width: 980px; max-width: 100%; border-radius: 26px; background: var(--op-modal);
    box-shadow: 0 24px 70px rgba(0,0,0,.4); overflow: hidden; color: var(--op-text);
}
.op-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 6px; }
.op-modal-head .op-roundbtn { width: 32px; height: 32px; }
.op-modal-title { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.op-modal-title b { font-size: 17px; font-weight: 700; }
.op-modal-title span { font-size: 13px; color: var(--op-text-2); }
.op-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; padding: 14px 22px 0; }
.op-tile { border-radius: 16px; background: var(--op-card-raised); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.op-tile span { font-size: 12px; color: var(--op-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-tile b { font-size: 26px; font-weight: 700; font-family: var(--op-rounded); font-variant-numeric: tabular-nums; line-height: 1.2; }
.op-card9 { margin: 14px 22px 0; border-radius: 18px; background: var(--op-card-raised); overflow: hidden; }
.op-card9 + .op-card9 { margin-top: 12px; }
.op-card9-row { display: flex; }
.op-card9-row + .op-card9-row { border-top: 1px solid var(--op-sep); }
.op-card9-row > * {
    flex: 1; height: 44px; display: flex; align-items: center; justify-content: center; min-width: 0;
    font-size: 15px; font-family: var(--op-rounded); font-variant-numeric: tabular-nums; color: var(--op-text-2);
}
.op-card9-row > .lbl { width: 90px; flex: none; justify-content: flex-start; padding-left: 16px; font-size: 14px; font-family: var(--op-font); }
.op-card9-row.is-head > * { font-weight: 600; }
.op-card9-row.is-you > * { color: var(--op-text); }
.op-card9-row.is-you > .lbl { font-weight: 600; }
.op-card9-row .tot { font-weight: 700; color: var(--op-text); }
.op-card9-row.is-head .tot { font-weight: 600; }
.op-card9-row button { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
/* The course page's scorecard: the same card, small enough for the inspector. */
.op-card9.is-compact { margin: 0 14px; }
.op-card9.is-compact + .op-card9.is-compact { margin-top: 8px; }
.op-card9.is-compact .op-card9-row > * { height: 30px; font-size: 13px; }
.op-card9.is-compact .op-card9-row > .lbl {
    width: 56px; padding: 0 6px 0 12px; font-size: 12px; display: block; line-height: 30px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Birdies circled, bogeys boxed; two rings or two boxes for anything further out. */
.op-sc {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 600; font-family: var(--op-rounded); font-variant-numeric: tabular-nums; color: var(--op-text);
}
.op-sc.is-birdie { border-radius: 16px; border: 2px solid var(--op-green); }
.op-sc.is-eagle { border-radius: 16px; border: 2px solid var(--op-green); box-shadow: 0 0 0 2px var(--op-card-raised), 0 0 0 4px var(--op-green); }
.op-sc.is-bogey { border-radius: 5px; border: 2px solid var(--op-text-2); }
.op-sc.is-double { border-radius: 5px; border: 2px solid var(--op-text-2); box-shadow: 0 0 0 2px var(--op-card-raised), 0 0 0 4px var(--op-text-2); }
.op-sc.is-empty { color: var(--op-text-3); }
.op-sc.is-now { background: var(--op-green-tint); border-radius: 8px; }
.op-modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 18px 22px 22px; flex-wrap: wrap; }
.op-modal-foot .op-note { margin-right: auto; font-size: 14px; color: var(--op-text-2); }

/* ── Smaller windows ──────────────────────────────────────────────── */

@media (max-width: 1180px) {
    :root { --op-inspector-w: 320px; --op-sidebar-w: 232px; }
    .op-yardages .big { font-size: 56px; }
}

/*
 * Phones and narrow windows: the sidebar becomes a drawer behind a menu
 * button, and a canvas page stacks — the map on top, the inspector under it,
 * the page scrolling — so the rangefinder still works one-handed on a course.
 */
@media (max-width: 900px) {
    :root { --op-left: 60px; --op-inspector-w: 0px; }
    .op-sidebar { display: none; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
    html.op-drawer .op-sidebar { display: flex; }
    html.op-drawer .op-scrim { display: block; }
    button.op-menu-btn { display: flex; }
    html.op-drawer button.op-menu-btn { display: none; }
    .op-main, html.op-collapsed .op-main { margin-left: 0; padding: 60px 10px 40px; }
    .op-canvas .op-main { padding: 0; }
    html.op-collapsed .op-sidebar { display: none; }
    html.op-collapsed.op-drawer .op-sidebar { display: flex; }

    /* The map is the top --op-maph of the page; what floats on it is placed from its top. */
    :root { --op-maph: max(58vh, 320px); }
    .op-stage { position: relative; inset: auto; overflow: visible; background: var(--op-bg); min-height: 100vh; }
    .op-stage.no-inspector { position: fixed; inset: 0; min-height: 0; }
    .op-mapwrap { position: relative; height: var(--op-maph); overflow: hidden; background: var(--op-map-bg); }
    .op-stage.no-inspector .op-mapwrap { position: absolute; inset: 0; height: auto; }
    .op-inspector {
        position: relative; right: auto; top: auto; bottom: auto; width: auto; margin: 10px;
        overflow: visible; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--op-card); box-shadow: none; border: 0;
    }
    .op-inspector-body { overflow: visible; }
    .op-inspector .op-group { background: var(--op-bg); }
    .op-mapctl { right: var(--op-gap); bottom: auto; top: calc(var(--op-maph) - 150px); }
    /* No room beside the title and the toggle: the preview is a row of its own under them. */
    .op-stage .op-holestep { position: absolute; top: 54px; left: calc(var(--op-gap) - var(--op-left)); right: 0; }
    .op-holestep-pick { flex: 1; align-items: center; }
    .op-popover { right: 60px; bottom: auto; top: 60px; }
    .op-mapnote { right: auto; left: var(--op-gap); bottom: auto; top: 60px; }
    .op-strip { left: var(--op-gap); right: var(--op-gap); bottom: auto; top: calc(var(--op-maph) - 56px); }
    .op-stage.no-inspector .op-mapctl { top: auto; bottom: 40px; }
    .op-stage.no-inspector .op-inspector { position: absolute; left: var(--op-gap); right: var(--op-gap); top: auto; bottom: var(--op-gap); margin: 0; box-shadow: var(--op-panel-shadow); }
    /* The map is a third of the screen: the course's own name is in the panel just under it,
       and its neighbours' are smaller, so the labels don't lie across the drawing. */
    .op-pin.is-selected .op-chiplabel { display: none; }
    .op-pin .op-chiplabel { max-width: 150px; padding: 5px 10px; font-size: 12px; }
    .op-pin .op-chiplabel-sub { font-size: 11px; }
    .op-stage .maplibregl-ctrl-bottom-right { right: 0; }
    .op-stage .maplibregl-ctrl-bottom-left { left: 0; }
    .op-modal-wrap { padding-top: 20px; }
    .op-lrow-spec { display: none; }
    .op-yardages .big { font-size: 56px; }
    .op-card9-row > .lbl { width: 52px; padding-left: 10px; }
    .op-card9-row > * { font-size: 13px; }
    .op-sc { width: 26px; height: 26px; font-size: 13px; }
    .op-tiles { padding: 12px 14px 0; gap: 8px; }
    .op-card9 { margin: 12px 14px 0; }
    .op-modal-head, .op-modal-foot { padding-left: 14px; padding-right: 14px; }
}

@media (prefers-reduced-motion: no-preference) {
    .op-btn, .op-filter, .op-strip button, .op-nav a { transition: background-color .15s ease, color .15s ease; }
}
