@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&display=swap');

/* Colours live in theme.css; this file only reads tokens. */
:root {
  --radius: 21px;
  --rail: 62px;
  --gap: 14px;
  --row: 76px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--ground);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 60vw; height: 60vw;
  top: -22vw; left: -10vw;
  background: radial-gradient(circle, var(--blob-1), transparent 68%);
}

body::after {
  width: 52vw; height: 52vw;
  bottom: -20vw; right: -8vw;
  background: radial-gradient(circle, var(--blob-2), transparent 70%);
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -.028em;
  margin: 0;
}

button, input, select, textarea { font: inherit; color: inherit; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb {
  background: rgb(var(--ink-rgb) / .18);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}

/* ------------------------------------------------------------------ shell */

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
  gap: var(--gap);
  padding: var(--gap);
}

.rail {
  flex: 0 0 var(--rail);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgb(255 255 255 / calc(.7 * var(--glass-k)));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 13px 7px;
}

.rail .mark {
  width: 33px; height: 33px;
  border-radius: 11px;
  overflow: hidden;
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  letter-spacing: -.03em;
  margin-bottom: 9px;
  box-shadow: 0 6px 16px rgb(var(--accent-rgb) / .38);
}

.rail button {
  width: 42px; height: 42px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .18s, color .18s;
}

.rail button:hover { background: rgb(255 255 255 / calc(.4 * var(--glass-k))); color: var(--ink); }

.rail button.active {
  background: var(--raised);
  color: var(--accent);
  box-shadow: 0 6px 16px rgb(var(--shadow-rgb) / calc(.16 * var(--shadow-k)));
}

.rail button svg { width: 18px; height: 18px; }

.rail .spacer { flex: 1; }

/* Application streak: grey while it is still alive but not yet earned today,
   amber once you have applied today. */
.rail .streak {
  margin-top: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  color: var(--faint);
  cursor: default;
}
.rail .streak .flame svg { width: 22px; height: 22px; display: block; }
.rail .streak .n { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rail .streak.lit { color: var(--amber); }
.rail .streak.lit .n { color: var(--amber-text); }
.rail .streak.pop .flame { animation: streak-pop .6s cubic-bezier(.3, 1.6, .5, 1); }

@keyframes streak-pop {
  0% { transform: scale(.6); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .rail .streak.pop .flame { animation: none; } }

.streak-widget { display: flex; flex-direction: column; gap: 12px; height: 100%; justify-content: center; }
.streak-head { display: flex; align-items: center; gap: 11px; }
.streak-head > div { flex: 1; min-width: 0; }
.streak-flame { color: var(--faint); flex: none; }
.streak-flame svg { width: 34px; height: 34px; display: block; }
.streak-flame.lit { color: var(--amber); }
.streak-num { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.streak-sub { font-size: 12px; color: var(--muted); }
.streak-days { display: flex; gap: 4px; }
.streak-days span {
  flex: 1; height: 10px; border-radius: 4px;
  background: rgb(var(--ink-rgb) / .08);
}
.streak-days span.on { background: var(--amber); }
.streak-days span:last-child { outline: 1.5px solid rgb(var(--ink-rgb) / .22); outline-offset: 1px; }

/* ------------------------------------------------------------------- main */

.main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 3px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 3px 13px;
  flex-wrap: wrap;
}

.page-head h1 { font-size: clamp(22px, 2.4vw, 30px); }
.page-head .sub { color: var(--muted); margin-top: 3px; font-size: 13px; }

.head-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------ glass */

.glass {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgb(255 255 255 / calc(.7 * var(--glass-k)));
}

.tile {
  background: var(--tile);
  border: 1px solid rgb(255 255 255 / calc(.55 * var(--glass-k)));
  border-radius: 13px;
  padding: 9px 11px;
}

/* ---------------------------------------------------------------- buttons */

.btn {
  border: 1px solid rgb(255 255 255 / calc(.6 * var(--glass-k)));
  background: rgb(255 255 255 / calc(.5 * var(--glass-k)));
  border-radius: 11px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .16s, transform .16s;
  white-space: nowrap;
}

.btn:hover { background: rgb(255 255 255 / calc(.75 * var(--glass-k))); }
.btn:active { transform: scale(.98); }

.btn.primary {
  background: linear-gradient(135deg, var(--accent-lite), var(--accent-fill));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 7px 18px rgb(var(--accent-rgb) / .32);
}

.btn.primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--accent-lite), var(--accent-fill)); }
.btn.ghost { background: transparent; border-color: rgb(var(--ink-rgb) / .14); }
.btn.danger { color: var(--pink-text); border-color: rgb(var(--pink-rgb) / .3); background: rgb(var(--pink-rgb) / .08); }
.btn.sm { padding: 5px 9px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; display: block; }
a.btn { text-decoration: none; color: inherit; display: inline-flex; align-items: center; }

/* ----------------------------------------------------------------- inputs */

input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]):not([type=range]),
select, textarea, .inp {
  width: 100%;
  font-size: 13.5px;
  background: rgb(255 255 255 / calc(.58 * var(--glass-k)));
  border: 1px solid rgb(255 255 255 / calc(.7 * var(--glass-k)));
  border-radius: 11px;
  padding: 8px 11px;
  outline: none;
  transition: border-color .16s, background .16s, box-shadow .16s;
}

input:focus, select:focus, textarea:focus {
  border-color: rgb(var(--accent-rgb) / .5);
  background: rgb(255 255 255 / calc(.85 * var(--glass-k)));
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .12);
}

textarea { resize: vertical; min-height: 78px; line-height: 1.5; }

/* The browser's default picker button is a hard black glyph; recolour it to
   the muted indigo used elsewhere and give it a hit target. */
input[type=date]::-webkit-calendar-picker-indicator {
  opacity: .45;
  cursor: pointer;
  padding: 3px;
  margin-right: -2px;
  border-radius: 6px;
  filter: invert(24%) sepia(38%) saturate(2400%) hue-rotate(228deg) brightness(94%) contrast(96%);
  transition: opacity .15s, background .15s;
}
input[type=date]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background: rgb(var(--accent-rgb) / .12);
}
/* Empty date fields show mm/dd/yyyy in full-strength text; mute it to match
   the placeholder styling of every other field. */
input[type=date]:invalid::-webkit-datetime-edit,
input[type=date]:not(:focus):in-range::-webkit-datetime-edit { color: inherit; }
input[type=date]::-webkit-datetime-edit-fields-wrapper { padding: 0; }

/* Checkboxes default to the OS accent, which is rarely the app's. */
input[type=checkbox], input[type=radio] {
  accent-color: var(--accent-fill);
  width: 15px; height: 15px;
  cursor: pointer;
  flex: none;
}

::placeholder { color: var(--faint); opacity: 1; }
select { appearance: none; cursor: pointer; padding-right: 26px;
  background-image: var(--icon-select);
  background-repeat: no-repeat; background-position: right 10px center; }

label.field { display: block; margin-bottom: 11px; }
label.field > span {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
}

/* Per-field helper text. A div rather than a span so the `> span` rule above —
   which styles the field's *label* — does not capture it. */
.field .hint {
  font-size: 11px;
  color: var(--faint);
  line-height: 1.4;
  margin-top: 4px;
}

.row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.row-3 { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
.row > *, .row-3 > * { min-width: 0; }
@media (max-width: 760px) { .row, .row-3 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ chips */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}

.chip.red     { background: rgb(var(--pink-rgb) / .16);  color: var(--pink-text); border-color: rgb(var(--pink-rgb) / .28); }
.chip.amber   { background: rgb(var(--amber-rgb) / .16);   color: var(--amber-text); border-color: rgb(var(--amber-rgb) / .26); }
.chip.green   { background: rgb(var(--green-rgb) / .15);   color: var(--green-text); border-color: rgb(var(--green-rgb) / .26); }
.chip.indigo  { background: rgb(var(--accent-rgb) / .14);   color: var(--accent); border-color: rgb(var(--accent-rgb) / .24); }
.chip.purple  { background: rgb(var(--purple-rgb) / .14);  color: var(--purple-text); border-color: rgb(var(--purple-rgb) / .24); }
.chip.pink    { background: rgb(var(--pink-rgb) / .13);  color: var(--pink-text); border-color: rgb(var(--pink-rgb) / .24); }
.chip.neutral { background: rgb(var(--ink-rgb) / .07);    color: var(--muted); border-color: rgb(var(--ink-rgb) / .1); }
.chip.past    { background: rgb(var(--ink-rgb) / .1);     color: var(--faint); }

/* -------------------------------------------------------------- searchbar */

.search { position: relative; width: 210px; }

.search input {
  padding: 7px 11px 7px 30px;
  background: rgb(255 255 255 / calc(.5 * var(--glass-k)));
  background-image: var(--icon-search);
  background-repeat: no-repeat;
  background-position: left 10px center;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  z-index: 40;
  background: rgb(var(--panel-rgb) / calc(.72 * var(--panel-k)));
}

.search-results .hit {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 11px; cursor: pointer;
}
.search-results .hit:hover, .search-results .hit.on { background: rgb(var(--accent-rgb) / .12); }
.search-results .hit .grow { flex: 1; min-width: 0; }
.search-results .hit .t { font-weight: 500; font-size: 13px; }
.search-results .hit .s { font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------------------- widget bar */

.widget-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin: 0 3px 13px;
}

/* The pills scroll on one line; label and Reset sit outside it and never move.
   Vertical padding keeps the active pill's shadow from being clipped, and the
   edge fades only on a side that has more to scroll to. */
.widget-bar .track {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  margin: -4px 0 -8px;
  scrollbar-width: none;
  --fade-l: 0px;
  --fade-r: 0px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
}
.widget-bar .track.more-l { --fade-l: 28px; }
.widget-bar .track.more-r { --fade-r: 28px; }
.widget-bar .track::-webkit-scrollbar { display: none; }
.widget-bar .pill,
.widget-bar .label { flex: none; white-space: nowrap; }

.widget-bar .label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-right: 2px;
}

.widget-bar .sep {
  width: 1px; align-self: stretch;
  background: rgb(var(--ink-rgb) / .12);
  margin: 0 3px;
}

.pill {
  border: 1px solid rgb(255 255 255 / calc(.55 * var(--glass-k)));
  background: rgb(255 255 255 / calc(.3 * var(--glass-k)));
  color: var(--muted);
  border-radius: 99px;
  padding: 4px 11px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background .16s, color .16s;
}

.pill:hover { background: rgb(255 255 255 / calc(.62 * var(--glass-k))); color: var(--ink); }
.pill.on { background: var(--raised); color: var(--accent); box-shadow: 0 4px 11px rgb(var(--shadow-rgb) / calc(.12 * var(--shadow-k))); }
.pill .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: .0;
}
.pill.on .dot { opacity: 1; }

/* --------------------------------------------------------------- widgets */

#grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: var(--row);
  gap: var(--gap);
  padding: 0 3px 32px;
}

.widget {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 15px 17px;
  min-height: 0;
  overflow: hidden;
  transition: box-shadow .2s, opacity .2s;
}

.widget.dragging { opacity: .45; }
.widget.drop-target { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.widget.resizing { user-select: none; }

.w-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 11px;
  flex: 0 0 auto;
}

.w-head h3 { font-size: 15px; flex: 1; }

/* Padding widens the hit area without changing the icon's visual size. */
.w-head .grab {
  cursor: grab; color: var(--faint); display: flex; flex: 0 0 auto;
  padding: 5px 4px; margin: -5px -2px -5px -4px; border-radius: 7px;
}
.w-head .grab:hover { color: var(--ink); }
.w-head .grab:active { cursor: grabbing; }
.w-head .grab svg { width: 15px; height: 15px; }

.w-add {
  border: 0;
  background: rgb(var(--accent-rgb) / .12);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  cursor: pointer;
  flex: none;
  transition: background .15s;
}
.w-add:hover { background: rgb(var(--accent-rgb) / .22); }

.w-head .x {
  border: 0; background: transparent; cursor: pointer;
  color: var(--faint); font-size: 15px; line-height: 1;
  padding: 2px 4px; border-radius: 7px;
}
.w-head .x:hover { color: var(--pink-text); background: rgb(var(--pink-rgb) / .1); }

.w-body { flex: 1; min-height: 0; overflow-y: auto; margin: -3px -5px -3px 0; padding: 3px 5px 3px 0; }

.resize-handle {
  position: absolute;
  right: 3px; bottom: 3px;
  width: 17px; height: 17px;
  cursor: nwse-resize;
  border-radius: 0 0 15px 0;
  opacity: .32;
  background:
    linear-gradient(135deg, transparent 48%, rgb(var(--ink-rgb) / .6) 49%, transparent 52%),
    linear-gradient(135deg, transparent 62%, rgb(var(--ink-rgb) / .6) 63%, transparent 66%);
}
.resize-handle:hover { opacity: .8; }

.empty { color: var(--faint); font-size: 13.5px; padding: 8px 2px; }

/* ------------------------------------------------- example / preview state */

/* Shown when a widget has no real data yet: realistic content at reduced
   opacity so the structure reads without being mistaken for the user's data. */
.ex { opacity: .62; pointer-events: none; }

.example-tag {
  display: block;
  font-size: 12px;
  font-style: italic;
  color: var(--faint);
  margin-top: 9px;
}

.avatar {
  width: 31px; height: 31px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12.5px;
  color: #fff;
  flex: none;
  letter-spacing: -.02em;
  position: relative;
  overflow: hidden;
}

/* The logo sits over the initials on a white plate — most brand marks are
   drawn for a light background. Hidden until it loads, so a slow or missing
   logo never flashes an empty square. */
.avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 4px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid rgb(var(--ink-rgb) / .1);
  border-radius: inherit;
  opacity: 0;
  transition: opacity .15s;
}
.avatar.has-logo img { opacity: 1; }

.day-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  margin-bottom: 11px;
}

.day-strip .dow {
  font-size: 10.5px; font-weight: 500;
  color: var(--faint);
  margin-bottom: 4px;
  letter-spacing: .04em;
}

.day-strip .dnum {
  font-size: 14px; font-weight: 600;
  padding: 7px 0;
  border-radius: 9px;
  position: relative;
}

.day-strip .today .dow { color: var(--accent); }
.day-strip .today .dnum { background: var(--accent-fill); color: #fff; font-weight: 700; }

.day-strip .dnum .mark {
  position: absolute;
  bottom: 2px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
}
.day-strip .today .dnum .mark { background: #fff; }

.note-row { display: flex; gap: 9px; margin-bottom: 10px; }
.note-row .spine { width: 4px; border-radius: 3px; flex: none; }
.note-row .t { font-size: 13px; font-weight: 600; margin-bottom: 1px; }
.note-row .s { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(82px, 1fr)); gap: 8px; }

/* Snapshot tiles open the matching filter on All applications. The lift on
   hover is the only affordance — a number that navigates needs to say so. */
.stat.linked { cursor: pointer; transition: background .15s, transform .15s, box-shadow .15s; }
.stat.linked:hover {
  background: rgb(255 255 255 / calc(.8 * var(--glass-k)));
  transform: translateY(-2px);
  box-shadow: 0 7px 16px rgb(var(--shadow-rgb) / calc(.12 * var(--shadow-k)));
}
.stat.linked:focus-visible {
  outline: 2px solid rgb(var(--accent-rgb) / .55);
  outline-offset: 2px;
}
.stat .n { font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.stat .l { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* At full size only: Total and Applied take a double-width headline row and
   fill the leftover height. Below that size .stat-grid's uniform tiles win. */
.stat-grid.emph {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1.35fr 1fr;
  height: 100%;
  min-height: 0;
}
.stat-grid.emph .stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}
.stat-grid.emph .stat.big { grid-column: span 2; }
.stat-grid.emph .stat.big .n { font-size: 36px; line-height: 1.05; }
.stat-grid.emph .stat.big .l { font-size: 13px; margin-top: 3px; }

.list-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 12px;
  cursor: pointer; transition: background .14s;
}
.list-row:hover { background: rgb(255 255 255 / calc(.55 * var(--glass-k))); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-weight: 500; font-size: 14px; }
.list-row .s { font-size: 12.5px; color: var(--muted); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ app table */

.app-table { margin: 0 3px 32px; overflow: hidden; }

.app-table-cols, .app-table-row {
  display: grid;
  grid-template-columns: 34px 2fr .9fr 1fr 1fr .85fr 1fr 96px;
  gap: 12px;
  align-items: center;
  padding: 9px 16px;
}

.app-table-cols {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid rgb(255 255 255 / calc(.55 * var(--glass-k)));
}

/* Sortable headers. The global `button { font: inherit; color: inherit }` rule
   carries size, weight and colour down from the row above, but the `font`
   shorthand covers neither text-transform nor letter-spacing — and the UA
   stylesheet pins both on form controls. Without inheriting them explicitly
   the sortable headers render sentence-case and untracked while the plain
   ones stay uppercase. */
.app-table-cols .col-sort {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color .14s;
}
.app-table-cols .col-sort:hover,
.app-table-cols .col-sort.on { color: var(--ink); }
.app-table-cols .col-sort:focus-visible {
  outline: 2px solid rgb(var(--accent-rgb) / .5);
  outline-offset: 3px;
  border-radius: 4px;
}

/* A clip-path triangle rather than a glyph, matching .ctl-chevron — no
   dependency on the font having the character. The arrow is the only signal a
   header is clickable, so it ghosts in on hover instead of appearing from
   nowhere on the active column. */
.sort-arrow {
  width: 7px; height: 5px; flex: none;
  background: currentColor;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  opacity: 0;
  transition: opacity .14s, transform .18s;
}
.col-sort:hover .sort-arrow { opacity: .35; }
.col-sort.on .sort-arrow { opacity: 1; }
.sort-arrow.down { transform: rotate(180deg); }

.app-table-row {
  cursor: pointer;
  border-bottom: 1px solid rgb(var(--ink-rgb) / .07);
  transition: background .14s;
}
.app-table-row:last-child { border-bottom: 0; }
.app-table-row:hover { background: rgb(255 255 255 / calc(.45 * var(--glass-k))); }
.app-table-row .co { font-weight: 500; font-size: 13.5px; }
.app-table-row .ro { font-size: 12px; color: var(--muted); margin-top: 1px; }

.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13.5px; }
.bar-row .name { width: 110px; color: var(--muted); flex: 0 0 auto; font-size: 12.5px; }
.bar-track { flex: 1; height: var(--bar-h); border-radius: 99px; background: rgb(var(--ink-rgb) / .08); overflow: hidden; --bar-h: 7px; }
/* display:block is load-bearing — .bar-track is not a flex container, so an
   inline span would drop width/height entirely and the fill would vanish. */
.bar-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-lite), var(--accent-fill)); }
.bar-row .val { width: 23px; text-align: right; font-weight: 500; }
.bar-row .name.faint { color: var(--faint); }

/* Segmented variant for the per-track outcome mix. A separate class rather
   than making .bar-track itself a flex container — .bar-fill relies on it not
   being one (see the note above), and statusBars must keep working. */
.bar-track.seg { display: flex; }
/* Explicit height, not 100%: against a flex-item parent the percentage
   resolves to zero here, so the segments render as invisible slivers. Sharing
   --bar-h with .bar-track keeps the two from drifting apart. */
.bar-seg { height: var(--bar-h); min-width: 3px; }
.bar-seg:first-child { border-radius: 99px 0 0 99px; }
.bar-seg:last-child { border-radius: 0 99px 99px 0; }
.bar-seg:only-child { border-radius: 99px; }

/* --------------------------------------------------------------- pipeline */

/* Headline counts above the board. Same tile type as the dashboard Snapshot
   widget, laid out as one strip. */
.pipe-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 4px 8px;
  padding: 14px 19px;
  margin: 0 3px 13px;
}
.pipe-stats .stat { padding: 2px 4px; }

/* ------------------------------------------------------------------ board */

.board {
  display: flex;
  gap: 11px;
  overflow-x: auto;
  padding: 0 3px 18px;
  align-items: flex-start;
}

.col {
  flex: 0 0 228px;
  max-height: min(58vh, 470px);
  display: flex;
  flex-direction: column;
  padding: 11px;
}

.col-head { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.col-head h3 { font-size: 12.5px; flex: 1; }
.col-head .count {
  font-size: 11.5px; color: var(--muted);
  background: rgb(255 255 255 / calc(.5 * var(--glass-k)));
  border-radius: 99px; padding: 1px 7px;
}

.col-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; min-height: 58px; padding: 2px; }
.col.over { box-shadow: 0 0 0 2px rgb(var(--accent-rgb) / .5), var(--shadow); }

/* A stage holding nothing collapses to a rail — eleven full-width columns for
   a handful of cards is mostly dead space. It stays a drop target, so every
   stage is still reachable by drag. */
.col.slim {
  flex: 0 0 46px;
  height: 196px;
  max-height: none;
  padding: 12px 5px;
  background: rgb(255 255 255 / calc(.3 * var(--glass-k)));
}
.col.slim .col-head {
  flex: 1;
  flex-direction: column-reverse;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
  margin: 0;
  min-height: 0;
}
.col.slim .col-head h3 {
  flex: 0 1 auto;
  writing-mode: vertical-rl;
  white-space: nowrap;
  overflow: hidden;
  font-weight: 500;
  color: var(--muted);
}
.col.slim .col-head .count { flex: none; }

.card {
  background: rgb(255 255 255 / calc(.62 * var(--glass-k)));
  border: 1px solid rgb(255 255 255 / calc(.7 * var(--glass-k)));
  border-radius: 13px;
  padding: 10px 11px;
  cursor: grab;
  transition: transform .14s, box-shadow .14s, opacity .14s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgb(var(--shadow-rgb) / calc(.12 * var(--shadow-k))); }
.card.dragging { opacity: .4; cursor: grabbing; }
.card .co { font-weight: 700; font-size: 13px; letter-spacing: -.02em; }
.card .ro { font-size: 11.5px; color: var(--muted); margin: 2px 0 7px; line-height: 1.35; }
.card .meta { display: flex; flex-wrap: wrap; gap: 4px; }

/* ----------------------------------------------------- outbound app links */

/* "View Posting" / "Check Status" on a card or table row. Two separately
   labelled targets rather than one generic "link", so the posting and the
   status portal are never mistaken for each other. */
.out-links { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }

.out-link {
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  color: var(--accent);
  background: rgb(var(--accent-rgb) / .1);
  border-radius: 7px;
  padding: 3px 7px;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s;
}
.out-link:hover { background: rgb(var(--accent-rgb) / .22); }

/* In the table the column is narrow, so the pair stacks instead of wrapping
   mid-label. */
.app-table-row .out-links { flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 0; }

/* --------------------------------------------------------------- calendar */

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 14px; }
.cal-dow {
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  text-align: center; padding-bottom: 6px;
  letter-spacing: .06em; text-transform: uppercase;
}

.cal-cell {
  min-height: 84px;
  border-radius: 13px;
  background: rgb(255 255 255 / calc(.38 * var(--glass-k)));
  border: 1px solid rgb(255 255 255 / calc(.55 * var(--glass-k)));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / calc(.5 * var(--glass-k)));
  padding: 6px 7px;
  display: flex; flex-direction: column; gap: 3px;
  overflow: hidden;
  transition: background .16s;
}
.cal-cell:hover { background: rgb(255 255 255 / calc(.58 * var(--glass-k))); }
.cal-cell.other { opacity: .38; }

/* Today reads as a soft tinted panel rather than a hard 1px outline, which
   looked like a focus ring against the frosted surfaces. */
.cal-cell.today {
  background: linear-gradient(160deg, rgb(var(--accent-lite-rgb) / .16), rgb(var(--accent-rgb) / .09));
  border-color: rgb(var(--accent-rgb) / .28);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / calc(.6 * var(--glass-k))), 0 4px 14px rgb(var(--accent-rgb) / .12);
}

.cal-cell .dnum {
  font-size: 11.5px; font-weight: 500; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; border-radius: 50%;
  align-self: flex-start;
}
/* Filled disc mirrors the day-strip treatment on the dashboard. */
.cal-cell.today .dnum {
  background: var(--accent-fill); color: #fff; font-weight: 700;
  box-shadow: 0 3px 8px rgb(var(--accent-rgb) / .35);
}
.cal-week .cal-cell { min-height: 300px; }

.ev {
  font-size: 10.5px; font-weight: 500; line-height: 1.3;
  padding: 4px 7px; border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: transform .14s, box-shadow .14s;
}
.ev:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgb(var(--shadow-rgb) / calc(.14 * var(--shadow-k))); }

.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); padding: 0 3px 11px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 4px; vertical-align: -1px; }

.seg { display: inline-flex; background: rgb(255 255 255 / calc(.4 * var(--glass-k))); border: 1px solid var(--edge); border-radius: 11px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 9px; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--raised); color: var(--accent); box-shadow: 0 3px 9px rgb(var(--shadow-rgb) / calc(.12 * var(--shadow-k))); }

/* --------------------------------------------------------------- insights */

.ins-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); padding: 0 3px 32px; }
.ins-grid .full { grid-column: 1 / -1; }
.ins-grid > * { min-width: 0; }
@media (max-width: 900px) { .ins-grid { grid-template-columns: 1fr; } }
.panel { padding: 17px 19px; }
.panel h3 { font-size: 13.5px; margin-bottom: 3px; }
.panel .cap { font-size: 11.5px; color: var(--muted); margin-bottom: 14px; }
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}

/* Pipeline health ring — hidden behind SHOW_HEALTH_RING in board.js. Kept so
   flipping that flag needs no CSS work. */
.ring-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ring-legend { font-size: 12.5px; display: flex; flex-direction: column; gap: 7px; }
.ring-legend div { display: flex; align-items: center; gap: 7px; }
.ring-legend i { width: 9px; height: 9px; border-radius: 3px; }

/* ---------------------------------------------------------------- detail */

.detail-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--gap); padding: 0 3px 32px; align-items: start; }
@media (max-width: 940px) { .detail-grid { grid-template-columns: 1fr; } }
/* Grid children default to min-width:auto, so one long unbroken string (a URL
   in a pasted JD) would otherwise push the whole layout past the viewport. */
.detail-grid > *, .detail-grid > * > * { min-width: 0; }

/* The posting text is edited in place, so it keeps the compact setting the
   read-only view used — it is long, and 13px+ made it a wall. */
textarea.jd-edit {
  font-size: 12.5px;
  line-height: 1.6;
  max-height: 420px;
}

.file-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 7px; }
.file-name { font-size: 11.5px; color: var(--muted); flex: 1; min-width: 90px; }

/* ----------------------------------------------------------------- modal */

.backdrop {
  position: fixed; inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  z-index: 60;
  padding: 20px;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }

.modal {
  width: min(640px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 21px 23px;
  background: rgb(var(--panel-rgb) / calc(.62 * var(--panel-k)));
  animation: rise .22s cubic-bezier(.2, .8, .3, 1);
}
@keyframes rise { from { transform: translateY(12px) scale(.98); opacity: 0; } }

.modal h2 { font-size: 18px; margin-bottom: 3px; }
.modal .cap { color: var(--muted); font-size: 12.5px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.modal-actions .left { margin-right: auto; }

/* ------------------------------------------------- track backfill preview */

.guess-list { max-height: 340px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }

.guess-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 11px;
  cursor: pointer;
  border-bottom: 1px solid rgb(var(--ink-rgb) / .07);
}
.guess-row:last-child { border-bottom: 0; }
.guess-row:hover { background: rgb(255 255 255 / calc(.5 * var(--glass-k))); }
.guess-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.guess-row .t { font-size: 13.5px; font-weight: 500; }
.guess-row .s { font-size: 12px; color: var(--muted); }

.note {
  font-size: 11.5px;
  padding: 8px 11px;
  border-radius: 10px;
  margin-bottom: 13px;
  background: rgb(var(--amber-rgb) / .12);
  color: var(--note-text);
  border: 1px solid rgb(var(--amber-rgb) / .2);
}
.note.info { background: rgb(var(--accent-rgb) / .1); color: var(--accent); border-color: rgb(var(--accent-rgb) / .18); }

.spin {
  width: 13px; height: 13px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ appearance */

.appearance { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.accent-dots { display: flex; gap: 10px; }
.accent-dot {
  width: 24px; height: 24px; border-radius: 50%;
  border: 0; padding: 0; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgb(var(--ink-rgb) / .12);
  transition: transform .14s;
}
.accent-dot:hover { transform: scale(1.08); }
.accent-dot.on { outline: 2px solid var(--ink); outline-offset: 2px; }
.accent-dot:focus-visible { outline: 2px solid rgb(var(--accent-rgb) / .6); outline-offset: 2px; }
.accent-dot[data-value="indigo"] { background: var(--swatch-indigo); }
.accent-dot[data-value="teal"] { background: var(--swatch-teal); }
.accent-dot[data-value="sky"] { background: var(--swatch-sky); }
.accent-dot[data-value="graphite"] { background: var(--swatch-graphite); }

/* ----------------------------------------------------------------- toast */

.toast {
  position: fixed;
  bottom: 22px; left: 50%;
  transform: translate(-50%, 18px);
  background: rgba(31, 38, 70, .92);
  color: #fff;
  padding: 9px 17px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 90;
  box-shadow: 0 11px 26px rgb(var(--shadow-rgb) / calc(.3 * var(--shadow-k)));
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: rgba(216, 27, 82, .94); }
.toast.actionable { pointer-events: auto; display: flex; align-items: center; gap: 12px; }

.toast-btn {
  border: 0;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  padding: 4px 11px;
  border-radius: 8px;
  cursor: pointer;
}
.toast-btn:hover { background: rgba(255, 255, 255, .3); }

/* ------------------------------------------- reminders-style action list */

.rem {
  display: flex;
  gap: 11px;
  padding: 10px 2px;
  border-bottom: 1px solid rgb(var(--ink-rgb) / .09);
  cursor: pointer;
}
.rem:last-child { border-bottom: 0; }
.rem:hover .t { color: var(--accent); }

.rem .circle {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.8px solid rgb(var(--ink-rgb) / .3);
  flex: none;
  margin-top: 1px;
  transition: border-color .15s, background .15s;
  position: relative;
}
.rem .circle:hover { border-color: var(--accent); background: rgb(var(--accent-rgb) / .12); }
.rem .circle::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent-fill);
  opacity: 0;
  transition: opacity .15s;
}
.rem .circle:hover::after { opacity: .55; }

.rem .body { flex: 1; min-width: 0; }
.rem .t { font-size: 14px; font-weight: 500; line-height: 1.32; }

.rem .meta {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 12.5px;
  margin-top: 2px;
  color: var(--muted);
}
.rem .meta.red { color: var(--pink-text); }
.rem .meta.amber { color: var(--amber-text); }
.rem .meta.past { color: var(--pink-text); }

.rem .badge {
  background: rgb(var(--ink-rgb) / .55);
  color: var(--on-ink);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
}

/* ------------------------------------------- themed select & date picker */

/* Native select lists and date panels are drawn by the OS and cannot be
   styled, so those controls are rebuilt in the DOM. These rules keep the
   closed field pixel-identical to a text input. */

.ctl { position: relative; width: 100%; }

.ctl-field {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  text-align: left;
  background: rgb(255 255 255 / calc(.58 * var(--glass-k)));
  border: 1px solid rgb(255 255 255 / calc(.7 * var(--glass-k)));
  border-radius: 11px;
  padding: 8px 11px;
  cursor: pointer;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.ctl-field:hover { background: rgb(255 255 255 / calc(.72 * var(--glass-k))); }
.ctl-field:focus-visible,
.ctl.open .ctl-field {
  outline: none;
  border-color: rgb(var(--accent-rgb) / .5);
  background: rgb(255 255 255 / calc(.85 * var(--glass-k)));
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .12);
}

.ctl-label { flex: 1; min-width: 0; }
.ctl-label.is-empty { color: var(--faint); }

.ctl-chevron {
  width: 11px; height: 7px; flex: none;
  background: currentColor;
  opacity: .5;
  transition: transform .18s;
  clip-path: polygon(0 0, 50% 78%, 100% 0, 100% 22%, 50% 100%, 0 22%);
}
.ctl.open .ctl-chevron { transform: rotate(180deg); }

.ctl-cal-icon {
  width: 15px; height: 15px; flex: none;
  opacity: .5;
  background: currentColor;
  -webkit-mask: var(--cal-mask) center / contain no-repeat;
  mask: var(--cal-mask) center / contain no-repeat;
}
.ctl.has-value .ctl-cal-icon, .ctl.open .ctl-cal-icon { opacity: .75; color: var(--accent); }

:root {
  --cal-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
}

/* Shared floating panel */
.ctl-panel {
  position: absolute;
  left: 0;
  min-width: 100%;
  z-index: 70;
  background: rgb(var(--panel-rgb) / calc(.82 * var(--panel-k)));
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid var(--edge);
  border-radius: 15px;
  box-shadow: 0 16px 40px rgb(var(--shadow-rgb) / calc(.2 * var(--shadow-k))), inset 0 1px 0 rgb(255 255 255 / calc(.8 * var(--glass-k)));
  padding: 6px;
  animation: ctl-in .14s ease;
}
@keyframes ctl-in { from { opacity: 0; transform: translateY(-4px); } }

.ctl-list { max-height: 260px; overflow-y: auto; }

.ctl-opt {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ctl-opt.active { background: rgb(var(--accent-rgb) / .1); }
.ctl-opt.selected { color: var(--accent); font-weight: 600; }
.ctl-opt.selected::after {
  content: '';
  margin-left: auto;
  width: 13px; height: 9px; flex: none;
  background: currentColor;
  clip-path: polygon(0 44%, 10% 33%, 40% 66%, 90% 0, 100% 11%, 40% 90%);
}

/* Calendar panel */
.ctl-cal { width: 258px; padding: 10px; }

.ctl-cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.ctl-cal-title { flex: 1; text-align: center; font-weight: 700; font-size: 13px; letter-spacing: -.02em; }

.ctl-nav {
  width: 26px; height: 26px; flex: none;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  font-size: 15px; line-height: 1; cursor: pointer;
}
.ctl-nav:hover { background: rgb(var(--accent-rgb) / .1); color: var(--accent); }

.ctl-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ctl-cal-dow {
  font-size: 10px; font-weight: 600; color: var(--faint);
  text-align: center; padding-bottom: 4px;
}

.ctl-cal-day {
  border: 0; background: transparent;
  aspect-ratio: 1; border-radius: 9px;
  font-size: 12.5px; font-weight: 500; color: var(--ink);
  cursor: pointer;
  transition: background .12s;
}
.ctl-cal-day:hover { background: rgb(var(--accent-rgb) / .12); }
.ctl-cal-day.other { color: var(--faint); }
.ctl-cal-day.today { color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / .35); }
.ctl-cal-day.selected {
  background: var(--accent-fill); color: #fff; font-weight: 700;
  box-shadow: 0 4px 10px rgb(var(--accent-rgb) / .35);
}

.ctl-cal-foot {
  display: flex; gap: 6px; margin-top: 8px;
  padding-top: 8px; border-top: 1px solid rgb(var(--ink-rgb) / .1);
}
.ctl-cal-btn {
  flex: 1; border: 0; border-radius: 9px;
  padding: 6px; font-size: 12.5px; font-weight: 600;
  background: rgb(var(--accent-rgb) / .1); color: var(--accent);
  cursor: pointer;
}
.ctl-cal-btn:hover { background: rgb(var(--accent-rgb) / .2); }
.ctl-cal-btn.muted { background: rgb(var(--ink-rgb) / .07); color: var(--muted); }
.ctl-cal-btn.muted:hover { background: rgb(var(--ink-rgb) / .13); }

/* Panels are portaled to <body> and fixed-positioned, so they escape modal
   and widget overflow without the modal having to give up scrolling. */
.ctl-panel { position: fixed; }

/* ------------------------------------------------------------ demo banner
 *
 * The signed-out preview at /demo. Floated over the bottom of the page rather
 * than inserted into the shell: the whole point of the page is to show the real
 * layout, and a bar that pushed the rail and board up would show a layout no
 * signed-in user ever sees. `.main` gets matching bottom padding instead, so
 * the last card in a column can still be scrolled clear of it.
 */
.demo-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 10px 12px 10px 16px;
  font-size: 13px;
  color: var(--ink);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--edge);
  border-radius: 16px;
  box-shadow: var(--shadow), inset 0 1px 0 rgb(255 255 255 / calc(.7 * var(--glass-k)));
}

.demo-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-fill);
  box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / .16);
}

.demo-text { color: var(--muted); }
.demo-text strong { color: var(--ink); font-weight: 600; }

.rail a.mark { text-decoration: none; }

/* The brand mark is a fixed-colour image, not the accent: it is the logo. */
.mark > img { display: block; width: 100%; height: 100%; }

.demo-bar .demo-cta,
.demo-bar .demo-home {
  flex: 0 0 auto;
  text-decoration: none;
  padding: 7px 12px;
  font-size: 13px;
}

.demo-close {
  flex: 0 0 auto;
  border: 0;
  background: none;
  color: var(--faint);
  font-size: 19px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
}
.demo-close:hover { color: var(--ink); }

body.has-demo-bar .main { padding-bottom: 68px; }

/* On a phone the CTA is what matters; the explanatory line would otherwise wrap
   to three lines and cover the board it is advertising. */
@media (max-width: 620px) {
  .demo-bar { left: 12px; right: 12px; transform: none; max-width: none; gap: 9px; padding-left: 13px; }
  .demo-text { flex: 1; min-width: 0; font-size: 12px; }
}

/* ------------------------------------------------------------------ tour */

/* Above modals (60–70) so nothing can open over it, below toasts (90). */
.tour-shield { position: fixed; inset: 0; z-index: 80; }

/* The scrim is the spotlight's own shadow, so the cut-out is always exactly
   the highlighted element — no clip-path or SVG mask to keep in sync. */
.tour-spot {
  position: fixed;
  z-index: 81;
  border-radius: 14px;
  box-shadow: 0 0 0 2px rgb(var(--accent-rgb) / .7), 0 0 0 100vmax var(--scrim);
  pointer-events: none;
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease;
}
.tour-spot.off { left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; box-shadow: 0 0 0 100vmax var(--scrim); }

.tour-card {
  position: fixed;
  z-index: 82;
  width: min(320px, calc(100vw - 24px));
  padding: 16px 18px 14px;
  background: rgb(var(--panel-rgb) / calc(.86 * var(--panel-k)));
  animation: rise .22s cubic-bezier(.2, .8, .3, 1);
}
/* inset + auto margins, not a translate: `rise` animates transform and would
   knock a translated card off-centre for its duration. */
.tour-card.centered { inset: 0; margin: auto; height: fit-content; width: min(380px, calc(100vw - 24px)); }
.tour-card h3 { margin: 2px 0 6px; font-size: 16px; }
.tour-card p { margin: 0 0 14px; color: var(--muted); line-height: 1.5; }
.tour-count { font-size: 11.5px; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
.tour-actions { display: flex; align-items: center; gap: 6px; }
.tour-actions .grow { flex: 1; }

/* On dark the shared scrim barely separates a dark element from a dark page.
   Lift the target instead: a lighter scrim, a glowing ring, and a faint white
   wash over the highlighted element itself, plus a more opaque card. */
[data-theme="dark"] .tour-spot {
  background: rgb(255 255 255 / .07);
  box-shadow:
    0 0 0 2px var(--accent-lite),
    0 0 22px 4px rgb(var(--accent-lite-rgb) / .55),
    0 0 0 100vmax rgb(4 6 14 / .42);
}
[data-theme="dark"] .tour-spot.off { background: none; box-shadow: 0 0 0 100vmax rgb(4 6 14 / .42); }
[data-theme="dark"] .tour-card {
  background: rgb(var(--panel-rgb) / .97);
  border-color: rgb(var(--accent-lite-rgb) / .45);
  box-shadow: 0 18px 44px rgb(0 0 0 / .55), 0 0 0 1px rgb(var(--accent-lite-rgb) / .2);
}
[data-theme="dark"] .tour-card p { color: var(--ink); opacity: .82; }

@media (prefers-reduced-motion: reduce) {
  .tour-spot { transition: none; }
  .tour-card { animation: none; }
}
