:root {
  --bg: #edf8ff;
  --bg-2: #dff1fc;
  --panel: #ffffff;
  --panel-soft: #f5fbff;
  --panel-blue: #e8f5fd;
  --text: #17344d;
  --text-soft: #607f98;
  --line: #c7e1f2;
  --line-strong: #9fcde9;
  --blue: #1778b8;
  --blue-dark: #0d5f99;
  --blue-deep: #0b4f82;
  --blue-light: #5fb8e9;
  --blue-pale: #d9f0fc;
  --danger: #b74c58;
  --danger-bg: #fff0f2;
  --success: #287a65;
  --shadow: 0 16px 40px rgba(25, 91, 135, 0.12);
  --shadow-soft: 0 8px 22px rgba(25, 91, 135, 0.09);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  font-size: 16px;
}

body {
  color: var(--text);
  background: linear-gradient(180deg, #f7fcff 0%, var(--bg) 42%, var(--bg-2) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(23, 120, 184, 0.2);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

/* Banner */
.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 434;
  overflow: hidden;
  border: 1px solid rgba(135, 195, 230, 0.7);
  border-radius: 28px;
  background: #cfeeff url('/banner.png') center / cover no-repeat;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 67, 113, 0.02), rgba(5, 67, 113, 0.08));
}

.hero-actions {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
}

.lang-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  background: rgba(235, 248, 255, 0.9);
  box-shadow: 0 8px 22px rgba(13, 80, 126, 0.18);
  backdrop-filter: blur(8px);
}

.lang-btn {
  width: 62px;
  min-width: 62px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  color: var(--blue-deep);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 800;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.lang-btn:hover {
  transform: translateY(-1px);
}

.lang-btn.active {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 6px 14px rgba(13, 95, 153, 0.22);
}

.hero-cta-row {
  display: flex;
  justify-content: center;
  margin: 16px 0 0;
}

/* Buttons */
.primary-btn,
.secondary-btn,
.action-btn,
.icon-btn,
.mini-btn,
.chip-btn,
.run-toggle,
.member-pill,
.member-name-btn {
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.primary-btn,
.secondary-btn,
.action-btn {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 800;
}

.primary-btn {
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(23, 120, 184, 0.2);
}

.primary-btn:hover {
  transform: translateY(-1px);
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

.hero-create-btn {
  min-width: 260px;
  min-height: 52px;
  border-radius: 14px;
  font-size: 1rem;
}

.secondary-btn {
  border: 1px solid var(--line-strong);
  color: var(--blue-deep);
  background: var(--panel-soft);
}

.secondary-btn:hover {
  transform: translateY(-1px);
  background: var(--panel-blue);
}

.secondary-btn-small {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 0.88rem;
}

.action-btn {
  border: 1px solid var(--line);
  color: var(--blue-deep);
  background: var(--blue-pale);
}

.action-btn:hover {
  transform: translateY(-1px);
}

.action-btn.danger,
.mini-btn.danger {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #f3cbd0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--blue-deep);
  background: var(--panel-soft);
  font-size: 1.45rem;
  line-height: 1;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stat-card {
  min-height: 94px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.stat-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.stat-card strong {
  color: var(--blue-dark);
  font-size: 1.75rem;
  line-height: 1;
}

/* Main panel */
.panel {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.modal-header h3,
.run-head h3,
.subpanel h4 {
  margin: 0;
  color: var(--text);
  font-weight: 850;
}

.panel-header h2 {
  font-size: 1.65rem;
}

.panel-header p {
  margin: 5px 0 0;
  color: var(--text-soft);
}

/* Filters */
.filters-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 12px;
  margin-top: 16px;
}

.field,
.search-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.field span,
.field label,
.field-label {
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: #fbfdff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(95, 184, 233, 0.18);
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.chip-btn {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--blue-deep);
  background: #fff;
  font-size: 0.88rem;
  font-weight: 800;
}

.chip-btn:hover {
  transform: translateY(-1px);
  background: var(--panel-blue);
}

.chip-btn.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 6px 14px rgba(23, 120, 184, 0.16);
}

/* Board */
.board-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  min-width: 0;
}

.loading,
.empty-state,
.error-banner {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
  color: var(--text-soft);
  text-align: center;
}

.loading {
  padding: 30px 18px;
}

.error-banner {
  padding: 18px;
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #f3cbd0;
}
/* ===== Empty state illustration ===== */

.empty-state.empty-state-illustrated {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 0;
  padding: 28px 20px;
  text-align: center;
  overflow: hidden;
}

.empty-state-copy {
  width: 100%;
  max-width: 700px;
  text-align: center;
}

.empty-state-copy h3 {
  margin: 0;
  color: var(--blue-deep);
  font-size: 1.25rem;
  line-height: 1.3;
}

.empty-state-copy p {
  margin: 7px 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.empty-state-art-wrap {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
}

.empty-state-art {
  display: block;
  width: min(420px, 80vw);
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Dungeon cards */
.run-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.run-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.run-title-block {
  min-width: 0;
  flex: 1;
}

.run-title-row {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 12px;
}

.run-title-row h3 {
  min-width: 0;
  color: var(--blue-deep);
  font-size: 1.4rem;
  line-height: 1.25;
}

.run-inline-notes {
  display: flex;
  min-width: 0;
  gap: 5px;
  color: var(--text-soft);
  font-size: 0.86rem;
}

.run-inline-notes-label {
  flex: 0 0 auto;
  font-weight: 750;
}

.run-inline-notes-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--blue-deep);
  background: var(--panel-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.badge.primary {
  color: var(--blue-dark);
  background: var(--blue-pale);
}

.badge.danger {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #f3cbd0;
}

.run-head-side {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.run-updated {
  color: var(--text-soft);
  font-size: 0.78rem;
  white-space: nowrap;
}

.run-head-actions {
  display: grid;
  grid-template-columns: auto auto;
  gap: 7px;
}

.run-head-actions .run-join-btn {
  grid-column: 1 / -1;
}

.run-head-actions .primary-btn,
.run-head-actions .secondary-btn,
.run-head-actions .action-btn {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.84rem;
}

.run-summary-grid {
  display: grid;
  grid-template-columns: 2.1fr repeat(3, 0.7fr);
  gap: 8px;
  margin-top: 14px;
}

.summary-box {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel-soft);
}

.summary-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

.summary-value {
  display: block;
  overflow-wrap: anywhere;
  color: var(--blue-deep);
  font-size: 0.98rem;
}

.run-preview-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.run-preview-join-row {
  display: none;
}

.member-preview {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  gap: 7px;
}

.member-pill,
.member-pill-btn {
  min-height: 34px;
  max-width: 190px;
  padding: 0 11px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--blue-deep);
  background: #f4fbff;
  font-size: 0.82rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-pill:hover,
.member-pill-btn:hover {
  transform: translateY(-1px);
  border-color: var(--blue-light);
  background: var(--blue-pale);
}

/* Member preview colors by class */
.member-pill.member-pill--tank {
  background: linear-gradient(180deg, #fff1df, #f4c88e);
  border-color: rgba(207, 129, 36, 0.30);
  color: #8f4f08;
}

.member-pill.member-pill--healer {
  background: linear-gradient(180deg, #fff1f8, #f3c0d8);
  border-color: rgba(205, 119, 161, 0.28);
  color: #9a3e6e;
}

.member-pill.member-pill--bloodstrom {
  background: linear-gradient(180deg, #f3e5d9, #d7b18a);
  border-color: rgba(134, 93, 57, 0.30);
  color: #6f4424;
}

.member-pill.member-pill--numina {
  background: linear-gradient(180deg, #f3edff, #d5c0f1);
  border-color: rgba(130, 93, 181, 0.28);
  color: #68429d;
}

.member-pill.member-pill--nightwaker {
  background: linear-gradient(180deg, #eef9ff, #c3e8f7);
  border-color: rgba(90, 161, 191, 0.28);
  color: #2e6f8d;
}

.member-pill.member-pill--celestune {
  background: linear-gradient(180deg, #edf3ff, #bfd0f0);
  border-color: rgba(61, 89, 145, 0.30);
  color: #29467b;
}

.member-pill.member-pill--dragonsvelte {
  background: linear-gradient(180deg, #f2fbe9, #cfe9b4);
  border-color: rgba(108, 156, 70, 0.28);
  color: #507b2f;
}

.member-pill.member-pill--other {
  background: linear-gradient(180deg, #ffffff, #f4f5f7);
  border-color: rgba(160, 170, 185, 0.28);
  color: #44566d;
}

.member-pill.member-pill--tank:hover,
.member-pill.member-pill--healer:hover,
.member-pill.member-pill--bloodstrom:hover,
.member-pill.member-pill--numina:hover,
.member-pill.member-pill--nightwaker:hover,
.member-pill.member-pill--celestune:hover,
.member-pill.member-pill--dragonsvelte:hover,
.member-pill.member-pill--other:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.run-card-bottom-bar {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.run-toggle {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: var(--blue-dark);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 800;
}

.run-toggle::after {
  content: "⌃";
  display: inline-block;
  margin-left: 7px;
}

.is-collapsed .run-toggle::after {
  content: "⌄";
}

.run-toggle:hover {
  background: var(--panel-blue);
}

.run-details {
  margin-top: 12px;
}

.is-collapsed .run-details {
  display: none;
}

.is-expanded .run-details {
  display: block;
}

/* Member table */
.member-section {
  min-width: 0;
}

.member-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.member-section-head strong {
  color: var(--blue-deep);
}

.member-table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.member-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.member-table th,
.member-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e5f2fa;
  text-align: left;
  vertical-align: middle;
}

.member-table th {
  color: var(--text-soft);
  background: var(--panel-soft);
  font-size: 0.8rem;
  font-weight: 800;
}

.member-table td {
  font-size: 0.88rem;
}

.member-table tbody tr:last-child td {
  border-bottom: 0;
}

.member-table tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.member-table tbody tr:hover td {
  background: #f2faff;
}

.member-table--simple th:nth-child(1) { width: 24%; }
.member-table--simple th:nth-child(2) { width: 16%; }
.member-table--simple th:nth-child(3) { width: 16%; }
.member-table--simple th:nth-child(4) { width: auto; }

.member-cell-main {
  min-width: 0;
}

.member-name-btn {
  max-width: 100%;
  padding: 0;
  border: 0;
  color: var(--blue-dark);
  background: transparent;
  text-align: left;
}

.member-name-btn:hover {
  color: var(--blue-deep);
  text-decoration: underline;
}

.member-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.mini-btn {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--blue-deep);
  background: var(--panel-soft);
  font-size: 0.8rem;
  font-weight: 800;
}

/* Modal / forms */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 55, 84, 0.42);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(900px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(10, 65, 103, 0.24);
}

.modal-card.member-modal-card {
  width: min(620px, 100%);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  color: var(--blue-deep);
  font-size: 1.28rem;
}

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

.full-span {
  grid-column: 1 / -1;
}

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

.check-item,
.checkbox-item {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-soft);
}

.check-item input,
.checkbox-item input {
  width: 16px;
  height: 16px;
  min-height: 0;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--blue);
}

.check-item span,
.checkbox-item span {
  color: var(--text);
  font-size: 0.86rem;
}

.subpanel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.subpanel h4 {
  margin-bottom: 10px;
  color: var(--blue-deep);
  font-size: 1rem;
}

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.form-actions.single-action .primary-btn {
  min-width: 160px;
}

.optional-note {
  color: var(--text-soft);
  font-size: 0.8em;
  font-weight: 600;
}

/* Tablet */
@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 24px, 1240px);
    padding-top: 12px;
  }

  .hero {
    border-radius: 22px;
  }

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

  .filters-grid .search-field {
    grid-column: 1 / -1;
  }

  .run-head {
    flex-direction: column;
  }

  .run-head-side {
    width: 100%;
    align-items: stretch;
  }

  .run-head-top {
    display: flex;
    justify-content: flex-end;
  }

  .run-head-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .run-head-actions .run-join-btn {
    grid-column: auto;
  }

  .run-head-actions .primary-btn,
  .run-head-actions .secondary-btn,
  .run-head-actions .action-btn {
    width: 100%;
  }

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

  .run-summary-grid .summary-box:first-child {
    grid-column: 1 / -1;
  }
}

/* Mobile */
@media (max-width: 680px) {
  html {
    font-size: 15px;
  }

  .app-shell {
    width: min(100% - 16px, 1240px);
    padding: 8px 0 28px;
  }

  .hero {
    border-radius: 16px;
  }

  .hero-actions {
    top: 8px;
    right: 8px;
  }

  .lang-toggle {
    gap: 2px;
    padding: 3px;
  }

  .lang-btn {
    width: 42px;
    min-width: 42px;
    height: 28px;
    font-size: 0.74rem;
  }

  .hero-cta-row {
    margin-top: 10px;
  }

  .hero-create-btn {
    min-width: min(260px, 88vw);
    min-height: 46px;
    font-size: 0.9rem;
  }

  .stats-grid {
    gap: 6px;
    margin-top: 10px;
  }

  .stat-card {
    min-height: 62px;
    padding: 8px 9px;
    border-radius: 12px;
  }

  .stat-card span {
    margin-bottom: 3px;
    font-size: 0.66rem;
    line-height: 1.2;
  }

  .stat-card strong {
    font-size: 1.1rem;
  }

  .panel {
    margin-top: 10px;
    padding: 11px;
    border-radius: 16px;
  }

  .panel-header {
    padding-bottom: 9px;
  }

  .panel-header h2 {
    font-size: 1.12rem;
  }

  .panel-header p {
    font-size: 0.77rem;
    line-height: 1.4;
  }

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

  .filters-grid .search-field {
    grid-column: 1 / -1;
  }

  .field span,
  .field label,
  .field-label {
    font-size: 0.76rem;
  }

  input,
  select,
  textarea {
    min-height: 39px;
    padding: 7px 9px;
    border-radius: 10px;
    font-size: 0.82rem;
  }

  .chips-row {
    gap: 6px;
    margin-top: 9px;
    padding: 7px;
    border-radius: 11px;
  }

  .chip-btn {
    min-height: 31px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 0.72rem;
  }

  .secondary-btn-small {
    min-height: 31px;
    font-size: 0.72rem;
  }

  .board-list {
    gap: 9px;
    margin-top: 9px;
  }

.empty-state.empty-state-illustrated {
  gap: 12px;
  padding: 20px 12px;
}

.empty-state-copy h3 {
  font-size: 1rem;
}

.empty-state-copy p {
  margin-top: 5px;
  font-size: 0.78rem;
}

.empty-state-art {
  width: min(300px, 82vw);
}

  .run-card {
    padding: 11px;
    border-radius: 15px;
  }

  .run-head {
    gap: 8px;
  }

  .run-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .run-title-row h3 {
    font-size: 1.03rem;
  }

  .run-inline-notes {
    max-width: 100%;
    font-size: 0.72rem;
  }

  .run-meta {
    gap: 5px;
    margin-top: 6px;
  }

  .badge {
    min-height: 26px;
    padding: 0 8px;
    font-size: 0.7rem;
  }

  .run-head-top {
    justify-content: flex-start;
  }

  .run-updated {
    font-size: 0.66rem;
  }

  .run-head-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .run-head-actions .run-join-btn {
    display: none;
  }

  .run-head-actions .primary-btn,
  .run-head-actions .secondary-btn,
  .run-head-actions .action-btn {
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .run-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 9px;
  }

  .run-summary-grid .summary-box:first-child {
    grid-column: 1 / -1;
  }

  .summary-box {
    padding: 8px 9px;
    border-radius: 10px;
  }

  .summary-label {
    font-size: 0.64rem;
  }

  .summary-value {
    font-size: 0.82rem;
  }

  .run-preview-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
  }

  .run-preview-join-row {
    display: block;
    width: 100%;
  }

  .run-join-inline-btn {
    width: 100%;
    min-height: 36px;
    border-radius: 9px;
    font-size: 0.76rem;
  }

  .member-preview {
    gap: 5px;
  }

  .member-pill,
  .member-pill-btn {
    min-height: 29px;
    max-width: 135px;
    padding: 0 9px;
    font-size: 0.7rem;
  }

  .run-card-bottom-bar {
    margin-top: 8px;
    padding-top: 7px;
  }

  .run-toggle {
    min-height: 30px;
    font-size: 0.72rem;
  }

  .member-section-head {
    font-size: 0.8rem;
  }

  .member-table {
    min-width: 560px;
  }

  .member-table th,
  .member-table td {
    padding: 8px 9px;
    font-size: 0.72rem;
  }

  .modal-backdrop {
    align-items: flex-start;
    padding: 10px;
  }

  .modal-card {
    max-height: calc(100vh - 20px);
    padding: 12px;
    border-radius: 16px;
  }

  .modal-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .modal-header h3 {
    font-size: 1.02rem;
  }

  .form-grid,
  .member-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #run-form > .field:nth-child(1),
  #run-form > .field:nth-child(2),
  #run-form > .full-span,
  .member-fields .full-span {
    grid-column: 1 / -1;
  }

  .checkbox-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .check-item,
  .checkbox-item {
    min-height: 50px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 5px 3px;
    text-align: center;
  }

  .check-item span,
  .checkbox-item span {
    font-size: 0.68rem;
    line-height: 1.1;
  }

  .form-actions {
    gap: 6px;
  }

  .form-actions .primary-btn,
  .form-actions .action-btn {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.8rem;
  }
  .empty-state-art {
  width: min(220px, 68vw);
}
}

@media (max-width: 420px) {
  .stats-grid {
    gap: 4px;
  }

  .stat-card {
    min-height: 56px;
    padding: 7px;
  }

  .stat-card span {
    font-size: 0.6rem;
  }

  .stat-card strong {
    font-size: 1rem;
  }

  .filters-grid {
    gap: 6px;
  }

  .checkbox-grid {
    gap: 4px;
  }

  .member-pill,
  .member-pill-btn {
    max-width: 120px;
  }
}
