/* PTS Lab Calendar. Palette and faces follow the lab website (teal-to-violet accent,
   Space Grotesk / Inter / Noto Sans KR). Layout: one centred column of numbered steps. */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #0d1526;
  --text-2: #3f4c63;
  --muted: #64718a;
  --border: rgba(12, 20, 40, .12);
  --border-2: rgba(12, 20, 40, .24);
  --acc: #0f9e91;
  --acc-ink: #ffffff;
  --acc-soft: #d8f3f0;
  --violet: #6355e8;
  --heat: 15, 158, 145;
  --warn: #c2412d;
  --pref: #b45309;
  /* lipid-P mark: stem ink + the three gradient stops, same values as the
     lab website's header mark so the two properties stay in step. */
  --lt: #0d1526; --s1: #12b5a6; --s2: #3b7be0; --s3: #6355e8;
  --pref-soft: #fdf1e1;
  --font-display: "Space Grotesk", "Noto Sans KR", system-ui, sans-serif;
  --font-body: "Inter", "Noto Sans KR", system-ui, -apple-system, sans-serif;
  --r: 12px;
  --bar: rgba(245, 247, 251, .72);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: light;
}

/* ===========================================================================
   Scale (2026-11-15)

   Before this block the stylesheet carried 19 distinct border-radius values
   (fifteen different pixel numbers, including 11px and 12px side by side) and
   22 font sizes, thirteen of them between 9px and 17px. Nothing was chosen;
   the values had accreted. A reader cannot see 11 vs 12, but they do feel a
   page where nothing quite agrees.

   Four radii and six text steps. The display sizes (27/32/68 and the two
   clamps) stay as they are: those are the page's voice, not its UI ladder.
   =========================================================================== */
:root {
  --r-xs: 6px;    /* chips, dots, the smallest marks */
  --r-sm: 10px;   /* buttons and compact controls   */
  --r-md: 14px;   /* inner panels, day cells        */
  --r-lg: 20px;   /* cards and sheets               */

  --t-micro: 11px;  /* overlines, counters            */
  --t-meta: 13px;   /* captions, secondary meta       */
  --t-body: 14px;   /* default running text           */
  --t-lead: 16px;   /* emphasis, list leads           */
  --t-title: 20px;  /* panel titles                   */
  --t-xl: 24px;     /* the month heading on phones    */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #06080d; --surface: #0d1220; --surface-2: #131a2b; --text: #e9edf5; --text-2: #b3bdcf; --muted: #8492a8;
    --border: rgba(255, 255, 255, .1); --border-2: rgba(255, 255, 255, .2);
    --acc: #35e0d0; --acc-ink: #04110f; --acc-soft: #0f3532; --violet: #9a8ffa; --heat: 53, 224, 208; --warn: #ff8a73; --pref: #f5b94a; --pref-soft: #2d2210;
    --lt: #e9edf5; --s1: #35e0d0; --s2: #6ea8fe; --s3: #7c6cf7;
    --bar: rgba(6, 8, 13, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #06080d; --surface: #0d1220; --surface-2: #131a2b; --text: #e9edf5; --text-2: #b3bdcf; --muted: #8492a8;
  --border: rgba(255, 255, 255, .1); --border-2: rgba(255, 255, 255, .2);
  --acc: #35e0d0; --acc-ink: #04110f; --acc-soft: #0f3532; --violet: #9a8ffa; --heat: 53, 224, 208; --warn: #ff8a73; --pref: #f5b94a; --pref-soft: #2d2210;
    --lt: #e9edf5; --s1: #35e0d0; --s2: #6ea8fe; --s3: #7c6cf7;
  --bar: rgba(6, 8, 13, .7);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
/* clip, not hidden: the top bar's full-bleed backdrop must not widen the page, and sticky must keep working */
html, body { overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body);
  font-size: var(--t-body); line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 calc(120px + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}
:lang(ko) body, html[lang="ko"] body { word-break: keep-all; }
main { max-width: 980px; margin: 0 auto; display: grid; gap: 30px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(24px, 4.4vw, 34px); line-height: 1.15; font-weight: 700; letter-spacing: -0.022em; }
h2 { font-size: var(--t-title); line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
h3 { font-size: var(--t-lead); font-weight: 700; }
p { margin: 0; }
a { color: var(--acc); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }

/* Top bar: a translucent layer the page scrolls under */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  max-width: 980px; margin: 0 auto 8px; padding-block: 12px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}
/* The bar is floating chrome, so it should dissolve into the content rather
   than end on a rule. The layer is extended 14px past the bar and masked
   away over that distance, which fades the blur and the tint together —
   a scroll edge, not a divider. The old 1px keyline drew a hard line
   across the page at every scroll position. */
.top::before {
  content: ""; position: absolute; inset: 0 -100vmax -14px; z-index: -1;
  background: var(--bar); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  -webkit-mask-image: linear-gradient(#000 calc(100% - 14px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 14px), transparent);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: var(--t-body); text-decoration: none; color: var(--text); }
.mark { width: 32px; height: 32px; flex: none; display: block; }
.mark svg { display: block; width: 100%; height: 100%; }
/* The head is a <circle> filled by a gradient whose stops are classed, so the
   colour comes through CSS custom properties and never through var() inside
   an SVG presentation attribute, which does not resolve. */
.logo__tails { stroke: var(--lt); stroke-width: 5.6; stroke-linecap: round; stroke-linejoin: round; fill: none; transition: stroke .3s ease; }
.logo__s1 { stop-color: var(--s1); } .logo__s2 { stop-color: var(--s2); } .logo__s3 { stop-color: var(--s3); }
.brand small { font-family: var(--font-body); font-weight: 500; color: var(--muted); font-size: var(--t-meta); }
.lang { display: inline-flex; border: 1px solid var(--border-2); border-radius: 999px; padding: 3px; background: var(--surface); }
.lang button { border: 0; background: none; border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: var(--t-meta); font-weight: 600; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* Round tabs (e.g. 1차 심사 · 온라인 / 2차 심사 · 대면) */
.rounds { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.rounds button { border: 0; background: transparent; border-radius: var(--r-sm); padding: 11px 12px; font-weight: 700; font-size: var(--t-body); color: var(--muted); cursor: pointer; min-width: 0; overflow-wrap: anywhere; transition: transform 160ms var(--ease-out), background-color 120ms ease, color 120ms ease; }
.rounds button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(12, 20, 40, .12); }
.rounds button:active { transform: scale(0.97); }
header.intro { display: grid; gap: 12px; padding-top: 8px; }
.eyebrow { font-size: var(--t-meta); letter-spacing: .09em; text-transform: uppercase; font-weight: 700; color: var(--acc); }
.lead { color: var(--text-2); max-width: 70ch; white-space: pre-line; }
.closed-banner { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-md); padding: 12px 14px; font-weight: 600; }
/* How-to guide at the top of the calendar page */
.howto { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--acc); border-radius: var(--r-md); padding: 16px 18px; gap: 10px; }
.howto h2 { font-size: var(--t-lead); }
.howto ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; line-height: 1.5; }
.howto li::marker { font-weight: 700; color: var(--acc); }
/* Lab calendar. Neutral glass surfaces; the colour sits on the events. */
.labcal {
  --muted: #4f5b72;
  /* Six rows have to fit the window, not a number chosen once. The subtrahend
     is the chrome above and below the grid (top bar, header band, card padding,
     month bar, weekday row); the floor keeps a cell readable on a short laptop
     and the ceiling stops the grid ballooning on a tall display. The flat value
     stays first so a browser without svh keeps what it always had. */
  --row: 132px;
  /* Divided by the current month's week count, not a constant six. A five-week
     month therefore gets taller cells rather than a blank sixth row. The
     subtrahend is everything above and below the grid: top bar, header band,
     card padding, month bar, weekday row and legend. */
  --vrows: 6;
  --row: clamp(92px, (100svh - 366px) / var(--vrows), 150px);
  --lc-weekly-bg: #cdf3ec; --lc-weekly-fg: #05534a; --lc-weekly: #0fa596;
  --lc-indigo: #5856d6; --lc-pink: #c32f83; --lc-special: linear-gradient(135deg, var(--lc-indigo), var(--lc-pink));
  --lc-special-bg: #e7e5fb; --lc-special-fg: #3a2bb0;
  --lc-today: #e5342a; --lc-sun: #d92d20; --lc-sat: #2563eb;
  /* More transparent than before, not less: the whole point is to see the
     backdrop through it. The edge is a specular highlight, so it is close to
     white; the shadow is three stops — contact, mid, ambient — because one
     blurred stop reads as a drop shadow and three read as a pane held above
     the page. */
  --lc-glass: color-mix(in srgb, var(--surface) 55%, transparent);
  --lc-edge: rgba(255, 255, 255, .92);
  --lc-hair: rgba(255, 255, 255, .55);
  --lc-shadow: 0 1px 2px rgba(24, 32, 56, .05), 0 10px 20px -10px rgba(24, 32, 56, .14), 0 34px 64px -28px rgba(24, 32, 56, .26);
  --lc-a1: #7fd8cb; --lc-a2: #9cc4f4; --lc-a3: #c4bff6; --lc-a4: #a6e3ef; --lc-ahl: rgba(255, 255, 255, .55);
  --lc-aop: .62;
  --lc-rim: linear-gradient(145deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .4) 28%, rgba(255, 255, 255, .08) 58%, rgba(255, 255, 255, .55));
  --lc-sheen: linear-gradient(165deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .12) 36%, rgba(255, 255, 255, 0) 68%);
  --lc-inner: rgba(255, 255, 255, .22);
  --lc-glow: rgba(255, 255, 255, .65);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .labcal {
    --muted: #a7b2c5; --lc-weekly-bg: #0f4a44; --lc-weekly-fg: #a5f6ec; --lc-weekly: #35e0d0;
    --lc-indigo: #6866ee; --lc-pink: #d43a92; --lc-sun: #ff7b72; --lc-sat: #79a8ff;
    --lc-special-bg: #272161; --lc-special-fg: #cfc9ff;
    --lc-glass: color-mix(in srgb, var(--surface) 62%, transparent);
    --lc-edge: rgba(255, 255, 255, .15);
    --lc-hair: rgba(255, 255, 255, .1);
    --lc-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 24px -12px rgba(0, 0, 0, .5), 0 44px 76px -32px rgba(0, 0, 0, .78);
    --lc-a1: #0f5f58; --lc-a2: #1e4180; --lc-a3: #2d296e; --lc-a4: #135470; --lc-ahl: rgba(255, 255, 255, .1);
    --lc-aop: .8;
    --lc-rim: linear-gradient(145deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .1) 30%, rgba(255, 255, 255, .03) 60%, rgba(255, 255, 255, .16));
    --lc-sheen: linear-gradient(165deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02) 38%, rgba(255, 255, 255, 0) 68%);
    --lc-inner: rgba(255, 255, 255, .04);
    --lc-glow: rgba(255, 255, 255, .05);
  }
}
:root[data-theme="dark"] .labcal {
  --muted: #a7b2c5; --lc-weekly-bg: #0f4a44; --lc-weekly-fg: #a5f6ec; --lc-weekly: #35e0d0;
  --lc-indigo: #6866ee; --lc-pink: #d43a92; --lc-sun: #ff7b72; --lc-sat: #79a8ff;
  --lc-special-bg: #272161; --lc-special-fg: #cfc9ff;
  --lc-glass: color-mix(in srgb, var(--surface) 62%, transparent);
  --lc-edge: rgba(255, 255, 255, .15);
  --lc-hair: rgba(255, 255, 255, .1);
  --lc-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 24px -12px rgba(0, 0, 0, .5), 0 44px 76px -32px rgba(0, 0, 0, .78);
  --lc-a1: #0f5f58; --lc-a2: #1e4180; --lc-a3: #2d296e; --lc-a4: #135470; --lc-ahl: rgba(255, 255, 255, .1);
  --lc-aop: .8;
  --lc-rim: linear-gradient(145deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .1) 30%, rgba(255, 255, 255, .03) 60%, rgba(255, 255, 255, .16));
  --lc-sheen: linear-gradient(165deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02) 38%, rgba(255, 255, 255, 0) 68%);
  --lc-inner: rgba(255, 255, 255, .04);
  --lc-glow: rgba(255, 255, 255, .05);
}
/* ---------------------------------------------------------------------------
   The backdrop: three ribbons, drawn by lab-backdrop.js.

   It is there for the glass. A pane reads as frosted only where a defined
   edge passes behind it and goes soft inside it. The floating discs this
   replaces crossed a pane at one or two points; a ribbon's long contour
   crosses every pane on the page, several times, and it moves.

   Each ribbon is a div twice the window's width, sliding by exactly half of
   it: compositor-only, so the background never repaints. A second, slower
   vertical sway runs on the independent `translate` property, which composes
   with the drift's `transform` instead of fighting it for the same property.
   --------------------------------------------------------------------------- */
.lc-aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.lc-aurora .rib {
  position: absolute; top: 0; left: 0; width: 200vw; height: 100%;
  will-change: transform;
  animation: var(--drift) var(--d) linear infinite, lcSway var(--sw) ease-in-out infinite alternate;
}
.lc-aurora .dl { --drift: lcRibL; }
.lc-aurora .dr { --drift: lcRibR; }
.lc-aurora svg { display: block; width: 100%; height: 100%; }
.lc-aurora .rb { opacity: calc(var(--lc-aop) * .7); }
.lc-aurora .rb-edge { fill: none; stroke: var(--lc-ahl); stroke-width: 1.5; }
.lc-aurora .s-a1 { stop-color: var(--lc-a1); }
.lc-aurora .s-a2 { stop-color: var(--lc-a2); }
.lc-aurora .s-a3 { stop-color: var(--lc-a3); }
.lc-aurora .s-a4 { stop-color: var(--lc-a4); }
@keyframes lcRibL { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
@keyframes lcRibR { from { transform: translate3d(-50%, 0, 0); } to { transform: translate3d(0, 0, 0); } }
@keyframes lcSway { from { translate: 0 -2.5vh; } to { translate: 0 2.5vh; } }
/* The main site's lipids. Free ones rise from below the window to above it
   and turn as they go; the bilayer sits at 78% of the window's height, as the
   main hero's does, so it runs below the sidebar on the right and frosts
   behind the calendar on the left. */
.lc-aurora .fls { position: absolute; inset: 0; }
.lc-aurora .fl {
  position: absolute; top: 0; will-change: transform;
  animation: lcRise var(--d) linear var(--dl) infinite;
}
.lc-aurora .fl svg { display: block; overflow: visible; animation: lcSpin var(--sd) linear infinite var(--sdir); }
@keyframes lcRise { from { transform: translate3d(0, 108vh, 0); } to { transform: translate3d(0, -12vh, 0); } }
@keyframes lcSpin { to { transform: rotate(360deg); } }
.lc-aurora .mem {
  position: absolute; left: 0; top: calc(78% - 70px); height: 140px; will-change: transform;
  animation: lcRibL var(--d) linear infinite, lcSway 24s ease-in-out infinite alternate;
}
.lc-aurora .mem svg { display: block; overflow: visible; }
@media (prefers-reduced-motion: reduce) {
  .lc-aurora .rib, .lc-aurora .mem, .lc-aurora .fl, .lc-aurora .fl svg { animation: none; }
  /* With nothing rising, park the free lipids where they can be seen. */
  .lc-aurora .fl { transform: translate3d(0, var(--py), 0); }
}
.labcal .top, .labcal main { max-width: 1200px; }
.labcal main { gap: 20px; }
/* The header is now one cell: the band fills it and the next event floats on
   top of the band's right side. The page title that used to open the row has
   gone to .lc-sr — the top bar already carries it, and the row it occupied is
   what makes the sixth week of the month fit on screen. */
.lc-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: center; padding-top: 2px; }
.lc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.lc-hero .lc-next { grid-column: 2; justify-self: stretch; align-self: center; max-width: 100%; }
.lc-card {
  background: var(--lc-glass); border: 1px solid var(--lc-hair); border-radius: 22px; padding: 18px;
  backdrop-filter: blur(34px) saturate(200%); -webkit-backdrop-filter: blur(34px) saturate(200%);
  box-shadow: inset 0 1px 0 var(--lc-edge), var(--lc-shadow); min-width: 0;
}
.lc-next {
  display: grid; grid-template-columns: auto 1fr; gap: 1px 12px; align-items: center; text-align: left; cursor: pointer; font: inherit; color: var(--text);
  background: var(--lc-glass); border: 1px solid var(--lc-hair); border-radius: 16px; padding: 11px 18px 11px 12px; max-width: 100%;
  backdrop-filter: blur(34px) saturate(200%); -webkit-backdrop-filter: blur(34px) saturate(200%); box-shadow: inset 0 1px 0 var(--lc-edge), var(--lc-shadow);
}
.lc-next-tag { grid-row: span 2; align-self: stretch; display: grid; place-items: center; padding: 0 12px; border-radius: var(--r-sm); font-size: var(--t-meta); font-weight: 700; background: var(--lc-weekly-bg); color: var(--lc-weekly-fg); }
.lc-next.special .lc-next-tag { background: var(--lc-special); color: #fff; }
.lc-next b { font-size: var(--t-lead); font-family: var(--font-display); letter-spacing: -0.01em; }
.lc-next span:last-child { font-size: var(--t-body); font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

.lc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.lc-side { display: grid; gap: 18px; position: sticky; top: 72px; }
/* ---------------------------------------------------------------------------
   The month bar. Three outlined buttons sitting beside a heading became one
   heading with a segmented control: the arrows and Today share a recessed
   track, and only Today is raised out of it, because only Today is a
   destination. The month name carries the gradient the page heading used to.
   --------------------------------------------------------------------------- */
.lc-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 13px; }
.lc-bar h2 { display: inline-flex; align-items: baseline; gap: 10px; font-size: clamp(32px, 3.3vw, 44px); letter-spacing: -0.03em; line-height: 1.1; }
.lc-m {
  background: linear-gradient(100deg, var(--acc), #4a7fe0);
  -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .04em;
}
.lc-y { font-size: var(--t-title); font-weight: 500; color: var(--muted); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }

.lc-nav { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.lc-round, .lc-today { border: 0; background: none; cursor: pointer; color: var(--text); transition: transform 140ms var(--ease-out), background-color 120ms ease, color 120ms ease; }
.lc-round { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; padding: 0; color: var(--muted); }
.lc-round svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lc-today {
  height: 34px; padding: 0 15px; border-radius: 999px; font-size: var(--t-meta); font-weight: 700;
  background: var(--surface); box-shadow: 0 1px 2px rgba(20, 30, 60, .10);
}
.lc-round:active, .lc-today:active, .lc-next:active, .lc-urow:active { transform: scale(0.94); }
.lc-next, .lc-urow { transition: transform 140ms var(--ease-out), background-color 120ms ease; }

/* A label row, not a row of words competing with the dates beneath it. */
.lc-wds {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  font-size: var(--t-micro); font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); padding: 0 7px 7px;
}
.lc-wds > span { padding-left: 4px; }
.lc-wds .sun, .lc-cell.sun .lc-num { color: var(--lc-sun); }
.lc-wds .sat, .lc-cell.sat .lc-num { color: var(--lc-sat); }

/* The view is as tall as the month in it, and eases between the two heights
   when a five-week month follows a six-week one. Each page keeps its own
   height, so during a slide the shorter neighbour is short rather than
   stretched to fill a frame that does not belong to it. */
.lc-view { position: relative; height: calc(var(--vrows) * var(--row)); overflow: hidden; touch-action: pan-y; transition: height 320ms var(--ease-drawer); }
.lc-track { position: absolute; inset: 0; }
.lc-page {
  position: absolute; top: 0; width: 100%; height: calc(var(--rows, 6) * var(--row));
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: var(--row);
}

/* Selection was a flat box with a 2px border. It is now a tile: a shallow
   gradient, a ring at just over half strength, and a shadow cast down — so it
   reads as sitting on the grid rather than drawn into it. */
.lc-lens { position: absolute; top: 0; left: 0; width: calc(100% / 7); height: var(--row); pointer-events: none; transition: transform 320ms var(--ease-drawer); }
.lc-lens::before {
  content: ""; position: absolute; inset: 3px; border-radius: var(--r-md);
  background: linear-gradient(155deg, color-mix(in srgb, var(--acc) 17%, transparent), color-mix(in srgb, var(--violet) 21%, transparent));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--violet) 52%, transparent),
              0 8px 20px -10px color-mix(in srgb, var(--violet) 72%, transparent);
}

.lc-cell {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; overflow: hidden;
  padding: 7px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--text); font: inherit;
  transition: transform 140ms var(--ease-out);
}
/* The week's rule, pulled in from the card's edge at both ends. */
.lc-cell::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--border); }
.lc-cell.sun::before { left: 7px; }
.lc-cell.sat::before { right: 7px; }
/* Saturday and Sunday. Three per cent: enough to find the week's edges, not
   enough to look like a colour. */
.lc-cell.sun, .lc-cell.sat { background: color-mix(in srgb, var(--text) 2%, transparent); }
.lc-cell.out { background: none; }
.lc-cell:focus-visible { outline-offset: -3px; border-radius: var(--r-md); }
.lc-cell:active { transform: scale(0.97); }

.lc-num {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--font-display); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: color 160ms ease, background-color 160ms ease;
}
.lc-cell.out .lc-num { color: var(--muted); font-weight: 500; opacity: .55; }
.lc-cell.out .lc-chips { opacity: .42; }
.lc-cell.is-today .lc-num { background: var(--lc-today); color: #fff; box-shadow: 0 3px 10px -2px color-mix(in srgb, var(--lc-today) 70%, transparent); }
.lc-cell[aria-pressed="true"]:not(.is-today) .lc-num { color: var(--violet); }

/* Events: a tinted surface with a saturated rail, not a sticker. The rail is
   what lets the two kinds stay distinguishable once the fill is quiet enough
   to put two of them in a cell without the cell shouting. */
.lc-chips { display: grid; gap: 3px; width: 100%; min-width: 0; align-content: start; }
.lc-chip {
  position: relative; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  border-radius: 5px; padding: 3px 6px 3px 12px; font-size: var(--t-meta); line-height: 1.3; font-weight: 600;
  word-break: keep-all; overflow-wrap: anywhere;
}
.lc-chip::before { content: ""; position: absolute; left: 4px; top: 3.5px; bottom: 3.5px; width: 3px; border-radius: 2px; background: currentColor; opacity: .62; }
.lc-chip b { font-weight: 700; font-variant-numeric: tabular-nums; }
.lc-chip.weekly { background: var(--lc-weekly-bg); color: var(--lc-weekly-fg); }
.lc-chip.special { background: var(--lc-special-bg); color: var(--lc-special-fg); }
.lc-more { font-size: var(--t-micro); font-weight: 700; color: var(--muted); padding-left: 5px; }

/* Paging with the buttons or the keyboard brings the month in on a diagonal:
   --k is column plus row, so the wave runs from the first of the month toward
   the last. A swipe skips it — the next month is already under the finger, and
   animating it in would argue with the gesture. */
@keyframes lcCellIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.lc-page.in .lc-cell { animation: lcCellIn 240ms var(--ease-out) backwards; animation-delay: calc(var(--k, 0) * 12ms); }

.lc-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--t-meta); font-weight: 500; color: var(--muted); padding-top: 11px; }
.lc-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.lc-key { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.lc-key.weekly { background: var(--lc-weekly); }
.lc-key.special { background: var(--lc-special); }

.lc-dhead { display: flex; align-items: center; gap: 14px; }
.lc-big { font-family: var(--font-display); font-size: 68px; line-height: 1; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.lc-dhead.has .lc-big { background: linear-gradient(135deg, var(--acc), var(--violet) 60%, var(--lc-pink)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.lc-dmeta { display: grid; gap: 1px; min-width: 0; }
.lc-dmeta b { font-size: var(--t-title); font-family: var(--font-display); letter-spacing: -0.012em; }
.lc-dmeta span { font-size: var(--t-body); font-weight: 500; color: var(--muted); }
.lc-tag { margin-left: auto; align-self: flex-start; background: var(--lc-today); color: #fff; font-size: var(--t-meta); font-weight: 700; padding: 3px 11px; border-radius: 999px; }
.lc-devents { display: grid; gap: 8px; }
.lc-ev { position: relative; display: grid; gap: 2px; padding: 12px 14px 12px 20px; border-radius: var(--r-md); background: var(--lc-weekly-bg); color: var(--lc-weekly-fg); }
.lc-ev::before { content: ""; position: absolute; left: 9px; top: 11px; bottom: 11px; width: 3px; border-radius: 2px; background: currentColor; opacity: .62; }
.lc-ev.special { background: var(--lc-special-bg); color: var(--lc-special-fg); }
.lc-etime { font-size: var(--t-body); font-weight: 700; font-variant-numeric: tabular-nums; }
.lc-ename { font-family: var(--font-display); font-size: var(--t-lead); line-height: 1.3; letter-spacing: -0.012em; }
.lc-eplace { font-size: var(--t-body); line-height: 1.45; font-weight: 500; }
.lc-empty { color: var(--muted); font-size: var(--t-body); font-weight: 500; }
.lc-up { display: grid; gap: 2px; margin-inline: -8px; }
.lc-urow {
  display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; width: 100%; text-align: left; border: 0; background: none; cursor: pointer; color: var(--text); font: inherit;
  padding: 9px 10px 9px 20px; border-radius: var(--r-md); position: relative;
}
.lc-urow::before { content: ""; position: absolute; left: 9px; top: 11px; bottom: 11px; width: 4px; border-radius: var(--r-xs); background: var(--lc-weekly); }
.lc-urow.special::before { background: var(--lc-special); }
.lc-uname { font-size: var(--t-body); line-height: 1.35; grid-column: 1; }
.lc-uwhen { font-size: var(--t-body); font-weight: 500; color: var(--muted); grid-column: 1; font-variant-numeric: tabular-nums; }
.lc-ubadge { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: var(--t-meta); font-weight: 700; color: var(--violet); white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  .lc-round:hover, .lc-today:hover { border-color: var(--violet); }
  .lc-home:hover, .lc-theme:hover { border-color: var(--violet); }
  .lc-cell:hover .lc-num { background: var(--surface-2); }
  .lc-cell.is-today:hover .lc-num { background: var(--lc-today); }
  .lc-urow:hover { background: color-mix(in srgb, var(--violet) 9%, transparent); }
  .lc-next:hover { border-color: var(--violet); }
}
@media (max-width: 900px) {
  .labcal { --row: 64px; }
  .lc-layout { grid-template-columns: minmax(0, 1fr); }
  .lc-side { position: static; }
  .lc-card { padding: 14px 10px; border-radius: var(--r-lg); }
  .lc-side .lc-card { padding: 16px 14px; }
  .lc-bar { padding-inline: 6px; }
  .lc-bar h2 { font-size: 27px; }
  .lc-y { font-size: var(--t-lead); }
  .lc-today { padding: 0 14px; }
  .lc-round, .lc-today { height: 38px; }
  .lc-round { width: 38px; }
  .lc-wds { padding: 0; text-align: center; }
  .lc-cell { align-items: center; padding: 5px 2px; gap: 4px; }
  .lc-chips { display: flex; justify-content: center; gap: 3px; width: auto; }
  .lc-chip { width: 9px; height: 9px; padding: 0; border-radius: 50%; }
  .lc-chip b, .lc-chip span { display: none; }
  .lc-chip.weekly { background: var(--lc-weekly); }
  .lc-more { display: none; }
  .lc-legend { padding-inline: 6px; }
  .lc-next { width: 100%; }
  .lc-up { margin-inline: -4px; }
}
@media (prefers-reduced-motion: no-preference) {
  .lc-enter { animation: lcMaterialize 460ms var(--ease-out) backwards; animation-delay: calc(var(--e, 0) * 70ms); }
  .lc-rise { animation: lcRise 240ms var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 40ms); }
}
@keyframes lcMaterialize { from { opacity: 0; transform: translateY(14px) scale(0.985); filter: blur(6px); } }
@keyframes lcRise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .lc-lens, .lc-cell, .lc-round, .lc-today, .lc-next, .lc-urow { transition: none; }
  .lc-cell:active, .lc-round:active, .lc-today:active, .lc-next:active, .lc-urow:active { transform: none; }
  .lc-enter, .lc-rise { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .lc-card, .lc-next { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .lc-aurora { display: none; }
}
@media (prefers-contrast: more) {
  .lc-card, .lc-next { background: var(--surface); border-color: var(--text); }
  .lc-aurora { display: none; }
}
.lc-tools { display: flex; align-items: center; gap: 8px; }
.lc-admin { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px 0 11px; border: 1px solid var(--border-2); border-radius: 999px; background: var(--surface); color: var(--text); font-size: var(--t-meta); font-weight: 600; cursor: pointer; white-space: nowrap; transition: transform 140ms var(--ease-out), border-color 120ms ease; }
.lc-admin svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lc-admin.on { border-color: var(--violet); color: var(--violet); }
/* Back to the main lab site. Same pill as Admin so the two read as one
   set of tools rather than a link bolted beside a button. */
.lc-home { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px 0 11px; border: 1px solid var(--border-2); border-radius: 999px; background: var(--surface); color: var(--text); font-size: var(--t-meta); font-weight: 600; text-decoration: none; white-space: nowrap; transition: transform 140ms var(--ease-out), border-color 120ms ease; }
.lc-home svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lc-home:active { transform: scale(0.96); }
/* Light / dark. The page already followed a stored choice and fell back to the
   system setting; there was simply nothing to click. The icon shows the theme
   in force, matching the main site's switch rather than inventing a second
   convention, and the three-block pattern is the one the rest of this file uses
   for a theme that may be unset. */
.lc-theme { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border: 1px solid var(--border-2); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer; transition: transform 140ms var(--ease-out), border-color 120ms ease; }
.lc-theme:active { transform: scale(0.94); }
.lc-theme svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.lc-theme .i-sun { display: block; }
.lc-theme .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lc-theme .i-sun { display: none; }
  :root:not([data-theme="light"]) .lc-theme .i-moon { display: block; }
}
:root[data-theme="dark"] .lc-theme .i-sun { display: none; }
:root[data-theme="dark"] .lc-theme .i-moon { display: block; }
:root[data-theme="light"] .lc-theme .i-sun { display: block; }
:root[data-theme="light"] .lc-theme .i-moon { display: none; }
.lc-admin:active, .lc-add:active, .lc-eedit:active, .lc-btn:active { transform: scale(0.96); }
.lc-ev { position: relative; }
.lc-eedit { position: absolute; top: 8px; right: 8px; border: 0; border-radius: 999px; padding: 4px 12px; font-size: var(--t-meta); font-weight: 700; color: inherit; background: color-mix(in srgb, currentColor 16%, transparent); cursor: pointer; transition: transform 140ms var(--ease-out); }
.lc-add { width: 100%; height: 44px; border: 1.5px dashed var(--violet); border-radius: var(--r-md); background: color-mix(in srgb, var(--violet) 8%, transparent); color: var(--violet); font-size: var(--t-body); font-weight: 700; cursor: pointer; transition: transform 140ms var(--ease-out), background-color 120ms ease; }
.lc-sheet { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: hidden auto; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgba(10, 16, 40, .55); }
.lc-sheet::backdrop { background: rgba(8, 12, 28, .42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lc-form { display: grid; gap: 13px; }
.lc-form h2 { font-size: var(--t-xl); letter-spacing: -0.02em; }
.lc-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.lc-field { display: grid; gap: 5px; font-size: var(--t-body); font-weight: 600; color: var(--text-2); min-width: 0; }
.lc-field input, .lc-field select { width: 100%; font: inherit; font-size: var(--t-lead); font-weight: 500; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; }
.lc-field input:focus, .lc-field select:focus { outline: 2px solid var(--violet); outline-offset: 1px; }
.lc-seg { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3px; padding: 3px; border-radius: var(--r-md); background: var(--surface-2); }
.lc-seg input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.lc-seg span { display: block; text-align: center; padding: 8px 6px; border-radius: var(--r-sm); font-size: var(--t-body); font-weight: 600; cursor: pointer; color: var(--text-2); transition: background-color 140ms ease, color 140ms ease; }
.lc-seg input:checked + span { background: var(--violet); color: var(--bg); }
.lc-seg input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }
.lc-note { font-size: var(--t-body); font-weight: 500; color: var(--text-2); line-height: 1.5; }
.lc-formmsg { color: var(--warn); font-size: var(--t-body); font-weight: 600; }
.lc-formmsg:empty { display: none; }
.lc-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.lc-btn { height: 42px; padding: 0 18px; border: 0; border-radius: var(--r-md); background: linear-gradient(135deg, var(--acc), var(--violet)); color: var(--acc-ink); font-size: var(--t-body); font-weight: 700; cursor: pointer; transition: transform 140ms var(--ease-out); }
.lc-btn:disabled { opacity: .6; cursor: default; }
.lc-btn.ghost { background: var(--surface-2); color: var(--text); }
.lc-btn.danger { margin-right: auto; background: none; color: var(--warn); padding: 0 6px; }
@media (hover: hover) and (pointer: fine) { .lc-admin:hover { border-color: var(--violet); } .lc-add:hover { background: color-mix(in srgb, var(--violet) 15%, transparent); } }
@media (max-width: 560px) {
  .labcal .brand small { display: none; }
  .labcal .brand > span:last-child { font-size: var(--t-body); }
  .labcal .lang button { padding: 4px 9px; }
  .lc-admin { width: 36px; padding: 0; justify-content: center; }
  .lc-admin span { display: none; }
  .lc-sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; border-width: 1px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: no-preference) {
  .lc-sheet { opacity: 0; transform: translateY(10px) scale(0.97); transition: opacity 170ms ease, transform 170ms var(--ease-out), overlay 170ms allow-discrete, display 170ms allow-discrete; }
  .lc-sheet[open] { opacity: 1; transform: none; transition-duration: 260ms; }
  @starting-style { .lc-sheet[open] { opacity: 0; transform: translateY(10px) scale(0.97); } }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 560px) {
  .lc-sheet { transform: translateY(100%); transition-timing-function: ease, var(--ease-drawer); }
  .lc-sheet[open] { transition-duration: 320ms; }
  @starting-style { .lc-sheet[open] { opacity: 1; transform: translateY(100%); } }
}
.labcal footer { max-width: 1200px; }
.labcal .lang button { white-space: nowrap; }
@media (max-width: 900px) { .labcal .brand small { display: none; } }
/* ---------------------------------------------------------------------------
   The header band: glass lab objects, drawn in lab-scene.js.

   One material throughout — a frosted fill that is brighter at the top-left,
   a fine edge, a specular stroke along the lit side, a soft contact shadow —
   so the flask, the plate, the widget and the avatars read as objects made of
   the same glass as the panes around them, not as illustrations pasted on.

   The band is sized by its own ratio, 900:150, so nothing in it is ever
   cropped; on a phone the script narrows the view to the plate and the chart.
   --------------------------------------------------------------------------- */
.lc-scene {
  --sg-1: rgba(255, 255, 255, .8); --sg-2: rgba(255, 255, 255, .22);
  --sg-edge: rgba(96, 116, 160, .45); --sg-edge0: rgba(96, 116, 160, 0);
  --sg-spec: rgba(255, 255, 255, .95); --sg-shadow: rgba(30, 45, 80, .12);
  --sg-well: rgba(120, 140, 180, .14); --sg-ink: rgba(40, 56, 92, .2); --sg-ink2: rgba(40, 56, 92, .1);
  --sg-net: rgba(70, 90, 140, .35); --sg-dot: #64748b; --sg-q: #2563eb;
  grid-column: 1;
  position: relative; overflow: hidden; min-width: 0; width: 100%;
  aspect-ratio: 900 / 150;
  border-radius: var(--r-lg);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lc-scene {
    --sg-1: rgba(255, 255, 255, .22); --sg-2: rgba(255, 255, 255, .04);
  --sg-edge: rgba(255, 255, 255, .3); --sg-edge0: rgba(255, 255, 255, 0);
  --sg-spec: rgba(255, 255, 255, .55); --sg-shadow: rgba(0, 0, 0, .4);
  --sg-well: rgba(255, 255, 255, .07); --sg-ink: rgba(255, 255, 255, .2); --sg-ink2: rgba(255, 255, 255, .1);
  --sg-net: rgba(170, 190, 240, .35); --sg-dot: #cbd5e1; --sg-q: #7cb3ff;
  }
}
:root[data-theme="dark"] .lc-scene {
  --sg-1: rgba(255, 255, 255, .22); --sg-2: rgba(255, 255, 255, .04);
  --sg-edge: rgba(255, 255, 255, .3); --sg-edge0: rgba(255, 255, 255, 0);
  --sg-spec: rgba(255, 255, 255, .55); --sg-shadow: rgba(0, 0, 0, .4);
  --sg-well: rgba(255, 255, 255, .07); --sg-ink: rgba(255, 255, 255, .2); --sg-ink2: rgba(255, 255, 255, .1);
  --sg-net: rgba(170, 190, 240, .35); --sg-dot: #cbd5e1; --sg-q: #7cb3ff;
}
.lc-scene > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.lc-scene .s-g1 { stop-color: var(--sg-1); }
.lc-scene .s-g2 { stop-color: var(--sg-2); }
.lc-scene .s-e0 { stop-color: var(--sg-edge0); }
.lc-scene .s-e1 { stop-color: var(--sg-edge); }
.lc-scene .gb { stroke: var(--sg-edge); stroke-width: 1.1; }
.lc-scene .sp { fill: none; stroke: var(--sg-spec); stroke-width: 1.8; stroke-linecap: round; }
.lc-scene .sp-soft { stroke-width: 1.3; opacity: .7; }
.lc-scene .sp-top { stroke-width: 1; opacity: .9; }
.lc-scene .sh { fill: var(--sg-shadow); }
.lc-scene .shelf { fill: none; stroke: url(#sgShelf); stroke-width: 1.2; }
.lc-scene .wl { fill: var(--sg-well); stroke: var(--sg-edge); stroke-width: .8; }
.lc-scene .sk { fill: var(--sg-ink); }
.lc-scene .sk2 { fill: var(--sg-ink2); }
.lc-scene .ax { fill: none; stroke: var(--sg-ink); stroke-width: 1; }
.lc-scene .tdot { fill: var(--sg-dot); }
.lc-scene .q { fill: var(--sg-q); font: 700 15px var(--font-display); }
.lc-scene .wm { font: 700 21px var(--font-display); letter-spacing: -0.02em; }
/* Things that grow from their own centre, and bars that grow from their base. */
.lc-scene .fb { transform-box: fill-box; transform-origin: center; }
.lc-scene .fbb { transform-box: fill-box; transform-origin: center bottom; }
/* The conversation lines and the data path keep flowing the whole time. */
.lc-scene .net { fill: none; stroke: var(--sg-net); stroke-width: 1.2; stroke-dasharray: 2 5; stroke-linecap: round; animation: lcNet 2.4s linear infinite; }
.lc-scene .strm { fill: none; stroke: var(--sg-net); stroke-width: 1; stroke-dasharray: 1.5 4; stroke-linecap: round; animation: lcNet 3.2s linear infinite; }
@keyframes lcNet { to { stroke-dashoffset: -14; } }
.lc-scene.away * { animation-play-state: paused !important; }

@media (max-width: 760px) {
  /* Below this the event pill and the band cannot share a row, so they stack. */
  .lc-hero { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .lc-scene { grid-area: auto; }
  .lc-hero .lc-next { grid-area: auto; justify-self: stretch; margin-right: 0; max-width: 100%; }
}
@media (max-width: 700px) {
  /* The script has narrowed the view to the plate and the chart. */
  .lc-scene { aspect-ratio: 352 / 150; }
}
@media (prefers-reduced-motion: reduce) {
  /* Held at fourteen and a half seconds: the plate is dosed, the chart drawn,
     the conversation finished — a still of the work done, not an empty bench. */
  .lc-scene * { animation-play-state: paused !important; animation-delay: -14.5s !important; }
}

.final-events { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.final-event { display: grid; gap: 8px; align-content: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; }
.final-name { width: fit-content; padding: 3px 12px; border-radius: 999px; background: linear-gradient(135deg, var(--acc), var(--violet)); color: var(--acc-ink); font-size: var(--t-body); font-weight: 700; }
.final-when { margin: 0; font-family: var(--font-display); font-size: var(--t-xl); font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.final-place { margin: 0; color: var(--text-2); font-size: var(--t-body); line-height: 1.55; }
.final-place b { color: var(--text); margin-right: 4px; }
.prefer { background: var(--pref-soft); border: 1px solid var(--border); border-left: 4px solid var(--pref); border-radius: var(--r-md); padding: 16px 18px; gap: 10px; }
.prefer h2 { font-size: var(--t-lead); display: flex; align-items: center; gap: 8px; }
.prefer h2 .star, .day .star, .sw.pref { color: var(--pref); }
.prefer p { margin: 0; line-height: 1.6; }
.pref-list { display: grid; gap: 4px; }
.pref-list ul { margin: 0 0 6px; padding-left: 20px; display: grid; gap: 3px; font-variant-numeric: tabular-nums; }
.pref-round { font-size: var(--t-meta); font-weight: 700; color: var(--pref); }
.tag.pref { border-color: var(--pref); color: var(--pref); font-weight: 700; }
.email-note { background: var(--acc-soft); border-radius: var(--r-sm); padding: 10px 12px; font-size: var(--t-body); font-weight: 500; }
.summary { margin-top: 12px; background: var(--surface); border: 1px solid var(--acc); border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 8px; }
.summary pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.6 var(--font-body); font-variant-numeric: tabular-nums; user-select: all; -webkit-user-select: all; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--text); color: var(--bg); font-size: var(--t-meta); font-weight: 700; flex: none; }
section { display: grid; gap: 14px; }
.hint { color: var(--muted); font-size: var(--t-meta); }

/* People */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 10px; }
.person {
  text-align: left; cursor: pointer; display: grid; gap: 2px; min-width: 0;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 12px 14px;
}
@media (hover: hover) and (pointer: fine) { .person:hover:not(:disabled) { border-color: var(--border-2); } }
.person[aria-pressed="true"] { border-color: var(--acc); box-shadow: inset 0 0 0 1.5px var(--acc); }
.person .role { font-size: var(--t-meta); color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.person .nm { font-size: var(--t-lead); font-weight: 700; font-family: var(--font-display); }
.person .aff { font-size: var(--t-meta); color: var(--muted); overflow-wrap: anywhere; }
.tag { font-size: var(--t-micro); padding: 0 7px; border-radius: 999px; border: 1px solid var(--border-2); }
.state { font-size: var(--t-meta); font-weight: 600; color: var(--acc); }
.state.none { color: var(--muted); font-weight: 500; }

/* Calendar */
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--t-meta); color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: var(--r-xs); border: 1px solid var(--border); display: inline-block; }
.sw.full { background: var(--acc); border-color: var(--acc); }
.sw.part { background: var(--surface); border: 2px solid var(--acc); }
.sw.heat { background: rgba(var(--heat), .32); }
.sw.off { background: var(--surface-2); }
.sw.pref { border: 2px solid var(--pref); background: var(--surface); font-size: var(--t-micro); line-height: 10px; font-style: normal; text-align: center; font-weight: 700; }
.sw.block { background: repeating-linear-gradient(135deg, var(--surface-2) 0 3px, var(--warn) 3px 4px); }
.months { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
.month { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; min-width: 0; }
.month h3 { margin-bottom: 10px; }
.month h3:has(+ .month-label) { margin-bottom: 6px; }
.month-label { margin: 0 0 12px; display: inline-block; font-size: var(--t-meta); font-weight: 700; color: var(--acc); background: var(--acc-soft); border-radius: var(--r-sm); padding: 4px 10px; }
.round-tag { display: inline-block; max-width: 100%; font-size: var(--t-micro); font-weight: 700; color: var(--acc); background: var(--acc-soft); border-radius: var(--r-xs); padding: 1px 6px; white-space: normal; overflow-wrap: anywhere; vertical-align: 1px; }
.best-row .when .round-tag { display: block; width: fit-content; margin-top: 3px; }
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wd { font-size: var(--t-meta); text-align: center; color: var(--muted); font-weight: 600; }
.wd.sun { color: var(--warn); }
.day {
  aspect-ratio: 1 / 1; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface);
  position: relative; display: grid; place-items: center; padding: 0; cursor: pointer;
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: var(--t-body);
}
@media (hover: hover) and (pointer: fine) { .day:hover:not(:disabled) { border-color: var(--acc); } }
.day.heat { background: rgba(var(--heat), var(--h, 0)); }
.day.pref { border: 2px solid var(--pref); }
.day.part { border: 2px solid var(--acc); }
.day.full { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.day.focus { box-shadow: 0 0 0 3px var(--violet); }
.day:disabled { cursor: default; background: var(--surface-2); color: var(--muted); border-color: transparent; font-weight: 500; opacity: .7; }
.day.final:disabled { background: linear-gradient(135deg, var(--acc), var(--violet)); border-color: transparent; color: var(--acc-ink); font-weight: 700; opacity: 1; }
.day.pref:disabled { border: 2px solid var(--pref); }
.day.blocked:disabled { background: repeating-linear-gradient(135deg, var(--surface-2) 0 5px, transparent 5px 7px), var(--surface-2); color: var(--warn); text-decoration: line-through; opacity: 1; }
.day .cnt { position: absolute; right: 4px; bottom: 3px; font-size: var(--t-micro); line-height: 1; font-weight: 700; }
.day .star { position: absolute; right: -4px; top: -4px; z-index: 1; width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; font-size: var(--t-micro); line-height: 1; background: var(--pref); color: var(--surface) !important; }
.blank { aspect-ratio: 1 / 1; }

/* Time slots */
.slots-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; display: grid; gap: 12px; }
.slots-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.slots-head h3 { font-size: var(--t-lead); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--border-2); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: var(--t-meta); font-weight: 600; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .chip-btn:hover { border-color: var(--acc); } }
.range-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.range-field { display: grid; gap: 4px; font-size: var(--t-meta); font-weight: 600; color: var(--muted); min-width: 132px; flex: 1 1 132px; }
.range-field select { font-size: var(--t-body); font-weight: 600; font-variant-numeric: tabular-nums; padding: 9px 10px; background: var(--surface); }
.range-row .btn { flex: 0 0 auto; padding-block: 10px; }
.chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.range-pill { display: inline-flex; align-items: center; gap: 4px; background: var(--acc); color: var(--acc-ink); border-radius: 999px; padding: 3px 4px 3px 12px; font-size: var(--t-meta); font-weight: 600; font-variant-numeric: tabular-nums; }
.range-pill .x { border: 0; background: rgba(255, 255, 255, .25); color: inherit; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: var(--t-body); line-height: 1; display: grid; place-items: center; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.slot {
  border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--r-sm); padding: 9px 10px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-weight: 600; font-size: var(--t-body);
}
@media (hover: hover) and (pointer: fine) { .slot:hover { border-color: var(--acc); } }
.slot.pref { border-color: var(--pref); }
.slot[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.slot .n { font-size: var(--t-micro); font-weight: 700; padding: 0 6px; border-radius: 999px; background: rgba(var(--heat), .18); }
.slot[aria-pressed="true"] .n { background: rgba(255, 255, 255, .28); }
.empty-panel { color: var(--muted); font-size: var(--t-body); border: 1px dashed var(--border-2); border-radius: var(--r-md); padding: 16px; }

/* Save */
.save { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; display: grid; gap: 12px; }
label { font-size: var(--t-body); font-weight: 600; display: grid; gap: 6px; }
textarea, input, select {
  font: inherit; font-size: var(--t-body); color: var(--text); background: var(--bg); border: 1px solid var(--border-2);
  border-radius: var(--r-sm); padding: 9px 10px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 64px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.btn { font-weight: 700; font-size: var(--t-body); border: 0; border-radius: var(--r-sm); padding: 11px 22px; background: var(--acc); color: var(--acc-ink); cursor: pointer; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border-2); }
.btn.danger { background: transparent; color: var(--warn); border: 1px solid var(--warn); }
.btn.small { font-size: var(--t-meta); padding: 6px 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.msg { font-size: var(--t-body); color: var(--muted); }
.msg.ok { color: var(--acc); font-weight: 600; }
.msg.err { color: var(--warn); font-weight: 600; }

/* Results */
.best { display: grid; gap: 8px; }
.best-row {
  display: grid; grid-template-columns: minmax(0, 1.2fr) 56px minmax(0, 2fr); gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px;
}
.best-row .when { display: grid; font-variant-numeric: tabular-nums; }
.best-row .when b { font-weight: 700; }
.best-row .when span { color: var(--text-2); font-size: var(--t-meta); }
.best-row .n { font-weight: 700; color: var(--acc); font-variant-numeric: tabular-nums; }
.best-row .who { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.best-row.all { border-color: var(--acc); box-shadow: inset 0 0 0 1px var(--acc); }
.chip { font-size: var(--t-meta); background: var(--acc-soft); border-radius: 999px; padding: 1px 9px; }
.notes { display: grid; gap: 6px; font-size: var(--t-body); }
.notes div { overflow-wrap: anywhere; }
.loading { color: var(--muted); }
footer { max-width: 980px; margin: 40px auto 0; color: var(--muted); font-size: var(--t-meta); }

@media (max-width: 560px) {
  .best-row { grid-template-columns: 1fr auto; }
  .best-row .who { grid-column: 1 / -1; }
  .month { padding: 10px; }
  .grid { gap: 3px; }
  .day { font-size: var(--t-body); }
  .brand small { display: none; }
}
/* Floating save bar: always reachable once a name is chosen */
.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--bar); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
}
.savebar-in { max-width: 980px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.savebar .who-line { min-width: 0; display: grid; font-size: var(--t-meta); line-height: 1.35; }
.savebar .who-line b { font-size: var(--t-body); letter-spacing: 0.005em; }
.savebar .msg { overflow-wrap: anywhere; }

/* Press feedback on everything pressable; it lives on the press and is instant */
.day, .slot, .person, .btn, .chip-btn, .lang button { transition: transform 160ms var(--ease-out), background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
.day:active:not(:disabled), .slot:active, .person:active:not(:disabled), .btn:active:not(:disabled), .chip-btn:active, .lang button:active { transform: scale(0.96); }

@media (prefers-reduced-motion: no-preference) {
  .slots-panel { transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); transform-origin: top center; }
  @starting-style { .slots-panel { opacity: 0; transform: translateY(-6px) scale(0.99); } }
  .savebar { transition: transform 240ms var(--ease-out), opacity 240ms var(--ease-out); }
  @starting-style { .savebar { transform: translateY(100%); opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  .day, .slot, .person, .btn, .chip-btn, .lang button { transition: background-color 120ms ease, border-color 120ms ease; }
  .day:active:not(:disabled), .slot:active, .person:active:not(:disabled), .btn:active:not(:disabled), .chip-btn:active, .lang button:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --bar: var(--bg); }
  .top::before, .savebar { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ===========================================================================
   Narrow-phone fixes (2026-11-15)
   =========================================================================== */

/* THE CLIPPING BUG.
   .lc-cal is a grid whose single track was `auto`, and an auto track grows to
   its widest child rather than to its container. The widest child is the month
   bar, whose min-content is 360px (title 177 + nav 161 + gap) against a 341px
   card content box. So the bar pushed the track to 360px, and .lc-wds and
   .lc-view inherited it — which is why the Saturday column ran 12px past a
   375px viewport and the next-month chevron 6px, while the page itself
   reported no horizontal overflow (.labcal clips it).
   Pinning the track to the container is the structural half of the fix; the
   min-width:0 lets the bar's flex children actually shrink into it instead of
   overflowing in turn. */
.lc-cal { grid-template-columns: minmax(0, 1fr); padding: 16px 11px 14px; }
.lc-bar { min-width: 0; }
.lc-bar h2, .lc-nav { min-width: 0; }

/* The other half: make the bar's min-content fit. At 375px the budget is
   341 - 12 (bar padding) = 329, and the measured content was 348. Trimming the
   title and the Today padding brings it to ~318 without touching the round
   buttons, whose size is pinned by the tap-target rule below. */
@media (max-width: 430px) {
  .lc-bar h2 { font-size: var(--t-xl); gap: 6px; }
  .lc-y { font-size: var(--t-body); }
  .lc-today { padding: 0 11px; }
}

/* TAP TARGETS.
   Eight controls measured under Apple's 44x44 floor: the language pair at
   54x28 and 64x28, Admin and the theme switch at 36x36, and the month
   controls at 38x38. Rather than inflate them visually — which would reopen
   the width problem above and coarsen a deliberately compact bar — each gets a
   centred invisible hit area. The visual size is unchanged; only the region
   that accepts a finger grows. */
.lang button,
.lc-home,
.lc-admin,
.lc-theme,
.lc-round,
.lc-today { position: relative; }

.lang button::after,
.lc-home::after,
.lc-admin::after,
.lc-theme::after,
.lc-round::after,
.lc-today::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, 44px);
  height: max(100%, 44px);
  transform: translate(-50%, -50%);
  /* Pointer-only: it must never paint, never trap text selection, and never
     sit above a sibling's own hit area. */
  background: transparent;
  pointer-events: auto;
}

/* ===========================================================================
   Glass.

   One material for every pane — the calendar, the day panel, Upcoming, the
   next-event pill and the scene band — so they read as one family of sheets
   floating over the same backdrop.

   What carries it, from the outside in:
     - a rim that catches light. A 1px ring whose brightness runs from near
       white at the top-left to almost nothing at the bottom-right and back up a
       little at the far corner. border-image cannot follow a border-radius, so
       it is a pseudo-element with a gradient background, masked to its own
       1px padding;
     - a sheen across the surface, strongest where the rim is brightest;
     - a specular top edge, a faint inner keyline and soft inner light along
       the bottom, so the pane has thickness instead of being a flat cut-out;
     - and the blur itself, which now has defined shapes behind it to frost.
   =========================================================================== */
.lc-card, .lc-next, .lc-scene {
  position: relative;
  border: 0;
  background: var(--lc-sheen), var(--lc-glass);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow:
    inset 0 1px 0 var(--lc-edge),
    inset 0 0 0 1px var(--lc-inner),
    inset 0 -18px 30px -26px var(--lc-glow),
    var(--lc-shadow);
}
.lc-card::after, .lc-next::after, .lc-scene::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--lc-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
@media (prefers-reduced-transparency: reduce) {
  .lc-card, .lc-next, .lc-scene { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .lc-card, .lc-next, .lc-scene { background: var(--surface); box-shadow: inset 0 0 0 1px var(--text); }
  .lc-card::after, .lc-next::after, .lc-scene::after { display: none; }
}

/* ===========================================================================
   Phones: the top bar, and the event dots.

   With the theme switch added, the tools row needed 319px beside the brand on
   a 375px screen and ran 74px off the right edge, taking the theme switch and
   Admin with it. Admin was already icon-only below 560px; Lab site was not.
   Below 560px both are 36px icon buttons, and below 430px the language pair
   reads 한 / EN. Every control keeps its full name for assistive tech: Lab
   site's label is clipped rather than removed (Admin gets an aria-label from
   script), and the language buttons keep their own text at font-size 0 with
   the short form drawn in ::before. Below 350px the brand shows the mark only.
   =========================================================================== */
@media (max-width: 560px) {
  .lc-tools { gap: 6px; }
  .lc-home { width: 36px; padding: 0; justify-content: center; }
  .lc-home span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 430px) {
  .labcal .lang button { font-size: 0; padding: 4px 10px; }
  .labcal .lang button::before { font-size: 12px; font-weight: 700; }
  .labcal .lang button[data-lang-btn="ko"]::before { content: "한"; }
  .labcal .lang button[data-lang-btn="en"]::before { content: "EN"; }
}
@media (max-width: 350px) {
  .labcal .brand > span:last-child { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 900px) {
  /* Below 900px an event is a 9px dot. The desktop rail must not draw inside
     it, and a special event goes back to the full gradient: the pale tint that
     suits a rail behind text is close to invisible as a whole dot. */
  .lc-chip::before { display: none; }
  .lc-chip.special { background: var(--lc-special); }
}
