/* =============================================================================
   x-spec.css · Specialities (Care Galaxy) · Lakeview Multispeciality Clinic
   Medical sci-fi, calm: glass + hairline gradient borders, HUD mono labels,
   holographic figure, organ line art. Works with every html[data-part].
   ============================================================================= */
.xs { --xs-glow: color-mix(in srgb, var(--teal) 40%, transparent); --xs-hair: linear-gradient(135deg, color-mix(in srgb, var(--brass) 55%, transparent), transparent 38%, transparent 62%, color-mix(in srgb, var(--teal) 50%, transparent)); }
.xs-hud { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--mono); font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.xs-hud-sep { opacity: .45; }
.xs-lbl { display: block; font-family: var(--mono); font-size: .66rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); }

/* hairline gradient border for glass cards on this page */
.xs .cw-card-glass { position: relative; }
.xs .cw-card-glass::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--xs-hair);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }

/* ---------------------------------------------------------------- hero */
.xs-hero { overflow: hidden; }
.xs-aurora { position: absolute; inset: -20% -10% auto; height: 120%; pointer-events: none; z-index: 0; opacity: .75;
  background: radial-gradient(40% 50% at 18% 30%, color-mix(in srgb, var(--teal) 22%, transparent), transparent 70%),
              radial-gradient(36% 46% at 82% 18%, color-mix(in srgb, var(--brass) 20%, transparent), transparent 70%),
              radial-gradient(30% 40% at 60% 80%, color-mix(in srgb, #8b5cf6 12%, transparent), transparent 70%);
  filter: blur(10px); animation: xsAurora 22s ease-in-out infinite alternate; }
@keyframes xsAurora { to { transform: translate3d(3%, 4%, 0) scale(1.06); } }
html[data-part="night"] .xs-aurora { opacity: 1; }
.xs-hero-in { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.xs-hero h1 { margin-top: 14px; }
.xs-hi { font-family: var(--serif); font-style: italic; font-size: clamp(1.15rem, 2vw, 1.45rem); color: var(--brass-text); margin-top: 10px; }
.xs-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 28px; max-width: 640px; }
.xs-stat { position: relative; padding: 14px 14px 12px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); overflow: hidden; }
.xs-stat::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--teal), transparent); opacity: .7; }
.xs-stat.live::after { background: linear-gradient(90deg, var(--ok), transparent); }
.xs-stat b { display: block; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.xs-stat span { display: block; margin-top: 6px; font-size: .74rem; line-height: 1.3; color: var(--mut); }
.xs-stat-note { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
@media (max-width: 560px) { .xs-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.xs-find-card { padding: clamp(20px, 3vw, 30px); overflow: hidden; }
.xs-find-card::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 40%; pointer-events: none; border-radius: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, var(--teal) 8%, transparent), transparent); }
.xs-find { position: relative; z-index: 1; display: grid; gap: 10px; }
.xs-find-hud { font-size: .64rem; }
.xs-find-h { font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.2rem); line-height: 1.05; }
.xs-find-row { display: flex; gap: 8px; margin-top: 4px; }
.xs-find-row input { flex: 1; min-width: 0; min-height: 52px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line2); background: var(--field); font-size: 1rem; }
.xs-find-row input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.xs-find-row .btn { flex: none; }
.xs-samples { display: flex; flex-wrap: wrap; gap: 6px; }
.xs-sample { border: 1px dashed var(--line2); background: transparent; border-radius: 99px; padding: 5px 11px; font-size: .78rem; color: var(--mut); transition: all .2s var(--ease); }
.xs-sample:hover, .xs-sample:focus-visible { border-style: solid; border-color: var(--teal); color: var(--teal); }
.xs-match:empty { display: none; }
.xs-match.on { --hue: var(--teal); border-radius: 18px; padding: 14px; border: 1px solid color-mix(in srgb, var(--hue) 40%, var(--line)); background: color-mix(in srgb, var(--hue) 7%, var(--card)); animation: xsIn .45s var(--ease); }
.xs-m-card { display: flex; gap: 12px; align-items: flex-start; }
.xs-m-gl { width: 52px; height: 52px; flex: none; color: var(--hue); padding: 6px; border-radius: 14px; background: color-mix(in srgb, var(--hue) 12%, transparent); }
html[data-part="night"] .xs-m-gl { color: color-mix(in srgb, var(--hue) 60%, #fff); }
.xs-m-gl path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: xsDraw 1.2s var(--ease) forwards; }
.xs-m-txt { display: grid; gap: 4px; min-width: 0; }
.xs-m-txt b { font-size: 1.08rem; }
.xs-m-txt small { color: var(--mut); line-height: 1.45; }
.xs-m-txt .pill { justify-self: start; margin-top: 2px; }
.xs-m-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.xs-match.sos { display: grid; gap: 10px; animation: xsIn .35s var(--ease); }
.xs-m-sos { display: flex; gap: 8px; align-items: center; font-weight: 650; color: var(--sos); }
.xs-m-tm a { color: var(--sos); font-weight: 700; }
.xs-find-fine { display: flex; gap: 6px; align-items: flex-start; }
@media (max-width: 900px) { .xs-hero-in { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .xs-find-row .btn span { display: none; } .xs-find-row .btn { padding: 0 16px; } }

/* ---------------------------------------------------------------- hub */
.xs-hub-sec { position: relative; padding: clamp(40px, 6vw, 84px) 0 clamp(56px, 7vw, 100px); }
.xs-hub-head { margin-bottom: 22px; }
.xs-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.xs-fchip { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line2); background: var(--glass);
  font-size: .84rem; font-weight: 600; color: var(--ink); transition: all .25s var(--ease); white-space: nowrap; }
.xs-fchip .mono { font-size: .7rem; color: var(--mut); padding: 1px 6px; border-radius: 99px; background: var(--bg2); }
.xs-fchip:hover { border-color: var(--teal); transform: translateY(-1px); }
.xs-fchip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); box-shadow: 0 8px 22px -12px var(--xs-glow); }
.xs-fchip[aria-pressed="true"] .mono { background: color-mix(in srgb, var(--bg) 18%, transparent); color: inherit; }
.xs-fchip.duty i { color: var(--ok); }
.xs-fchip.duty[aria-pressed="true"] i { color: inherit; }

.xs-hub { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.xs-galaxy-col { position: sticky; top: calc(var(--hdr-h) + 12px); }
.xs-galaxy-wrap { --rx: 0deg; --ry: 0deg; position: relative; border-radius: var(--r-xl); padding: 8px; perspective: 1200px;
  background: radial-gradient(70% 60% at 50% 45%, color-mix(in srgb, var(--teal) 8%, transparent), transparent 70%); }
.xs-galaxy { display: block; width: 100%; height: auto; overflow: visible; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .5s var(--ease); }
.xs-hud-corner { position: absolute; font-size: .6rem; letter-spacing: .16em; color: var(--mut); padding: 6px 10px; pointer-events: none; }
.xs-hud-corner::before { content: ''; position: absolute; width: 14px; height: 14px; border: 1px solid var(--brass); opacity: .7; }
.xs-hud-corner.tl { top: 0; left: 0; } .xs-hud-corner.tl::before { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.xs-hud-corner.tr { top: 0; right: 0; text-align: right; } .xs-hud-corner.tr::before { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.xs-hud-corner.bl { bottom: 0; left: 0; } .xs-hud-corner.bl::before { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.xs-hud-corner.br { bottom: 0; right: 0; text-align: right; color: var(--teal); } .xs-hud-corner.br::before { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.xs-kbd { margin-top: 10px; text-align: center; }
.xs-kbd kbd { font-family: var(--mono); font-size: .72rem; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line2); background: var(--card); }

/* svg pieces */
.xs-dots { opacity: .7; }
.xs-orb { stroke: var(--line2); stroke-width: 1; }
.xs-orb.a { stroke-dasharray: 2 7; }
.xs-orb.b { stroke: color-mix(in srgb, var(--teal) 24%, transparent); }
.xs-orb.c { stroke: color-mix(in srgb, var(--brass) 30%, transparent); stroke-dasharray: 1 12; }
.xs-orb.d { stroke: color-mix(in srgb, var(--teal) 18%, transparent); stroke-dasharray: 30 18; }
.xs-sat { fill: var(--brass); }
.xs-spin { transform-origin: 410px 430px; animation: xsSpin 120s linear infinite; }
.xs-spin.rev { animation-duration: 80s; animation-direction: reverse; }
@keyframes xsSpin { to { transform: rotate(360deg); } }
.xs-constel { fill: color-mix(in srgb, var(--teal) 5%, transparent); stroke: color-mix(in srgb, var(--teal) 55%, transparent); stroke-width: 1.2; stroke-dasharray: 4 6; animation: xsDash 6s linear infinite; }
@keyframes xsDash { to { stroke-dashoffset: -100; } }
.xs-fig-fill > * { fill: color-mix(in srgb, var(--teal) 6%, transparent); }
.xs-fig-line > * { stroke-width: 1.6; stroke-linejoin: round; opacity: .85; }
.xs-fig-detail > * { stroke: color-mix(in srgb, var(--teal) 45%, transparent); stroke-width: 1; }
html[data-part="night"] .xs-fig-line > * { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--teal) 60%, transparent)); }
.xs-scanbar { animation: xsScan 5.5s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes xsScan { from { transform: translateY(0); } to { transform: translateY(600px); } }

.xs-link { fill: none; stroke: var(--hue, var(--teal)); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; opacity: .9; }
.xs-linkg.draw .xs-link { animation: xsDrawLink .9s var(--ease) both; }
@keyframes xsDrawLink { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.xs-anc { fill: var(--hue, var(--teal)); stroke: var(--bg); stroke-width: 2; }
.xs-anc-ring { fill: none; stroke: var(--hue, var(--teal)); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: xsAnc 1.8s ease-out infinite; }
@keyframes xsAnc { from { transform: scale(1); opacity: .9; } to { transform: scale(3.4); opacity: 0; } }

.xs-node { cursor: pointer; outline: none; transition: opacity .35s var(--ease); }
.xs-n-in { transition: transform .35s var(--spring); }
.xs-node:hover .xs-n-in, .xs-node:focus-visible .xs-n-in { transform: scale(1.12); }
.xs-n-core { fill: color-mix(in srgb, var(--hue) 10%, var(--card)); stroke: var(--hue); stroke-width: 1.6; transition: fill .3s ease; }
.xs-n-gl { stroke: var(--hue); transition: stroke .3s ease; }
html[data-part="night"] .xs-n-gl { stroke: color-mix(in srgb, var(--hue) 55%, #fff); }
html[data-part="night"] .xs-n-core { fill: color-mix(in srgb, var(--hue) 18%, var(--card)); }
.xs-n-halo { fill: color-mix(in srgb, var(--hue) 22%, transparent); opacity: 0; }
.xs-node.duty .xs-n-halo { animation: xsPulse 2.8s ease-out infinite; }
@keyframes xsPulse { 0% { transform: scale(.85); opacity: .75; } 100% { transform: scale(1.5); opacity: 0; } }
.xs-n-ring { fill: none; stroke: var(--hue); stroke-width: 1.4; stroke-dasharray: 3 5; opacity: 0; transition: opacity .3s ease; }
.xs-node:focus-visible .xs-n-ring { opacity: 1; stroke: var(--brass); stroke-dasharray: none; stroke-width: 2.4; }
.xs-node.on .xs-n-ring { opacity: 1; animation: xsSpin 14s linear infinite; }
.xs-node.on .xs-n-core { fill: var(--hue); }
.xs-node.on .xs-n-gl { stroke: #fff; }
.xs-node.on .xs-n-in { transform: scale(1.14); }
.xs-n-dot { stroke: var(--card); stroke-width: 2; fill: var(--st-off); }
.xs-node[data-st="in"] .xs-n-dot { fill: var(--st-in); }
.xs-node[data-st="wait"] .xs-n-dot { fill: var(--st-wait); }
.xs-node[data-st="free"] .xs-n-dot { fill: var(--st-free); }
.xs-n-lab { font-family: var(--sans); font-size: 15px; font-weight: 650; fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 5px; stroke-linejoin: round; letter-spacing: -.01em; }
.xs-node.on .xs-n-lab { fill: var(--brass-text); }
.xs-node.dim { opacity: .16; }
.xs-node.dim .xs-n-halo { animation: none; }

/* paused when off-screen / tab hidden */
.xs-paused .xs-spin, .xs-paused .xs-scanbar, .xs-paused .xs-n-halo, .xs-paused .xs-n-ring, .xs-paused .xs-anc-ring, .xs-paused .xs-constel,
.xs-paused .xs-p-scan, .xs-paused .xs-p-orbit, .xs-paused.xs-p-scan { animation-play-state: paused !important; }
.xs-panel.xs-paused .xs-p-scan, .xs-panel.xs-paused .xs-p-orbit { animation-play-state: paused !important; }

/* ---------------------------------------------------------------- mobile rail */
.xs-rail { display: none; }

/* ---------------------------------------------------------------- panel */
.xs-panel { --hue: var(--teal); position: relative; padding: clamp(20px, 2.6vw, 30px); overflow: hidden; scroll-margin-top: calc(var(--hdr-h) + 12px); outline: none; display: grid; gap: 20px; }
.xs-panel::after { content: ''; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--hue) 22%, transparent), transparent 70%); }
.xs-p-scan { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--hue), transparent); opacity: .7; animation: xsPanelScan 6s ease-in-out infinite; pointer-events: none; }
@keyframes xsPanelScan { 0%, 100% { transform: translateY(0); opacity: 0; } 10% { opacity: .7; } 50% { transform: translateY(260px); opacity: .5; } 60% { opacity: 0; } }
.xs-p-head { position: relative; z-index: 1; display: flex; gap: 18px; align-items: center; }
.xs-p-glyph { position: relative; flex: none; width: 92px; height: 92px; border-radius: 26px; display: grid; place-items: center; color: var(--hue);
  background: color-mix(in srgb, var(--hue) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--hue) 35%, transparent); box-shadow: 0 18px 40px -22px var(--hue); }
html[data-part="night"] .xs-p-glyph { color: color-mix(in srgb, var(--hue) 55%, #fff); }
.xs-p-glyph .xs-gl { width: 60px; height: 60px; }
.xs-p-glyph.draw path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: xsDraw 1.5s var(--ease) forwards; }
.xs-p-glyph.draw path:nth-child(2) { animation-delay: .15s; } .xs-p-glyph.draw path:nth-child(3) { animation-delay: .3s; } .xs-p-glyph.draw path:nth-child(n+4) { animation-delay: .45s; }
@keyframes xsDraw { to { stroke-dashoffset: 0; } }
.xs-p-orbit { position: absolute; inset: -7px; border-radius: 32px; border: 1px dashed color-mix(in srgb, var(--hue) 45%, transparent); animation: xsSpin 30s linear infinite; }
.xs-p-title { min-width: 0; }
.xs-p-title .xs-hud { color: var(--hue); font-size: .64rem; }
html[data-part="night"] .xs-p-title .xs-hud { color: color-mix(in srgb, var(--hue) 55%, #fff); }
.xs-p-duty { color: var(--ok); }
.xs-p-name { font-family: var(--serif); font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1; margin-top: 6px; outline: none; }
.xs-p-sub { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; color: var(--mut); font-size: .92rem; }
.xs-p-sub [lang="hi"] { color: var(--brass-text); font-weight: 600; }
.xs-p-when { position: relative; z-index: 1; padding: 14px 16px; border-radius: 16px; border-left: 3px solid var(--hue); background: color-mix(in srgb, var(--hue) 6%, transparent); }
.xs-p-when p { margin-top: 6px; font-size: 1.02rem; line-height: 1.55; }

.xs-docs { display: grid; gap: 10px; position: relative; z-index: 1; }
.xs-doc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "pic id next" "pic live next"; gap: 6px 14px; align-items: center;
  padding: 14px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.xs-doc > .cw-portrait { grid-area: pic; }
.xs-doc-id { grid-area: id; display: grid; gap: 2px; min-width: 0; }
.xs-doc-id b { font-size: 1.02rem; }
.xs-doc-id > span { font-size: .84rem; color: var(--mut); }
.xs-doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: .72rem !important; letter-spacing: .02em; color: var(--mut); margin-top: 2px; }
.xs-doc-meta i { color: var(--teal); }
.xs-doc-live { grid-area: live; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.xs-doc-live small { font-size: .78rem; color: var(--mut); }
.xs-doc-next { grid-area: next; display: grid; gap: 3px; justify-items: end; text-align: right; padding-left: 14px; border-left: 1px dashed var(--line2); }
.xs-doc-next small { font-size: .74rem; color: var(--mut); }
.xs-slot { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); padding: 4px 0; }
.xs-slot b { font-size: .96rem; }
.xs-slot i { color: var(--brass-text); transition: transform .25s var(--ease); }
.xs-slot:hover i { transform: translateX(3px); }
@media (max-width: 1180px) and (min-width: 980px), (max-width: 560px) {
  .xs-doc { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "pic id" "live live" "next next"; }
  .xs-doc-next { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; text-align: left; border-left: 0; padding-left: 0; border-top: 1px dashed var(--line2); padding-top: 10px; }
  .xs-doc-next .xs-lbl { flex: 1 0 100%; }
}

.xs-p-act { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.xs-p-cols { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.xs-p-col h3, .xs-p-flags h3 { display: flex; align-items: center; gap: 8px; font-size: .95rem; margin-bottom: 10px; }
.xs-p-col h3 i { color: var(--hue); }
html[data-part="night"] .xs-p-col h3 i { color: color-mix(in srgb, var(--hue) 55%, #fff); }
.xs-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.xs-tags li { padding: 6px 11px; border-radius: 99px; font-size: .82rem; background: color-mix(in srgb, var(--hue) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--hue) 22%, transparent); }
.xs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.xs-list li { display: flex; gap: 9px; align-items: flex-start; font-size: .88rem; line-height: 1.45; }
.xs-list li::before { content: ''; flex: none; width: 7px; height: 7px; margin-top: 7px; border-radius: 2px; transform: rotate(45deg); background: var(--hue); }
.xs-p-flags { position: relative; z-index: 1; display: grid; gap: 10px; padding-top: 16px; border-top: 1px dashed var(--line2); }
.xs-p-flags h3 { color: var(--sos); margin-bottom: 0; }
.xs-p-flags ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: .9rem; }
.xs-p-flags li::marker { color: var(--sos); }
.xs-p-fine { position: relative; z-index: 1; }
@media (max-width: 560px) { .xs-p-cols { grid-template-columns: 1fr; } .xs-p-head { gap: 14px; } .xs-p-glyph { width: 72px; height: 72px; border-radius: 20px; } .xs-p-glyph .xs-gl { width: 46px; height: 46px; } .xs-p-act .btn { flex: 1 1 auto; } }

/* ---------------------------------------------------------------- weekly heatmap */
.xs-week-scroll { overflow-x: auto; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.xs-week { width: 100%; border-collapse: separate; border-spacing: 4px; padding: 8px; min-width: 0; }
.xs-week th, .xs-week td { text-align: center; }
.xs-week thead th { font-size: .78rem; font-weight: 650; color: var(--mut); padding: 8px 2px 10px; vertical-align: bottom; position: relative; }
.xs-week thead th span { display: block; }
.xs-week thead th small { display: block; font-size: .7rem; opacity: .75; }
.xs-week thead th em { position: absolute; left: 50%; top: -4px; transform: translateX(-50%); font-style: normal; font-size: .56rem; letter-spacing: .14em; color: var(--brass-text); }
.xs-week thead th.today { color: var(--ink); }
.xs-week .xs-w-name { text-align: left; width: 34%; }
.xs-week tbody th { padding: 0; }
.xs-week tbody th button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 6px 8px; border-radius: 10px; text-align: left; font-size: .9rem; font-weight: 600; color: var(--ink); }
.xs-week tbody th button:hover { background: color-mix(in srgb, var(--hue) 10%, transparent); }
.xs-week tr.sel th button { background: color-mix(in srgb, var(--hue) 14%, transparent); }
.xs-w-gl { width: 26px; height: 26px; flex: none; color: var(--hue); }
html[data-part="night"] .xs-w-gl { color: color-mix(in srgb, var(--hue) 55%, #fff); }
.xs-week td { height: 44px; border-radius: 10px; padding: 0; position: relative; }
.xs-week td.off { color: var(--mut); background: color-mix(in srgb, var(--ink) 3%, transparent); }
.xs-week td.on { background: color-mix(in srgb, var(--hue) calc(var(--a) * 100%), transparent); }
.xs-week td.on.full { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--hue) 14%, transparent) 0 6px, transparent 6px 12px); }
.xs-week td a, .xs-week td > span[role] { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 44px; border-radius: 10px; text-decoration: none; color: var(--ink); transition: transform .2s var(--ease), box-shadow .2s ease; }
.xs-week td a:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -10px var(--hue); }
.xs-week td b { font-size: .92rem; line-height: 1; font-weight: 600; }
.xs-week td small { font-size: .58rem; color: color-mix(in srgb, var(--ink) 65%, transparent); margin-top: 3px; letter-spacing: .06em; }
.xs-week td.today { box-shadow: inset 0 0 0 1.5px var(--brass); }
.xs-week thead th.today::after { content: ''; position: absolute; left: 20%; right: 20%; bottom: 2px; height: 2px; border-radius: 2px; background: var(--brass); }
html[data-part="night"] .xs-week td.on b, html[data-part="night"] .xs-week td.on small { color: #fff; }
.xs-week-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
.xs-week-legend span { display: inline-flex; align-items: center; gap: 7px; }
.xs-lg-cell { display: inline-block; width: 18px; height: 14px; border-radius: 4px; }
.xs-lg-cell.lo { background: color-mix(in srgb, var(--teal) 22%, transparent); }
.xs-lg-cell.hi { background: color-mix(in srgb, var(--teal) 80%, transparent); }
.xs-lg-cell.off { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.xs-lg-cell.today { box-shadow: inset 0 0 0 1.5px var(--brass); }
@media (max-width: 640px) {
  .xs-week { border-spacing: 2px; padding: 4px; }
  .xs-week .xs-w-name { width: auto; }
  .xs-week tbody th button { padding: 4px 4px; gap: 6px; font-size: .74rem; }
  .xs-w-gl { width: 20px; height: 20px; }
  .xs-week td { height: 38px; } .xs-week td a, .xs-week td > span[role] { min-height: 38px; }
  .xs-week td small { display: none; }
  .xs-week td b { font-size: .8rem; }
  .xs-week thead th { font-size: .68rem; padding: 10px 0 8px; }
  .xs-week thead th em { font-size: .48rem; letter-spacing: .06em; }
}

/* ---------------------------------------------------------------- safety */
.xs-safe-fine { margin-top: 14px; max-width: 820px; }

/* ---------------------------------------------------------------- tablet: galaxy stacked */
@media (max-width: 979px) {
  .xs-hub { grid-template-columns: 1fr; }
  .xs-galaxy-col { position: relative; top: auto; max-width: 620px; margin-inline: auto; width: 100%; }
}
/* ---------------------------------------------------------------- phone: card rail replaces the galaxy */
@media (max-width: 639px) {
  .xs-galaxy-col { display: none; }
  .xs-filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 6px; scrollbar-width: none; -webkit-mask: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); mask: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); }
  .xs-filters::-webkit-scrollbar { display: none; }
  .xs-rail { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 4px 16px 14px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .xs-rail::-webkit-scrollbar { display: none; }
  .xs-rc { --hue: var(--teal); flex: 0 0 auto; width: 148px; scroll-snap-align: center; display: grid; gap: 10px; padding: 14px; text-align: left; border-radius: 20px;
    border: 1px solid var(--line); background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); position: relative; overflow: hidden; transition: all .3s var(--ease); }
  .xs-rc::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--hue); opacity: .55; }
  .xs-rc-gl { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--hue); background: color-mix(in srgb, var(--hue) 12%, transparent); position: relative; }
  html[data-part="night"] .xs-rc-gl { color: color-mix(in srgb, var(--hue) 55%, #fff); }
  .xs-rc.duty .xs-rc-gl::after { content: ''; position: absolute; inset: -3px; border-radius: 17px; border: 1.5px solid var(--hue); opacity: 0; animation: xsRcPulse 2.6s ease-out infinite; }
  @keyframes xsRcPulse { 0% { opacity: .7; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.18); } }
  .xs-rc-gl .xs-gl { width: 32px; height: 32px; }
  .xs-rc-t { display: grid; gap: 4px; min-width: 0; }
  .xs-rc-t b { font-size: .95rem; }
  .xs-rc-t small { display: flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--mut); line-height: 1.3; }
  .xs-rc.on { background: var(--hue); border-color: var(--hue); color: #fff; box-shadow: 0 14px 28px -16px var(--hue); }
  .xs-rc.on .xs-rc-gl { color: #fff; background: rgba(255, 255, 255, .18); }
  .xs-rc.on small { color: rgba(255, 255, 255, .88); }
  .xs-rc.on::after { background: #fff; opacity: .5; }
  .xs-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--st-off); }
  .xs-dot.in { background: var(--st-in); } .xs-dot.wait { background: var(--st-wait); } .xs-dot.free { background: var(--st-free); }
  .xs-rc.on .xs-dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
  .xs-panel { border-radius: var(--r-lg); }
}

@keyframes xsIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .xs-aurora, .xs-spin, .xs-constel, .xs-scanbar, .xs-node.duty .xs-n-halo, .xs-node.on .xs-n-ring, .xs-anc-ring, .xs-p-scan, .xs-p-orbit, .xs-rc.duty .xs-rc-gl::after { animation: none !important; }
  .xs-scanbar { display: none; }
  .xs-node.duty .xs-n-halo { opacity: .35; transform: scale(1.15); }
  .xs-p-glyph.draw path, .xs-m-gl path, .xs-linkg.draw .xs-link { animation: none !important; stroke-dashoffset: 0; }
  .xs-galaxy { transform: none !important; }
  .xs-n-in, .xs-week td a { transition: none; }
}
