:root {
  color-scheme: light;
  --bg-top: #eef3fb;
  --bg-bottom: #f9fbfe;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.96);
  --line: rgba(49, 88, 136, 0.12);
  --text: #152131;
  --muted: #6d7f96;
  --blue: #1d77d8;
  --blue-soft: rgba(29, 119, 216, 0.10);
  --pink: #e05a72;
  --pink-strong: #b63a54;
  --pink-soft: rgba(224, 90, 114, 0.10);
  --danger-soft: rgba(209, 69, 93, 0.08);
  --success-soft: rgba(20, 138, 95, 0.10);
  --warn-soft: rgba(181, 120, 35, 0.14);
  --shadow: 0 18px 45px rgba(22, 41, 72, 0.12);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(29, 119, 216, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(224, 90, 114, 0.14), transparent 22%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.6), transparent 28%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
.link,
.view-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

button:hover,
.link:hover,
.view-link:hover {
  transform: translateY(-1px);
}

button.primary,
.link.primary,
.tab.active,
.view-link.accent,
.view-link.is-active.accent {
  color: #fff;
  background: linear-gradient(135deg, var(--pink), #ff7e94);
  border-color: rgba(224, 90, 114, 0.8);
  box-shadow: 0 10px 22px rgba(224, 90, 114, 0.18);
}

button.ghost,
.ghost,
.link.ghost,
.view-link,
.tab {
  color: var(--blue);
  background: rgba(29, 119, 216, 0.05);
  border-color: rgba(29, 119, 216, 0.16);
}

button.danger {
  color: var(--pink-strong);
  background: var(--danger-soft);
  border-color: #f7c7d1;
}

button:disabled,
.link.disabled {
  opacity: 0.52;
  pointer-events: none;
  transform: none;
}

.page-shell {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 42px;
  display: grid;
  gap: 18px;
}

.page-banner {
  padding: 18px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(16, 36, 66, 0.98) 0%, rgba(29, 119, 216, 0.88) 50%, rgba(224, 90, 114, 0.92) 100%);
  color: #fff;
  border: 1px solid rgba(180, 214, 255, 0.16);
  box-shadow: var(--shadow);
}

.page-banner h1 {
  margin: 0;
  font-size: clamp(32px, 5.4vw, 46px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.surface-card,
.result-card,
.list-card,
.log-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.surface-card {
  padding: 18px;
}

.toolbar-card,
.toolbar-main,
.toolbar-side,
.row,
.section-head,
.section-head-meta,
.tabs,
.db-toolbar,
.result-row,
.result-actions,
.candidate-line,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-card,
.section-head,
.result-row {
  justify-content: space-between;
}

.toolbar-main {
  flex: 1 1 420px;
}

.quality-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-soft);
  font-size: 13px;
}

.quality-field select {
  min-height: 32px;
  padding: 0 28px 0 10px;
  border: 1px solid rgba(16, 36, 66, 0.14);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
}

.app-toolbar-main {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  gap: 6px;
}

.app-toolbar-main > .status-pill.user-pill,
.app-toolbar-main > .quota-pill,
.app-toolbar-main > #logout-btn {
  min-height: 28px;
  padding: 0 7px;
  font-size: 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex: 0 1 auto;
}

.app-toolbar-main > .status-pill.user-pill {
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-toolbar-main > .quota-pill {
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-toolbar-main > #logout-btn {
  max-width: 76px;
}

.toolbar-side {
  margin-left: auto;
}

.select-wrap {
  flex: 1 1 280px;
  min-width: 220px;
}

.db-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  width: 100%;
}

.db-toolbar .select-wrap {
  grid-column: 1 / -1;
  min-width: 0;
}

.db-toolbar > button {
  width: auto;
  min-width: 0;
  padding: 0 7px;
  white-space: nowrap;
}

.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.15;
}

.inline-head {
  justify-content: space-between;
}

.stack {
  display: grid;
  gap: 12px;
}

.grid-2,
.grid-3,
.filter-grid,
.age-grid,
.metric-grid {
  display: grid;
  gap: 12px;
}

.search-pair-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.search-mode-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.search-mode-row > .label {
  margin: 0;
  white-space: nowrap;
}

.mode-toggle {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  justify-content: flex-start;
  align-items: center;
}

.mode-toggle-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.mode-toggle-btn.is-active {
  background: linear-gradient(180deg, #c9cfd7 0%, #adb5bf 100%);
  color: var(--blue);
  border-color: rgba(154, 165, 177, 0.72);
  box-shadow: 0 8px 18px rgba(154, 165, 177, 0.16);
}

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

@media (max-width: 760px) {
  .search-mode-row {
    gap: 10px;
  }

  .mode-toggle {
    gap: 6px;
  }

  .mode-toggle-btn {
    min-height: 38px;
    padding: 0 10px;
    font-size: 13px;
  }
}

.match-banner {
  background: linear-gradient(135deg, rgba(16, 36, 66, 0.98) 0%, rgba(29, 119, 216, 0.88) 50%, rgba(224, 90, 114, 0.92) 100%);
}

.match-banner p {
  margin: 8px 0 0;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
}

.match-list-card {
  gap: 10px;
}

.match-list-head {
  align-items: flex-start;
  gap: 10px;
}

.match-title-block {
  display: grid;
  flex: 1 1 320px;
  gap: 8px;
  min-width: 0;
}

.match-title-block h2 {
  margin: 0;
}

.match-quota-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: min(100%, 460px);
}

.match-quota-strip span {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  padding: 6px 6px;
  border-radius: 12px;
  border: 1px solid rgba(29, 119, 216, 0.12);
  background: rgba(29, 119, 216, 0.05);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
}

.match-quota-strip b,
.match-quota-strip strong {
  min-width: 0;
  white-space: nowrap;
}

.match-quota-strip b {
  font-weight: 700;
}

.match-quota-strip strong {
  color: var(--text);
  font-size: 13px;
}

.match-primary-action {
  min-width: 88px;
  min-height: 38px;
  padding: 0 14px;
}

.match-open-create {
  min-width: 132px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 14px;
  white-space: nowrap;
}

.match-compact-toolbar {
  gap: 8px;
  padding: 12px 14px;
}

.match-compact-toolbar .toolbar-main {
  flex: 1 1 auto;
  min-width: 0;
}

.match-status-row {
  gap: 6px;
}

.match-status-row > .status-pill,
.match-status-row > .quota-pill {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.match-toolbar-actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 6px;
  margin-left: auto;
}

.match-toolbar-actions > .view-link,
.match-toolbar-actions > button {
  width: auto;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
}

.match-form-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 8px;
  width: 100%;
  max-width: 360px;
}

.match-created-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 300px;
}

.match-form-actions > button,
.match-form-actions > .link,
.match-created-actions > button {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  white-space: nowrap;
}

.quota-overview,
.admin-video-layout {
  align-items: stretch;
}

.admin-video-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 14px;
}

.match-form-card input,
.match-form-card select,
.match-form-card textarea,
.quota-action-grid input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

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

.quota-action-grid {
  grid-template-columns: minmax(120px, 0.7fr) minmax(120px, 0.7fr) minmax(160px, 1.4fr);
  margin: 10px 0;
}

.match-room-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.match-room-card .result-row {
  align-items: flex-start;
  gap: 12px;
}

.match-room-card .result-row > div:first-child {
  flex: 1 1 360px;
  min-width: 0;
}

.match-room-actions {
  display: grid;
  flex: 0 1 410px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  min-width: min(100%, 340px);
}

.match-room-actions-6 {
  flex-basis: 500px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-width: min(100%, 420px);
}

.match-room-actions > button,
.match-room-actions > .link {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 6px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
}

.match-room-list-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
}

.match-room-list-card.is-finished {
  background: #f5f1f1;
  border-color: #e1d6d6;
}

.match-room-list-card.is-finished .match-room-title,
.match-room-list-card.is-finished .match-room-line,
.match-room-list-card.is-finished .badge,
.match-room-list-card.is-finished .room-action-copy,
.match-room-list-card.is-finished .room-action-disabled {
  color: #8f8181;
}

.match-room-list-card.is-finished .badge {
  background: #eee5e5;
  border-color: #ddd0d0;
}

.match-room-list-card.is-finished .room-action-copy,
.match-room-list-card.is-finished .room-action-disabled {
  background: #eee6e6;
  border-color: #ddd1d1;
  box-shadow: none;
}

.match-room-list-card.is-finished .room-action-copy[disabled],
.match-room-list-card.is-finished .room-action-disabled[disabled] {
  opacity: 1;
}

.match-room-summary {
  display: grid;
  gap: 4px;
}

.match-room-head {
  gap: 8px;
  align-items: flex-start;
}

.match-room-title {
  min-width: 0;
  font-size: 17px;
  line-height: 1.35;
}

.match-room-line {
  margin: 0;
}

.match-room-button-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.match-room-button-row > button,
.match-room-button-row > .link {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 4px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
}

.match-create-modal {
  width: min(540px, 100%);
  max-height: min(82vh, 760px);
  overflow: auto;
}

.match-create-modal-body {
  padding: 18px;
  gap: 12px;
}

.match-create-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.match-create-actions > button {
  width: 100%;
  min-height: 38px;
  min-width: 0;
  padding: 0 12px;
}

.match-inline-feedback {
  min-height: 20px;
}

.match-inline-feedback.is-copy {
  color: #8b1e34;
  font-weight: 700;
}

.copy-notice-panel {
  width: min(280px, 100%);
  border-radius: 18px;
  cursor: pointer;
}

.copy-notice-text {
  padding: 18px 16px;
  text-align: center;
  color: #8b1e34;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.poster-result-card .result-row {
  display: grid;
  gap: 10px;
}

.poster-row {
  width: 100%;
}

.poster-card-head {
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
  flex: 1 1 100%;
}

.poster-result-card .candidate-line {
  width: 100%;
  flex-wrap: wrap;
  gap: 8px;
}

.poster-main-line {
  justify-content: space-between;
  align-items: center;
}

.poster-main-line .status {
  margin-left: auto;
  text-align: right;
  justify-self: end;
}

.poster-subline {
  width: 100%;
  gap: 8px;
}

.poster-subline .candidate-meta {
  padding: 0;
  font-size: 13px;
}

.poster-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  justify-self: stretch;
  align-self: stretch;
}

.poster-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

.poster-card-head,
.poster-actions {
  grid-column: 1 / -1;
}

.poster-actions > button,
.poster-actions > .link {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 13px;
  white-space: nowrap;
}

.match-host-toolbar {
  display: grid;
  gap: 10px;
}

.match-host-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.match-host-status > .status-pill {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.match-host-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.match-host-actions > button,
.match-host-actions > .view-link {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
}

.match-host-note {
  margin: 0;
  min-height: 20px;
  font-size: 13px;
}

.control-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 249, 253, 0.92));
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.control-card h3 {
  margin: 0;
  font-size: 18px;
}

.control-card .muted {
  margin: 0;
  font-size: 12px;
}

.control-card > button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 12px;
}

.guest-control-grid {
  gap: 10px;
}

.control-card.is-waiting {
  border-color: rgba(208, 146, 82, 0.34);
  background: linear-gradient(180deg, rgba(255, 247, 238, 0.98), rgba(252, 242, 229, 0.96));
}

.control-card.is-ready {
  border-color: rgba(185, 87, 101, 0.34);
  background: linear-gradient(180deg, rgba(255, 240, 243, 0.98), rgba(255, 232, 237, 0.96));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.match-guest-toolbar {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.match-guest-status-row {
  display: grid;
  grid-template-columns: minmax(70px, 0.65fr) minmax(0, 1.35fr);
  gap: 8px;
}

.match-guest-status-row > .status-pill {
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-guest-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 8px;
}

.match-guest-actions > button {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  white-space: nowrap;
}

.match-message-card {
  padding: 10px 14px;
}

.match-message-card p {
  margin: 0;
}

.match-message-card p + p {
  margin-top: 4px;
}

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(7, 16, 28, 0.74);
  backdrop-filter: blur(8px);
}

.host-call-overlay {
  padding: 0;
}

.call-shell {
  width: min(980px, 100%);
  height: min(92dvh, 920px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(29, 119, 216, 0.22), transparent 28%),
    linear-gradient(180deg, rgba(7, 16, 28, 0.96), rgba(11, 22, 36, 0.98));
  box-shadow: 0 24px 80px rgba(4, 10, 18, 0.38);
}

.host-call-shell {
  width: 100%;
  height: 100dvh;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  grid-template-rows: minmax(0, 1fr);
}

.guest-call-shell {
  grid-template-rows: minmax(0, 1fr);
}

.host-call-layout {
  position: relative;
  height: 100%;
  min-height: 0;
  padding: 0;
}

.host-side-actions {
  position: absolute;
  top: 50%;
  right: 12px;
  z-index: 5;
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 8px;
  transform: translateY(-50%);
}

.host-side-btn {
  width: auto;
  min-width: 0;
  min-width: 64px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 14px;
  white-space: nowrap;
}

.guest-side-actions {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.guest-side-btn {
  width: auto;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 14px;
  white-space: nowrap;
}

.call-title-block {
  display: grid;
  gap: 4px;
}

.call-title-block strong {
  font-size: 18px;
  font-weight: 700;
}

.call-title-block span {
  color: rgba(235, 242, 250, 0.72);
  font-size: 13px;
}

.guest-call-stage,
.host-call-stage {
  min-height: 0;
}

.guest-call-stage {
  position: relative;
  display: block;
  height: 100%;
}

.host-call-stage {
  --host-card-width: 188px;
  --host-card-height: 334px;
  --host-thumb-width: 84px;
  --host-thumb-height: 149px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, var(--host-card-width));
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  overflow: hidden;
}

.guest-call-stage {
  --guest-main-card-width: 240px;
  --guest-main-card-height: 427px;
  position: relative;
  display: block;
  height: 100%;
}

.guest-thumb-rail {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: clamp(78px, 20vw, 108px);
}

.guest-thumb-rail .call-slot-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
}

.guest-main-slot {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.guest-main-slot > .call-participant-card {
  width: var(--guest-main-card-width);
  height: var(--guest-main-card-height);
}

.host-self-float {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: var(--host-thumb-width);
  height: var(--host-thumb-height);
  transform: translate(-50%, -50%);
}

.host-self-float .call-slot-thumb {
  height: 100%;
}

.host-call-stage .call-slot-main {
  width: var(--host-card-width);
  height: var(--host-card-height);
}

.call-slot {
  min-width: 0;
  min-height: 0;
}

.call-slot-main {
  height: 100%;
}

.call-slot > .call-participant-card {
  height: 100%;
}

.guest-main-slot > .call-participant-card {
  width: var(--guest-main-card-width);
  height: var(--guest-main-card-height);
}

.call-slot-thumb {
  height: clamp(104px, 18vh, 142px);
}

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

.guest-call-shell .call-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.call-controls > button {
  min-width: 0;
  min-height: 42px;
  border-radius: 16px;
  white-space: nowrap;
}

.call-controls > button:disabled {
  opacity: 0.58;
}

.call-participant-card {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 20% 10%, rgba(29, 119, 216, 0.18), transparent 26%),
    linear-gradient(135deg, #13263d, #203d58);
  color: rgba(255, 255, 255, 0.9);
}

.call-participant-card.is-clickable {
  cursor: pointer;
}

.call-participant-card.is-thumbnail {
  border-radius: 20px;
}

.draggable-float {
  touch-action: none;
  user-select: none;
  cursor: grab;
  will-change: left, top;
}

.draggable-float.is-dragging {
  cursor: grabbing;
}

.call-media {
  position: absolute;
  inset: 0;
}

.guest-call-stage .call-media,
.host-call-stage .call-media {
  background: #05080d;
}

.guest-call-stage .call-media video,
.host-call-stage .call-media video {
  object-fit: contain;
}

.call-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.call-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  text-align: center;
}

.call-participant-card.has-video .call-placeholder {
  display: none;
}

.call-label {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  font-size: 12px;
}

.call-corner-action {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  width: auto !important;
  max-width: none;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(164, 33, 45, 0.36);
  border-radius: 999px;
  background: rgba(102, 17, 26, 0.78);
  color: #fff4f1;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.call-corner-action:disabled {
  opacity: 0.48;
}

.video-stage {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  min-height: 360px;
}

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

.video-tile {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(16, 36, 66, 0.16);
  background:
    radial-gradient(circle at 20% 10%, rgba(29, 119, 216, 0.18), transparent 26%),
    linear-gradient(135deg, #13263d, #203d58);
  color: rgba(255, 255, 255, 0.82);
}

.video-tile span {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 1;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  font-size: 12px;
}

.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.is-local {
  min-height: 360px;
}

@media (max-width: 860px) {
  .admin-video-layout,
  .video-stage,
  .copy-grid,
  .quota-action-grid {
    grid-template-columns: 1fr;
  }

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

  .video-tile,
  .is-local {
    min-height: 240px;
  }

  .call-overlay {
    padding: 0;
  }

  .call-shell {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    padding: 12px;
    gap: 10px;
  }

  .call-title-block strong {
    font-size: 16px;
  }

  .guest-thumb-rail {
    top: 10px;
    right: 10px;
    width: clamp(72px, 22vw, 92px);
  }

  .host-call-layout {
    height: 100%;
  }

  .host-side-btn,
  .guest-side-btn {
    min-height: 36px;
    padding: 0 8px;
    font-size: 12px;
  }

  .host-side-actions {
    right: 10px;
    gap: 6px;
  }

  .guest-side-actions {
    right: 10px;
    bottom: 10px;
    gap: 6px;
  }

  .host-self-float {
    width: var(--host-thumb-width);
    height: var(--host-thumb-height);
  }

  .call-slot-thumb {
    height: clamp(92px, 16vh, 118px);
  }

  .call-participant-card {
    border-radius: 20px;
  }

  .call-label {
    right: 10px;
    bottom: 10px;
    padding: 4px 8px;
    font-size: 11px;
  }

  .call-corner-action {
    top: 10px;
    right: 10px;
    min-height: 28px;
    padding: 0 9px;
    font-size: 11px;
  }

  .host-call-stage {
    gap: 8px;
  }
}

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

.search-pair-grid > label span {
  white-space: nowrap;
}

.search-pair-grid > label select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
}

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

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

.filter-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1.05fr);
  align-items: end;
}

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

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
  align-items: start;
  align-content: start;
  grid-auto-rows: var(--admin-card-height, auto);
  height: auto;
}

.admin-card {
  padding: 18px;
  border-radius: 18px;
  overflow: hidden;
  height: 100%;
}

.admin-card.stack,
.admin-card.scroll-card {
  gap: 12px;
}

.admin-card-lg {
  height: 100%;
}

.admin-card-md {
  height: 100%;
}

.admin-card-compact {
  align-content: start;
}

.admin-card-compact.stack {
  gap: 10px;
}

.admin-card-compact .grid-2,
.admin-card-compact .grid-3 {
  gap: 10px;
}

.admin-card-compact .form-actions {
  gap: 8px;
}

.admin-card .section-head h2 {
  font-size: clamp(22px, 2vw, 28px);
}

.admin-card label,
.admin-card .mini-label,
.admin-card .label,
.admin-card .muted,
.admin-card .mini,
.admin-card .error {
  font-size: 12px;
}

.admin-card input,
.admin-card select {
  min-height: 42px;
  border-radius: 14px;
  font-size: 14px;
  padding: 0 14px;
}

.admin-card button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 14px;
}

.admin-card .db-toolbar,
.admin-card .form-actions,
.admin-card .row,
.admin-card .section-head,
.admin-card .result-actions,
.admin-card .candidate-line,
  .admin-card .result-row,
  .admin-card .result-meta {
  gap: 8px;
}

.admin-card .metric-grid {
  gap: 12px;
}

.admin-card .metric-card {
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
}

.admin-card .metric-card strong {
  font-size: 24px;
}

.admin-card .list-card,
.admin-card .log-card {
  padding: 12px 14px;
  border-radius: 18px;
}

.admin-banner p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.84);
}

.admin-nav-card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
}

.admin-inner-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  align-items: stretch;
}

.admin-tab-btn {
  flex: 1 1 140px;
  min-width: 0;
  white-space: nowrap;
  color: var(--blue);
  background: rgba(29, 119, 216, 0.06);
  border-color: rgba(29, 119, 216, 0.16);
  font-weight: 800;
}

.admin-inner-tab-btn {
  flex: initial;
  min-width: 0;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  white-space: nowrap;
  color: var(--blue);
  background: rgba(29, 119, 216, 0.06);
  border-color: rgba(29, 119, 216, 0.16);
  font-weight: 800;
}

.admin-tab-btn.is-active,
.admin-inner-tab-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, #102442 0%, var(--blue) 62%, #3f9de8 100%);
  border-color: rgba(29, 119, 216, 0.42);
  box-shadow: 0 12px 24px rgba(29, 119, 216, 0.18);
}

.admin-shell {
  min-width: 0;
}

.admin-module-card {
  height: clamp(560px, calc(100dvh - 230px), 820px);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

.admin-module-card[data-admin-panel="users"] {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
  overflow: hidden;
}

.admin-module-card[data-admin-panel="users"] > .admin-subgrid {
  min-height: auto;
}

.admin-module-card[data-admin-panel="users"] > .admin-user-list-block {
  min-height: 0;
  overflow: hidden;
}

.admin-module-card::-webkit-scrollbar {
  width: 10px;
}

.admin-module-card::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c8d9f1;
}

.admin-module-card::-webkit-scrollbar-track {
  background: #eef5ff;
  border-radius: 999px;
}

.admin-section-block {
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  min-width: 0;
  overflow: hidden;
}

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

.admin-user-card {
  display: grid;
  gap: 12px;
}

.admin-user-list-block {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  margin-top: 16px;
}

.user-list {
  display: grid;
  gap: 12px;
  min-height: 0;
  max-height: min(48dvh, 540px);
  overflow: auto;
  padding-right: 4px;
  height: 100%;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.user-list::-webkit-scrollbar {
  width: 10px;
}

.user-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c8d9f1;
}

.user-list::-webkit-scrollbar-track {
  background: #eef5ff;
  border-radius: 999px;
}

.admin-user-card .user-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.admin-user-card .user-actions > button {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  white-space: nowrap;
}

.admin-user-quota-grid {
  grid-template-columns: minmax(110px, 0.8fr) minmax(110px, 0.8fr) minmax(160px, 1.4fr);
}

.admin-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  overflow: hidden;
}

.admin-metrics .metric-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 10px 12px;
}

.admin-metrics .metric-card strong {
  font-size: clamp(18px, 5vw, 24px);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.2;
}

#system-status,
#db-picked,
#db-note,
#admin-current-db {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-module-card .section-head {
  align-items: flex-start;
}

.db-toolbar .select-wrap,
.db-toolbar .select-wrap select {
  min-width: 0;
}

.between {
  justify-content: space-between;
}

.quota-panel {
  width: min(720px, 100%);
}

.quota-panel-body {
  padding: 18px;
}

.search-card,
.results-card,
.auth-card {
  display: grid;
  gap: 12px;
}

.results {
  display: grid;
  gap: 12px;
}

.phone-list-window {
  min-height: 360px;
  max-height: min(72dvh, 760px);
  overflow: auto;
  padding-right: 6px;
  align-content: start;
}

.phone-list-window::-webkit-scrollbar {
  width: 10px;
}

.phone-list-window::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c8d9f1;
}

.phone-list-window::-webkit-scrollbar-track {
  background: #eef5ff;
  border-radius: 999px;
}

.footer-card {
  display: grid;
  gap: 0;
}

.footer-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.portal-bottom-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.portal-bottom-nav > .link,
.portal-bottom-nav > button {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  text-align: center;
}

.portal-bottom-nav > .is-active {
  color: var(--blue);
  background: rgba(29, 119, 216, 0.12);
  border-color: rgba(29, 119, 216, 0.3);
}

.portal-admin-bottom-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.footer-logout-btn {
  width: auto;
  min-width: 120px;
  min-height: 42px;
  padding: 0 16px;
}

.metric-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #f7faff 0%, #f2f6fc 100%);
}

.metric-card strong {
  font-size: 24px;
  line-height: 1;
}

.mini-label,
.label,
label {
  color: var(--muted);
  font-size: 12px;
}

.label,
label span,
.mini-label {
  font-weight: 500;
}

.search-card .label,
.search-card .search-pair-grid > label span,
.search-card .quick-filter-grid > .inline-field span,
.search-card .quick-filter-grid > .age-inline-field span,
.search-card .inline-check span {
  font-size: 16px;
}

.search-card .label,
.search-card .quick-filter-grid > .inline-field span,
.search-card .quick-filter-grid > .age-inline-field span,
.search-card .section-head.inline-head > .label {
  font-weight: 800;
}

label {
  display: grid;
  gap: 6px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(49, 88, 136, 0.16);
  background: #fff;
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  min-height: 84px;
  padding: 12px 14px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(224, 90, 114, 0.72);
  box-shadow: 0 0 0 4px rgba(224, 90, 114, 0.12);
}

.auth-card input,
.auth-card select,
.search-card input,
.search-card select {
  font-size: 16px;
}

.quick-filter-grid {
  gap: 10px 10px;
  align-items: center;
}

.quick-filter-grid > .inline-field,
.quick-filter-grid > .age-inline-field {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.quick-filter-grid > .inline-field span,
.quick-filter-grid > .age-inline-field span {
  margin: 0;
  white-space: nowrap;
}

.quick-filter-grid > .inline-field select {
  width: 100%;
  max-width: 240px;
  min-height: 40px;
}

.quick-filter-grid > .age-inline-field .compact-age-grid {
  width: 100%;
  min-width: 0;
  gap: 8px;
  grid-template-columns: minmax(96px, 1fr) minmax(96px, 1fr);
}

.quick-filter-grid > .age-inline-field .compact-age-grid input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
}

.status-pill,
.badge,
.quota-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-pill.user-pill {
  color: #c4425b;
  background: var(--pink-soft);
}

.status-pill.neutral {
  color: var(--muted);
  background: #f4f8fe;
  border-color: var(--line);
}

.status-pill.soft-count {
  color: #c4425b;
  background: #fcecf1;
}

.badge {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.badge.ok {
  color: #2c8b62;
  background: var(--success-soft);
}

.badge.warn {
  color: #b57a18;
  background: var(--warn-soft);
}

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

.quota-pill.unlimited {
  color: var(--blue);
  background: var(--blue-soft);
}

.quota-pill.ok {
  color: #2c8b62;
  background: var(--success-soft);
}

.quota-pill.low {
  color: #b57a18;
  background: var(--warn-soft);
}

.quota-pill.empty {
  color: #d24c66;
  background: var(--danger-soft);
}

.view-link {
  min-height: 42px;
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.view-link.is-active {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: #bfd7fa;
}

.view-link.accent {
  background: linear-gradient(180deg, #f97f96 0%, var(--pink) 100%);
  color: #fff;
  border-color: rgba(241, 98, 126, 0.45);
}

.tabs {
  margin-left: auto;
}

.auth-head {
  justify-content: space-between;
}

.auth-head h2 {
  font-size: clamp(24px, 2vw, 30px);
}

.form-actions {
  justify-content: flex-start;
}

.search-card .form-actions {
  flex-wrap: nowrap;
}

.keyword-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.keyword-row .query-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
}

.keyword-row .query-remove {
  flex: 0 0 auto;
  width: auto;
  min-width: 62px;
  padding: 0 10px;
  white-space: nowrap;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 14px;
}

.inline-check input[type="checkbox"] {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
}

.muted,
.mini,
.error {
  margin: 0;
}

.muted,
.mini {
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.error {
  color: #d24c66;
  min-height: 24px;
  font-size: 13px;
}

.result-card,
.list-card,
.log-card {
  padding: 14px 16px;
}

.admin-layout > .surface-card {
  height: 100%;
}

.scroll-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.scroll-region {
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding-right: 6px;
}

.scroll-region::-webkit-scrollbar {
  width: 10px;
}

.scroll-region::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c8d9f1;
}

.scroll-region::-webkit-scrollbar-track {
  background: #eef5ff;
  border-radius: 999px;
}

.result-card {
  display: grid;
  gap: 12px;
}

.result-row {
  align-items: flex-start;
}

.candidate-line {
  flex: 1 1 360px;
}

.candidate-name {
  font-size: 18px;
  font-weight: 700;
}

.candidate-meta,
.result-meta {
  color: var(--muted);
  font-size: 14px;
}

.result-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-grid {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px 0;
  align-items: start;
}

.detail-grid dt {
  color: var(--muted);
  font-weight: 600;
  margin: 6px 0 0;
  white-space: normal;
}

.detail-grid dd {
  margin: 0 0 2px;
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.55;
}

.detail-dialog {
  width: min(720px, 100%);
  max-height: min(84vh, 860px);
  display: flex;
  flex-direction: column;
}

.detail-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

.detail-body {
  max-height: min(72vh, 760px);
  overflow: auto;
}

.detail-modal-grid dd {
  color: #b32d44;
}

.user-list,
.log-list {
  display: grid;
  gap: 12px;
}

#poster-consumption-panel,
#video-consumption-panel {
  min-height: 280px;
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
  background: var(--surface-soft);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(24, 40, 66, 0.34);
}

.modal-panel {
  width: min(720px, 100%);
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 22px 60px rgba(56, 82, 125, 0.22);
}

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

.preview-title {
  font-size: 16px;
  font-weight: 700;
}

.preview-body {
  min-height: 220px;
  max-height: min(74vh, 820px);
  overflow: auto;
  padding: 18px;
  background: var(--surface-soft);
}

.preview-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}

.preview-message {
  color: var(--muted);
  text-align: center;
}

.editor-panel .stack {
  padding: 18px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1280px) {
  .admin-layout,
  .grid-3,
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quick-filter-grid {
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 0.78fr) minmax(0, 1.12fr);
  }
}

@media (max-width: 980px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    margin: 10px auto calc(110px + env(safe-area-inset-bottom, 0px));
  }

  .page-banner {
    padding: 22px 22px 24px;
    border-radius: 28px;
  }

  .page-banner h1 {
    font-size: clamp(26px, 6.2vw, 36px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }

  .surface-card,
  .result-card,
  .list-card,
  .log-card {
    border-radius: 28px;
  }

  .surface-card {
    padding: 20px;
  }

  .toolbar-card,
  .toolbar-main,
  .toolbar-side,
  .result-row,
  .result-actions,
  .candidate-line {
    width: 100%;
  }

  .app-toolbar-main {
    gap: 4px;
    width: 100%;
    flex-wrap: nowrap;
  }

  .app-toolbar-main > .status-pill.user-pill {
    max-width: 20vw;
  }

  .app-toolbar-main > .quota-pill {
    max-width: 24vw;
  }

  .app-toolbar-main > #logout-btn {
    max-width: 24vw;
    padding: 0 5px;
    font-size: 9px;
  }

  .toolbar-side {
    margin-left: 0;
  }

  .admin-layout,
  .grid-2,
  .grid-3,
  .filter-grid,
  .age-grid,
  .admin-subgrid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .search-pair-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
  }

  .search-pair-grid > label select {
    min-height: 40px;
    padding: 0 10px;
    font-size: 15px;
  }

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

  .admin-card-lg,
  .admin-card-md {
    height: auto;
  }

  .admin-db-card {
    order: 1;
  }

  .admin-settings-card {
    order: 2;
  }

  .admin-create-card {
    order: 3;
  }

  .admin-users-card {
    order: 4;
  }

  .admin-downloads-card {
    order: 5;
  }

  .admin-audit-card {
    order: 6;
  }

  .admin-card-compact {
    padding: 14px 16px;
    border-radius: 20px;
  }

  .admin-card-compact.stack {
    gap: 8px;
  }

  .admin-card-compact .section-head h2 {
    font-size: clamp(18px, 3vw, 22px);
  }

  .admin-card-compact .grid-2,
  .admin-card-compact .grid-3 {
    gap: 8px;
  }

  .admin-card-compact input,
  .admin-card-compact select,
  .admin-card-compact button {
    min-height: 38px;
    font-size: 13px;
    padding: 0 12px;
  }

  .admin-card-compact .form-actions {
    gap: 8px;
  }

  .admin-nav-card {
    gap: 8px;
    padding: 12px;
  }

  .admin-tab-btn {
    flex: 1 1 calc(50% - 8px);
    min-height: 38px;
    padding: 0 10px;
    font-size: 13px;
  }

  .admin-module-card {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 16px;
  }

  .admin-module-card[data-admin-panel="users"] {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .admin-user-list-block {
    display: grid;
    grid-template-rows: auto auto;
    min-height: auto;
    overflow: visible;
  }

  .user-list {
    height: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .admin-section-block {
    padding: 12px;
  }

  .admin-user-quota-grid {
    grid-template-columns: 1fr;
  }

  .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .admin-metrics .metric-card {
    min-width: 0;
    padding: 9px 10px;
  }

  .admin-metrics .metric-card strong {
    font-size: clamp(16px, 4.2vw, 18px);
  }

  .db-toolbar {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    align-items: stretch;
    position: relative;
    z-index: 1;
  }

  .db-toolbar .select-wrap {
    grid-column: 1 / -1;
  }

  .db-toolbar .select-wrap select {
    width: 100%;
  }

  .db-toolbar > button {
    display: inline-flex !important;
    width: 100% !important;
    min-height: 38px;
    padding: 0 5px;
    font-size: 12px;
  }

  #poster-consumption-panel,
  #video-consumption-panel {
    min-height: 0;
    overflow: visible;
    scrollbar-gutter: auto;
  }

  button,
  .link,
  .view-link {
    width: 100%;
  }

  .form-actions,
  .toolbar-main,
  .toolbar-side,
  .result-actions {
    gap: 12px;
  }

  .match-list-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(72px, auto);
    gap: 8px;
  }

  .match-quota-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .match-quota-strip span {
    padding: 5px 4px;
    font-size: 11px;
  }

  .match-quota-strip strong {
    font-size: 12px;
  }

  .match-primary-action {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 0 8px;
    font-size: 12px;
  }

  .match-open-create {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 0 6px;
    font-size: 12px;
  }

  .match-compact-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .match-toolbar-actions {
    grid-auto-flow: initial;
    grid-auto-columns: initial;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    width: 100%;
    margin-left: 0;
  }

  .match-toolbar-actions > .view-link,
  .match-toolbar-actions > button {
    width: 100%;
    min-width: 0;
    padding: 0 4px;
  }

  .match-form-actions,
  .match-created-actions {
    max-width: none;
  }

  .match-room-card {
    padding: 12px;
  }

  .match-room-card .result-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .match-room-actions,
  .match-room-actions-6 {
    width: 100%;
    min-width: 0;
    flex-basis: auto;
    gap: 5px;
  }

  .match-room-actions {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .match-room-actions-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .match-room-actions > button,
  .match-room-actions > .link {
    min-height: 32px;
    padding: 0 2px;
    font-size: 11px;
  }

  .match-room-list-card {
    padding: 11px 12px;
  }

  .match-room-title {
    font-size: 16px;
  }

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

  .match-room-button-row > button,
  .match-room-button-row > .link {
    min-height: 32px;
    padding: 0 2px;
    font-size: 11px;
  }

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

  .phone-list-window {
    min-height: 300px;
    max-height: min(58dvh, 560px);
    padding-right: 2px;
  }

  .poster-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px;
    width: 100% !important;
    min-width: 0;
  }

  .poster-actions > button,
  .poster-actions > .link {
    min-height: 36px;
    padding: 0 6px;
    font-size: 12px;
  }

  .match-host-status {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .match-host-status > .status-pill {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .match-host-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .match-host-actions > button,
  .match-host-actions > .view-link {
    min-height: 34px;
    padding: 0 2px;
    font-size: 11px;
  }

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

  .match-guest-status-row {
    grid-template-columns: minmax(62px, 0.65fr) minmax(0, 1.35fr);
  }

  .app-toolbar-main {
    display: flex;
    align-items: center;
  }

  .app-toolbar-main > .status-pill.user-pill,
  .app-toolbar-main > .quota-pill,
  .app-toolbar-main > #logout-btn {
    min-height: 26px;
    padding: 0 5px;
    font-size: 9px;
  }

  .form-actions {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    gap: 8px;
  }

  .search-card .form-actions > button,
  .form-actions > button {
    width: auto;
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    min-height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }

  .keyword-row .query-remove {
    min-width: 60px;
  }

  .footer-actions {
    justify-content: flex-end;
  }

  .footer-card {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    z-index: 70;
    margin: 0;
    padding: 12px;
    border-radius: 24px;
    box-shadow: 0 18px 42px rgba(7, 16, 28, 0.18);
  }

  .footer-card .portal-bottom-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-card .portal-admin-bottom-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .footer-card .portal-bottom-nav > .link,
  .footer-card .portal-bottom-nav > button,
  .footer-card .footer-logout-btn {
    width: 100%;
    min-width: 0;
    font-size: 12px;
    padding: 0 4px;
    letter-spacing: -0.02em;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
  }
}

@media (max-width: 760px) {
  .quick-filter-grid {
    gap: 8px;
  }

  .quick-filter-grid > .inline-field,
  .quick-filter-grid > .age-inline-field {
    display: grid;
    grid-template-columns: minmax(64px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }

  .quick-filter-grid > .inline-field span,
  .quick-filter-grid > .age-inline-field span {
    margin: 0;
    white-space: nowrap;
    font-size: 14px;
  }

  .quick-filter-grid > .inline-field select,
  .quick-filter-grid > .age-inline-field .compact-age-grid input {
    min-height: 38px;
    padding: 0 10px;
    font-size: 14px;
  }

  .quick-filter-grid > .age-inline-field .compact-age-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .keyword-row {
    gap: 8px;
  }

  .keyword-row .query-input {
    min-height: 38px;
    padding: 0 10px;
    font-size: 14px;
  }

  .keyword-row .query-remove {
    min-width: 56px;
    min-height: 38px;
    padding: 0 8px;
  }

  .form-actions {
    gap: 8px;
  }

  .search-card .form-actions > button,
  .form-actions > button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 13px;
  }

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

  .admin-metrics .metric-card {
    padding: 8px 8px;
  }

  .admin-metrics .metric-card strong {
    font-size: 16px;
  }

  .db-toolbar {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    align-items: stretch;
  }

  .db-toolbar .select-wrap {
    grid-column: 1 / -1;
  }

  .db-toolbar .select-wrap select {
    width: 100%;
  }

  .db-toolbar > button {
    display: inline-flex !important;
    width: 100% !important;
    min-height: 36px;
    padding: 0 4px;
    font-size: 12px;
  }

  .copy-notice-text {
    padding: 16px 14px;
    font-size: 14px;
  }

  .search-pair-grid {
    gap: 8px;
  }

  .search-pair-grid > label {
    gap: 4px;
  }

  .search-pair-grid > label span {
    font-size: 14px;
  }

  .search-pair-grid > label select {
    min-height: 38px;
    padding: 0 10px;
    font-size: 14px;
  }
}
