:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef2f7;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.6;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  border-radius: 8px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(140deg, rgba(19, 99, 119, 0.14), transparent 38%),
    linear-gradient(320deg, rgba(53, 95, 169, 0.12), transparent 42%),
    #eef2f7;
}

.login-panel {
  width: min(430px, 100%);
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  background: #fff;
  padding: 28px;
  box-shadow: 0 16px 48px rgba(23, 32, 51, 0.12);
}

.contract-actions,
.login-brand,
.brand,
.admin-chip,
.button,
.nav-item,
.alert,
.placeholder {
  display: flex;
  align-items: center;
}

.contract-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.login-brand {
  gap: 14px;
  margin-bottom: 24px;
}

.contract-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #eef2f7;
}

.contract-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #d9e1ec;
  background: #fff;
  padding: 12px 18px;
}

.contract-frame {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 64px);
  border: 0;
  background: #fff;
}

.login-brand p {
  max-width: 330px;
  margin-top: 4px;
  color: #65738a;
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

.field {
  display: grid;
  gap: 6px;
  color: #4c5b70;
  font-size: 13px;
}

.input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cdd7e5;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  padding: 8px 10px;
  outline: none;
}

select.input {
  height: 38px;
  min-height: 38px;
  appearance: none;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #65738a 50%),
    linear-gradient(135deg, #65738a 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 16px,
    calc(100% - 10px) 16px;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
  line-height: 20px;
}

.input:focus {
  border-color: #13737f;
  box-shadow: 0 0 0 3px rgba(19, 115, 127, 0.12);
}

.button {
  min-height: 38px;
  justify-content: center;
  gap: 8px;
  border: 1px solid #cdd7e5;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  padding: 8px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.button.primary {
  border-color: #13737f;
  background: #13737f;
  color: #fff;
}

.contract-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 14px;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #f8fafc;
  color: #4c5b70;
  text-decoration: none;
  font-size: 13px;
}

.alert {
  min-height: 36px;
  border: 1px solid #f1b3a4;
  border-radius: 6px;
  background: #fff2ee;
  color: #9b341f;
  padding: 8px 10px;
  margin-bottom: 12px;
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #d9e1ec;
  background: #f8fafc;
  padding: 18px 12px;
}

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

.brand {
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 0 8px;
  color: #172033;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.brand span {
  white-space: nowrap;
}

nav {
  display: grid;
  gap: 4px;
  margin-top: 18px;
}

.sidebar-footer {
  display: flex;
  margin-top: auto;
  padding: 18px 8px 0;
}

.nav-item {
  min-height: 38px;
  width: 100%;
  justify-content: flex-start;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4c5b70;
  padding: 8px 10px;
  text-decoration: none;
}

.nav-item.active,
.nav-item:hover {
  background: #e7f1f3;
  color: #0f5962;
}

.workspace {
  min-width: 0;
  background: #eef2f7;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #d9e1ec;
  background: #fff;
  padding: 14px 20px;
}

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

.admin-chip {
  gap: 8px;
  color: #4c5b70;
  font-size: 13px;
  white-space: nowrap;
}

.icon-button {
  min-height: 32px;
  border: 1px solid #cdd7e5;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  padding: 5px 10px;
}

.logout-button {
  justify-content: center;
  width: 100%;
}

.surface {
  margin: 20px;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  background: #fff;
}

.placeholder {
  min-height: 220px;
  justify-content: center;
  color: #65738a;
}

.membership-panel {
  min-width: 0;
  padding: 20px;
}

.membership-panel .surface {
  margin: 0;
}

.membership-filters {
  padding: 16px;
}

.membership-filter-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px 16px;
  align-items: end;
}

.membership-filter-actions,
.membership-bulk-actions,
.membership-query-actions,
.membership-pagination,
.membership-page-actions,
.member-identity,
.member-tags {
  display: flex;
  align-items: center;
}

.membership-filter-actions {
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.membership-bulk-actions,
.membership-query-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.membership-result-count {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 40px;
  white-space: nowrap;
}

.membership-list-view {
  margin-top: 16px !important;
  overflow: hidden;
}

.membership-table-wrap {
  width: 100%;
  overflow: auto;
}

.membership-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  color: #172033;
  font-size: 13px;
}

.membership-table th,
.membership-table td {
  border-bottom: 1px solid #e5eaf3;
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.membership-table th {
  background: #f8fafc;
  color: #4c5b70;
  font-weight: 700;
}

.membership-table tbody tr:hover {
  background: #f8fbfd;
}

.membership-user-table .membership-action-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 76px;
  text-align: center;
  background: #fff;
  box-shadow: -10px 0 14px -14px rgba(23, 32, 51, 0.55);
}

.membership-user-table th.membership-action-cell {
  z-index: 3;
  background: #f8fafc;
}

.membership-user-table tbody tr:hover .membership-action-cell {
  background: #f8fbfd;
}

.membership-empty {
  color: #65738a;
  text-align: center !important;
}

.mono-cell {
  color: #4c5b70;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.member-id-cell {
  width: 118px;
  max-width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-identity {
  width: 145px;
  gap: 10px;
  font-weight: 700;
}

.member-name {
  min-width: 0;
  max-width: 8em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 999px;
  object-fit: cover;
  background: #e7f1f3;
}

.member-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f5962;
  font-weight: 700;
}

.member-tags {
  flex-wrap: wrap;
  gap: 6px;
  min-width: 160px;
}

.tag-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.tag-pill {
  background: #edf4ff;
  color: #285c9f;
}

.button.danger {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b42318;
}

.button.danger:not(:disabled):hover {
  border-color: #fca5a5;
  background: #ffe4e6;
}

.status-pill.is-normal {
  background: #e9f8ef;
  color: #1e7a44;
}

.status-pill.is-disabled {
  background: #fff0ee;
  color: #9b341f;
}

.muted,
.two-line-cell small {
  color: #65738a;
}

.two-line-cell {
  display: grid;
  gap: 3px;
}

.link-button {
  border: 0;
  background: transparent;
  color: #2563eb;
  padding: 0;
  font-weight: 700;
}

.membership-pagination {
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  color: #4c5b70;
}

.membership-page-actions {
  gap: 8px;
}

.membership-detail-view {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(288px, 304px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.membership-profile-panel {
  align-self: start;
  padding: 14px;
}

.back-button {
  width: fit-content;
  margin-bottom: 14px;
}

.member-profile-card {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.member-profile-card .member-avatar {
  width: 68px;
  height: 68px;
  font-size: 24px;
}

.member-profile-card h3,
.membership-detail-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.member-profile-card dl,
.membership-detail-card dl {
  width: 100%;
  display: grid;
  gap: 10px;
  margin: 0;
}

.member-profile-card dl {
  gap: 8px;
}

.member-profile-card dl div,
.membership-detail-card dl div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
}

.member-profile-card dl div {
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
}

.member-profile-card dt,
.membership-detail-card dt {
  color: #65738a;
}

.member-profile-card dt,
.member-profile-card dd {
  font-size: 14px;
  line-height: 1.28;
}

.member-profile-card dd,
.membership-detail-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.profile-tags {
  min-width: 0;
}

.membership-detail-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto;
  align-self: start;
  align-content: start;
  gap: 16px;
}

.membership-tabs {
  min-height: 58px;
  height: 58px;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 14px;
}

.membership-tab {
  flex: 0 0 auto;
  height: 58px;
  min-height: 58px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #4c5b70;
  padding: 0 14px;
  font-weight: 700;
}

.membership-tab.active,
.membership-tab:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.membership-detail-content {
  min-width: 0;
}

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

.membership-detail-card {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
}

.membership-detail-card.wide-card {
  grid-column: span 2;
}

.runtime-config-panel {
  padding: 18px;
}

.runtime-config-form,
.runtime-config-list,
.runtime-config-group {
  display: grid;
  gap: 16px;
}

.runtime-config-group h3 {
  margin: 0;
  font-size: 16px;
}

.runtime-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px 16px;
}

.runtime-config-field {
  align-content: start;
  min-width: 0;
}

.runtime-config-field small {
  color: #65738a;
  font-size: 12px;
  font-weight: 500;
}

.runtime-config-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #e5eaf2;
  padding-top: 16px;
}

.membership-table-wrap.compact .membership-table {
  min-width: 640px;
}

.detail-table th,
.detail-table td {
  white-space: normal;
}

.api-debug-panel {
  min-width: 0;
}

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

.debug-nav,
.debug-main,
.debug-identity {
  min-width: 0;
  margin: 0;
}

.debug-nav {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.debug-nav-header {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid #e5eaf3;
  padding: 12px;
}

.debug-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.debug-tag {
  min-height: 28px;
  border: 1px solid #cdd7e5;
  border-radius: 999px;
  background: #fff;
  color: #4c5b70;
  padding: 4px 9px;
  font-size: 12px;
}

.debug-tag span {
  margin-left: 4px;
  color: #65738a;
  font-weight: 700;
}

.debug-tag.active,
.debug-tag:hover {
  border-color: #13737f;
  background: #e7f1f3;
  color: #0f5962;
}

.debug-operation-list {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding: 8px;
}

.debug-operation {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  padding: 12px;
  text-align: left;
}

.debug-operation.active,
.debug-operation:hover {
  border-color: #bed2d7;
  background: #e7f1f3;
}

.debug-operation-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.debug-operation-text strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debug-operation-text code {
  color: #0f5962;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.method-get {
  background: #eaf6ee;
  color: #24663b;
}

.method-post {
  background: #e8f2ff;
  color: #215a9e;
}

.method-put,
.method-patch {
  background: #fff5df;
  color: #83600d;
}

.method-delete {
  background: #fff0ee;
  color: #9b341f;
}

.debug-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.debug-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 51, 0.48);
}

.debug-modal {
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  margin: 0;
  box-shadow: 0 24px 70px rgba(23, 32, 51, 0.28);
}

.debug-main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e5eaf3;
  padding: 16px;
}

.debug-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.debug-title-block {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.debug-title-block h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.debug-title-block code {
  color: #0f5962;
  overflow-wrap: anywhere;
}

.debug-operation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #65738a;
  font-size: 12px;
}

.debug-identity {
  order: -1;
  display: grid;
  gap: 14px;
  background: #fff;
  padding: 16px;
}

.debug-identity-header,
.debug-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #4c5b70;
  font-size: 13px;
}

.debug-identity-header {
  justify-content: flex-start;
}

.debug-identity-grid {
  display: grid;
  justify-content: start;
  grid-template-columns: minmax(220px, 320px) minmax(150px, 260px) auto auto;
  gap: 12px;
  align-items: end;
}

.debug-token-state {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

button.debug-token-state {
  cursor: pointer;
}

button.debug-token-state:disabled {
  cursor: default;
}

.debug-token-state.is-valid {
  border-color: #86c79b;
  background: #eefaf2;
  color: #166534;
}

.debug-token-state.is-expired,
.debug-token-state.is-missing {
  border-color: #f1a7a2;
  background: #fff1f0;
  color: #b42318;
}

.debug-token-arrow {
  font-size: 10px;
  line-height: 1;
}

.debug-token-restore {
  justify-self: start;
}

.debug-identity-actions {
  display: contents;
}

.debug-identity-actions .button {
  min-width: 128px;
}

.debug-content-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  overflow: auto;
}

.debug-form,
.debug-result {
  min-width: 0;
  padding: 18px;
}

.debug-form {
  border-bottom: 1px solid #e5eaf3;
}

.debug-operation-description {
  display: grid;
  gap: 6px;
  border: 1px solid #cfe4e8;
  border-radius: 8px;
  background: #f2fbfc;
  margin: 0 0 14px;
  padding: 13px 16px;
}

.debug-operation-description h4 {
  margin: 0;
  color: #172033;
  font-size: 13px;
  line-height: 1.35;
}

.debug-operation-description p {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-line;
}

.debug-fieldset {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid #e5eaf3;
  border-radius: 8px;
  margin: 0 0 14px;
  padding: 16px 18px 18px;
}

.debug-fieldset legend {
  color: #172033;
  font-weight: 700;
  padding: 0 4px;
}

.debug-field small {
  color: #65738a;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.debug-textarea {
  min-height: 108px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.debug-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #65738a;
  font-size: 12px;
}

.debug-upload-row input[type="file"] {
  max-width: 100%;
}

.debug-result {
  display: grid;
  align-content: start;
  gap: 12px;
}

.debug-json-card {
  min-width: 0;
  border: 1px solid #e5eaf3;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  overflow: auto;
}

.debug-response-empty,
.debug-empty {
  color: #65738a;
}

.debug-json-tree {
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.debug-json-list {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.debug-json-row {
  display: grid;
  grid-template-columns: minmax(80px, 170px) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  border-left: 1px solid #d9e1ec;
  padding-left: 8px;
}

.debug-json-key {
  min-width: 0;
  color: #0f5962;
  overflow-wrap: anywhere;
}

.debug-json-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.debug-json-scalar {
  color: #172033;
}

.debug-json-null {
  color: #8a95a6;
}

.debug-image-preview {
  display: grid;
  gap: 6px;
  width: min(100%, 420px);
  margin: 4px 0;
}

.debug-image-preview img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #fff;
}

.debug-image-preview figcaption {
  color: #65738a;
  font-family: inherit;
  font-size: 12px;
}

@media (max-width: 760px) {
  .input,
  .debug-textarea,
  .debug-upload-row input[type="file"] {
    font-size: 16px !important;
  }

  .login-shell {
    align-items: start;
    padding: 14px;
  }

  .login-panel {
    margin-top: 18px;
    padding: 20px;
    box-shadow: 0 10px 28px rgba(23, 32, 51, 0.1);
  }

  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    min-height: auto;
    height: auto;
    display: block;
    position: relative;
    border-right: 0;
    border-bottom: 1px solid #d9e1ec;
    padding: 14px 14px 12px;
  }

  .sidebar-header {
    gap: 10px;
    padding-right: 74px;
  }

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

  .sidebar-footer {
    position: absolute;
    top: 14px;
    right: 14px;
    margin: 0;
    padding: 0;
  }

  .logout-button {
    width: auto;
    min-width: 58px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    padding: 14px;
  }

  .surface {
    margin: 14px;
  }

  .placeholder {
    min-height: 160px;
  }

  .membership-panel {
    padding: 14px;
  }

  .membership-filter-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .membership-filter-actions,
  .membership-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .membership-bulk-actions,
  .membership-query-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .membership-filter-actions .button {
    width: 100%;
  }

  .membership-detail-view {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .membership-detail-card.wide-card {
    grid-column: auto;
  }

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

  .runtime-config-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .membership-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .membership-tab {
    flex: 0 0 auto;
  }

  .member-profile-card dl div,
  .membership-detail-card dl div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

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

  .debug-nav {
    height: auto;
    margin-bottom: 14px;
  }

  .debug-operation-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .debug-main {
    display: block;
  }

  .debug-modal-backdrop {
    align-items: start;
    justify-items: stretch;
    overflow: hidden;
    padding: 8px;
  }

  .debug-modal {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
    margin: 0;
    max-height: none;
    overflow: hidden;
  }

  .debug-main-header,
  .debug-identity-header,
  .debug-result-header {
    align-items: stretch;
    flex-direction: column;
  }

  .debug-header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .debug-header-actions .button,
  .debug-header-actions .icon-button {
    width: 100%;
  }

  .debug-identity-grid {
    display: block;
  }

  .debug-content-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .debug-identity-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .debug-identity-actions .button {
    min-width: 0;
  }

  .debug-identity-grid .field,
  .debug-identity-actions {
    margin-top: 10px;
  }

  .debug-form {
    border-bottom: 1px solid #e5eaf3;
  }

  .debug-form,
  .debug-result {
    padding: 12px;
  }

  .debug-fieldset {
    padding: 12px;
  }

  .debug-json-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  .debug-json-key {
    font-weight: 700;
  }

  .contract-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .contract-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .contract-frame {
    min-height: calc(100vh - 124px);
  }
}

@media (max-width: 420px) {
  .contract-actions {
    grid-template-columns: 1fr;
  }

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