:root {
  color-scheme: light;
  --ink: #152027;
  --muted: #64717a;
  --line: #dfe7ea;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-solid: #ffffff;
  --control: #ffffff;
  --surface-soft: #f5f8fa;
  --primary-text: #ffffff;
  --success-bg: #e8f8f4;
  --success-text: #087968;
  --warning-bg: #fff4df;
  --warning-text: #98600d;
  --danger-bg: #fff0f2;
  --danger-text: #a7313d;
  --method-bg: #edf3ff;
  --sidebar-bg: rgba(250, 253, 253, 0.82);
  --detail-row: rgba(255, 255, 255, 0.72);
  --blue: #2f66f6;
  --teal: #13a892;
  --amber: #c37a17;
  --rose: #d74d5b;
  --mist: #eef6f8;
  --shadow: 0 24px 70px rgba(21, 32, 39, 0.12);
  --body-bg:
    radial-gradient(circle at 18% 8%, rgba(47, 102, 246, 0.16), transparent 28rem),
    radial-gradient(circle at 85% 18%, rgba(19, 168, 146, 0.18), transparent 26rem),
    linear-gradient(135deg, #f7fbfd 0%, #edf4f7 48%, #f8faf7 100%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8f0f4;
  --muted: #94a7b2;
  --line: #2b3c45;
  --panel: rgba(18, 29, 35, 0.88);
  --panel-solid: #16242b;
  --control: #1b2b33;
  --surface-soft: #101b21;
  --primary-text: #0d171c;
  --success-bg: #123b35;
  --success-text: #73e1cf;
  --warning-bg: #3b2b14;
  --warning-text: #efc273;
  --danger-bg: #442129;
  --danger-text: #ff9eaa;
  --method-bg: #1d3157;
  --sidebar-bg: rgba(12, 21, 26, 0.9);
  --detail-row: rgba(28, 43, 51, 0.86);
  --blue: #7ea1ff;
  --teal: #50d6c0;
  --amber: #efb85e;
  --rose: #ff8190;
  --mist: #14232a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --body-bg:
    radial-gradient(circle at 18% 8%, rgba(75, 113, 220, 0.2), transparent 28rem),
    radial-gradient(circle at 85% 18%, rgba(32, 168, 146, 0.15), transparent 26rem),
    linear-gradient(135deg, #0c151a 0%, #101c22 48%, #0d171c 100%);
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--body-bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.sidebar-resizer:focus-visible {
  outline: 3px solid rgba(47, 102, 246, 0.24);
  outline-offset: 2px;
}

input[readonly] {
  background: #f2f6f8;
  color: var(--muted);
}

.app-shell {
  --sidebar-width: 280px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.app-shell.sidebar-resizing {
  transition: none;
  user-select: none;
  cursor: col-resize;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 28px 20px;
  border-right: 1px solid rgba(21, 32, 39, 0.08);
  background: var(--sidebar-bg);
  backdrop-filter: blur(18px);
  transition: padding 180ms ease;
}

.sidebar-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  z-index: 4;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.sidebar-resizer:hover,
.app-shell.sidebar-resizing .sidebar-resizer {
  background: rgba(47, 102, 246, 0.18);
}

.sidebar-collapsed .sidebar-resizer {
  display: none;
}

.sidebar-toggle {
  position: absolute;
  top: 18px;
  right: -13px;
  z-index: 5;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(21, 32, 39, 0.1);
  border-radius: 999px;
  background: var(--control);
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #fff;
  box-shadow: 0 14px 34px rgba(47, 102, 246, 0.24);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand > div strong,
.brand > div span {
  display: block;
}

.brand > div span {
  color: var(--muted);
  font-size: 0.82rem;
}

.brand .brand-mark {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.95rem;
}

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

.nav-item,
.secondary-button,
.primary-button,
.danger-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.nav-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--control);
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.active .nav-icon {
  border-color: rgba(47, 102, 246, 0.18);
  background: linear-gradient(135deg, rgba(47, 102, 246, 0.12), rgba(19, 168, 146, 0.12));
  color: var(--blue);
}

.sidebar-collapsed .sidebar {
  padding-inline: 14px;
}

.sidebar-collapsed .brand {
  justify-content: center;
}

.sidebar-collapsed .nav-item:not(.active) {
  overflow: hidden;
}

.sidebar-collapsed .nav-item {
  grid-template-columns: 30px;
  gap: 0;
  white-space: nowrap;
}

.sidebar-collapsed .nav-item {
  font-size: 0;
}

.sidebar-collapsed .brand > div {
  display: none;
}

.sidebar-collapsed .nav-item {
  justify-content: center;
  padding-inline: 0;
}

.sidebar-collapsed .nav-icon {
  margin: 0;
}

.sidebar-collapsed .connection-card {
  padding: 9px 6px;
}

.sidebar-collapsed .connection-card strong {
  display: none;
}

.sidebar-collapsed .connection-state {
  justify-content: center;
  margin: 0;
}

.nav-item:hover {
  background: var(--control);
  color: var(--ink);
}

.nav-item.active,
.nav-item[aria-current="page"] {
  position: relative;
  background: linear-gradient(135deg, rgba(47, 102, 246, 0.14), rgba(19, 168, 146, 0.1));
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(47, 102, 246, 0.18), 0 10px 28px rgba(21, 32, 39, 0.08);
}

.connection-card {
  margin-top: auto;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.connection-card strong {
  display: block;
  font-size: 0.82rem;
}

.connection-state {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.connection-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--rose);
}

.connection-dot::after {
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  background: currentColor;
  color: var(--rose);
  opacity: 0.2;
  content: "";
  animation: ping 1.7s ease-out infinite;
}

.connection-state.connected .connection-dot {
  background: var(--teal);
}

.connection-state.connected .connection-dot::after {
  color: var(--teal);
}

.main-content {
  min-width: 0;
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--teal);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 6px;
  font-size: clamp(1.15rem, 1.55vw, 1.6rem);
  line-height: 1.08;
}

h2 {
  font-size: 1.08rem;
}

h3 {
  margin: 4px 0 0;
  font-size: 1rem;
}

.topbar-actions,
.panel-toolbar,
.pagination-bar,
.detail-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions,
.pagination-bar,
.modal-actions {
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  padding: 0 16px;
  font-weight: 700;
}

.compact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  font-size: 0.82rem;
}

.compact-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.compact-button span {
  white-space: nowrap;
}

.primary-button {
  background: var(--ink);
  color: var(--primary-text);
  box-shadow: 0 12px 26px rgba(21, 32, 39, 0.18);
}

.secondary-button {
  background: var(--control);
  color: var(--ink);
  border: 1px solid var(--line);
}

.danger-button {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  background: var(--control);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.2rem;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: block;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(21, 32, 39, 0.12);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.table-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.metric-card {
  padding: 13px;
  animation: riseIn 520ms ease both;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.35rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.hidden {
  display: none !important;
}

.resource-view {
  display: grid;
  gap: 18px;
}

.table-panel {
  min-width: 0;
  overflow: hidden;
}

.panel-toolbar {
  flex-wrap: wrap;
  padding: 16px;
  border-bottom: 1px solid rgba(21, 32, 39, 0.08);
}

.search-field {
  display: flex;
  flex: 1 1 280px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
}

.search-field input,
.panel-toolbar select {
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-field input {
  width: 100%;
}

.panel-toolbar select,
.toolbar-input,
dialog input,
dialog select,
dialog textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--ink);
}

.panel-toolbar select {
  height: 42px;
  padding: 0 12px;
}

.field-picker {
  position: relative;
}

.field-picker summary {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.field-picker summary::-webkit-details-marker {
  display: none;
}

.field-picker div {
  position: absolute;
  z-index: 8;
  right: 0;
  display: grid;
  gap: 6px;
  width: min(280px, calc(100vw - 40px));
  min-width: 220px;
  max-height: min(320px, 60vh);
  overflow: auto;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

.field-option {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.field-picker-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  font-weight: 500;
}

.toolbar-input {
  height: 42px;
  min-width: min(320px, 100%);
  padding: 0 12px;
}

.bulk-upload-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.file-drop {
  min-height: 78px;
  justify-content: center;
  padding: 14px;
  border: 1px dashed rgba(47, 102, 246, 0.34);
  border-radius: 8px;
  background: var(--control);
}

.file-drop input {
  padding: 0;
  border: 0;
  border-radius: 0;
}

.bulk-actions {
  display: flex;
  gap: 10px;
}

.bulk-summary {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.bulk-hints {
  margin: 4px 0 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
}

.bulk-hints summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
}

.bulk-hints-body {
  margin-top: 12px;
  overflow-x: auto;
  font-size: 0.82rem;
  color: var(--muted);
}

.bulk-hints-body p {
  margin: 0 0 10px;
  line-height: 1.5;
}

.bulk-hints-body code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(21, 32, 39, 0.06);
  font-size: 0.92em;
  color: var(--ink);
}

.bulk-hints-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.bulk-hints-table th,
.bulk-hints-table td {
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.bulk-hints-table th {
  color: var(--ink);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bulk-hints-example {
  margin-top: 10px !important;
}

.bulk-preview-wrap {
  max-height: min(46vh, 520px);
  border: 1px solid rgba(21, 32, 39, 0.07);
  border-radius: 8px;
}

.bulk-row-success {
  background: rgba(19, 168, 146, 0.08);
}

.bulk-row-error {
  background: rgba(215, 77, 91, 0.08);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  table-layout: fixed;
  user-select: text;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(21, 32, 39, 0.07);
  text-align: left;
  font-size: 0.86rem;
}

th {
  position: relative;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  min-width: 44px;
}

.th-inner {
  display: flex;
  align-items: center;
  min-height: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  z-index: 3;
  width: 7px;
  height: 100%;
  cursor: col-resize;
}

.column-resizer::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 3px;
  width: 1px;
  background: rgba(47, 102, 246, 0.22);
  content: "";
}

.column-resizer:hover::before,
body.resizing-columns .column-resizer::before {
  width: 2px;
  background: var(--blue);
}

tbody tr {
  transition: background 180ms ease, transform 180ms ease;
}

tbody tr:hover,
tbody tr.selected {
  background: rgba(47, 102, 246, 0.07);
}

td,
td *:not(button) {
  user-select: text;
}

.select-row-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.avatar {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(47, 102, 246, 0.95), rgba(19, 168, 146, 0.95));
  color: #fff;
  font-weight: 800;
}

.user-cell strong,
.user-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-cell span {
  color: var(--muted);
  font-size: 0.8rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill.inactive {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.pagination-bar {
  justify-content: flex-end;
  padding: 14px 16px;
}

.pagination-bar select {
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--ink);
}

.pagination-bar span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.page-size-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.detail-panel {
  padding: 14px;
  animation: slideIn 560ms ease both;
}

.detail-hero {
  display: flex;
  gap: 14px;
  align-items: center;
}

.avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  font-size: 0.9rem;
}

.detail-hero p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
  word-break: break-word;
}

.detail-actions {
  margin: 18px 0;
  flex-wrap: wrap;
}

.detail-field-picker {
  flex: 0 0 auto;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-list div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--detail-row);
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
  font-weight: 600;
}

pre {
  max-height: 180px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 0.8rem;
}

dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.wide-dialog {
  width: min(1040px, calc(100vw - 32px));
}

dialog::backdrop {
  background: rgba(21, 32, 39, 0.45);
  backdrop-filter: blur(6px);
}

.modal-card {
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: var(--panel-solid);
  box-shadow: 0 28px 90px rgba(21, 32, 39, 0.22);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

dialog input,
dialog select,
dialog textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  color: var(--ink);
  font-weight: 500;
  outline: 0;
}

dialog textarea {
  resize: vertical;
}

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

[data-user-only].hidden {
  display: none;
}

.form-message {
  min-height: 22px;
  color: var(--rose);
  font-weight: 700;
}

.form-message.success {
  color: #087968;
}

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

.log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.api-log-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 12px;
  min-height: 0;
  max-height: min(62vh, 680px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.api-reference-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.api-reference-list {
  display: grid;
  gap: 12px;
}

.api-reference-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
}

.api-reference-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.api-reference-title {
  min-width: 0;
}

.api-reference-title strong,
.api-reference-title span {
  display: block;
}

.api-reference-title span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.api-reference-card pre {
  max-height: 280px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.api-log-entry {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  overflow: hidden;
}

.api-log-summary {
  display: grid;
  gap: 9px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: var(--control);
  color: var(--ink);
  text-align: left;
}

.api-log-request-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.api-log-info-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-left: 72px;
}

.method-pill {
  display: inline-grid;
  min-width: 62px;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--method-bg);
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
}

.api-log-url {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
  line-height: 1.45;
}

.api-log-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.api-log-duration {
  min-width: 0;
  text-align: left;
}

.api-log-separator,
.api-log-chevron {
  color: var(--muted);
}

.api-log-chevron {
  margin-left: auto;
  font-size: 1.1rem;
  transition: transform 180ms ease;
}

.api-log-entry.open .api-log-chevron {
  transform: rotate(180deg);
}

.api-log-details {
  display: none;
  padding: 0 12px 12px;
  border-top: 1px solid rgba(21, 32, 39, 0.07);
}

.api-log-entry.open .api-log-details {
  display: grid;
  gap: 10px;
}

.api-log-details pre {
  max-height: 240px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.empty-log {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100vw - 44px));
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 22px 54px rgba(21, 32, 39, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.loading-row,
.empty-row {
  color: var(--muted);
  text-align: center;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes ping {
  from {
    opacity: 0.32;
    transform: scale(0.8);
  }
  to {
    opacity: 0;
    transform: scale(2.4);
  }
}

@media (max-width: 1280px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    width: 100%;
  }
}

@media (max-width: 1040px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .sidebar-collapsed .sidebar {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    height: auto;
    padding: 14px 22px;
  }

  .sidebar-resizer,
  .sidebar-toggle {
    display: none;
  }

  .sidebar-collapsed .brand {
    justify-content: flex-start;
  }

  .sidebar-collapsed .brand > div,
  .sidebar-collapsed .connection-card strong {
    display: block;
  }

  .sidebar-collapsed .nav-item {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 14px;
    font-size: inherit;
  }

  .sidebar-collapsed .connection-card {
    padding: 9px 11px;
  }

  .sidebar-collapsed .connection-state {
    justify-content: flex-start;
    margin: 0;
  }

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

  .nav-item {
    grid-template-columns: 30px auto;
    justify-content: center;
  }

  .connection-card {
    margin-top: 0;
  }

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

@media (max-width: 680px) {
  .main-content {
    padding: 18px;
  }

  .sidebar,
  .sidebar-collapsed .sidebar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px 18px;
  }

  .nav-list {
    grid-column: 1 / -1;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    min-width: 96px;
  }

  .connection-card {
    padding: 8px 10px;
  }


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

  .topbar-actions,
  .panel-toolbar,
  .pagination-bar {
    width: 100%;
  }

  .topbar-actions .primary-button,
  .panel-toolbar .secondary-button,
  .panel-toolbar .danger-button,
  .panel-toolbar select {
    flex: 1 1 auto;
  }

  .search-field {
    flex-basis: 100%;
  }

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

  .detail-actions > button {
    flex: 1 1 calc(50% - 10px);
  }

  .panel-toolbar .field-picker,
  .detail-field-picker {
    flex: 1 1 100%;
    width: 100%;
  }

  .panel-toolbar .field-picker summary,
  .detail-field-picker summary {
    justify-content: center;
  }

  .panel-toolbar .field-picker div,
  .detail-field-picker div {
    right: auto;
    left: 0;
    width: 100%;
  }

  .bulk-upload-panel {
    grid-template-columns: 1fr;
  }

  .bulk-actions,
  .modal-actions {
    width: 100%;
  }

  .bulk-actions button,
  .modal-actions button {
    flex: 1;
  }

  .modal-card {
    padding: 18px;
  }

  .api-log-request-line {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .api-log-request-line .status-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .api-log-info-line {
    flex-wrap: wrap;
    padding-left: 0;
  }

  .api-log-duration {
    margin-left: 0;
    text-align: left;
  }

  h1 {
    font-size: 1.25rem;
  }
}

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