.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.gate[hidden] { display: none; }
.gate-card {
  width: min(380px, 100%);
  padding: 30px 26px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 24px 60px -30px rgba(31, 29, 26, 0.25);
  text-align: center;
}
.gate-card svg.mark { display: block; width: 44px; height: 44px; margin: 0 auto 14px; }
.gate-card h1 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: 0.06em; }
.account-gate-actions [hidden] { display: none; }
.gate-card.is-booting { padding-bottom: 28px; }
.gate-card.is-booting .account-gate-actions,
.gate-card.is-booting #login-err { display: none; }
.gate-card.is-booting #gate-note { min-height: 0; margin: 8px 0 0; }
.gate-card.is-booting #gate-note::after {
  display: block;
  width: 52px;
  height: 2px;
  margin: 14px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  content: "";
  animation: gate-wait 1.4s ease-in-out infinite;
}
@keyframes gate-wait {
  0% { background-position: 100% 0; opacity: 0.35; }
  50% { background-position: 0 0; opacity: 0.9; }
  100% { background-position: -100% 0; opacity: 0.35; }
}
.gate-card .field { margin-top: 22px; }
.gate-card .field input::placeholder { color: var(--faint); }
.gate-card p { margin: 8px 0 22px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.field { display: grid; gap: 6px; text-align: left; font-size: 13px; color: var(--muted); }
.field input {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus { border-color: var(--line-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent); }
.primary {
  width: 100%;
  height: 42px;
  margin-top: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
  cursor: pointer;
}
.primary:active { transform: scale(0.99); }
.err { min-height: 1.4em; margin: 10px 0 0; font-size: 13px; color: #a04b2a; }
body[data-presence="asleep"] .err,
body[data-presence="asleep"] .paper-err,
body[data-presence="asleep"] .seat-err { color: #e5a27a; }

.desk { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: 100dvh; }
.desk[hidden] { display: none; }
.pile-col { display: flex; flex-direction: column; min-height: 0; padding: 10px 10px 12px; background: var(--side); }
.desk-top { display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 2px 0 8px; }
.top-actions { display: flex; align-items: center; gap: 2px; }
.desk-top .account-open.account-icon {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.desk-top .account-open.account-icon:hover {
  border: 0;
  background: var(--hover);
  color: var(--ink);
}
.desk-top .account-open.account-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.55;
}
.desk-nav { display: flex; gap: 6px; padding: 0 8px 8px; }
.desk-nav[hidden] { display: none; }
.desk-nav button {
  flex: 1;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
}
.desk-nav button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#pane-thread { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#pane-thread[hidden] { display: none; }
.pane { flex: 1; min-height: 0; overflow: auto; }
.pane[hidden] { display: none; }
#pane-apply,
#pane-audit,
#pane-pool { display: flex; flex-direction: column; overflow: hidden; }
#pane-profile { display: flex; flex-direction: column; overflow-y: auto; }
#pane-apply[hidden],
#pane-audit[hidden],
#pane-pool[hidden],
#pane-profile[hidden] { display: none; }
.papers { padding: 0 24px 20px; }
.auto-approve {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 24px 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  cursor: pointer;
  user-select: none;
}
.auto-approve input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.auto-approve-track {
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--line-2);
  transition: background 0.18s ease;
}
.auto-approve-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(31, 29, 26, 0.16);
  content: "";
  transition: transform 0.18s ease;
}
.auto-approve input:checked + .auto-approve-track { background: var(--dot); }
.auto-approve input:checked + .auto-approve-track::after { transform: translateX(18px); }
.auto-approve input:focus-visible + .auto-approve-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.auto-approve-copy { min-width: 0; }
.auto-approve-copy b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.auto-approve-copy small {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}
.auto-approve-err { margin: -2px 24px 10px; }
.profile-form {
  width: min(38rem, calc(100% - 48px));
  margin: 20px auto 40px;
  padding: 26px 26px 20px;
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 20px 55px -40px rgba(31, 29, 26, 0.35);
}
.profile-card-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.profile-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
}
.profile-card-head h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.profile-card-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}
.profile-form .field { gap: 8px; color: var(--ink-2); font-size: 12.5px; }
.profile-opening { display: grid; gap: 9px; }
.profile-opening-title { color: var(--ink-2); font-size: 12.5px; }
.opening-list { display: grid; gap: 8px; }
.opening-row { display: flex; align-items: center; gap: 8px; }
.opening-row input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.opening-row input:focus { border-color: var(--line-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent); }
.opening-remove {
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.opening-remove:hover { border-color: var(--line-2); color: var(--ink); }
.opening-add {
  justify-self: start;
  height: 34px;
  padding: 0 12px;
  border: 1px dashed var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.opening-add:disabled { opacity: 0.45; cursor: default; }
.profile-id {
  display: flex;
  align-items: center;
  overflow: hidden;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--side);
}
.profile-id span {
  flex: none;
  padding: 0 0 0 15px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.profile-id input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 15px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}
.profile-id:focus-within {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent);
}
.profile-form textarea {
  width: 100%;
  min-height: 108px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--side);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}
.profile-form textarea:focus {
  outline: 0;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent);
}
.profile-hint { margin: -4px 0 0; color: var(--faint); font-size: 12px; line-height: 1.65; }
.profile-form .err { min-height: 0; margin: 0; }
.profile-ok { min-height: 0; margin: 0; color: var(--accent); font-size: 13px; }
.profile-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.profile-actions .primary {
  width: auto;
  min-width: 112px;
  height: 40px;
  margin: 0;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
}
.profile-actions .primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.profile-actions .primary:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 42%, transparent); outline-offset: 3px; }
@media (max-width: 700px) {
  .profile-form { width: calc(100% - 32px); margin: 14px auto 28px; padding: 21px 18px 16px; }
  .profile-card-head h3 { font-size: 19px; }
}
#pane-pool .pool-line {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
#pane-pool .pool-main { min-width: 0; flex: 1; }
#pane-pool .pool-main b {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#pane-pool .pool-main small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
#pane-pool .pool-time {
  flex: none;
  padding-top: 2px;
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
}
.papers h3 {
  margin: 2px 2px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--faint);
}
.papers .quiet { margin: 8px 0 0; text-align: left; }
.paper {
  margin: 0 0 12px;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.paper b { display: block; font-family: var(--mono); font-size: 13px; font-weight: 600; }
.paper p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.paper .decide { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.paper .decide button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 4.5em;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: pointer;
}
.paper .decide button:hover { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); color: var(--ink); }
.paper .decide button.yes { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.paper .decide button.yes:hover { background: color-mix(in srgb, var(--ink) 88%, var(--accent)); color: var(--bg); }
.paper .decide button.no {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
  color: var(--accent);
}
.paper .decide button.quiet {
  background: var(--panel);
  border-color: var(--line);
  color: var(--muted);
}
.paper .decide button.quiet:hover { color: var(--ink); }
.seat {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.seat[data-off="1"] .name b { color: var(--muted); }
.seat-status { display: block; margin-top: 4px; font-size: 12px; color: var(--faint); }
.seat-status[data-state="online"] { color: var(--up); }
.seat-status[data-state="busy"] { color: var(--accent); }
.seat-status[data-state="idle"] { color: var(--muted); }
.seat-status[data-state="closed"] { color: var(--accent); }
.seat .name { flex: 1; min-width: 0; }
.seat .name b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}
.seat .blurb { display: block; margin-top: 2px; font-size: 12px; line-height: 1.5; color: var(--muted); white-space: normal; }
.seat-err { flex: 1 0 100%; margin: 0 0 8px; font-size: 12px; color: #a04b2a; }
.seats { margin-bottom: 8px; }
.talks-col { margin-top: 28px; }
.gate-switch {
  position: relative;
  flex: none;
  width: 72px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--off);
  box-shadow: inset 0 1px 2px rgba(31, 29, 26, 0.08);
  cursor: pointer;
  transition: background-color 0.25s, border-color 0.25s, width 0.2s;
}
.gate-switch:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.gate-switch[aria-checked="true"] {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 30%, transparent);
}
.gate-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(31, 29, 26, 0.18);
  transition: left 0.2s ease;
}
.gate-switch[aria-checked="true"]::after { left: 45px; }
.gate-switch b {
  position: absolute;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.gate-switch[aria-checked="false"] b { right: 10px; color: var(--muted); }
.gate-switch[aria-checked="true"] b { left: 11px; color: var(--on-accent); }
.gate-switch[data-confirm="1"] {
  width: 108px;
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
  border-color: var(--accent);
  box-shadow: none;
}
.gate-switch[data-confirm="1"]::after { left: 81px; }
.gate-switch[data-confirm="1"] b { left: 12px; right: auto; color: var(--accent); }
#applications,
#audit {
  width: min(42rem, 100%);
  flex: 1;
  min-height: 0;
  margin: 0 auto;
  overflow: auto;
}
#applications {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 2px;
}
#applications .sheet { flex: 1; min-height: 0; overflow: auto; padding-bottom: 8px; }
#applications .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#applications .head b { font-size: 14px; }
#applications .state {
  flex: none;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--chip);
  font-size: 12px;
  line-height: 24px;
  letter-spacing: 0.08em;
  color: var(--faint);
}
#applications .paper[data-status="pending"] .state {
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
  color: var(--accent);
}
#applications .paper[data-status="approved"] .state {
  background: color-mix(in srgb, var(--up) 16%, var(--panel));
  color: var(--up);
}
#applications .paper[data-status="rejected"] .state { color: var(--muted); }
#applications .mail { margin: 4px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
#applications .once { margin-top: 10px; }
.paper-err { margin: 8px 0 0; font-size: 12.5px; color: #a04b2a; }
#applications .blurb { margin: 6px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
#applications .why { margin: 8px 0 0; font-size: 13.5px; line-height: 1.65; color: var(--muted); }
#applications .reject-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
}
#applications .reject-box textarea {
  display: block;
  width: 100%;
  height: 68px;
  min-height: 68px;
  max-height: 120px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  resize: none;
  box-sizing: border-box;
}
#applications .reject-box .decide {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
#applications .reject-box .decide button {
  flex: 0 0 auto;
  align-self: center;
  height: 32px;
  margin: 0;
  line-height: 1;
}
.audit-bar { margin: 0 0 12px; }
.audit-bar select {
  width: min(100%, 280px);
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
}
.audit-bar select:focus {
  border-color: var(--line-2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent);
  outline: none;
}
.audit-line {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.audit-line:hover { background: var(--hover); }
.audit-line .line { flex: 1; min-width: 0; }
.audit-line b,
.audit-line .who,
.audit-line .preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-line b { font-size: 14px; font-weight: 500; }
.audit-line .who { margin-top: 2px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.audit-line .preview { margin-top: 3px; font-size: 13px; color: var(--muted); }
.audit-line small { flex: none; font-size: 12px; color: var(--faint); }
.audit-line.waiting small { color: var(--accent); }
.audit-line.reported {
  border-color: #c15a36;
  background: rgba(193, 90, 54, 0.1);
  box-shadow: inset 3px 0 0 #c15a36;
}
.audit-line.reported:hover { background: rgba(193, 90, 54, 0.15); }
.audit-line.reported small { color: #a63e1d; font-weight: 600; }
.audit-line .report {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.5;
  color: #a94f2d;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audit-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0;
}
.audit-filter button {
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.audit-filter button:hover { border-color: var(--line-2); color: var(--ink); }
.audit-filter button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 8px 0 12px;
}
.pager button {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
}
.pager button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); color: var(--ink); }
.pager button:disabled { color: var(--faint); cursor: default; }
.pager span {
  min-width: 4.5em;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--faint);
}
#applications .quiet,
.talks-list .quiet,
.seats .quiet { margin: 28px 0; text-align: center; }
.pane .reader-top h2 { font-size: 18px; letter-spacing: 0.04em; }
.pane .reader-top small { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pass { font-family: var(--mono); font-size: 15px; color: var(--ink); }
.back { margin-left: -9px; margin-right: 4px; }
.back[hidden] { display: none; }
.desk-top [data-tip]:hover::after { left: auto; right: 0; transform: none; bottom: auto; top: calc(100% + 6px); }

.presence {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-top: 12px;
  padding: 10px 11px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--up);
  flex: none;
}
.presence[data-state="busy"] .presence-dot { background: var(--accent); }
.presence[data-state="away"] .presence-dot,
.presence[data-state="off"] .presence-dot { background: var(--faint); }
.presence[data-state="idle"] .presence-dot {
  background: transparent;
  border: 1.5px solid var(--up);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 18%, transparent);
}
.presence[data-state="closed"] .presence-dot {
  background: transparent;
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.presence b { font-size: 13px; font-weight: 600; }
.presence[data-state="busy"] b { color: var(--accent); }
.presence[data-state="away"] b { color: var(--muted); }
.presence[data-state="idle"] b { color: var(--muted); }
.presence[data-state="closed"] b { color: var(--accent); }
.work-state {
  flex: none;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.work-state:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 3px; border-radius: 999px; }
.work-state[hidden] { display: none; }
.work-switch-track {
  position: relative;
  display: block;
  width: 76px;
  height: 26px;
  border-radius: 999px;
  background: var(--muted);
  transition: background-color 0.18s ease;
}
.work-state[aria-checked="true"] .work-switch-track { background: var(--accent); }
.work-state-label {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--panel);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1;
  transform: translateY(-1px);
  z-index: 1;
  pointer-events: none;
}
.work-state[aria-checked="true"] .work-state-label { color: var(--on-accent); }
.work-state[aria-checked="true"] .work-state-label { left: 10px; right: 26px; }
.work-state[aria-checked="false"] .work-state-label { left: 26px; right: 10px; }
.work-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(31, 29, 26, 0.22);
  transition: transform 0.18s ease, background-color 0.18s ease;
  z-index: 2;
}
.work-state[aria-checked="true"] .work-switch-knob { transform: translateX(50px); background: var(--on-accent); }

.count { margin: 14px 10px 2px; font-size: 12.5px; line-height: 1.6; color: var(--faint); }
.pile { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px 8px; }
.pile h3 { margin: 16px 10px 6px; font-size: 12px; font-weight: 500; color: var(--faint); }
.fold summary {
  margin: 16px 10px 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
  cursor: pointer;
  list-style: none;
}
.fold summary::-webkit-details-marker { display: none; }
.thread-load-more {
  display: block;
  margin: 2px auto 14px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.thread-load-more:hover { border-color: var(--line-2); background: var(--hover); color: var(--ink); }
.thread-load-more:disabled { cursor: default; opacity: 0.65; }
.fold summary::before { content: "▸ "; }
.fold[open] summary::before { content: "▾ "; }
.pile .none { margin: 6px 10px; font-size: 13px; color: var(--faint); }
.slip {
  display: block;
  flex: 1;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.slip b, .slip span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slip b { font-size: 14px; font-weight: 500; }
.slip span { margin-top: 2px; font-size: 13px; color: var(--muted); }
.slip small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--faint); }
.slip.waiting b::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 8px 2px 0;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}

.reader { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.reader-top { flex: none; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 18px 24px 0; }
.reader-top h2 { flex: 1 1 auto; margin: 0; min-width: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-top small { flex: none; font-size: 12px; color: var(--faint); white-space: nowrap; }
.reader-top .text-btn { flex: none; white-space: nowrap; }
.slip-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin: 0 0 4px;
  border-radius: 12px;
  transition: background-color 0.15s;
}
.slip-row:hover,
.slip-row:focus-within { background: var(--hover); }
.slip-row[data-current="true"] { background: var(--panel); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(31, 29, 26, 0.05); }
.slip-row[data-pinned="true"] { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.slip-row[data-pinned="true"]:hover { background: var(--hover); }
.slip-pin-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 16px;
  margin: 12px 4px 0 0;
  color: var(--accent);
}
.slip-pin-mark svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.slip-pin-mark svg.pin-solid { fill: currentColor; stroke: none; }
.slip-more {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 9px 2px 0 1px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
}
.slip-more svg { width: 16px; height: 16px; fill: currentColor; }
.slip-row:hover .slip-more,
.slip-row:focus-within .slip-more,
.slip-more[aria-expanded="true"] { opacity: 1; pointer-events: auto; }
.slip-more:hover,
.slip-more[aria-expanded="true"] { background: var(--hover-2); color: var(--ink); }
@media (hover: none) {
  .slip-more { opacity: 0.6; pointer-events: auto; }
}
.slip-menu {
  position: absolute;
  top: calc(100% + 2px);
  right: 2px;
  z-index: 40;
  min-width: 142px;
  padding: 5px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 14px 34px -18px rgba(31, 29, 26, 0.45);
}
.slip-menu[hidden] { display: none; }
.slip-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 32px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.slip-menu-item svg {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.slip-menu-item svg.pin-solid { fill: currentColor; stroke: none; }
.slip-menu-item:hover { background: var(--hover); color: var(--ink); }
.shelve {
  flex: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.shelve:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--ink); }
.shelve[data-confirm="1"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.shelve[data-pinned="1"] { border-color: color-mix(in srgb, var(--accent) 34%, var(--line)); color: var(--accent); }
.shelve[hidden] { display: none; }
#block {
  margin-left: 0;
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
  color: var(--accent);
}
#block[data-mode="undo"] { border-color: var(--line); background: var(--panel); color: var(--ink-2); }
#block[data-confirm="1"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
#shelve[hidden] + #block { margin-left: auto; }
.thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px max(24px, calc((100% - 46rem) / 2)) 24px;
}
.quiet { margin: auto; max-width: 22rem; text-align: center; font-size: 14px; line-height: 1.7; color: var(--faint); }
.them, .me { max-width: 80%; }
.them { align-self: flex-start; }
.me { align-self: flex-end; text-align: right; }
.them p, .me p, .me .md {
  margin: 0;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.7;
  text-align: left;
  overflow-wrap: anywhere;
}
.them p, .me p { white-space: pre-wrap; }
.them p { background: var(--bubble); }
.me p, .me .md { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.them small, .me small { display: block; margin: 4px 8px 0; font-size: 11.5px; color: var(--faint); }
.me .md .katex { font-size: 1.04em; }
.me .md .katex-display {
  max-width: 100%;
  margin: 0.65em 0;
  padding: 2px 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.me .md .katex-display > .katex {
  width: max-content;
  min-width: 100%;
  font-size: 1.08em;
}
.reply { flex: none; width: min(46rem, calc(100% - 32px)); margin: 0 auto 16px; }
.reply[hidden] { display: none; }
.reply textarea { min-height: 72px; }
.hint { font-size: 12px; color: var(--faint); }

.sketch {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(31, 29, 26, 0.38);
}
.sketch[hidden] { display: none; }
.sketch-card {
  width: min(760px, 100%);
  min-width: 0;
  max-width: 100%;
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 24px 70px -24px rgba(31, 29, 26, 0.45);
}
.sketch-card header, .sketch-card footer { display: flex; align-items: center; gap: 8px; }
.sketch-card h2 { margin: 0; font-size: 16px; font-weight: 600; }
.sketch-card header button, .sketch-tools button, .sketch-card footer button {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.sketch-card header button {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
}
.sketch-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 12px 0; }
.sketch-tool-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sketch-actions { margin-left: auto; }
@media (max-width: 700px) {
  .sketch-actions { margin-left: 0; }
  .sketch-color span { display: none; }
  .sketch-color { padding: 0 6px; }
}
.sketch-tools button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 13px;
}
.sketch-tools button[data-size]:disabled { opacity: 0.4; cursor: default; }
.sketch-tools kbd {
  padding: 0 3px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 4px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9.5px;
  line-height: 1.5;
}
@media (hover: none) {
  .sketch-tools kbd { display: none; }
}
.sketch-tools button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.sketch-color {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
}
.sketch-color input {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  appearance: none;
}
.sketch-color input::-webkit-color-swatch-wrapper { padding: 0; }
.sketch-color input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.swatch { width: 22px; height: 22px; padding: 0; border-radius: 999px; background: var(--c) !important; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ink); }
.sketch-viewport {
  width: 100%;
  max-height: min(420px, 52vh);
  overflow: auto;
  border-radius: 12px;
  background: #fffaf3;
  overscroll-behavior: contain;
}
.sketch-viewport::-webkit-scrollbar { width: 9px; height: 9px; }
.sketch-viewport::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--line-2); }
#sketch-pad {
  display: block;
  width: auto;
  height: auto;
  border-radius: 0;
  background: #fffaf3;
  touch-action: none;
  cursor: crosshair;
}
.sketch-viewport.panning #sketch-pad { cursor: grab; }
.sketch-viewport.panning.dragging #sketch-pad { cursor: grabbing; }
.sketch-viewport.filling #sketch-pad { cursor: crosshair; }
.sketch-zoom button:disabled { opacity: 0.4; cursor: default; }
.sketch-zoom #sketch-zoom-reset { min-width: 52px; justify-content: center; }
.sketch-err { min-height: 1.2em; margin: 8px 0 0; font-size: 13px; color: #a04b2a; }
.sketch-card footer { justify-content: flex-end; margin-top: 8px; }
.sketch-card footer .primary {
  width: auto;
  height: 36px;
  margin: 0;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
}
.sketch-card footer .text-btn {
  margin-right: 2px;
  color: var(--muted);
  font-size: 13px;
}
.sketch-card footer .text-btn:hover {
  background: var(--hover);
  color: var(--ink);
}

@media (min-width: 1180px) {
  #audit {
    width: min(72rem, 100%);
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 0 28px;
    align-items: stretch;
    overflow: hidden;
  }
  #audit .roster,
  #audit .talks-col { min-height: 0; overflow: auto; }
  #audit .talks-col {
    display: flex;
    flex-direction: column;
    margin-top: 0;
    overflow: hidden;
  }
  #audit .talks-list { flex: 1; min-height: 0; overflow: auto; }
  .papers h3.talks { margin-top: 2px; }
}
@media (max-width: 860px) {
  .desk { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 100dvh; }
  .pile { max-height: 46vh; }
  .reader { min-height: 80dvh; border-top: 1px solid var(--line); }
  .reader-top { padding: 16px 16px 0; }
  .thread { padding: 16px; }
  .papers { padding-left: 16px; padding-right: 16px; }
  #pane-apply,
  #pane-audit { display: block; overflow: visible; flex: none; }
  #applications,
  #audit { display: block; overflow: visible; height: auto; }
  #applications .sheet,
  #audit .roster,
  #audit .talks-col,
  #audit .talks-list { overflow: visible; height: auto; }
  #audit .talks-col { display: block; }
}

#pane-thread > .message-nav { flex: none; padding-inline: max(24px, calc((100% - 46rem) / 2)); }
