/* WeSee console — white, thin rules, one accent. No fills: structure comes from
   space and lines, so the page reads the same on a projector and a laptop. */

:root {
  --ink: #12233b;
  --ink-soft: #5a6a80;
  --line: #dfe4ec;
  --line-strong: #c3ccdb;
  --accent: #b4472a;
  --paper: #ffffff;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

/* The attribute is how this page hides things; a `display` rule on the element
   (the header is flex, the acknowledgement is flex) would otherwise win over it
   and leave a hidden control on screen. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}

.bar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-weight: 650;
  font-size: 14px;
  color: var(--accent);
}

.bar-title {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.bar-title span {
  color: var(--ink-soft);
  font-weight: 450;
}

.bar-person {
  margin-left: auto;
  text-align: right;
  min-width: 0;
}

.person-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.person-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 32ch;
}

.person-email {
  color: var(--ink-soft);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 32ch;
}

/* ---------- company chip ---------- */

.company {
  position: relative;
}

.chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

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

.chip:focus-visible,
.quiet:focus-visible,
.menu button:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chip-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.chip-name {
  font-weight: 600;
  max-width: 26ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-role {
  font-size: 12px;
  color: var(--ink-soft);
}

.chip-caret {
  width: 8px;
  height: 8px;
  margin: -4px 2px 0 4px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: rotate(45deg);
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 300px;
  max-height: 60vh;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 12px 30px rgba(18, 35, 59, 0.08);
}

.menu[hidden] {
  display: none;
}

.company-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.company-option:hover:not(:disabled) {
  border: 1px solid var(--line);
  padding: 7px 9px;
}

.company-option:disabled {
  cursor: default;
}

.company-option[aria-current="true"] .company-option-name {
  font-weight: 650;
}

.company-option-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-option-role {
  color: var(--ink-soft);
  font-size: 12.5px;
  white-space: nowrap;
}

.company-option-tick {
  color: var(--accent);
}

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

.page {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 56px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.card + .card {
  margin-top: 20px;
}

.card.next h2 {
  margin: 0 0 8px;
  font-size: 17px;
  letter-spacing: -0.01em;
}

h1 {
  margin: 0 0 10px;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.company-name {
  font-size: 30px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 2px;
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.lede {
  margin: 0 0 18px;
  color: var(--ink-soft);
  max-width: 56ch;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 18px;
  border-top: 1px solid var(--line);
}

.facts > div {
  padding: 14px 16px 0 0;
}

.facts > div + div {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.facts dt {
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.facts dd {
  margin: 0;
  font-weight: 550;
}

.note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 14.5px;
}

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

label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 550;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
}

input:focus {
  border-color: var(--ink-soft);
}

form button[type="submit"] {
  width: 100%;
  min-height: 46px;
  margin-top: 20px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: progress;
}

.quiet {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.quiet.inline {
  min-height: 34px;
  padding: 4px 10px;
  font-size: 14px;
}

/* ---------- status ---------- */

.status {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 14.5px;
}

.status[data-kind="error"] {
  border-color: var(--accent);
  color: var(--accent);
}

.status[data-kind="info"] {
  color: var(--ink-soft);
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12.5px;
}

@media (max-width: 720px) {
  .bar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }

  .bar-person {
    order: 3;
    margin-left: 0;
    text-align: left;
  }

  .company {
    margin-left: auto;
  }

  .menu {
    right: 0;
    min-width: min(320px, calc(100vw - 32px));
  }

  .page {
    padding: 24px 16px 40px;
  }

  .card {
    padding: 20px;
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .facts > div + div {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    margin-top: 12px;
  }

  .foot {
    flex-direction: column;
    gap: 6px;
  }
}

/* ---------- nav under the bar ---------- */

.nav {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.nav a {
  display: inline-block;
  min-height: 44px;
  padding: 12px 10px;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

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

.nav a[aria-current] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ---------- the plan table ---------- */

.plan-wrap {
  margin-top: 8px;
}

table.plan {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  table-layout: fixed;
}

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

table.plan thead th {
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 550;
  border-bottom: 1px solid var(--line-strong);
}

table.plan th:first-child,
table.plan td:first-child {
  padding-left: 0;
}

table.plan td:last-child,
table.plan th:last-child {
  padding-right: 0;
}

.plan-family {
  font-weight: 600;
}

.plan-version {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.plan .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.plan-pubs {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-pubs li {
  padding: 2px 0;
  color: var(--ink);
}

.plan-pubs li + li {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 6px;
}

.plan-pubs-ended li {
  color: var(--ink-soft);
}

.plan-unpublished {
  color: var(--ink-soft);
  font-style: italic;
}

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--ink-soft);
  vertical-align: 1px;
}

/* The plan is a table, so it gets the width a table needs; the shell card keeps
   its narrower measure for reading. */
body[data-route="plan"] .page {
  max-width: 1080px;
}

.plan-pubs li {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pub-unit {
  font-weight: 550;
}

.pub-meta {
  color: var(--ink-soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ---------- publish ---------- */

.publish {
  margin-top: 4px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field label {
  margin-top: 0;
}

.field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.field select:disabled {
  color: var(--ink-soft);
  cursor: not-allowed;
}

#publish-version {
  margin: 14px 0 0;
  font-weight: 550;
}

.preview {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.preview h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.preview-count {
  margin: 0 0 14px;
  color: var(--ink-soft);
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr;
  gap: 16px;
}

.preview-grid h4 {
  margin: 0 0 6px;
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 550;
}

.preview-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.preview-grid li {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.ack {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14.5px;
  cursor: pointer;
}

.ack input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin-top: 1px;
  flex: 0 0 auto;
}

.publish-actions {
  margin-top: 20px;
}

#publish-go {
  min-height: 46px;
  padding: 10px 22px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

#publish-go:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status[data-kind="ok"] {
  border-color: var(--ink);
  color: var(--ink);
}

@media (max-width: 720px) {
  .field-row,
  .preview-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- audience ---------- */

.audience {
  margin-top: 4px;
}

.audience-headline {
  margin: 18px 0 4px;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.audience-warnings {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  list-style: none;
  color: var(--accent);
  font-size: 14.5px;
}

.audience-warnings li + li {
  margin-top: 6px;
}

.audience-groups {
  margin-top: 22px;
}

.audience-group {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.audience-group h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 15px;
}

table.audience-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  table-layout: fixed;
}

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

table.audience-table thead th {
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 550;
}

table.audience-table th:first-child { width: 30%; }
table.audience-table th:nth-child(2) { width: 18%; }

table.audience-table th span.pub-meta {
  display: block;
  font-weight: 400;
}

.end-panel {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.end-confirm {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
}

.end-sentence {
  margin: 0 0 14px;
  font-weight: 550;
}

.end-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.end-row label {
  margin: 0;
}

.end-row input {
  width: auto;
  min-height: 40px;
}

.end-actions {
  display: flex;
  gap: 10px;
}

.danger {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.danger:disabled {
  opacity: 0.6;
  cursor: progress;
}
