/*
 * The design system: type, layout and every component, for every page we
 * write. Colours come only from tokens.css (linked first), sides are
 * logical (inline-start and inline-end) so right-to-left pages mirror, and
 * nothing is loaded from another site. See docs/DESIGN.md.
 */

/* ------------------------------------------------------------------ base */

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.0625rem;
  line-height: 1.3;
}

h3 {
  font-size: 0.9375rem;
  line-height: 1.35;
}

h4 {
  font-size: 0.875rem;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

ul,
ol {
  margin: 0;
}

code,
kbd,
samp {
  font-family: var(--font-mono);
}

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

/* Headings and areas that focus moves to when a page or drawer opens are not controls: no ring. */
:is(h1, h2, h3, main, section)[tabindex="-1"]:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

kbd {
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 700;
  border: 1px solid var(--control);
  border-block-end-width: 2px;
  border-radius: 6px;
  padding: 0 6px;
  line-height: 18px;
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
}

.icon {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon .solid {
  fill: currentColor;
  stroke: none;
}

/* Icons that point along the line turn round in right-to-left pages. */
:dir(rtl) .icon.flip {
  transform: scaleX(-1);
}

.hint {
  color: var(--muted);
  font-size: 0.8125rem;
}

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

.grow {
  flex: 1 1 auto;
  min-width: 0;
}

.num {
  font-variant-numeric: tabular-nums;
}

.description {
  white-space: pre-line;
}

/* A sentence that introduces a page or a card, a little larger and quieter. */
.lead {
  color: var(--muted);
  font-size: 1rem;
  max-inline-size: 48rem;
}

.path {
  word-break: break-all;
}

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

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -4rem;
  z-index: 50;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-s);
  background: var(--surface);
  font-weight: 650;
}

/* The shadow only while it shows, so it never spills onto the top of the page. */
.skip:focus {
  inset-block-start: 1rem;
  box-shadow: var(--shadow-l);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
}

.row.spread {
  justify-content: space-between;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* A short list of a project's versions, and a version's change list. */
.versions,
.changes {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.app {
  display: grid;
  grid-template-columns: 15.75rem minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  position: sticky;
  inset-block-start: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 1.125rem 0.875rem;
  background:
    radial-gradient(260px 200px at 0 0, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(220px 180px at 100% 30px, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 70%),
    var(--surface);
  border-inline-end: 1px solid var(--border);
  overflow: auto;
  z-index: 10;
}

.side:dir(rtl) {
  background:
    radial-gradient(260px 200px at 100% 0, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(220px 180px at 0 30px, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 70%),
    var(--surface);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.5rem 1rem;
  text-decoration: none;
  color: var(--text);
}

.logo:hover {
  color: var(--text);
}

.logo b {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.logo span span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.open-client {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  margin: -0.5rem 0 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-s);
  background: var(--surface-2);
  font-size: 0.8125rem;
}

.open-client b {
  overflow-wrap: anywhere;
}

.mark {
  flex: none;
}

/* A brand's logo, in place of the mark: as tall as the mark, and never wider than the sidebar's share. */
.brand-logo {
  flex: none;
  display: block;
  block-size: 38px;
  inline-size: auto;
  max-inline-size: 9rem;
  object-fit: contain;
}

.mark-bg {
  fill: var(--accent);
}

.mark-dot {
  fill: var(--accent-2);
}

.sidenav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.jump {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0 0.625rem;
  margin-block-end: 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--bg);
  color: var(--faint);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  text-align: start;
}

.jump:hover {
  border-color: var(--accent-line);
  color: var(--text);
}

.navlabel {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0.875rem 0.625rem 0.25rem;
}

.navlist {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.5rem;
  padding: 0 0.625rem;
  border-radius: var(--radius-s);
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.90625rem;
  position: relative;
}

.item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.item[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.item[aria-current="page"]::before {
  content: "";
  position: absolute;
  inset-inline-start: -0.875rem;
  inset-block: 8px;
  width: 4px;
  border-start-end-radius: 4px;
  border-end-end-radius: 4px;
  background: linear-gradient(var(--accent), var(--accent-2));
}

.item .n {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 0 0.5rem;
  line-height: 20px;
}

.item[aria-current="page"] .n {
  background: var(--surface);
}

.item .n.alert {
  background: var(--warn-soft);
  color: var(--warn);
}

.sidefoot {
  margin-block-start: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-block-start: 0.875rem;
  border-block-start: 1px solid var(--border);
}

.me {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.me b {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25;
  overflow-wrap: break-word;
}

/* An email address in place of a name: one line, a little smaller, ending in … where it is too long. */
.me b.address {
  overflow: hidden;
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me .grow > span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.me-link {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  padding: 0.25rem;
  margin: -0.25rem;
  border-radius: var(--radius-s);
  color: inherit;
  text-decoration: none;
}

.me-link:hover,
.me-link[aria-current='page'] {
  background: var(--surface-2);
}

.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 3px;
  background: var(--surface-2);
  gap: 2px;
}

.seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0 0.625rem;
  min-height: 2rem;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}

.seg button:hover {
  color: var(--text);
}

.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-s);
}

.seg.full {
  display: flex;
}

.seg.full button {
  flex: 1;
  padding: 0 0.375rem;
}

select.langpick {
  min-height: 2.25rem;
  font-size: 0.84375rem;
}

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

.page {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.page:focus {
  outline: none;
}

.top {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0 2rem;
  border-block-end: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(10px);
  position: sticky;
  inset-block-start: 0;
  z-index: 6;
}

/* Only narrow screens have the menu button and the dimmed page behind the open sidebar. */
.top .menu,
.side-scrim {
  display: none;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--faint);
  min-width: 0;
}

.crumbs a {
  text-decoration: none;
  font-weight: 600;
  color: var(--muted);
}

.crumbs a:hover {
  color: var(--accent);
}

.crumbs b {
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.crumbs .sep {
  display: inline-flex;
}

.spacer {
  flex: 1;
}

/* In a toolbar the spacer pushes what follows to the end of the line, and
   takes no room (not even a gap) when the toolbar wraps on a narrow screen. */
.toolbar > .spacer {
  flex: 0 0 0;
  margin-inline: auto -0.625rem;
}

.top-context {
  text-align: end;
}

.hero {
  position: relative;
  padding: 1.875rem 2rem 0;
  isolation: isolate;
}

/* The gradients and dots reach below the page head, over the first card: they never take a click. */
.hero::before,
.hero::after {
  pointer-events: none;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 230px;
  z-index: -1;
  background:
    radial-gradient(560px 210px at 92% -10px, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(460px 190px at 66% -40px, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 70%);
}

.hero:dir(rtl)::before {
  background:
    radial-gradient(560px 210px at 8% -10px, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(460px 190px at 34% -40px, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 70%);
}

/* The dots fade out towards the start of the line. */
.hero::after {
  content: "";
  position: absolute;
  inset-block: 0 auto;
  inset-inline: 30% 0;
  height: 230px;
  z-index: -1;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 16%, transparent) 1px, transparent 1.6px);
  background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 95% 0, var(--mix-dark), transparent 75%);
  mask-image: radial-gradient(ellipse 70% 90% at 95% 0, var(--mix-dark), transparent 75%);
}

.hero:dir(rtl)::after {
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 5% 0, var(--mix-dark), transparent 75%);
  mask-image: radial-gradient(ellipse 70% 90% at 5% 0, var(--mix-dark), transparent 75%);
}

.titlerow {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.titles {
  min-width: 0;
}

/* How an action in the page head is going, such as a download, under the title. */
.hero > .notice {
  margin-block-start: 1rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin-block-start: 0.375rem;
}

.titleline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-block-start: 0.375rem;
}

.titleline h1 {
  margin: 0;
}

.facts-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block-start: 0.75rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 1.75rem;
  padding: 0 0.6875rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

a.pill:hover {
  border-color: var(--accent-line);
  color: var(--text);
}

.pill.warn {
  background: var(--warn-soft);
  border-color: transparent;
  color: var(--warn);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
}

.actions.end {
  justify-content: flex-end;
}

.tabs {
  display: flex;
  gap: 2px;
  margin-block-start: 1.375rem;
  border-block-end: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.tab {
  appearance: none;
  background: none;
  border: 0;
  border-block-end: 3px solid transparent;
  margin-block-end: -1px;
  padding: 0 0.875rem;
  min-height: 2.875rem;
  font: inherit;
  font-size: 0.90625rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  text-decoration: none;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-selected="true"] {
  color: var(--text);
  border-block-end-color: var(--accent);
}

.tab:focus-visible {
  outline-offset: -3px;
}

.count {
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}

.count:empty {
  display: none;
}

.count.alert {
  background: var(--warn-soft);
  color: var(--warn);
}

.tab[aria-selected="true"] .count:not(.alert) {
  background: var(--accent-soft);
  color: var(--accent);
}

/* A state of the whole site, under the top bar on every page (your announcement, paused, past due). */
.site-banner {
  padding: 1.25rem 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Two standing banners at once (your announcement and a free trial's), spaced as the site banner spaces its own. */
.banner-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.content {
  padding: 1.5rem 2rem 7.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.content:focus {
  outline: none;
}

.cols {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1.25rem;
  align-items: start;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 1rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  min-width: 0;
}

.cardhead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-block-end: 1px solid var(--border);
}

.cardhead .t {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.cardhead .hint {
  margin-block-start: 2px;
}

.cardbody {
  padding: 1.25rem 1.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.cardbody.flush {
  padding: 0;
  gap: 0;
  overflow: hidden;
  border-end-start-radius: var(--radius);
  border-end-end-radius: var(--radius);
}

.cardbody.flush > .notice,
.cardbody.flush > .toolbar,
.cardbody.flush > .tblfoot {
  margin: 1rem 1.25rem;
}

.cardbody.flush > .toolbar {
  margin-block-end: 0.25rem;
}

.cardbody.flush > .notice:empty {
  display: none;
}

/* A notice at the top of a card whose body runs to its edges. */
.cardbody.flush > .notice {
  margin: 0.875rem 1rem 0;
}

.ictile {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-s);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  flex: none;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent);
}

.ictile.soft {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}

.ictile.warn {
  background: var(--warn-soft);
  color: var(--warn);
  box-shadow: none;
}

.ictile.bad {
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: none;
}

.ictile.ok {
  background: var(--ok-soft);
  color: var(--ok);
  box-shadow: none;
}

.callout {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  padding: 1rem 1.125rem;
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--accent-soft), var(--accent-softer) 60%, var(--surface));
  border: 1px solid var(--accent-line);
}

.callout p {
  color: var(--muted);
}

.callout.warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}

.callout.warn p {
  color: var(--text);
}

/* The free trial's banner: its words, then Buy now at the end of the line. */
.callout[data-notice='trial'] p {
  flex: 1;
  align-self: center;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.125rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
  transition: border-color 0.12s, transform 0.12s;
}

a.stat:hover {
  color: var(--text);
  border-color: var(--accent-line);
  transform: translateY(-1px);
}

.stat .big {
  font-size: 2.125rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.stat .lab {
  font-weight: 650;
  font-size: 0.875rem;
}

.stat::after {
  content: "";
  position: absolute;
  inset-inline-end: -30px;
  inset-block-start: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}

.stat.warn::after {
  background: radial-gradient(circle, color-mix(in srgb, var(--warn) 22%, transparent), transparent 70%);
}

.notice {
  border-radius: var(--radius-s);
  padding: 0.6875rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.notice:empty {
  display: none;
}

.notice.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.notice.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.notice.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.notice.info {
  background: var(--accent-soft);
  color: var(--text);
}

.empty {
  padding: 2.25rem 1.25rem;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
}

.loading {
  padding: 0.25rem 0;
}

.cardbody.flush > .loading {
  padding: 1.25rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.875rem 1.25rem;
  margin: 0;
}

.facts.one {
  grid-template-columns: minmax(0, 1fr);
}

.facts > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.facts dt {
  font-size: 0.71875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.facts dd {
  margin: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

meter,
progress {
  display: block;
  width: 100%;
  height: 0.75rem;
  border: 0;
  border-radius: 999px;
  background: var(--surface-3);
  accent-color: var(--accent);
  overflow: hidden;
}

meter::-webkit-meter-bar {
  background: var(--surface-3);
  border: 0;
  border-radius: 999px;
  height: 0.75rem;
}

meter::-webkit-meter-optimum-value {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}

meter::-webkit-meter-suboptimum-value,
meter::-webkit-meter-even-less-good-value {
  background: var(--warn);
  border-radius: 999px;
}

meter::-moz-meter-bar {
  background: var(--accent);
  border-radius: 999px;
}

progress::-webkit-progress-bar {
  background: var(--surface-3);
  border-radius: 999px;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}

progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.84375rem;
  color: var(--muted);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.625rem;
  padding: 0 1rem;
  border-radius: var(--radius-s);
  font: inherit;
  font-size: 0.90625rem;
  font-weight: 650;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.06s;
}

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

.btn.primary {
  background: linear-gradient(180deg, var(--accent-top), var(--accent));
  color: var(--on-accent);
  box-shadow: var(--shine), 0 2px 10px color-mix(in srgb, var(--accent) 32%, transparent);
}

.btn.primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--control);
  box-shadow: var(--shadow-s);
}

.btn.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
  padding: 0 0.75rem;
}

.btn.ghost:hover {
  background: var(--accent-soft);
}

.btn.danger {
  background: var(--danger);
  color: var(--surface);
}

.btn.danger:hover {
  background: color-mix(in srgb, var(--danger) 85%, var(--text));
  color: var(--surface);
}

.btn.danger-ghost {
  background: transparent;
  color: var(--danger);
}

.btn.danger-ghost:hover {
  background: var(--danger-soft);
}

.btn.small {
  min-height: 2.125rem;
  padding: 0 0.75rem;
  font-size: 0.84375rem;
  border-radius: 9px;
}

.btn.icon {
  width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
}

.btn.icon.small {
  width: 2rem;
  min-height: 2rem;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn[aria-busy="true"] {
  cursor: progress;
}

/* ---------------------------------------------------------------- fields */

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.fields {
  display: grid;
  gap: 1rem 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.field > label,
legend {
  font-weight: 650;
  font-size: 0.875rem;
}

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

input:not([type="checkbox"], [type="radio"], [type="file"]),
select,
textarea {
  font-size: 0.90625rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--control);
  border-radius: var(--radius-s);
  padding: 0.5625rem 0.75rem;
  min-height: 2.625rem;
  width: 100%;
}

textarea {
  min-height: 7rem;
  resize: vertical;
  line-height: 1.55;
}

input:not([type="checkbox"], [type="radio"]):focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0.125rem 0 0;
  accent-color: var(--accent);
  cursor: pointer;
  flex: none;
}

input[type="file"] {
  font-size: 0.875rem;
  max-width: 100%;
}

input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 650;
  min-height: 2.25rem;
  padding: 0 0.875rem;
  margin-inline-end: 0.75rem;
  border-radius: var(--radius-s);
  border: 1px solid var(--control);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.code-input {
  font-family: var(--font-mono);
  font-size: 1.25rem !important;
  letter-spacing: 0.2em;
  max-width: 16rem;
}

/* Use a passkey, after a second-step code field (stepInput), and what went wrong with it. */
.step-passkey {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.75rem;
}

.field-problem {
  color: var(--danger);
}

.field-problem:empty {
  display: none;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

legend {
  padding: 0;
  margin-block-end: 0.375rem;
}

.check {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.5rem 0.625rem;
  margin-inline: -0.625rem;
  border-radius: var(--radius-s);
}

.check:hover {
  background: var(--surface-2);
}

.check-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.check label {
  font-weight: 600;
  cursor: pointer;
}

.check:has(input:disabled) label {
  cursor: not-allowed;
  color: var(--muted);
}

.choice-value {
  margin-inline-start: 1.875rem;
  max-width: 16rem;
}

/* A choice's value only shows while its choice is picked. */
.choice-value:has(input:disabled) {
  display: none;
}

select.short,
input.short {
  max-width: 9rem;
}

details.disclose > summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--accent);
  min-height: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

details.disclose > summary::-webkit-details-marker {
  display: none;
}

details.disclose > summary::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.12s;
}

details.disclose > summary:dir(rtl)::before {
  transform: rotate(135deg);
}

details.disclose[open] > summary::before {
  transform: rotate(45deg);
}

details.disclose > :not(summary) {
  margin-block-start: 0.75rem;
}

/* ------------------------------------------------------------- charts */

/* Charts as cards (the dashboard, your Sales page), two to a row, one on narrow screens. */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

@media (max-width: 60rem) {
  .chart-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* charts.js: lines and columns drawn as SVG in the drawing's own units,
   sized to the card; bars as meters; colours by series class only. */
.chart {
  margin: 0;
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-rule {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-scale,
.chart-label {
  fill: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.chart-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-point {
  fill: currentColor;
}

.chart-column {
  fill: var(--accent);
}

.chart-hit {
  fill: transparent;
  pointer-events: all;
}

.chart-hit:hover {
  fill: var(--accent-softer);
}

.series-1 {
  color: var(--chart-1);
}

.series-2 {
  color: var(--chart-2);
}

.series-3 {
  color: var(--chart-3);
}

.series-4 {
  color: var(--chart-4);
}

.series-5 {
  color: var(--chart-5);
}

.series-6 {
  color: var(--chart-6);
}

.series-other {
  color: var(--control);
}

/* The numbers under the pointer: a line kept tall so the chart doesn't move. */
.chart-readout {
  margin: 0;
  min-height: 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
}

.chart-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.chart-key {
  inline-size: 0.75rem;
  block-size: 0.75rem;
  border-radius: 3px;
  background: currentColor;
}

.chart-table > summary {
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
}

.chart-table > :not(summary) {
  margin-block-start: 0.5rem;
}

.chart-empty {
  margin: 0;
  padding-block: 2rem;
  text-align: center;
}

.chart-bars {
  display: grid;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chart-bars li {
  display: grid;
  grid-template-columns: minmax(6rem, 1fr) 2fr auto;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.chart-bar-name {
  overflow-wrap: anywhere;
}

.chart-bar-value {
  color: var(--muted);
  white-space: nowrap;
}

/* ------------------------------------------------- search, filters, views */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
}

.search {
  position: relative;
  flex: 1 1 16rem;
  max-width: 25rem;
}

.search .icon {
  position: absolute;
  inset-inline-start: 0.75rem;
  inset-block-start: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.search input {
  padding-inline: 2.375rem 2.5rem !important;
}

.search kbd {
  position: absolute;
  inset-inline-end: 0.625rem;
  inset-block-start: 50%;
  transform: translateY(-50%);
}

select.fchip,
button.fchip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border: 1px solid var(--control);
  background: var(--surface);
  color: var(--text);
  width: auto;
  min-height: 2.375rem;
  border-radius: 999px;
  padding: 0 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

/* Tinted while it is not on its first option, which means "any". */
select.fchip:not(:has(option:first-child:checked)),
button.fchip[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* A date filter: its words and a narrow date field, in a toolbar. */
.fdate {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.fdate input {
  width: auto;
  min-height: 2.375rem;
}

/* A text filter, such as a statement's verb: its words and a field read on Enter. */
.ftext {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.ftext input {
  width: 14rem;
  min-height: 2.375rem;
  font-family: var(--font-mono);
}

.viewtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.viewtab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.125rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.84375rem;
  font-weight: 650;
  cursor: pointer;
}

.viewtab:hover {
  color: var(--text);
  border-color: var(--accent-line);
}

.viewtab[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.viewtab[aria-pressed="true"] .count:not(.alert) {
  background: var(--surface);
  color: var(--accent);
}

/* Views in a column beside a table (the project browser), folding above it on narrow screens. */
.browse {
  display: grid;
  grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.sideviews {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidegroup {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidehead {
  margin: 0 0 0.25rem;
  padding: 0 0.75rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sideviews .viewtab {
  display: flex;
  border-radius: var(--radius-s);
  text-align: start;
}

.newdot {
  inline-size: 0.5rem;
  block-size: 0.5rem;
  border-radius: 999px;
  background: var(--accent);
}

.newdot[hidden] {
  display: none;
}

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

  .sideviews,
  .sidegroup {
    flex-flow: row wrap;
    align-items: center;
  }

  .sidehead {
    display: none;
  }

  .sideviews .viewtab {
    display: inline-flex;
    border-radius: 999px;
  }
}

/* Who has access, as overlapping initials. */
.faces {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.faces .avatar + .avatar {
  margin-inline-start: -0.75rem;
  box-shadow: 0 0 0 2px var(--surface);
}

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

.tablebox {
  overflow-x: auto;
}

.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.tbl th {
  font-size: 0.71875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: start;
  padding: 0.625rem 0.875rem;
  background: var(--surface-2);
  border-block-end: 1px solid var(--border);
  white-space: nowrap;
}

.tbl td {
  padding: 0.75rem 0.875rem;
  border-block-end: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.90625rem;
}

.tbl.compact td {
  padding-block: 0.375rem;
}

.tbl th:first-child,
.tbl td:first-child {
  padding-inline-start: 1.25rem;
}

.tbl th:last-child,
.tbl td:last-child {
  padding-inline-end: 1.25rem;
}

.tbl tbody tr:last-child td {
  border-block-end: 0;
}

.tbl tbody tr:hover td {
  background: var(--surface-2);
}

.tbl .num {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

/* Short values (IDs, dates, badges) that read badly broken over two lines. */
.tbl .nowrap {
  white-space: nowrap;
}

.tbl .end {
  text-align: end;
}

.tbl .end .actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

/* ------------------------------------------- selection and bulk actions */

.tbl th.pick,
.tbl td.pick {
  inline-size: 1%;
  padding-inline-end: 0.25rem;
}

.tbl .pick input {
  margin: 0;
  vertical-align: middle;
}

.tbl th.menu,
.tbl td.menu {
  inline-size: 1%;
  padding-inline-start: 0.25rem;
}

.tbl tr.picked td {
  background: var(--accent-softer);
}

.tbl tr.picked td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.tbl tr.picked td:first-child:dir(rtl) {
  box-shadow: inset -3px 0 0 var(--accent);
}

/* A row that needs someone's attention, such as a project whose creator has left. */
.tbl tr.flagged td:first-child {
  box-shadow: inset 3px 0 0 var(--warn);
}

.tbl tr.flagged td:first-child:dir(rtl) {
  box-shadow: inset -3px 0 0 var(--warn);
}

.checks-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

/* A long list of ticks (the groups an external manager will manage) scrolls inside its own box. */
.checks-scroll {
  display: grid;
  gap: 0.5rem;
  max-block-size: 16rem;
  overflow-y: auto;
  padding-inline-end: 0.5rem;
}

.linkbtn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.linkbtn:hover {
  color: var(--accent-hover);
}

/* A setting shown in words above a list, changed in place (a group's default due date). */
.defaultline {
  padding: 0.75rem 1.25rem;
  border-block-end: 1px solid var(--border);
  font-size: 0.875rem;
}

.defaultline .stack {
  max-inline-size: 36rem;
}

.search-note {
  margin: 0;
  padding: 0.625rem 1.25rem;
  border-block-end: 1px solid var(--border);
}

.matchline {
  padding: 0.625rem 1.25rem;
  background: var(--accent-softer);
  border-block-end: 1px solid var(--border);
  font-size: 0.875rem;
  text-align: center;
}

.bulk {
  position: sticky;
  inset-block-end: 1rem;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  pointer-events: none;
  animation: rise 0.18s ease-out;
}

.bulk > * {
  pointer-events: auto;
}

/* The count, the actions (which wrap among themselves when there isn't
   room) and Clear stay on one line; the corners round a bar of one row
   into a pill without stretching one of several rows into an oval. */
.bulk-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.375rem 0.5rem;
  max-inline-size: 100%;
  padding-block: 0.375rem;
  padding-inline: 1rem 0.5rem;
  border-radius: 1.375rem;
  background: var(--text);
  color: var(--surface);
  box-shadow: var(--shadow-l);
}

.bulk-count {
  font-weight: 750;
  font-size: 0.875rem;
  padding-inline-end: 0.5rem;
  white-space: nowrap;
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-inline-size: 0;
  gap: 0.25rem;
}

.bulk-bar .btn.ghost {
  color: var(--surface);
}

/* The bar is the reverse of the page, so its danger is the reversed one. */
.bulk-bar .btn.danger-ghost {
  color: var(--danger-inv);
}

.bulk-bar .btn.danger-ghost:hover {
  background: color-mix(in srgb, var(--danger-inv) 18%, transparent);
}

.bulk-bar .btn.ghost:hover,
.bulk-bar .btn.ghost[aria-expanded="true"] {
  background: color-mix(in srgb, var(--surface) 16%, transparent);
}

/* On a phone the count and Clear share the top line, the actions below them. */
@media (max-width: 40rem) {
  .bulk-bar {
    flex-wrap: wrap;
    padding-inline: 1rem 0.5rem;
  }

  .bulk-count {
    flex: 1;
  }

  .bulk-actions {
    order: 3;
    flex-basis: 100%;
  }
}

.bulk-clear {
  flex: none;
  white-space: nowrap;
  border: 0;
  background: none;
  color: color-mix(in srgb, var(--surface) 78%, var(--text));
  font: inherit;
  font-size: 0.84375rem;
  font-weight: 650;
  min-block-size: 2rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  cursor: pointer;
}

.bulk-clear:hover {
  color: var(--surface);
  background: color-mix(in srgb, var(--surface) 16%, transparent);
}

.bulk-panel {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  inline-size: min(34rem, 100%);
  padding-block: 1rem;
  padding-inline: 1.25rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-l);
}

.bulk-panel-body {
  flex: 1;
  min-inline-size: 0;
  display: grid;
  gap: 0.75rem;
}

.bulk-panel-body .actions {
  justify-content: flex-end;
}

.rowmenu-list {
  margin: 0;
  min-inline-size: 14rem;
  max-inline-size: min(22rem, calc(100vw - 2rem));
  padding: 0.375rem;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-l);
  position-area: block-end span-inline-start;
  position-try-fallbacks: flip-block;
}

.rowmenu-list:popover-open {
  display: grid;
}

.rowmenu-item {
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  text-align: start;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
}

.rowmenu-item:hover,
.rowmenu-item:focus-visible {
  background: var(--surface-2);
}

.tblfoot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.84375rem;
}

.who {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

/* In a table the person keeps a readable width; on a narrow screen the table
   scrolls sideways instead of squeezing the name. */
.tbl .who {
  min-inline-size: 12rem;
}

.who .grow > .hint {
  display: block;
  overflow-wrap: anywhere;
}

/* A second line in parts, such as an external's address and organisation, one under the other. */
.who .sublines > span {
  display: block;
}

.who b,
.namelink,
.namebtn {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.namelink {
  color: var(--text);
  text-decoration: none;
}

.namelink:hover,
.namebtn:hover {
  color: var(--accent);
  text-decoration: underline;
}

.namebtn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: start;
}

.avatar {
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78125rem;
  font-weight: 750;
  color: var(--avatar-text);
  flex: none;
  letter-spacing: 0.02em;
}

.avatar.big {
  width: 3.25rem;
  height: 3.25rem;
  font-size: 1.125rem;
}

.av1 {
  background: var(--avatar-1);
}

.av2 {
  background: var(--avatar-2);
}

.av3 {
  background: var(--avatar-3);
}

.av4 {
  background: var(--avatar-4);
}

.av5 {
  background: var(--avatar-5);
}

.av6 {
  background: var(--avatar-6);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 999px;
  padding: 1px 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.bad {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.info {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  padding: 0 0.5rem;
  font-size: 0.78125rem;
  font-weight: 650;
  line-height: 22px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.tag.info {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.tag.ok {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}

.tag.warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}

.tag.bad {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.thumb {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 11px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--on-accent);
  font-weight: 800;
  font-size: 0.9375rem;
  text-shadow: 0 1px 2px var(--thumb-shade);
  box-shadow: inset 0 0 0 1px var(--thumb-ring);
}

.th1 {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.th2 {
  background: conic-gradient(from 200deg at 75% 25%, var(--accent-2), var(--accent), var(--accent-2));
}

.th3 {
  background: repeating-linear-gradient(45deg, var(--accent) 0 7px, color-mix(in srgb, var(--accent) 78%, var(--mix-light)) 7px 14px);
}

.th4 {
  background:
    radial-gradient(circle at 28% 30%, var(--accent-2) 0 26%, transparent 27%),
    radial-gradient(circle at 76% 72%, color-mix(in srgb, var(--accent) 55%, var(--mix-light)) 0 20%, transparent 21%),
    var(--accent);
}

.th5 {
  background: linear-gradient(160deg, var(--accent-2), var(--accent) 60%, color-mix(in srgb, var(--accent) 60%, var(--mix-dark)));
}

.th6 {
  background: repeating-linear-gradient(0deg, var(--accent-2) 0 6px, color-mix(in srgb, var(--accent-2) 70%, var(--mix-dark)) 6px 12px);
}

/* A plain list of rows inside a card, such as a learner's courses. */
.rows {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rows > li {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.25rem;
  border-block-end: 1px solid var(--border);
}

.rows > li:last-child {
  border-block-end: 0;
}

.rows .grow > .hint,
.rows .grow > p {
  display: block;
}

/* A row's button or actions keep their size; the text beside them wraps instead. */
.rows > li > .btn,
.rows > li > .actions {
  flex: none;
}

.rows .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-block-start: 0.25rem;
}

/* Rows in a drawer's padded body line up with its other content. */
.dbody .rows > li {
  padding-inline: 0;
}

/* A numbered step (a lesson in a course), ticked once done. */
.step-number {
  flex: none;
  display: inline-grid;
  place-items: center;
  inline-size: 2rem;
  block-size: 2rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.step-number.done {
  background: var(--ok-soft);
  border-color: transparent;
  color: var(--ok);
}

.step-number.now {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

.step-number.bad {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--danger);
}

/* Status steps in order (a custom address going live): each a number and its name, with a word for where it is. */
.status-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.status-steps > li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

/* A value to copy, such as a DNS record's name: its label, the value in a monospace box, and Copy. */
.copybox {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 0.5rem;
  align-items: center;
}

.copybox-label {
  grid-column: 1 / -1;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.copybox-value {
  display: block;
  min-inline-size: 0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-s);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

/* Text of several lines, such as JSON: kept as it is, in a box that scrolls. */
.copybox-value.lines {
  margin: 0;
  white-space: pre-wrap;
  max-block-size: 60vh;
  overflow: auto;
}

.copyboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0.75rem 1rem;
}

/* Words from another service, kept as it wrote them, in a box of their own. */
.quoted {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-s);
  background: var(--surface-2);
  border-inline-start: 3px solid var(--warn);
  overflow-wrap: anywhere;
}

/* A strip along the foot of a flush card: a note, or a small form. */
.cardnote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.875rem 1.25rem;
  border-block-start: 1px solid var(--border);
  background: var(--surface-2);
}

/* A field and its button on one line, the button level with the input. */
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.625rem;
  inline-size: 100%;
}

.inline-form > .field {
  flex: 1 1 16rem;
}

.inline-form > .btn {
  margin-block-start: calc(0.875rem * 1.5 + 0.375rem);
}

/* One big number with what it is out of, as on the home page's seats card. */
.big-figure {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 2.25rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.big-figure .hint {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0;
}

/* Quick actions: links styled as buttons, one per line. */
.quick {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick > .btn {
  justify-content: flex-start;
}

/* Facts that arrive after the page head is drawn sit in the head's line as if they were its own. */
.pills {
  display: contents;
}

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

.toasts {
  position: fixed;
  inset-block-end: 1.5rem;
  inset-inline-start: 1.5rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: calc(100% - 3rem);
}

body:has(.app) .toasts {
  inset-inline-start: calc(15.75rem + 1.5rem);
  max-width: min(35rem, calc(100% - 15.75rem - 3rem));
}

.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: min(22.5rem, 100%);
  max-width: 35rem;
  padding: 0.625rem 0.625rem 0.75rem 0.875rem;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-l);
  overflow: hidden;
  animation: rise 0.2s ease-out;
}

.toast-ic {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-soft);
  color: var(--ok);
  flex: none;
}

.toast.error .toast-ic {
  background: var(--danger-soft);
  color: var(--danger);
}

.toast-text {
  flex: 1;
  font-weight: 650;
  font-size: 0.875rem;
  line-height: 1.35;
}

.toast-undo {
  border: 0;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-weight: 750;
  font-size: 0.875rem;
  min-height: 2.25rem;
  padding: 0 0.875rem;
  border-radius: var(--radius-s);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.toast-undo:hover {
  background: color-mix(in srgb, var(--accent) 24%, var(--surface));
}

.toast-x {
  border: 0;
  background: none;
  color: var(--muted);
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.toast-x:hover {
  background: var(--surface-2);
}

.drain {
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: 0 50%;
  animation: drain 10s linear forwards;
}

.drain:dir(rtl) {
  transform-origin: 100% 50%;
}

.toast.paused .drain {
  animation-play-state: paused;
}

@keyframes drain {
  to {
    transform: scaleX(0);
  }
}

@keyframes rise {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes slide {
  from {
    translate: var(--slide-from) 0;
    opacity: 0;
  }
}

/* --------------------------------------------- drawers, dialogs, palette */

dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0;
  box-shadow: var(--shadow-l);
}

dialog::backdrop {
  background: var(--scrim);
  animation: fade 0.15s;
}

dialog.drawer {
  --slide-from: 30px;
  inset: 0;
  margin: 0;
  margin-inline-start: auto;
  width: min(31.25rem, 100%);
  max-width: 100%;
  height: 100%;
  max-height: none;
  border-block: 0;
  border-inline-end: 0;
  border-radius: 0;
  flex-direction: column;
  animation: slide 0.2s ease-out;
}

dialog.drawer:dir(rtl) {
  --slide-from: -30px;
}

dialog.drawer[open] {
  display: flex;
}

.drawer .dhead {
  padding: 1.25rem 1.375rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  position: relative;
  isolation: isolate;
  border-block-end: 1px solid var(--border);
}

.drawer .dhead::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(300px 120px at 100% 0, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}

.drawer .dhead:dir(rtl)::before {
  background: radial-gradient(300px 120px at 0 0, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}

.drawer .dhead:not(:has(.tabs)) {
  padding-block-end: 1.125rem;
}

.dtitle {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.dtitle h2 {
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

.drawer .tabs {
  margin: 0 -0.5rem;
  border: 0;
}

.drawer .tab {
  padding-inline: 0.625rem;
}

.drawer .dbody {
  flex: 1;
  overflow: auto;
  padding: 1.25rem 1.375rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.drawer .dfoot {
  padding: 0.875rem 1.375rem;
  border-block-start: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
}

/* A full-screen overlay (the composer's Preview): its head, then a body that fills the rest. */
dialog.overlay {
  inset: 0;
  margin: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 0;
  flex-direction: column;
  animation: fade 0.15s;
}

dialog.overlay[open] {
  display: flex;
}

.overlay .ohead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1.25rem;
  border-block-end: 1px solid var(--border);
}

.otitle {
  flex: 1 1 12rem;
  min-inline-size: 0;
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
}

.otitle h2 {
  font-size: 1.125rem;
  overflow-wrap: anywhere;
}

.otools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
}

.overlay .obody {
  flex: 1;
  min-block-size: 0;
  display: flex;
}

.section-title {
  font-size: 0.71875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

/* A section title partway down a card starts a new part of it, with a line above. */
.cardbody > .section-title:not(:first-child) {
  margin-block: 0.5rem 0;
  padding-block-start: 1.125rem;
  border-block-start: 1px solid var(--border);
}

dialog.dialog {
  width: min(30rem, calc(100% - 2rem));
  border-radius: 18px;
  padding: 1.5rem;
  animation: rise 0.16s ease-out;
}

.dialog form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.warnhead {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
}

.warnhead h2 {
  margin-block-end: 0.25rem;
}

.warnhead p {
  color: var(--muted);
}

dialog.cmdk {
  width: min(40rem, calc(100% - 2rem));
  margin-block: 12vh auto;
  border-radius: 18px;
  overflow: hidden;
  animation: rise 0.15s ease-out;
}

dialog.cmdk[open] {
  display: flex;
  flex-direction: column;
}

.cmdk-in {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 1rem;
  border-block-end: 1px solid var(--border);
  color: var(--faint);
}

.cmdk-in input {
  border: 0 !important;
  outline: 0 !important;
  background: none !important;
  font-size: 1.0625rem !important;
  min-height: 3.25rem !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.cmdk-list {
  max-height: 23.75rem;
  overflow: auto;
  padding: 0.5rem;
}

.cmdk-h {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0.625rem 0.625rem 0.25rem;
}

.cmdk-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-s);
  cursor: pointer;
}

.cmdk-item[aria-selected="true"] {
  background: var(--accent-soft);
}

.cmdk-item b {
  display: block;
  font-size: 0.90625rem;
  line-height: 1.3;
}

.cmdk-item .hint {
  display: block;
}

.cmdk-ic {
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--accent);
  flex: none;
}

.cmdk-go {
  color: var(--faint);
  display: inline-flex;
}

.cmdk-note:empty {
  display: none;
}

.cmdk-note {
  padding: 0 1rem 0.75rem;
}

.cmdk-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 1.125rem;
  padding: 0.625rem 1rem;
  border-block-start: 1px solid var(--border);
  font-size: 0.78125rem;
  color: var(--muted);
  background: var(--surface-2);
}

.cmdk-foot kbd + kbd {
  margin-inline-start: 2px;
}

/* A list whose lines each start with a tick: what a plan includes. */
.ticks {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding-inline-start: 1.625rem;
}

.ticks li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0.25rem;
  top: 0.3rem;
  width: 0.375rem;
  height: 0.6875rem;
  border: solid var(--ok);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

[dir="rtl"] .ticks li::before {
  transform: rotate(45deg) scaleX(-1);
}

/* ----------------------------------------------------- the sign-in layout */

.auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 4rem 1rem 3rem;
  position: relative;
  isolation: isolate;
}

.auth::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 22rem;
  z-index: -1;
  background:
    radial-gradient(640px 260px at 70% -40px, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(520px 220px at 30% -60px, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 70%);
}

.auth::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 22rem;
  z-index: -1;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 14%, transparent) 1px, transparent 1.6px);
  background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(ellipse 60% 90% at 50% 0, var(--mix-dark), transparent 75%);
  mask-image: radial-gradient(ellipse 60% 90% at 50% 0, var(--mix-dark), transparent 75%);
}

.auth .logo {
  padding: 0;
}

.auth-card {
  width: min(28rem, 100%);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.auth-banner {
  width: min(28rem, 100%);
}

.auth-card:focus {
  outline: none;
}

.auth-card h1 {
  font-size: 1.625rem;
}

.auth-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  width: min(28rem, 100%);
}

.auth-foot select.langpick {
  width: auto;
}

/* The wide form (the order form): the choices, and a summary that stays in view. */
.auth-grid {
  width: min(60rem, 100%);
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1.25rem;
  align-items: start;
}

.auth.wide .auth-card {
  width: auto;
}

.auth.wide .auth-foot {
  width: min(60rem, 100%);
}

.auth-summary {
  position: sticky;
  top: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  box-shadow: var(--shadow);
}

.auth-summary h2 {
  font-size: 1.125rem;
}

/* The summary's lines: what each costs, and the total under a rule. */
.sum-lines {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.sum-lines li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.sum-lines .num,
.sum-total .num {
  white-space: nowrap;
}

.sum-total {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block-start: 0.75rem;
  border-block-start: 1px solid var(--border);
  font-weight: 700;
  font-size: 1.125rem;
}

.auth-summary > .btn {
  width: 100%;
  justify-content: center;
}

@media (max-width: 60rem) {
  .auth-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-summary {
    position: static;
  }
}

/* Turnstile's check on the order form, with room kept for it while it loads. */
.turnstile-box {
  min-height: 4.0625rem;
}

/* An input followed by the fixed text it always ends with, such as an instance's domain. */
.affix {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.affix > input {
  flex: 1;
  min-width: 0;
}

.affix-end {
  color: var(--muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* What the check of a field said, beside it: available, or why not. */
.field-check {
  font-size: 0.8125rem;
  font-weight: 600;
}

.field-check.ok {
  color: var(--ok);
}

.field-check.bad {
  color: var(--danger);
}

/* An add-on on the order form (and on Plan and billing's Add-ons): its
   name and price on one line, then its choice and what it gives across the
   whole row, so a long price never squeezes the field on a phone. The
   stack and field inside only group, so their parts sit in this grid. */
.addon {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.375rem 1rem;
  align-items: start;
  padding-block: 0.75rem;
  border-block-start: 1px solid var(--border);
}

.addon:first-of-type {
  border-block-start: 0;
}

.addon > .stack,
.addon > .stack > .field {
  display: contents;
}

.addon > .stack > *,
.addon > .stack > .field > * {
  grid-column: 1 / -1;
}

.addon > .stack > label,
.addon > .stack > .check,
.addon > .stack > .field > label {
  grid-row: 1;
  grid-column: 1;
}

.addon .addon-price {
  grid-row: 1;
  grid-column: 2;
  white-space: nowrap;
  font-weight: 600;
}

.addon input[type="number"] {
  max-width: 7rem;
}

/* A number between big − and + buttons: typed, stepped with the arrow
   keys, or pressed (and held) a step at a time. Bigger where fingers tap. */
.stepper {
  --step-size: 2.5rem;
  display: inline-flex;
  align-items: stretch;
  gap: 0.375rem;
  justify-self: start;
}

.stepper > .btn.icon {
  width: var(--step-size);
  min-height: var(--step-size);
  flex: none;
  touch-action: manipulation;
  user-select: none;
}

.stepper > .btn.icon[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.stepper > .btn.icon[aria-disabled="true"]:active {
  transform: none;
}

.stepper > input[type="number"] {
  width: 5.5rem;
  max-width: none;
  min-height: var(--step-size);
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  appearance: textfield;
}

.stepper > input[type="number"]::-webkit-inner-spin-button,
.stepper > input[type="number"]::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

@media (pointer: coarse) {
  .stepper {
    --step-size: 2.75rem;
  }
}

/* A form whose text boxes are a little smaller than usual, such as the
   order form, where many fields follow each other. */
.form.compact {
  gap: 0.875rem;
}

.form.compact input:not([type="checkbox"], [type="radio"], [type="file"], .stepper > input),
.form.compact select {
  min-height: 2.25rem;
  padding: 0.375rem 0.625rem;
}

/* The plans on Plan and billing's Change plan, side by side where they fit:
   each card has its price, what it includes and when a move takes effect. */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
  align-items: stretch;
}

.plan-price {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.includes {
  margin: 0;
  padding-inline-start: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* --------------------------------------------- course uploads and reports */

.upload {
  border: 2px dashed var(--control);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  background: var(--surface-2);
}

.upload.dragging {
  border-color: var(--accent);
  background: var(--accent-softer);
}

.upload .drop-hint {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.upload-progress {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.upload-result {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.upload-result:empty {
  display: none;
}

.dropping {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius);
}

/* Several zips at once: a row each, then the options for them all. */
.upload-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(12rem, 2fr) minmax(10rem, 1fr);
  gap: 0.5rem 1rem;
  align-items: center;
  padding-block: 0.75rem;
  border-block-end: 1px solid var(--border);
}

.upload-row:last-child {
  border-block-end: 0;
}

.upload-file {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
}

.upload-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.upload-more {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.upload-more:empty {
  display: none;
}

.upload-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-inline-size: 36rem;
}

.upload-row[data-state='ready'] .upload-state,
.upload-row[data-state='made'] .upload-state {
  color: var(--ok);
}

.upload-row[data-state='failed'] .upload-state {
  color: var(--danger);
}

@media (max-width: 60rem) {
  .upload-row {
    grid-template-columns: 1fr;
  }
}

.upload-report {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.report {
  padding-inline-start: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.report li .hint {
  display: block;
}

.report.error li::marker {
  color: var(--danger);
}

.report.warn li::marker {
  color: var(--warn);
}

.package-lessons {
  padding-inline-start: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.package-lessons .hint {
  display: block;
}

/* A table cell with several lines: a name, its hints, a meter, a form. */
.cellstack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  min-inline-size: 0;
}

.cellstack > .hint {
  display: block;
}

.cellstack > meter {
  max-inline-size: 10rem;
}

.tbl .num > .cellstack {
  align-items: flex-end;
}

/* ------------------------------------------- order lines and timelines */

/* The line editor: a table whose cells are fields, lined up at the top, close together. */
.tbl.lines td {
  vertical-align: top;
}

.tbl.lines th,
.tbl.lines td {
  padding-inline: 0.375rem;
}

.tbl.lines tbody tr:hover td {
  background: none;
}

.tbl.lines select,
.tbl.lines input {
  min-inline-size: 0;
}

/* Each choice wide enough to read what it says. */
.tbl.lines select[name='what'],
.tbl.lines select[name='planId'],
.tbl.lines select[name='productId'],
.tbl.lines select[name='entitlement'] {
  min-inline-size: 10rem;
}

.tbl.lines select[name='billing'],
.tbl.lines select[name='starts'],
.tbl.lines select[name='ends'] {
  min-inline-size: 8.5rem;
}

.tbl.lines input[name='words'] {
  min-inline-size: 10rem;
}

.tbl.lines input[name='amount'] {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

/* Dated rows down a line: a dot, the date, and what starts or ends then. */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1rem max-content minmax(0, 1fr);
  column-gap: 0.75rem;
}

/* Every row shares the list's columns, so the dates and what happens line up. */
.timeline > li {
  position: relative;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: baseline;
  padding-block: 0.5rem;
}

/* The line between the dots. */
.timeline > li::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: calc(0.5rem - 1px);
  border-inline-start: 2px solid var(--border);
}

.timeline > li:first-child::before {
  inset-block-start: 1rem;
}

.timeline > li:last-child::before {
  inset-block-end: calc(100% - 1rem);
}

.timeline > li:only-child::before {
  display: none;
}

.timeline .dot {
  position: relative;
  align-self: center;
  justify-self: center;
  inline-size: 0.75rem;
  block-size: 0.75rem;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--accent);
}

.timeline .when {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.timeline .what {
  overflow-wrap: anywhere;
}

.timeline > li.past {
  color: var(--muted);
}

.timeline > li.past .dot {
  border-color: var(--control);
}

.timeline > li.today .dot {
  background: var(--accent);
}

/* ---------------------------------------------------------- narrow screens */

@media (max-width: 60rem) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    --off: -100%;
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(18rem, 86vw);
    height: auto;
    z-index: 30;
    translate: var(--off) 0;
    visibility: hidden;
    transition: translate 0.2s ease-out, visibility 0.2s;
    box-shadow: var(--shadow-l);
  }

  .side:dir(rtl) {
    --off: 100%;
  }

  .app.menu-open .side {
    translate: 0 0;
    visibility: visible;
  }

  .side-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: var(--scrim);
    animation: fade 0.15s;
  }

  .top .menu {
    display: inline-flex;
    margin-inline-start: -0.5rem;
  }

  .top,
  .hero,
  .content,
  .site-banner,
  .composer {
    padding-inline: 1rem;
  }

  .top-context {
    display: none;
  }

  .cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .facts {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Each line becomes a card of its fields, each with its column's name above it. */
  .tbl.lines thead {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .tbl.lines,
  .tbl.lines tbody,
  .tbl.lines tr,
  .tbl.lines td {
    display: block;
  }

  .tbl.lines tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-block-end: 0.75rem;
  }

  .tbl.lines td,
  .tbl.lines td:first-child,
  .tbl.lines td:last-child {
    padding: 0.375rem 0;
    border: 0;
  }

  .tbl.lines td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-block-end: 0.25rem;
    font-size: 0.71875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .tbl.lines td.end {
    text-align: end;
  }

  .tbl.lines input[name='words'] {
    min-inline-size: 0;
    inline-size: 100%;
  }

  .timeline {
    grid-template-columns: 1rem minmax(0, 1fr);
  }

  .timeline .what {
    grid-column: 2;
  }

  body:has(.app) .toasts,
  .toasts {
    inset-inline: 1rem;
    max-width: none;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

/* -------------------------------------------- the person's own settings */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .drain {
    display: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .top {
    background: var(--surface);
    backdrop-filter: none;
  }
}

@media (forced-colors: active) {
  .btn,
  .badge,
  .pill,
  .viewtab,
  .seg button[aria-pressed="true"],
  .tab[aria-selected="true"],
  .item[aria-current="page"] {
    border: 1px solid CanvasText;
  }

  .badge::before {
    background: CanvasText;
  }
}

/* ------------------------------------------------------------- branding */

/* A palette's two colours, beside its name; the palette is set on the swatch itself. */
.swatch {
  display: inline-flex;
  flex: none;
  margin-block-start: 0.125rem;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border);
}

.swatch-accent,
.swatch-second {
  display: block;
  inline-size: 0.875rem;
  block-size: 1.25rem;
}

.swatch-accent {
  background: var(--accent);
}

.swatch-second {
  background: var(--accent-2);
}

.palette-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0 1rem;
}

.brand-own {
  max-width: none;
}

.brand-own .row {
  align-items: flex-end;
}

.brand-own input[type="color"] {
  inline-size: 2.75rem;
  block-size: 2.5rem;
  padding: 0.125rem;
  border: 1px solid var(--control);
  border-radius: var(--radius-s);
  background: var(--surface);
  margin-block-end: 1.5rem;
}

.brand-made p {
  margin: 0;
}

.brand-logo-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.brand-logo-box .brand-logo {
  block-size: 48px;
  max-inline-size: 14rem;
}

/* The previews: a small page in each theme, with the brand's tokens set on it. */
.brand-previews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.brand-preview {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.brand-preview.light {
  color-scheme: light;
}

.brand-preview.dark {
  color-scheme: dark;
}

.brand-preview[data-font="rounded"] {
  --font: var(--font-rounded);
}

.brand-preview[data-font="classic"] {
  --font: var(--font-classic);
}

.brand-preview[data-font="humanist"] {
  --font: var(--font-humanist);
}

.brand-preview[data-font="clean"] {
  --font: var(--font-clean);
}

.brand-preview[data-corners="square"] {
  --radius: var(--radius-square);
  --radius-s: var(--radius-s-square);
}

.brand-preview[data-corners="soft"] {
  --radius: var(--radius-soft);
  --radius-s: var(--radius-s-soft);
}

.brand-preview[data-corners="default"] {
  --radius: var(--radius-default);
  --radius-s: var(--radius-s-default);
}

.brand-preview[data-corners="round"] {
  --radius: var(--radius-round);
  --radius-s: var(--radius-s-round);
}

.brand-preview p {
  margin: 0;
}

.brand-preview-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.brand-preview-title {
  font-size: 1.125rem;
  font-weight: 700;
}

.brand-preview-link {
  color: var(--accent);
  text-decoration: underline;
}

.brand-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.brand-preview-button {
  padding: 0.4rem 0.875rem;
  border-radius: var(--radius-s);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.brand-preview-chip {
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
}

.brand-preview-meter {
  block-size: 0.5rem;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.brand-preview-meter span {
  display: block;
  inline-size: 60%;
  block-size: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* --------------------------------------- signing in: the authenticator set-up */

.steps {
  margin: 0;
  padding-inline-start: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--muted);
}

.qr-wrap {
  align-self: center;
  inline-size: min(100%, 13rem);
  padding: 0.75rem;
  border-radius: var(--radius);
  background: var(--qr-light);
  border: 1px solid var(--border);
}

.qr {
  display: block;
  inline-size: 100%;
  block-size: auto;
}

/* Always dark on light, whatever the page's colours, so phones can read it. */
.qr rect {
  fill: var(--qr-light);
}

.qr path {
  fill: var(--qr-dark);
}

.secret {
  display: inline-block;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
  padding: 0.375rem 0.625rem;
  border-radius: calc(var(--radius) / 2);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.codes {
  margin: 0;
  padding: 0.75rem 1rem;
  list-style: none;
  columns: 2;
  column-gap: 1.5rem;
  font-size: 1.05rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.codes li {
  padding-block: 0.2rem;
}

/* A Get started line that isn't done yet: an empty ring where the tick goes. */
.tick-ring {
  flex: none;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  display: grid;
  place-items: center;
}

.tick-ring::before {
  content: "";
  inline-size: 1.25rem;
  block-size: 1.25rem;
  border-radius: 999px;
  border: 2px solid var(--control);
}

/* The composer (phase 10e): its bar, then the section list, the open section's timeline and the settings, side by side. */
.composer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-block-size: 0;
  /* Room at the end to scroll the timeline's last buttons up past a toast. */
  padding: 1.25rem 2rem 7rem;
}

.composer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block-end: 0.75rem;
  border-block-end: 1px solid var(--border);
}

.composer-name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  min-inline-size: 0;
}

.composer-name h1 {
  margin: 0;
  font-size: 1.375rem;
  overflow-wrap: anywhere;
}

.composer-rename input {
  min-inline-size: 16rem;
}

.composer-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.composer-save {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}

.composer-save[data-save="saved"] {
  color: var(--ok);
}

.composer-save[data-save="failed"] .error-text,
[data-sending="failed"] {
  color: var(--danger);
}

.composer-storage meter {
  inline-size: 6rem;
}

.composer-editing:empty {
  display: none;
}

.composer-columns {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr) minmax(16rem, 22rem);
  gap: 1.25rem;
  align-items: start;
}

.composer-sections,
.composer-timeline,
.composer-settings {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-inline-size: 0;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.composer-sections h2,
.composer-timeline h2,
.composer-settings h2 {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.composer-sections-list,
.composer-cards {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.composer-row,
.composer-card {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding-inline-start: 0.25rem;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--faint);
}

.composer-row.current,
.composer-card.current {
  border-color: var(--accent-line);
  background: var(--accent-softer);
}

.composer-row[draggable="true"],
.composer-card[draggable="true"] {
  cursor: grab;
}

.composer-row.dragging,
.composer-card.dragging {
  opacity: 0.5;
}

/* A block in the section list: its heading row, then its sections, set in under it. */
.composer-block {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.composer-block-sections {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.composer-block.dragging {
  opacity: 0.5;
}

.composer-block.drop-here > .composer-block-head {
  box-shadow: 0 -3px 0 var(--accent);
}

/* Course settings, above the sections. */
.composer-course {
  flex: none;
  border: 1px solid var(--border);
}

.composer-course.current {
  border-color: var(--accent-line);
  background: var(--accent-softer);
}

/* The Ready to build line under the sections, which opens Build (10g1). */
.composer-ready {
  flex: none;
  margin-block-start: 0.75rem;
  border: 1px solid var(--border);
}

.composer-ready.ok {
  color: var(--ok);
}

.composer-ready.warn {
  border-color: var(--warn);
  color: var(--warn);
}

.composer-ready.danger {
  border-color: var(--danger);
  color: var(--danger);
}

/* Build's Ready to build list: each problem and warning, with Go to. */
.composer-ready-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.composer-ready-entry {
  flex-wrap: nowrap;
  align-items: flex-start;
}

.composer-ready-entry.problem > svg {
  color: var(--danger);
}

.composer-ready-entry.warning > svg {
  color: var(--warn);
}

/* How the course's title screen looks: in the instance's brand, or in TrioLMS's own look. */
.composer-look {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  padding: 1.25rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--accent-softer);
  color: var(--text);
  font-family: var(--font);
  text-align: center;
}

.composer-look[data-look="trio"] {
  --font: var(--font-clean);
  --radius: var(--radius-default);
  --radius-s: var(--radius-s-default);
}

.composer-look-logo {
  max-block-size: 2.5rem;
  max-inline-size: 10rem;
  object-fit: contain;
}

.composer-look-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.125rem;
  overflow-wrap: anywhere;
}

.composer-look-start {
  padding: 0.375rem 1rem;
  border-radius: var(--radius-s);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

/* Where a dragged row will land: a line above it. */
.composer-row.drop-here,
.composer-card.drop-here {
  box-shadow: 0 -3px 0 var(--accent);
}

.composer-pick {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-inline-size: 0;
  padding: 0.5rem;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.composer-pick .grow {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* In the section list, and in a timeline narrowed by the columns beside it, a row's count or rule goes under its title rather than squeeze it. */
.composer-sections .composer-pick,
.composer-timeline .composer-pick {
  flex-wrap: wrap;
  row-gap: 0.125rem;
}

.composer-sections .composer-pick .grow {
  flex: 1 1 6rem;
}

.composer-timeline .composer-pick .grow {
  flex: 1 1 9rem;
}

.composer-pick > .hint {
  flex: none;
  white-space: nowrap;
}

.composer-card .composer-pick {
  padding-block: 0.75rem;
}

.kind-icon {
  flex: none;
  display: grid;
  place-items: center;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  border-radius: var(--radius-s);
  background: var(--accent-soft);
  color: var(--accent);
}

.kind-icon.placeholder {
  background: var(--surface-2);
  color: var(--muted);
  outline: 1px dashed var(--control);
}

.composer-add {
  flex-wrap: wrap;
}

/* The section's heading with Timeline and Map beside it. */
.composer-view {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* The structure map: a plane in map units (one to a pixel) that scrolls in its box, with the
   ways on drawn under the cards. Its geometry runs left to right in every language. */
.composer-map {
  overflow: auto;
  max-block-size: 70vh;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.composer-map-plane {
  position: relative;
  direction: ltr;
  inline-size: calc(var(--width) * 1px);
  block-size: calc(var(--height) * 1px);
}

.composer-map-ways {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.map-way path {
  fill: none;
  stroke: var(--faint);
  stroke-width: 1.5;
}

.map-way.otherwise path {
  stroke-dasharray: 6 4;
}

.map-way.faded {
  opacity: 0.4;
}

.map-way text {
  fill: var(--text);
  font-size: 0.75rem;
  paint-order: stroke;
  stroke: var(--surface-2);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.composer-map-ways marker path {
  fill: var(--faint);
}

.composer-map-card {
  position: absolute;
  inset-inline-start: calc(var(--x) * 1px);
  inset-block-start: calc(var(--y) * 1px);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  inline-size: calc(var(--card-width) * 1px);
  block-size: calc(var(--card-height) * 1px);
  padding: 0.5rem;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: start;
  overflow: hidden;
}

button.composer-map-card {
  cursor: pointer;
  touch-action: none;
}

.composer-map-card .grow {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.composer-map-card .grow > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The rule badge goes under the name and kind, so the name has the card's width. */
.composer-map-card .grow > [data-rule] {
  align-self: start;
  margin-block-start: 0.25rem;
}

.composer-map-card .composer-thumb {
  inline-size: 2.25rem;
}

.composer-map-card.current {
  border-color: var(--accent-line);
  background: var(--accent-softer);
}

.composer-map-card.placeholder {
  border-style: dashed;
  border-color: var(--control);
}

.composer-map-card.faded {
  opacity: 0.55;
}

.composer-map-card.dragging {
  z-index: 1;
  box-shadow: var(--shadow);
  cursor: grabbing;
}

.composer-map-end {
  justify-content: center;
  color: var(--muted);
  background: var(--surface-2);
}

.composer-map-problem {
  position: absolute;
  inset-block-start: 0.25rem;
  inset-inline-end: 0.25rem;
  color: var(--danger);
}

/* A picture's card shows it, and a video's its first frame, in place of the kind's icon. */
.composer-thumb {
  flex: none;
  inline-size: 4rem;
  block-size: 2.25rem;
  object-fit: cover;
  border-radius: var(--radius-s);
  background: var(--surface-2);
}

/* A card's file while it is sent: a bar, and how much has gone. */
.composer-sending,
.composer-file-shown {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-inline-size: 0;
}

.composer-sending {
  margin-block-start: 0.25rem;
}

.composer-file {
  align-items: center;
  flex-wrap: nowrap;
}

.composer-poster {
  flex: none;
  inline-size: 6rem;
  block-size: 3.375rem;
  object-fit: cover;
  border-radius: var(--radius-s);
  background: var(--surface-2);
}

.composer-caption-list,
.composer-gap-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A poster's, a slide's picture's or a caption's row wraps in the narrow settings column: the picture or language, then the file's name, then its buttons. */
.composer-file[data-poster],
.composer-file[data-picture],
.composer-captions .composer-file {
  flex-wrap: wrap;
}

.composer-file[data-poster] > .composer-file-shown,
.composer-file[data-picture] > .composer-file-shown,
.composer-captions .composer-file > .composer-file-shown {
  flex: 1 1 8rem;
}

.composer-caption-list select {
  flex: 1 1 100%;
}

.composer-gaps:empty {
  display: none;
}

/* The rich-text editor: its toolbar, the link row, and the text area, which looks like an input and grows with what it holds. */
.rich {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.rich-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem;
}

.rich-link {
  align-items: center;
}

.rich-link input {
  flex: 1 1 12rem;
}

.rich-area {
  font-size: 0.90625rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--control);
  border-radius: var(--radius-s);
  padding: 0.5625rem 0.75rem;
  min-block-size: 7rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rich-area:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.rich-area[contenteditable="false"] {
  opacity: 0.55;
}

.rich-area > * {
  margin-block: 0 0.5em;
}

.rich-area > :last-child {
  margin-block-end: 0;
}

.rich-area h2 {
  font-size: 1.125rem;
}

.rich-area h3 {
  font-size: 1rem;
}

.rich-area ul,
.rich-area ol {
  padding-inline-start: 1.5rem;
}

.field > .field-label {
  font-weight: 650;
  font-size: 0.875rem;
}

/* While files are over the timeline, its outline shows they can be dropped there. */
.composer-timeline.drop-files {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

/* A quiz's question parts: a row of fields for each answer, pair, step, accepted answer, area or option, with its small buttons at the end. */
.composer-parts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.composer-part {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
}

.composer-part-fields {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  min-inline-size: 0;
}

.composer-part-fields > input[type="text"] {
  flex: 1 1 100%;
  min-inline-size: 0;
}

.composer-part-tools {
  display: flex;
  flex: none;
}

/* A quiz's draw: how many questions, then from which bank. */
.composer-draw > input[type="number"] {
  inline-size: 5rem;
}

.composer-draw > select {
  flex: 1 1 8rem;
  min-inline-size: 0;
}

.composer-right {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.composer-needs {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--warn);
}

.kind-icon.question {
  inline-size: 2rem;
  block-size: 2rem;
}

/* A hotspot's picture with its right areas outlined over it, placed from their custom properties (shares of the picture). */
.composer-hotspot {
  position: relative;
  max-inline-size: 100%;
  touch-action: none;
  cursor: crosshair;
  user-select: none;
  /* Areas are places on the picture, left to right, whatever the page's direction. */
  direction: ltr;
}

.composer-hotspot img {
  display: block;
  inline-size: 100%;
  border-radius: var(--radius-s);
}

.composer-area {
  position: absolute;
  inset-inline-start: calc(var(--x) * 100%);
  inset-block-start: calc(var(--y) * 100%);
  inline-size: calc(var(--w) * 100%);
  block-size: calc(var(--h) * 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  pointer-events: none;
}

.composer-area-number {
  display: inline-grid;
  place-items: center;
  min-inline-size: 1.25rem;
  block-size: 1.25rem;
  padding-inline: 0.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.75rem;
  font-weight: 600;
}

.composer-area-field {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
}

.composer-area-field input {
  inline-size: 5.5rem;
}

/* Who else has the project open, in the bar: their initials, the editor's ringed and marked with a pencil. */
.composer-here {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.composer-here-person {
  position: relative;
  display: inline-flex;
}

.composer-here-person .avatar {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.6875rem;
}

.composer-here-person.editing .avatar {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}

.composer-here-person svg {
  position: absolute;
  inset-block-end: -0.375rem;
  inset-inline-end: -0.375rem;
  padding: 2px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
}

.composer-here-more {
  padding-inline: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--faint);
}

/* The settings column's own parts, laid out as the column was. */
.composer-settings-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-inline-size: 0;
}

/* The narrow layouts' buttons and notice show only below their widths, and Close only in the drawer. */
.composer-show-settings,
.composer-show-sections,
.composer-drawer-head,
.composer-narrow {
  display: none;
}

/* The drawer the settings move into below 1200px: the design's drawer, holding the column as it is. */
dialog.composer-drawer {
  width: min(24rem, 100%);
  overflow-y: auto;
}

.composer-drawer .composer-settings {
  flex: 1;
  border: 0;
  border-radius: 0;
}

.composer-drawer .composer-drawer-head {
  display: flex;
  justify-content: flex-end;
}

/* Below 1200px the settings column gives way to the drawer, opened from Settings in the bar. */
@media (max-width: 1199px) {
  .composer-columns {
    grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
  }

  .composer-show-settings {
    display: inline-flex;
  }

  .composer-columns > .composer-settings {
    display: none;
  }
}

/* Below 960px the timeline takes the width, and the section list opens over it from Sections in the bar. */
@media (max-width: 959px) {
  .composer-columns {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
  }

  .composer-show-sections {
    display: inline-flex;
  }

  .composer-narrow {
    display: block;
  }

  .composer-sections {
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    z-index: 20;
    inline-size: min(20rem, 100%);
    max-block-size: 75vh;
    overflow-y: auto;
    box-shadow: var(--shadow-l);
  }

  .composer:not([data-sections="open"]) .composer-sections {
    display: none;
  }
}

/* Preview (10g2): the player's frame, and on the inline end what TrioLMS would record. */
.preview-body {
  flex: 1;
  min-block-size: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22.5rem;
}

/* The stage box holds the notice and the stage, which takes the rest of its height. */
.preview-stage-box {
  min-block-size: 0;
}

.preview-stage {
  flex: 1;
  display: flex;
  min-block-size: 0;
  background: var(--stage);
}

.preview-stage > iframe {
  display: block;
  flex: 1;
  inline-size: 100%;
  block-size: 100%;
  border: 0;
}

.preview-panel {
  overflow: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-inline-start: 1px solid var(--border);
}

.preview-sections,
.preview-answers {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preview-sections > li {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
}

.preview-sections > li.current {
  border-color: var(--accent-line);
  background: var(--accent-softer);
}

.preview-answers > li {
  padding-block-end: 0.5rem;
  border-block-end: 1px solid var(--border);
}

@media (max-width: 959px) {
  .preview-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(24rem, 70vh) auto;
    overflow: auto;
  }

  .preview-panel {
    overflow: visible;
    border-inline-start: 0;
    border-block-start: 1px solid var(--border);
  }
}

/* The course report (10g3): the composer's report lines as a page, headings by kind, quiz questions as points with their answers under them. */
.course-report {
  max-inline-size: 72ch;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.course-report h2 {
  margin: 0 0 0.25rem;
  font-size: 1.375rem;
}

.course-report h3 {
  margin: 1.25rem 0 0.125rem;
  padding-block-start: 0.75rem;
  border-block-start: 1px solid var(--border);
  font-size: 1.125rem;
}

.course-report h4 {
  margin: 0.75rem 0 0;
  font-size: 1rem;
}

.course-report p {
  margin: 0;
}

.course-report .points,
.course-report .subpoints {
  margin: 0;
  padding-inline-start: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.course-report .subpoints {
  margin-block-start: 0.25rem;
  color: var(--muted);
}

details[data-report] > .course-report {
  margin-block-start: 0.75rem;
}

/* The composer's help (10h1): a "?" beside an option's label with its tooltip, and the docs panel in the settings column. */
.help-label-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-inline-size: 0;
}

.field > .help-label-row > label,
.field > .help-label-row > .field-label {
  font-weight: 650;
  font-size: 0.875rem;
}

.btn.icon.help-tip {
  min-block-size: 1.75rem;
  min-inline-size: 1.75rem;
  padding: 0.25rem;
  color: var(--muted);
}

.help-tip-box {
  margin: 0;
  inline-size: min(20rem, calc(100vw - 2rem));
  padding: 0.75rem;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-l);
  font-size: 0.875rem;
  font-weight: 400;
  position-area: block-end span-inline-end;
  position-try-fallbacks: flip-block, flip-inline;
}

.help-tip-box:popover-open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.help-tip-box p {
  margin: 0;
}

.help-docs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-inline-size: 0;
}

.help-docs h3 {
  margin: 0;
  font-size: 0.875rem;
}

.help-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-block-end: 0.75rem;
}

.help-pages {
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-link {
  inline-size: 100%;
  padding: 0.375rem 0.5rem;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--accent);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.help-link:hover {
  background: var(--accent-softer);
}

.help-page {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.625rem;
}

.help-page h3 {
  font-size: 1rem;
}

.help-page p {
  margin: 0;
}

.help-example {
  padding: 0.5rem 0.75rem;
  border-inline-start: 3px solid var(--accent-line);
  background: var(--accent-softer);
}

/* The composer's tutorial (10h2): the offer in a corner, and each step's box beside the part it is about, which is outlined. */
.tour-offer,
.tour-coach {
  margin: 0;
  padding: 1rem;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-l);
  font-size: 0.875rem;
}

.tour-offer:popover-open,
.tour-coach:popover-open {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tour-offer h2,
.tour-coach h2 {
  margin: 0;
  font-size: 1rem;
}

.tour-offer p,
.tour-coach p {
  margin: 0;
}

.tour-offer {
  position: fixed;
  inset: auto 1rem 1rem auto;
  inline-size: min(22rem, calc(100vw - 2rem));
}

/* Its buttons keep their words on one line. */
.tour-offer .row > * {
  flex: none;
}

.tour-coach {
  inline-size: min(22rem, calc(100vw - 2rem));
  position-area: block-end span-inline-end;
  position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
  border-block-start: 3px solid var(--accent);
}

.tour-actions {
  margin-block-start: 0.25rem;
}

[data-tour-target] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-s);
}
