:root {
  --bg: #f5faff;
  --surface: #ffffffed;
  --soft: #dcedff;
  --primary: #abd3fa;
  --strong: #316997;
  --lav: #e5ddfb;
  --mint: #d9efe7;
  --ink: #283e55;
  --muted: #62758a;
  --danger: #ac4866;
  --line: #dce9f3;
  --shadow: 0 8px 30px #639ac00b;
  font-synthesis: none;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
svg {
  width: 20px;
  height: 20px;
  display: block;
  flex: none;
}
nav svg {
  width: 22px;
  height: 22px;
}
#notifyBtn {
  min-width: 42px;
  display: grid;
  place-items: center;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 66% 0, #e4f1ff 0, transparent 44%),
    linear-gradient(120deg, #f7fbff, #faf9ff);
  color: var(--ink);
  font:
    14px/1.55 Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "PingFang SC",
    "Noto Sans CJK SC",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #578bbf;
  outline-offset: 3px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #83b8e5;
  outline-offset: 1px;
}
button:hover:not(:disabled) {
  filter: brightness(0.98);
}
input,
select,
textarea {
  border: 1px solid #cfdfed;
  background: #fcfeff;
  border-radius: 10px;
  padding: 10px;
  min-width: 0;
  width: 100%;
  resize: vertical;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  margin-bottom: 0;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.3;
}
h2 {
  font-size: 18px;
  line-height: 1.5;
}
h3 {
  font-size: 17px;
  margin: 12px 0 8px;
}
small {
  font-size: 11px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--strong);
  font-weight: 750;
  margin: 0 0 7px;
}
.muted,
.view-note {
  color: var(--muted);
}
.view-note {
  font-size: 12px;
  margin-bottom: 18px;
}
.primary,
.soft {
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.primary {
  background: linear-gradient(120deg, #b7ddff, #c7d4fb);
  color: #284f73;
  border: 1px solid #a8cdeb;
  box-shadow: 0 4px 12px #93b6dd22;
}
.soft {
  background: #ffffffc9;
  border: 1px solid var(--line);
}
.text-button {
  background: transparent;
  color: var(--strong);
  padding: 8px 0;
  font-size: 12px;
  font-weight: 650;
}
.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.empty {
  padding: 25px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.card {
  background: var(--surface);
  border: 1px solid #e2ebf4;
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow-wrap: anywhere;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.025em;
  padding: 4px 8px;
  border-radius: 6px;
  background: #edf4f9;
  color: #536b80;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.badge.running,
.badge.RUNNING,
.badge.IN_PROGRESS {
  background: #e3f2ff;
  color: #2c6898;
}
.badge.NEEDS_HUMAN,
.badge.BLOCKED,
.badge.NEEDS_REVISION {
  background: #fcebf0;
  color: #a64160;
}
.badge.AUDITING,
.badge.SUBMITTED,
.badge.READY_TO_MERGE,
.badge.READY_TO_CLOSE {
  background: #eee9fb;
  color: #6c579a;
}
.badge.CLOSED,
.badge.MERGED {
  background: #e3f3ed;
  color: #346e59;
}
#shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr) 278px;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  min-height: 680px;
  padding: 28px 16px;
  background: #f5faffb3;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 0 34px;
}
.brand-mark,
.crest {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  flex: none;
  border: 1px solid #c2d7ed;
  border-radius: 14px;
  background: linear-gradient(145deg, #e3f3ff, #e6dffa);
  color: #6288b3;
  font-size: 23px;
  box-shadow:
    inset 0 1px 0 white,
    0 5px 14px #a9c6e133;
}
.brand b {
  font-size: 12px;
  letter-spacing: 0.02em;
}
.brand b span {
  font-weight: 500;
}
.brand small,
.zone small,
.rail-head small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.brand small {
  letter-spacing: 0.02em;
}
.nav-caption {
  font-size: 9px;
  letter-spacing: 0.13em;
  color: var(--muted);
  padding: 0 12px 13px;
}
nav {
  display: grid;
  gap: 5px;
}
nav button {
  display: flex;
  gap: 12px;
  align-items: center;
  background: transparent;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  text-align: left;
  color: var(--muted);
  min-height: 49px;
}
nav i {
  font-style: normal;
  font-size: 21px;
  width: 24px;
  text-align: center;
  color: #7193b1;
}
nav span {
  font-size: 12px;
}
nav small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.035em;
}
nav button.active,
nav button:hover {
  background: #fff;
  color: #2c608d;
  border-color: #d6e6f5;
  box-shadow: 0 4px 14px #88acd811;
}
nav button.active i {
  color: #487aab;
}
.zone {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 0;
  border-top: 1px solid var(--line);
}
.zone b {
  font-size: 11px;
}
.zone > span {
  display: grid;
  place-items: center;
  border: 3px solid #cae4e4;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}
main {
  padding: 30px 28px 40px;
  min-width: 0;
}
header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-actions .soft {
  padding: 8px 11px;
}
#refreshBtn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 19px;
}
#refreshBtn small {
  font-size: 10px;
  font-weight: 500;
}
#notifyBtn {
  font-size: 19px;
}
.hero-alert {
  padding: 20px 23px;
  border: 1px solid #efcdd9;
  background: linear-gradient(105deg, #fffafb, #fff4f7 70%, #f3efff);
  border-radius: 19px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 5px 22px #cb8bac09;
}
.hero-alert.clear {
  background: linear-gradient(110deg, #fafdff, #edf6ff 70%, #f1edfc);
  border-color: #d4e5f4;
}
.hero-alert .eyebrow {
  color: #8f5875;
}
.hero-alert.clear .eyebrow {
  color: var(--strong);
}
.hero-alert strong {
  font-size: 17px;
  letter-spacing: 0.02em;
}
.hero-alert .count {
  font-size: 32px;
  color: var(--danger);
  margin-right: 13px;
  font-weight: 550;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.hero-alert.clear .count {
  color: #608bac;
}
.hero-alert p:not(.eyebrow) {
  margin: 5px 0;
  color: #735166;
  font-size: 12px;
}
.hero-alert.clear p:not(.eyebrow) {
  color: var(--ink);
}
.hero-alert small {
  color: var(--muted);
}
.human-next {
  font-size: 12px;
  color: #88435f;
  overflow-wrap: anywhere;
  max-width: 620px;
}
.deck-summary {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 15px 4px;
  color: var(--muted);
  font-size: 11px;
  flex-wrap: wrap;
}
.deck-summary > span,
.deck-summary button {
  display: flex;
  gap: 6px;
  align-items: center;
}
.deck-summary b {
  color: var(--ink);
  font-size: 15px;
}
.deck-summary button {
  background: transparent;
  font-size: 11px;
  padding: 0;
  color: var(--muted);
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6fae99;
}
.relay {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #ffffffa8;
  margin-bottom: 22px;
}
.relay-step {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  padding: 9px 10px;
  border-radius: 8px;
  min-width: 0;
  text-align: left;
}
.relay-step > span {
  font-size: 9px;
  color: #859aad;
}
.relay-step b {
  font-size: 11px;
  font-weight: 600;
}
.relay-step small {
  margin-left: auto;
  color: #6483a5;
}
.relay-step:not(:last-child) {
  border-right: 1px solid #e9eff7;
}
.relay-step.current {
  background: #e6effd;
  color: #35618e;
  box-shadow: inset 0 0 0 1px #c5daf2;
}
.section-title {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 12px;
}
.section-title h2 {
  font-size: 15px;
  margin: 0;
  letter-spacing: 0.01em;
}
.section-title h2 small {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}
.section-title > span {
  color: var(--muted);
  font-size: 11px;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.project-card {
  padding: 16px;
}
.project-top {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.project-top .eyebrow {
  margin: 0 auto 0 0;
  font-size: 9px;
}
.project-top > .muted {
  font-size: 10px;
}
.project-icon {
  width: 28px;
  height: 28px;
  border: 1px solid #d4e4f5;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #edf7ff, #eeebfb);
  color: var(--strong);
  font-size: 12px;
}
.title-button {
  background: none;
  padding: 0;
  text-align: left;
  font: inherit;
  line-height: 1.4;
}
.project-next {
  font-size: 12px;
  min-height: 32px;
  color: var(--muted);
  margin-bottom: 12px;
}
.project-foot {
  border-top: 1px solid #edf2f8;
  margin-top: 10px;
  padding-top: 8px;
  display: grid;
  gap: 3px;
  font-size: 10px;
  color: var(--muted);
}
.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}
.column {
  background: #eaf2fa7a;
  border: 1px solid #dce8f3;
  border-radius: 14px;
  padding: 9px;
  min-height: 195px;
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
}
.column-head {
  display: flex;
  justify-content: space-between;
  padding: 4px 3px 12px;
  font-size: 11px;
  font-weight: 650;
}
.column-head > span:last-child {
  background: #fff;
  border-radius: 5px;
  padding: 0 6px;
  color: var(--muted);
}
.ticket {
  display: block;
  width: 100%;
  text-align: left;
  background: white;
  border: 1px solid #dfeaf4;
  border-radius: 11px;
  padding: 12px;
  margin-bottom: 9px;
  box-shadow: 0 3px 8px #6894b508;
  overflow-wrap: anywhere;
}
.ticket:hover {
  border-color: #afc9e6;
  box-shadow: 0 5px 16px #6894b517;
}
.ticket b {
  display: block;
  margin: 6px 0 9px;
  font-size: 13px;
  line-height: 1.5;
}
.ticket small {
  color: var(--muted);
  font-size: 10px;
  display: block;
}
.ticket-project {
  margin-top: 8px;
}
.ticket-owner {
  font-size: 11px;
  margin-bottom: 3px;
}
.ticket-next {
  font-size: 11px;
  color: var(--strong);
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px solid #eef3f8;
}
.ticket-next:before {
  content: "→ ";
  color: #8da9c3;
}
.order-grid,
.entity-grid,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.order-grid .ticket {
  padding: 18px;
}
.entity-grid dl {
  font-size: 12px;
}
.filters {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  padding: 14px;
  background: #ffffffa8;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.filters label {
  flex: 1;
  min-width: 140px;
}
.filters .search {
  flex: 1.5;
}
.filters input,
.filters select {
  font-size: 12px;
}
.detail-top {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.detail-top .muted {
  font-size: 12px;
}
dl {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr);
  gap: 10px;
  margin: 16px 0;
  font-size: 13px;
}
dt {
  color: var(--muted);
  font-size: 11px;
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
code {
  font-size: 11px;
  overflow-wrap: anywhere;
}
.blocker,
#offlineBanner {
  padding: 12px;
  border: 1px solid #efcdd9;
  border-radius: 10px;
  background: #fff3f7;
  color: #984463;
  font-size: 12px;
}
#offlineBanner {
  margin-bottom: 15px;
}
.raw-detail {
  margin-top: 15px;
}
summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.7;
  background: #f4f8fd;
  padding: 16px;
  border-radius: 12px;
  max-height: 60vh;
  overflow: auto;
}
.context-card {
  margin-top: 12px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  text-align: left;
  padding: 13px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  vertical-align: top;
  min-width: 110px;
  max-width: 340px;
  overflow-wrap: anywhere;
}
.table th {
  color: var(--muted);
  background: #f4f9fd;
  font-size: 10px;
  letter-spacing: 0.03em;
}
.needs-list {
  display: grid;
  gap: 14px;
}
.needs-item {
  border-left: 3px solid #d68ba4;
}
.needs-item h2 {
  margin: 10px 0 4px;
}
.needs-item > p {
  font-size: 12px;
}
.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: #ffffff94;
  border-left: 1px solid var(--line);
  padding: 28px 18px 18px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.rail-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 16px;
}
.rail-head b {
  font-size: 15px;
}
.snapshot-label {
  font-size: 8px;
  letter-spacing: 0.08em;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
}
.runner-mini {
  margin: 8px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6faff;
}
.runner-mini > div {
  display: flex;
  justify-content: space-between;
  gap: 7px;
}
.runner-mini b {
  font-size: 12px;
}
.runner-mini small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  overflow-wrap: anywhere;
  margin-top: 7px;
}
.rail .section-title {
  margin: 20px 0 0;
}
.rail .section-title h2 {
  font-size: 12px;
}
.feed {
  overflow: auto;
  flex: 1;
  min-height: 50px;
  margin-top: 8px;
}
.event {
  padding: 13px 4px;
  border-bottom: 1px solid #eaf0f7;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.event b {
  color: var(--strong);
  font-size: 10px;
}
.event time {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 5px;
}
.message {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.message label {
  font-size: 9px;
}
.message select {
  font-size: 11px;
  padding: 7px;
  margin-bottom: 9px;
}
.message > div {
  display: flex;
}
.message input {
  min-width: 0;
  flex: 1;
  border-radius: 9px 0 0 9px;
  font-size: 11px;
}
.message button {
  width: 38px;
  background: #d4e9fc;
  border-radius: 0 9px 9px 0;
}
.message > small {
  font-size: 9px;
  display: block;
  margin-top: 5px;
}
.login {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 28%, #dfedff, transparent 55%), var(--bg);
  z-index: 20;
  padding: 20px;
}
.login-card {
  width: min(420px, 100%);
  padding: 36px;
  background: #ffffffd9;
  border: 1px solid white;
  border-radius: 25px;
  box-shadow: 0 25px 70px #4e9ce621;
  text-align: center;
}
.login-card .crest {
  margin: 0 auto 25px;
  width: 48px;
  height: 54px;
}
.login-card h1 {
  font-size: 24px;
}
.login-card > p.muted {
  font-size: 12px;
  margin: 13px 0 26px;
}
.login-card label {
  text-align: left;
}
.login-card input {
  margin: 7px 0 14px;
}
.login-card button {
  width: 100%;
  padding: 13px;
  border: 1px solid #b6d5ef;
  border-radius: 11px;
  background: linear-gradient(120deg, #c1e1fc, #dbdffa);
  font-weight: 650;
}
.login-card > small {
  display: block;
  margin-top: 20px;
}
.error {
  color: var(--danger);
  margin-top: 8px;
  font-size: 12px;
}
dialog {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  border: 1px solid white;
  border-radius: 21px;
  padding: 0;
  background: #fbfdff;
  box-shadow: 0 30px 90px #26364d33;
}
dialog::backdrop {
  background: #304d6b45;
  backdrop-filter: blur(6px);
}
dialog form,
.confirm-body {
  padding: 26px;
}
.dialog-head,
.dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.dialog-head h2 {
  margin-bottom: 12px;
  font-size: 22px;
}
.icon {
  background: none;
  font-size: 25px;
  width: 44px;
  height: 44px;
  flex: none;
}
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.config-grid {
  grid-template-columns: 1fr 2fr 1fr;
}
label {
  display: grid;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.preview {
  margin: 16px 0;
  padding: 13px;
  background: #edf5ff;
  border: 1px solid #dce9f9;
  border-radius: 10px;
  color: var(--strong);
  font-size: 12px;
}
.intake-owner {
  font-size: 11px;
  margin: 12px 0;
}
.dialog-actions {
  justify-content: flex-end;
  gap: 8px;
}
#dispatchDialog {
  max-width: 500px;
}
#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  background: #294963;
  color: white;
  padding: 13px 17px;
  border-radius: 12px;
  margin-top: 7px;
  box-shadow: var(--shadow);
  font-size: 12px;
}
#content:has(> .deck-summary) {
  display: flex;
  flex-direction: column;
}
#content:has(> .deck-summary) > .relay {
  margin-bottom: 0;
}
@media (min-width: 1700px) {
  #shell {
    grid-template-columns: 238px minmax(0, 1fr) 306px;
  }
  main {
    padding: 36px 40px;
  }
  .sidebar {
    padding: 34px 22px;
  }
  .hero-alert {
    padding: 25px 28px;
  }
  .project-card {
    padding: 20px;
  }
  .project-next {
    min-height: 38px;
  }
  .column {
    min-height: 230px;
  }
  .ticket {
    padding: 15px;
  }
  .rail {
    padding: 34px 22px;
  }
}
@media (max-width: 1250px) {
  #shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .rail {
    display: none;
  }
  main {
    padding: 26px 24px;
  }
  .sidebar {
    padding: 26px 12px;
  }
  .brand {
    gap: 6px;
  }
  .brand b {
    font-size: 11px;
  }
  .brand small {
    font-size: 9px;
  }
}
@media (max-width: 850px) {
  #shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }
  .sidebar {
    padding: 22px 9px;
  }
  .brand div,
  .zone div,
  .nav-caption {
    display: none;
  }
  .brand {
    justify-content: center;
  }
  nav button {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 7px 2px;
  }
  nav span {
    font-size: 9px;
  }
  nav small {
    display: none;
  }
  .zone {
    padding: 12px 0;
    justify-content: center;
  }
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  header {
    flex-wrap: wrap;
  }
  .header-actions {
    margin-left: auto;
  }
  .relay-step {
    padding: 8px 5px;
    gap: 4px;
  }
}
@media (max-width: 600px) {
  #shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    z-index: 10;
    bottom: 0;
    top: auto;
    height: auto;
    min-height: 0;
    width: 100%;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: #fafdfff5;
    backdrop-filter: blur(18px);
    border: 0;
    border-top: 1px solid #d5e4f2;
  }
  .brand,
  .zone {
    display: none;
  }
  nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  nav button {
    flex: 0 0 57px;
    min-height: 51px;
    padding: 4px 3px;
    border-radius: 10px;
    gap: 0;
  }
  nav i {
    font-size: 20px;
    line-height: 24px;
  }
  nav span {
    display: block;
    font-size: 10px;
    white-space: nowrap;
  }
  nav small {
    display: none;
  }
  main {
    padding: calc(21px + env(safe-area-inset-top)) 16px
      calc(90px + env(safe-area-inset-bottom));
  }
  header {
    gap: 14px;
    margin-bottom: 20px;
    align-items: center;
  }
  h1 {
    font-size: 25px;
  }
  header > div:first-child {
    width: 100%;
  }
  .header-actions {
    margin-left: 0;
    width: 100%;
    gap: 8px;
  }
  #importBtn {
    margin-left: auto;
  }
  .header-actions .soft {
    min-height: 40px;
  }
  #refreshBtn small {
    font-size: 10px;
  }
  .hero-alert {
    padding: 17px;
    display: block;
    border-radius: 17px;
  }
  .hero-alert strong {
    font-size: 16px;
  }
  .hero-alert .count {
    font-size: 29px;
  }
  .hero-alert .soft {
    margin-top: 14px;
    width: 100%;
    min-height: 40px;
  }
  .human-next {
    font-size: 12px;
  }
  .deck-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding: 14px 2px;
  }
  .relay {
    margin-bottom: 18px;
    padding: 4px;
  }
  .relay-step {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 7px 0;
  }
  .relay-step b {
    font-size: 10px;
  }
  .relay-step small {
    margin: 0;
    font-size: 10px;
    min-height: 15px;
  }
  .project-grid,
  .order-grid,
  .entity-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .project-card {
    padding: 16px;
  }
  .project-next {
    min-height: 0;
  }
  .project-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
  }
  .project-grid {
    gap: 10px;
  }
  .board {
    grid-template-columns: 1fr;
  }
  .column {
    min-height: 100px;
    max-height: none;
    overflow: visible;
  }
  .column .empty {
    padding: 13px;
  }
  .section-title {
    margin-top: 20px;
  }
  .section-title h2 {
    font-size: 14px;
  }
  .section-title h2 small {
    font-size: 10px;
  }
  .filters {
    padding: 12px;
    gap: 10px;
  }
  .filters label {
    min-width: 120px;
  }
  .filters .search {
    flex-basis: 100%;
  }
  .filters .soft {
    width: 100%;
  }
  .card {
    padding: 17px;
    border-radius: 15px;
  }
  dl {
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 10px;
    font-size: 12px;
  }
  .detail-top {
    gap: 8px;
  }
  .grid4,
  .config-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .config-grid label:nth-child(2) {
    grid-column: 1/-1;
    grid-row: 2;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  dialog {
    max-height: calc(100dvh - 24px);
    width: calc(100vw - 24px);
    border-radius: 18px;
  }
  dialog form,
  .confirm-body {
    padding: 18px;
  }
  .dialog-head h2 {
    font-size: 20px;
  }
  .dialog-head .eyebrow {
    font-size: 9px;
  }
  .dialog-actions {
    position: sticky;
    bottom: -18px;
    background: #fbfdfff5;
    padding: 12px 0;
    flex-wrap: wrap;
  }
  .intake-owner {
    font-size: 10px;
  }
  .preview {
    font-size: 11px;
  }
  .table th,
  .table td {
    font-size: 11px;
  }
  .context-card h2 {
    font-size: 15px;
  }
  #toast {
    bottom: calc(80px + env(safe-area-inset-bottom));
    right: 16px;
  }
  .login-card {
    padding: 28px;
  }
  .login-card h1 {
    font-size: 23px;
  }
}
@media (display-mode: standalone) {
  body {
    overscroll-behavior-y: contain;
  }
  .sidebar {
    user-select: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
