:root {
  color-scheme: light;
  --bg: #edf1ea;
  --paper: #fbfbf7;
  --surface: #ffffff;
  --surface-soft: #f2f6f0;
  --surface-strong: #e5ece4;
  --text: #17201b;
  --muted: #647268;
  --line: #d8e1d7;
  --line-strong: #bdcabf;
  --primary: #2d7356;
  --primary-strong: #174c38;
  --primary-soft: #e1f2e8;
  --accent: #c96435;
  --accent-soft: #fff0e7;
  --danger: #aa3a31;
  --danger-soft: #fde8e5;
  --green: #237b4b;
  --green-soft: #e3f3e8;
  --blue: #3d6d91;
  --blue-soft: #e5f0f5;
  --gray: #66706a;
  --gray-soft: #edf0ee;
  --shadow: 0 18px 48px rgba(27, 40, 32, 0.11);
  --shadow-soft: 0 8px 22px rgba(27, 40, 32, 0.07);
  --radius: 8px;
  --radius-sm: 6px;
  --max: 1440px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111613;
  --paper: #161d19;
  --surface: #1c2420;
  --surface-soft: #232d28;
  --surface-strong: #2b3731;
  --text: #edf3ee;
  --muted: #a9b6ad;
  --line: #35433b;
  --line-strong: #526158;
  --primary: #78d0a4;
  --primary-strong: #a0e7c0;
  --primary-soft: #173629;
  --accent: #f0a16c;
  --accent-soft: #3d2a1e;
  --danger: #ff9388;
  --danger-soft: #3c211f;
  --green: #8ee0a5;
  --green-soft: #193523;
  --blue: #9ac8ee;
  --blue-soft: #172d3d;
  --gray: #c5cec8;
  --gray-soft: #2b312e;
  --shadow: 0 20px 52px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}

.app-page {
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(45, 115, 86, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 115, 86, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--primary-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(201, 100, 53, 0.34);
  outline-offset: 2px;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 32px 14px;
}

.brand-block {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  color: var(--primary-strong);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-header h1,
.auth-brand h1,
.auth-title h2 {
  margin: 0;
  font-family: "Source Han Serif SC", "Noto Serif CJK SC", "STSong", "SimSun", serif;
  font-weight: 800;
  letter-spacing: 0;
}

.app-header h1 {
  margin-top: 4px;
  font-size: 34px;
  line-height: 1.14;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.user-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  padding: 6px 12px;
  font-size: 13px;
}

.app-nav {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 4px;
}

.nav-button {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 800;
}

.nav-button.active {
  background: var(--primary);
  color: #fff;
}

.app-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 32px 42px;
}

.view-panel {
  display: grid;
  gap: 16px;
}

.view-panel:not([hidden]) {
  animation: view-enter 220ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.workbench-hero,
.screen-heading,
.module-card,
.purchase-list-card,
.template-strip,
.asset-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.workbench-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.4fr);
  gap: 18px;
  align-items: end;
  padding: 24px;
}

.workbench-hero h2,
.screen-heading h2,
.module-card h2 {
  margin: 0;
  letter-spacing: 0;
}

.workbench-hero h2 {
  margin-top: 4px;
  font-size: 26px;
}

.workbench-hero p,
.screen-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.workbench-hero-metrics,
.module-metrics,
.asset-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.workbench-hero-metrics > div,
.mini-metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 10px;
}

.workbench-hero-metrics span,
.mini-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workbench-hero-metrics strong,
.mini-metric strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 20px;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 16px;
}

.module-card {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 20px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  animation: card-enter 360ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.module-card:nth-child(2) {
  animation-delay: 60ms;
}

.module-card:hover,
.purchase-list-card:hover,
.asset-card:hover {
  border-color: rgba(45, 115, 86, 0.36);
  box-shadow: 0 16px 36px rgba(27, 40, 32, 0.11);
  transform: translateY(-2px);
}

.module-card-primary {
  border-color: rgba(45, 115, 86, 0.3);
  background: linear-gradient(180deg, var(--surface), var(--primary-soft));
}

.module-card-head,
.screen-heading,
.template-strip-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.module-kicker,
.list-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.module-status {
  border: 1px solid rgba(45, 115, 86, 0.28);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.muted-status {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.screen-heading {
  padding: 18px 20px;
}

.purchase-list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 12px;
}

.purchase-list-card {
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  animation: card-enter 360ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.purchase-list-card:nth-child(2) {
  animation-delay: 60ms;
}

.purchase-list-card:nth-child(3) {
  animation-delay: 120ms;
}

.purchase-list-card.active {
  border-color: var(--primary);
}

.purchase-list-open {
  display: grid;
  gap: 12px;
  width: 100%;
  min-height: 180px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 18px;
  text-align: left;
}

.purchase-list-topline,
.purchase-list-metrics {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.purchase-list-topline strong {
  font-size: 20px;
}

.purchase-list-topline span {
  color: var(--primary-strong);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
}

.purchase-list-desc {
  min-height: 42px;
  color: var(--muted);
  font-size: 14px;
}

.purchase-card-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.purchase-card-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 260ms ease;
}

.purchase-list-metrics {
  flex-wrap: wrap;
  justify-content: flex-start;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.template-strip {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.template-strip h3 {
  margin: 0;
}

.template-strip-head span,
.template-card span {
  color: var(--muted);
  font-size: 13px;
}

.template-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.template-card {
  display: grid;
  gap: 4px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 12px;
}

.asset-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.asset-list {
  display: grid;
  gap: 10px;
}

.asset-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  animation: card-enter 320ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.asset-card strong,
.asset-card span {
  display: block;
}

.asset-card > div:first-child span,
.asset-card-meta {
  color: var(--muted);
  font-size: 13px;
}

.asset-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.inline-empty {
  border: 1px dashed var(--line-strong);
  box-shadow: none;
}

.mobile-overview {
  display: none;
}

.mobile-overview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px;
}

.mobile-overview-card summary {
  cursor: pointer;
  list-style: none;
}

.mobile-overview-card summary::-webkit-details-marker {
  display: none;
}

.mobile-overview-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 10px;
  align-items: center;
}

.mobile-overview-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mobile-overview-summary strong {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 24px;
  line-height: 1;
}

.mobile-overview-hint {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.mobile-overview-hint::after {
  content: "▾";
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.16s ease;
}

.mobile-overview-card:not([open]) .mobile-overview-hint::after {
  transform: rotate(-90deg);
}

.mobile-overview-card:not([open]) .mobile-overview-metrics,
.mobile-overview-card:not([open]) .mobile-more-stats {
  display: none;
}

.mobile-overview-track {
  grid-column: 1 / -1;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.mobile-overview-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.28s ease;
}

.mobile-overview-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.mobile-overview-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.mobile-overview-metric,
.mobile-more-stat-grid > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  padding: 9px 10px;
}

.mobile-overview-metric span,
.mobile-more-stat-grid span {
  color: var(--muted);
  font-size: 12px;
}

.mobile-overview-metric strong,
.mobile-more-stat-grid strong {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.mobile-more-stats {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 8px;
}

.mobile-more-stats summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mobile-more-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.dashboard-band {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(45, 115, 86, 0.09), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.dashboard-progress {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
}

.progress-score {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.progress-score strong {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 44px;
  line-height: 1;
}

.progress-score span,
.progress-note,
.focus-cell span,
.stat-label,
.muted {
  color: var(--muted);
}

.progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.28s ease;
}

.progress-note {
  margin: 0;
  font-size: 13px;
}

.dashboard-focus {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.focus-cell {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 14px;
}

.focus-cell strong {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.danger-focus strong {
  color: var(--danger);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.compact-stats {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.stat-card {
  display: grid;
  gap: 7px;
  min-height: 92px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

[data-theme="dark"] .stat-card {
  background: rgba(28, 36, 32, 0.9);
}

.stat-label {
  font-size: 12px;
}

.stat-value {
  align-self: end;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 19px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.stat-good {
  border-color: rgba(35, 123, 75, 0.28);
}

.stat-warn {
  border-color: rgba(201, 100, 53, 0.3);
  background: var(--accent-soft);
}

.stat-danger {
  border-color: rgba(170, 58, 49, 0.32);
  background: var(--danger-soft);
}

.stat-danger .stat-value {
  color: var(--danger);
}

.stat-quiet {
  background: var(--gray-soft);
}

.toolbar,
.list-shell {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toolbar {
  padding: 16px;
}

.toolbar-head,
.list-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.toolbar-head {
  margin-bottom: 14px;
}

.toolbar-head h2,
.list-header h2,
.dialog-header h2,
.members-body h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) minmax(240px, 2fr);
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--text);
  padding: 8px 10px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.quick-actions,
.main-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.main-actions {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.danger-button,
.compact-button {
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 8px 12px;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.primary-button {
  border-color: var(--primary-strong);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.secondary-button {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.ghost-button {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.ghost-button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.danger-button {
  border-color: rgba(170, 58, 49, 0.28);
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  padding: 0;
  border-color: var(--line);
  background: var(--paper);
  color: var(--text);
  font-size: 20px;
}

.compact-button {
  min-height: 30px;
  border-color: var(--line);
  background: var(--paper);
  color: var(--text);
  padding: 5px 8px;
  font-size: 13px;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.desktop-label {
  display: inline;
}

.mobile-icon {
  display: none;
}

.mobile-list-controls {
  display: block;
}

.list-header {
  position: relative;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.list-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.more-menu {
  position: absolute;
  right: 16px;
  top: 62px;
  z-index: 12;
  width: 180px;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 8px;
}

.more-menu .ghost-button {
  justify-content: flex-start;
  text-align: left;
}

.muted {
  font-size: 13px;
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 14px 16px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 4px;
}

.view-tab {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.view-tab.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
  box-shadow: inset 0 0 0 1px rgba(61, 133, 91, 0.08);
}

.view-tab span {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  margin-left: 2px;
  font-size: 12px;
}

#openFiltersButton.has-active-filters {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.grid-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px 16px;
}

.grid-tools .search-label {
  min-width: 0;
}

.filter-summary {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.selection-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 16px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--primary-soft);
  padding: 10px 12px;
}

.selection-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grid-wrap {
  padding: 0 16px 16px;
}

.inventory-grid {
  width: 100%;
  height: min(680px, calc(100vh - 330px));
  min-height: 440px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  --ag-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  --ag-font-size: 13px;
  --ag-border-color: var(--line);
  --ag-header-background-color: var(--surface-soft);
  --ag-background-color: var(--surface);
  --ag-foreground-color: var(--text);
  --ag-secondary-foreground-color: var(--muted);
  --ag-odd-row-background-color: var(--paper);
  --ag-row-hover-color: var(--primary-soft);
  --ag-selected-row-background-color: var(--primary-soft);
  --ag-input-focus-border-color: var(--primary);
}

[data-theme="dark"] .inventory-grid {
  --ag-background-color: #1c2420;
  --ag-foreground-color: #edf3ee;
  --ag-header-background-color: #232d28;
  --ag-secondary-foreground-color: #a9b6ad;
  --ag-odd-row-background-color: #18211c;
  --ag-row-hover-color: #243a31;
  --ag-selected-row-background-color: #284234;
  --ag-border-color: #35433b;
  --ag-input-background-color: #111613;
  --ag-input-border-color: #526158;
  --ag-input-focus-border-color: #78d0a4;
  --ag-control-panel-background-color: #1c2420;
  --ag-menu-background-color: #1c2420;
  --ag-modal-overlay-background-color: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .inventory-grid .ag-root-wrapper,
[data-theme="dark"] .inventory-grid .ag-root,
[data-theme="dark"] .inventory-grid .ag-layout-normal,
[data-theme="dark"] .inventory-grid .ag-body,
[data-theme="dark"] .inventory-grid .ag-body-clipper,
[data-theme="dark"] .inventory-grid .ag-body-viewport,
[data-theme="dark"] .inventory-grid .ag-body-vertical-scroll,
[data-theme="dark"] .inventory-grid .ag-body-vertical-scroll-viewport,
[data-theme="dark"] .inventory-grid .ag-body-vertical-scroll-container,
[data-theme="dark"] .inventory-grid .ag-body-horizontal-scroll,
[data-theme="dark"] .inventory-grid .ag-body-horizontal-scroll-viewport,
[data-theme="dark"] .inventory-grid .ag-body-horizontal-scroll-container,
[data-theme="dark"] .inventory-grid .ag-center-cols-clipper,
[data-theme="dark"] .inventory-grid .ag-center-cols-viewport,
[data-theme="dark"] .inventory-grid .ag-center-cols-container,
[data-theme="dark"] .inventory-grid .ag-row-container,
[data-theme="dark"] .inventory-grid .ag-pinned-left-cols-container,
[data-theme="dark"] .inventory-grid .ag-pinned-right-cols-container,
[data-theme="dark"] .inventory-grid .ag-full-width-container,
[data-theme="dark"] .inventory-grid .ag-spanning-container,
[data-theme="dark"] .inventory-grid .ag-overlay,
[data-theme="dark"] .inventory-grid .ag-overlay-wrapper,
[data-theme="dark"] .inventory-grid .ag-paging-panel {
  background: #1c2420 !important;
  color: #edf3ee !important;
  border-color: #35433b !important;
}

[data-theme="dark"] .inventory-grid .ag-header,
[data-theme="dark"] .inventory-grid .ag-header-row,
[data-theme="dark"] .inventory-grid .ag-header-cell,
[data-theme="dark"] .inventory-grid .ag-header-group-cell {
  background: #232d28 !important;
  color: #edf3ee !important;
  border-color: #35433b !important;
}

[data-theme="dark"] .inventory-grid .ag-row {
  background: #1c2420 !important;
  color: #edf3ee !important;
  border-color: #35433b !important;
}

[data-theme="dark"] .inventory-grid .ag-row-odd {
  background: #18211c !important;
}

[data-theme="dark"] .inventory-grid .ag-row-hover,
[data-theme="dark"] .inventory-grid .ag-row:hover {
  background: #243a31 !important;
}

[data-theme="dark"] .inventory-grid .ag-row-selected,
[data-theme="dark"] .inventory-grid .ag-row-selected.ag-row-hover {
  background: #284234 !important;
}

[data-theme="dark"] .inventory-grid .ag-cell,
[data-theme="dark"] .inventory-grid .ag-header-cell-text,
[data-theme="dark"] .inventory-grid .ag-icon,
[data-theme="dark"] .inventory-grid .ag-paging-panel {
  color: #edf3ee !important;
}

[data-theme="dark"] .inventory-grid .grid-over-budget {
  color: var(--danger) !important;
}

.inventory-grid .tag {
  min-height: 20px;
  border-radius: 5px;
  border: 1px solid transparent;
  padding: 1px 6px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0;
}

.grid-over-budget {
  color: var(--danger);
  font-weight: 800;
}

.checkbox-label {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: var(--text);
}

.checkbox-label input {
  width: auto;
  min-height: auto;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

tbody tr:hover {
  background: rgba(45, 115, 86, 0.04);
}

td.name-cell {
  min-width: 150px;
  font-weight: 800;
}

.money-cell {
  white-space: nowrap;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

.note-cell {
  max-width: 220px;
  color: var(--muted);
}

.link-cell {
  max-width: 160px;
  overflow-wrap: anywhere;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.status-select {
  min-width: 88px;
  min-height: 32px;
  margin-top: 6px;
  padding: 4px 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.tag-priority-必买,
.tag-status-待买 {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-priority-建议 {
  background: var(--blue-soft);
  color: var(--blue);
}

.tag-priority-后置,
.tag-status-后置 {
  background: var(--gray-soft);
  color: var(--gray);
}

.tag-priority-已有,
.tag-status-已有,
.tag-status-已买 {
  background: var(--green-soft);
  color: var(--green);
}

.tag-status-不买 {
  background: var(--gray-soft);
  color: var(--gray);
}

.tag-item-type-durable {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.tag-item-type-consumable {
  background: var(--blue-soft);
  color: var(--blue);
}

.tag-item-type-service {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-item-type-material {
  background: var(--gray-soft);
  color: var(--gray);
}

[data-theme="dark"] .inventory-grid .tag-priority-必买,
[data-theme="dark"] .inventory-grid .tag-status-待买 {
  border-color: rgba(240, 161, 108, 0.34);
  background: rgba(240, 161, 108, 0.14);
  color: #ffd0a8;
}

[data-theme="dark"] .inventory-grid .tag-priority-建议 {
  border-color: rgba(154, 200, 238, 0.32);
  background: rgba(154, 200, 238, 0.13);
  color: #c4e1f7;
}

[data-theme="dark"] .inventory-grid .tag-priority-后置,
[data-theme="dark"] .inventory-grid .tag-status-后置,
[data-theme="dark"] .inventory-grid .tag-status-不买 {
  border-color: rgba(197, 206, 200, 0.22);
  background: rgba(197, 206, 200, 0.11);
  color: #d6ded9;
}

[data-theme="dark"] .inventory-grid .tag-priority-已有,
[data-theme="dark"] .inventory-grid .tag-status-已有,
[data-theme="dark"] .inventory-grid .tag-status-已买 {
  border-color: rgba(142, 224, 165, 0.34);
  background: rgba(142, 224, 165, 0.14);
  color: #c5f2d1;
}

[data-theme="dark"] .inventory-grid .tag-item-type-durable,
[data-theme="dark"] .inventory-grid .tag-item-type-consumable,
[data-theme="dark"] .inventory-grid .tag-item-type-service,
[data-theme="dark"] .inventory-grid .tag-item-type-material {
  border-color: rgba(197, 206, 200, 0.18);
  background: rgba(197, 206, 200, 0.1);
  color: #d6ded9;
}

.tag-role-owner {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.tag-role-admin {
  background: var(--blue-soft);
  color: var(--blue);
}

.tag-role-member {
  background: var(--gray-soft);
  color: var(--gray);
}

.over-budget {
  color: var(--danger);
  font-weight: 800;
}

.inventory-grid .ag-row.row-just-saved,
.mobile-row-just-saved {
  animation: saved-flash 1400ms ease both;
}

.mobile-row-just-saved {
  border-color: rgba(45, 115, 86, 0.36);
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes saved-flash {
  0% {
    background-color: var(--green-soft);
    box-shadow: inset 3px 0 0 var(--green);
  }
  65% {
    background-color: color-mix(in srgb, var(--green-soft) 45%, transparent);
    box-shadow: inset 3px 0 0 rgba(35, 123, 75, 0.45);
  }
  100% {
    background-color: transparent;
    box-shadow: inset 0 0 0 transparent;
  }
}

.mobile-list {
  display: none;
  padding: 10px;
  gap: 8px;
  align-items: start;
}

.item-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.item-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
}

.item-card-title {
  font-weight: 800;
}

.item-card-meta,
.item-card-money {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.item-card-money {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

.item-card-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.item-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.mobile-item-row {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  padding: 10px;
}

.mobile-item-over-budget {
  border-color: rgba(170, 58, 49, 0.32);
}

.mobile-row-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.mobile-row-check {
  width: 18px;
  min-height: 18px;
  margin-top: 4px;
}

.mobile-row-open {
  display: grid;
  min-width: 0;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
}

.mobile-row-open:hover {
  transform: none;
}

.mobile-item-row.is-expanded {
  border-color: var(--primary);
  background: var(--surface);
}

.mobile-row-title-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.mobile-row-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.mobile-row-subline {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

.mobile-row-subline > * {
  flex: 0 0 auto;
}

.mobile-row-subline .tag {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

.mobile-priority-text {
  color: var(--muted);
}

.mobile-inline-editor {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.mobile-status-pills {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.mobile-status-pill {
  min-width: 0;
}

.mobile-status-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mobile-status-pill span {
  display: grid;
  place-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mobile-status-pill input:checked + span {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.mobile-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mobile-edit-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.mobile-edit-grid input,
.mobile-edit-grid textarea {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 14px;
}

.mobile-edit-grid textarea {
  resize: vertical;
}

.mobile-edit-wide {
  grid-column: 1 / -1;
}

.mobile-extra-fields {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 8px;
}

.mobile-extra-fields summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mobile-extra-fields .mobile-edit-grid {
  margin-top: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mobile-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 8px;
}

.mobile-row-more {
  position: relative;
}

.mobile-row-more-button {
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  list-style: none;
}

.mobile-row-more-button::-webkit-details-marker {
  display: none;
}

.mobile-row-menu {
  position: absolute;
  top: 38px;
  right: 0;
  z-index: 15;
  display: grid;
  width: min(290px, calc(100vw - 42px));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 10px;
}

.mobile-status-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-status-field .status-select {
  width: 100%;
  margin: 0;
}

.mobile-row-note {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.mobile-row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.empty-state {
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
}

dialog {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(12, 18, 15, 0.5);
}

.dialog-card {
  display: block;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.span-2 {
  grid-column: span 2;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.members-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
}

.members-body h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.member-list {
  display: grid;
  gap: 8px;
}

.member-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 10px;
}

.invite-form {
  display: grid;
  gap: 10px;
}

.invite-result {
  margin-top: 12px;
  border: 1px dashed var(--primary);
  border-radius: var(--radius);
  background: var(--primary-soft);
  padding: 12px;
  overflow-wrap: anywhere;
}

.invite-result strong {
  display: block;
  margin-top: 4px;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 20px;
  letter-spacing: 0;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(45, 115, 86, 0.11), transparent 42%),
    var(--bg);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(340px, 440px);
  gap: 18px;
  width: min(920px, 100%);
  align-items: stretch;
}

.auth-brand,
.auth-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: grid;
  align-content: space-between;
  min-height: 420px;
  padding: 24px;
  overflow: hidden;
  position: relative;
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(45, 115, 86, 0.18);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  border-radius: var(--radius);
  opacity: 0.34;
  pointer-events: none;
}

.auth-brand > * {
  position: relative;
}

.auth-brand h1 {
  margin-top: 8px;
  font-size: 36px;
  line-height: 1.12;
}

.auth-brand p {
  align-self: end;
  margin: 0;
  color: var(--muted);
}

.auth-ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 28px 0;
  max-width: 280px;
}

.auth-ledger span {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

.auth-panel {
  padding: 22px;
}

.auth-title h2 {
  margin-top: 4px;
  font-size: 28px;
}

.auth-title p {
  margin: 6px 0 0;
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0;
}

.auth-tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
}

.auth-tab.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 800;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-message {
  margin-top: 12px;
  border: 1px solid rgba(170, 58, 49, 0.28);
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

@media (max-width: 1240px) {
  .stats-grid {
    grid-template-columns: repeat(5, minmax(140px, 1fr));
  }
}

@media (max-width: 980px) {
  .app-header,
  .dashboard-band,
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .app-header {
    align-items: start;
  }

  .header-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .app-nav {
    order: -1;
    width: 100%;
  }

  .nav-button {
    flex: 1;
  }

  .workbench-hero,
  .screen-heading,
  .asset-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .workbench-hero {
    padding: 18px;
  }

  .workbench-hero h2 {
    font-size: 22px;
  }

  .workbench-hero-metrics,
  .module-metrics,
  .asset-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workbench-grid,
  .purchase-list-grid,
  .template-list {
    grid-template-columns: 1fr;
  }

  .purchase-list-open {
    min-height: 0;
  }

  .template-strip-head,
  .module-card-head {
    align-items: start;
  }

  .asset-card-meta {
    justify-content: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-header,
  .app-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .app-header h1 {
    font-size: 28px;
  }

  .mobile-overview {
    display: block;
    margin-top: 4px;
  }

  .workbench-grid,
  .purchase-list-grid,
  .template-list {
    grid-template-columns: 1fr;
  }

  .workbench-hero-metrics,
  .module-metrics,
  .asset-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-band,
  .compact-stats {
    display: none;
  }

  .dashboard-band,
  .toolbar,
  .list-shell {
    border-radius: var(--radius);
  }

  .dashboard-focus {
    grid-template-columns: 1fr;
  }

  .focus-cell {
    min-height: 86px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card {
    min-height: 84px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .toolbar-head {
    align-items: start;
    flex-direction: column;
  }

  .list-header {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 10px;
  }

  .list-header > div:first-child {
    min-width: 0;
  }

  .list-header h2 {
    font-size: 16px;
  }

  .list-header .muted {
    display: block;
    font-size: 12px;
    line-height: 1.35;
  }

  .list-actions {
    margin-left: auto;
    gap: 8px;
  }

  .list-actions .primary-button,
  .list-actions .secondary-button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: 999px;
    padding: 0;
  }

  .desktop-label {
    display: none;
  }

  .mobile-icon {
    display: inline-grid;
    place-items: center;
    color: currentColor;
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
  }

  .toolbar-head .primary-button {
    width: 100%;
  }

  .main-actions,
  .quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-list-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    gap: 8px;
    align-items: center;
    padding: 10px;
  }

  .grid-tools,
  .selection-bar {
    grid-template-columns: 1fr;
  }

  .grid-tools {
    display: flex;
    justify-content: flex-end;
    padding: 0;
  }

  .grid-tools .search-label,
  .grid-tools #resetColumnsButton {
    display: none;
  }

  .grid-tools #openFiltersButton {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: 999px;
    padding: 0;
  }

  #openFiltersButton.has-active-filters::after {
    content: "";
    position: absolute;
    right: 6px;
    top: 6px;
    width: 7px;
    height: 7px;
    border: 2px solid var(--surface);
    border-radius: 999px;
    background: var(--danger);
  }

  .search-glyph {
    position: relative;
    width: 18px;
    height: 18px;
  }

  .search-glyph::before {
    content: "";
    position: absolute;
    left: 1px;
    top: 1px;
    width: 10px;
    height: 10px;
    border: 2px solid currentColor;
    border-radius: 999px;
  }

  .search-glyph::after {
    content: "";
    position: absolute;
    left: 11px;
    top: 12px;
    width: 8px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform: rotate(45deg);
  }

  .filter-summary:not([hidden]) {
    display: none;
  }

  .filter-summary .ghost-button {
    min-height: 28px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
  }

  .view-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    min-width: 0;
  }

  .view-tab {
    min-height: 34px;
    padding: 5px 4px;
    font-size: 13px;
  }

  .selection-bar {
    align-items: stretch;
  }

  .selection-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .more-menu {
    position: static;
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    margin-top: 0;
  }

  .grid-wrap {
    display: none;
  }

  .table-wrap {
    display: none;
  }

  .mobile-list {
    display: grid;
  }

  .form-grid,
  .members-body {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .auth-page {
    padding: 14px;
  }

  .auth-brand {
    min-height: 280px;
  }
}

@media (min-width: 560px) and (max-width: 720px) {
  .mobile-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-row-menu {
    width: min(300px, calc(50vw - 20px));
  }
}

@media (max-width: 460px) {
  .stats-grid,
  .main-actions,
  .quick-actions,
  .selection-actions {
    grid-template-columns: 1fr;
  }

  .progress-score strong {
    font-size: 36px;
  }

  .auth-brand h1 {
    font-size: 30px;
  }

  .mobile-item-row {
    padding: 9px;
  }

  .mobile-row-main {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
