/* ==========================================================================
   Конференции · администрирование
   Палитра: хвойная зелень + золото (литургические цвета), холодный фон.
   Шрифты: Literata — заголовки и цифры дат, Golos Text — интерфейс,
   IBM Plex Mono — адреса и логины.
   Фирменный элемент: «листок календаря» с датами конференции.
   ========================================================================== */

:root {
  color-scheme: light;

  --ground: #eef1ee;
  --surface: #ffffff;
  --surface-2: #f5f7f5;
  --surface-3: #e9eeea;
  --line: #dce3de;
  --line-strong: #c2ccc5;

  --ink: #1b2420;
  --ink-soft: #3c4843;
  --muted: #66716c;
  --faint: #8d9792;

  --pine: #1f4d3f;
  --pine-hover: #163b30;
  --pine-tint: #e2ede7;
  --pine-tint-2: #cfe1d7;
  --night: #12201b;
  --night-2: #1b2d26;

  --gold: #b8892c;
  --gold-soft: #f6ecd6;
  --gold-ink: #7a5710;

  --danger: #a3322c;
  --danger-hover: #82241f;
  --danger-soft: #fbeceb;

  --font-display: "Literata", "PT Serif", Georgia, "Times New Roman", serif;
  --font-body: "Golos Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --radius-sm: 0.5rem;
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 1px 2px rgb(18 32 27 / 6%);
  --shadow: 0 1px 2px rgb(18 32 27 / 5%), 0 8px 24px -12px rgb(18 32 27 / 14%);
  --ring: 0 0 0 3px rgb(184 137 44 / 45%);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

[hidden] {
  display: none !important;
}

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--ground);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

img {
  max-width: 100%;
}

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

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h3,
h4 {
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.3;
}

svg {
  flex: 0 0 auto;
}

:where(button, .button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
  letter-spacing: -0.01em;
}

.eyebrow {
  margin-bottom: 0.5rem;
  color: var(--gold-ink);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lead {
  max-width: 44rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.55;
}

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

.count {
  display: inline-grid;
  min-width: 1.9em;
  padding: 0.1em 0.5em;
  place-items: center;
  border-radius: 999px;
  color: var(--pine);
  background: var(--pine-tint);
  font-family: var(--font-body);
  font-size: 0.5em;
  font-weight: 650;
  letter-spacing: 0;
  vertical-align: 0.35em;
}

.card__title .count {
  font-size: 0.65em;
  vertical-align: 0.15em;
}

.count:empty {
  display: none;
}

.role-pill {
  display: inline-flex;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  color: var(--gold-ink);
  background: var(--gold-soft);
  font-size: 0.85rem;
  font-weight: 600;
  vertical-align: 0.05em;
}

/* ---------- Buttons ---------- */

.button,
button {
  display: inline-flex;
  min-height: 2.6rem;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--pine);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease), box-shadow 140ms var(--ease);
}

.button svg,
button svg {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button:hover,
button:hover:not(:disabled) {
  background: var(--pine-hover);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button--ghost,
button.button--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.button--ghost:hover,
button.button--ghost:hover:not(:disabled) {
  border-color: var(--pine);
  color: var(--pine);
  background: var(--surface);
}

.button--quiet,
button.button--quiet {
  color: var(--muted);
  background: transparent;
}

.button--quiet:hover {
  color: var(--ink);
  background: var(--surface-3);
}

.button--danger,
button.button--danger {
  background: var(--danger);
}

.button--danger:hover,
button.button--danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

.button--sm {
  min-height: 2.2rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.button--block {
  width: 100%;
}

.icon-button,
button.icon-button {
  width: 2.1rem;
  min-height: 2.1rem;
  padding: 0;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
}

.icon-button:hover:not(:disabled),
button.icon-button:hover:not(:disabled) {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

.icon-button--danger:hover:not(:disabled),
button.icon-button--danger:hover:not(:disabled) {
  border-color: #efc7c4;
  color: var(--danger);
  background: var(--danger-soft);
}

.icon-button:disabled {
  opacity: 0.3;
}

/* ---------- Form controls ---------- */

label,
.label {
  display: inline-block;
  color: var(--ink);
  font-size: 0.87rem;
  font-weight: 600;
}

.label--sub {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.req {
  color: var(--gold);
}

.optional {
  margin-left: 0.35rem;
  color: var(--faint);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  vertical-align: 0.12em;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 2.6rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: inset 0 1px 1px rgb(18 32 27 / 3%);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover,
select:hover,
textarea:hover {
  border-color: #aab6ae;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus,
textarea:focus {
  border-color: var(--pine);
  outline: none;
  box-shadow: 0 0 0 3px rgb(31 77 63 / 16%);
}

input:disabled,
select:disabled,
textarea:disabled {
  color: var(--faint);
  background: var(--surface-2);
  cursor: not-allowed;
}

textarea {
  min-height: 6rem;
  line-height: 1.5;
  resize: vertical;
}

select {
  appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366716c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1.1rem;
}

input[type="checkbox"]:not([role="switch"]),
input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--pine);
}

.form-stack {
  display: grid;
  gap: 1.35rem;
}

.field {
  display: grid;
  min-width: 0;
  gap: 0.4rem;
  align-content: start;
}

.field__label-row {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
}

.counter {
  color: var(--faint);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.counter.is-near {
  color: var(--gold-ink);
}

.input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}

.input-group:focus-within {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgb(31 77 63 / 16%);
}

.input-group__prefix {
  display: grid;
  padding: 0 0.1rem 0 0.8rem;
  place-items: center;
  color: var(--faint);
  font-family: var(--font-mono);
}

.input-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  flex: 1 1 auto;
  border: 0;
  padding-left: 0.2rem;
  background: transparent;
  box-shadow: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.input-group input:focus {
  box-shadow: none !important;
}

.input-group .button {
  margin: 0.2rem;
  white-space: nowrap;
  box-shadow: none;
}

/* Switch */

.switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.switch input[role="switch"] {
  appearance: none;
  position: relative;
  width: 2.5rem;
  height: 1.45rem;
  flex: 0 0 auto;
  margin: 0;
  border-radius: 999px;
  background: #b6c0ba;
  cursor: pointer;
  transition: background-color 160ms var(--ease);
}

.switch input[role="switch"]::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(1.45rem - 6px);
  height: calc(1.45rem - 6px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(18 32 27 / 30%);
  content: "";
  transition: transform 160ms var(--ease);
}

.switch input[role="switch"]:checked {
  background: var(--pine);
}

.switch input[role="switch"]:checked::before {
  transform: translateX(1.05rem);
}

.switch input[role="switch"]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.switch--sm {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.switch--sm input[role="switch"] {
  width: 2.1rem;
  height: 1.2rem;
}

.switch--sm input[role="switch"]::before {
  width: calc(1.2rem - 6px);
  height: calc(1.2rem - 6px);
}

.switch--sm input[role="switch"]:checked::before {
  transform: translateX(0.9rem);
}

/* Notices */

.notice {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.45;
}

.notice--error {
  border-color: #efc7c4;
  color: var(--danger-hover);
  background: var(--danger-soft);
}

/* ---------- Brand ---------- */

.brand {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border-radius: 0.6rem;
  color: var(--night);
  background: var(--gold);
}

.brand-text {
  display: grid;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.1;
}

.brand-text small {
  margin-top: 0.15rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  opacity: 0.6;
}

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

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

.app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 2rem;
  padding: 1.4rem 0.9rem 1rem;
  color: #dfe8e3;
  background: var(--night);
}

.app-sidebar .brand {
  padding: 0 0.45rem;
  color: #fff;
}

.sidebar-nav {
  display: grid;
  gap: 0.15rem;
}

.sidebar-nav a,
.sidebar-logout button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 2.5rem;
  gap: 0.7rem;
  align-items: center;
  justify-content: flex-start;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-radius: var(--radius-sm);
  color: #b5c4bc;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}

.sidebar-nav svg,
.sidebar-logout svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-nav a:hover,
.sidebar-logout button:hover:not(:disabled) {
  color: #fff;
  background: var(--night-2);
}

.sidebar-nav a[aria-current="page"] {
  color: #fff;
  background: var(--night-2);
}

.sidebar-nav a[aria-current="page"]::before {
  position: absolute;
  top: 0.55rem;
  bottom: 0.55rem;
  left: -0.9rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
  content: "";
}

.sidebar-nav a[aria-current="page"] svg {
  color: var(--gold);
}

.sidebar-logout {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgb(255 255 255 / 8%);
}

.app-main {
  min-width: 0;
  padding: clamp(1.25rem, 3.5vw, 2.75rem) clamp(1rem, 3.5vw, 3rem) 4rem;
}

.page-shell {
  width: min(100%, 60rem);
  margin: 0 auto;
}

.page-shell--wide {
  width: min(100%, 74rem);
}

.page-shell--narrow {
  width: min(100%, 36rem);
}

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

.page-header__copy {
  display: grid;
  min-width: 0;
  gap: 0.35rem;
}

.page-header .lead {
  margin-top: 0.35rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
  color: var(--faint);
  font-size: 0.82rem;
}

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

.breadcrumb a:hover {
  color: var(--pine);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---------- Cards ---------- */

.card,
.auth-card {
  min-width: 0;
  padding: clamp(1.1rem, 2.6vw, 1.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card--compact {
  padding: 1.1rem 1.2rem;
}

.card__title {
  margin-bottom: 1rem;
}

.card__title--sm {
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 1.5rem;
}

.card-actions form {
  display: contents;
}

.facts {
  display: grid;
  margin: 0 0 1rem;
}

.facts > div {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.facts > div:first-child {
  padding-top: 0;
}

dt {
  color: var(--muted);
  font-size: 0.85rem;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
  text-align: right;
}

/* ---------- Auth ---------- */

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  background:
    radial-gradient(60rem 30rem at 100% 0%, rgb(31 77 63 / 9%), transparent 70%),
    var(--ground);
}

.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
  width: min(100%, 52rem);
  overflow: hidden;
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: 0 30px 60px -30px rgb(18 32 27 / 35%);
}

.auth-aside {
  position: relative;
  display: flex;
  min-height: 26rem;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem;
  overflow: hidden;
  color: #dfe8e3;
  background: var(--night);
}

.auth-aside::after {
  position: absolute;
  right: -3.5rem;
  bottom: -3.5rem;
  width: 14rem;
  height: 14rem;
  border: 1px solid rgb(184 137 44 / 35%);
  border-radius: 50%;
  box-shadow: 0 0 0 2.25rem rgb(184 137 44 / 6%), 0 0 0 4.5rem rgb(184 137 44 / 4%);
  content: "";
}

.auth-aside .brand {
  color: #fff;
}

.auth-aside__quote {
  position: relative;
  z-index: 1;
  max-width: 17rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.35;
  color: #fff;
}

.auth-split .auth-card {
  display: grid;
  align-content: center;
  gap: 0.5rem;
  padding: clamp(1.5rem, 5vw, 2.75rem);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.auth-card .form-stack {
  margin-top: 1.25rem;
  gap: 1rem;
}

.auth-card .notice {
  margin-top: 1rem;
}

.auth-card .lead {
  font-size: 0.95rem;
}

.auth-single {
  display: grid;
  width: min(100%, 30rem);
  gap: 1.25rem;
}

.auth-single > .brand {
  justify-self: center;
}

.auth-single__title {
  text-align: center;
}

.card--notice {
  display: grid;
  gap: 0.75rem;
  justify-items: start;
}

.card--notice h1 {
  font-size: 1.5rem;
}

.card--notice .lead {
  font-size: 0.97rem;
}

.card__badge {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: var(--radius);
  color: var(--gold-ink);
  background: var(--gold-soft);
}

.card__badge svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card--notice .card-actions {
  margin-top: 0.75rem;
}

/* ---------- Home ---------- */

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

.launch-tile {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  min-height: 11rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease);
}

.launch-tile:hover {
  border-color: var(--pine-tint-2);
  box-shadow: 0 1px 2px rgb(18 32 27 / 5%), 0 16px 32px -16px rgb(18 32 27 / 24%);
  transform: translateY(-2px);
}

.launch-tile__icon {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1.25rem;
  place-items: center;
  border-radius: var(--radius);
  color: var(--pine);
  background: var(--pine-tint);
}

.launch-tile__icon svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.launch-tile__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.launch-tile__text {
  color: var(--muted);
  font-size: 0.87rem;
}

.launch-tile--primary {
  border-color: var(--pine);
  color: #fff;
  background: var(--pine);
}

.launch-tile--primary:hover {
  border-color: var(--pine-hover);
  background: var(--pine-hover);
}

.launch-tile--primary .launch-tile__icon {
  color: var(--night);
  background: var(--gold);
}

.launch-tile--primary .launch-tile__text {
  color: #c7d8cf;
}

/* ---------- Date leaf (signature) ---------- */

.date-leaf {
  display: grid;
  grid-template-rows: auto 1fr;
  width: 3.6rem;
  min-height: 3.9rem;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 0.55rem;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line), 0 2px 0 -1px var(--surface), 0 3px 0 -1px var(--line);
  text-align: center;
}

.date-leaf__month {
  padding: 0.15rem 0.2rem 0.12rem;
  color: #fff;
  background: var(--pine);
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.date-leaf__day {
  display: grid;
  place-items: center;
  padding: 0.1rem 0.15rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: lining-nums;
  line-height: 1;
  letter-spacing: -0.03em;
}

.date-leaf__day.is-range {
  font-size: 1rem;
}

.date-leaf__month.is-split {
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.date-leaf.is-past .date-leaf__month {
  background: #8d9792;
}

.date-leaf.is-past .date-leaf__day {
  color: var(--muted);
}

.date-leaf.is-live .date-leaf__month {
  color: var(--night);
  background: var(--gold);
}

.date-leaf--lg {
  width: 4.6rem;
  min-height: 5rem;
}

.date-leaf--lg .date-leaf__month {
  font-size: 0.7rem;
}

.date-leaf--lg .date-leaf__day {
  font-size: 1.8rem;
}

.date-leaf--lg .date-leaf__month.is-split {
  font-size: 0.62rem;
}

.date-leaf--lg .date-leaf__day.is-range {
  font-size: 1.3rem;
}

.date-leaf--blank .date-leaf__day {
  color: var(--faint);
}

/* Status */

.status {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.4rem;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-3);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.status:empty {
  display: none;
}

.status::before {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status--upcoming {
  color: var(--pine);
  background: var(--pine-tint);
}

.status--live {
  color: var(--gold-ink);
  background: var(--gold-soft);
}

.status--live::before {
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

/* ---------- Conference list ---------- */

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.search {
  position: relative;
  display: block;
  flex: 1 1 16rem;
  max-width: 24rem;
}

.search svg {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: var(--faint);
  stroke-width: 2;
  stroke-linecap: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.search input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  padding-left: 2.3rem;
}

.segmented {
  display: inline-flex;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--surface-3);
}

.segmented button {
  min-height: 2rem;
  padding: 0.3rem 0.8rem;
  border-radius: 0.45rem;
  color: var(--muted);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 550;
}

.segmented button:hover:not(:disabled) {
  color: var(--ink);
  background: transparent;
}

.segmented button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.conf-list {
  display: grid;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  list-style: none;
}

.conf-row {
  position: relative;
  display: flex;
  gap: 1.1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  transition: background-color 140ms var(--ease);
}

.conf-row + .conf-row {
  border-top: 1px solid var(--line);
}

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

.conf-row__body {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 0.2rem;
}

.conf-row__title {
  font-size: 1.08rem;
}

.conf-row__title a {
  text-decoration: none;
}

.conf-row__title a::after {
  position: absolute;
  inset: 0;
  content: "";
}

.conf-row__title a:focus-visible {
  outline: none;
}

.conf-row:has(a:focus-visible) {
  background: var(--surface-2);
  box-shadow: inset 3px 0 0 var(--gold);
}

.conf-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.conf-row__meta .mono {
  color: var(--faint);
}

.conf-row__chevron {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: var(--faint);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms var(--ease), stroke 160ms var(--ease);
}

.conf-row:hover .conf-row__chevron {
  stroke: var(--pine);
  transform: translateX(3px);
}

.empty-filter {
  padding: 2rem 1rem;
  text-align: center;
}

.empty {
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  padding: clamp(2.5rem, 7vw, 4.5rem) 1.5rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty .date-leaf {
  margin-bottom: 0.75rem;
  transform: rotate(-4deg);
}

.empty .hint {
  max-width: 26rem;
  margin-bottom: 0.75rem;
}

/* ---------- Detail ---------- */

.detail-title {
  display: flex;
  gap: 1.1rem;
  align-items: center;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  align-items: center;
  margin-top: 0.45rem;
  color: var(--ink-soft);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18rem;
  gap: 1.25rem;
  align-items: start;
}

.detail-main {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.detail-aside {
  position: sticky;
  top: 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.cover {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-3);
  aspect-ratio: 16 / 7;
  box-shadow: var(--shadow);
}

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

.prose {
  max-width: 44rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  white-space: pre-wrap;
}

.summary {
  display: grid;
  margin: 0;
}

.summary > div {
  display: grid;
  gap: 0.1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
}

.summary > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.summary dt {
  font-size: 0.78rem;
}

.summary dd {
  font-weight: 550;
  text-align: left;
}

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

.speaker-card {
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  text-align: center;
}

.speaker-card h3 {
  font-size: 0.92rem;
  font-weight: 600;
}

.speaker-card .speaker-photo {
  width: 6rem;
  height: 6rem;
  border: 3px solid var(--surface);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line);
}

/* Registration summary on the detail page */

#detail-form-settings {
  display: grid;
  gap: 1rem;
}

.form-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.form-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.form-table th,
.form-table td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  vertical-align: top;
}

.form-table thead th {
  color: var(--muted);
  background: var(--surface-2);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-table tbody tr + tr td {
  border-top: 1px solid var(--line);
}

.form-table__num {
  width: 2.5rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.form-table__name {
  font-weight: 600;
}

.form-table .settings-condition {
  margin-top: 0.3rem;
  color: var(--gold-ink);
  font-size: 0.8rem;
  font-weight: 500;
}

.tag {
  display: inline-flex;
  padding: 0.1rem 0.5rem;
  border-radius: 0.35rem;
  color: var(--ink-soft);
  background: var(--surface-3);
  font-size: 0.78rem;
  font-weight: 550;
  white-space: nowrap;
}

.tag--req {
  color: var(--pine);
  background: var(--pine-tint);
}

.detail-option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.detail-option-list li {
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.donation-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.donation-chips strong {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  color: var(--gold-ink);
  background: var(--gold-soft);
  font-variant-numeric: tabular-nums;
}

.skeleton {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton--cover {
  aspect-ratio: 16 / 7;
}

.skeleton--aside {
  height: 18rem;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- Editor ---------- */

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16.5rem;
  gap: 1.25rem;
  align-items: start;
}

.editor__main {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.editor__aside {
  position: sticky;
  top: 1.5rem;
}

.editor-section {
  scroll-margin-top: 1.5rem;
}

.editor-section__head,
.builder-block__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: flex-start;
  justify-content: space-between;
}

.editor-section__head {
  margin: calc(-1 * clamp(1.1rem, 2.6vw, 1.6rem)) calc(-1 * clamp(1.1rem, 2.6vw, 1.6rem)) 1.35rem;
  padding: clamp(1.1rem, 2.6vw, 1.6rem);
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.editor-section__head > div,
.builder-block__head > div {
  display: grid;
  min-width: 0;
  flex: 1 1 16rem;
  gap: 0.2rem;
}

.editor-section__head .switch {
  margin-top: 0.2rem;
}

/* Dropzone */

.dropzone {
  position: relative;
  display: grid;
  min-height: 11rem;
  overflow: hidden;
  place-items: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease);
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--pine);
  background: var(--pine-tint);
}

.dropzone:focus-within {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgb(31 77 63 / 16%);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone__empty {
  display: grid;
  gap: 0.15rem;
  justify-items: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.dropzone__empty svg {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.4rem;
  fill: none;
  stroke: var(--pine);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dropzone__empty strong {
  color: var(--ink);
  font-weight: 600;
}

.dropzone__preview {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

.dropzone__replace {
  display: none;
}

.dropzone:has(.dropzone__preview:not([hidden])) {
  border-style: solid;
  place-items: stretch;
}

.dropzone:has(.dropzone__preview:not([hidden])) .dropzone__empty {
  display: none;
}

.dropzone:has(.dropzone__preview:not([hidden])) .dropzone__replace {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: inline-flex;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  color: #fff;
  background: rgb(18 32 27 / 72%);
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* Date range */

.date-range {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.date-range legend {
  margin-bottom: 0.4rem;
  padding: 0;
}

.date-range__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: end;
  max-width: 30rem;
}

.date-range__dash {
  padding-bottom: 0.6rem;
  color: var(--faint);
}

/* Speakers */

.speaker-list {
  display: grid;
  gap: 0.6rem;
}

.speaker-list:not(:empty) + .list-empty {
  display: none;
}

.list-empty {
  padding: 1.1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.87rem;
  text-align: center;
}

#form-builder:not([hidden]) + .list-empty--form {
  display: none;
}

.speaker-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  animation: row-in 220ms var(--ease);
}

.speaker-avatar {
  position: relative;
  display: grid;
  width: 3.75rem;
  height: 3.75rem;
  flex: 0 0 auto;
  overflow: hidden;
  place-items: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: 50%;
  color: var(--faint);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 140ms var(--ease), color 140ms var(--ease);
}

.speaker-avatar:hover,
.speaker-avatar:focus-within {
  border-color: var(--pine);
  color: var(--pine);
}

.speaker-avatar:focus-within {
  box-shadow: 0 0 0 3px rgb(31 77 63 / 16%);
}

.speaker-avatar svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.speaker-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.speaker-avatar.has-photo {
  border-style: solid;
  border-color: var(--line);
}

.speaker-avatar input[type="file"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  cursor: pointer;
}

.speaker-row__fields {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 0.25rem;
}

.speaker-row__file {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Field builder */

.builder-block + .builder-block {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.builder-block__head {
  margin-bottom: 1rem;
}

.field-editor-list {
  display: grid;
  gap: 0.6rem;
  counter-reset: field;
}

.field-editor {
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  animation: row-in 220ms var(--ease);
}

.field-editor__head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0.5rem 0.5rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.field-editor__index {
  display: grid;
  width: 1.6rem;
  height: 1.6rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0.4rem;
  color: var(--pine);
  background: var(--pine-tint);
  font-size: 0.78rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.field-editor__title {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  gap: 0.5rem;
  align-items: center;
}

.field-editor__title strong {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-editor__title .tag {
  flex: 0 0 auto;
}

.field-editor__tools {
  display: flex;
  flex: 0 0 auto;
  gap: 0.1rem;
}

.field-editor__body {
  display: grid;
  gap: 0.9rem;
  padding: 0.9rem 0.85rem 1rem;
}

.field-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.field-editor-grid .switch {
  min-height: 2.6rem;
}

/* ---------- Feature cards: icon picker and preview ---------- */

.icon-trigger,
button.icon-trigger {
  width: 100%;
  justify-content: flex-start;
  gap: 0.65rem;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface);
  font-weight: 500;
  text-align: left;
}

button.icon-trigger:hover:not(:disabled),
button.icon-trigger[aria-expanded="true"] {
  border-color: var(--pine);
  background: var(--surface);
}

.icon-trigger__glyph {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0.4rem;
  color: var(--pine);
  background: var(--pine-tint);
  font-weight: 700;
}

.icon-trigger .icon-trigger__glyph svg {
  width: 1.25rem;
  height: 1.25rem;
}

.icon-trigger__name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-trigger__action {
  flex: 0 0 auto;
  color: var(--pine);
  font-size: 0.82rem;
  font-weight: 600;
}

.icon-trigger.is-empty .icon-trigger__name {
  color: var(--faint);
  font-family: var(--font-body);
}

.icon-trigger.is-unknown .icon-trigger__glyph {
  color: var(--danger);
  background: var(--danger-soft);
}

.icon-picker {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

.icon-picker__head {
  display: flex;
  gap: 0.5rem;
}

.icon-picker__status {
  margin: 0;
}

.icon-picker__grid {
  display: grid;
  max-height: 20rem;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  grid-auto-rows: 4.4rem;
  align-content: start;
  gap: 0.35rem;
  padding: 0.15rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.icon-picker__item,
button.icon-picker__item {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  gap: 0.3rem;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.3rem;
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
  font-weight: 400;
}

button.icon-picker__item:hover:not(:disabled) {
  border-color: var(--pine);
  color: var(--pine);
  background: var(--surface);
}

button.icon-picker__item[aria-pressed="true"] {
  border-color: var(--pine);
  color: #fff;
  background: var(--pine);
}

.icon-picker__item svg {
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
}

.icon-picker__name {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feature-preview {
  display: grid;
  gap: 0.5rem;
  margin: 0.25rem 0 1rem;
  padding: 0.9rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.feature-preview__label {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feature-preview__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem;
}

.feature-preview__card {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 0.45rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.feature-preview__icon {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 50%;
  color: var(--pine);
  background: var(--pine-tint);
}

.feature-preview__icon svg {
  width: 1.4rem;
  height: 1.4rem;
}

.feature-preview__title {
  font-family: var(--font-display);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.feature-preview__text {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.feature-preview__card.is-placeholder .feature-preview__title,
.feature-preview__card.is-placeholder .feature-preview__text {
  color: var(--faint);
}

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

.condition-editor:empty {
  display: none;
}

.condition-editor {
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line);
}

.condition-editor > .hint {
  font-size: 0.8rem;
}

.condition-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.6rem;
  align-items: end;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--gold-soft);
}

.condition-controls__word {
  padding-bottom: 0.65rem;
  color: var(--gold-ink);
  font-size: 0.82rem;
  font-weight: 650;
}

.condition-controls .field label {
  color: var(--gold-ink);
  font-size: 0.75rem;
  font-weight: 550;
}

.condition-value-wrap {
  min-width: 0;
}

.add-row,
button.add-row {
  width: 100%;
  margin-top: 0.6rem;
  border: 1.5px dashed var(--line-strong);
  color: var(--pine);
  background: transparent;
}

.add-row:hover:not(:disabled),
button.add-row:hover:not(:disabled) {
  border-color: var(--pine);
  background: var(--pine-tint);
}

.donation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 10rem));
  gap: 0.75rem;
}

/* Editor side panel */

.editor-panel {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.editor-panel__label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.outline {
  position: relative;
  display: grid;
  gap: 0.1rem;
  margin: -0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.outline a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.5rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  text-decoration: none;
}

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

.outline__dot {
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}

.outline li.is-done .outline__dot {
  border-color: var(--pine);
  background: var(--pine);
}

.outline li.is-partial .outline__dot {
  border-color: var(--gold);
  background: linear-gradient(90deg, var(--gold) 50%, transparent 50%);
}

.outline__name {
  font-weight: 550;
}

.outline__state {
  color: var(--faint);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.editor-submit {
  display: grid;
  gap: 0.4rem;
}

.editor-submit button[type="submit"] {
  min-height: 2.9rem;
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 68rem) {
  .editor,
  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-aside {
    position: static;
    order: -1;
  }

  .detail-aside .button {
    display: none;
  }

  .summary {
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0 1.25rem;
  }

  .summary > div:first-child {
    padding-top: 0.6rem;
    border-top: 1px solid var(--line);
  }

  .editor__aside {
    position: sticky;
    top: auto;
    bottom: 0;
    z-index: 5;
    margin: 0 calc(-1 * clamp(1rem, 3.5vw, 3rem)) -4rem;
  }

  .editor-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 0.75rem clamp(1rem, 3.5vw, 3rem) max(0.75rem, env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 0;
    box-shadow: 0 -8px 24px -12px rgb(18 32 27 / 20%);
  }

  .editor-panel__label {
    display: none;
  }

  .outline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin: 0;
  }

  .outline a {
    padding: 0.25rem 0.2rem;
    font-size: 0.82rem;
  }

  .outline__state {
    display: none;
  }

  .editor-panel .notice {
    grid-column: 1 / -1;
    order: -1;
  }

  .editor-submit {
    display: flex;
  }

  .editor-submit .button--quiet {
    display: none;
  }

  .editor-submit button[type="submit"] {
    width: auto;
    min-height: 2.6rem;
  }
}

@media (max-width: 52rem) {
  .app-frame {
    display: block;
  }

  .app-sidebar {
    position: sticky;
    z-index: 10;
    height: auto;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    padding: max(0.6rem, env(safe-area-inset-top)) 0.75rem 0.6rem;
  }

  .app-sidebar .brand-text {
    display: none;
  }

  .app-sidebar .brand {
    padding: 0;
  }

  .sidebar-nav {
    display: flex;
    flex: 1 1 auto;
    gap: 0.1rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar-nav a,
  .sidebar-logout button {
    width: auto;
    min-height: 2.3rem;
    padding: 0.4rem 0.6rem;
    white-space: nowrap;
  }

  .sidebar-nav a[aria-current="page"]::before {
    display: none;
  }

  .sidebar-logout {
    margin: 0;
    padding: 0 0 0 0.5rem;
    border-top: 0;
    border-left: 1px solid rgb(255 255 255 / 10%);
  }

  .sidebar-logout span {
    display: none;
  }

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

  .launch-tile {
    min-height: 0;
  }

  .launch-tile__icon {
    margin-bottom: 0.5rem;
  }

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

  .auth-aside {
    min-height: 0;
    padding: 1.5rem;
  }

  .auth-aside__quote {
    font-size: 1.05rem;
  }

  .editor__aside {
    margin-bottom: -4rem;
  }

  .editor-section__head {
    margin: -1.1rem -1.1rem 1.2rem;
    padding: 1.1rem;
  }
}

@media (max-width: 40rem) {
  .sidebar-nav span {
    display: none;
  }

  .sidebar-nav a[aria-current="page"] span {
    display: inline;
  }

  .page-header {
    align-items: stretch;
  }

  .page-header > .button {
    width: 100%;
  }

  .conf-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "leaf body" "leaf status";
    gap: 0.4rem 0.85rem;
    align-items: start;
    padding: 0.9rem 1rem;
  }

  .conf-row .date-leaf {
    grid-area: leaf;
  }

  .conf-row__body {
    grid-area: body;
  }

  .conf-row .status {
    grid-area: status;
    justify-self: start;
  }

  .conf-row__chevron {
    display: none;
  }

  .conf-row__meta .mono {
    overflow-wrap: anywhere;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1 1 0;
  }

  .search {
    max-width: none;
  }

  .detail-title {
    align-items: flex-start;
  }

  .date-leaf--lg {
    width: 3.6rem;
    min-height: 3.9rem;
  }

  .date-leaf--lg .date-leaf__day {
    font-size: 1.35rem;
  }

  .date-leaf--lg .date-leaf__day.is-range {
    font-size: 1rem;
  }

  .date-leaf--lg .date-leaf__month.is-split {
    font-size: 0.55rem;
  }

  .field-editor-grid,
  .condition-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .condition-controls__word {
    padding: 0;
  }

  .field-editor__title .tag {
    display: none;
  }

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

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

  .date-range__dash {
    display: none;
  }

  .outline {
    display: none;
  }

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

  .editor-submit button[type="submit"] {
    width: 100%;
  }

  .facts > div {
    display: grid;
    gap: 0.2rem;
  }

  dd {
    text-align: left;
  }
}

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

html:focus-within {
  scroll-behavior: smooth;
}

/* ==========================================================================
   Заявки, пользователи, диалоги
   ========================================================================== */

.page-header--detail {
  align-items: center;
}

.notice--gold {
  border-color: #ead7a8;
  color: var(--gold-ink);
  background: var(--gold-soft);
}

.page-shell > .notice {
  margin-bottom: 1rem;
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line-strong);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs [role="tab"] {
  position: relative;
  min-height: 2.75rem;
  margin-bottom: -1px;
  padding: 0.55rem 0.9rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

.tabs [role="tab"]:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-3);
}

.tabs [role="tab"][aria-selected="true"] {
  border-bottom-color: var(--gold);
  color: var(--ink);
}

.tabs [role="tab"] .count {
  font-size: 0.72em;
  vertical-align: 0.1em;
}

.tabs [role="tab"][aria-selected="false"] .count {
  color: var(--muted);
  background: var(--surface-3);
}

/* ---------- Statistics ---------- */

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

.stat {
  display: grid;
  align-content: start;
  gap: 0.25rem;
  padding: 1rem 1.15rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat__label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.stat__value {
  color: var(--pine);
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.stat__note {
  color: var(--faint);
  font-size: 0.8rem;
}

.stat--gold {
  border-color: #ead7a8;
  background: linear-gradient(180deg, #fffaf0, var(--surface) 70%);
}

.stat--gold .stat__value {
  color: var(--gold-ink);
}

.stat--quiet .stat__value {
  color: var(--ink-soft);
}

.stat__bar {
  display: block;
  height: 0.3rem;
  margin: 0.35rem 0 0.1rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--gold-soft);
}

.stat__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 600ms var(--ease);
}

.stats-note {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  margin: 0.75rem 0 1.5rem;
}

.stats-note svg {
  width: 1rem;
  height: 1rem;
  margin-top: 0.1rem;
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---------- Applications table ---------- */

.pager-info {
  font-variant-numeric: tabular-nums;
}

.apps-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: opacity 160ms var(--ease);
}

.apps-table-wrap.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

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

.apps-table th,
.apps-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: middle;
}

.apps-table thead th {
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.apps-row {
  cursor: pointer;
  transition: background-color 120ms var(--ease);
}

.apps-row + .apps-row td {
  border-top: 1px solid var(--line);
}

.apps-row:hover {
  background: #f7faf8;
}

.apps-row td {
  color: var(--ink-soft);
}

.apps-table .col-person {
  min-width: 13rem;
}

.apps-table .col-extra {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apps-table .col-date {
  width: 1%;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.apps-table .col-status {
  width: 1%;
  text-align: right;
}

.apps-table th.col-status {
  text-align: right;
}

.row-link,
button.row-link {
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: none;
  font-size: 0.95rem;
  font-weight: 650;
  text-align: left;
}

button.row-link:hover:not(:disabled) {
  color: var(--pine);
  background: none;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.apps-row__sub {
  display: block;
  margin-top: 0.1rem;
  color: var(--faint);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.col-date .apps-row__sub {
  margin-top: 0;
}

.status--submitted {
  color: var(--pine);
  background: var(--pine-tint);
}

.status--donated {
  color: var(--gold-ink);
  background: var(--gold-soft);
}

.apps-message {
  padding: 2.5rem 1rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}

.apps-message h3 {
  margin-bottom: 0.3rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

#apps-error {
  margin-top: 1rem;
}

/* ---------- Payment ledger ---------- */

.payment-ledger {
  margin-top: 1.5rem;
}

.payment-ledger__head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.payment-ledger__head .card__title {
  margin-bottom: 0.3rem;
}

.payment-ledger__head .pager-info {
  flex: 0 0 auto;
  margin-top: 0.25rem;
  text-align: right;
}

.payment-ledger > .notice {
  margin-bottom: 1rem;
}

.payment-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.payment-totals-note {
  margin: -0.35rem 0 1rem;
}

.payment-totals > div {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.payment-totals span,
.payment-totals small {
  color: var(--muted);
  font-size: 0.76rem;
}

.payment-totals strong {
  color: var(--pine);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-variant-numeric: lining-nums tabular-nums;
}

.payment-table .payment-invoice,
.payment-table .payment-amount,
.payment-table .payment-fee,
.payment-table .payment-date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.payment-table .payment-invoice {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.payment-table .payment-amount,
.payment-table .payment-fee {
  color: var(--ink-soft);
}

.payment-table .payment-actions {
  width: 1%;
  white-space: nowrap;
}

.payment-action-list {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
}

.payment-action-list .button {
  white-space: nowrap;
}

.payment-status--initializing {
  color: var(--gold-ink);
  background: var(--gold-soft);
}

.payment-status--pending {
  color: var(--pine);
  background: var(--pine-tint);
}

.payment-status--paid {
  color: var(--pine);
  background: var(--pine-tint-2);
}

.payment-status--initialization_failed {
  color: var(--danger);
  background: var(--danger-soft);
}

.payment-test {
  margin-top: 0.3rem;
  color: var(--gold-ink);
  background: var(--gold-soft);
}

.payment-events {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.payment-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 1rem;
  padding: 0.8rem 0;
}

.payment-event + .payment-event {
  border-top: 1px solid var(--line);
}

.payment-event__name {
  color: var(--ink);
  font-weight: 600;
}

.payment-event__outcome {
  color: var(--muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.payment-event__details {
  grid-column: 1 / -1;
  color: var(--faint);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.payment-event time {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--faint);
  font-size: 0.8rem;
  text-align: right;
  white-space: nowrap;
}

.pager {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
}

.pager__page {
  min-width: 9rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- Dialogs: side sheet and centred modal ---------- */

dialog {
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: var(--surface);
}

dialog::backdrop {
  background: rgb(18 32 27 / 45%);
  backdrop-filter: blur(2px);
}

.sheet[open] {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(100%, 34rem);
  height: 100%;
  margin: 0;
  box-shadow: -20px 0 50px -20px rgb(18 32 27 / 35%);
  animation: sheet-in 260ms var(--ease);
}

.modal[open] {
  width: min(calc(100% - 2rem), 34rem);
  max-height: min(calc(100% - 2rem), 46rem);
  margin: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px -30px rgb(18 32 27 / 45%);
  animation: modal-in 200ms var(--ease);
}

@keyframes sheet-in {
  from {
    transform: translateX(2.5rem);
    opacity: 0;
  }
}

@keyframes modal-in {
  from {
    transform: translateY(0.75rem) scale(0.98);
    opacity: 0;
  }
}

.sheet__form,
.modal__form {
  display: flex;
  height: 100%;
  max-height: inherit;
  flex-direction: column;
}

.modal[open] .modal__form {
  max-height: min(calc(100vh - 2rem), 46rem);
}

.sheet__head,
.modal__head {
  display: flex;
  flex: 0 0 auto;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.35rem 1.5rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.sheet__head h2,
.modal__head h2 {
  font-size: 1.4rem;
}

.sheet__head .eyebrow,
.modal__head .eyebrow {
  margin-bottom: 0.3rem;
}

.sheet__head .hint {
  margin-top: 0.3rem;
}

.sheet__head .icon-button,
.modal__head .icon-button {
  margin: -0.25rem -0.5rem 0 0;
}

.icon-button svg {
  width: 1.15rem;
  height: 1.15rem;
}

.sheet__body,
.modal__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1.35rem 1.5rem 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet__section {
  margin-top: 1.6rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
}

.sheet__section-title {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sheet__foot,
.modal__foot {
  display: grid;
  flex: 0 0 auto;
  gap: 0.75rem;
  padding: 0.9rem 1.5rem max(0.9rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.sheet__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.sheet__actions--start {
  justify-content: flex-start;
  margin-top: 0.8rem;
}

.modal__lead {
  margin-bottom: 1rem;
}

.mono-title {
  font-family: var(--font-mono);
  font-size: 1.2rem !important;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.mono-input {
  font-family: var(--font-mono);
}

/* Radio cards: status of an application, role of a new user */

.status-choice,
.role-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.role-choice {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.status-choice legend,
.role-choice legend {
  margin-bottom: 0.5rem;
  padding: 0;
}

.status-choice__option,
.role-choice__option {
  position: relative;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease), box-shadow 140ms var(--ease);
}

.status-choice__option input,
.role-choice__option input {
  margin-top: 0.15rem !important;
}

.status-choice__option span,
.role-choice__option span {
  display: grid;
  gap: 0.1rem;
}

.status-choice__option strong,
.role-choice__option strong {
  font-size: 0.9rem;
  font-weight: 650;
}

.status-choice__option small,
.role-choice__option small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.status-choice__option:hover,
.role-choice__option:hover {
  border-color: var(--pine);
}

.status-choice__option:has(input:checked),
.role-choice__option:has(input:checked) {
  border-color: var(--pine);
  background: var(--pine-tint);
  box-shadow: inset 0 0 0 1px var(--pine);
}

.status-choice__option--gold input {
  accent-color: var(--gold);
}

.status-choice__option--gold:hover {
  border-color: var(--gold);
}

.status-choice__option--gold:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.status-choice__option:has(input:focus-visible),
.role-choice__option:has(input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Answer controls inside the editor */

.check-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  min-height: 2.2rem;
  font-weight: 500;
  cursor: pointer;
}

.choice-group {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-group legend {
  margin-bottom: 0.3rem;
  padding: 0;
}

/* ---------- Users ---------- */

.skeleton--list {
  height: 16rem;
}

.user-list {
  display: grid;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  list-style: none;
}

.user-row {
  display: grid;
  grid-template-columns: auto minmax(9rem, 13rem) minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1.1rem;
}

.user-row + .user-row {
  border-top: 1px solid var(--line);
}

.user-row.is-new {
  animation: row-flash 2.4s var(--ease);
}

@keyframes row-flash {
  0%,
  40% {
    background: var(--gold-soft);
  }
}

.user-avatar {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 50%;
  color: var(--pine);
  background: var(--pine-tint);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.user-row--admin .user-avatar {
  color: var(--night);
  background: var(--gold);
}

.user-row.is-blocked .user-avatar {
  color: var(--faint);
  background: var(--surface-3);
}

.user-row.is-blocked .user-row__login {
  color: var(--muted);
}

.user-row.is-blocked .chip-list {
  opacity: 0.6;
}

.user-row__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  align-items: center;
}

.tag--blocked {
  color: var(--danger-hover);
  background: var(--danger-soft);
}

.user-avatar--sm {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  font-size: 0.9rem;
}

.user-row__who {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  justify-items: start;
}

.user-row__login {
  max-width: 100%;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-tag {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.role-tag--admin {
  color: var(--gold-ink);
}

.role-tag--manager {
  color: var(--pine);
}

.user-row__access {
  min-width: 0;
}

.access-note {
  color: var(--faint);
  font-size: 0.85rem;
}

.tag--warn {
  color: var(--gold-ink);
  background: var(--gold-soft);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  max-width: 16rem;
  padding: 0.15rem 0.55rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-2);
  font-size: 0.8rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip a {
  color: inherit;
  text-decoration: none;
}

.chip:has(a:hover) {
  border-color: var(--pine);
  color: var(--pine);
}

.chip--series {
  border-color: var(--pine-tint);
  color: var(--pine);
  background: var(--pine-tint);
}

.access-note--paused {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
}

.chip--more {
  border-style: dashed;
  color: var(--muted);
  background: transparent;
}

.user-row__actions {
  display: flex;
  min-width: 5.5rem;
  justify-content: flex-end;
}

/* Conference picker */

.picker {
  display: grid;
  gap: 0.6rem;
}

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

.picker__tools input {
  flex: 1 1 100%;
}

.picker__summary {
  margin-right: auto;
  font-variant-numeric: tabular-nums;
}

.picker__list {
  display: grid;
  max-height: 20rem;
  margin: 0;
  padding: 0.25rem;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  list-style: none;
}

.picker__item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
}

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

.picker__item.is-checked {
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--pine), var(--shadow-sm);
}

.picker__text {
  display: grid;
  min-width: 0;
}

.picker__text strong {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker__text small {
  color: var(--muted);
  font-size: 0.78rem;
}

.picker__item.is-inherited {
  cursor: default;
  box-shadow: inset 3px 0 0 var(--line-strong);
}

.picker__item.is-blocked .picker__text strong {
  color: var(--muted);
}

.picker__item.is-blocked .user-avatar {
  color: var(--faint);
  background: var(--surface-3);
}

.picker__empty {
  padding: 1rem;
  text-align: center;
}

.date-leaf--xs {
  width: 2.6rem;
  min-height: 2.7rem;
  border-radius: 0.4rem;
  box-shadow: none;
}

.date-leaf--xs .date-leaf__month {
  padding: 0.08rem 0.1rem;
  font-size: 0.5rem;
}

.date-leaf--xs .date-leaf__month.is-split {
  font-size: 0.42rem;
  letter-spacing: 0;
}

.date-leaf--xs .date-leaf__day {
  font-size: 1rem;
}

.date-leaf--xs .date-leaf__day.is-range {
  font-size: 0.72rem;
  letter-spacing: -0.05em;
}

/* Toast */

.toast {
  position: fixed;
  z-index: 50;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  left: 50%;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  color: #fff;
  background: var(--night);
  box-shadow: 0 14px 30px -12px rgb(18 32 27 / 50%);
  font-size: 0.9rem;
  font-weight: 550;
  opacity: 0;
  transform: translate(-50%, 0.75rem);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
  pointer-events: none;
}

.toast::before {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: var(--gold);
  content: "";
  vertical-align: 0.08em;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 68rem) {
  .apps-table .col-extra {
    display: none;
  }
}

@media (max-width: 52rem) {
  .user-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .user-row__access {
    grid-column: 2 / -1;
    grid-row: 2;
  }

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

@media (max-width: 40rem) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat:first-child {
    grid-column: 1 / -1;
  }

  .stat {
    padding: 0.85rem 0.95rem;
  }

  .stat__value {
    font-size: 1.75rem;
  }

  .apps-table thead {
    display: none;
  }

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

  .apps-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "person status" "date date";
    gap: 0.35rem 0.75rem;
    align-items: start;
    padding: 0.8rem 0.95rem;
  }

  .apps-row + .apps-row {
    border-top: 1px solid var(--line);
  }

  .apps-row + .apps-row td {
    border-top: 0;
  }

  .apps-table td {
    display: block;
    padding: 0;
  }

  .apps-table .col-person {
    grid-area: person;
    min-width: 0;
  }

  .apps-table .col-date {
    display: flex;
    width: auto;
    grid-area: date;
    gap: 0.3rem;
    color: var(--faint);
    font-size: 0.8rem;
  }

  .apps-table .col-status {
    grid-area: status;
  }

  .payment-ledger__head {
    display: grid;
    gap: 0.45rem;
  }

  .payment-ledger__head .pager-info {
    margin-top: 0;
    text-align: left;
  }

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

  .payment-table-wrap {
    overflow-x: visible;
  }

  .payment-table .payment-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "invoice status" "application application" "amount fee" "date actions";
    gap: 0.35rem 0.75rem;
    align-items: start;
    padding: 0.8rem 0.95rem;
  }

  .payment-table .payment-row + .payment-row,
  .payment-table .payment-row + .payment-row td {
    border-top: 1px solid var(--line);
  }

  .payment-table .payment-row td {
    display: block;
    padding: 0;
  }

  .payment-table .payment-invoice {
    grid-area: invoice;
  }

  .payment-table .payment-application {
    grid-area: application;
  }

  .payment-table .payment-amount {
    grid-area: amount;
  }

  .payment-table .payment-fee {
    grid-area: fee;
  }

  .payment-table .payment-status-cell {
    grid-area: status;
    text-align: right;
  }

  .payment-table .payment-date {
    grid-area: date;
  }

  .payment-table .payment-actions {
    grid-area: actions;
  }

  .list-toolbar .segmented {
    width: 100%;
  }

  .list-toolbar .segmented button {
    flex: 1 1 0;
    padding-inline: 0.4rem;
  }

  .pager__page {
    min-width: 0;
  }

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

  .sheet__head,
  .modal__head,
  .sheet__body,
  .modal__body {
    padding-inline: 1.1rem;
  }

  .sheet__foot,
  .modal__foot {
    padding-inline: 1.1rem;
  }

  .modal[open] {
    width: 100%;
    max-height: 92vh;
    margin: auto 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .modal[open] .modal__form {
    max-height: 92vh;
  }

  .user-row {
    gap: 0.6rem 0.8rem;
    padding: 0.85rem 0.95rem;
  }

  .user-avatar {
    width: 2.1rem;
    height: 2.1rem;
  }

  .chip {
    max-width: 12rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sheet[open],
  .modal[open],
  .user-row.is-new {
    animation: none;
  }

  .toast,
  .stat__bar span {
    transition: none;
  }
}

/* ---------- Conference editing ---------- */

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.field-warning {
  padding: 0.5rem 0.7rem;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--gold-ink);
  background: var(--gold-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}

.form-locked-note {
  margin-bottom: 1.1rem;
}

.editor.is-loading .editor__main {
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 40rem) {
  .page-header__actions {
    width: 100%;
  }

  .page-header__actions .button {
    flex: 1 1 0;
  }
}

/* ==========================================================================
   Публикация, серии, копии
   Черновик — «неотпечатанный» листок: пунктирный край и штриховка вместо
   сплошной заливки. Тот же приём используется в списке, карточке и серии.
   ========================================================================== */

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

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

/* Draft marks */

.date-leaf.is-draft {
  border-style: dashed;
  background: var(--surface-2);
  box-shadow: none;
}

.date-leaf.is-draft .date-leaf__month {
  color: var(--ink-soft);
  background: repeating-linear-gradient(135deg, var(--surface-3) 0 4px, #dbe2dd 4px 8px);
}

.date-leaf.is-draft .date-leaf__day {
  color: var(--muted);
}

.pub-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0.14rem 0.6rem;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.76rem;
  font-weight: 650;
  white-space: nowrap;
}

.conf-row__badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

.series-mark {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 550;
}

.series-mark::before {
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8892c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='3.5' width='13' height='11' rx='1.8'/%3E%3Cpath d='M4 7.5v10.2A1.8 1.8 0 0 0 5.8 19.5H16'/%3E%3C/svg%3E") center / contain no-repeat;
  content: "";
}

/* Publication bar on the conference card */

.publish-bar {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0.7rem 0.8rem 0.7rem 1.05rem;
  border: 1px solid var(--pine-tint-2);
  border-radius: var(--radius);
  background: var(--pine-tint);
}

.publish-bar__mark {
  width: 0.6rem;
  height: 0.6rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--pine);
  box-shadow: 0 0 0 4px rgb(31 77 63 / 14%);
}

.publish-bar__text {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 0.05rem;
}

.publish-bar__text strong {
  color: var(--pine);
  font-size: 0.92rem;
}

.publish-bar__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.4rem;
}

.publish-bar.is-draft {
  border: 1.5px dashed var(--line-strong);
  background: repeating-linear-gradient(135deg, var(--surface) 0 10px, var(--surface-2) 10px 20px);
}

.publish-bar.is-draft .publish-bar__mark {
  border: 2px dashed var(--muted);
  background: transparent;
  box-shadow: none;
}

.publish-bar.is-draft .publish-bar__text strong {
  color: var(--ink);
}

.summary-previous {
  color: var(--muted);
  font-weight: 500 !important;
  white-space: pre-line;
}

/* Editor: intake and publication */

.intake__deadline {
  display: flex;
  gap: 0.5rem;
  align-items: end;
  max-width: 27rem;
  margin-bottom: 0.4rem;
  transition: opacity 140ms var(--ease);
}

.intake__deadline .field {
  flex: 1 1 auto;
}

.intake__deadline.is-off {
  opacity: 0.5;
}

.dates-past-note {
  max-width: 30rem;
  margin-top: 0.7rem;
}

#section-publish .status-choice {
  max-width: 34rem;
}

#section-publish .field {
  max-width: 34rem;
}

/* New user dialog */

.modal--user[open] {
  width: min(calc(100% - 2rem), 46rem);
}

.modal--user .role-choice__option {
  padding: 0.9rem 1rem;
}

/* Copy dialog */

.modal--wide[open] {
  width: min(calc(100% - 2rem), 38rem);
}

.transfer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.transfer__col {
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--pine-tint-2);
  border-radius: var(--radius);
  background: var(--pine-tint);
}

.transfer__col--no {
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
}

.transfer h3 {
  margin-bottom: 0.45rem;
  color: var(--pine);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.transfer__col--no h3 {
  color: var(--muted);
}

.transfer ul {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.transfer li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.4;
}

.transfer li::before {
  position: absolute;
  left: 0;
  color: var(--pine);
  font-weight: 700;
  content: "✓";
}

.transfer__col--no li {
  color: var(--muted);
}

.transfer__col--no li::before {
  color: var(--faint);
  content: "–";
}

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

.series-lead {
  max-width: 44rem;
}

.series-list {
  display: grid;
  gap: 1rem;
}

.series-card.is-new {
  animation: row-flash 2.4s var(--ease);
}

.series-card__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: flex-start;
  justify-content: space-between;
}

.series-card__titles {
  display: grid;
  min-width: 0;
  flex: 1 1 18rem;
  gap: 0.2rem;
}

.series-card__titles h2 {
  font-size: 1.35rem;
}

.series-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.series-card__no-managers {
  color: var(--gold-ink);
}

.series-card__meta .mono {
  color: var(--faint);
}

.series-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.series-card__description {
  display: -webkit-box;
  max-width: 48rem;
  margin-top: 0.6rem;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.9rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.series-card__empty {
  margin-top: 0.25rem;
}

/* The rail: occurrences as a row of calendar leaves joined by a thread. */

.series-rail {
  display: flex;
  margin: 1.1rem calc(-1 * clamp(1.1rem, 2.6vw, 1.6rem)) calc(-0.5 * clamp(1.1rem, 2.6vw, 1.6rem));
  padding: 0.35rem clamp(0.6rem, 2vw, 1.1rem) 0.6rem;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  list-style: none;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.rail-item {
  position: relative;
  flex: 0 0 8.5rem;
  scroll-snap-align: start;
}

.rail-item + .rail-item::before {
  position: absolute;
  top: 2.55rem;
  left: -50%;
  width: 100%;
  border-top: 2px solid var(--line-strong);
  content: "";
}

.rail-item.is-draft::before,
.rail-item--add::before {
  border-top-style: dashed !important;
}

.rail-item__link {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.15rem;
  justify-items: center;
  padding: 0.6rem 0.4rem 0.55rem;
  border-radius: var(--radius);
  color: inherit;
  text-align: center;
  text-decoration: none;
  transition: background-color 140ms var(--ease);
}

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

.rail-item__link:hover .date-leaf {
  border-color: var(--pine);
}

.rail-item__year {
  margin-top: 0.5rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  font-variant-numeric: lining-nums;
  line-height: 1.1;
}

.rail-item__title {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.rail-item__state {
  margin-top: 0.15rem;
  color: var(--faint);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.rail-item__state--current {
  color: var(--gold-ink);
}

.rail-item.is-current .date-leaf {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--gold);
}

.rail-item.is-draft .rail-item__year {
  color: var(--muted);
}

.rail-add {
  display: grid;
  width: 3.6rem;
  height: 3.9rem;
  place-items: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: 0.55rem;
  color: var(--pine);
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1;
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease);
}

.rail-item--add .rail-item__link:hover .rail-add {
  border-color: var(--pine);
  background: var(--pine-tint);
}

.rail-item--add .rail-item__title {
  margin-top: 0.5rem;
  color: var(--pine);
  font-weight: 600;
}

/* Empty state: a fanned stack of blank leaves */

.leaf-stack {
  display: flex;
  margin-bottom: 0.9rem;
}

.leaf-stack .date-leaf {
  margin: 0 -0.55rem;
  transform: rotate(-9deg) translateY(4px);
}

.leaf-stack .date-leaf:nth-child(2) {
  position: relative;
  z-index: 1;
  transform: none;
}

.leaf-stack .date-leaf:nth-child(3) {
  transform: rotate(9deg) translateY(4px);
}

/* Conferences without a series */

.unassigned {
  margin-top: 1.5rem;
}

.unassigned .card__title {
  margin-bottom: 0.3rem;
}

.unassigned__list {
  display: grid;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.loose-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(11rem, 15rem);
  gap: 0.9rem;
  align-items: center;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}

.loose-row__text {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.75rem;
  align-items: baseline;
  min-width: 0;
}

.loose-row__text a {
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.loose-row__text a:hover {
  color: var(--pine);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.loose-row__select {
  min-height: 2.3rem !important;
  padding-block: 0.35rem !important;
  font-size: 0.86rem;
}

@media (max-width: 40rem) {
  .conf-row__badges {
    grid-area: status;
    justify-content: flex-start;
  }

  .publish-bar {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .publish-bar__mark {
    margin-top: 0.4rem;
  }

  .publish-bar__text {
    flex-basis: calc(100% - 2rem);
  }

  .publish-bar__actions {
    width: 100%;
    justify-content: flex-end;
  }

  .modal--wide[open],
  .modal--user[open] {
    width: 100%;
  }

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

  .intake__deadline {
    flex-wrap: wrap;
  }

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

  .loose-row__select {
    grid-column: 1 / -1;
  }

  .series-card__actions {
    width: 100%;
  }

  .series-card__actions .button {
    flex: 1 1 auto;
  }

  #create-series {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .series-card.is-new {
    animation: none;
  }
}

/* ==========================================================================
   Архив проведения: итоги и ссылки. Состояние видимости повторяет язык
   публикации — пунктир и штриховка значат «пока не на сайте».
   ========================================================================== */

.archive {
  display: grid;
  gap: 1rem;
  max-width: 54rem;
}

.archive-visibility {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.8rem 1rem;
  border: 1px solid var(--pine-tint-2);
  border-radius: var(--radius);
  background: var(--pine-tint);
}

.archive-visibility strong {
  display: block;
  color: var(--pine);
  font-size: 0.92rem;
}

.archive-visibility__mark {
  width: 0.6rem;
  height: 0.6rem;
  flex: 0 0 auto;
  margin-top: 0.4rem;
  border-radius: 50%;
  background: var(--pine);
  box-shadow: 0 0 0 4px rgb(31 77 63 / 14%);
}

.archive-visibility[data-state="waiting"] {
  border-color: #ead7a8;
  background: var(--gold-soft);
}

.archive-visibility[data-state="waiting"] strong {
  color: var(--gold-ink);
}

.archive-visibility[data-state="waiting"] .archive-visibility__mark {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgb(184 137 44 / 18%);
}

.archive-visibility[data-state="hidden"],
.archive-visibility[data-state="empty"] {
  border: 1.5px dashed var(--line-strong);
  background: repeating-linear-gradient(135deg, var(--surface) 0 10px, var(--surface-2) 10px 20px);
}

.archive-visibility[data-state="hidden"] strong,
.archive-visibility[data-state="empty"] strong {
  color: var(--ink);
}

.archive-visibility[data-state="hidden"] .archive-visibility__mark,
.archive-visibility[data-state="empty"] .archive-visibility__mark {
  border: 2px dashed var(--muted);
  background: transparent;
  box-shadow: none;
}

.archive-section__head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.archive-section__head > div {
  display: grid;
  gap: 0.2rem;
}

.archive-section__head .counter {
  flex: 0 0 auto;
  margin-top: 0.3rem;
  white-space: nowrap;
}

.link-list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list__empty {
  padding: 0.9rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.87rem;
  text-align: center;
}

.link-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.8rem 0.6rem 0.85rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  animation: row-in 220ms var(--ease);
}

.link-row.is-invalid {
  border-color: #efc7c4;
  background: var(--danger-soft);
}

.link-row__index {
  display: grid;
  width: 1.6rem;
  height: 1.6rem;
  margin-top: 1.55rem;
  place-items: center;
  border-radius: 0.4rem;
  color: var(--pine);
  background: var(--pine-tint);
  font-size: 0.78rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.link-row__fields {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 0.6rem 0.75rem;
  min-width: 0;
}

.link-row__desc {
  grid-column: 1 / -1;
}

.link-row__desc textarea {
  min-height: 3.2rem;
}

.link-row__url-box {
  position: relative;
}

.link-row__url-box input {
  font-size: 0.85rem;
}

.link-row__url-box input:not(:placeholder-shown) {
  padding-right: 8.5rem !important;
}

.link-host {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  max-width: 8rem;
  overflow: hidden;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  color: var(--pine);
  background: var(--pine-tint);
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateY(-50%);
}

.link-host:hover {
  background: var(--pine-tint-2);
  text-decoration: underline;
}

.link-row__tools {
  display: grid;
  gap: 0.1rem;
  margin-top: 1.35rem;
}

.archive .add-row {
  margin-top: 0.6rem;
}

.archive-savebar {
  position: static;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  justify-content: flex-end;
  margin: 0 -0.25rem;
  padding: 0.75rem 0.25rem max(0.75rem, env(safe-area-inset-bottom));
  border-top: 1px solid transparent;
  background: var(--ground);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}

.archive-savebar.is-dirty {
  position: sticky;
  border-top-color: var(--line);
  box-shadow: 0 -10px 20px -14px rgb(18 32 27 / 25%);
}

.archive-savebar__state {
  margin-right: auto;
}

.archive-savebar.is-dirty .archive-savebar__state {
  color: var(--gold-ink);
  font-weight: 600;
}

.archive-savebar .notice {
  flex: 1 1 100%;
}

@media (max-width: 40rem) {
  .link-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0.75rem 0.5rem 0.8rem 0.75rem;
  }

  .link-row__index,
  .link-host {
    display: none !important;
  }

  .link-row__url-box input:not(:placeholder-shown) {
    padding-right: 0.75rem !important;
  }

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

  .link-row__tools {
    margin-top: 1.3rem;
  }

  .archive-savebar .button {
    flex: 1 1 auto;
  }

  .archive-savebar__state {
    flex: 1 1 100%;
  }
}

/* ==========================================================================
   Журнал событий и согласие участника
   ========================================================================== */

.audit-lead {
  max-width: 46rem;
}

.audit-filters {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.audit-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  gap: 0.75rem;
}

.audit-filters__more summary {
  width: max-content;
  color: var(--pine);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.audit-filters__more[open] summary {
  margin-bottom: 0.75rem;
}

.audit-filters__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.audit-filters__actions .hint {
  margin-right: auto;
}

.audit-table .col-date time {
  font-variant-numeric: tabular-nums;
}

.audit-row__action .apps-row__sub {
  font-size: 0.74rem;
}

.audit-outcome--success {
  color: var(--pine);
  background: var(--pine-tint);
}

.audit-outcome--rejected,
.audit-outcome--failed {
  color: var(--danger);
  background: var(--danger-soft);
}

.audit-outcome--duplicate {
  color: var(--gold-ink);
  background: var(--gold-soft);
}

.audit-outcome--reported {
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  background: var(--surface);
}

.sheet--wide[open] {
  width: min(100%, 44rem);
}

.audit-section + .audit-section,
#audit-detail > .notice + .audit-section {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.audit-facts {
  display: grid;
  margin: 0;
}

.audit-facts > div {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  gap: 0.2rem 1rem;
  padding: 0.45rem 0;
}

.audit-facts > div + div {
  border-top: 1px dashed var(--line);
}

.audit-facts dd {
  font-weight: 500;
  text-align: left;
}

.audit-break {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-stamp {
  display: grid;
  gap: 0.1rem;
}

.audit-stamp__utc,
.audit-endpoint code {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 500;
}

.audit-endpoint {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.audit-quote {
  margin: 0.35rem 0 0.75rem;
  padding: 0.7rem 0.85rem;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--gold-soft);
  color: var(--ink);
  font-size: 0.9rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.audit-quote--long {
  max-height: 22rem;
  overflow-y: auto;
}

.audit-disclosure summary {
  color: var(--pine);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.audit-json {
  max-height: 28rem;
  margin: 0.6rem 0 0;
  padding: 0.8rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}


@media (max-width: 40rem) {
  .audit-facts > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .audit-filters__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .audit-table .audit-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "action outcome" "who subject" "date date";
  }

  .audit-row__action { grid-area: action; }
  .audit-row > td:nth-child(3) { grid-area: outcome; }
  .audit-row__who { grid-area: who; }
  .audit-row__subject { grid-area: subject; text-align: right; }
  .audit-table .audit-row .col-date { grid-area: date; }
}
