:root {
  color-scheme: light;
  --canvas: #f4f5f8;
  --paper: #fff;
  --ink: #222c3b;
  --muted: #586576;
  --quiet: #637083;
  --line: #e2e7ef;
  --accent: #0067d5;
  --accent-strong: #0058b5;
  --accent-soft: #eaf3ff;
  --tint: #f6f8fc;
  --ok: #20664e;
  --radius: 22px;
  --lift: 0 1px 2px #253d5805, 0 10px 32px #213b5c0a;
  --gutter: clamp(18px, 4vw, 58px);
  --max-width: 1370px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 92px; min-width: 0; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% -210px, #eaf4ff 0, transparent 640px), var(--canvas);
  font: 400 15px/1.62 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
[hidden] { display: none !important; }
a { color: var(--accent); }
svg { display: block; flex: none; }
:focus-visible { outline: 3px solid #438be0; outline-offset: 3px; }
::selection { color: #12467c; background: #d9eaff; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 14px; min-width: 0; }

.masthead {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 1px 0 #fefefe80;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 70px;
  max-width: var(--max-width);
  padding-inline: var(--gutter);
  margin-inline: auto;
}
.brand, .topbar-actions, .account-trigger, .account-info { display: flex; align-items: center; }
.brand { gap: 10px; min-width: 0; }
.brand > strong { font-size: 17px; font-weight: 760; white-space: nowrap; }
.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 35px;
  width: 35px;
  height: 35px;
  border: 1px solid #c8e0fb;
  border-radius: 11px;
  color: #115da9;
  background: linear-gradient(155deg, #f8fbff 0%, #dcecff 100%);
  box-shadow: inset 0 1px 0 #fff, 0 2px 5px #234b7111;
}
.brand-mark svg { width: 23px; height: 23px; }
.topbar-actions { gap: 14px; min-width: 0; }
.header-refresh, .account-trigger {
  min-height: 44px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  transition: background-color 150ms, border-color 150ms;
}
.header-refresh { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 650; }
.header-refresh svg { width: 20px; height: 20px; }
.header-refresh:hover, .account-trigger:hover, .account-trigger[aria-expanded="true"] { border-color: var(--line); background: var(--tint); }
.account { position: relative; }
.account-trigger { gap: 8px; font-size: 14px; font-weight: 700; max-width: min(230px, 42vw); }
#account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid #cadef7;
  border-radius: 50%;
  color: #23598f;
  background: linear-gradient(160deg, #f1f8ff, #e1eeff);
  font-size: 12px;
  font-weight: 720;
}
.avatar.big { flex-basis: 40px; width: 40px; height: 40px; font-size: 16px; }
.chevron { width: 17px; height: 17px; color: #64748a; transition: transform 160ms; }
.account-trigger[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.account-popover {
  position: absolute;
  inset: calc(100% + 9px) 0 auto auto;
  width: min(282px, calc(100vw - 2 * var(--gutter)));
  padding: 9px;
  border: 1px solid #e1e9f4;
  border-radius: 17px;
  background: var(--paper);
  box-shadow: inset 0 1px 0 #fff, 0 16px 46px #233f6724, 0 3px 10px #233f6709;
  animation: pop-in 160ms ease-out both;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.account-info { gap: 11px; padding: 9px 9px 13px; }
.account-info > div { min-width: 0; overflow-wrap: anywhere; }
.account-info strong { color: var(--ink); font-weight: 750; }
.account-info .muted { font-size: 12px; }
.account-options { display: grid; gap: 3px; padding-block: 6px; border-top: 1px solid var(--line); }
.role-option {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: start;
  font-size: 14px;
  font-weight: 650;
}
.role-option:hover { background: var(--tint); }
.role-option.active { border-color: #dbeaff; color: var(--accent-strong); background: var(--accent-soft); }
.account-option-icon { color: #5077a3; }
.account-option-icon svg { width: 19px; height: 19px; }
.role-tick { visibility: hidden; }
.role-option.active .role-tick { visibility: visible; }

.content {
  width: min(100%, var(--max-width));
  margin-inline: auto;
  padding: 36px var(--gutter) 64px;
}
.page-head {
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px 32px;
  padding: clamp(26px, 3.7vw, 53px) clamp(23px, 3.5vw, 49px);
  margin-bottom: 27px;
  overflow: hidden;
  border: 1px solid #e1e8f2;
  border-radius: 26px;
  background:
    radial-gradient(ellipse at 96% 5%, #edf9ff 0%, transparent 48%),
    radial-gradient(ellipse at 76% 110%, #d8eafe 0%, #e9f3ff 24%, transparent 58%),
    linear-gradient(108deg, #fbfcfe 8%, #f1f6fc 62%, #f5faff 100%);
  box-shadow: inset 0 1px 0 #fff, 0 5px 21px #27435f06;
}
.page-head > div { min-width: 0; }
.page-head h1 {
  color: #1d2938;
  font-size: clamp(28px, 3.45vw, 46px);
  font-weight: 760;
  line-height: 1.16;
  letter-spacing: -.044em;
  text-wrap: balance;
}
.desc { margin-top: 12px; color: #58697b; font-size: 14px; }
.page-head:has(.date-indicator) { padding-block: clamp(14px, 1.8vw, 26px); }
.page-head:has(.date-indicator) h1 { font-size: clamp(28px, 3.2vw, 43px); }
.page-head:has(.date-indicator) .desc { margin-top: 7px; }
.actions { position: relative; display: flex; align-items: center; gap: 8px; }
.date-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid #dce7f4;
  border-radius: 11px;
  background: #ffffffbf;
  color: #466079;
  font-size: 12px;
  font-weight: 640;
}
.date-indicator svg { width: 17px; height: 17px; }
.tabs {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  max-width: 100%;
  margin-bottom: 22px;
  padding: 3px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ebeff5;
}
.tab {
  min-height: 40px;
  padding: 4px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 660;
  white-space: nowrap;
  transition: background-color 150ms, border-color 150ms, color 150ms, box-shadow 150ms;
}
.tab:hover { color: var(--accent-strong); background: #ffffff7a; }
.tab.active {
  border-color: #e0e7f1;
  color: var(--accent-strong);
  background: var(--paper);
  box-shadow: 0 1px 3px #314b6816;
  font-weight: 750;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.43;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color 150ms, border-color 150ms, color 150ms;
}
.btn.small { min-height: 38px; padding: 7px 11px; }
.btn svg { width: 16px; height: 16px; }
.btn.primary {
  border-color: #005fc5;
  color: #fff;
  background: linear-gradient(#0872dd, var(--accent));
  box-shadow: inset 0 1px 0 #ffffff24, 0 3px 8px #005cbd24;
}
.btn:active:not(:disabled), .account-trigger:active, .header-refresh:active {
  transform: scale(.98);
}
.btn.primary:active:not(:disabled) { box-shadow: inset 0 1px 3px #00377242; }
.btn.primary:hover:not(:disabled) { border-color: var(--accent-strong); background: var(--accent-strong); }
.btn.secondary, .btn.ghost { border-color: #dae4f1; color: var(--accent-strong); background: #fbfdff; }
.btn.secondary:hover:not(:disabled), .btn.ghost:hover:not(:disabled) { border-color: #bfd9f7; background: var(--accent-soft); }
.btn.danger { border-color: #f0d5de; color: #972f56; background: #fdf4f7; }
.btn.danger:hover { background: #fae9ef; }
.card-actions, .form-actions, .modal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.empty {
  grid-column: 1 / -1;
  padding: 42px 16px;
  border: 1px dashed #dce5f0;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--muted);
  text-align: center;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 8px 22px #24466807;
}
.metric { min-width: 0; padding: 19px clamp(13px, 2vw, 25px) 20px; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric-label { color: var(--muted); font-size: 13px; font-weight: 650; }
.metric-value {
  margin-top: 5px;
  color: #223551;
  font-size: clamp(24px, 2.5vw, 33px);
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.metric-note { color: var(--quiet); font-size: 12px; }
.metric.emphasis .metric-value { color: var(--accent); }
.list-heading { margin-bottom: 11px; color: #27374a; font-size: 17px; font-weight: 740; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.trainer-history { display: grid; gap: 10px; margin-top: 18px; }
.trainer-history-group {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.trainer-history-group > summary {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 11px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.trainer-history-group > summary::-webkit-details-marker { display: none; }
.trainer-history-group > summary::before {
  content: '';
  width: 8px;
  height: 9px;
  background: var(--quiet);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.trainer-history-group[open] > summary::before { transform: rotate(90deg); }
.trainer-history-group > summary:hover { background: var(--accent-soft); }
.trainer-history-count { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.trainer-history-cards { padding: 12px; border-top: 1px solid var(--line); }
.task-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: clamp(16px, 2.15vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 8px 25px #24466807;
  transition: border-color 160ms, box-shadow 160ms;
}
.task-card:hover { border-color: #d0dfee; box-shadow: 0 3px 7px #25476908, 0 14px 30px #2547690e; }
.task-card.ended-card { background: #fcfdff; box-shadow: none; }
.card-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px 12px; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 7px;
  color: #53667e;
  background: #edf1f7;
  font-size: 12px;
  font-weight: 670;
  line-height: 1.55;
  white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.status.active { color: var(--accent-strong); background: var(--accent-soft); }
.status.pending, .chip.pending { color: #894f21; background: #fdf1e5; }
.status.done, .chip.done { color: var(--ok); background: #e9f5ef; }
.status.late, .chip.late { color: #79571e; background: #fff2d8; }
.status.exception, .chip.exception { color: #98385f; background: #fbedf2; }
.status.ended { color: #566377; background: #eef0f4; }
.status.cancelled { color: #8b4551; background: #f9edf0; }
.due {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 640;
}
.due svg { width: 15px; height: 15px; }
.task-title {
  margin: 12px 0 13px;
  color: #253448;
  font-size: clamp(17px, 1.45vw, 22px);
  font-weight: 755;
  letter-spacing: -.015em;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.task-note {
  margin: -3px 0 14px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #52677f;
  background: var(--tint);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.task-notes, .group-message-notes {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.task-notes {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}
.progress-row { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 8px; color: var(--muted); font-size: 13px; }
.progress-row strong { color: #294966; font-variant-numeric: tabular-nums; }
.progress {
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef6;
}
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0067d5, #2989e7); }
.people-list { display: grid; gap: 7px; margin-top: 13px; }
.people-list + .people-list { margin-top: 10px; }
.people-list h3 { color: var(--muted); font-size: 12px; font-weight: 700; }
.exception-reason { font-size: 12px; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 3px 8px; border-radius: 6px; color: #506478; background: var(--tint); font-size: 12px; overflow-wrap: anywhere; }
.task-card > .card-actions { justify-content: space-between; margin-top: auto; padding-top: 15px; }
.task-card > .card-actions .task-log-button { margin-inline-start: auto; }
.task-card > .card-actions::before { content: ""; flex: 0 0 100%; height: 1px; margin-bottom: 2px; background: var(--line); }

dialog.modal {
  width: min(690px, calc(100% - 32px));
  max-height: min(85dvh, 790px);
  padding: 0;
  border: 1px solid #dce6f0;
  border-radius: 21px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 80px #223c5730;
  overflow: auto;
  scroll-padding: 84px 0 76px;
}
dialog.modal::backdrop { background: #283a5242; backdrop-filter: blur(3px); }
dialog.modal[open] { animation: pop-in 160ms ease-out both; }
.modal-head, .modal-actions {
  position: sticky;
  z-index: 1;
  padding: 15px 20px;
  background: var(--paper);
}
.modal-head { top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 19px; font-weight: 750; line-height: 1.4; overflow-wrap: anywhere; }
.modal-body { padding: 20px; min-width: 0; }
.modal-actions { bottom: 0; justify-content: flex-end; border-top: 1px solid var(--line); }
.task-summary { margin-bottom: 21px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.url-preview { margin-top: 6px; overflow-wrap: anywhere; }
.toast {
  position: fixed;
  z-index: 8;
  inset: auto var(--gutter) 25px auto;
  width: max-content;
  max-width: calc(100% - 2 * var(--gutter));
  padding: 11px 16px;
  border: 1px solid #d6e6f8;
  border-radius: 13px;
  color: #23476d;
  background: #f9fcff;
  box-shadow: 0 8px 34px #294d7324;
  font-size: 14px;
  font-weight: 680;
  overflow-wrap: anywhere;
  animation: pop-in 160ms ease-out both;
}

@media (max-width: 730px) {
  .content { padding-top: 23px; }
  .page-head { margin-bottom: 19px; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 500px) {
  .topbar { min-height: 61px; gap: 5px; }
  .topbar-actions { gap: 3px; }
  .header-refresh { min-width: 42px; justify-content: center; padding-inline: 5px; }
  .header-refresh > span { display: none; }
  .brand { gap: 6px; }
  .brand > strong { font-size: 15px; }
  .brand-mark { width: 31px; height: 31px; flex-basis: 31px; }
    .account-trigger { gap: 5px; padding-inline: 5px; font-size: 13px; }
  .page-head { gap: 13px; border-radius: 19px; }
  .desc { margin-top: 7px; }
  .tabs { margin-bottom: 16px; }
  .tab { padding-inline: 10px; font-size: 13px; }
  .metrics { margin-bottom: 21px; }
  .modal-head, .modal-actions { padding-inline: 14px; }
  .modal-body { padding: 15px 14px; }
}
@media (max-width: 345px) { .prototype-badge { display: none; } }
@supports (backdrop-filter: blur(1px)) {
  .masthead {
    background: rgba(250,252,255,.84);
    backdrop-filter: blur(18px) saturate(135%);
  }
  .account-popover {
    background: rgba(253,254,255,.96);
    backdrop-filter: blur(20px) saturate(125%);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .masthead, .account-popover { background: var(--paper); backdrop-filter: none; }
  dialog.modal::backdrop { backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn:active:not(:disabled), .account-trigger:active, .header-refresh:active { transform: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Publishing workspace */
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(300px, 1fr);
  align-items: start;
  gap: 22px;
}
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--lift);
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 23px 26px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(17px, 1.6vw, 21px);
  font-weight: 760;
  line-height: 1.35;
  letter-spacing: -.018em;
}
.panel-head .muted, .panel-title + .muted {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}
.panel-body { min-width: 0; padding: 23px 26px; }
.publish-panel .panel-head { position: relative; }
.publish-panel .panel-body { padding-block: 0; }
.published-panel .panel-head {
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: linear-gradient(150deg, var(--paper) 10%, var(--tint));
}
.published-panel .panel-body { padding-block: 5px 16px; }

.form-section {
  display: grid;
  grid-template-columns: minmax(104px, 23%) minmax(0, 1fr);
  gap: 14px clamp(15px, 2.25vw, 30px);
  padding-block: 23px;
  border-bottom: 1px solid var(--line);
}
.section-copy, .section-body { min-width: 0; }
.section-title {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.4;
}
.section-lead {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.58;
}
.section-body { display: grid; gap: 14px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 12px;
}
.form-grid > :is(.wide, .full, .box, .form-error, .notice, .section-title) { grid-column: 1 / -1; }
.field {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 6px;
}
.field > label, label.field, .field > :is(span:first-child, legend) {
  color: var(--ink);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.45;
}
.field small, .field .muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.field :is(input:not([type=radio], [type=checkbox], [type=hidden]), select, textarea),
.input-action :is(input:not([type=radio], [type=checkbox], [type=hidden]), select, textarea),
.reminder-details :is(input:not([type=radio], [type=checkbox], [type=hidden]), select, textarea) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 8px 11px;
  border: 1px solid #dce3ed;
  border-radius: 10px;
  color: var(--ink);
  background-color: var(--paper);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field textarea { min-height: 92px; resize: vertical; }
.field :is(input, textarea)::placeholder, .input-action input::placeholder { color: var(--quiet); opacity: 1; }
.field :is(input, select, textarea):focus,
.input-action :is(input, select, textarea):focus,
.reminder-details :is(input, select, textarea):focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input[aria-invalid=true], .field textarea[aria-invalid=true] {
  border-color: #b24c65;
}
.req { margin-inline-start: 2px; color: #a53c59; font-weight: 740; }
.input-action {
  display: flex;
  align-items: stretch;
  min-width: 0;
  gap: 7px;
}
.input-action > :is(input, select) { flex: 1 1 0; }
.input-action > .btn { flex: 0 0 auto; }
.field-row, .box-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px 12px;
}
.box {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--tint);
}
.box-head {
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 710;
}
.box-head .muted { color: var(--muted); font-weight: 450; }
.check-grid, .people-grid { display: grid; gap: 7px; }
.check-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 122px), 1fr)); }
.people-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr)); }
.check, .person-check {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
  font-size: 13px;
  font-weight: 630;
  line-height: 1.25;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.check:hover, .person-check:hover { border-color: #b9cde4; }
.check:has(input:checked), .person-check:has(input:checked) {
  border-color: #bdd8f7;
  background: var(--accent-soft);
}
:is(.check, .person-check) > input:is([type=radio], [type=checkbox]) {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.person-check { min-height: 49px; }
:is(.check, .person-check) > span { min-width: 0; overflow-wrap: anywhere; }
.person-check small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 460;
  line-height: 1.3;
}

.reminder-details {
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--tint);
}
.reminder-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 43px;
  gap: 8px;
  border-radius: 8px;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.reminder-details > summary::-webkit-details-marker { display: none; }
.reminder-details > summary::after {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin: -4px 4px 0 auto;
  transform: rotate(45deg);
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
}
.reminder-details[open] > summary::after { margin-top: 4px; transform: rotate(225deg); }
.reminder-details > :last-child:not(summary) { margin-bottom: 12px; }
.publish-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 9px 12px;
  padding-block: 16px 19px;
}
.publish-footer > :is(.muted, .notice) { margin-inline-end: auto; }
.form-error {
  color: #9a3454;
  font-size: 13px;
  font-weight: 660;
  line-height: 1.45;
}
.form-error:empty { display: none; }
.form-error:not(:empty) { padding: 8px 10px; border-radius: 9px; background: #fcf0f3; }
.publish-footer .form-error { flex: 1 1 100%; }

/* Published work list */
.mini-list { display: grid; min-width: 0; }
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 11px 13px;
  padding-block: 15px;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.list-row > .btn { flex-shrink: 0; }
.list-main { flex: 1; display: grid; min-width: 0; gap: 6px; }
.list-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  gap: 5px 8px;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 730;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.list-title > .status { flex: 0 0 auto; }
.list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 9px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.list-meta strong { color: var(--accent-strong); }
.list-main > .progress { margin-top: 3px; }
.published-panel .empty { margin-block: 13px 4px; }

/* Roster and notification history */
.notice-stack { display: grid; gap: 11px; }
.notice {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: var(--tint);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.notice-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 5px 14px;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.notice-head > :is(time, small, .muted) { color: var(--muted); font-size: 11px; font-weight: 500; }
.mentions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
  margin-top: 6px;
  color: var(--accent-strong);
  font-weight: 625;
}
.mentions > span {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
}
.table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 13px;
}
.table-wrap :is(th, td) {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: middle;
}
.table-wrap th { color: var(--muted); background: var(--tint); font-weight: 700; white-space: nowrap; }
.table-wrap tr:last-child td { border-bottom: 0; }

@media (max-width: 1100px) {
  .admin-grid { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; }
  .panel-head, .panel-body { padding-inline: 20px; }
  .check-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 106px), 1fr)); }
  .people-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 116px), 1fr)); }
}
@media (max-width: 900px) {
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 570px) {
  .panel-head, .panel-body { padding-inline: 15px; }
  .panel-head { padding-block: 16px; }
  .form-section { grid-template-columns: minmax(0, 1fr); padding-block: 16px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .section-body { gap: 11px; }
  .check, .person-check, .reminder-details > summary { min-height: 44px; }
  .list-row { gap: 9px; }
  .input-action > .btn { white-space: normal; }
}
@media (max-width: 350px) {
  .list-row { align-items: flex-start; flex-direction: column; }
  .list-main { align-self: stretch; }
}

.completion-box { display: grid; gap: 11px; }
.completion-box > p { font-size: 13px; }
.completion-box .field-row { font-size: 13px; }
.completion-box .field-row .muted, .completion-box .box-head > span { font-size: 12px; }
.completion-box .box-head { margin-bottom: 0; }
.result-filter {
  display: grid;
  gap: 7px;
  padding: 0 10px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.result-filter:has(.result-filter-toggle input:checked) { border-color: var(--accent); }
.result-filter-toggle {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}
.result-filter-toggle input { margin: 0; accent-color: var(--accent); }
.result-filter p { font-size: 12px; }
.result-filter-fields { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.25fr); gap: 8px; }
.result-filter-fields + p { margin-top: 7px; }
.result-filter-operator {
  display: grid;
  min-height: 43px;
  align-items: center;
  padding-inline: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}
@media (max-width: 570px) {
  .result-filter-fields { grid-template-columns: minmax(0, 1fr) auto; }
  .result-filter-fields > :last-child { grid-column: 1 / -1; }
}
.completion-preview-scope, #completion-preview-people td { overflow-wrap: anywhere; }
#completion-preview-people td p { margin-top: 4px; font-size: 12px; }
.recipient-head { margin: 0; }
.recipient-head .check { min-height: 40px; }
.recipient-head > span, .publish-footer > span { color: var(--muted); font-size: 12px; }
.reminder-fields { display: grid; gap: 11px; }
.reminder-fields > p { font-size: 13px; }
.reminder-summary { margin-left: auto; color: var(--quiet); font-size: 11px; text-align: right; }
.reminder-details > summary::after { margin-inline-start: 2px; }
.reminder-details > summary > :first-child { min-width: 0; }
.reminder-day-picker {
  min-width: 0;
  border: 1px solid #dce3ed;
  border-radius: 10px;
  background: var(--paper);
}
.reminder-day-picker > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 8px 11px;
  border-radius: 9px;
  cursor: pointer;
  list-style: none;
}
.reminder-day-picker > summary::-webkit-details-marker { display: none; }
.reminder-day-picker > summary > span { min-width: 0; overflow-wrap: anywhere; }
.reminder-day-picker > summary::after {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin: -4px 3px 0 0;
  transform: rotate(45deg);
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  content: "";
}
.reminder-day-picker[open] > summary::after { margin-top: 4px; transform: rotate(225deg); }
.reminder-day-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 0 9px 9px;
}
.reminder-day-options .check {
  min-height: 44px;
  padding-inline: 7px;
}
.reminder-period { display: grid; gap: 8px; min-width: 0; padding: 10px 0 0; border: 0; border-top: 1px solid var(--line); }
.reminder-period legend { padding-right: 8px; color: var(--ink); font-size: 13px; font-weight: 700; }
.reminder-period p { font-size: 13px; }
.reminder-hour-options, .reminder-escalation { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.reminder-hour-options .check, .reminder-escalation .check { min-height: 44px; }
.reminder-schedule ul, .notice-changes { margin: 6px 0; padding-inline-start: 21px; }
.reminder-schedule p { font-size: 13px; }
.edit-diff { display: grid; gap: 1px; margin-top: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.edit-diff > div { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 3fr); gap: 10px; padding: 10px 12px; }
.edit-diff > div, .edit-diff dd { min-width: 0; background: var(--paper); }
.edit-diff dd { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 9px; overflow-wrap: anywhere; white-space: pre-wrap; }
.edit-diff dt { color: var(--muted); font-weight: 650; }
.edit-diff del { color: var(--quiet); }
.edit-diff ins { color: var(--accent-strong); text-decoration: none; }
@media (max-width: 520px) { .edit-diff > div { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
/* Operations task index */
.task-list-panel {
  --task-columns: minmax(0, 2fr) minmax(76px, .64fr) minmax(118px, 1fr) minmax(105px, 1.06fr) minmax(62px, auto);
  --task-column-gap: clamp(12px, 2.15vw, 28px);
  --task-inline: clamp(18px, 2.4vw, 32px);
}
.operator-task-list {
  --task-action-width: 216px;
  --task-columns: minmax(0, 2fr) minmax(76px, .64fr) minmax(118px, 1fr) minmax(105px, 1.06fr) var(--task-action-width);
}
.task-list-panel > .panel-head {
  align-items: center;
  gap: 12px 18px;
  padding: 23px var(--task-inline);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: var(--paper);
}
.task-list-panel > .panel-body { padding: 0; }
.task-list-panel .task-list-body { min-width: 0; padding: 0 var(--task-inline) 1px; }
.task-list-panel .list-columns,
.task-list-panel .list-row[data-task-id] {
  display: grid;
  grid-template-columns: var(--task-columns);
  gap: var(--task-column-gap);
  align-items: center;
  justify-content: initial;
}
.task-list-panel .list-columns {
  margin-inline: calc(-1 * var(--task-inline));
  padding: 10px var(--task-inline);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--tint);
  font-size: 12px;
  font-weight: 690;
}
.task-list-panel .list-columns > :last-child { text-align: end; }
.task-list-panel .list-row[data-task-id] {
  min-height: 74px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}
.task-list-panel .list-row[data-task-id]:last-child { border-bottom: 0; }
.task-list-panel :is(.task-cell, .status-cell, .deadline-cell, .completion-cell, .list-action) { min-width: 0; }
.task-list-panel .task-cell { display: grid; gap: 5px; }
.task-list-panel .list-title { color: var(--ink); font-size: 15px; }
.task-list-panel .list-meta { display: flex; font-size: 12px; }
.task-list-panel .deadline-cell {
  color: var(--ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.task-list-panel .completion-cell {
  display: grid;
  justify-items: start;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.task-list-panel .completion-cell .progress { width: 100%; max-width: 185px; margin: 0; }
.task-list-panel .completion-cell strong { color: var(--ink); }
.task-list-panel .list-action { display: flex; justify-self: end; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.task-list-panel .list-action .btn, .task-card .task-log-button { min-height: 44px; white-space: nowrap; }
.task-log-button { min-width: 44px; }
.task-cancel-button:not(:disabled) { color: #9e374b; }
.task-cancel-button:not(:disabled):hover { background: #fcf0f2; }
.task-list-panel .mobile-label { display: none; }
.task-list-panel .empty { margin-block: 16px 18px; }

@supports (grid-template-columns: subgrid) {
  @media (min-width: 721px) {
    .operator-task-list .task-list-body {
      --task-action-width: auto;
      display: grid;
      grid-template-columns: var(--task-columns);
      column-gap: var(--task-column-gap);
    }
    .operator-task-list :is(.list-columns, .list-row[data-task-id]) {
      grid-column: 1 / -1;
      grid-template-columns: subgrid;
    }
  }
}

/* Standalone create page and recipient labels */
.create-workspace { width: min(100%, 1000px); margin-inline: auto; }
.create-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.create-nav > a { font-weight: 680; }
.create-nav > a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  gap: 6px;
  color: var(--accent-strong);
  text-decoration: none;
}
.create-nav > a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }
.create-workspace .publish-panel { max-width: 100%; }
.create-workspace .publish-panel .panel-head { padding-block: 24px; }
.create-workspace .form-section { grid-template-columns: minmax(100px, 25%) minmax(0, 1fr); }
.create-workspace .publish-footer { padding-block: 18px 22px; }

.recipient-tools {
  display: grid;
  min-width: 0;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--tint);
}
.recipient-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 8px 12px;
}
.recipient-labels { display: flex; flex-wrap: wrap; min-width: 0; gap: 6px; }
.recipient-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  max-width: 100%;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--paper);
  font: inherit;
  font-size: 12px;
  font-weight: 680;
  overflow-wrap: anywhere;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.recipient-tag:hover { border-color: #b8d7f8; color: var(--accent-strong); }
.recipient-tag[aria-pressed="true"] {
  border-color: #a4c9f1;
  color: var(--accent-strong);
  background: var(--accent-soft);
}
.recipient-tag:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.recipient-tag svg { width: 14px; height: 14px; }
#edit-recipient-label { flex: 0 0 auto; }
.label-form { display: grid; min-width: 0; gap: 12px; }
.label-form .label-members { display: grid; min-width: 0; gap: 8px; }
.label-form .label-members:has(> :is(.person-check, .check)) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
}
.label-form .label-members :is(.person-check, .check) { min-width: 0; }

@media (max-width: 720px) {
  .task-list-panel .list-columns { display: none; }
  .task-list-panel .list-row[data-task-id] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: 'task task' 'status deadline' 'completion action';
    align-items: start;
    gap: 9px 15px;
    padding-block: 15px;
  }
  .task-list-panel .task-cell { grid-area: task; }
  .task-list-panel .status-cell { grid-area: status; }
  .task-list-panel .deadline-cell { grid-area: deadline; }
  .task-list-panel .completion-cell { grid-area: completion; }
  .task-list-panel .list-action { grid-area: action; align-self: end; }
  .operator-task-list .list-row[data-task-id] {
    grid-template-areas: 'task task' 'status deadline' 'completion completion' 'action action';
  }
  .task-list-panel :is(.status-cell, .deadline-cell) { display: grid; justify-items: start; gap: 3px; }
  .task-list-panel .completion-cell { gap: 4px; }
  .task-list-panel .mobile-label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.3;
  }
}
@media (max-width: 570px) {
  .task-list-panel { --task-inline: 15px; }
  .task-list-panel > .panel-head, .create-workspace .publish-panel .panel-head { padding-block: 17px; }
  .create-workspace .form-section { grid-template-columns: minmax(0, 1fr); }
  .recipient-tag { min-height: 42px; padding-inline: 9px; }
}
@media (max-width: 345px) {
  .create-nav { margin-bottom: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .recipient-tag { transition: none; }
}
.recipient-labels { align-items: center; }
#recipient-tags { display: flex; flex-wrap: wrap; gap: 6px; }
#assignee-count, .recipient-group-count { color: var(--muted); font-size: 12px; }
.recipient-group { padding-bottom: 9px; border-bottom: 1px solid var(--line); }
#select-group-all[aria-pressed="true"] { border-color: #a4c9f1; background: var(--accent-soft); }
.recipient-label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; }
.recipient-label-row + .recipient-label-row { border-top: 1px solid var(--line); }
.label-form .label-members { display: block; padding: 10px 0 0; margin: 0; border: 0; }
.label-form .label-members legend { font-size: 13px; font-weight: 680; }
.completion-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 7px; }
@media (max-width: 360px) {
  .account-trigger { max-width: 92px; }
}

.document-fields { display: grid; min-width: 0; gap: 7px; margin: 0; padding: 0; border: 0; }
.document-fields > button { justify-self: start; }
#doc-list { display: grid; gap: 7px; }
.document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  align-items: end;
  gap: 7px;
}
.document-row > .btn { min-width: 44px; min-height: 44px; }
.document-row input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid #dce3ed;
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper);
  font-size: 13px;
  font-weight: 680;
}
.document-row input::placeholder { color: var(--quiet); }
.task-deadline { max-width: 365px; }
.task-deadline-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 8px;
}
.group-preview-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 5px 13px; }
.notice-preview-options { justify-self: start; margin-bottom: 0; }
.notice-preview-options .tab { min-height: 44px; }
.group-message { padding: 15px; }
.group-message .mentions { display: flex; flex-wrap: wrap; gap: 4px 8px; white-space: normal; }
.group-message-entry { color: var(--accent-strong); font-weight: 680; }
.publication-opening .mentions { display: inline; }
.publication-opening .mentions > span { display: inline-block; margin-inline-end: 6px; }
.publication-message .group-message-entry { font-weight: inherit; }

.auth-card {
  display: grid;
  justify-items: start;
  gap: 24px;
  width: min(100%, 460px);
  margin: clamp(32px, 9vh, 112px) auto 0;
  padding: clamp(25px, 5vw, 40px);
}
.auth-card h1 { font-size: clamp(23px, 4.5vw, 30px); line-height: 1.25; }
.auth-card .btn { min-height: 44px; }
.auth-error, .sync-note { color: #8c5120; overflow-wrap: anywhere; }
.auth-error { padding: 10px 12px; border-radius: 10px; background: #fdf5e9; }
.page-loading { margin-block: 30px; text-align: center; color: var(--muted); }

/* Signed-out workbench */
.auth-page {
  --auth-ink: #1e2b49;
  --auth-secondary: #505c72;
  --auth-action: #375cc7;
  --auth-action-hover: #2b4eb6;
  --auth-focus: #2c50b3;
  display: grid;
  grid-template-rows: auto 1fr;
  min-block-size: 100vh;
  min-block-size: 100svh;
  color: var(--auth-ink);
  background:
    radial-gradient(ellipse 52% 66% at 52% 38%, #f9faff 8%, transparent 86%),
    radial-gradient(ellipse 66% 80% at 93% 14%, #e9ecf9 0%, transparent 82%),
    radial-gradient(ellipse 65% 80% at 0% 96%, #edf3f8 0%, transparent 85%),
    #f8f8fa;
}
.auth-page .masthead { border-color: #e4e8f2; background: rgb(251 252 255 / 63%); backdrop-filter: none; }
.auth-page .topbar {
  min-block-size: 68px;
  max-width: 1360px;
  padding-inline: clamp(20px, 4.7vw, 64px);
}
.auth-page .brand { gap: 11px; }
.auth-page .brand > strong { font-size: 16px; font-weight: 650; letter-spacing: .025em; }
.auth-page .brand-mark {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-color: #d1daf5;
  color: #4266c5;
  background: linear-gradient(155deg, #fbfcff 2%, #dfe8fc 100%);
  box-shadow: inset 0 1px 0 #fff, 0 2px 5px rgb(43 67 128 / 8%);
}
.auth-page .brand-mark svg { width: 20px; height: 20px; }
.auth-page .content {
  display: grid;
  place-items: center;
  padding: clamp(35px, 7vh, 80px) 24px max(56px, env(safe-area-inset-bottom, 0px));
}
.auth-login {
  width: min(100%, 520px);
  color: var(--auth-ink);
  font-size: 1rem;
  line-height: normal;
  text-align: center;
}
.auth-login .auth-error {
  width: fit-content;
  max-width: 100%;
  margin: 16px auto 0;
  font-size: .875rem;
  line-height: 1.5;
}
.auth-seal::after, .auth-row:first-child i::after { position: absolute; content: ""; }
.auth-scene {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  width: min(100%, 340px);
  aspect-ratio: 340 / 228;
  margin: 0 auto clamp(15px, 2.5vh, 25px);
}
.auth-scene::before {
  position: absolute;
  z-index: -1;
  inset: -23% -13% -6%;
  background: radial-gradient(ellipse at center, rgb(197 210 251 / 46%) 0%, rgb(222 230 252 / 34%) 40%, transparent 71%);
  content: "";
}
.auth-sheet {
  position: absolute;
  border: 1px solid #fff;
}
.auth-sheet-back {
  inset: 19cqw auto auto 21cqw;
  width: 41cqw;
  height: 39cqw;
  border-radius: 6.2cqw;
  transform: rotate(-17deg);
  background: linear-gradient(140deg, rgb(247 249 255 / 92%) 0%, #e4ebfc 51%, #c9d7f7 100%);
  box-shadow: inset 0 0 0 1px rgb(158 176 224 / 16%), 0 12px 25px -9px rgb(55 83 158 / 28%);
}
.auth-sheet-front {
  inset: 6cqw auto auto 32cqw;
  width: 44cqw;
  height: 48cqw;
  padding: 7cqw 5cqw;
  border-radius: 6.2cqw;
  transform: rotate(8deg);
  background: linear-gradient(147deg, #fff 17%, #f6f8fe 61%, #ecf1fc 100%);
  box-shadow: inset 0 0 0 1px rgb(171 185 228 / 18%), 0 17px 28px -12px rgb(56 81 151 / 34%);
}
.auth-sheet-heading {
  display: block;
  width: 46%;
  height: 2.2cqw;
  margin-block-end: 4.3cqw;
  border-radius: 6px;
  background: #91a9e6;
}
.auth-sheet-rows { display: grid; gap: 3.25cqw; }
.auth-row {
  display: grid;
  grid-template-columns: 4.45cqw 1fr;
  align-items: center;
  gap: 3cqw;
}
.auth-row i {
  position: relative;
  width: 4.45cqw;
  aspect-ratio: 1;
  border: 1px solid #cdd8f2;
  border-radius: 1.35cqw;
  background: #f8faff;
}
.auth-row:first-child i { border-color: #c5d3fa; background: #e1eafd; }
.auth-row:first-child i::after {
  width: 45%;
  height: 30%;
  inset: 24% auto auto 24%;
  border: solid #466dcc;
  border-width: 0 0 1.5px 1.5px;
  transform: rotate(-45deg);
}
.auth-row b {
  width: 100%;
  height: 1.55cqw;
  border-radius: 8px;
  background: #dce5f8;
}
.auth-row:nth-child(2) b { width: 78%; }
.auth-row:nth-child(3) b { width: 61%; }
.auth-seal {
  position: absolute;
  inset: 38cqw auto auto 66cqw;
  width: 21cqw;
  height: 21cqw;
  border: 1px solid #9fb4f7;
  border-radius: 7.4cqw;
  transform: rotate(-11deg);
  background: linear-gradient(147deg, #a2bbff 0%, #7397f3 43%, #5274d4 100%);
  box-shadow: inset 0 2px 2px rgb(255 255 255 / 58%),
    inset 0 -2px 3px rgb(34 63 148 / 25%),
    0 11px 20px -5px rgb(56 87 188 / 53%),
    0 3px 4px rgb(66 96 171 / 21%);
}
.auth-seal::after {
  inset: 31% auto auto 28%;
  width: 44%;
  height: 30%;
  border: solid #fff;
  border-width: 0 0 4.5px 4.5px;
  border-radius: 2px 1px 3px 3px;
  transform: rotate(-45deg);
  filter: drop-shadow(0 2px 1px rgb(44 77 163 / 22%));
}
.auth-login h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4.2vw, 3.35rem);
  line-height: 1.16;
  letter-spacing: -.042em;
  font-weight: 700;
  text-wrap: balance;
}
.auth-lead {
  margin: 15px auto 0;
  color: var(--auth-secondary);
  font-size: 1rem;
  line-height: 1.7;
  text-wrap: balance;
}
.auth-action {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: min(100%, 268px);
  min-block-size: 54px;
  margin-block: 31px 0;
  padding: 12px 44px;
  border: 1px solid rgb(34 62 152 / 21%);
  border-radius: 15px;
  color: #fff;
  background: var(--auth-action);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 23%), 0 8px 19px rgb(55 92 199 / 20%);
  font: inherit;
  font-weight: 630;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
@media (hover: hover) {
  .auth-action:hover {
    background: var(--auth-action-hover);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 20%), 0 9px 22px rgb(55 92 199 / 28%);
  }
}
.auth-action:active { transform: scale(.98); }
.auth-action:focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 4px; }
.auth-arrow {
  position: absolute;
  right: 19px;
  top: 50%;
  width: 14px;
  height: 14px;
  color: rgb(255 255 255 / 88%);
  transform: translateY(-50%);
}
.auth-arrow::before {
  position: absolute;
  top: 6px;
  left: 1px;
  width: 12px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  content: "";
}
.auth-arrow::after {
  position: absolute;
  top: 3px;
  right: 1px;
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  border-radius: 0 1px 0 0;
  transform: rotate(45deg);
  content: "";
}
.auth-hint {
  min-block-size: 1.5em;
  margin: 15px auto 0;
  color: var(--auth-secondary);
  font-size: .8125rem;
  line-height: 1.6;
}
@media (max-width: 600px) {
  .auth-page .topbar { min-block-size: 60px; }
  .auth-scene { width: min(100%, 260px); }
  .auth-action { margin-block-start: 25px; }
}
@media (max-height: 620px) {
  .auth-page .content { padding-block: 24px 36px; }
  .auth-scene { width: min(100%, 220px); }
}
@media (max-height: 460px) and (orientation: landscape) {
  .auth-page .topbar { min-block-size: 52px; }
  .auth-page .content { padding-block: 16px 20px; }
  .auth-scene { width: min(100%, 140px); margin-block-end: 10px; }
  .auth-login h1 { font-size: 1.9rem; }
  .auth-lead { margin-block-start: 8px; }
  .auth-action { min-block-size: 46px; margin-block-start: 15px; }
  .auth-hint { margin-block-start: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-action { transition: none; }
  .auth-action:active { transform: none; }
}
.header-row { max-width: 165px; }
.sync-note { font-size: 12px; }
.modal-feedback { margin-top: 14px; padding: 9px 12px; border-radius: 10px; color: #23476d; background: var(--accent-soft); }

.task-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--tint);
}
.task-overview dt { color: var(--muted); font-size: 12px; }
.task-overview dd { margin: 4px 0 0; font-weight: 680; overflow-wrap: anywhere; }
.task-overview-note { grid-column: 1 / -1; }
.task-overview-note dd { font-weight: 400; white-space: pre-wrap; }
.task-detail-documents .document-menu { position: static; margin-top: 7px; }
.completion-detail { display: grid; gap: 15px; }
.completion-detail .task-summary { margin: 0; }
.completion-detail h3 { margin-bottom: 7px; font-size: 16px; }
.completion-subheading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 3px 10px; margin-bottom: 8px; }
.completion-subheading h4 { margin: 0; font-size: 13px; }
.completion-subheading p { font-size: 12px; }
.completion-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 124px), 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.completion-people > li {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  align-items: baseline;
  gap: 4px 6px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--tint);
  overflow-wrap: anywhere;
}
.completed-people > li { border-color: #daeae2; background: #edf7f1; }
.completion-people :is(time, li > .muted) { width: 100%; font-size: 12px; }
.completion-people time { color: var(--quiet); font-variant-numeric: tabular-nums; }
.completion-late { color: #79571e; font-size: 12px; }
.task-log-caption { font-weight: 690; overflow-wrap: anywhere; }
.task-log-zone { margin-top: 4px; font-size: 12px; }
.timeline { display: grid; gap: 0; margin: 14px 0 0; padding: 0; list-style: none; }
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  min-height: 60px;
  padding: 0 0 14px 20px;
}
.timeline li::before {
  position: absolute;
  z-index: 1;
  inset: 5px auto auto 0;
  width: 9px;
  height: 9px;
  border: 2px solid #4982ce;
  border-radius: 50%;
  background: var(--paper);
  content: "";
}
.timeline li.completed::before { border-color: #419674; }
.timeline li.edited::before { border-color: var(--accent-strong); }
.timeline li.cancelled::before { border-color: #ad5261; }
.timeline li:not(:last-child)::after {
  position: absolute;
  inset: 9px auto -6px 4px;
  width: 1px;
  background: #dae6f7;
  content: "";
}
.timeline :is(time, p, .muted) { color: var(--quiet); font-size: 12px; }
.timeline time { font-variant-numeric: tabular-nums; }
.timeline p { grid-column: 1 / -1; overflow-wrap: anywhere; }
@media (max-width: 420px) {
  .task-overview { gap: 10px; padding: 11px; }
  .timeline li { grid-template-columns: minmax(0, 1fr); }
}


/* Named task documents and management center */
.task-documents { position: relative; max-width: 100%; }
.task-documents summary { cursor: pointer; list-style: none; min-height: 44px; }
.task-documents summary::-webkit-details-marker { display: none; }
.document-chevron {
  width: 7px;
  height: 7px;
  margin: 0 2px 3px;
  border: solid currentColor;
  border-width: 0 1.7px 1.7px 0;
  transform: rotate(45deg);
}
.task-documents[open] .document-chevron { transform: translateY(3px) rotate(225deg); }
.document-menu {
  position: absolute;
  z-index: 4;
  inset: calc(100% + 7px) auto auto 0;
  display: grid;
  gap: 3px;
  width: min(250px, calc(100vw - 2 * var(--gutter) - 36px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 10px 29px #24375525;
}
.document-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
  text-decoration: none;
}
.document-link:hover { background: var(--accent-soft); color: var(--accent-strong); }
.document-link > span { flex: none; color: var(--accent-strong); }
.management-entry { flex: none; white-space: nowrap; }
.management-entry.active { border-color: #b6cff2; background: var(--accent-soft); }
.management-workspace { max-width: 1112px; margin-inline: auto; }
.management-tabs .tab { min-height: 44px; }
.management-members .panel-head { align-items: center; }
.management-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.management-toolbar .field { width: min(100%, 280px); }
.management-toolbar > .muted { margin-bottom: 8px; font-size: 13px; }
.management-table { border: 0; }
.management-table :is(th,td) { padding: 10px 12px; }
.management-table th:first-child { border-radius: 9px 0 0 9px; }
.management-table th:last-child { border-radius: 0 9px 9px 0; }
.management-table :is(th,td):last-child { text-align: end; }
.management-table .management-empty { padding: 24px 12px; text-align: center; }
.management-table button { min-height: 44px; white-space: nowrap; }
.management-person { display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.management-person .muted { display: block; font-size: 12px; }
.management-tags, .management-tag-list { display: flex; flex-wrap: wrap; gap: 5px 7px; }
.management-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 7px;
  color: var(--muted);
  background: #eef1f7;
  font-size: 12px;
  font-weight: 670;
  overflow-wrap: anywhere;
}
.management-tag.role-admin { background: var(--accent-soft); color: var(--accent-strong); }
.management-tag.role-trainer { background: #e8f4ee; color: var(--ok); }
.management-group-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr);
  align-items: start;
  gap: 17px;
}
.management-group-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}
.management-form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.management-group-layout .panel-body > .muted,
.management-form-foot .muted, .management-group-meta { font-size: 13px; }
.management-group-layout code { display: block; color: var(--muted); overflow-wrap: anywhere; }
.management-group-meta { margin-top: 6px; }
.management-role-options { gap: 8px; }
.management-role-options .person-check { min-height: 62px; }

@media (max-width: 730px) {
  .management-group-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .management-workspace .panel-head, .management-workspace .panel-body { padding-inline: 15px; }
  .management-table, .management-table :is(table,tbody) { display: block; }
  .management-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .management-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
  }
  .management-table tr:last-child { border: 0; }
  .management-table td { padding: 0; border: 0; }
  .management-table td:nth-child(2) { grid-area: 2 / 1; }
  .management-table td:nth-child(3) { grid-area: 2 / 2; text-align: end; }
  .management-table td:nth-child(4) { grid-area: 1 / 2; }
  .management-table td[colspan] { grid-column: 1 / -1; }
  .document-row { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 5px; }
  .document-row input { padding-inline: 6px; font-size: 12px; }
  .document-row > .btn { padding-inline: 6px; }
  .task-deadline-inputs input { padding-inline: 6px; }
}
@media (max-width: 500px) {
  .topbar:has(.management-entry:not([hidden])) { padding-inline: 12px; }
  .topbar:has(.management-entry:not([hidden])) .brand > strong { font-size: 13px; }
  .topbar:has(.management-entry:not([hidden])) .brand-mark { flex-basis: 27px; width: 27px; height: 27px; }
  .management-entry { padding-inline: 7px; font-size: 12px; }
  .topbar-actions:has(.management-entry:not([hidden])) .header-refresh { min-width: 34px; }
  .topbar-actions:has(.management-entry:not([hidden])) .account-trigger { gap: 3px; padding-inline: 3px; }
  .topbar-actions:has(.management-entry:not([hidden])) #account-name {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
  }
  .task-documents { flex-basis: 100%; }
  .task-documents summary { width: 100%; justify-content: space-between; }
  .document-menu { position: static; width: 100%; margin-top: 7px; background: var(--tint); box-shadow: none; }
}
