/* Liquid glass (Graphite): loaded after app.css and coach.css. A graphite
   gradient behind everything, and every button, field and card on the .cx
   screens (Home, New Round, History, Settings, My Bag, Coaching, Practice...)
   is frosted glass: 5% white fill, an edge that glows top and bottom and fades
   at the sides, and the same 8px blur as the GPS screen's map buttons (the
   GPS screen itself, .holeview, keeps its own look). Selected is solid blue.
   Many of these elements carry inline colours, hence the !important. */
:root {
  --glass-fill: rgba(255,255,255,.05);
  --glass-edge: .10;
  --glass-blur: blur(8px) saturate(180%);
  --glass-on: #3D8BF2;
  --mac-blue: #0A84FF; --mac-green: #30D158; --mac-yellow: #FFD60A; --mac-red: #FF453A;
}
/* Also the colour of the strip down the right side of phones that keep one for the clock
   (and what shows on an overscroll): as near black as can be, nearly off on an OLED
   screen. Not pure #000: with that the phone seemed to draw the strip as a solid edge,
   and a swiped screen no longer slid over it. */
html { background: #030303; }
body, body.coach { background: linear-gradient(180deg, #2c2c2e 0%, #232325 45%, #1a1a1c 100%) !important; }
.cx, .cx.coachroot, .coachroot .page { background: transparent !important; }

/* Buttons */
.cx button:not(.linkbtn):not(.link):not(.glass-skip) {
  background: var(--glass-fill) !important;
  border: 0 !important;
  border-radius: 22px !important;
  box-shadow: inset 0 1.5px 2px rgba(255,255,255,calc(var(--glass-edge) * 1.4)),
              inset 0 -1.5px 2px rgba(255,255,255,calc(var(--glass-edge) * .9)),
              0 2px 10px rgba(0,0,0,.35) !important;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
/* For the edge ring; zero specificity, so any rule or inline style that places a button wins. */
:where(.cx button) { position: relative; }
:where(.cx) button:where(:not(.linkbtn):not(.link):not(.glass-skip))::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255,255,255,calc(var(--glass-edge) * 4)) 0%,
    rgba(255,255,255,calc(var(--glass-edge) * .25)) 30%,
    rgba(255,255,255,calc(var(--glass-edge) * .25)) 70%,
    rgba(255,255,255,calc(var(--glass-edge) * 2.6)) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
/* Round icon buttons */
.cx .iconbtn, .cx .back-btn-top, .cx button.back-btn { border-radius: 50% !important; }

/* Selected: solid blue. Toggles mark the picked one with a class, aria-pressed,
   or an inline blue background (#2d7abc). */
.cx button.selected:not(.linkbtn):not(.link):not(.glass-skip),
.cx button.on:not(.linkbtn):not(.link):not(.glass-skip),
.cx button[aria-pressed="true"]:not(.linkbtn):not(.link):not(.glass-skip),
.cx button:not(.homebtn):not(.linkbtn):not(.link):not(.glass-skip)[style*="background:#2d7abc"],
.cx button:not(.homebtn):not(.linkbtn):not(.link):not(.glass-skip)[style*="background: rgb(45, 122, 188)"],
.cx button:not(.homebtn):not(.linkbtn):not(.link):not(.glass-skip)[style*="background-color: rgb(45, 122, 188)"] {
  background: var(--glass-on) !important; color: #fff !important;
  box-shadow: inset 0 1.5px 2px rgba(255,255,255,.35), 0 2px 10px rgba(0,0,0,.3) !important;
}
.cx button.selected::before, .cx button.on::before, .cx button[aria-pressed="true"]::before,
.cx button[style*="background:#2d7abc"]::before, .cx button[style*="rgb(45, 122, 188)"]::before {
  background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,.1) 35%, rgba(255,255,255,.1) 65%, rgba(255,255,255,.4)) !important;
}
.cx button.selected small, .cx button.on small { color: rgba(255,255,255,.85) !important; }
/* Toggles that mark the picked one green (#00b87a / #007a52) and the others grey
   text: the picked one is solid blue too. Unpicked grey text (#606060) is lifted
   so it doesn't look switched off. */
.cx :has(> button:is([style*="color:#606060"], [style*="color: rgb(96, 96, 96)"])) > button:not(.linkbtn):not(.link):not(.glass-skip):is([style*="background:#00b87a"], [style*="background: rgb(0, 184, 122)"], [style*="background:#007a52"], [style*="background: rgb(0, 122, 82)"]) {
  background: var(--glass-on) !important; color: #fff !important;
  box-shadow: inset 0 1.5px 2px rgba(255,255,255,.35), 0 2px 10px rgba(0,0,0,.3) !important;
}
.cx button:not(:disabled):is([style*="color:#606060"], [style*="color: rgb(96, 96, 96)"]) { color: #a8a8ad !important; }
/* How Far Should I Hit It?: the picked tab is blue like every other. */
.cx :is(button, div).dg-tab.dg-tab-active:not(.linkbtn):not(.link):not(.glass-skip) { background: var(--glass-on) !important; color: #fff !important; }

/* Home: each button's colour moves to its icon, in the macOS palette. */
.cx .homebtn[style*="#1a4a8a"] .ic, .cx .homebtn[style*="#2d7abc"] .ic { color: var(--mac-blue); }
.cx .homebtn[style*="#007a52"] .ic, .cx .homebtn[style*="#00402c"] .ic { color: var(--mac-green); }
.cx .homebtn[style*="#d49a10"] .ic { color: var(--mac-yellow); }

/* Fields */
.cx input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),
.cx select, .cx textarea {
  background: var(--glass-fill) !important;
  border: 1px solid rgba(255,255,255,var(--glass-edge)) !important;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.cx input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), .cx select { border-radius: 22px !important; }
.cx select option { background: #2c2c2e; color: #fff; }

/* Cards and panels (solid greys inline): a frosted graphite pane. */
.cx div[style*="background:#222"], .cx div[style*="background:#282828"], .cx div[style*="background:#333"],
.cx .card {
  background: rgba(58,58,60,.38) !important;
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
}
/* Panels and tiles: the same glass as the buttons (fill, glowing edge, soft shadow,
   round corners). Matched by their inline background, as written or as the browser
   rewrites it once the app shows or hides them. Bars, avatars, dropdowns and pop-up
   boxes keep the frosted pane above; a panel inside a panel is a light inset. */
.cx :is(div[style*="background:#222"], div[style*="background: rgb(34, 34, 34)"], div[style*="background:#282828"], div[style*="background: rgb(40, 40, 40)"], div[style*="background:#333"], div[style*="background: rgb(51, 51, 51)"], div[style*="background:#1a4a8a"][style*="padding"], div[style*="background: rgb(26, 74, 138)"][style*="padding"], div[style*="background:#00402c"][style*="padding"], div[style*="background: rgb(0, 64, 44)"][style*="padding"], div[style*="background:#0a3020"][style*="padding"], div[style*="background: rgb(10, 48, 32)"][style*="padding"], div[style*="background:#1e1e1e"][style*="border:1px"][style*="padding"], div[style*="background: rgb(30, 30, 30)"][style*="border: 1px"][style*="padding"], a[style*="background:#1e1e1e"][style*="border"], :is(#performanceAnalysisPage, #studentViewPage) div:is([style*="#3a1515"], [style*="rgb(58, 21, 21)"], [style*="#2a2508"], [style*="rgb(42, 37, 8)"], [style*="#2a1510"], [style*="rgb(42, 21, 16)"])[style*="padding"], .card, .stat, .setupcard, .savedbook, .markereditor, .dg-stat-box, .bo-results):not([style*=";height:"]):not([style*="; height:"]):not([style^="height:"]):not([style*="position:absolute"]):not([style*="position: absolute"]):not([style*="position:fixed"]):not([style*="position: fixed"]):not([style*="box-shadow"]):not([style*="border-radius:50%"]):not([style*="border-radius: 50%"]):not(:has(> button + button)) {
  position: relative; background: var(--glass-fill) !important; border: 0 !important; border-radius: 22px !important;
  box-shadow: inset 0 1.5px 2px rgba(255,255,255,calc(var(--glass-edge) * 1.4)),
              inset 0 -1.5px 2px rgba(255,255,255,calc(var(--glass-edge) * .9)),
              0 2px 10px rgba(0,0,0,.35) !important;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.cx :is(div[style*="background:#222"], div[style*="background: rgb(34, 34, 34)"], div[style*="background:#282828"], div[style*="background: rgb(40, 40, 40)"], div[style*="background:#333"], div[style*="background: rgb(51, 51, 51)"], div[style*="background:#1a4a8a"][style*="padding"], div[style*="background: rgb(26, 74, 138)"][style*="padding"], div[style*="background:#00402c"][style*="padding"], div[style*="background: rgb(0, 64, 44)"][style*="padding"], div[style*="background:#0a3020"][style*="padding"], div[style*="background: rgb(10, 48, 32)"][style*="padding"], div[style*="background:#1e1e1e"][style*="border:1px"][style*="padding"], div[style*="background: rgb(30, 30, 30)"][style*="border: 1px"][style*="padding"], a[style*="background:#1e1e1e"][style*="border"], :is(#performanceAnalysisPage, #studentViewPage) div:is([style*="#3a1515"], [style*="rgb(58, 21, 21)"], [style*="#2a2508"], [style*="rgb(42, 37, 8)"], [style*="#2a1510"], [style*="rgb(42, 21, 16)"])[style*="padding"], .card, .stat, .setupcard, .savedbook, .markereditor, .dg-stat-box, .bo-results):not([style*=";height:"]):not([style*="; height:"]):not([style^="height:"]):not([style*="position:absolute"]):not([style*="position: absolute"]):not([style*="position:fixed"]):not([style*="position: fixed"]):not([style*="box-shadow"]):not([style*="border-radius:50%"]):not([style*="border-radius: 50%"]):not(:has(> button + button))::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255,255,255,calc(var(--glass-edge) * 4)) 0%,
    rgba(255,255,255,calc(var(--glass-edge) * .25)) 30%,
    rgba(255,255,255,calc(var(--glass-edge) * .25)) 70%,
    rgba(255,255,255,calc(var(--glass-edge) * 2.6)) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
:is(.cx :is(div[style*="background:#222"], div[style*="background: rgb(34, 34, 34)"], div[style*="background:#282828"], div[style*="background: rgb(40, 40, 40)"], div[style*="background:#333"], div[style*="background: rgb(51, 51, 51)"], div[style*="background:#1a4a8a"][style*="padding"], div[style*="background: rgb(26, 74, 138)"][style*="padding"], div[style*="background:#00402c"][style*="padding"], div[style*="background: rgb(0, 64, 44)"][style*="padding"], div[style*="background:#0a3020"][style*="padding"], div[style*="background: rgb(10, 48, 32)"][style*="padding"], div[style*="background:#1e1e1e"][style*="border:1px"][style*="padding"], div[style*="background: rgb(30, 30, 30)"][style*="border: 1px"][style*="padding"], a[style*="background:#1e1e1e"][style*="border"], :is(#performanceAnalysisPage, #studentViewPage) div:is([style*="#3a1515"], [style*="rgb(58, 21, 21)"], [style*="#2a2508"], [style*="rgb(42, 37, 8)"], [style*="#2a1510"], [style*="rgb(42, 21, 16)"])[style*="padding"], .card, .stat, .setupcard, .savedbook, .markereditor, .dg-stat-box, .bo-results):not([style*=";height:"]):not([style*="; height:"]):not([style^="height:"]):not([style*="position:absolute"]):not([style*="position: absolute"]):not([style*="position:fixed"]):not([style*="position: fixed"]):not([style*="box-shadow"]):not([style*="border-radius:50%"]):not([style*="border-radius: 50%"]):not(:has(> button + button)), .cx .glasstile, .cx .comb-hist-card) :is(div[style*="background:#222"], div[style*="background: rgb(34, 34, 34)"], div[style*="background:#282828"], div[style*="background: rgb(40, 40, 40)"], div[style*="background:#333"], div[style*="background: rgb(51, 51, 51)"], div[style*="background:#1a4a8a"][style*="padding"], div[style*="background: rgb(26, 74, 138)"][style*="padding"], div[style*="background:#00402c"][style*="padding"], div[style*="background: rgb(0, 64, 44)"][style*="padding"], div[style*="background:#0a3020"][style*="padding"], div[style*="background: rgb(10, 48, 32)"][style*="padding"], div[style*="background:#1e1e1e"][style*="border:1px"][style*="padding"], div[style*="background: rgb(30, 30, 30)"][style*="border: 1px"][style*="padding"], a[style*="background:#1e1e1e"][style*="border"], :is(#performanceAnalysisPage, #studentViewPage) div:is([style*="#3a1515"], [style*="rgb(58, 21, 21)"], [style*="#2a2508"], [style*="rgb(42, 37, 8)"], [style*="#2a1510"], [style*="rgb(42, 21, 16)"])[style*="padding"], .card, .stat, .setupcard, .savedbook, .markereditor, .dg-stat-box, .bo-results):not([style*=";height:"]):not([style*="; height:"]):not([style^="height:"]):not([style*="position:absolute"]):not([style*="position: absolute"]):not([style*="position:fixed"]):not([style*="position: fixed"]):not([style*="box-shadow"]):not([style*="border-radius:50%"]):not([style*="border-radius: 50%"]):not(:has(> button + button)) {
  background: rgba(255,255,255,.04) !important; border-radius: 14px !important; box-shadow: none !important;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
:is(.cx :is(div[style*="background:#222"], div[style*="background: rgb(34, 34, 34)"], div[style*="background:#282828"], div[style*="background: rgb(40, 40, 40)"], div[style*="background:#333"], div[style*="background: rgb(51, 51, 51)"], div[style*="background:#1a4a8a"][style*="padding"], div[style*="background: rgb(26, 74, 138)"][style*="padding"], div[style*="background:#00402c"][style*="padding"], div[style*="background: rgb(0, 64, 44)"][style*="padding"], div[style*="background:#0a3020"][style*="padding"], div[style*="background: rgb(10, 48, 32)"][style*="padding"], div[style*="background:#1e1e1e"][style*="border:1px"][style*="padding"], div[style*="background: rgb(30, 30, 30)"][style*="border: 1px"][style*="padding"], a[style*="background:#1e1e1e"][style*="border"], :is(#performanceAnalysisPage, #studentViewPage) div:is([style*="#3a1515"], [style*="rgb(58, 21, 21)"], [style*="#2a2508"], [style*="rgb(42, 37, 8)"], [style*="#2a1510"], [style*="rgb(42, 21, 16)"])[style*="padding"], .card, .stat, .setupcard, .savedbook, .markereditor, .dg-stat-box, .bo-results):not([style*=";height:"]):not([style*="; height:"]):not([style^="height:"]):not([style*="position:absolute"]):not([style*="position: absolute"]):not([style*="position:fixed"]):not([style*="position: fixed"]):not([style*="box-shadow"]):not([style*="border-radius:50%"]):not([style*="border-radius: 50%"]):not(:has(> button + button)), .cx .glasstile, .cx .comb-hist-card) :is(div[style*="background:#222"], div[style*="background: rgb(34, 34, 34)"], div[style*="background:#282828"], div[style*="background: rgb(40, 40, 40)"], div[style*="background:#333"], div[style*="background: rgb(51, 51, 51)"], div[style*="background:#1a4a8a"][style*="padding"], div[style*="background: rgb(26, 74, 138)"][style*="padding"], div[style*="background:#00402c"][style*="padding"], div[style*="background: rgb(0, 64, 44)"][style*="padding"], div[style*="background:#0a3020"][style*="padding"], div[style*="background: rgb(10, 48, 32)"][style*="padding"], div[style*="background:#1e1e1e"][style*="border:1px"][style*="padding"], div[style*="background: rgb(30, 30, 30)"][style*="border: 1px"][style*="padding"], a[style*="background:#1e1e1e"][style*="border"], :is(#performanceAnalysisPage, #studentViewPage) div:is([style*="#3a1515"], [style*="rgb(58, 21, 21)"], [style*="#2a2508"], [style*="rgb(42, 37, 8)"], [style*="#2a1510"], [style*="rgb(42, 21, 16)"])[style*="padding"], .card, .stat, .setupcard, .savedbook, .markereditor, .dg-stat-box, .bo-results):not([style*=";height:"]):not([style*="; height:"]):not([style^="height:"]):not([style*="position:absolute"]):not([style*="position: absolute"]):not([style*="position:fixed"]):not([style*="position: fixed"]):not([style*="box-shadow"]):not([style*="border-radius:50%"]):not([style*="border-radius: 50%"]):not(:has(> button + button))::before { display: none; }
/* Pickers: glass pills like the buttons, text centred. */
.cx select {
  -webkit-appearance: none; appearance: none; text-align: center; text-align-last: center;
  box-shadow: inset 0 1.5px 2px rgba(255,255,255,calc(var(--glass-edge) * 1.4)),
              inset 0 -1.5px 2px rgba(255,255,255,calc(var(--glass-edge) * .9)),
              0 2px 10px rgba(0,0,0,.35) !important;
}
/* Small tags (Block, Random, library topics): pills. */
.cx span[style*="padding:2px"][style*="border-radius"] { border-radius: 999px !important; }

/* Rows painted the old page colour: toggle groups lose their backing (no bubble behind the bubbles). */
.cx div[style*="background:#1e1e1e"] { background: transparent !important; }
/* Sticky tab bars (My Bag's tabs): no band and no box behind the tabs, just the glass buttons. */
.cx div[style*="sticky"][style*="background:#1e1e1e"] > div {
  background: transparent !important; border: 0 !important; overflow: visible !important; gap: 6px;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}

/* The course search's results are a plain list, not a stack of bubbles. */
.cx .courseresults button:not(.linkbtn):not(.link):not(.glass-skip),
.cx .courseresults button.on:not(.linkbtn):not(.link):not(.glass-skip) {
  background: transparent !important; border: 0 !important; border-bottom: 1px solid #2c2c2c !important;
  border-radius: 0 !important; box-shadow: none !important; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.cx .courseresults button.on:not(.linkbtn):not(.link):not(.glass-skip) { background: rgba(61,139,242,.25) !important; }
.cx .courseresults button::before { display: none; }

/* Performance Analysis (and a player's, in Coaching): good / bad tinted cards
   become plain glass panes; only the numbers and labels keep their green or red. */
:is(#performanceAnalysisPage, #studentViewPage) [style*="#0a3020"],
:is(#performanceAnalysisPage, #studentViewPage) [style*="rgb(10, 48, 32)"],
:is(#performanceAnalysisPage, #studentViewPage) [style*="#0a3a20"],
:is(#performanceAnalysisPage, #studentViewPage) [style*="rgb(10, 58, 32)"],
:is(#performanceAnalysisPage, #studentViewPage) [style*="#3a1515"],
:is(#performanceAnalysisPage, #studentViewPage) [style*="rgb(58, 21, 21)"],
:is(#performanceAnalysisPage, #studentViewPage) [style*="#3d1515"],
:is(#performanceAnalysisPage, #studentViewPage) [style*="rgb(61, 21, 21)"],
:is(#performanceAnalysisPage, #studentViewPage) [style*="#2a2508"],
:is(#performanceAnalysisPage, #studentViewPage) [style*="rgb(42, 37, 8)"],
:is(#performanceAnalysisPage, #studentViewPage) [style*="#2a1510"],
:is(#performanceAnalysisPage, #studentViewPage) [style*="rgb(42, 21, 16)"],
:is(#performanceAnalysisPage, #studentViewPage) [style*="#3a3010"],
:is(#performanceAnalysisPage, #studentViewPage) [style*="rgb(58, 48, 16)"] {
  background: rgba(58,58,60,.38) !important;
  border-color: rgba(255,255,255,.08) !important;
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
}

/* Tappable tiles (My Bag's clubs and other cards you tap): glass bubbles like the buttons. */
.cx div[onclick][style*="background:#222"] {
  position: relative;
  background: var(--glass-fill) !important; border: 0 !important; border-radius: 18px !important;
  box-shadow: inset 0 1.5px 2px rgba(255,255,255,calc(var(--glass-edge) * 1.4)),
              inset 0 -1.5px 2px rgba(255,255,255,calc(var(--glass-edge) * .9)),
              0 2px 10px rgba(0,0,0,.35) !important;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.cx div[onclick][style*="background:#222"]::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255,255,255,calc(var(--glass-edge) * 4)) 0%,
    rgba(255,255,255,calc(var(--glass-edge) * .25)) 30%,
    rgba(255,255,255,calc(var(--glass-edge) * .25)) 70%,
    rgba(255,255,255,calc(var(--glass-edge) * 2.6)) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* Number fields: no up/down arrows. */
.cx input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.cx input[type=number]::-webkit-inner-spin-button, .cx input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Icon tints in the macOS palette (Practice and Learning's tiles), like Home's. */
.cx .tint-blue { color: var(--mac-blue); } .cx .tint-green { color: var(--mac-green); }
.cx .tint-yellow { color: var(--mac-yellow); } .cx .tint-red { color: var(--mac-red); }
.cx .tint-purple { color: #BF5AF2; }

/* Round buttons stay round: app.css gives every button a 40px min-height, which
   stretched the 32px search/settings and 36px back buttons into ovals. */
.cx .iconbtn, .cx .back-btn-top { min-height: 0 !important; aspect-ratio: 1; }

/* Stats Dashboard: each strokes gained category is a glass bubble you tap. */
.cx .sgtap {
  position: relative; border-radius: 18px;
  background: var(--glass-fill);
  box-shadow: inset 0 1.5px 2px rgba(255,255,255,calc(var(--glass-edge) * 1.4)),
              inset 0 -1.5px 2px rgba(255,255,255,calc(var(--glass-edge) * .9)),
              0 2px 10px rgba(0,0,0,.35);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  -webkit-tap-highlight-color: transparent; transition: transform .08s;
}
.cx .sgtap:active { transform: scale(.98); }
.cx .sgtap::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255,255,255,calc(var(--glass-edge) * 4)) 0%,
    rgba(255,255,255,calc(var(--glass-edge) * .25)) 30%,
    rgba(255,255,255,calc(var(--glass-edge) * .25)) 70%,
    rgba(255,255,255,calc(var(--glass-edge) * 2.6)) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* Glass tiles (Speed sessions, Combine History): the same pane and edge as the glass buttons. */
.cx .glasstile, .cx .comb-hist-card {
  position: relative; background: var(--glass-fill) !important; border: 0 !important; border-radius: 22px !important;
  box-shadow: inset 0 1.5px 2px rgba(255,255,255,calc(var(--glass-edge) * 1.4)),
              inset 0 -1.5px 2px rgba(255,255,255,calc(var(--glass-edge) * .9)),
              0 2px 10px rgba(0,0,0,.35) !important;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.cx .comb-hist-card { padding: 14px 16px !important; margin-bottom: 10px !important; }
.cx .glasstile::before, .cx .comb-hist-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255,255,255,calc(var(--glass-edge) * 4)) 0%,
    rgba(255,255,255,calc(var(--glass-edge) * .25)) 30%,
    rgba(255,255,255,calc(var(--glass-edge) * .25)) 70%,
    rgba(255,255,255,calc(var(--glass-edge) * 2.6)) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
/* Stat cells inside a tile: a light inset, not a second pane. */
.cx .glasstile div[style*="background:#282828"] { background: rgba(255,255,255,.04) !important; border-radius: 14px !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
/* Filter pickers: glass pills like the buttons, text centred, no arrow. */
.cx select.glassselect {
  -webkit-appearance: none; appearance: none; text-align: center; text-align-last: center; font-weight: 600;
  box-shadow: inset 0 1.5px 2px rgba(255,255,255,calc(var(--glass-edge) * 1.4)),
              inset 0 -1.5px 2px rgba(255,255,255,calc(var(--glass-edge) * .9)),
              0 2px 10px rgba(0,0,0,.35) !important;
}

/* Distance Optimizer: no header bar, thin slider tracks, label left and value right,
   the picked mode and the headline numbers in the blue of a selected button. */
.cx #bagOptApp .bo-header { background: transparent !important; border: 0 !important; }
.cx #bagOptApp input[type="range"] { min-height: 0 !important; height: 6px !important; background: rgba(255,255,255,.15) !important; border: 0 !important; box-shadow: none !important; }
.cx #bagOptApp .bo-slider-label { text-align: left; }
.cx #bagOptApp .bo-current-value-display { text-align: right; }
.cx #bagOptApp .bo-result-card { background: rgba(255,255,255,.04) !important; border: 0 !important; box-shadow: none !important; border-radius: 12px !important; }
.cx #bagOptApp .bo-distance-highlight { background: var(--glass-on) !important; }
.cx #bagOptApp .bo-distance-highlight :is(.bo-result-label, .bo-result-value, .bo-result-unit) { color: #fff !important; }
.cx #bagOptApp button.bo-toggle-btn.bo-active { background: var(--glass-on) !important; color: #fff !important; }

/* While a screen is being swiped: no glass blur (redrawing it every frame stutters). */
body.swiping .cx, body.swiping .cx *, body.swiping .cx *::before { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
/* The screen before, shown under one being swiped back (js/coaching/swipe.js). */
#swipeUnder { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: linear-gradient(180deg, #2c2c2e 0%, #232325 45%, #1a1a1c 100%); }
#swipeUnder .page { display: flex !important; height: 100%; }
#swipeUnder #swipeUnderView > .cx { min-height: 100%; }

/* Pages with tabs (My Bag, Practice and Learning, Performance Analysis): the page
   scrolls as a whole, the title goes with it and the tabs stay at the top with the
   content passing under them. No fixed header band. */

/* ---- Shared controls: one look for each kind of button, on every page ----
   .tabs    a tab bar: glass pills sharing the width, the picked one blue
   .fmenu   Filter: one "☰ Filter" button dropping down the list's pickers (js/ui.js)
   .xbtn    close / clear: a round glass button with ✕
   .delbtn  delete an item: a round glass button with a red bin */
.cx .tabs {
  gap: 6px !important; width: 100%; padding: 0 !important; border: 0 !important; border-radius: 0 !important;
  background: transparent !important; box-shadow: none !important; overflow: visible !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
.cx .tabs > button:not(.linkbtn):not(.glass-skip) {
  flex: 1 1 auto !important; min-width: 0; width: auto !important; max-width: none !important;
  height: 38px !important; min-height: 0 !important; margin: 0 !important; padding: 0 8px !important;
  border-radius: 22px !important; font-size: 13px !important; font-weight: 700 !important; font-family: inherit !important;
  color: rgba(255,255,255,.78) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cx .tabs.many > button:not(.linkbtn):not(.glass-skip) { font-size: 12px !important; padding: 0 4px !important; }

.cx .fbar { display: flex; align-items: center; gap: 8px; width: 100%; }
.cx .fbar > input { flex: 1; min-width: 0; width: auto !important; max-width: none !important; margin: 0 !important; }
.cx .fhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.cx .fhead.end { justify-content: flex-end; }
.cx .fmenu { position: relative; flex: none; }
.cx button.fbtn:not(.linkbtn) {
  flex: none !important; width: auto !important; max-width: none !important; height: 36px !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 12px !important; display: inline-flex !important; align-items: center; justify-content: center; gap: 5px;
  font-size: 13px !important; font-weight: 700 !important; color: #fff !important;
}
.cx .fpanel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 260px; max-width: calc(100vw - 32px); box-sizing: border-box;
  display: flex; flex-direction: column; gap: 8px; padding: 12px; text-align: left;
  background: #2c2c2e !important; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08);
}
.cx .fpanel[hidden] { display: none; }
.cx .frow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; }
.cx .frow > span { font-size: 13px; font-weight: 600; color: #9a9a9a; }
.cx .frow > select {
  flex: none; display: block !important; width: 160px !important; max-width: 160px !important; height: 34px !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 10px !important; font-size: 13px !important; font-weight: 600; color: #fff !important; box-sizing: border-box;
}
.cx .factions { display: flex; gap: 8px; margin-top: 4px; }
.cx .factions > button:not(.linkbtn) { flex: 1; width: auto !important; max-width: none !important; height: 36px !important; min-height: 0 !important; margin: 0 !important; font-size: 13px !important; font-weight: 700 !important; color: #fff !important; }
.cx .factions > button.fdone:not(.linkbtn) { background: var(--glass-on) !important; }

.cx :is(.xbtn, .delbtn):not(.linkbtn) {
  flex: none !important; width: 32px !important; height: 32px !important; min-width: 32px !important; max-width: 32px !important; min-height: 0 !important;
  margin: 0; padding: 0 !important; border-radius: 50% !important; display: inline-flex !important; align-items: center; justify-content: center;
  font-size: 15px !important; font-weight: 600 !important; line-height: 1 !important; color: #e5e5ea !important; cursor: pointer;
}
.cx .delbtn:not(.linkbtn) { color: var(--mac-red) !important; }
.cx :is(.xbtn, .delbtn) svg, .cx :is(.xbtn, .delbtn) .ic { width: 16px; height: 16px; }

/* Tabs (or History's search row) over a scrolling list: .overtop sits on top and the
   .undertop list starts under it (--over: its height, --gap: the space below it), so
   the list passes beneath the tabs as it scrolls, as on My Bag, while the title above
   stays put with nothing behind it. Nothing in the list is blurred: on iPhone blurred
   glass inside a scrolling box isn't clipped at the box's edge and drew over the title. */
.cx .overtop { position: relative; z-index: 10; margin-bottom: 0 !important; }
.cx .undertop { margin-top: calc(-1 * var(--over, 38px)) !important; padding-top: calc(var(--over, 38px) + var(--gap, 14px)) !important; }
.cx .undertop :is(button, div, a, input, select, textarea, span, label) { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
/* A soft fade, not a hard line, where a list slides under the tabs (--fade: where it is
   fully shown, by default just below the tabs). */
.cx .undertop {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade, calc(var(--over, 38px) + var(--gap, 14px))));
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fade, calc(var(--over, 38px) + var(--gap, 14px))));
}
