/* The customer portal (#496, A57) in the hub's own language. The portal ships no build step and
   cannot import web/styles/tokens.css, so the values it needs stand here once, each named after
   its hub token: paper, ink, night, chalk, Eis; radii, shadows, the 72 px brand grid and the
   entrance wash measured at wayunit.com (docs/32 § 4a). A colour that is not in tokens.css does
   not belong here either. */

@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;

  /* Palette (tokens.css) */
  --paper-050: #ffffff;
  --paper-100: #fafbfc;
  --paper-200: #f5f7f9;
  --ink-900: #0f1626;
  --ink-700: #2f4153;
  --ink-500: #5a7285;
  --night-950: #0c1420;
  --night-900: #0f1626;
  --night-800: #141e2c;
  --chalk-050: #e8f1f6;
  --chalk-300: #b8c9d4;
  --chalk-500: #8ca3b3;
  --eis-900: #005778;
  --eis-800: #00739e;
  --eis-500: #3fc2f3;
  --eis-400: #62cdf5;
  --eis-300: #93ddf8;
  --eis-200: #bee8f8;
  --eis-100: #dff4fc;
  --eis-night-quiet: #103344;
  --amber-900: #683f00;
  --amber-400: #d9a03c;
  --vermillion-700: #b3261e;
  --vermillion-400: #e8796a;
  --moss-700: #0f6b4f;
  --moss-400: #63af79;
  --grid-line-light: #e4edf2;

  /* Roles, light */
  --canvas: var(--paper-200);
  --surface: var(--paper-100);
  --raised: var(--paper-050);
  --text: var(--ink-900);
  --text-secondary: var(--ink-700);
  --text-muted: var(--ink-500);
  --hairline: color-mix(in srgb, var(--ink-900) 13%, transparent);
  --border: color-mix(in srgb, var(--ink-900) 18%, transparent);
  --hover: color-mix(in srgb, var(--ink-900) 5%, var(--paper-050));
  --accent: var(--eis-800);
  --accent-hover: var(--eis-900);
  --accent-quiet: color-mix(in srgb, var(--eis-800) 7%, var(--paper-050));
  --brand: var(--eis-400);
  --on-brand: var(--ink-900);
  --selected: var(--ink-900);
  --on-selected: var(--paper-050);
  --selected-hover: var(--ink-700);
  --focus: var(--eis-800);
  --warning: var(--amber-900);
  --warning-quiet: color-mix(in srgb, var(--amber-900) 10%, var(--paper-050));
  --danger: var(--vermillion-700);
  --danger-quiet: color-mix(in srgb, var(--vermillion-700) 9%, var(--paper-050));
  --positive: var(--moss-700);
  --positive-quiet: color-mix(in srgb, var(--moss-700) 10%, var(--paper-050));
  --brand-grid-color: var(--grid-line-light);
  --provider-tint: color-mix(in srgb, var(--eis-400) 9%, var(--paper-050));

  /* The entrance wash: Eis 300, Eis 400 and Eis 100 in the dosage the wayunit.com hero carries. */
  --wash-entrance:
    radial-gradient(46% 58% at 76% 26%, color-mix(in srgb, var(--eis-300) 26%, transparent) 0%, transparent 70%),
    radial-gradient(64% 74% at 20% -12%, color-mix(in srgb, var(--eis-400) 28%, transparent) 0%, transparent 68%),
    linear-gradient(to bottom, color-mix(in srgb, var(--eis-100) 46%, transparent) 0%, transparent 78%);

  --shadow-control: 0 1px 2px color-mix(in srgb, var(--ink-900) 8%, transparent);
  --shadow-card:
    0 1px 2px color-mix(in srgb, var(--ink-900) 4%, transparent),
    0 12px 32px -12px color-mix(in srgb, var(--ink-900) 14%, transparent);
  --shadow-dialog:
    0 24px 64px color-mix(in srgb, var(--ink-900) 12%, transparent),
    0 8px 24px color-mix(in srgb, var(--ink-900) 6%, transparent);

  /* Shape, type, motion (tokens.css) */
  --radius-1: 6px;
  --radius-3: 12px;
  --radius-4: 14px;
  --radius-5: 20px;
  --radius-6: 24px;
  --radius-pill: 9999px;
  --brand-grid-cell: 72px;
  --brand-grid-mask-corner: radial-gradient(90% 90% at 100% 0%, #000000 0%, #00000073 40%, transparent 82%);
  --brand-grid-mask-dome: radial-gradient(115% 92% at 50% -12%, #000000 0%, #00000073 40%, transparent 82%);
  --font: Manrope, ui-sans-serif, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --control-height: 44px;
  --ease-standard: cubic-bezier(0.2, 0, 0.13, 1);
  --motion-instant: 100ms;
  --motion-slow: 400ms;
}

/* Night is its own ladder, not an inversion; Eis is dosed down to a sixth so it tints instead
   of glowing. */
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: var(--night-950);
    --surface: var(--night-900);
    --raised: var(--night-800);
    --text: var(--chalk-050);
    --text-secondary: var(--chalk-300);
    --text-muted: var(--chalk-500);
    --hairline: color-mix(in srgb, var(--chalk-050) 11%, transparent);
    --border: color-mix(in srgb, var(--chalk-050) 20%, transparent);
    --hover: color-mix(in srgb, var(--chalk-050) 7%, var(--night-900));
    --accent: var(--eis-300);
    --accent-hover: var(--eis-200);
    --accent-quiet: var(--eis-night-quiet);
    --selected: var(--chalk-050);
    --on-selected: var(--night-950);
    --selected-hover: var(--chalk-300);
    --focus: var(--eis-300);
    --warning: var(--amber-400);
    --warning-quiet: color-mix(in srgb, var(--amber-400) 16%, var(--night-800));
    --danger: var(--vermillion-400);
    --danger-quiet: color-mix(in srgb, var(--vermillion-400) 16%, var(--night-800));
    --positive: var(--moss-400);
    --positive-quiet: color-mix(in srgb, var(--moss-400) 16%, var(--night-800));
    --brand-grid-color: color-mix(in srgb, var(--paper-050) 5.5%, transparent);
    --provider-tint: color-mix(in srgb, var(--eis-400) 7%, var(--night-800));
    --wash-entrance:
      radial-gradient(46% 58% at 76% 26%, color-mix(in srgb, var(--eis-400) 7%, transparent) 0%, transparent 70%),
      radial-gradient(64% 74% at 20% -12%, color-mix(in srgb, var(--eis-300) 5%, transparent) 0%, transparent 68%),
      linear-gradient(to bottom, color-mix(in srgb, var(--eis-800) 16%, transparent) 0%, transparent 78%);
    --shadow-control: 0 1px 2px color-mix(in srgb, #000 50%, transparent);
    --shadow-card:
      0 0 0 1px color-mix(in srgb, var(--chalk-050) 6%, transparent),
      0 12px 32px -12px color-mix(in srgb, #000 70%, transparent);
    --shadow-dialog:
      0 0 0 1px color-mix(in srgb, var(--chalk-050) 8%, transparent),
      0 24px 64px color-mix(in srgb, #000 55%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-instant: 0ms;
    --motion-slow: 0ms;
  }
}

/* Base ------------------------------------------------------------------------------- */

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

/* A class that sets `display` (.button, .field) must never beat the hidden attribute (E222). */
[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  isolation: isolate;
  position: relative;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

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

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

h1 {
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0;
  overflow-wrap: break-word;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin: 0 0 1rem;
}

p {
  margin: 0;
}

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

.wrap {
  --gutter: 1.5rem;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -999px;
  z-index: 2;
}

.skip:focus {
  left: 1rem;
  top: 0.75rem;
  background: var(--raised);
  color: var(--text);
  padding: 0.625rem 1rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
}

.icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow--muted {
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

.lead {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
}

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

.hint--center {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}

.nowrap {
  white-space: nowrap;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* The brand grid: 72 px cells, a neutral line, always masked - never a bare full surface. */
.entry::before,
.app::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--brand-grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--brand-grid-color) 1px, transparent 1px);
  background-size: var(--brand-grid-cell) var(--brand-grid-cell);
  background-position: center top;
}

/* Entrance: login, invitation, a message before signing in ------------------------------- */

.entry {
  background-color: var(--raised);
  background-image: var(--wash-entrance);
  background-repeat: no-repeat;
  background-size: 100% min(760px, 100%);
}

.entry::before {
  height: 100%;
  mask-image: var(--brand-grid-mask-dome);
}

.entry-head {
  display: flex;
  justify-content: center;
  padding: 2.5rem 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-1);
}

.brand__logo,
.brand__logo img {
  display: block;
  height: 1.625rem;
  width: auto;
}

.brand--entry .brand__logo,
.brand--entry .brand__logo img {
  height: 2rem;
}

.brand__sub {
  padding-left: 0.875rem;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25rem;
  white-space: nowrap;
}

.entry-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem 3.5rem;
}

.panel {
  width: 100%;
  background: var(--raised);
  border-radius: var(--radius-6);
  box-shadow: var(--shadow-dialog);
  animation: rise var(--motion-slow) var(--ease-standard) both;
}

.panel--entry {
  max-width: 27.5rem;
  padding: 2.5rem 2.25rem 2rem;
}

.intro {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.intro .lead {
  max-width: 34ch;
  margin: 0.25rem auto 0;
}

.panel--message {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.panel--message .lead {
  max-width: 36ch;
}

.message__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-pill);
  background: var(--accent-quiet);
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.message__mark .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.panel__actions {
  margin-top: 1rem;
}

/* A message shown to a signed-in person stands on the canvas like any other page. */
.app .panel--message {
  margin: 3rem auto 0;
}

/* Signed in: header bar, canvas, cards ------------------------------------------------------- */

.app::before {
  height: calc(var(--brand-grid-cell) * 4);
  mask-image: var(--brand-grid-mask-corner);
  background-position: right top;
}

.top {
  padding-top: 1rem;
}

.top__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  min-height: 4rem;
  padding: 0.75rem 0.75rem 0.75rem 1.5rem;
  background: var(--raised);
  border-radius: var(--radius-5);
  box-shadow: var(--shadow-card);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 1rem;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--motion-instant) var(--ease-standard), color var(--motion-instant) var(--ease-standard);
}

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

.nav__link[aria-current='page'] {
  background: var(--selected);
  color: var(--on-selected);
}

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

.who__text {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 22rem;
}

.who__logout {
  margin: 0;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-pill);
  background: var(--accent-quiet);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.main {
  flex: 1;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

/* Forms and a single ticket read best at a measure, not across a wide screen. */
.main:has(.card--form) {
  max-width: 56rem;
}

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

.foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
}

.entry .foot__inner {
  justify-content: center;
}

.foot__inner {
  position: relative;
}

/* The rule spans the content, not the gutters, so it ends where the cards end. */
.app .foot__inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--hairline);
}

.foot__claim {
  letter-spacing: 0.04em;
}


.foot a {
  color: var(--text-muted);
  text-decoration: none;
}

.foot a:hover {
  color: var(--text);
  text-decoration: underline;
}

.card {
  background: var(--raised);
  border-radius: var(--radius-6);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  margin-bottom: 1.5rem;
  animation: rise var(--motion-slow) var(--ease-standard) both;
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.page-head--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  margin: 0 0 1rem -0.75rem;
  padding: 0 0.875rem 0 0.75rem;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

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

/* Notices -------------------------------------------------------------------------- */

.notice {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  border-radius: var(--radius-3);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  background: var(--accent-quiet);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.45;
}

.notice::before {
  content: '';
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.375rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

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

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

.field-error {
  color: var(--danger);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* Forms ----------------------------------------------------------------------------- */

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

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

.field label {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
}

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

.form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

input,
select,
textarea {
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-control);
  padding: 0 0.875rem;
  min-height: var(--control-height);
  width: 100%;
  transition:
    border-color var(--motion-instant) var(--ease-standard),
    background-color var(--motion-instant) var(--ease-standard);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: var(--raised);
}

input[readonly] {
  color: var(--text-muted);
  background: var(--canvas);
  box-shadow: none;
}

input[readonly]:hover {
  border-color: var(--hairline);
}

input[aria-describedby$='-error'],
select[aria-describedby$='-error'],
textarea[aria-describedby$='-error'] {
  border-color: var(--danger);
}

/* The caret drawn from two gradients: an image would need a data: URL, which img-src forbids. */
select {
  appearance: none;
  padding-right: 2.5rem;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 1.25rem) 50%,
    calc(100% - 0.9rem) 50%;
  background-size: 0.375rem 0.375rem;
  background-repeat: no-repeat;
}

select option {
  background: var(--raised);
  color: var(--text);
}

textarea {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  line-height: 1.55;
  resize: vertical;
  min-height: 9rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-shrink: 0;
  min-height: var(--control-height);
  padding: 0 1.375rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: var(--on-selected);
  background: var(--selected);
  border: 1px solid var(--selected);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-control);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--motion-instant) var(--ease-standard),
    border-color var(--motion-instant) var(--ease-standard),
    color var(--motion-instant) var(--ease-standard),
    scale var(--motion-instant) var(--ease-standard);
}

.button:hover {
  color: var(--on-selected);
  background: var(--selected-hover);
  border-color: var(--selected-hover);
}

.button:active {
  scale: 0.97;
}

.button--block {
  width: 100%;
  margin-top: 0.5rem;
}

.button--quiet {
  color: var(--text-secondary);
  background: var(--raised);
  border-color: var(--border);
}

.button--quiet:hover {
  color: var(--text);
  background: var(--hover);
  border-color: var(--text-muted);
}

.button--small {
  min-height: 2.5rem;
  padding: 0 1rem;
}

/* Ticket list ------------------------------------------------------------------------ */

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  text-align: left;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}

.table th:first-child,
.table td:first-child {
  padding-left: 1.75rem;
}

.table th:last-child,
.table td:last-child {
  padding-right: 1.75rem;
}

.table th {
  color: var(--text-muted);
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
  white-space: nowrap;
}

.table tbody tr {
  position: relative;
  transition: background-color var(--motion-instant) var(--ease-standard);
}

.table tbody tr:hover {
  background: var(--hover);
}

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

/* The subject's link covers the whole row: one target, still one link for a screen reader. */
.cell--subject a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: break-word;
}

.cell--subject a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.cell--subject a:focus-visible {
  outline: none;
}

.table tbody tr:has(a:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.table tbody tr:hover .cell--subject a {
  color: var(--accent);
}

.cell--number {
  color: var(--text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cell--muted {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 1.5rem;
  padding: 0 0.625rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--hover);
  color: var(--text-secondary);
}

.state__dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: var(--radius-pill);
  background: currentColor;
}

.state--new,
.state--open {
  background: var(--accent-quiet);
  color: var(--accent);
}

.state--pendingCustomer {
  background: var(--warning-quiet);
  color: var(--warning);
}

.state--closedSuccessful {
  background: var(--positive-quiet);
  color: var(--positive);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
  text-align: center;
}

.empty__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-pill);
  background: var(--accent-quiet);
  color: var(--accent);
}

.empty--quiet {
  padding: 1.5rem;
  border-radius: var(--radius-4);
  border: 1px dashed var(--border);
}

/* Ticket ----------------------------------------------------------------------------- */

.ticket-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.ticket-head__title {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
  flex: 1 1 20rem;
}

.ticket-head h1 {
  font-size: 1.75rem;
}

.ticket-head__state {
  padding-top: 0.25rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 1rem 1.5rem;
  margin: 1.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
}

.facts dt {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.facts dd {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.thread {
  margin: 2.5rem 0 2rem;
}

.thread__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0.875rem;
  position: relative;
}

/* The thread's spine: a hairline from one author's chip to the next. */
.post:not(:last-child)::before {
  content: '';
  position: absolute;
  left: calc(1.125rem - 0.5px);
  top: 2.75rem;
  bottom: -0.75rem;
  width: 1px;
  background: var(--hairline);
}

.avatar--provider {
  background: var(--brand);
  color: var(--on-brand);
}

.avatar--customer {
  background: var(--raised);
  color: var(--text-secondary);
  box-shadow: inset 0 0 0 1px var(--border);
}

.post__card {
  background: var(--raised);
  border-radius: var(--radius-4);
  box-shadow: var(--shadow-card);
  padding: 1rem 1.25rem 1.125rem;
}

.post--provider .post__card {
  background: var(--provider-tint);
}

.post__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.125rem 0.625rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

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

.post--provider .post__side {
  color: var(--accent);
  font-weight: 600;
}

.post__head time {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* The list's view: two links on a grey track, the current one a raised pill (the hub's
   filter pills, without the sliding marker - there is no script to slide it). */
.filter {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  margin: -0.25rem 0 1.25rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.filter__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0 0.875rem 0 1.125rem;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--motion-instant) var(--ease-standard), color var(--motion-instant) var(--ease-standard);
}

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

.filter__pill[aria-current='page'] {
  background: var(--raised);
  color: var(--text);
  box-shadow: var(--shadow-control);
}

.filter__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.375rem;
  padding: 0 0.4375rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.filter__pill[aria-current='page'] .filter__count {
  background: var(--accent-quiet);
  color: var(--accent);
}

/* „Wieder öffnen“ under the facts of a closed ticket: a quiet band with the last day and the button. */
.reopen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-top: 1.5rem;
  padding: 0.875rem 0.875rem 0.875rem 1.25rem;
  border-radius: var(--radius-4);
  background: var(--accent-quiet);
}

.reopen__text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.reopen__form {
  margin: 0;
}

/* Narrow screens ---------------------------------------------------------------------- */

@media (max-width: 48rem) {
  .wrap {
    --gutter: 1rem;
  }

  .top {
    padding-top: 0.75rem;
  }

  .top__bar {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .top__bar .brand {
    padding-left: 0.5rem;
  }

  .who {
    margin-left: auto;
  }

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

  .nav {
    order: 3;
    flex-basis: 100%;
    padding: 0.25rem;
    border-radius: var(--radius-pill);
    background: var(--hover);
  }

  .nav__link {
    flex: 1;
    justify-content: center;
    padding: 0 0.5rem;
    white-space: nowrap;
  }

  .main {
    padding-top: 1.75rem;
  }

  h1 {
    font-size: 1.625rem;
  }

  .ticket-head h1 {
    font-size: 1.375rem;
  }

  .card {
    padding: 1.25rem;
    border-radius: var(--radius-5);
  }

  .card--flush {
    padding: 0;
  }

  .page-head .button {
    width: 100%;
  }

  .form__actions .button {
    flex: 1;
  }

  .entry-head {
    padding-top: 1.75rem;
  }

  .entry-main {
    padding: 2rem 1rem 2.5rem;
    align-items: flex-start;
  }

  .panel--entry {
    padding: 2rem 1.25rem 1.5rem;
    border-radius: var(--radius-5);
  }

  /* A row becomes a small card: number and state on top, the subject, then who and when. */
  .table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .table,
  .table tbody {
    display: block;
  }

  .table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'number state'
      'subject subject'
      'meta updated';
    gap: 0.375rem 0.75rem;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--hairline);
  }

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

  .table tbody td,
  .table tbody td:first-child,
  .table tbody td:last-child {
    display: block;
    padding: 0;
    border: 0;
  }

  .table td.cell--number {
    grid-area: number;
    font-size: 0.8125rem;
  }

  .table td.cell--state {
    grid-area: state;
  }

  .table td.cell--subject {
    grid-area: subject;
    font-size: 0.9375rem;
  }

  .table td.cell--type {
    display: none;
  }

  .table td.cell--requester {
    grid-area: meta;
    color: var(--text-muted);
    font-size: 0.8125rem;
  }

  .table td.cell--updated {
    grid-area: updated;
    font-size: 0.8125rem;
  }

  .filter {
    display: flex;
  }

  .filter__pill {
    flex: 1;
    justify-content: center;
  }

  .reopen .button,
  .reopen__form {
    width: 100%;
  }

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

  .post > .avatar,
  .post::before {
    display: none;
  }
}

@media (max-width: 30rem) {
  .top__bar .brand__sub {
    display: none;
  }

  .foot__claim {
    flex-basis: 100%;
    text-align: center;
  }

}
