:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --panel-soft: #fafafa;
  --line: #d9dde3;
  --line-strong: #c2c8d0;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-soft: #e8efff;
  --danger: #d14343;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-panel {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 600;
}

.login-subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}

.field input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0 12px;
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-ghost {
  background: #fff;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-small {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

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

.demo-user-actions {
  min-width: 300px;
}

.table-inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-inline-form input {
  width: 150px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
}

.account-attributes-form,
.phone-policy-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 440px;
  max-width: 100%;
  margin-top: 10px;
  margin-bottom: 10px;
}

.account-attributes-form label,
.phone-policy-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.account-attributes-form input,
.phone-policy-form input,
.phone-policy-form select {
  min-width: 0;
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
}

.account-attributes-form input[type="checkbox"],
.phone-policy-form input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.account-attributes-form input:not([type="checkbox"]),
.account-attributes-form button,
.phone-policy-form .phone-preset-field,
.phone-policy-form input[name="description"] {
  grid-column: 1 / -1;
}

.account-attributes-form button,
.phone-policy-form button {
  justify-self: start;
  white-space: nowrap;
}

.data-table.phone-policy-table {
  min-width: 0;
}

.account-attributes-form .account-field {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  white-space: normal;
}

.account-attributes-form .account-field-hint {
  grid-column: 1 / -1;
  white-space: normal;
}

.account-attributes-form input:disabled {
  background: var(--bg);
  color: var(--muted);
}

.user-test-key {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.5;
}

#refreshUsersBtn {
  flex-shrink: 0;
}

.data-table.users-table {
  min-width: 1800px;
  table-layout: fixed;
}

.users-table .users-col-user { width: 280px; }
.users-table .users-col-collected { width: 80px; }
.users-table .users-col-demo { width: 96px; }
.users-table .users-col-phone { width: 184px; }
.users-table .users-col-key { width: 180px; }
.users-table .users-col-identities { width: 180px; }
.users-table .users-col-sources { width: 200px; }
.users-table .users-col-posts { width: 184px; }
.users-table .users-col-activity { width: 124px; }
.users-table .users-col-status { width: 118px; }
.users-table .users-col-time { width: 174px; }

.users-table th {
  white-space: nowrap;
}

.users-table th:first-child,
.users-table td:first-child {
  position: sticky;
  left: 0;
  box-shadow: inset -1px 0 var(--line);
}

.users-table th:first-child { z-index: 3; }
.users-table td:first-child { z-index: 2; background: #fff; }
.users-table tbody tr:hover td:first-child { background: #fafcff; }

.users-table .user-single-line {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-table .user-identifier {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.users-table .user-identity-key {
  flex-basis: 100%;
}

.users-table .user-source + .user-source {
  margin-top: 10px;
}

.users-table .user-post-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.users-table .user-post-stats span {
  white-space: nowrap;
}

.users-table .user-post-stats strong {
  color: var(--text);
  font-weight: 500;
}

.users-table td:nth-child(4) .cell-primary,
.users-table td:nth-child(9),
.users-table td:nth-child(11) .cell-primary,
.users-table td:nth-child(11) .cell-secondary {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.users-table-scroll {
  max-height: min(640px, max(240px, calc(100vh - 430px)));
  scrollbar-gutter: stable;
}

.users-table-scroll:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.filter-bar.users-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
}

.users-filter-bar .filter-item {
  flex: 0 1 140px;
  min-width: 0;
}

.users-filter-bar .filter-item.wide {
  flex: 1 1 260px;
}

.error-text {
  color: #b91c1c;
}

.page {
  height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
  overflow: hidden;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #eef1f5;
  padding: 16px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  margin: 0 16px 20px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.nav-label {
  margin: 0 16px 8px;
  font-size: 12px;
  color: var(--muted);
}

.nav-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 9px 16px 9px 18px;
  margin-bottom: 0;
  cursor: pointer;
  color: var(--text);
}

.nav-item.active {
  border-left-color: var(--primary);
  background: #e8edf5;
  color: #1748b5;
}

.nav-item + .nav-item {
  margin-top: 2px;
}

.nav-item:hover {
  background: #e9edf3;
}

.nav-group {
  margin: 2px 0;
}

.nav-group-title {
  display: block;
  padding: 10px 16px 6px 18px;
  font-weight: 700;
  color: #506070;
  cursor: pointer;
  user-select: none;
}

.nav-group-title::marker {
  color: #7b8794;
}

.nav-group-title.active {
  color: #1748b5;
}

.nav-subitem {
  padding-left: 34px;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100vh;
}

.topbar {
  height: 56px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.topbar-title {
  font-size: 18px;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user {
  font-size: 13px;
  color: var(--muted);
}

.environment-badge {
  flex: none;
  padding: 4px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #f2f4f7;
  font-size: 12px;
  white-space: nowrap;
}

.environment-test { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.environment-prod { color: #b42318; background: #fef3f2; border-color: #fecdca; }

.system-message-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  resize: vertical;
  line-height: 1.6;
}

.audience-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 0;
  margin: 0;
  border: 0;
}

.audience-picker legend { margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.audience-picker label { display: flex; align-items: center; gap: 8px; }
.audience-picker input[type="radio"] { width: 16px; height: 16px; margin: 0; }
.message-preview { display: grid; gap: 16px; }
.message-preview h2 { font-size: 18px; margin: 0; }
.message-preview .btn { justify-self: start; }
.message-preview-meta { font-size: 13px; color: var(--muted); }
.data-table input[type="checkbox"] { width: 16px; height: 16px; padding: 0; }
.modal-panel:focus { outline: none; }
.btn:focus-visible, summary:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }

.content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px;
}

.section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

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

.section-title {
  font-size: 16px;
  font-weight: 600;
}

.random-nicknames fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.nickname-pools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.nickname-pool-body { padding: 16px; }
.nickname-pool-body textarea { width: 100%; resize: vertical; line-height: 1.8; }
.nickname-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.nickname-preview { margin-top: 24px; }
.nickname-samples { display: flex; gap: 10px; flex-wrap: wrap; }
.nickname-samples span { padding: 8px 12px; background: #f3f6fa; border-radius: 10px; }
@media (max-width: 1050px) { .nickname-pools { grid-template-columns: 1fr; } }

.registration-invites {
  display: grid;
  gap: 16px;
}

.registration-invites .panel {
  min-width: 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.registration-invites .toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 14px 0;
}

.registration-invites label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.registration-invites input:not([type="checkbox"]),
.registration-invites select,
.registration-invites textarea {
  min-width: 100px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
}

.registration-invites input[type="number"] { width: 110px; }
.registration-invites textarea { width: 100%; resize: vertical; }
.registration-invites #invite-settings-form { align-items: center; }
.registration-invites #invite-settings-form label { display: flex; align-items: center; }

.section-desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.section-subtitle {
  padding: 16px 16px 0;
  font-size: 14px;
  font-weight: 600;
}

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

.platform-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-soft);
}

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

.platform-title {
  font-size: 15px;
  font-weight: 600;
}

.updated-at {
  font-size: 12px;
  color: var(--muted);
}

.platform-body {
  padding: 14px;
}

.field-inline {
  margin-bottom: 14px;
}

.field-inline:last-child {
  margin-bottom: 0;
}

.field-inline label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.field-inline input,
.field-inline select,
.field-inline textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
}

.field-inline input,
.field-inline select {
  height: 36px;
  padding: 0 10px;
}

.field-inline textarea {
  min-height: 260px;
  resize: vertical;
  padding: 10px;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.legal-doc-list {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.legal-doc-card {
  background: #fff;
}

.readonly-text {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.form-strip {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(180px, 280px) auto;
  align-items: end;
  gap: 12px;
}

.inline-form .field-inline {
  margin-bottom: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  height: 36px;
}

.platform-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 14px 14px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  font-size: 13px;
  color: var(--text);
}

.checkbox-row input {
  width: 16px;
  height: 16px;
}

.home-frame-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr)) auto;
  align-items: end;
  gap: 12px;
}

.home-frame-create-form .field-inline {
  margin-bottom: 0;
}

.home-frame-list {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.home-frame-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
}

.home-frame-preview {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  background: linear-gradient(135deg, #eef3ff, #fce7f3);
}

.home-frame-preview img,
.home-frame-preview-fallback {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  display: block;
}

.home-frame-preview-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

.home-frame-preview-copy {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  color: #111827;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 700;
  text-shadow: 0 1px 12px rgba(255,255,255,0.72);
}

.home-frame-fields {
  padding: 14px;
}

.home-frame-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

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

.home-frame-form-grid .field-inline {
  margin-bottom: 0;
}

.home-frame-upload-field {
  grid-column: 1 / -1;
}

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

.upload-row input[type="file"] {
  height: auto;
  padding: 7px 10px;
}

.upload-status {
  min-height: 18px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.home-frame-actions {
  gap: 8px;
  padding: 14px 0 0;
}

.play-scene-card {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
}

.play-scene-preview {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  min-height: 132px;
  padding: 18px;
  background: #f8fafc;
  background-position: center;
  background-size: cover;
  border-right: 1px solid var(--line);
}

.play-scene-preview-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: #111827;
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  word-break: break-word;
}

.play-scene-preview-copy {
  min-width: 0;
}

.play-scene-preview-title {
  color: #111827;
  font-size: 15px;
  font-weight: 700;
}

.play-scene-preview-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.play-scene-preview-cta {
  display: inline-flex;
  width: fit-content;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.play-scene-preview-chevron {
  color: #94a3b8;
  font-size: 24px;
}

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

.play-scene-form-grid .field-inline {
  margin-bottom: 0;
}

.play-scene-form-grid .field-inline.wide {
  grid-column: span 2;
}

.hint {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  color: var(--muted);
}

.message {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 13px;
}

.message.error {
  background: #fff3f3;
  border-color: #efc0c0;
  color: var(--danger);
}

.message.success {
  background: #eefbf3;
  border-color: #b8e3c4;
  color: #216b3b;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fcfcfd;
}

.filter-item label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.filter-item.wide {
  grid-column: span 3;
}

.filter-item input,
.filter-item select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0 10px;
  background: #fff;
}

.filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.prompt-scene-picker {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fcfcfd;
}

.prompt-scene-picker-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.prompt-scene-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.prompt-scene-choice {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.prompt-scene-choice:hover {
  border-color: #9db8f7;
  background: #f8fbff;
}

.prompt-scene-choice.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.prompt-scene-choice input {
  margin-top: 2px;
  accent-color: #2563eb;
}

.prompt-scene-choice-main,
.prompt-scene-choice-meta {
  min-width: 0;
}

.prompt-scene-choice-title {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.prompt-scene-choice-key,
.prompt-scene-choice-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-scene-choice-meta {
  grid-column: 2;
}

.prompt-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 16px;
  padding: 16px;
}

.prompt-layout-rerank {
  align-items: start;
}

.prompt-version-list {
  display: grid;
  gap: 14px;
}

.prompt-strategy-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: #fff;
}

.prompt-strategy-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.prompt-strategy-card textarea {
  min-height: 300px;
}

.prompt-side {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.prompt-create-form {
  margin-top: 16px;
}

.prompt-create-form textarea {
  min-height: 180px;
}

.experiment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.experiment-column {
  display: grid;
  align-content: start;
  gap: 16px;
}

.experiment-form {
  padding: 14px;
}

.experiment-form .field-inline textarea {
  min-height: 150px;
}

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

.experiment-form-grid .field-inline {
  margin-bottom: 14px;
}

.experiment-form-actions {
  padding: 0;
  gap: 8px;
}

.experiment-mini-table .data-table {
  min-width: 720px;
}

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

.experiment-topup {
  display: flex;
  align-items: center;
  gap: 8px;
}

.experiment-topup input {
  width: 84px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0 10px;
}

.experiment-sample-list {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.experiment-sample-card {
  background: #fff;
}

.experiment-sample-body {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.experiment-json,
.experiment-output {
  max-height: 220px;
  overflow: auto;
  margin: 6px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f8fafc;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.experiment-attempt-table {
  min-width: 1120px;
}

.compact-hint {
  margin: 12px 0 0;
}

.table-shell {
  padding: 0 16px 16px;
}

.table-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}

.table-summary-text {
  font-size: 13px;
  color: var(--muted);
}

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

.data-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}

.data-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  position: sticky;
  top: 0;
  background: #f7f8fa;
  z-index: 1;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.data-table tbody tr:hover {
  background: #fafcff;
}

.admin-menu-editor {
  width: 300px;
}

.admin-menu-editor summary {
  cursor: pointer;
  white-space: nowrap;
}

.admin-menu-editor form {
  padding: 12px 0 4px;
}

.admin-menu-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-bottom: 12px;
}

.admin-menu-options label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
  cursor: pointer;
}

.admin-menu-editor input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 1px 0 0;
  flex: none;
}

.data-table input,
.data-table select {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
}

.nami-personality-label-fields {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.llm-model-table {
  min-width: 1060px;
}

.llm-call-log-table {
  min-width: 1480px;
  table-layout: fixed;
}

.llm-call-log-col-time {
  width: 10%;
}

.llm-call-log-col-scene {
  width: 14%;
}

.llm-call-log-col-service {
  width: 7%;
}

.llm-call-log-col-model {
  width: 16%;
}

.llm-call-log-col-relation {
  width: 24%;
}

.llm-call-log-col-tokens {
  width: 9%;
}

.llm-call-log-col-cost {
  width: 8%;
}

.llm-call-log-col-status {
  width: 7%;
}

.llm-call-log-col-error {
  width: 5%;
}

.llm-call-log-error-cell .cell-primary,
.llm-call-log-error-cell .cell-secondary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.nami-insight-message-cell {
  min-width: 260px;
  max-width: 420px;
}

.remote-post-image {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  background: #eceff3;
}

.content-report-list {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.content-report-card {
  box-shadow: none;
}

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

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

.report-post-preview {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.report-post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.report-post-body {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.report-chat-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.report-chat-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.report-action-row {
  display: grid;
  grid-template-columns: 160px minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.report-note-field input {
  width: 100%;
}

.connection-table {
  min-width: 1380px;
}

.connection-table col.connection-col-meta {
  width: 170px;
}

.connection-table col.connection-col-side {
  width: 360px;
}

.connection-table col.connection-col-lighting {
  width: 210px;
}

.connection-table col.connection-col-count {
  width: 72px;
}

.connection-table col.connection-col-status {
  width: 110px;
}

.connection-table col.connection-col-action {
  width: 92px;
}

.connection-side-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.connection-side-image-btn {
  flex: 0 0 auto;
}

.connection-side-image {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background: #eceff3;
}

.connection-side-content {
  min-width: 0;
}

.connection-post-body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
}

.match-simulator-filter {
  grid-template-columns: minmax(280px, 2fr) minmax(220px, 1fr) auto;
}

.match-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.match-stage-section {
  margin-top: 16px;
}

.match-source-card {
  margin-top: 16px;
  background: #fff;
}

.match-source-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.match-source-text {
  margin-top: 10px;
}

.match-source-joint {
  max-height: 132px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

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

.match-summary-item {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.server-request-metrics {
  margin-top: 14px;
}

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

.server-request-daily-table {
  min-width: 620px;
}

.server-request-retention-table {
  min-width: 420px;
}

.new-user-retention-table {
  min-width: 840px;
}

.new-user-retention-wrap {
  max-height: 560px;
  overflow: auto;
}

@media (max-width: 1200px) {
  .server-request-retention-grid {
    grid-template-columns: 1fr;
  }
}

.match-route-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.match-route-detail {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

.match-route-detail summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  background: #f8fafc;
}

.match-route-detail .data-table-wrap {
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
}

.match-simulator-table {
  min-width: 1280px;
}

.match-post-body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.image-preview-btn {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.table-empty {
  color: var(--muted);
}

.cell-primary {
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.cell-warning {
  color: #9a6700;
}

.cell-secondary {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.public-id-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.public-id-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-id-copy {
  flex-shrink: 0;
  height: 24px;
  padding: 0 6px;
}

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

.stack-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  line-height: 1.5;
}

.stack-line:last-child {
  margin-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid #c6d4f6;
  border-radius: 999px;
  background: #f4f7ff;
  color: #1748b5;
  font-size: 12px;
  cursor: pointer;
}

.harness-rule-grid,
.harness-readonly-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--panel-soft);
  margin-bottom: 20px;
}

.harness-rule-grid > div,
.harness-readonly-grid > div {
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.harness-rule-grid > div:last-child,
.harness-readonly-grid > div:last-child {
  border-right: 0;
}

.harness-rule-grid strong,
.harness-readonly-grid strong,
.harness-readonly-grid span {
  display: block;
}

.harness-rule-grid span,
.harness-readonly-grid span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

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

.harness-readonly-grid strong {
  margin-top: 5px;
  font-size: 14px;
}

.harness-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f5f6f8;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.harness-state.is-on {
  border-color: #9fd6b4;
  background: #edf9f1;
  color: #166534;
}

.harness-state.is-off {
  border-color: #d5d9df;
  background: #f6f7f8;
  color: #667085;
}

.muted-code {
  margin-top: 4px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.harness-scene-table {
  min-width: 1420px;
}

.harness-scene-cell {
  min-width: 210px;
}

.harness-number-input {
  width: 76px;
}

.harness-ttl-input {
  width: 118px;
}

.harness-effective-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 9px;
}

.harness-capability-cell {
  min-width: 330px;
}

.harness-model-line {
  display: grid;
  grid-template-columns: 70px minmax(140px, 1fr) auto;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.harness-model-line code {
  overflow-wrap: anywhere;
}

.harness-ready {
  margin-top: 6px;
  color: #166534;
  font-size: 12px;
}

.harness-issues {
  margin-top: 6px;
  color: #b42318;
  font-size: 12px;
  line-height: 1.5;
}

.compact-checkbox {
  white-space: nowrap;
}

.harness-run-list {
  border: 1px solid var(--line);
}

.harness-run + .harness-run {
  border-top: 1px solid var(--line);
}

.harness-run > summary {
  display: grid;
  grid-template-columns: 150px minmax(150px, 1fr) auto auto auto minmax(230px, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 14px;
  background: #fff;
  cursor: pointer;
  list-style-position: inside;
  font-size: 12px;
}

.harness-run[open] > summary {
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.harness-run-time,
.harness-run-scene {
  font-weight: 600;
}

.harness-run > summary code {
  overflow-wrap: anywhere;
}

.harness-run-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.harness-step-table {
  min-width: 980px;
}

.compact-empty {
  margin: 0;
  border: 0;
}

@media (max-width: 1100px) {
  .harness-rule-grid,
  .harness-readonly-grid {
    grid-template-columns: 1fr 1fr;
  }

  .harness-rule-grid > div,
  .harness-readonly-grid > div {
    border-bottom: 1px solid var(--line);
  }

  .harness-run > summary {
    grid-template-columns: 140px minmax(140px, 1fr) auto;
  }
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
}

.pagination-info {
  font-size: 12px;
  color: var(--muted);
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal-panel {
  width: min(920px, 100%);
  max-height: min(86vh, 960px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

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

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-content {
  max-height: calc(86vh - 64px);
  overflow: auto;
  padding: 16px;
}

.modal-loading,
.modal-empty {
  color: var(--muted);
  font-size: 13px;
}

.image-modal-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image {
  max-width: 100%;
  max-height: calc(86vh - 120px);
  border-radius: 8px;
  display: block;
}

.modal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
}

.modal-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-item-title {
  font-size: 14px;
  font-weight: 600;
}

.modal-item-meta {
  font-size: 12px;
  color: var(--muted);
}

.modal-item-body {
  margin-top: 8px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-item-subtle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-thumb {
  margin-top: 8px;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  background: #eceff3;
}

.modal-thumb-button {
  display: inline-flex;
  margin-top: 8px;
}

.modal-item-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.overlay-backdrop {
  z-index: 70;
  background: rgba(15, 23, 42, 0.56);
}

.overlay-panel {
  width: min(840px, 100%);
}

@media (max-width: 980px) {
  .page {
    height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .sidebar {
    position: static;
    top: auto;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main {
    height: auto;
    min-height: 0;
  }

  .content {
    overflow: visible;
  }

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

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

  .prompt-layout {
    grid-template-columns: 1fr;
  }

  .experiment-layout,
  .experiment-form-grid,
  .two-column-grid,
  .match-summary-grid {
    grid-template-columns: 1fr;
  }

  .experiment-toolbar,
  .experiment-topup {
    flex-direction: column;
    align-items: stretch;
  }

  .prompt-side {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 16px;
  }

  .prompt-strategy-header {
    flex-direction: column;
  }

  .prompt-strategy-grid {
    grid-template-columns: 1fr;
  }

  .table-summary,
  .pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-backdrop {
    padding: 12px;
  }
}

.ms-workspace { overflow: hidden; }
.ms-page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 22px 24px 20px; }
.ms-page-header h1 { margin: 0 0 7px; font-size: 22px; line-height: 1.3; font-weight: 650; }
.ms-caption { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.ms-defaults { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 0 24px; }
.ms-default-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 15px 16px; background: #fafbfc; }
.ms-default-card > div { min-width: 0; }
.ms-default-card .btn { flex: none; font-size: 12px; height: 32px; padding: 0 10px; }
.ms-eyebrow { color: var(--muted); font-size: 11px; font-weight: 600; margin-bottom: 7px; }
.ms-default-value { font-size: 13px; font-weight: 600; line-height: 1.55; overflow-wrap: anywhere; margin-bottom: 5px; }
.ms-routing-note { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 9px; padding: 12px 24px 18px; font-size: 12px; color: var(--muted); }
.ms-text-button { background: none; border: 0; padding: 2px 0; color: var(--primary); cursor: pointer; font-size: 12px; }
.ms-text-button:focus-visible, .ms-type-tab:focus-visible, .ms-service-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.ms-browser-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 13px 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.ms-type-tabs { display: flex; align-items: center; gap: 4px; }
.ms-type-tab { display: flex; align-items: center; gap: 7px; height: 34px; border: 0; border-radius: 4px; padding: 0 11px; color: var(--muted); background: transparent; font-size: 12px; cursor: pointer; }
.ms-type-tab > span { font-variant-numeric: tabular-nums; color: #8a93a1; font-size: 11px; }
.ms-type-tab:hover { background: #f6f7f9; }
.ms-type-tab.ms-is-active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.ms-type-tab.ms-is-active > span { color: var(--primary); }
.ms-filters { display: flex; align-items: center; gap: 8px; }
.ms-filters input, .ms-filters select { height: 34px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 12px; padding: 0 10px; color: var(--text); }
.ms-search input { width: 215px; }
.ms-filters select { width: 106px; }
.ms-master-detail { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 440px; }
.ms-service-list { padding: 0 0 12px; background: #fafbfc; border-right: 1px solid var(--line); max-height: 680px; overflow-y: auto; }
.ms-list-heading { display: flex; align-items: center; justify-content: space-between; padding: 17px 17px 13px; color: var(--muted); font-size: 11px; }
.ms-list-heading span { font-variant-numeric: tabular-nums; }
.ms-service-item { display: block; width: calc(100% - 16px); text-align: left; margin: 0 8px 4px; padding: 12px 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--text); cursor: pointer; }
.ms-service-item:hover { background: #f0f3f7; }
.ms-service-item.ms-is-active { background: #fff; border-color: #c9d9f8; box-shadow: inset 3px 0 0 var(--primary); }
.ms-service-item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ms-service-item-top strong { font-size: 13px; line-height: 1.45; font-weight: 600; overflow-wrap: anywhere; }
.ms-service-dot { height: 6px; width: 6px; border-radius: 50%; background: #45a47a; flex: none; }
.ms-service-dot.ms-is-off { background: #aab1bc; }
.ms-service-key { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.ms-service-meta { display: block; font-size: 11px; line-height: 1.6; color: #8b929c; margin-top: 6px; }
.ms-list-empty { padding: 20px 16px; font-size: 12px; color: var(--muted); }
.ms-detail { padding: 23px 24px 26px; min-width: 0; background: #fff; }
.ms-detail-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.ms-heading-line { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 7px; }
.ms-heading-line h2, .ms-editor-heading h2 { margin: 0; font-size: 19px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.ms-status { display: inline-flex; align-items: center; gap: 5px; border-radius: 4px; padding: 3px 7px; white-space: nowrap; font-size: 11px; line-height: 1.3; }
.ms-status-on { color: #28734f; background: #edf7f0; }
.ms-status-off { color: #707987; background: #f0f2f5; }
.ms-actions { display: flex; align-items: center; gap: 7px; flex: none; }
.ms-actions .btn { font-size: 12px; padding: 0 10px; height: 32px; }
.ms-connection-summary { display: grid; grid-template-columns: minmax(0, 1fr) 100px; gap: 20px; padding: 16px 0 18px; margin: 14px 0 0; border-bottom: 1px solid #e9ecf1; }
.ms-connection-summary dt { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.ms-connection-summary dd { font-size: 12px; line-height: 1.6; margin: 0; }
.ms-endpoint { color: #596475; overflow-wrap: anywhere; }
.ms-key-ready { color: #28734f; }
.ms-key-missing { color: #9b6421; }
.ms-inline-note { border-radius: 4px; padding: 10px 12px; background: #f6f8fb; color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 14px; }
.ms-model-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 22px 0 10px; }
.ms-model-heading h3 { font-size: 13px; margin: 0; font-weight: 600; }
.ms-model-heading h3 span { color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 3px; }
.ms-table-scroll { width: 100%; overflow-x: auto; }
.ms-model-table { width: 100%; min-width: 520px; border-collapse: collapse; text-align: left; }
.ms-table-caption { text-align: left; caption-side: bottom; padding: 12px 0 0; font-size: 11px; color: var(--muted); }
.ms-model-table th { padding: 10px 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fafbfc; font-size: 11px; font-weight: 500; color: var(--muted); }
.ms-model-table td { padding: 15px 8px; border-bottom: 1px solid #edf0f4; vertical-align: middle; font-size: 12px; }
.ms-model-table th:first-child, .ms-model-table td:first-child { padding-left: 10px; width: 32%; }
.ms-model-table th:last-child, .ms-model-table td:last-child { text-align: right; width: 70px; }
.ms-model-name { font-weight: 550; color: var(--text); line-height: 1.5; overflow-wrap: anywhere; }
.ms-model-meta { display: flex; flex-wrap: wrap; gap: 4px 7px; color: var(--muted); font-size: 10px; margin-top: 5px; }
.ms-model-meta:empty { display: none; }
.ms-default-tag { color: var(--primary); }
.ms-price { display: flex; gap: 10px; font-size: 11px; line-height: 1.85; white-space: nowrap; }
.ms-price > span { color: #8a93a1; }
.ms-price > b { font-weight: 450; font-variant-numeric: tabular-nums; }
.ms-small-button { padding: 0 9px; height: 29px; min-width: 44px; font-size: 11px; white-space: nowrap; }
.ms-empty { display: flex; min-height: 260px; flex-direction: column; align-items: center; justify-content: center; padding: 45px 24px; text-align: center; }
.ms-empty strong { font-size: 15px; font-weight: 550; }
.ms-empty p { max-width: 360px; font-size: 12px; color: var(--muted); line-height: 1.7; margin: 10px 0 16px; }
.ms-empty-inset { min-height: 220px; border: 1px dashed var(--line); border-radius: 5px; margin-top: 5px; }
.ms-editor { max-width: 720px; }
.ms-editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.ms-editor-heading .ms-caption { margin-top: 6px; }
.ms-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ms-field { min-width: 0; }
.ms-field-wide { grid-column: 1 / -1; }
.ms-field[hidden] { display: none; }
.ms-field > label { display: block; font-size: 12px; color: #475569; margin-bottom: 7px; }
.ms-field input:not([type="checkbox"]), .ms-field select { width: 100%; height: 37px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; padding: 0 10px; font-size: 12px; color: var(--text); }
.ms-field input[readonly] { background: #f7f8fa; color: var(--muted); }
.ms-field input:focus, .ms-field select:focus, .ms-filters input:focus, .ms-filters select:focus { outline: 2px solid #c6d8fd; outline-offset: 1px; border-color: #95b7f7; }
.ms-field-hint { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 6px 0 0; }
.ms-field .ms-checkbox, .ms-checkbox { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text); line-height: 1.5; margin: 0; }
.ms-checkbox + .ms-checkbox { margin-top: 10px; }
.ms-checkbox input { width: 15px; height: 15px; margin: 0; }
.ms-form-section-title { margin: 26px 0 17px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.ms-form-subtitle { color: #475569; font-size: 12px; font-weight: 550; margin-bottom: -4px; }
.ms-form-subtitle span { color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 8px; }
.ms-advanced { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.ms-advanced summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.ms-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.ms-form-error { margin-bottom: 18px; padding: 11px 12px; border: 1px solid #f1cbcb; border-radius: 4px; background: #fff7f7; color: #a03636; font-size: 12px; line-height: 1.6; }
.ms-form-error[hidden] { display: none; }
.ms-workspace button:disabled { opacity: .55; cursor: default; }
.ms-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 1180px) {
  .ms-defaults { gap: 10px; }
  .ms-default-card { align-items: flex-start; flex-direction: column; gap: 8px; }
  .ms-browser-toolbar { align-items: flex-start; }
  .ms-master-detail { grid-template-columns: 210px minmax(0, 1fr); }
  .ms-detail { padding-left: 18px; padding-right: 18px; }
  .ms-detail-heading { flex-direction: column; gap: 13px; }
}
@media (max-width: 760px) {
  .ms-page-header { padding: 18px 16px; }
  .ms-page-header h1 { font-size: 20px; }
  .ms-defaults { grid-template-columns: 1fr; padding: 0 16px; }
  .ms-default-card { flex-direction: row; align-items: center; }
  .ms-routing-note { padding: 12px 16px 16px; }
  .ms-browser-toolbar { padding: 12px 16px; }
  .ms-type-tabs { flex-wrap: wrap; }
  .ms-filters { width: 100%; }
  .ms-search { flex: 1; }
  .ms-search input { width: 100%; }
  .ms-master-detail { grid-template-columns: 1fr; }
  .ms-service-list { display: flex; overflow-x: auto; gap: 5px; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); max-height: none; }
  .ms-list-heading { display: none; }
  .ms-service-item { flex: 0 0 180px; margin: 0; }
  .ms-detail { padding: 20px 16px; }
  .ms-form-grid { grid-template-columns: 1fr; }
  .ms-connection-summary { grid-template-columns: minmax(0, 1fr) 80px; gap: 12px; }
}
