/* 声景科学排期系统 — 设计系统
   编辑部工作台：蓝灰底、白色表面、深青强调；系统中文字体；紧凑但不拥挤。
   组件与用法见 docs/ui.md。不依赖任何框架。 */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --line: #e1e6ec;
  --line-strong: #cbd3dc;
  --ink: #1c2733;
  --ink-2: #4f5b6b;
  --ink-3: #8593a3;
  --accent: #0e6f6a;
  --accent-strong: #0a5754;
  --accent-soft: #e3f1ef;
  --accent-ring: rgba(14, 111, 106, 0.28);
  --ok: #1f7a4d;
  --ok-bg: #e6f4ec;
  --warn: #b45309;
  --warn-bg: #fff3e0;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --info: #2a5bc7;
  --info-bg: #e8effc;
  --neutral: #4f5b6b;
  --neutral-bg: #eef1f5;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.04);
  --shadow-pop: 0 8px 24px rgba(16, 24, 40, 0.14);
  --font: -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1180px;
  color-scheme: light;
}

/* ───────── 基础 ───────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 10px;
  letter-spacing: -0.005em;
}
h1 {
  font-size: 24px;
}
h2 {
  font-size: 19px;
}
h3 {
  font-size: 16px;
  margin-top: 24px;
}
h4 {
  font-size: 14.5px;
  margin-top: 16px;
}
h2 small,
h3 small,
h4 small,
.page-title small,
.count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  margin-left: 4px;
}
p {
  margin: 0 0 10px;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
small {
  font-size: 13px;
}
code,
pre {
  font-family: var(--mono);
  font-size: 0.92em;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}
ul,
ol {
  padding-left: 1.3em;
  margin: 0 0 10px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.muted {
  color: var(--ink-3);
}
.num,
.big,
.kpi-value,
td.num {
  font-variant-numeric: tabular-nums;
}
td.num,
th.num {
  text-align: right;
}
td.name {
  white-space: nowrap;
}

/* ───────── 顶栏与导航 ───────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}
.brand-mark i {
  display: block;
  width: 3px;
  border-radius: 1px;
  background: var(--accent);
}
.brand-mark i:nth-child(1) {
  height: 7px;
}
.brand-mark i:nth-child(2) {
  height: 13px;
}
.brand-mark i:nth-child(3) {
  height: 16px;
}
.brand-mark i:nth-child(4) {
  height: 10px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.nav-group {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-group + .nav-group::before {
  content: "";
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 8px;
}
.nav a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 14px;
  white-space: nowrap;
}
.nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}
.nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
}
.nav-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}
.nav-user .name {
  font-weight: 600;
  color: var(--ink);
}
.nav-toggle {
  display: none;
}

/* ───────── 页面骨架 ───────── */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 22px 24px 40px;
}
.footer {
  padding-top: 0;
  color: var(--ink-3);
  font-size: 12.5px;
  text-align: center;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}
.page-title {
  font-size: 24px;
  margin: 0;
}
.page-sub {
  margin: 4px 0 0;
  color: var(--ink-3);
  font-size: 13.5px;
}
.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
/* 还没改成 .page-head 的页面也有同样的观感 */
main > h2:first-child {
  font-size: 24px;
  margin: 0 0 4px;
}
main > h2:first-child + p.muted,
main > h2:first-child + p {
  margin: 0 0 18px;
  font-size: 13.5px;
}
section {
  margin-bottom: 8px;
}
section > h3 {
  margin: 22px 0 10px;
}
section > h3:first-child {
  margin-top: 4px;
}
.back {
  display: inline-block;
  font-size: 13px;
  margin-bottom: 8px;
}

/* ───────── 卡片 ───────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.card > h3:first-child,
.card > h4:first-child {
  margin-top: 0;
}
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}
.card-title small {
  font-weight: 500;
  color: var(--ink-3);
}
.card.compact {
  padding: 12px 14px;
}

/* 论文卡片：左侧状态色条 */
.paper {
  display: grid;
  gap: 5px;
  padding: 13px 16px 13px 18px;
  border-left: 3px solid var(--line-strong);
}
.paper[data-tone="ok"] {
  border-left-color: var(--ok);
}
.paper[data-tone="warn"] {
  border-left-color: var(--warn);
}
.paper[data-tone="danger"] {
  border-left-color: var(--danger);
}
.paper[data-tone="info"] {
  border-left-color: var(--info);
}
.paper-title {
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.4;
  margin: 0;
}
.paper-title a {
  color: var(--ink);
}
.title-en {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.4;
}
.authors {
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.meta {
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.meta > * + *::before {
  content: "·";
  color: var(--line-strong);
  margin-right: 10px;
}
.meta > form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.meta > a {
  color: var(--accent);
}
.paper .actions {
  margin-top: 2px;
}

/* ───────── 状态标签 ───────── */
.badge,
.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  background: var(--neutral-bg);
  color: var(--neutral);
  vertical-align: middle;
}
.badge-ok,
.badge-done {
  background: var(--ok-bg);
  color: var(--ok);
}
.badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge-info {
  background: var(--info-bg);
  color: var(--info);
}
.badge-accent {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.overdue {
  color: var(--danger);
  font-weight: 600;
}
.low-priority {
  opacity: 0.55;
}
.protected {
  color: var(--ok);
  font-weight: 600;
}

/* ───────── 按钮 ───────── */
button,
.btn,
a[role="button"],
input[type="submit"] {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  width: auto;
  margin: 0;
  transition: background 0.12s ease, border-color 0.12s ease;
}
button:hover,
.btn:hover,
a[role="button"]:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  text-decoration: none;
  color: #fff;
}
button.secondary,
.btn-secondary,
a[role="button"].secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
button.secondary:hover,
.btn-secondary:hover,
a[role="button"].secondary:hover {
  background: var(--surface-2);
  border-color: var(--ink-3);
  color: var(--ink);
}
button.outline,
.btn-ghost,
a[role="button"].outline {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
}
button.outline:hover,
.btn-ghost:hover,
a[role="button"].outline:hover {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-strong);
}
button.danger,
.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: #efc4bf;
}
button.danger:hover,
.btn-danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}
button.link {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 500;
}
button.link:hover {
  background: none;
  text-decoration: underline;
  color: var(--accent-strong);
}
button:disabled,
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-sm,
.actions button,
.actions a[role="button"],
td button,
td a[role="button"],
.card-title button,
.card-title a[role="button"] {
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
}
.btn-block {
  width: 100%;
}

/* ───────── 表单 ───────── */
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="file"]), select, textarea) {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  margin: 0;
}
select {
  padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%234f5b6b' stroke-width='1.6' d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none;
}
textarea {
  height: auto;
  min-height: 84px;
  padding: 8px 10px;
  line-height: 1.5;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
input::placeholder,
textarea::placeholder {
  color: var(--ink-3);
}
input[type="file"] {
  font-size: 13px;
}
input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  vertical-align: middle;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin: 0 0 12px;
}
label > input:not([type="checkbox"]):not([type="radio"]),
label > select,
label > textarea {
  margin-top: 6px;
  font-weight: 400;
}
label:has(> input[type="checkbox"]:first-child),
label:has(> input[type="radio"]:first-child) {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  color: var(--ink);
}
.help {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 0 0 12px;
}
label + .help,
.form-grid + .help {
  margin-top: -6px;
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 12px;
}
.checks label {
  margin: 0;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 12px;
}
/* 行内小表单：一行里放输入与按钮 */
.actions,
.inline-form,
form.inline,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.actions form,
.toolbar form,
form.inline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.actions input:not([type="checkbox"]):not([type="radio"]),
.actions select,
.inline-form input:not([type="checkbox"]):not([type="radio"]),
.inline-form select,
.toolbar input:not([type="checkbox"]):not([type="radio"]),
.toolbar select,
td input:not([type="checkbox"]):not([type="radio"]),
td select {
  width: auto;
  height: 30px;
  font-size: 13px;
}
.toolbar {
  margin: 0 0 14px;
}
.inline-form label,
.toolbar label,
.actions label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 400;
  white-space: nowrap;
}
.inline-form label > input,
.toolbar label > input,
.actions label > input,
.inline-form label > select,
.toolbar label > select {
  margin-top: 0;
}
.page-actions form,
.card-title form {
  margin: 0;
}
.card-title .actions {
  margin-left: auto;
}
.toolbar input[type="search"],
.toolbar input[type="text"] {
  min-width: 220px;
}
.actions > a:not([role="button"]) {
  font-size: 13px;
}
.actions small {
  font-size: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 16px;
}

/* ───────── 表格 ───────── */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.card .table-wrap {
  border: 0;
  border-radius: 0;
  margin: 0 -18px 0;
  width: calc(100% + 36px);
  border-top: 1px solid var(--line);
}
.card > .table-wrap:last-child {
  margin-bottom: -16px;
}
.card > .table-wrap:first-child {
  border-top: 0;
  margin-top: -16px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--surface-2);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover td {
  background: #fafbfc;
}
td.actions,
th.actions {
  display: table-cell;
  white-space: nowrap;
}
td.actions > form,
td.actions > a[role="button"],
td.actions > button {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 6px 4px 0;
}
td .paper-title {
  font-size: 14px;
}
td .authors,
td .title-en {
  font-size: 12.5px;
}
td .title-en {
  margin-top: 2px;
}
tr.merge-row td {
  background: var(--surface-2);
  padding-top: 6px;
  padding-bottom: 8px;
}

/* ───────── KPI 小卡 ───────── */
.stat-grid,
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stat-grid .card,
.kpi {
  margin: 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.big,
.kpi-value {
  display: block;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.kpi-label,
.stat-grid .card .muted {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 3px;
}
.kpi.warn .kpi-value {
  color: var(--warn);
}
.kpi.ok .kpi-value {
  color: var(--ok);
}

/* ───────── 提示、空状态、时间线 ───────── */
.messages {
  position: fixed;
  top: 66px;
  right: 16px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(440px, calc(100vw - 32px));
}
.msg {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--info);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  box-shadow: var(--shadow-pop);
  font-size: 13.5px;
  animation: msg-in 0.2s ease, msg-out 0.5s ease 6s forwards;
}
.msg-success {
  border-left-color: var(--ok);
}
.msg-error {
  border-left-color: var(--danger);
}
.msg-warning {
  border-left-color: var(--warn);
}
@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}
@keyframes msg-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}
.empty {
  padding: 22px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13.5px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--line);
}
.timeline li {
  position: relative;
  padding: 0 0 12px 12px;
  font-size: 13.5px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 3px var(--surface);
}
.timeline li:first-child::before {
  background: var(--accent);
}
.timeline time {
  color: var(--ink-3);
  font-size: 12.5px;
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
}
.timeline .who {
  color: var(--ink-2);
  font-weight: 500;
}
.timeline .muted {
  color: var(--ink-3);
}
.kv {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.kv th {
  width: 7em;
  background: none;
  color: var(--ink-3);
  font-weight: 500;
  padding: 7px 10px 7px 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: top;
}
.kv td {
  padding: 7px 0;
  overflow-wrap: anywhere;
}
.kv td.num {
  text-align: left;
}
.kv tr:last-child th,
.kv tr:last-child td {
  border-bottom: 0;
}

/* ───────── 布局辅助 ───────── */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
.two-col > aside .card {
  padding: 14px 16px;
}
.two-col > aside .card > form + form,
.form-list > form + form {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  margin-top: 10px;
}
.two-col > aside .card > form label:last-of-type {
  margin-bottom: 8px;
}
.stack > * + * {
  margin-top: 12px;
}
.split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-3);
}
.flow .badge {
  height: 24px;
}
.flow .arrow {
  color: var(--line-strong);
}
.board-summary .badge {
  margin: 0 4px 6px 0;
}
.board-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 10px;
}
.board-cards .card {
  margin: 0;
}

/* ───────── 日历 ───────── */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.cal-head {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
  margin-bottom: 4px;
}
.cal-head > * {
  font-weight: 600;
}
.calendar .day {
  min-height: 92px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 12.5px;
}
.calendar .day.pad {
  background: transparent;
  border-color: transparent;
}
.calendar .day.today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.calendar .day.two-plus {
  background: var(--warn-bg);
}
.calendar .day .n {
  display: block;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.calendar .day.today .n {
  color: var(--accent);
}
.calendar .day a,
.calendar .day .entry {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.month-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13.5px;
}
.month-nav .current {
  font-weight: 600;
  font-size: 15px;
}

/* ───────── 登录页 ───────── */
.login {
  max-width: 380px;
  margin: 8vh auto 0;
}
.login .brand {
  justify-content: center;
  margin-bottom: 18px;
  font-size: 17px;
}
.login button {
  width: 100%;
  height: 38px;
}

/* ───────── 杂项 ───────── */
textarea.copy {
  font-family: var(--mono);
  font-size: 12.5px;
  min-height: 18rem;
  line-height: 1.5;
}
.pool-title {
  min-width: 260px;
}
.links a {
  margin-right: 6px;
  white-space: nowrap;
}
.nowrap,
td .protected,
td.links {
  white-space: nowrap;
}
details > summary {
  cursor: pointer;
  color: var(--ink-2);
  font-size: 13.5px;
}
::selection {
  background: var(--accent-soft);
}

/* ───────── 响应式 ───────── */
@media (max-width: 900px) {
  .topbar-inner {
    flex-wrap: wrap;
    padding: 8px 16px;
    min-height: 52px;
    gap: 8px;
  }
  .brand {
    order: 1;
  }
  .nav-toggle {
    display: inline-flex;
    order: 2;
    margin-left: auto;
    height: 34px;
  }
  .nav {
    display: none;
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 6px 0 10px;
  }
  .nav.open {
    display: flex;
  }
  .nav-group {
    flex-wrap: wrap;
    gap: 4px;
  }
  .nav-group + .nav-group {
    padding-top: 6px;
    border-top: 1px solid var(--line);
  }
  .nav-group + .nav-group::before {
    display: none;
  }
  .nav a {
    height: 38px;
    font-size: 14.5px;
  }
  .nav-user {
    margin-left: 0;
    padding-top: 6px;
    border-top: 1px solid var(--line);
  }
  .wrap {
    padding: 16px 14px 32px;
  }
  .page-title,
  main > h2:first-child {
    font-size: 21px;
  }
  .card {
    padding: 14px;
  }
  .card .table-wrap {
    margin: 0 -14px -14px;
    width: calc(100% + 28px);
  }
  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }
  .calendar {
    display: block;
  }
  .cal-head {
    display: none;
  }
  .calendar .day {
    min-height: 0;
    margin-bottom: 4px;
  }
  .calendar .day.pad,
  .calendar .day:empty {
    display: none;
  }
  .calendar .day a,
  .calendar .day .entry {
    white-space: normal;
  }
  button,
  .btn,
  a[role="button"] {
    min-height: 36px;
  }
  .actions button,
  .actions a[role="button"],
  td button {
    min-height: 32px;
  }
  .messages {
    top: auto;
    bottom: 12px;
    left: 12px;
    right: 12px;
    max-width: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .msg {
    animation: none;
  }
  * {
    transition: none !important;
  }
}
