/* Business Simulation Game portal — one stylesheet, no framework, no build step. */

:root {
  --ground: #eef0f2;
  --paper: #ffffff;
  --ink: #16191d;
  --ink-soft: #5b636d;
  --ink-faint: #8b939d;
  --rule: #d5d9de;
  --rule-soft: #e6e9ec;
  --live: #0f766e;
  --live-soft: #d7ece9;
  --alert: #9a3412;
  --alert-soft: #fbe6dc;
  --good: #15803d;
  --good-soft: #dcf0e2;
  --shadow: 0 1px 2px rgba(20, 24, 28, .06);
  --radius: 3px;
  --measure: 68ch;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.55 "Archivo", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1;
}

a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 .75rem; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .75rem 1.5rem;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.masthead__id { display: flex; align-items: center; gap: .75rem; min-width: 0; flex: 1 1 12rem; }
.masthead__logo { height: 26px; width: auto; display: block; }

.masthead__wordmark {
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .8rem;
}

.masthead__session {
  padding-left: .75rem;
  border-left: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: .85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.masthead__right {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .82rem;
  flex-wrap: wrap;
  min-width: 0;
}

.masthead__link {
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.masthead__link:hover { color: var(--ink); }
.masthead__link.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.masthead__link--live { color: var(--live); font-weight: 600; }

.seat { display: flex; align-items: center; gap: .5rem; color: var(--ink-soft); flex-wrap: wrap; min-width: 0; }
.seat__team { font-weight: 600; color: var(--ink); }

.inline { display: inline; margin: 0; }

.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: underline;
}
.linkbtn:hover { color: var(--ink); }

/* ---------------------------------------------------------- process rail */

/*
 * The eight stages as a rail down the left of every session page.
 *
 * It was a full-width bar across the top. Eight labels never fitted a laptop
 * without shrinking past reading size, and the bar pushed the actual page a
 * further 90px down on every single view. Down the side it costs width the
 * content did not need, and the labels get their own line each.
 *
 * The joins between dots are drawn per step. One long line behind the track
 * has to be placed by arithmetic over the track height, which only survives
 * while every step is exactly as tall as the others; a segment between two
 * neighbours survives a label wrapping onto a second line.
 */

.frame {
  display: grid;
  grid-template-columns: 14.5rem minmax(0, 1fr);
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
}
.frame--bare { grid-template-columns: minmax(0, 1fr); }

.process {
  position: sticky;
  top: 0;
  align-self: start;
  /*
   * A grid item refuses to shrink below its own content unless told to. The
   * rail carries a 640px-wide track when it lies down horizontally, and
   * without this the whole document gained a sideways scrollbar on a phone
   * instead of the rail scrolling inside itself.
   */
  min-width: 0;
  /*
   * Full screen height, held. The rail is a fixed frame the content scrolls
   * behind: the eight stages stay where they are however far down a list of
   * forty decisions you have gone, and the progress read-out sits on the
   * bottom edge rather than floating halfway up beside a short page.
   */
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-right: 1px solid var(--rule);
  padding: 1.15rem 1rem 1.1rem;
}

/* The stages take the space; the read-out is pushed to the floor. */
.process__track { flex: 1 1 auto; overflow-y: auto; scrollbar-width: thin; }
.process__done { flex: 0 0 auto; }

.process__cap {
  margin: 0 0 .7rem .1rem;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.process__track {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

/*
 * A stage that holds nothing, greyed even when the game has moved past it.
 *
 * Reactions can be empty while Results is full. Painting both as done tells
 * the room the reaction round happened, and a facilitator reading the rail
 * from across the table would believe it.
 */
.process__step.is-empty .process__dot {
  background: var(--paper);
  border-color: var(--rule);
  border-style: dashed;
  color: var(--ink-faint);
}
.process__step.is-empty .process__label { color: var(--ink-faint); font-weight: 500; }
.process__step.is-empty .process__verb { opacity: .65; }
.process__step.is-empty.is-now .process__dot {
  background: var(--ink);
  border-color: var(--ink);
  border-style: solid;
  color: #fff;
}

.process__step { position: relative; }

/* The join running down to the next dot. */
.process__step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 26px;
  bottom: -2px;
  width: 2px;
  border-radius: 2px;
  background: repeating-linear-gradient(180deg, var(--rule) 0 4px, transparent 4px 9px);
}
.process__step.is-linked::before {
  background: linear-gradient(180deg, var(--live), #2dd4bf);
}

.process__hit {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: .6rem;
  padding: .3rem .35rem .3rem 0;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
.process__hit:hover { background: var(--wash); }

.process__dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--rule);
  color: var(--ink-faint);
  font-size: .72rem;
  font-weight: 700;
  transition: transform .12s ease, box-shadow .12s ease;
}

.process__step.is-done .process__dot {
  background: var(--live);
  border-color: var(--live);
  color: #fff;
}

/* Where you are reading, as distinct from how far the game has got. */
.process__step.is-now .process__dot {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 0 0 3px var(--live-soft);
}

.process__hit:hover .process__dot { transform: scale(1.08); }

.process__text { display: flex; flex-direction: column; min-width: 0; }

.process__label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.25;
}
.process__step.is-now .process__label { color: var(--ink); }
.process__step.is-ahead .process__label { color: var(--ink-faint); font-weight: 500; }

.process__verb {
  font-size: .66rem;
  color: var(--ink-faint);
  letter-spacing: .02em;
  text-transform: lowercase;
}
.process__step.is-now .process__verb { color: var(--live); font-weight: 600; }

/* How far the game has got, as one number under the eight dots. */
.process__done {
  margin: 1rem .1rem 0;
  font-size: .64rem;
  color: var(--ink-faint);
  letter-spacing: .01em;
}
.process__donebar {
  display: block;
  height: 3px;
  margin-bottom: .35rem;
  border-radius: 3px;
  background: var(--rule);
  overflow: hidden;
}
.process__donebar > span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--live), #2dd4bf);
}

/*
 * Under 1040px the rail goes back across the top and scrolls sideways. A
 * 14.5rem column out of a 375px screen is not a navigation aid, it is a wall.
 */
@media (max-width: 1040px) {
  .frame { grid-template-columns: minmax(0, 1fr); }

  .process {
    position: static;
    height: auto;
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: .7rem 1rem .8rem;
  }
  .process__track { overflow-y: visible; }
  .process__cap, .process__done { display: none; }

  .process__track { flex-direction: row; min-width: 640px; }
  .process__step { flex: 1 1 0; min-width: 0; }

  .process__step:not(:last-child)::before {
    left: auto;
    right: -50%;
    top: 13px;
    bottom: auto;
    width: 100%;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--rule) 0 4px, transparent 4px 9px);
  }
  .process__step.is-linked::before {
    background: linear-gradient(90deg, var(--live), #2dd4bf);
  }

  .process__hit {
    grid-template-columns: none;
    justify-items: center;
    gap: .3rem;
    padding: 0 .3rem;
  }
  .process__text { align-items: center; text-align: center; }
  .process__verb { display: none; }
}

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

.shell { min-width: 0; max-width: 1180px; padding: 1.5rem; }

.stagehead {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.stagehead__n {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
}
.stagehead__n--aside { background: var(--ink-soft); font-style: italic; }

.stagehead__n--live {
  background: var(--live);
  position: relative;
}
.stagehead__n--live::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--live);
  animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.7); opacity: 0; } }

.stagehead__title { font-size: 1.35rem; }
.stagehead__hint { color: var(--ink-soft); font-size: .9rem; max-width: var(--measure); margin: .15rem 0 0; }

/* ------------------------------------------------------------------- panels */

.panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.1rem;
}
.panel--narrow { max-width: 26rem; margin: 3rem auto; }

.panel__title { font-size: 1rem; letter-spacing: .01em; }

.panel__note {
  color: var(--ink-soft);
  font-size: .85rem;
  margin: .2rem 0 .9rem;
  max-width: var(--measure);
}

.panel__headrow {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
  padding-bottom: .6rem;
  margin-bottom: .9rem;
  border-bottom: 1px solid var(--rule-soft);
}
.panel__objective { color: var(--ink-soft); font-size: .85rem; }
.panel__count { margin-left: auto; color: var(--ink-faint); font-size: .78rem; }

.lede { font-size: 1rem; max-width: var(--measure); }

.empty {
  color: var(--ink-soft);
  font-size: .9rem;
  font-style: italic;
  padding: .5rem 0;
  max-width: var(--measure);
}

.notice {
  padding: .6rem .8rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--ink-soft);
  background: var(--paper);
  font-size: .88rem;
  margin-bottom: 1rem;
}
.notice--warn { border-left-color: var(--alert); background: var(--alert-soft); }
.notice--info { border-left-color: var(--live); background: var(--live-soft); }

/* -------------------------------------------------------------------- grids */

.grid {
  display: grid;
  /* min() so a card never insists on being wider than the screen it is on. */
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 1rem;
}
.grid--wide { grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.split--live { grid-template-columns: 1.35fr 1fr; align-items: start; }

@media (max-width: 900px) {
  .split, .split--live { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ entries */

.entry {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  background: var(--paper);
}

.entry__head {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  margin-bottom: .6rem;
}
.entry__title { font-size: .98rem; }

.entry__score {
  margin-left: auto;
  font-weight: 700;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.entry__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .8rem;
  padding-top: .6rem;
  border-top: 1px solid var(--rule-soft);
  font-size: .78rem;
}
.entry__link { color: var(--live); text-decoration: none; font-weight: 600; }
.entry__link:hover { text-decoration: underline; }
.entry__muted { color: var(--ink-faint); }

.entry--decision { border-left: 3px solid var(--ink); }
.entry--reaction { border-left: 3px solid var(--alert); }
.entry--scenario { border-left: 3px solid var(--live); }
.entry--rival    { border-left: 3px solid var(--alert); }
.entry--client   { border-left: 3px solid var(--good); margin-bottom: 1rem; }
.entry--market   { margin-bottom: .75rem; }

.entry--rec.prio-critical { border-left: 3px solid var(--alert); }
.entry--rec.prio-high     { border-left: 3px solid #b45309; }
.entry--rec.prio-medium   { border-left: 3px solid var(--ink-soft); }
.entry--rec.prio-low      { border-left: 3px solid var(--rule); }

/* --------------------------------------------------------------------- bits */

.tag {
  display: inline-block;
  padding: .1rem .4rem;
  border-radius: 2px;
  background: var(--rule-soft);
  color: var(--ink-soft);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tag--good  { background: var(--good-soft); color: var(--good); }
.tag--bad   { background: var(--alert-soft); color: var(--alert); }
.tag--live  { background: var(--live-soft); color: var(--live); }
.tag--muted { background: transparent; color: var(--ink-faint); border: 1px solid var(--rule); }
.tag--role  { background: #e8eaf6; color: #3949ab; }


.callout {
  border-left: 2px solid var(--rule);
  padding: .1rem 0 .1rem .7rem;
  margin: .7rem 0;
}
.callout__title {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-faint);
  margin-bottom: .2rem;
}

.listblock { margin-top: .85rem; }
.listblock__title {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-faint);
  margin-bottom: .3rem;
}
/* Only the plain lists emitted by list_block() get bullets. Lists that carry
   their own class (chips, submissions, eventlist, people, doclist) style
   themselves and must not inherit one. */
.listblock > ul:not([class]) > li {
  position: relative;
  padding-left: .85rem;
  margin-bottom: .2rem;
  font-size: .88rem;
}
.listblock > ul:not([class]) > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: .3rem;
  padding: .12rem .45rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-size: .78rem;
  background: var(--paper);
}

.kv { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin: .7rem 0 0; }
.kv > div { min-width: 0; }
.kv dt {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-faint);
}
.kv dd { margin: 0; font-size: .88rem; }
.kv--tight { gap: .35rem 1rem; }
.kv--stacked { flex-direction: column; gap: .45rem; }
.kv--stacked dd { max-width: var(--measure); }

.dash { color: var(--rule); }

/* ------------------------------------------------------------------- meters */

.meters { margin-top: .8rem; display: grid; gap: .3rem; }

.meter { display: grid; grid-template-columns: 8.5rem 1fr 2.5rem; align-items: center; gap: .5rem; }
.meter__label { font-size: .74rem; color: var(--ink-soft); }
.meter__track { height: 5px; background: var(--rule-soft); border-radius: 3px; overflow: hidden; }
.meter__fill { display: block; height: 100%; background: var(--ink); }
.meter__value { font-size: .78rem; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink-soft); }

.gauge { display: grid; gap: .1rem; }
.scenario__gauges { display: flex; gap: 1.5rem; margin-bottom: .8rem; }
.gauge__value { font-size: 1.1rem; font-weight: 700; }
.gauge__label { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.gauge__track { display: block; height: 4px; width: 7rem; background: var(--rule-soft); border-radius: 2px; overflow: hidden; margin-top: .2rem; }
.gauge__fill { display: block; height: 100%; background: var(--live); }
.gauge--negative .gauge__fill { background: var(--alert); }
.gauge--negative .gauge__value { color: var(--alert); }

/* ------------------------------------------------------------------- rounds */

.rounds { display: grid; gap: .75rem; }

.round {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  padding: .8rem 0;
  border-top: 1px solid var(--rule-soft);
}
.round:first-child { border-top: 0; }


@media (max-width: 700px) { .round { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------- timeline */


/* ---------------------------------------------------------------- standings */

.standings { display: grid; gap: .6rem; }

.standing { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: .75rem; align-items: center; }
.standing__rank { font-size: 1.1rem; font-weight: 700; color: var(--ink-faint); text-align: right; }
.standing__head { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.standing__team { font-size: .92rem; }
.standing__bars { display: grid; gap: .2rem; }

.standing__gap { font-weight: 700; font-variant-numeric: tabular-nums; font-size: .88rem; }
.standing__gap.is-up { color: var(--good); }
.standing__gap.is-down { color: var(--alert); }

.bar { display: grid; grid-template-columns: 4.5rem 1fr 3rem; align-items: center; gap: .5rem; }
.bar__label { font-size: .7rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }
.bar__track { height: 8px; background: var(--rule-soft); border-radius: 4px; overflow: hidden; }
.bar__fill { display: block; height: 100%; background: var(--ink); }
.bar--ghost .bar__fill { background: repeating-linear-gradient(45deg, var(--ink-faint), var(--ink-faint) 3px, transparent 3px, transparent 6px); }
.bar__value { font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

.ranklist { display: grid; gap: .5rem; }
.ranklist__item { display: grid; grid-template-columns: 2.6rem 1fr; gap: .75rem; align-items: baseline; padding: .45rem 0; border-top: 1px solid var(--rule-soft); }
.ranklist__item:first-child { border-top: 0; }
.ranklist__score { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.ranklist__text { font-size: .9rem; margin: 0 0 .15rem; }
.ranklist__meta { display: flex; gap: .4rem; align-items: center; font-size: .76rem; color: var(--ink-faint); margin: 0; }

/* ------------------------------------------------------------------- tables */

.tablewrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); font-weight: 600; white-space: nowrap; }
.table tbody th { font-weight: 600; }
.table .num { font-variant-numeric: tabular-nums; font-weight: 700; }
.table__sub { display: block; font-weight: 400; color: var(--ink-faint); font-size: .78rem; margin-top: .15rem; max-width: 32ch; }
.table tr.is-late { background: var(--alert-soft); }
.is-late-cell { color: var(--alert); font-weight: 600; }

/* -------------------------------------------------------------------- plans */

.statrow { display: flex; flex-wrap: wrap; gap: 2rem; }
.stat { display: grid; gap: .1rem; }
.stat__value { font-size: 1.7rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.stat--alert .stat__value { color: var(--alert); }

.progress { display: flex; align-items: center; gap: .45rem; }
.progress__track { flex: 1 1 4rem; min-width: 3rem; height: 6px; background: var(--rule-soft); border-radius: 3px; overflow: hidden; }
.progress__fill { display: block; height: 100%; background: var(--live); }
.progress__value { font-size: .76rem; font-variant-numeric: tabular-nums; color: var(--ink-soft); }

.planlist { display: grid; gap: .5rem; }
.planlist__item { display: grid; gap: .25rem; padding: .45rem .6rem; background: var(--ground); border-radius: var(--radius); }
.planlist__head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.planlist__title { font-size: .86rem; font-weight: 600; }
.planlist__due { font-size: .74rem; color: var(--ink-faint); }

/* ---------------------------------------------------------------- reference */

.doclist { display: grid; gap: .4rem; }
.doc { display: flex; align-items: center; gap: 1rem; padding: .55rem .7rem; background: var(--ground); border-radius: var(--radius); }
.doc__body { flex: 1; min-width: 0; }
.doc__title { font-size: .9rem; }
.doc__desc { font-size: .8rem; color: var(--ink-soft); margin: .15rem 0 0; max-width: var(--measure); }

.provoker { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem .8rem; background: var(--ground); border-radius: var(--radius); margin-bottom: .9rem; }
.provoker__tag { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); padding-top: .15rem; white-space: nowrap; }
.provoker__text { font-size: .9rem; margin: 0; }
.provoker__meta { font-size: .76rem; color: var(--ink-faint); margin: .15rem 0 0; }

/* ------------------------------------------------------------------ live UI */

.pulse { display: inline-flex; align-items: center; gap: .35rem; margin-left: .5rem; font-size: .78rem; color: var(--live); }
.pulse__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: blink 2s ease-in-out infinite; }
.pulse.is-stale .pulse__dot { background: var(--alert); animation: none; }
.pulse.is-stale { color: var(--alert); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.liveround { padding: .8rem 0; border-top: 1px solid var(--rule-soft); }
.liveround:first-child { border-top: 0; }
.liveround__head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.liveround__title { font-size: 1rem; }
.liveround__objective { color: var(--ink-soft); font-size: .86rem; margin: .3rem 0 .5rem; }

.liveround__clock {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.05rem;
}
.liveround__clock.is-over { color: var(--alert); }
.liveround__clock.is-soon { color: var(--alert); }

.clockbar { height: 4px; background: var(--rule-soft); border-radius: 2px; overflow: hidden; margin-bottom: .6rem; }
.clockbar__fill { display: block; height: 100%; background: var(--live); transition: width 1s linear; }
.clockbar__fill.is-over { background: var(--alert); }

.submissions { display: grid; gap: .25rem; }
.submission { display: flex; justify-content: space-between; gap: .75rem; padding: .3rem .55rem; border-radius: var(--radius); font-size: .84rem; }
.submission.is-in { background: var(--good-soft); }
.submission.is-waiting { background: var(--ground); color: var(--ink-soft); }
.submission__team { font-weight: 600; }
.submission__state { font-size: .78rem; }

.feed { display: grid; gap: .1rem; max-height: 34rem; overflow-y: auto; }
.feed__item { display: grid; grid-template-columns: 4.5rem 1fr; gap: .6rem; padding: .45rem 0; border-top: 1px solid var(--rule-soft); font-size: .84rem; align-items: baseline; }
.feed__item:first-child { border-top: 0; }
.feed__when { font-size: .72rem; color: var(--ink-faint); white-space: nowrap; }
.feed__what { font-weight: 500; }
.feed__meta { grid-column: 2; font-size: .76rem; color: var(--ink-faint); }
.feed__item--decision .feed__what { color: var(--ink); }
.feed__item--reaction .feed__what { color: var(--alert); }
.feed__item--round .feed__what { color: var(--live); }

.feed__item.is-new { animation: slidein .4s ease-out; }
@keyframes slidein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------- forms */

.form { display: grid; gap: .8rem; }
.field { display: grid; gap: .25rem; }
.field__label { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }

.field__input {
  padding: .5rem .6rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font: inherit;
  background: var(--paper);
  color: var(--ink);
}
.field__input:focus { outline: 2px solid var(--live); outline-offset: -1px; border-color: var(--live); }

.btn {
  display: inline-block;
  padding: .45rem .8rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: .86rem;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--ground); }
.btn--primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--primary:hover { background: #000; }
.btn--small { padding: .25rem .55rem; font-size: .78rem; }

.pagelink { margin-top: .5rem; }
.ext { color: var(--live); }

/* -------------------------------------------------------------------- cards */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }

.card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--ink-soft); box-shadow: var(--shadow); }
.card__hit { display: block; padding: 1rem; text-decoration: none; color: inherit; }
.card__head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.card__title { font-size: 1rem; }
.card__problem { font-size: .87rem; color: var(--ink-soft); max-width: var(--measure); }

@media print {
  .masthead, .process, .no-print { display: none; }
  body { background: #fff; }
  .panel { border: 0; box-shadow: none; padding: 0; margin-bottom: 1.5rem; break-inside: avoid; }
}

/* Small screens: the masthead is the only thing that can force the page wide. */
@media (max-width: 640px) {
  .masthead { padding: .6rem .9rem; gap: .5rem; }
  .masthead__right { gap: .65rem; font-size: .78rem; }
  .masthead__session { padding-left: .5rem; }
  .shell { padding: 1rem .9rem; }
  .process { padding: .6rem .9rem; }
  .statrow { gap: 1.1rem; }
  .stat__value { font-size: 1.35rem; }
  .meter { grid-template-columns: 6.5rem 1fr 2.2rem; }
  .stagehead__title { font-size: 1.15rem; }
}

/* --------------------------------------------------------------------- tabs */

.tabs {
  display: flex;
  gap: .2rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  /* The active tab's -1px bottom margin overflows vertically by a hair, which
     was enough to raise a stray vertical scrollbar beside every tab row. */
  overflow-y: hidden;
  scrollbar-width: thin;
}

.tab {
  padding: .45rem .8rem;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: .88rem;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); background: var(--paper); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------- links */

.xlink {
  color: var(--live);
  text-decoration: none;
  font-size: .8rem;
  font-weight: 600;
}
.xlink:hover { text-decoration: underline; }

.entry__self { text-decoration: none; color: inherit; border-bottom: 1px solid transparent; }
.entry__self:hover { border-bottom-color: var(--ink-faint); }

.chip--link { text-decoration: none; color: var(--ink); transition: border-color .12s, background .12s; }
.chip--link:hover { border-color: var(--live); background: var(--live-soft); color: var(--live); }


/* ------------------------------------------------------------------ rounds */

.roundcard--current { border-left: 3px solid var(--live); }

.roundcard__clock {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1rem;
}
.roundcard__clock.is-over { color: var(--alert); }
.roundcard__clock.is-soon { color: var(--alert); }

.roundcard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: .8rem;
  border-top: 1px solid var(--rule-soft);
}
.roundcard__links { display: flex; gap: 1rem; flex-wrap: wrap; }
.roundcard__actions { display: flex; gap: .4rem; flex-wrap: wrap; }

.roundstrip { display: grid; gap: .4rem; }

.roundchip {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .6rem;
  background: var(--ground);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
}
.roundchip:hover { background: var(--rule-soft); }
.roundchip.is-current { border-left-color: var(--live); background: var(--live-soft); }
.roundchip__n { font-weight: 700; font-size: .9rem; min-width: 2rem; }
.roundchip__obj { flex: 1; font-size: .86rem; color: var(--ink-soft); }

/* ------------------------------------------------------------------ events */

.eventlist { display: grid; gap: .35rem; }

.eventitem { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; font-size: .86rem; }
.eventitem__when {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-faint);
  min-width: 6.5rem;
}
.eventitem__title { font-weight: 500; }

.eventlist--full { gap: 0; }

.eventrow {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: .85rem 0;
  border-top: 1px solid var(--rule-soft);
}
.eventrow:first-child { border-top: 0; }

/* The in-game date leads; the real injection time is not shown at all. */
.eventrow__date {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink);
  padding-top: .1rem;
}

@media (max-width: 700px) {
  .eventrow { grid-template-columns: 1fr; gap: .3rem; }
}

/* ------------------------------------------------------------------ people */

.people { display: grid; gap: .3rem; }

.person {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .35rem .55rem;
  background: var(--ground);
  border-radius: var(--radius);
  font-size: .86rem;
}
.person.is-me { background: var(--live-soft); }
.person__name { font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.person__meta { display: flex; align-items: center; gap: .4rem; }
.person__org { font-size: .76rem; color: var(--ink-faint); }

/* Clickable team names in the submission list */
a.submission__team { text-decoration: none; color: inherit; }
a.submission__team:hover { text-decoration: underline; }

/* ==================================================== round tabs and cards */

.tabs--rounds { gap: .3rem; border-bottom-width: 2px; }

.tab--round {
  display: grid;
  gap: 0;
  padding: .45rem .9rem;
  border: 1px solid var(--rule);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--ground);
  position: relative;
}
.tab--round .tab__n { font-size: .86rem; font-weight: 600; }
.tab--round .tab__state { font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); }
.tab--round.is-active { background: var(--paper); border-color: var(--rule); border-bottom-color: var(--paper); }
.tab--round.is-open .tab__state { color: var(--live); font-weight: 700; }

.tab__pip {
  position: absolute;
  top: .35rem;
  right: .4rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
}

.statrow--tight { gap: 1.6rem; margin: .8rem 0 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--rule-soft); }

/* ============================================================ create forms */

.panel--form { max-width: 46rem; }
.form--wide { gap: 1rem; }
.field__req { color: var(--alert); margin-left: .15rem; }
.field__hint { font-size: .74rem; color: var(--ink-faint); }

.field--range { display: grid; gap: .3rem; }
.slider { display: flex; align-items: center; gap: .6rem; }
/* min-width:0 because a flex item defaults to min-width:auto, and a range
   input's intrinsic minimum is wide enough to push a phone-width form
   sideways by a few pixels. */
.slider__input { flex: 1; min-width: 0; accent-color: var(--live); }
.slider__value {
  min-width: 2.4rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: .86rem;
}

.form__actions { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; }

.btn--add { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; }
.btn__plus { font-size: 1.05em; line-height: 1; color: var(--live); font-weight: 700; }
.btn--add:hover { border-color: var(--live); color: var(--live); }

.stagehead__n--new { background: var(--live); font-size: 1.2rem; }

/* ============================================ stage head with an action row */

.stagehead { align-items: flex-start; }
.stagehead__text { flex: 1; min-width: 0; }
.stagehead__actions { display: flex; gap: .4rem; flex-wrap: wrap; padding-top: .2rem; }

@media (max-width: 700px) {
  .stagehead { flex-wrap: wrap; }
  .stagehead__actions { width: 100%; }
}

/* ================================================= readability and density */

/* Cards lift slightly on hover so a clickable one reads as clickable. */
.entry { transition: border-color .15s, box-shadow .15s; }
.entry:hover { box-shadow: var(--shadow); }

.entry__head { padding-bottom: .5rem; border-bottom: 1px solid var(--rule-soft); }

/* A comfortable measure for prose, without starving the data blocks. */
.lede { line-height: 1.6; }
.callout p { line-height: 1.6; }

.learnlist { display: grid; gap: .35rem; }
.learnlist li {
  position: relative;
  padding-left: .9rem;
  font-size: .88rem;
  line-height: 1.5;
}
.learnlist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .6em;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--live);
}

.entry--learning { border-left: 3px solid var(--live); }

/* Scores are the thing people scan for: give them room. */
.entry__score { font-size: 1.15rem; letter-spacing: -.02em; }

.panel { padding: 1.25rem 1.4rem; }
@media (max-width: 700px) { .panel { padding: 1rem .9rem; } }

/* ===================================================================== *
 * Components added in the interactivity round.
 * ===================================================================== */

/* ------------------------------------------------------------ breadcrumb */

.crumbs { margin-bottom: .6rem; }

.crumbs__back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: .2rem .45rem .2rem .2rem;
  border-radius: var(--radius);
}
.crumbs__back:hover { color: var(--ink); background: var(--paper); }

.stagehead--detail { align-items: center; }
.stagehead__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .35rem; }
.stagehead__actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

.lede--big { font-size: 1.05rem; line-height: 1.6; }
.entry__score--big { font-size: 1.3rem; }

/* -------------------------------------------------------------- toolbar */

/*
 * Filters and ordering on one line. They answer one question — which of these,
 * in what order — so they are one control, not two stacked rows.
 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .75rem;
  padding: .5rem .65rem;
  margin-bottom: 1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toolbar__group { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.toolbar__group--sorts { margin-left: auto; }

.toolbar__select {
  font: inherit;
  font-size: .8rem;
  color: var(--ink-soft);
  padding: .28rem 1.5rem .28rem .5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  appearance: none;
  max-width: 12rem;
}
.toolbar__select:focus { outline: 2px solid var(--live); outline-offset: 1px; }

/* A filter that is doing something must not look like one that is not. */
.toolbar__select.is-on {
  border-color: var(--live);
  color: var(--ink);
  background-color: var(--live-soft);
  font-weight: 600;
}

.toolbar__legend {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-faint);
}

.toolbar__reset {
  font-size: .75rem;
  color: var(--alert);
  text-decoration: none;
  padding: .2rem .45rem;
  border-radius: 10px;
  background: var(--alert-soft);
}
.toolbar__reset:hover { text-decoration: underline; }

.sortchip {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .76rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: .24rem .5rem;
  border: 1px solid var(--rule);
  border-radius: 11px;
  background: var(--paper);
  white-space: nowrap;
}
.sortchip:hover { border-color: var(--ink-faint); color: var(--ink); }
.sortchip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}
.sortchip__dir { font-size: .7rem; opacity: .85; }

@media (max-width: 760px) {
  .toolbar__group--sorts { margin-left: 0; }
  .toolbar__select { flex: 1 1 8rem; max-width: none; }
}

/* --------------------------------------------------------- clickable card */

/*
 * A whole card is the click target, via a cover link stretched over it. Real
 * links inside sit above the cover, so "open the reaction thread" still goes to
 * the thread and not to the card's own page.
 */
.entry--open { position: relative; }
.entry--open:hover { border-color: var(--ink-faint); box-shadow: 0 2px 6px rgba(20, 24, 28, .09); }

.entry__cover {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
}
.entry--open > *:not(.entry__cover) { position: relative; z-index: 1; }
.entry--open .entry__cover:focus-visible { outline: 2px solid var(--live); outline-offset: -2px; }

/* Inner links must stay clickable above the cover. */
.entry--open a:not(.entry__cover),
.entry--open button { position: relative; z-index: 2; }

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

.chiprow { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; }

.chip--quiet { background: var(--rule-soft); color: var(--ink-soft); border-color: transparent; }
.chip--warn  { background: var(--alert-soft); color: var(--alert); border-color: transparent; font-weight: 600; }

.countpill {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .35rem;
  margin-left: .35rem;
  border-radius: 10px;
  background: var(--live);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
}
.countpill--zero { background: var(--rule-soft); color: var(--ink-faint); }

/* --------------------------------------------------------- the dimensions */

.dims { display: flex; flex-wrap: wrap; gap: .35rem; margin: .1rem 0 .75rem; }

.dim {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .74rem;
  font-weight: 600;
  padding: .18rem .5rem;
  border-radius: 11px;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  background: var(--paper);
}
.dim__icon { font-size: .8rem; line-height: 1; opacity: .7; }

.dim--geo { border-color: #c7d6e6; background: #eef4fa; color: #23486e; }

/* The time chips run warm to cool: the sooner it bites, the hotter it reads. */
.dim--immediate  { border-color: #f0c0ac; background: #fdece4; color: #9a3412; }
.dim--short_term { border-color: #f2d8a8; background: #fdf3e0; color: #8a5a09; }
.dim--long_term  { border-color: #bcd7d3; background: var(--live-soft); color: #0f5f59; }
.dim--on_event   { border-color: #cfc9e6; background: #efecf9; color: #4c3f83; }

/* --------------------------------------------------------------- priority */

.prio { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }

.prio__pips { display: inline-flex; gap: 2px; align-items: flex-end; }

.prio__pip {
  width: 3px;
  height: 8px;
  border-radius: 1px;
  background: var(--rule);
}
.prio__pip:nth-child(2) { height: 10px; }
.prio__pip:nth-child(3) { height: 12px; }
.prio__pip:nth-child(4) { height: 14px; }

.prio__word {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .01em;
}

.prio--critical .prio__pip.is-on { background: #b91c1c; }
.prio--critical .prio__word { color: #b91c1c; }
.prio--high     .prio__pip.is-on { background: var(--alert); }
.prio--high     .prio__word { color: var(--alert); }
.prio--medium   .prio__pip.is-on { background: #a16207; }
.prio--medium   .prio__word { color: #a16207; }
.prio--low      .prio__pip.is-on { background: var(--ink-faint); }
.prio--low      .prio__word { color: var(--ink-soft); }

.prioset { display: flex; flex-wrap: wrap; gap: .4rem; }

.prioset__opt { cursor: pointer; }
.prioset__opt input { position: absolute; opacity: 0; width: 0; height: 0; }

.prioset__face {
  display: inline-flex;
  align-items: center;
  padding: .35rem .6rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
}
.prioset__opt input:checked + .prioset__face {
  border-color: var(--ink);
  background: var(--ground);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.prioset__opt input:focus-visible + .prioset__face { outline: 2px solid var(--live); outline-offset: 1px; }

/* ---------------------------------------------------------- small cards */

.minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; }
.minis--stack { grid-template-columns: 1fr; }

.mini {
  display: block;
  padding: .55rem .65rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  text-decoration: none;
  color: inherit;
}
.mini:hover { border-color: var(--ink-faint); border-left-color: var(--live); background: #fbfcfc; }

.mini__tag {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-faint);
  margin-bottom: .1rem;
}
.mini__title { display: block; font-size: .88rem; font-weight: 600; line-height: 1.4; }
.mini__meta { display: block; font-size: .76rem; color: var(--ink-soft); margin-top: .15rem; }

.mini--decision { border-left-color: #7aa7c7; }
.mini--reaction { border-left-color: #c79b7a; }
.mini--scenario { border-left-color: #9b8ec7; }
.mini--round    { border-left-color: var(--live); }

/* ------------------------------------------------------------- the picker */

.picker { display: block; }

.picker__ui {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}

.picker__head {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .5rem;
  border-bottom: 1px solid var(--rule-soft);
  background: #fafbfb;
}

.picker__search {
  flex: 1 1 auto;
  font: inherit;
  font-size: .85rem;
  padding: .3rem .45rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  min-width: 0;
}
.picker__search:focus { outline: 2px solid var(--live); outline-offset: 0; }

.picker__count { font-size: .72rem; color: var(--live); font-weight: 700; white-space: nowrap; }
.picker__count.is-empty { color: var(--ink-faint); font-weight: 500; }

.picker__list { max-height: 15rem; overflow-y: auto; }
.picker__list.is-empty::after {
  content: "Nothing matches that search.";
  display: block;
  padding: .8rem;
  color: var(--ink-faint);
  font-size: .85rem;
}

.pick {
  display: flex;
  gap: .5rem;
  width: 100%;
  text-align: left;
  font: inherit;
  padding: .5rem .6rem;
  border: 0;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--paper);
  cursor: pointer;
}
.pick:last-child { border-bottom: 0; }
.pick:hover { background: #f6f8f8; }
.pick:focus-visible { outline: 2px solid var(--live); outline-offset: -2px; }

.pick__mark {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: .15rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper);
}
.pick[role="radio"] .pick__mark { border-radius: 50%; }

.pick.is-picked { background: var(--live-soft); }
.pick.is-picked .pick__mark {
  background: var(--live);
  border-color: var(--live);
  box-shadow: inset 0 0 0 2px var(--live-soft);
}

.pick__body { min-width: 0; }
.pick__line { display: flex; align-items: baseline; gap: .35rem; flex-wrap: wrap; }
.pick__title { font-size: .85rem; font-weight: 600; }
.pick__tag {
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-faint);
}
.pick__meta { display: block; font-size: .76rem; color: var(--ink-soft); line-height: 1.35; }
.pick__note { display: block; font-size: .72rem; color: var(--live); font-weight: 600; }

/* ------------------------------------------------------- form sectioning */

.formsec { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }

.formsec__legend {
  padding: 0 0 .3rem;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule-soft);
  width: 100%;
  margin-bottom: .7rem;
}

.formsec__body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .8rem 1rem;
}
.field--wide { grid-column: 1 / -1; }

/* ---------------------------------------------------------------- comments */

.thread { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }

.note {
  padding: .55rem .7rem;
  border-left: 3px solid var(--rule);
  background: #fafbfb;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.note__head { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .2rem; }
.note__who { font-size: .82rem; font-weight: 700; }
.note__when { font-size: .72rem; color: var(--ink-faint); }
.note__body { font-size: .9rem; line-height: 1.55; margin: 0; }

.comment-form { border-top: 1px solid var(--rule-soft); padding-top: .8rem; }

/* --------------------------------------------------------- the assistant */

.panel--ai { border-color: #cfc9e6; }

.ai__head { display: flex; align-items: center; gap: .5rem; margin-bottom: .2rem; }

.ai__badge {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #4c3f83;
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.ai__prompts { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }

.ai__chip {
  font: inherit;
  font-size: .78rem;
  text-align: left;
  padding: .3rem .55rem;
  border: 1px solid #cfc9e6;
  border-radius: 12px;
  background: #f6f4fc;
  color: #40357a;
  cursor: pointer;
}
.ai__chip:hover { background: #efecf9; border-color: #b3a9dc; }

.ai__ask { display: flex; gap: .4rem; }
.ai__ask .field__input { flex: 1 1 auto; min-width: 0; }

.ai__answer,
.ai__out {
  margin: .5rem 0 .75rem;
  padding: .65rem .75rem;
  background: #f6f4fc;
  border-left: 3px solid #4c3f83;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .9rem;
  line-height: 1.6;
}
.ai__asked { font-weight: 700; color: #40357a; margin-bottom: .35rem; }
.ai__thinking { color: var(--ink-soft); font-style: italic; margin: 0; }
.ai__error { color: var(--alert); margin: 0; }
.ai__form.is-asking .ai__chip { opacity: .5; pointer-events: none; }

/* ---------------------------------------------------------------- layout */

.split--detail { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .split--detail { grid-template-columns: 1fr; } }

.panel--desk { border-color: var(--live); border-left-width: 3px; }

.listblock__headrow { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }

.meters--tight .meter { margin-bottom: .25rem; }

.provoker--link { text-decoration: none; color: inherit; display: flex; }
.provoker--link:hover { background: var(--live-soft); border-color: var(--live); }

/* ------------------------------------------------- live page, made clickable */

.stat--link { text-decoration: none; color: inherit; border-radius: var(--radius); }
.stat--link:hover { background: var(--ground); }

.submission__hit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  text-decoration: none;
  color: inherit;
  padding: .25rem .1rem;
}
.submission__hit:hover .submission__team { text-decoration: underline; }

/*
 * Wrapping a feed row in a link put one child where the grid expected three,
 * so the whole row was squeezed into the 4.5rem timestamp column. The link
 * carries the same grid instead of collapsing it.
 */
.feed__hit {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: .6rem;
  align-items: baseline;
  grid-column: 1 / -1;
  text-decoration: none;
  color: inherit;
}
.feed__hit:hover .feed__what { text-decoration: underline; }

.tag--date { background: var(--ink); color: #fff; }

.eventitem__title { color: inherit; text-decoration: none; font-weight: 600; }
.eventitem__title:hover { text-decoration: underline; }
.masthead__session { color: inherit; text-decoration: none; }
.masthead__session:hover { text-decoration: underline; }
.seat__team { color: inherit; text-decoration: none; }
.seat__team:hover { text-decoration: underline; }

.meter--negative .meter__fill { background: var(--alert); }
.meter--negative .meter__value { color: var(--alert); font-weight: 700; }
.stagehead__meta .entry__score { margin-left: .5rem; }

/* ===================================================================== *
 * Team badges, tags, the nested ranking, the control desk.
 * ===================================================================== */

/* ------------------------------------------------------------- team badge */

/*
 * A logo when the team has one, its initials when it does not. Never nothing:
 * the badge is a fixed column in every list it appears in, and an empty one
 * makes the row below it jump.
 */
.badge {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
}

.badge--img { object-fit: contain; background: var(--paper); border: 1px solid var(--rule-soft); }

.badge--ini {
  /*
   * --team is set inline by team_color(): the client's own color_code when
   * Studio has one, otherwise a hue derived from the name so a team is still
   * the same colour on every page. Kept as a tint rather than a solid fill —
   * a brand colour chosen for a logo is not necessarily a colour white text
   * can sit on, and the badge must stay legible whatever is in the field.
   */
  --team: #55606b;
  background: color-mix(in srgb, var(--team) 13%, #fff);
  color: color-mix(in srgb, var(--team) 78%, #000);
  border: 1px solid color-mix(in srgb, var(--team) 32%, #fff);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.badge--sm { width: 20px; height: 20px; border-radius: 4px; }
.badge--sm.badge--ini { font-size: .56rem; }
.badge--lg { width: 40px; height: 40px; border-radius: 6px; }
.badge--lg.badge--ini { font-size: .95rem; }

.standing__head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ------------------------------------------------------------------- tags */

.taglist { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 .75rem; }

.taglabel {
  display: inline-flex;
  align-items: baseline;
  font-size: .74rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  padding: .12rem .45rem;
  border-radius: 3px;
  background: var(--rule-soft);
}
.taglabel:hover { background: var(--live-soft); color: var(--live); }
.taglabel__hash { opacity: .5; margin-right: .1rem; }
.taglabel--static { background: transparent; padding: 0 .3rem 0 0; font-weight: 500; }

/* --------------------------------------------------- the nested ranking */

/*
 * Scenario, then the decisions taken against it, then the counter-measures
 * those drew. The indent is the argument: it says a reaction only exists
 * because of a decision, which only exists because of a future.
 */
.nest { display: grid; gap: .1rem; }

.nest__children {
  display: grid;
  gap: .1rem;
  margin-left: 1.15rem;
  padding-left: .85rem;
  border-left: 2px solid var(--rule-soft);
}

.nest__row {
  display: grid;
  grid-template-columns: 5.4rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .6rem;
  padding: .4rem .1rem;
  border-top: 1px solid var(--rule-soft);
}
.nest__scenario > .nest__row { border-top-width: 2px; border-top-color: var(--rule); }
.nest > .nest__scenario:first-child > .nest__row { border-top: 0; }

.nest__kind {
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  text-align: center;
  padding: .15rem .3rem;
  border-radius: 3px;
}
.nest__kind--scenario { background: #efecf9; color: #4c3f83; }
.nest__kind--decision { background: #e7f0f7; color: #23486e; }
.nest__kind--reaction { background: #fbeee5; color: #8a4a1a; }

.nest__text {
  min-width: 0;
  color: inherit;
  text-decoration: none;
  font-size: .88rem;
  line-height: 1.4;
}
.nest__text:hover { text-decoration: underline; }
.nest__row--scenario .nest__text { font-weight: 700; font-size: .95rem; }
.nest__text--none { color: var(--ink-faint); font-style: italic; }

.nest__team {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .76rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.nest__score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 2.5rem;
}
.nest__row--scenario .nest__score { font-size: 1.05rem; }
.nest__row--reaction .nest__score { color: var(--ink-soft); font-weight: 600; }

@media (max-width: 700px) {
  .nest__row { grid-template-columns: 4.6rem minmax(0, 1fr) auto; }
  .nest__team { display: none; }
  .nest__children { margin-left: .5rem; padding-left: .55rem; }
}

/* -------------------------------------------------------- the control desk */

.table--control th[scope="row"] { white-space: nowrap; }
.table--control tr.is-open { background: var(--live-soft); }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }

.controls__open { display: flex; align-items: center; gap: .3rem; }

.controls__mins { display: inline-flex; align-items: center; gap: .25rem; font-size: .74rem; color: var(--ink-faint); }
.controls__mins .field__input { width: 4rem; padding: .2rem .35rem; font-size: .8rem; }

/* A round short of one decision per team is the thing to notice. */
.is-short { color: var(--alert); font-weight: 700; }


/* ------------------------------------------------------- team colour & link */

.teamlink {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.teamlink:hover { border-bottom-color: currentColor; }
.teamlink > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------- nature ---- */

/*
 * Preventive / curative / conditional. Deliberately quieter than the priority
 * badge: it classifies a move, it does not rank it.
 */
.nature {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .1rem .45rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  color: var(--ink-soft);
  background: var(--paper);
}
.nature::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.nature--preventive  { color: #1d6fa5; border-color: #bcdcf0; background: #f2f9fd; }
.nature--curative    { color: #a2600d; border-color: #f0dcbc; background: #fdf8f2; }
.nature--conditional { color: #5c5470; border-color: #d8d4e2; background: #f8f7fb; }

/* ---------------------------------------------------------- ghost button ---- */

.btn--ghost {
  background: transparent;
  border-color: var(--rule);
  color: var(--ink-soft);
}
.btn--ghost:hover { color: var(--ink); border-color: var(--ink-faint); background: var(--wash); }

/* ------------------------------------------------------------ player page --- */

.playerhead {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--team, var(--live));
  border-radius: 10px;
}
.playerhead__mark { flex: 0 0 auto; }
.playerhead__text { min-width: 0; flex: 1 1 auto; }
.playerhead__name { margin: 0; font-size: 1.35rem; line-height: 1.2; }
.playerhead__role { margin: .15rem 0 0; font-size: .8rem; color: var(--ink-faint); }
.playerhead__score { text-align: right; flex: 0 0 auto; }
.playerhead__score b { display: block; font-size: 1.5rem; line-height: 1; }
.playerhead__score span { font-size: .66rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }

.badge--xl { width: 52px; height: 52px; font-size: 1.15rem; border-radius: 12px; }

.roster { display: grid; gap: .5rem; }
.roster__row {
  display: flex;
  align-items: center;
  /* An email address is one unbreakable word. Without wrapping, one long
     address pushed a phone-width page sideways by a hundred pixels. */
  flex-wrap: wrap;
  gap: .4rem .6rem;
  padding: .55rem .7rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
}
.roster__name { font-weight: 600; min-width: 0; }
.roster__meta {
  color: var(--ink-faint);
  font-size: .78rem;
  margin-left: auto;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .roster__meta { margin-left: 0; width: 100%; text-align: left; }
}

@media (max-width: 700px) {
  .playerhead { flex-wrap: wrap; }
  .playerhead__score { text-align: left; }
}

/* ------------------------------------------------- recommendations, wide ---- */

/*
 * One recommendation per row, full width. They were a two-column grid, which
 * gave a 60-character measure to a paragraph of rationale and put two
 * unrelated recommendations side by side as though they were alternatives.
 */
.recs { display: grid; gap: .85rem; }
.rec { border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); overflow: hidden; }
.rec__head {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--wash);
}
.rec__title { margin: 0; font-size: 1rem; line-height: 1.3; flex: 1 1 auto; min-width: 0; }
.rec__body { padding: .9rem 1rem; }
.rec__grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.2rem; }
.rec__actions { display: flex; gap: .4rem; align-items: center; flex: 0 0 auto; }
@media (max-width: 820px) { .rec__grid { grid-template-columns: minmax(0, 1fr); } }

/* --------------------------------------------------------- row edit slot ---- */

.entry__edit { margin-left: auto; display: flex; gap: .4rem; align-items: center; }

/* ------------------------------------------------------- small additions ---- */

/* A score sitting among the chips, so a number reads as a number and not as
   another label. */
.chip--score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
  border-color: var(--ink-faint);
}

/* A note that introduces a whole tab rather than one panel. */
.panel__note--loose { margin: 0 0 .9rem; padding: 0 .2rem; max-width: 62ch; }

/* A team card carries its own colour as a left edge, so the four cards on the
   Context page are told apart before the names are read. */
.entry--team { border-left: 4px solid var(--team, var(--rule)); }
.entry--team .entry__title a { color: inherit; text-decoration: none; }
.entry--team .entry__title a:hover { text-decoration: underline; }

/* A heading a screen reader needs and a sighted reader does not. */
.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.table__actions { text-align: right; white-space: nowrap; }

/* ==========================================================================
   Round 3 — forms, pickers, ranking
   ========================================================================== */

/* ------------------------------------------------------------ tab bar ----- */

/* The row of add buttons that sits under a set of tabs. */
.tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: -.35rem 0 1rem;
}

/* ------------------------------------------------------- folded picker ---- */

/*
 * A relationship picker that opens on click.
 *
 * Left open, a list of forty scenarios is a wall in the middle of a form and
 * pushes everything below it off the screen. Folded, it is one line saying
 * what is chosen. It is never folded when something IS chosen — an edit form
 * that hides its own answer is worse than a long one.
 */
.picker__toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .5rem .7rem;
  border: 1px dashed var(--rule);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-soft);
  font: inherit;
  font-size: .85rem;
  text-align: left;
  cursor: pointer;
}
.picker__toggle:hover { border-color: var(--ink-faint); color: var(--ink); background: var(--wash); }
.picker__toggle::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 18px; height: 18px;
  flex: 0 0 auto;
  border-radius: 4px;
  background: var(--wash);
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1;
}
.picker.is-open > .picker__toggle::before { content: "\2212"; }
.picker.is-folded > .picker__body { display: none; }
.picker__count { margin-left: auto; color: var(--ink-faint); font-size: .76rem; }

/* -------------------------------------------------------- colour input ---- */

.colorpick { display: flex; align-items: center; gap: .5rem; }
.colorpick__swatch {
  flex: 0 0 auto;
  width: 38px; height: 34px;
  padding: 2px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
}
.colorpick__text { flex: 1 1 auto; min-width: 0; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------ form ergonomics --- */

/*
 * A form is read before it is filled. These four changes are all about the
 * reading: a section you can see the shape of, a required marker you can find,
 * a hint that sits under its field instead of beside it, and a save bar that
 * does not scroll away on a form with twenty fields.
 */
.formsec {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0;
  margin: 0 0 1rem;
  background: var(--paper);
}
.formsec__legend {
  display: block;
  width: 100%;
  margin: 0;
  padding: .6rem .95rem;
  border-bottom: 1px solid var(--rule);
  background: var(--wash);
  border-radius: 10px 10px 0 0;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.formsec__body { padding: .95rem; }

.field__req { color: var(--alert); margin-left: .15rem; font-weight: 700; }
.field__hint { display: block; margin-top: .3rem; color: var(--ink-faint); font-size: .76rem; line-height: 1.4; }

.field__input:focus-visible,
.picker__toggle:focus-visible {
  outline: 2px solid var(--live);
  outline-offset: 1px;
  border-color: var(--live);
}

/* The save bar stays on screen. A twenty-field form whose only button is at
   the bottom is a form people abandon halfway. */
.form--wide .form__actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  gap: .6rem;
  align-items: center;
  /* Bottom only. A negative horizontal margin made the bar wider than the
     form that holds it, which put a 6px scrollbar under a phone-width page. */
  margin: 0 0 -.2rem;
  padding: .8rem .2rem;
  background: linear-gradient(to top, var(--wash) 72%, transparent);
  border-top: 1px solid var(--rule);
}

/* ------------------------------------------------------------- ranking ---- */

.table__rank {
  width: 2.2rem;
  text-align: right;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  font-size: .78rem;
}

.scorepill {
  display: inline-block;
  min-width: 3rem;
  padding: .15rem .45rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--wash);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
  cursor: help;
}

.unit { color: var(--ink-faint); font-size: .78rem; }

/* -------------------------------------------------- recommendation source - */

.sourcerow { display: flex; flex-wrap: wrap; gap: .4rem; }

.src {
  display: inline-flex;
  align-items: baseline;
  gap: .4rem;
  max-width: 100%;
  padding: .3rem .55rem;
  border: 1px solid var(--rule);
  border-left-width: 3px;
  border-radius: 6px;
  background: var(--paper);
  color: inherit;
  text-decoration: none;
  font-size: .8rem;
}
.src:hover { background: var(--wash); }
.src__kind {
  flex: 0 0 auto;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.src__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src__tag { flex: 0 0 auto; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.src--scenario { border-left-color: #7c5cbf; }
.src--decision { border-left-color: #2f6fb0; }
.src--reaction { border-left-color: #c07a1e; }

.callout--impact { border-left-color: var(--live); background: var(--live-soft); }

.entry--brief { border-left: 4px solid var(--live); }


/* A last sweep for the narrowest screens: nothing in a form may be wider than
   the form. Controls whose intrinsic width beats their container -- range
   inputs, radio rows, long crumbs -- gave a phone a hairline scrollbar that no
   single rule explained. */
@media (max-width: 480px) {
  .formsec__body > * { max-width: 100%; }
  .field__input, .slider, .prioset, .colorpick { max-width: 100%; }
  .crumbs__back { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}


/* A <select> is as wide as its widest option and will happily outgrow the form
   that holds it. Every field is allowed to shrink; every control fills its
   field and stops there. */
.field { min-width: 0; }
.field__input { width: 100%; max-width: 100%; }
select.field__input { text-overflow: ellipsis; }

/* A date is one thing; broken over three lines it reads as three. */
.table--plans td:nth-last-child(2) { white-space: nowrap; }
.table--plans .table__sub { display: block; margin-top: .15rem; font-weight: 400; color: var(--ink-faint); font-size: .74rem; }
/* Participant polling must be able to hide stale actions, including .btn links. */
#participant-home [hidden] { display: none !important; }
