/* ---------------------------------------------------------------------------
   OrionBDM

   One surface rule, applied everywhere: the canvas is warm paper, panels are
   white, and every field is white with a hairline border. Nothing is lighter
   than its surroundings in one place and darker in another - that was the
   thing that made the first pass feel unfinished.

   Colour comes from the Door4 palette. Sunset is the only signal colour:
   it means "now", "active", "in progress" and nothing else.
   ------------------------------------------------------------------------- */

:root {
  /* Brand */
  --midnight: #2b2d42;
  --midnight-deep: #1f2131;
  --midnight-soft: #4a4d68;
  --sunset: #fec042;
  --sunset-deep: #8a6410;
  --ocean: #4fa6a4;
  --ocean-deep: #2f615f;
  --coral: #f27d39;
  --coral-deep: #8b421d;

  /* Surfaces. Paper is a shade under white so white panels lift off it. */
  --paper: #f1eee5;
  --paper-sunk: #e8e4d8;
  --panel: #ffffff;
  --line: #e2ddcf;
  --line-strong: #cfc8b6;

  /* Ink */
  --ink: #22242f;
  --ink-soft: #5c5f6e;
  --ink-faint: #8b8e9c;

  /* Type */
  --display: 'Archivo', 'Segoe UI', system-ui, sans-serif;
  --body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', monospace;

  /* One radius family, one shadow family. */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --shadow: 0 1px 2px rgb(34 36 47 / 6%), 0 1px 1px rgb(34 36 47 / 4%);
  --shadow-lift: 0 6px 20px -6px rgb(34 36 47 / 18%), 0 2px 6px -2px rgb(34 36 47 / 10%);

  --topbar-h: 58px;

  /* Every loading sweep shares this track and fill. Sunset on a cream track
     was barely visible; on midnight it carries, and the near-white core gives
     the travelling bar an edge you can actually follow across the room. */
  --sweep-track: var(--midnight);
  --sweep: linear-gradient(
    90deg,
    var(--sunset) 0%,
    #ffd875 30%,
    #fffaf0 50%,
    #ffd875 70%,
    var(--sunset) 100%
  );
  --sweep-glow: 0 0 10px rgb(254 192 66 / 85%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* An author `display` rule outranks the browser's own [hidden] rule, and this
   sheet sets display on things that get hidden - the boot and sign-in screens
   for two. Without this they stay laid out and push the app off the screen. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.55 var(--body);
  font-feature-settings: 'cv05' 1;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.018em;
  margin: 0;
  line-height: 1.15;
}

a {
  color: var(--ocean-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--midnight);
  outline-offset: 2px;
  border-radius: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- boot and sign-in ----------------------------------------------------- */

.boot {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.boot__mark {
  width: 30px;
  height: 30px;
  border: 3px solid rgb(43 45 66 / 16%);
  border-top-color: var(--midnight);
  border-right-color: var(--sunset);
  border-radius: 50%;
  animation: spin 0.62s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.signin {
  display: grid;
  place-content: center;
  gap: 22px;
  min-height: 100vh;
  padding: 24px;
  /* The one place the navy takes the whole screen: the front door. */
  background:
    radial-gradient(120% 90% at 50% 0%, #35374f 0%, var(--midnight) 45%, var(--midnight-deep) 100%);
}

.signin__card {
  width: min(430px, 100%);
  padding: 34px 32px 30px;
  background: var(--panel);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / 45%);
  text-align: center;
}

.signin__logo {
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
}

.signin__card h1 {
  font-size: 26px;
  letter-spacing: -0.03em;
}

.signin__blurb {
  margin: 8px 0 22px;
  color: var(--ink-soft);
  font-size: 14px;
}

.signin__foot {
  color: rgb(255 255 255 / 42%);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

/* Google's own button, near enough, without pulling in their script. */
.gbtn {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 18px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  color: var(--ink);
  font: 500 15px/1 var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.gbtn:hover {
  background: #fafafa;
  border-color: var(--ink-faint);
}

.gbtn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.signin__domain {
  margin-top: 16px;
  color: var(--ink-faint);
  font-size: 13px;
}

.signin__domain b {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-weight: 500;
}

.setup {
  text-align: left;
}

.setup ol {
  margin: 0 0 4px;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.setup li {
  margin-bottom: 7px;
}

.setup code {
  display: inline-block;
  padding: 1px 5px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  font: 400 12.5px/1.5 var(--mono);
  word-break: break-all;
}

/* --- top bar -------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  gap: 22px;
  align-items: center;
  height: var(--topbar-h);
  padding: 0 20px;
  background: var(--midnight);
  color: #fff;
}

.topbar__brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  flex: none;
}

.topbar__logo {
  height: 19px;
}

.topbar__rule {
  width: 1px;
  height: 20px;
  background: rgb(255 255 255 / 22%);
}

.topbar__wordmark {
  font: 600 16px/1 var(--display);
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 2px;
  margin-left: 8px;
}

/* Sunset marks where you are, and nothing else in the bar uses it. */
.nav__item {
  position: relative;
  padding: 0 13px;
  border-radius: var(--r-sm);
  color: rgb(255 255 255 / 68%);
  font: 500 14px/var(--topbar-h) var(--body);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.nav__item:hover {
  background: rgb(255 255 255 / 7%);
  color: #fff;
}

.nav__item[aria-current='page'] {
  color: #fff;
}

.nav__item[aria-current='page']::after {
  content: '';
  position: absolute;
  right: 13px;
  bottom: 0;
  left: 13px;
  height: 2px;
  background: var(--sunset);
  border-radius: 2px 2px 0 0;
}

.topbar__end {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: auto;
}

.badge {
  padding: 4px 9px;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 999px;
  color: rgb(255 255 255 / 72%);
  font: 500 11px/1.35 var(--mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* The "still running" pill. Lives in the top bar rather than in a view,
   because the whole point is that it survives navigating away from the run. */
.activity {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  max-width: 260px;
  padding: 4px 11px 4px 9px;
  border: 1px solid rgb(254 192 66 / 45%);
  border-radius: 999px;
  background: rgb(254 192 66 / 14%);
  color: var(--sunset);
  font: 500 11px/1.35 var(--mono);
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.activity:hover {
  border-color: rgb(254 192 66 / 75%);
  background: rgb(254 192 66 / 22%);
}

.activity span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge--mock {
  border-color: rgb(254 192 66 / 45%);
  background: rgb(254 192 66 / 14%);
  color: var(--sunset);
}

.badge--error {
  border-color: rgb(242 125 57 / 50%);
  background: rgb(242 125 57 / 16%);
  color: #ffc4a0;
}

.who {
  position: relative;
}

.who__button {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 8px 4px 4px;
  background: none;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font: 500 13.5px/1 var(--body);
  cursor: pointer;
}

.who__button:hover {
  background: rgb(255 255 255 / 8%);
}

.who__avatar {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  overflow: hidden;
  background: var(--ocean);
  border-radius: 50%;
  font: 600 11.5px/1 var(--mono);
  text-transform: uppercase;
}

.who__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.who__name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.who__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 10px;
  min-width: 220px;
  padding: 13px;
  background: var(--panel);
  border-radius: var(--r);
  box-shadow: var(--shadow-lift);
}

.who__email {
  color: var(--ink-soft);
  font: 400 12.5px/1.4 var(--mono);
  word-break: break-all;
}

.who__signout {
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink);
  font: 500 13.5px/1 var(--body);
  cursor: pointer;
}

.who__signout:hover {
  background: var(--paper-sunk);
}

/* --- page scaffolding ----------------------------------------------------- */

.view {
  padding: 30px 20px 90px;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
}

.page__head {
  display: flex;
  gap: 22px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 26px;
}

.page__head h1 {
  font-size: clamp(24px, 3vw, 31px);
}

.page__head-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-faint);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow--ok {
  color: var(--ocean-deep);
}

.eyebrow--warn {
  color: var(--coral-deep);
}

.lede {
  max-width: 60ch;
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 14.5px;
}

.lede em {
  font-style: normal;
  color: var(--ink);
}

.muted {
  color: var(--ink-soft);
}

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

.btn {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  height: 38px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink);
  font: 500 14px/1 var(--body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}

.btn:hover:not(:disabled) {
  border-color: var(--ink-faint);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--midnight);
  border-color: var(--midnight);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--midnight-soft);
  border-color: var(--midnight-soft);
}

.btn--tonal {
  background: var(--paper-sunk);
  border-color: transparent;
}

.btn--tonal:hover:not(:disabled) {
  background: #ded9cb;
  border-color: transparent;
}

.btn--quiet {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
}

.btn--quiet:hover:not(:disabled) {
  background: rgb(34 36 47 / 6%);
  border-color: transparent;
  color: var(--ink);
}

.btn--danger {
  background: transparent;
  border-color: transparent;
  color: var(--coral-deep);
}

.btn--danger:hover:not(:disabled) {
  background: rgb(242 125 57 / 12%);
  border-color: transparent;
}

.btn--lg {
  height: 46px;
  padding: 0 24px;
  font-size: 15px;
}

.btn--sm {
  height: 31px;
  padding: 0 11px;
  font-size: 13px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink);
  cursor: pointer;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: currentcolor;
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.icon-btn--filled {
  background: var(--midnight);
  border-color: var(--midnight);
  color: #fff;
}

/* --- ONE field treatment -------------------------------------------------- */

.field {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink);
  font: 400 14.5px/1 var(--body);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

textarea.field {
  height: auto;
  padding: 9px 11px;
  line-height: 1.5;
  resize: vertical;
}

select.field {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235c5f6e'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 18px;
  cursor: pointer;
}

.field::placeholder {
  color: var(--ink-faint);
}

.field:hover:not(:focus) {
  border-color: var(--ink-faint);
}

.field:focus {
  border-color: var(--midnight);
  box-shadow: 0 0 0 3px rgb(43 45 66 / 12%);
  outline: none;
}

.field--flush {
  border-color: transparent;
  background: transparent;
  font-weight: 500;
}

.field--flush:hover:not(:focus) {
  border-color: var(--line-strong);
  background: var(--panel);
}

.field--invalid,
.field--invalid:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgb(242 125 57 / 14%);
}

.lbl {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.lbl > span {
  color: var(--ink-soft);
  font: 500 12.5px/1.3 var(--body);
}

.lbl > span em {
  color: var(--ink-faint);
  font-style: normal;
  font-weight: 400;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.span2 {
  grid-column: span 2;
}

.span3 {
  grid-column: span 3;
}

.field-set {
  display: grid;
  gap: 9px;
}

.field-set__label {
  color: var(--ink-soft);
  font: 500 12.5px/1.3 var(--body);
}

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

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-toggle {
  display: inline-flex;
  align-items: center;
  height: 29px;
  padding: 0 11px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  font: 500 13px/1 var(--body);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.13s, border-color 0.13s, color 0.13s;
}

.chip-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-toggle:hover {
  border-color: var(--ink-faint);
  color: var(--ink);
}

.chip-toggle:has(input:checked) {
  background: var(--midnight);
  border-color: var(--midnight);
  color: #fff;
}

.chip-toggle:has(input:focus-visible) {
  outline: 2px solid var(--midnight);
  outline-offset: 2px;
}

/* --- segmented switch ----------------------------------------------------- */

.switch {
  display: inline-flex;
  /* A grid or flex parent would otherwise stretch it to the full width. */
  justify-self: start;
  align-self: start;
  flex: none;
  padding: 3px;
  background: var(--paper-sunk);
  border-radius: 8px;
}

.switch button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ink-soft);
  font: 500 13.5px/1 var(--body);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.switch button:hover {
  color: var(--ink);
}

.switch button[aria-selected='true'] {
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.switch__count {
  padding: 1px 5px;
  background: rgb(34 36 47 / 8%);
  border-radius: 999px;
  font: 500 11px/1.5 var(--mono);
}

.switch__count:empty {
  display: none;
}

.tabs-line {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tabs-line button {
  padding: 0 3px 10px;
  margin-right: 18px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--ink-faint);
  font: 500 14px/1 var(--body);
  cursor: pointer;
}

.tabs-line button:hover {
  color: var(--ink);
}

.tabs-line button[aria-selected='true'] {
  border-bottom-color: var(--midnight);
  color: var(--ink);
}

/* --- the two-phase spine -------------------------------------------------- */

/* The spine is the signature: the flow really is two phases, and the rule
   down the left says so without a word of explanation. */
.spine {
  position: relative;
  padding-left: 54px;
}

.spine::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 32px;
  left: 15px;
  width: 2px;
  background: linear-gradient(var(--line-strong) 0 60%, var(--line) 100%);
}

.spine__phase {
  position: relative;
  display: flex;
  gap: 13px;
  align-items: baseline;
  margin-bottom: 16px;
}

.spine__phase--two {
  margin-top: 30px;
}

.spine__num {
  position: absolute;
  top: -2px;
  left: -54px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--midnight);
  border: 3px solid var(--paper);
  border-radius: 50%;
  color: #fff;
  font: 600 12px/1 var(--mono);
}

.spine__label b {
  display: block;
  font: 600 16px/1.2 var(--display);
  letter-spacing: -0.015em;
}

.spine__label small {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 13px;
}

.spine__add {
  margin: 12px 0 0;
}

.guests {
  display: grid;
  gap: 14px;
}

/* --- guest card ----------------------------------------------------------- */

.guest {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.guest__head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.guest__index {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  background: var(--paper-sunk);
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font: 500 11.5px/1 var(--mono);
}

.guest__owner {
  height: 32px;
  flex: 1;
}

.guest__remove {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--ink-faint);
  cursor: pointer;
}

.guest__remove svg {
  width: 17px;
  height: 17px;
  fill: currentcolor;
}

.guest__remove:hover {
  background: rgb(242 125 57 / 12%);
  color: var(--coral-deep);
}

.guest__choose,
.guest__confirmed,
.guest__working {
  padding: 16px;
}

.guest__choose {
  display: grid;
  gap: 14px;
}

.pane {
  display: grid;
  gap: 14px;
}

.pane__actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.pane__hint {
  color: var(--ink-faint);
  font-size: 12.5px;
}

.inline-error {
  color: var(--coral-deep);
  font-size: 13.5px;
}

.inline-error:empty {
  display: none;
}

/* --- existing company picker --------------------------------------------- */

.picks {
  display: grid;
  gap: 7px;
  max-height: 290px;
  overflow-y: auto;
}

.pick {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.13s, background 0.13s;
}

.pick:hover {
  border-color: var(--midnight);
  background: #fcfbf8;
}

.pick__name {
  display: flex;
  gap: 8px;
  align-items: center;
  font: 600 14.5px/1.25 var(--display);
}

.pick__what {
  color: var(--ink-soft);
  font-size: 13px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.pick__meta {
  color: var(--ink-faint);
  font: 400 11.5px/1.4 var(--mono);
}

/* --- the confirmed company ----------------------------------------------- */

.known {
  padding: 15px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.known__head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

.known__name {
  font-size: 19px;
}

.known__meta {
  margin-top: 4px;
  color: var(--ink-soft);
  font: 400 12.5px/1.5 var(--mono);
}

.known__what {
  margin-top: 10px;
  font-size: 14px;
}

.known__note,
.known__alts {
  margin-top: 11px;
  padding: 10px 12px;
  border-left: 3px solid var(--sunset);
  background: rgb(254 192 66 / 13%);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 13.5px;
}

.known__note b,
.known__alts b {
  display: block;
  margin-bottom: 3px;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sunset-deep);
}

.known__alts ul {
  margin: 4px 0 0;
  padding-left: 17px;
}

.known__signals {
  margin-top: 11px;
}

.known__signals b {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-faint);
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.known__signals ul {
  margin: 0;
  padding-left: 17px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.known__signals li {
  margin-bottom: 3px;
}

.known__edit {
  margin-top: 13px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}

.known__edit summary {
  color: var(--ink-soft);
  font-size: 13.5px;
  cursor: pointer;
}

.known__edit summary:hover {
  color: var(--ink);
}

.known__edit[open] summary {
  margin-bottom: 13px;
}

.known__edit .pane__actions {
  margin-top: 13px;
}

.brief {
  display: grid;
  gap: 15px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
}

.brief__title {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* --- the look-up in progress --------------------------------------------- */

.working {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 15px;
  background: var(--paper);
  border-radius: var(--r);
  font-size: 14px;
  color: var(--ink-soft);
}

.working b {
  color: var(--ink);
}

.working__bar {
  position: relative;
  width: 52px;
  height: 4px;
  flex: none;
  overflow: hidden;
  background: var(--sweep-track);
  border-radius: 4px;
}

.working__bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--sweep);
  border-radius: 4px;
  box-shadow: var(--sweep-glow);
  animation: sweep 1.05s ease-in-out infinite;
}

@keyframes sweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* --- commission bar ------------------------------------------------------- */

.commission {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.commission__state {
  color: var(--ink-soft);
  font-size: 13.5px;
}

.commission__state b {
  color: var(--ink);
}

/* --- library -------------------------------------------------------------- */

.rows {
  display: grid;
  gap: 9px;
}

.row-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.13s, box-shadow 0.13s;
}

.row-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.row-card__title {
  display: flex;
  gap: 9px;
  align-items: center;
  font: 600 15.5px/1.3 var(--display);
}

.row-card__meta {
  margin-top: 5px;
  color: var(--ink-faint);
  font: 400 12px/1.5 var(--mono);
}

.row-card__end {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: none;
}

.count {
  display: grid;
  place-items: center;
  min-width: 40px;
  padding: 5px 8px;
  background: var(--paper);
  border-radius: var(--r-sm);
  text-align: center;
}

.count b {
  display: block;
  font: 600 15px/1 var(--mono);
}

.count span {
  font: 400 9.5px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.empty {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 40px;
  background: var(--panel);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
}

.empty h3 {
  font-size: 18px;
}

.empty p {
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 14px;
}

/* --- status dots and pills ------------------------------------------------ */

.dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--ink-faint);
}

.dot--running,
.dot--pending {
  background: var(--sunset);
  outline: 1px solid rgb(138 100 16 / 45%);
  animation: pulse 1.4s ease-out infinite;
}

.dot--completed {
  background: var(--ocean);
}

.dot--partial {
  background: var(--ocean);
  opacity: 0.55;
}

.dot--failed,
.dot--timed_out,
.dot--cancelled {
  background: var(--coral);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgb(254 192 66 / 90%);
  }
  70% {
    box-shadow: 0 0 0 7px rgb(254 192 66 / 0%);
  }
  100% {
    box-shadow: 0 0 0 0 rgb(254 192 66 / 0%);
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill--high {
  background: rgb(79 166 164 / 18%);
  color: var(--ocean-deep);
}

.pill--medium {
  background: rgb(254 192 66 / 25%);
  color: var(--sunset-deep);
}

.pill--low {
  background: rgb(242 125 57 / 16%);
  color: var(--coral-deep);
}

/* --- results -------------------------------------------------------------- */

.result-head {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
}

.result-head__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: none;
  flex-wrap: wrap;
}

.crumb {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--ink-faint);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

.crumb:hover {
  color: var(--ink);
}

.guest-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.gtab {
  display: grid;
  gap: 3px;
  min-width: 168px;
  padding: 10px 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.13s;
}

.gtab:hover {
  border-color: var(--line-strong);
}

.gtab[aria-selected='true'] {
  border-color: var(--midnight);
  box-shadow: inset 0 0 0 1px var(--midnight);
}

.gtab__name {
  display: flex;
  gap: 8px;
  align-items: center;
  font: 600 14px/1.25 var(--display);
}

.gtab__meta {
  color: var(--ink-faint);
  font: 400 11.5px/1.4 var(--mono);
}

.summary {
  padding: 16px 18px;
  background: var(--midnight);
  border-radius: var(--r);
  color: #fff;
  font-size: 16px;
  line-height: 1.5;
}

.summary__label {
  display: block;
  margin-bottom: 6px;
  color: var(--sunset);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.recap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
}

.recap__chip {
  padding: 5px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.recap__chip b {
  color: var(--ink-faint);
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 5px;
}

.callout {
  padding: 14px 16px;
  margin: 14px 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 14px;
}

.callout__label {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-faint);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.callout--host {
  background: rgb(79 166 164 / 10%);
  border-color: rgb(79 166 164 / 32%);
}

.callout--host .callout__label {
  color: var(--ocean-deep);
}

/* --- the opportunity stepper --------------------------------------------- */

.opps {
  margin-top: 18px;
}

.opps__bar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.opps__count {
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.opps__count b {
  font: 600 15px/1 var(--mono);
  color: var(--ink);
}

.opps__nav {
  display: flex;
  gap: 7px;
  align-items: center;
}

.opps__hint {
  color: var(--ink-faint);
  font-size: 12.5px;
}

kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 4px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  font: 500 11px/1.4 var(--mono);
  text-align: center;
}

.opps__rail {
  display: flex;
  gap: 3px;
  margin-bottom: 14px;
}

.rail-seg {
  flex: 1;
  height: 5px;
  padding: 0;
  background: var(--line-strong);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.13s, background 0.13s;
}

.rail-seg:hover {
  transform: scaleY(1.6);
}

.rail-seg--high {
  background: var(--ocean);
}

.rail-seg--medium {
  background: var(--sunset);
}

.rail-seg--low {
  background: var(--coral);
}

.rail-seg[aria-current='true'] {
  transform: scaleY(2);
}

.opp {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  animation: slide-in 0.24s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.opp--back {
  animation-name: slide-in-back;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
}

@keyframes slide-in-back {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.opp__head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}

.opp__title {
  display: flex;
  gap: 11px;
  align-items: baseline;
  font-size: 21px;
}

.opp__rank {
  font: 600 13px/1.5 var(--mono);
  color: var(--ink-faint);
}

.opp__lede {
  max-width: 72ch;
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 14.5px;
}

.opp__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.fact {
  padding: 13px 15px;
  background: var(--panel);
}

.fact--wide {
  grid-column: span 2;
}

.fact--now {
  background: rgb(254 192 66 / 12%);
}

.fact--angle {
  background: rgb(79 166 164 / 8%);
}

.fact__label {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
  color: var(--ink-faint);
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.fact__label svg {
  width: 14px;
  height: 14px;
  fill: currentcolor;
}

.fact__value {
  font-size: 14px;
  line-height: 1.5;
}

.opp__foot {
  margin-top: 14px;
}

.sources {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.sources__label {
  color: var(--ink-faint);
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  margin-right: 3px;
}

.sources a {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-soft);
  font: 500 11px/1 var(--mono);
  text-decoration: none;
}

.sources a:hover {
  background: var(--midnight);
  border-color: var(--midnight);
  color: #fff;
}

/* --- table view ----------------------------------------------------------- */

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  position: sticky;
  top: 0;
  background: var(--paper);
  color: var(--ink-faint);
  font: 500 10.5px/1.3 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fcfbf8;
}

.col-title {
  font-weight: 600;
  min-width: 160px;
}

/* --- states --------------------------------------------------------------- */

.state {
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.state strong {
  display: block;
  font: 600 16px/1.3 var(--display);
}

.state__hint {
  max-width: 62ch;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 14px;
}

.state__progress {
  position: relative;
  height: 4px;
  margin-top: 16px;
  overflow: hidden;
  background: var(--sweep-track);
  border-radius: 4px;
}

.state__progress::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--sweep);
  border-radius: 4px;
  box-shadow: var(--sweep-glow);
  animation: sweep 1.4s ease-in-out infinite;
}

.state--error {
  border-color: rgb(242 125 57 / 40%);
  background: rgb(242 125 57 / 7%);
}

.rawlink {
  display: inline-block;
  margin-top: 16px;
  color: var(--ocean-deep);
  font-size: 13.5px;
  font-weight: 500;
}

/* --- settings ------------------------------------------------------------- */

.settings {
  display: grid;
  gap: 16px;
}

.card {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.card__head {
  margin-bottom: 16px;
}

.card__head h2 {
  font-size: 17px;
}

.card__head p {
  max-width: 66ch;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.card__phase {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  background: var(--midnight);
  border-radius: 50%;
  color: #fff;
  font: 600 10.5px/1 var(--mono);
  vertical-align: 2px;
}

.settings__bar {
  position: sticky;
  bottom: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
  padding: 13px 18px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow-lift);
}

.settings__state {
  margin-right: auto;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.settings__state--ok {
  color: var(--ocean-deep);
  font-weight: 500;
}

.hint {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 12.5px;
}

.hint code {
  font: 400 12px/1.5 var(--mono);
}

.changed {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: rgb(254 192 66 / 24%);
  border-radius: 999px;
  color: var(--sunset-deep);
  font: 500 10px/1.5 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toggle-row {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.toggle-row:first-of-type {
  border-top: 0;
}

.toggle-row__copy {
  flex: 1;
}

.toggle-row__copy b {
  display: block;
  font-weight: 600;
  font-size: 14.5px;
}

.toggle-row__copy small {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 13px;
}

/* A real switch, because these settings cost money when they are wrong. */
.toggle {
  position: relative;
  width: 42px;
  height: 24px;
  flex: none;
  margin-top: 2px;
  background: var(--line-strong);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.16s;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow);
  transition: transform 0.16s;
}

.toggle[aria-pressed='true'] {
  background: var(--ocean);
}

.toggle[aria-pressed='true']::after {
  transform: translateX(18px);
}

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

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 60;
  padding: 12px 18px;
  background: var(--midnight);
  border-radius: var(--r);
  box-shadow: var(--shadow-lift);
  color: #fff;
  font-size: 14px;
  transform: translate(-50%, 0);
  animation: toast-in 0.2s ease-out;
}

.toast--error {
  background: var(--coral-deep);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 860px) {
  .grid,
  .opp__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .span2,
  .span3,
  .fact--wide {
    grid-column: span 1;
  }

  .page__head,
  .result-head,
  .commission {
    flex-direction: column;
    align-items: stretch;
  }

  .page__head-actions,
  .result-head__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    gap: 10px;
  }

  /* Narrow enough that the run name would crowd out the nav. The pulsing
     dot on its own still answers "is anything running?". */
  .activity span:last-child {
    display: none;
  }

  .nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
  }

  .nav__item {
    line-height: 38px;
  }

  .topbar__end {
    margin-left: auto;
  }

  .view {
    padding: 20px 14px 70px;
  }

  .spine {
    padding-left: 40px;
  }

  .spine::before {
    left: 11px;
  }

  .spine__num {
    left: -40px;
    width: 24px;
    height: 24px;
    font-size: 10px;
    border-width: 2px;
  }

  .who__name,
  .opps__hint {
    display: none;
  }
}
