/* =========================================================
   移动端 UI —— mobile-first components
   ----------------------------------------------------------------
   设计令牌:
   - 安全区:env(safe-area-inset-top/bottom) → iOS 刘海/灵动岛/底部手势条
   - 顶部 AppBar:高 56px;底部 TabBar:高 64px;FAB:右下 16px inset
   - 触摸目标 ≥ 44 x 44 CSS px
   - 圆角:卡片 16 / 按钮 12 / 输入框 12 / Chip 999
   - 颜色延用 CSS 变量(var(--brand) / var(--primary))
   ========================================================= */

/* ---------- 设计令牌(Mobile 局部覆盖) ---------- */
:root {
  --m-safe-top: env(safe-area-inset-top, 0px);
  --m-safe-bottom: env(safe-area-inset-bottom, 0px);
  --m-appbar-h: 56px;
  --m-tabbar-h: 64px;
  --m-fab-size: 56px;
  --m-tap-target: 44px;
  --m-radius-card: 16px;
  --m-radius-btn: 12px;
  --m-radius-input: 12px;
  --m-gap-y: 12px;
  --m-control-bg: #ffffff;
  --m-control-bg-muted: #edf2ff;
  --m-control-border: rgba(29, 64, 174, 0.24);
  --m-control-border-strong: rgba(29, 64, 174, 0.38);
  --m-control-text: #24324d;
  --m-control-shadow: 0 3px 10px rgba(28, 47, 94, 0.10);
}

html[data-layout='mobile'] body {
  font-size: 14px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

/* ---------- 滚动锁定(Sheet/ActionSheet 打开时禁止背景滚动) ---------- */
html[data-layout='mobile'].m-scroll-locked {
  overflow: hidden !important;
}
html[data-layout='mobile'] body.m-scroll-locked {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  overscroll-behavior: none;
}

/* ---------- 全局骨架:固定 AppBar + 主区 + TabBar ---------- */
.mobile-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--surface-soft, #f3f6fb);
  color: var(--ink);
}
html[data-theme='dark'] .mobile-shell {
  background: #0b1020;
}

.m-appbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(var(--m-appbar-h) + var(--m-safe-top));
  padding: var(--m-safe-top) 8px 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-soft, rgba(0,0,0,0.06));
}
html[data-theme='dark'] .m-appbar {
  background: rgba(11,16,32,0.92);
  border-bottom-color: rgba(255,255,255,0.08);
}
.m-appbar-title {
  position: absolute;
  left: 50%;
  top: var(--m-safe-top);
  transform: translateX(-50%);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  max-width: calc(100% - 120px);
  height: var(--m-appbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
}
.m-appbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 44px;
}
.m-appbar-actions .m-icon-btn:last-child {
  margin-right: 4px;
}

.m-icon-btn,
.m-appbar > button,
.m-tab-item,
.m-fab,
.m-card,
.m-segmented-control,
.m-list-row,
.m-sheet-grabber,
button,
[role="button"] {
  /* reset */
}

.m-icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--m-control-bg);
  border: 1px solid var(--m-control-border);
  box-shadow: var(--m-control-shadow);
  cursor: pointer;
  color: var(--m-control-text);
  text-decoration: none;
  font-size: 0;
}
.m-icon-btn:active {
  background: var(--m-control-bg-muted);
  border-color: var(--m-control-border-strong);
}
html[data-theme='dark'] .m-icon-btn {
  background: #141a2e;
  border-color: rgba(168,188,255,0.28);
  box-shadow: 0 3px 10px rgba(0,0,0,0.24);
  color: var(--ink);
}
html[data-theme='dark'] .m-icon-btn:active {
  background: #202b42;
}
.m-icon-btn .material-symbols-outlined {
  font-size: 24px;
}

.m-main {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 12px 16px calc(var(--m-tabbar-h) + var(--m-safe-bottom) + 16px);
  /* 当 FAB 出现时给底部留多一点空间 */
}
.m-main > * {
  min-width: 0;
  max-width: 100%;
}
.m-main--no-tabbar {
  padding-bottom: calc(var(--m-safe-bottom) + 16px);
}

/* ---------- 底部 Tab Bar ---------- */
.m-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  min-height: calc(var(--m-tabbar-h) + var(--m-safe-bottom));
  padding: 6px 0 calc(6px + var(--m-safe-bottom));
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-soft, rgba(0,0,0,0.06));
}
html[data-theme='dark'] .m-tabbar {
  background: rgba(11,16,32,0.92);
  border-top-color: rgba(255,255,255,0.08);
}
.m-tab-item {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--m-tap-target);
  padding: 6px 4px;
  border-radius: 12px;
  background: transparent;
  border: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  color: var(--text-soft);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}
.m-tab-item .material-symbols-outlined {
  font-size: 24px;
  font-variation-settings: 'wght' 400;
}
.m-tab-item.is-active {
  color: var(--brand, var(--primary));
}
.m-tab-item.is-active .material-symbols-outlined {
  font-variation-settings: 'wght' 600;
}
.m-tab-item .badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 30px);
  transform: none;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  font-weight: 600;
}
.m-tab-fab-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--m-tabbar-h);
}
.m-tab-fab-slot .m-tab-fab {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--brand, var(--primary));
  color: #fff;
  border: 0;
  margin-top: -22px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(29,64,174,0.35);
  transition: transform 0.15s ease;
  font-size: 0;
  text-decoration: none;
}
html[data-theme='dark'] .m-tab-fab-slot .m-tab-fab {
  border-color: #0b1020;
}
.m-tab-fab-slot .m-tab-fab:active {
  transform: scale(0.94);
}
.m-tab-fab-slot .m-tab-fab.is-current {
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--brand, var(--primary)) 18%, transparent),
    0 4px 16px rgba(29,64,174,0.35);
}
.m-tab-fab-slot .m-tab-fab .material-symbols-outlined {
  font-size: 28px;
  color: #fff;
}

/* ---------- FAB(独立浮于右下) ---------- */
.m-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(var(--m-tabbar-h) + var(--m-safe-bottom) + 16px);
  width: var(--m-fab-size);
  height: var(--m-fab-size);
  border-radius: 999px;
  background: var(--brand, var(--primary));
  color: #fff;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
  font-size: 0;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(29,64,174,0.40);
  transition: transform 0.15s ease, opacity 0.2s ease;
}
.m-fab:active { transform: scale(0.94); }
.m-fab.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(40px);
}
.m-fab .material-symbols-outlined { font-size: 28px; color: #fff; }
.m-fab--extended {
  width: auto;
  padding: 0 18px;
  border-radius: 999px;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- 卡片 ---------- */
.m-card {
  display: block;
  background: var(--surface, #fff);
  border-radius: var(--m-radius-card);
  padding: 16px;
  margin-bottom: var(--m-gap-y);
  box-shadow: 0 1px 3px rgba(15,23,42,0.04), 0 0 0 1px rgba(15,23,42,0.04);
  text-decoration: none;
  color: inherit;
}
html[data-theme='dark'] .m-card {
  background: #141a2e;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06);
}
.m-card--flat { box-shadow: none; }

.m-card-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}
.m-card-clickable:active {
  transform: scale(0.98);
}

.m-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.m-card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.m-card-title.large { font-size: 18px; }
.m-card-sub {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
}
.m-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-soft);
}
.m-card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.m-card-meta .material-symbols-outlined { font-size: 16px; }

/* ---------- 消息卡片：与全站卡片几何和文字层级保持一致 ---------- */
.m-message-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 4px 0 12px;
  color: var(--text-soft);
}
.m-message-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.m-message-mark-all-form { flex: 0 0 auto; margin: 0; }
.m-message-mark-all {
  min-height: 44px;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  color: var(--brand, var(--primary));
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.m-message-filters .m-badge {
  min-height: 44px;
  padding: 8px 12px;
  justify-content: center;
}
.m-message-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.m-msg-row-wrap.m-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  align-items: stretch;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--paper, #fff);
  min-height: 132px;
}
.m-msg-row {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  background: var(--paper, #fff);
  color: inherit;
}
.m-msg-open {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 132px;
  padding: 15px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.m-msg-row.is-unread .m-msg-open {
  box-shadow: inset 4px 0 0 var(--brand, var(--primary));
  background: color-mix(in srgb, var(--brand, var(--primary)) 4%, var(--paper, #fff));
}
.m-msg-layout {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) 20px;
  align-items: start;
  gap: 10px;
  min-width: 0;
}
.m-msg-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
}
.m-msg-row .dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--brand, var(--primary));
}
.m-msg-row .dot.is-placeholder { visibility: hidden; }
.m-msg-row .title {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.42;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.m-msg-row .body {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.m-msg-row .meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.m-kind-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-muted, #eef2fa);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.m-msg-chevron {
  align-self: center;
  color: var(--text-soft);
  font-size: 19px;
}
.m-msg-visible-actions {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  padding: 10px 8px 10px 0;
  background: var(--paper, #fff);
}
.m-msg-visible-action { margin: 0; }
.m-msg-visible-action button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--border-soft, rgba(94,113,152,0.18));
  border-radius: 11px;
  background: var(--surface-muted, #eef2fa);
  color: var(--text-soft);
  cursor: pointer;
}
.m-msg-visible-action button.is-read {
  border-color: rgba(15,159,102,0.22);
  background: rgba(15,159,102,0.09);
  color: #087347;
}
.m-msg-visible-action button.is-delete {
  border-color: rgba(201,60,60,0.22);
  background: rgba(201,60,60,0.08);
  color: #b42318;
}
.m-msg-visible-action .material-symbols-outlined { font-size: 19px; }
html[data-theme='dark'] .m-msg-row-wrap.m-card,
html[data-theme='dark'] .m-msg-row,
html[data-theme='dark'] .m-msg-visible-actions { background: #141a2e; }
html[data-theme='dark'] .m-msg-row.is-unread .m-msg-open {
  background: rgba(49, 91, 190, 0.13);
}

@media (max-width: 374px) {
  .m-message-toolbar { align-items: stretch; flex-direction: column; }
  .m-message-mark-all-form { align-self: flex-end; }
  .m-msg-open { padding-inline: 12px; }
}

/* ---------- 状态徽章 ---------- */
.m-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  background: var(--surface-muted, #eef2fa);
  color: var(--text-soft);
}
.m-badge .material-symbols-outlined { font-size: 14px; }
.m-badge--open     { background:#fff7ed; color:#c2410c; }
.m-badge--claimed  { background:#e0f2fe; color:#0369a1; }
.m-badge--confirm  { background:#fef3c7; color:#a16207; }
.m-badge--done     { background:#dcfce7; color:#16a34a; }
.m-badge--closed   { background:#f1f5f9; color:#64748b; }
.m-badge--expired  { background:#fee2e2; color:#b91c1c; }
.m-badge--danger   { background:#fee2e2; color:#b91c1c; }
.m-badge--brand    { background:rgba(29,64,174,0.10); color:var(--brand, var(--primary)); }

/* ---------- 按钮 ---------- */
.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--m-tap-target);
  padding: 0 18px;
  border-radius: var(--m-radius-btn);
  border: 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}
.m-btn:active { transform: scale(0.98); }
.m-btn:disabled, .m-btn[aria-disabled='true'] { opacity: 0.5; pointer-events: none; }
.m-btn .material-symbols-outlined { font-size: 20px; }
.m-btn--primary {
  background: var(--brand, var(--primary));
  color: #fff;
}
.m-btn--primary:active { background: color-mix(in srgb, var(--brand) 88%, black); }
.m-btn--secondary {
  background: var(--surface-muted, #eef2fa);
  color: var(--ink);
}
.m-btn--ghost {
  background: transparent;
  color: var(--brand, var(--primary));
}
.m-btn--danger {
  background: #dc2626;
  color: #fff;
}
.m-btn--block { width: 100%; }
.m-btn--sm { min-height: 36px; font-size: 13px; padding: 0 12px; }

/* ---------- 输入框 ---------- */
.m-field {
  margin-bottom: 14px;
}
.m-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-soft);
}
.m-field-label .req { color: #dc2626; }
.m-input,
.m-textarea {
  width: 100%;
  min-height: var(--m-tap-target);
  padding: 10px 12px;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: var(--m-radius-input);
  font-size: 16px;
  font-family: inherit;
  background: var(--surface, #fff);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
html[data-theme='dark'] .m-input,
html[data-theme='dark'] .m-textarea {
  border-color: rgba(255,255,255,0.12);
  background: #141a2e;
}
.m-input:focus,
.m-textarea:focus {
  outline: 0;
  border-color: var(--brand, var(--primary));
  box-shadow: 0 0 0 3px rgba(29,64,174,0.18);
}
.m-textarea { min-height: 96px; resize: vertical; }
.m-field-error {
  margin-top: 6px;
  font-size: 12px;
  color: #dc2626;
}
.m-field-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-soft);
}
.m-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.m-field-row > .m-input { flex: 1; }
.m-input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.m-input-group .m-input { padding-right: 50px; }
.m-input-group-btn {
  position: absolute;
  right: 2px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-soft);
  cursor: pointer;
}
.m-input-group-btn:active { background: rgba(0,0,0,0.05); }

/* ---------- SegmentedControl(状态过滤) ---------- */
.m-segmented-wrap {
  position: sticky;
  top: calc(var(--m-appbar-h) + var(--m-safe-top));
  z-index: 50;
  background: var(--surface-soft, #f3f6fb);
  padding: 8px 0;
  margin: -12px -16px 12px;
}
html[data-theme='dark'] .m-segmented-wrap {
  background: #0b1020;
}
.m-lobby-filter-wrap {
  position: static;
  top: auto;
  z-index: auto;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid rgba(29, 64, 174, 0.22);
  border-radius: var(--m-radius-card);
  background: var(--surface, #fff);
  box-shadow: 0 5px 16px rgba(28, 47, 94, 0.08);
}
.m-lobby-status-filter {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}
.m-lobby-status-filter .lobby-filter-chip {
  min-height: 44px;
  padding: 4px 2px;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (min-width: 520px) {
  .m-lobby-status-filter {
    grid-template-columns: repeat(var(--lobby-filter-count, 8), minmax(0, 1fr));
  }
  .m-lobby-status-filter .lobby-filter-chip {
    white-space: nowrap;
    overflow-wrap: normal;
  }
}
html[data-theme='dark'] .m-lobby-filter-wrap {
  border-color: rgba(168, 188, 255, 0.20);
  background: #141a2e;
  box-shadow: none;
}
.m-segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  background: var(--surface-muted, #eef2fa);
  border-radius: 12px;
  padding: 3px;
  margin: 0 16px;
  overflow: visible;
}

html[data-layout='mobile'] input:not([type='hidden']):not([type='checkbox']):not([type='radio']):not([type='file']),
html[data-layout='mobile'] select,
html[data-layout='mobile'] textarea {
  min-height: 48px;
  font-size: 16px !important;
  line-height: 1.4;
}
.m-segmented-control a,
.m-segmented-control button {
  min-width: 0;
  min-height: 36px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.m-segmented-control a.is-active,
.m-segmented-control button.is-active {
  background: var(--surface, #fff);
  color: var(--brand, var(--primary));
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15,23,42,0.08);
}
html[data-theme='dark'] .m-segmented-control a.is-active,
html[data-theme='dark'] .m-segmented-control button.is-active {
  background: #141a2e;
}

/* ---------- 列表行 ---------- */
.m-list { padding: 0; margin: 0; list-style: none; }
.m-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft, rgba(0,0,0,0.06));
  text-decoration: none;
  color: inherit;
  min-height: var(--m-tap-target);
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: inherit;
}
.m-list-row:last-child { border-bottom: 0; }
.m-list-row:active { background: rgba(0,0,0,0.03); }
.m-list-row .leading {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted, #eef2fa);
  color: var(--brand, var(--primary));
  font-weight: 700;
  font-size: 16px;
  flex: 0 0 auto;
}
.m-list-row .body {
  flex: 1 1 auto;
  min-width: 0;
}
.m-list-row .body .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-list-row .body .sub {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
}
.m-list-row .trailing {
  flex: 0 0 auto;
  color: var(--text-soft);
}

/* ---------- 9 宫格 ---------- */
.m-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0 8px;
}
.m-grid-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 4px;
  border-radius: var(--m-radius-card);
  background: var(--surface, #fff);
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  min-height: 84px;
  box-shadow: 0 0 0 1px rgba(15,23,42,0.04);
}
.m-grid-tile .material-symbols-outlined {
  font-size: 26px;
  color: var(--brand, var(--primary));
}
.m-grid-tile .label {
  font-size: 12px;
  font-weight: 500;
}
.m-grid-badge {
  position: absolute;
  top: 0;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  line-height: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--paper, #fff);
}

/* ---------- 滚动容器 ---------- */
.m-scroll-x {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  overflow: visible;
  scroll-snap-type: none;
  padding: 4px 0 16px;
  margin: 0;
}
.m-scroll-x > * { min-width: 0; scroll-snap-align: none; flex: 1 1 min(160px, 100%); }

/* ---------- Bottom Sheet ---------- */
.m-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.m-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.m-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 201;
  max-height: 92dvh;
  background: var(--surface, #fff);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(15,23,42,0.20);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.22,0.61,0.36,1);
  display: flex;
  flex-direction: column;
  padding-bottom: calc(8px + var(--m-safe-bottom));
}
html[data-theme='dark'] .m-sheet {
  background: #141a2e;
}
.m-sheet.is-open { transform: translateY(0); }
.m-sheet-grabber {
  position: relative;
  width: 36px;
  height: 4px;
  margin: 8px auto 4px;
  border-radius: 4px;
  background: rgba(0,0,0,0.18);
}
.m-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-soft, rgba(0,0,0,0.06));
}
html[data-theme='dark'] .m-sheet-head {
  border-bottom-color: rgba(255,255,255,0.08);
}
.m-sheet-title { font-size: 16px; font-weight: 600; }
.m-sheet-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
}
.m-sheet-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--border-soft, rgba(0,0,0,0.06));
  display: flex;
  gap: 8px;
}
html[data-theme='dark'] .m-sheet-foot {
  border-top-color: rgba(255,255,255,0.08);
}

/* ---------- Action Sheet(选项菜单) ---------- */
.m-actionsheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 201;
  padding: 0 8px calc(8px + var(--m-safe-bottom));
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.22,0.61,0.36,1);
}
.m-actionsheet.is-open { transform: translateY(0); }
.m-actionsheet-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  background: var(--surface, #fff);
  border-radius: 14px;
  overflow: hidden;
}
html[data-theme='dark'] .m-actionsheet-list {
  background: #141a2e;
}
.m-actionsheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  border-bottom: 1px solid var(--border-soft, rgba(0,0,0,0.06));
  color: var(--ink);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  min-height: var(--m-tap-target);
}
.m-actionsheet-item:last-child { border-bottom: 0; }
.m-actionsheet-item:active {
  background: rgba(0,0,0,0.05);
}
.m-actionsheet-item .material-symbols-outlined {
  font-size: 22px;
  color: var(--text-soft);
}
.m-actionsheet-item.is-danger { color: #dc2626; }
.m-actionsheet-item.is-danger .material-symbols-outlined { color: #dc2626; }
.m-actionsheet-cancel {
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 14px;
  background: var(--surface, #fff);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
html[data-theme='dark'] .m-actionsheet-cancel {
  background: #141a2e;
}

/* ---------- Modal(全屏,用于文件预览) ---------- */
.m-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: var(--surface, #fff);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.22,0.61,0.36,1);
  display: flex;
  flex-direction: column;
}
.m-modal.is-open { transform: translateY(0); }
html[data-theme='dark'] .m-modal { background: #0b1020; }

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed;
  top: calc(var(--m-safe-top) + 8px);
  left: 16px;
  right: 16px;
  z-index: 300;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  pointer-events: auto;
  background: rgba(28,28,28,0.92);
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
  animation: toast-in 0.2s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.20);
}
.toast .material-symbols-outlined { font-size: 20px; flex: 0 0 auto; margin-top: 1px; }
.toast--success { background: rgba(22,163,74,0.95); }
.toast--error   { background: rgba(220,38,38,0.95); }
.toast--info    { background: rgba(29,64,174,0.95); }
@keyframes toast-in {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
@keyframes toast-out {
  to { transform: translateY(-20px); opacity: 0; }
}
.toast.is-leaving { animation: toast-out 0.18s ease forwards; }

/* ---------- Skeleton(全局工具,已在前面提供)沿用 ---------- */

/* ---------- Empty State(同 .empty-state 复用) ---------- */

/* ---------- Sticky 底部操作条(状态机按钮) ---------- */
.m-actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--m-tabbar-h);
  /* 当无 tabbar 时底部=0 */
  z-index: 90;
  padding: 10px 16px calc(10px + var(--m-safe-bottom));
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-soft, rgba(0,0,0,0.06));
  display: flex;
  gap: 8px;
}
html[data-theme='dark'] .m-actionbar {
  background: rgba(11,16,32,0.92);
  border-top-color: rgba(255,255,255,0.08);
}
.m-actionbar--no-tabbar {
  bottom: 0;
}
.m-actionbar .m-btn { flex: 1; }

/* ---------- 通用工具 ---------- */
.m-stack { padding: 0; margin: 0; list-style: none; }
.m-stack > * + * { margin-top: 12px; }
.m-row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.m-text-center { text-align: center; }
.m-text-soft { color: var(--text-soft); }
.m-text-sm { font-size: 12px; }
.m-text-mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.m-pad-16 { padding: 16px; }
.m-gap-8 { gap: 8px; }
.m-flex { display: flex; align-items: center; }
.m-flex-1 { flex: 1 1 auto; min-width: 0; }

/* ---------- 验证码输入(6 格大输入) ---------- */
.m-code-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.m-code-cell {
  width: 100%;
  aspect-ratio: 1;
  max-width: 48px;
  margin: 0 auto;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 10px;
  background: var(--surface, #fff);
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}
html[data-theme='dark'] .m-code-cell {
  border-color: rgba(255,255,255,0.12);
  background: #141a2e;
}
.m-code-cell:focus {
  outline: 0;
  border-color: var(--brand, var(--primary));
  box-shadow: 0 0 0 3px rgba(29,64,174,0.18);
}

/* ---------- 错误/提示条 ---------- */
.m-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fef3c7;
  color: #92400e;
  font-size: 13px;
  margin-bottom: 12px;
}
.m-alert--error { background: #fee2e2; color: #991b1b; }
.m-alert--info { background: #e0f2fe; color: #075985; }
.m-alert--success { background: #dcfce7; color: #166534; }
.m-alert .material-symbols-outlined { font-size: 20px; flex: 0 0 auto; margin-top: 1px; }

/* ---------- 头像 ---------- */
.m-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--surface-muted, #eef2fa);
  color: var(--brand, var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex: 0 0 auto;
  overflow: hidden;
}
.m-avatar img { width: 100%; height: 100%; object-fit: cover; }
.m-avatar--lg { width: 56px; height: 56px; font-size: 22px; }

/* ---------- 下拉刷新 ---------- */
.m-pull-indicator {
  position: absolute;
  left: 0;
  right: 0;
  top: -32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-soft);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

/* ---------- 宽屏适配(平板) ---------- */
@media (min-width: 600px) and (max-width: 1024px) {
  .m-main { max-width: 720px; margin: 0 auto; }
}
@media (min-width: 1025px) {
  /* 桌面下不渲染移动布局 */
  body.mobile-shell { background: #f3f6fb; }
}

/* ============================================================
   全局共享工具类(从原 mobile.css 保留,供后台/前台共用)
   ========================================================= */

/* ---------- 全局空状态/加载态/错误态 ---------- */
.empty-state,
.admin-empty-state,
.state-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
  color: var(--text-soft);
}
.empty-state > .material-symbols-outlined,
.admin-empty-state > .material-symbols-outlined {
  font-size: 48px;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.empty-state p,
.admin-empty-state p {
  margin: 0 0 12px;
  font-size: 14px;
}

/* ---------- 加载骨架屏 ---------- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-muted) 0%,
    color-mix(in srgb, var(--surface-muted) 60%, var(--text-faint)) 50%,
    var(--surface-muted) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
  min-height: 16px;
}
.skeleton--text { height: 14px; margin: 6px 0; }
.skeleton--title { height: 20px; width: 60%; margin: 8px 0; }
.skeleton--avatar { width: 40px; height: 40px; border-radius: 50%; }
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: var(--surface-muted); }
}

/* ---------- a11y:skip-link、可见焦点环 ---------- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100000;
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 16px;
  outline: 3px solid color-mix(in srgb, var(--primary) 50%, transparent);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

@media (prefers-contrast: more) {
  .border-outline-variant { border-width: 2px !important; }
  .text-on-surface-variant { color: var(--text) !important; }
}

/* 2026-07-15 mobile geometry alignment. */
html[data-layout='mobile'] body,
html[data-layout='mobile'] button,
html[data-layout='mobile'] input,
html[data-layout='mobile'] select,
html[data-layout='mobile'] textarea {
  font-family: var(--font-sans-commercial);
}

.m-card,
.m-grid-tile {
  border-radius: var(--m-radius-card);
  border: 1px solid rgba(94, 113, 152, 0.12);
  box-shadow: 0 6px 18px rgba(28, 47, 94, 0.06);
}

.m-card {
  box-sizing: border-box;
}

.m-grid-4 {
  align-items: stretch;
  grid-auto-rows: minmax(98px, auto);
}

.m-grid-tile {
  width: 100%;
  height: 100%;
  min-height: 98px;
  padding: 14px 6px;
}

.m-lobby-card,
.m-req-row {
  display: flex;
  flex-direction: column;
  min-height: 168px;
}

.m-lobby-card .m-lobby-meta-row,
.m-req-row > form,
.m-req-row > div:last-child {
  margin-top: auto !important;
  padding-top: 10px;
}

.m-btn {
  min-height: var(--m-tap-target);
  border-radius: var(--m-radius-btn);
  padding-inline: 16px;
}

.m-btn--block {
  min-height: 48px;
}

.m-btn--sm {
  min-height: 36px;
  border-radius: 10px;
}

.m-inline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--m-control-border);
  border-radius: 10px;
  background: var(--m-control-bg-muted);
  color: #17388f;
  box-shadow: 0 2px 7px rgba(28, 47, 94, 0.10);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.m-inline-action:active {
  border-color: var(--m-control-border-strong);
  background: #dbe5fb;
  transform: scale(0.98);
}

html[data-theme='dark'] .m-inline-action {
  border-color: rgba(168, 188, 255, 0.30);
  background: #202b42;
  color: #dbe4ff;
  box-shadow: none;
}

.m-actionbar {
  align-items: stretch;
}

.m-actionbar .m-btn {
  min-height: 48px;
}

.empty-state,
.admin-empty-state,
.state-empty,
.access-empty,
.rpt-empty {
  min-height: 168px;
  padding: 32px 18px !important;
  border: 1px dashed var(--border-strong, rgba(94, 113, 152, 0.3));
  border-radius: var(--m-radius-card) !important;
  background: var(--surface-muted, #eef2fa);
}

.empty-state.m-card,
.admin-empty-state.m-card,
.state-empty.m-card {
  box-shadow: none;
}

html[data-theme='dark'] .m-card,
html[data-theme='dark'] .m-grid-tile {
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
}

html[data-theme='dark'] .empty-state,
html[data-theme='dark'] .admin-empty-state,
html[data-theme='dark'] .state-empty,
html[data-theme='dark'] .access-empty,
html[data-theme='dark'] .rpt-empty {
  background: #141a2e;
  border-color: rgba(255,255,255,0.14);
}

.m-card-meta,
.m-badge,
.m-code-cell,
.m-tab-item .badge,
.m-grid-tile .badge::after {
  font-variant-numeric: tabular-nums;
}

/* Request detail: readable order, aligned cards and one-handed primary actions. */
.m-request-detail { min-width: 0; }
.m-request-detail.has-actionbar { padding-bottom: 74px; }
.m-request-detail > .m-card { border: 1px solid var(--border-soft, rgba(15,23,42,0.06)); }

.m-request-hero { padding: 18px; }
.m-request-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.m-request-share { width: 40px; height: 40px; flex: 0 0 40px; background: var(--surface-muted, #eef2fa); }
.m-request-share .material-symbols-outlined { font-size: 20px; }
.m-request-kicker { display: block; margin-bottom: 5px; color: var(--brand, var(--primary)); font-size: 12px; font-weight: 700; letter-spacing: 0.035em; }
.m-request-title { margin: 0; color: var(--ink); font-size: clamp(20px, 5.7vw, 23px); font-weight: 800; line-height: 1.32; letter-spacing: -0.01em; overflow-wrap: anywhere; }

.m-request-people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
  padding: 12px 0;
  border-top: 1px solid var(--border-soft, rgba(15,23,42,0.06));
  border-bottom: 1px solid var(--border-soft, rgba(15,23,42,0.06));
}
.m-request-people > span { display: grid; gap: 2px; min-width: 0; }
.m-request-people small { color: var(--text-soft); font-size: 12px; }
.m-request-people strong { color: var(--ink); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }

.m-request-section-heading { display: flex; align-items: center; gap: 7px; margin: 2px 0 10px; color: var(--ink); font-size: 14px; }
.m-request-section-heading .material-symbols-outlined { color: var(--brand, var(--primary)); font-size: 19px; }

.m-request-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.m-request-info-grid > div { min-width: 0; min-height: 68px; padding: 10px 11px; border: 1px solid var(--border-soft, rgba(15,23,42,0.06)); border-radius: 12px; background: var(--surface-muted, #f4f7fc); }
.m-request-info-grid > .is-wide { grid-column: span 2; }
.m-request-info-grid dt { margin: 0; color: var(--text-soft); font-size: 12px; font-weight: 600; }
.m-request-info-grid dd { margin: 4px 0 0; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.m-request-info-grid dd.is-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.m-request-info-grid a { display: inline-flex; align-items: center; gap: 3px; color: var(--brand, var(--primary)); text-decoration: none; }
.m-request-info-grid a .material-symbols-outlined { font-size: 15px; }
.m-request-info-grid .m-field-error { display: block; margin-top: 2px; }

.m-request-progress { padding: 16px 14px; }
.m-request-progress .m-card-head { margin: 0 2px 14px; }
.m-request-progress .m-card-head .material-symbols-outlined { color: var(--brand, var(--primary)); }
.m-request-progress ol { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; margin: 0; padding: 0; list-style: none; }
.m-request-progress ol::before { content: ""; position: absolute; left: 11%; right: 11%; top: 16px; height: 2px; background: var(--border, #cbd5e1); }
.m-request-progress li { position: relative; z-index: 1; display: grid; justify-items: center; gap: 5px; color: var(--text-soft); text-align: center; }
.m-request-progress li > span { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 2px solid var(--border, #cbd5e1); border-radius: 999px; background: var(--surface, #fff); }
.m-request-progress li .material-symbols-outlined { font-size: 16px; }
.m-request-progress li small { font-size: 11px; line-height: 1.3; overflow-wrap: anywhere; }
.m-request-progress li.is-done { color: #0f9f66; }
.m-request-progress li.is-current { color: var(--brand, var(--primary)); font-weight: 700; }
.m-request-progress li.is-done > span { border-color: #8bd8b7; background: #e8f9f1; }
.m-request-progress li.is-current > span { border-color: var(--brand, var(--primary)); background: color-mix(in srgb, var(--brand, var(--primary)) 10%, var(--surface, #fff)); box-shadow: 0 0 0 4px rgba(29,64,174,0.08); }

.m-request-note .m-card-head { margin-bottom: 9px; }
.m-request-note .material-symbols-outlined { color: var(--brand, var(--primary)); }
.m-request-note p { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }

.m-request-action-card { padding: 16px; }
.m-request-action-heading { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 14px; padding: 11px; border-radius: 14px; background: var(--surface-muted, #eef2fa); }
.m-request-action-heading > .material-symbols-outlined { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface, #fff); color: var(--brand, var(--primary)); }
.m-request-action-heading > span { display: grid; gap: 1px; min-width: 0; }
.m-request-action-heading small { color: var(--text-soft); font-size: 11px; }
.m-request-action-heading strong { color: var(--ink); font-size: 16px; line-height: 1.25; }
.m-request-action-heading em { color: var(--text-soft); font-size: 11px; font-style: normal; white-space: nowrap; }
.m-request-action-card form + form { margin-top: 12px; }
.m-request-action-card .m-btn--block { min-height: 48px; }
.m-request-claim-form { margin: 14px 0 0; }
.m-request-status-copy { margin: 0; color: var(--text-soft); font-size: 13px; line-height: 1.6; }
.m-request-status-copy.is-success { color: #087347; }
.m-request-upload-separator { margin: 14px 0 8px; color: var(--text-soft); font-size: 12px; font-weight: 650; text-align: center; }
.m-request-secondary-action { display: flex; align-items: center; min-height: 40px; color: var(--text-soft); font-size: 12px; cursor: pointer; }

.m-request-report { margin-top: 0; padding: 14px 16px; box-shadow: none; }
.m-request-report summary { display: flex; align-items: center; gap: 6px; min-height: 36px; color: #b42318; font-size: 13px; font-weight: 650; cursor: pointer; }
.m-request-report summary .material-symbols-outlined { font-size: 18px; }
.m-request-report-notice { display: flex; align-items: flex-start; gap: 8px; color: #815d00; font-size: 12px; line-height: 1.5; }
.m-request-report-notice .material-symbols-outlined { font-size: 18px; }
.m-request-safety { display: flex; align-items: flex-start; justify-content: center; gap: 6px; margin: 20px 8px 4px; color: var(--text-soft); font-size: 12px; line-height: 1.5; text-align: left; overflow-wrap: anywhere; }
.m-request-safety .material-symbols-outlined { flex: 0 0 auto; font-size: 16px; }

html[data-theme='dark'] .m-request-info-grid > div,
html[data-theme='dark'] .m-request-share,
html[data-theme='dark'] .m-request-action-heading { background: #10172a; border-color: rgba(255,255,255,0.08); }
html[data-theme='dark'] .m-request-action-heading > .material-symbols-outlined,
html[data-theme='dark'] .m-request-progress li > span { background: #141a2e; }

@media (max-width: 359px) {
  .m-request-info-grid { grid-template-columns: minmax(0, 1fr); }
  .m-request-info-grid > .is-wide { grid-column: auto; }
  .m-request-people { grid-template-columns: minmax(0, 1fr); }
  .m-request-action-heading { grid-template-columns: 38px minmax(0, 1fr); }
  .m-request-action-heading em { grid-column: 2; }
}

/* Mobile shared library: one readable card per row with aligned actions. */
.m-library-summary { margin: 0 0 14px; color: var(--text-soft); font-size: 13px; line-height: 1.55; }
.m-library-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.m-library-card { padding: 16px; }
.m-library-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.m-library-card .m-card-title { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink); font-size: 17px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.m-library-card-meta { margin-top: 7px; color: var(--text-soft); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.m-library-card-footer { margin-top: 14px; }
.m-library-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.m-library-card-actions .m-btn { min-width: 0; min-height: 48px; }

/* 2026-07-16 mobile daylight control contrast and login action clarity. */
.m-tab-item {
  color: var(--m-control-text);
  font-weight: 600;
}
.m-tab-item .material-symbols-outlined {
  font-variation-settings: 'wght' 500;
}
.m-tab-fab-slot .m-tab-fab {
  box-sizing: border-box;
  border: 4px solid var(--m-control-bg);
  outline: 2px solid var(--m-control-border);
  outline-offset: 0;
  box-shadow: 0 8px 24px rgba(29,64,174,0.48);
}
.m-tab-fab-slot .m-tab-fab .material-symbols-outlined {
  color: #fff;
  font-size: 30px;
  font-variation-settings: 'wght' 700;
}
.m-btn {
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}
.m-btn--primary {
  border-color: color-mix(in srgb, var(--brand, var(--primary)) 82%, black);
  box-shadow: 0 5px 14px rgba(29,64,174,0.24);
}
.m-btn--secondary {
  border-color: var(--m-control-border);
  background: var(--m-control-bg-muted);
  color: #17388f;
  box-shadow: 0 2px 7px rgba(28,47,94,0.08);
}
.m-btn--ghost {
  border-color: var(--m-control-border);
  background: var(--m-control-bg);
}
.m-btn--danger {
  border-color: #b91c1c;
  box-shadow: 0 5px 14px rgba(185,28,28,0.20);
}
.m-input-group-btn {
  top: 50%;
  right: 4px;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  border: 1px solid var(--m-control-border);
  background: var(--m-control-bg-muted);
  color: #17388f;
}
.m-input-group-btn .material-symbols-outlined {
  font-size: 21px;
  font-variation-settings: 'wght' 600;
}
.m-input-group-btn:active {
  background: #dfe7fb;
  border-color: var(--m-control-border-strong);
}
.m-segmented-control {
  border: 1px solid var(--m-control-border);
}
.m-segmented-control a,
.m-segmented-control button {
  color: var(--m-control-text);
  font-weight: 600;
}
.m-segmented-control a.is-active,
.m-segmented-control button.is-active {
  outline: 1px solid var(--m-control-border);
}
.m-grid-tile {
  border-color: var(--m-control-border);
  box-shadow: var(--m-control-shadow);
}
.m-grid-tile .label {
  font-weight: 650;
}
.m-auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.m-auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--m-control-border);
  border-radius: 11px;
  background: var(--m-control-bg);
  color: var(--m-control-text);
  box-shadow: 0 2px 7px rgba(28,47,94,0.07);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.m-auth-link--primary {
  background: var(--m-control-bg-muted);
  color: #17388f;
}
.m-auth-link .material-symbols-outlined {
  font-size: 19px;
  font-variation-settings: 'wght' 600;
}
html[data-theme='dark'] .m-tab-item {
  color: #c5d0df;
}
html[data-theme='dark'] .m-tab-item.is-active {
  color: var(--brand, var(--primary));
}
html[data-theme='dark'] .m-tab-fab-slot .m-tab-fab {
  border-color: #141a2e;
  outline-color: rgba(168,188,255,0.38);
  box-shadow: 0 8px 24px rgba(0,0,0,0.52);
}
html[data-theme='dark'] .m-tab-fab-slot .m-tab-fab .material-symbols-outlined {
  color: #071536;
}
html[data-theme='dark'] .m-btn--primary {
  color: #071536;
  border-color: rgba(168,188,255,0.64);
  box-shadow: 0 5px 16px rgba(0,0,0,0.32);
}
html[data-theme='dark'] .m-btn--secondary,
html[data-theme='dark'] .m-btn--ghost {
  border-color: rgba(168,188,255,0.30);
  background: #202b42;
  color: #dbe4ff;
  box-shadow: none;
}
html[data-theme='dark'] .m-input-group-btn {
  border-color: rgba(168,188,255,0.28);
  background: #202b42;
  color: #dbe4ff;
}
html[data-theme='dark'] .m-auth-link {
  border-color: rgba(168,188,255,0.28);
  background: #141a2e;
  color: #dbe4ff;
  box-shadow: none;
}
html[data-theme='dark'] .m-auth-link--primary {
  background: #202b42;
}

/* 2026-07-16 mobile daylight affordance pass.
   Keep secondary and compact actions visibly interactive on pale surfaces. */
html[data-layout='mobile'][data-theme='light'] {
  --m-control-bg-muted: #e7eeff;
  --m-control-border: rgba(29, 64, 174, 0.38);
  --m-control-border-strong: rgba(29, 64, 174, 0.58);
  --m-control-shadow: 0 4px 12px rgba(28, 47, 94, 0.14);
}

html[data-layout='mobile'][data-theme='light'] .m-btn--secondary,
html[data-layout='mobile'][data-theme='light'] .m-btn--ghost,
html[data-layout='mobile'][data-theme='light'] .m-auth-link {
  box-shadow: 0 3px 9px rgba(28, 47, 94, 0.13);
}

html[data-layout='mobile'][data-theme='light'] .m-btn--primary {
  border-color: #17388f;
  background: #1d40ae;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(29, 64, 174, 0.30);
}

html[data-layout='mobile'][data-theme='light'] .m-tab-fab-slot .m-tab-fab {
  border-color: #ffffff;
  outline-color: rgba(29, 64, 174, 0.48);
  background: #1d40ae;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(29, 64, 174, 0.52);
}

html[data-layout='mobile'][data-theme='light'] .m-segmented-control {
  background: #dde6f8;
  border-color: rgba(29, 64, 174, 0.34);
}

html[data-layout='mobile'][data-theme='light'] .m-segmented-control a,
html[data-layout='mobile'][data-theme='light'] .m-segmented-control button {
  border: 1px solid rgba(29, 64, 174, 0.22);
  background: rgba(255, 255, 255, 0.72);
  color: #24324d;
}

html[data-layout='mobile'][data-theme='light'] .m-segmented-control a.is-active,
html[data-layout='mobile'][data-theme='light'] .m-segmented-control button.is-active {
  border-color: var(--brand, var(--primary));
  outline: 0;
  background: var(--brand, var(--primary));
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 11px rgba(29, 64, 174, 0.22);
}

html[data-layout='mobile'][data-theme='light'] .m-message-mark-all {
  padding-inline: 12px;
  border: 1px solid var(--m-control-border);
  border-radius: 10px;
  background: var(--m-control-bg-muted);
  box-shadow: 0 2px 7px rgba(28, 47, 94, 0.10);
  color: #17388f;
  font-weight: 650;
}

html[data-layout='mobile'][data-theme='light'] .m-msg-visible-action button {
  border-color: var(--m-control-border);
  background: var(--m-control-bg-muted);
  box-shadow: 0 2px 7px rgba(28, 47, 94, 0.10);
}

html[data-layout='mobile'][data-theme='light'] .m-unit-combo .m-input-icon {
  border: 1px solid var(--m-control-border) !important;
  background: var(--m-control-bg-muted) !important;
  color: #17388f !important;
  box-shadow: 0 2px 7px rgba(28, 47, 94, 0.10);
}

html[data-layout='mobile'][data-theme='dark'] .m-segmented-control a,
html[data-layout='mobile'][data-theme='dark'] .m-segmented-control button {
  border: 1px solid rgba(168, 188, 255, 0.18);
  background: rgba(20, 26, 46, 0.78);
  color: #c5d0df;
}

html[data-layout='mobile'][data-theme='dark'] .m-segmented-control a.is-active,
html[data-layout='mobile'][data-theme='dark'] .m-segmented-control button.is-active {
  border-color: rgba(168, 188, 255, 0.42);
  background: #202b42;
  color: #a8bcff;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.26);
}

/* 2026-07-16 final daylight contrast pass for the dedicated mobile templates.
   Use literal, widely supported colors so embedded mobile browsers cannot lose
   active backgrounds while retaining white active text. */
html[data-layout='mobile'][data-theme='light'] .m-card,
html[data-layout='mobile'][data-theme='light'] .m-grid-tile {
  border-color: #c6d0e1;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(28, 47, 94, 0.09);
}

html[data-layout='mobile'][data-theme='light'] .m-input,
html[data-layout='mobile'][data-theme='light'] .m-textarea {
  border-color: #9eacc6;
  background: #ffffff;
  color: #172033;
  -webkit-text-fill-color: #172033;
  box-shadow: 0 1px 2px rgba(28, 47, 94, 0.06);
}

html[data-layout='mobile'][data-theme='light'] .m-input::placeholder,
html[data-layout='mobile'][data-theme='light'] .m-textarea::placeholder {
  color: #68758b;
  opacity: 1;
}

html[data-layout='mobile'][data-theme='light'] .m-input:focus,
html[data-layout='mobile'][data-theme='light'] .m-textarea:focus {
  border-color: #1d40ae;
  box-shadow: 0 0 0 3px rgba(29, 64, 174, 0.16);
}

html[data-layout='mobile'][data-theme='light'] input:not([type='hidden']):not([type='checkbox']):not([type='radio']):not([type='file']),
html[data-layout='mobile'][data-theme='light'] select,
html[data-layout='mobile'][data-theme='light'] textarea {
  border-color: #9eacc6 !important;
  background-color: #ffffff !important;
  color: #172033 !important;
  -webkit-text-fill-color: #172033;
}

html[data-layout='mobile'][data-theme='light'] input:not([type='hidden']):not([type='checkbox']):not([type='radio']):not([type='file']):focus,
html[data-layout='mobile'][data-theme='light'] select:focus,
html[data-layout='mobile'][data-theme='light'] textarea:focus {
  border-color: #1d40ae !important;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(29, 64, 174, 0.16) !important;
}

html[data-layout='mobile'][data-theme='light'] .m-icon-btn,
html[data-layout='mobile'][data-theme='light'] .m-btn--secondary,
html[data-layout='mobile'][data-theme='light'] .m-btn--ghost,
html[data-layout='mobile'][data-theme='light'] .m-inline-action,
html[data-layout='mobile'][data-theme='light'] .m-auth-link,
html[data-layout='mobile'][data-theme='light'] .m-input-group-btn {
  border-color: #9fb0cf;
  background: #eaf0ff;
  color: #17388f;
  -webkit-text-fill-color: #17388f;
  box-shadow: 0 3px 9px rgba(28, 47, 94, 0.11);
}

html[data-layout='mobile'][data-theme='light'] .m-btn--primary,
html[data-layout='mobile'][data-theme='light'] .m-segmented-control a.is-active,
html[data-layout='mobile'][data-theme='light'] .m-segmented-control button.is-active {
  border-color: #17388f;
  background: #1d40ae;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

html[data-layout='mobile'][data-theme='light'] .m-segmented-control a:not(.is-active),
html[data-layout='mobile'][data-theme='light'] .m-segmented-control button:not(.is-active) {
  border-color: #a9b7cf;
  background: #ffffff;
  color: #33415c;
  -webkit-text-fill-color: #33415c;
}

html[data-layout='mobile'][data-theme='light'] .empty-state,
html[data-layout='mobile'][data-theme='light'] .admin-empty-state,
html[data-layout='mobile'][data-theme='light'] .state-empty,
html[data-layout='mobile'][data-theme='light'] .access-empty,
html[data-layout='mobile'][data-theme='light'] .rpt-empty {
  border-color: #aebbd1;
  background: #f3f6fc;
  color: #526079;
}

html[data-layout='mobile'][data-theme='light'] .empty-state > .material-symbols-outlined,
html[data-layout='mobile'][data-theme='light'] .admin-empty-state > .material-symbols-outlined {
  color: #66758f;
  opacity: 1;
}

/* 2026-07-16 mobile typography parity pass. */

/* 2026-07-17 mobile global-search polish. */
.m-search-card {
  padding: 16px;
  border-color: var(--m-control-border);
  box-shadow: 0 7px 20px rgba(28, 47, 94, 0.08);
}

.m-search-description {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

.m-search-form .m-input {
  min-height: 52px;
  padding-right: 54px;
  border-radius: 13px;
  font-size: 16px;
}

.m-search-form .m-input-group-btn {
  right: 6px;
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

html[data-theme='dark'] .m-search-card {
  border-color: var(--m-control-border);
  background: var(--surface-strong);
}
