:root {
  color-scheme: light;
  --bg: #f7f9fd;
  --panel: #ffffff;
  --panel-soft: #fbfcff;
  --panel-accent: #f8fbff;
  --text: #223550;
  --muted: #607086;
  --muted-2: #6f7f96;
  --border: #d5deea;
  --border-soft: #e4ebf4;
  --primary: #111827;
  --primary-hover: #000000;
  --primary-soft: #f1f5f9;
  --success: #067647;
  --success-bg: #e7f8ef;
  --warning: #946200;
  --warning-bg: #fff5d9;
  --danger: #b42318;
  --danger-bg: #fff0ee;
  --neutral-bg: #eef3f8;
  --shadow-control: 0 10px 20px rgba(29, 45, 72, 0.12);
  --shadow-panel: 0 8px 16px rgba(29, 45, 72, 0.05);
  --radius: 8px;
  --radius-input: 12px;
  --home-sidebar-apple-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.app-body {
  overflow: hidden;
}

.auth-body {
  min-height: 100vh;
}

.app-frame {
  display: flex;
  min-height: 100vh;
  width: 100vw;
}

.app-sidenav {
  flex: 0 0 276px;
  width: 276px;
  height: 100vh;
  overflow-y: auto;
  background: #ffffff;
  border-right: 1px solid #e2e9f3;
  font-family: var(--home-sidebar-apple-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sidenav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 94px;
  padding: 28px 22px 18px;
}

.brand-mark {
  flex: 0 0 30px;
  width: 30px;
  height: 27px;
}

.sidenav-logo strong,
.sidenav-logo span {
  display: block;
}

.sidenav-logo strong {
  color: #2d405c;
  font-size: 21px;
  font-weight: 460;
  letter-spacing: 0;
  line-height: 1.12;
}

.sidenav-logo span {
  margin-top: 3px;
  color: #8a94a3;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.menu-search {
  position: relative;
  display: flex;
  align-items: center;
  height: 48px;
  margin: 0 16px 26px;
  border: 1px solid #dce5f0;
  border-radius: 15px;
  background: #ffffff;
  transition: border-color .2s, box-shadow .2s;
}

.menu-search:focus-within {
  border-color: #b9c9e1;
  box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.08);
}

.menu-search-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-left: 15px;
  color: #111827;
}

.menu-search-icon,
.nav-icon svg,
.menu-caret svg,
.ui-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0 13px 0 11px;
  color: #2f415d;
  background: transparent;
  font-family: var(--home-sidebar-apple-font);
  font-size: 15px;
  font-weight: 380;
  letter-spacing: 0;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
}

.menu-search input::placeholder {
  color: #6d7686;
  font-weight: 340;
  opacity: .92;
}

.sidemenu {
  display: grid;
  gap: 22px;
  padding: 0 16px 28px;
}

.sidemenu-section {
  display: grid;
  gap: 8px;
}

.sidemenu-section-separated {
  border-top: 1px solid #dbe3ee;
  padding-top: 18px;
}

.sidemenu-title {
  margin: 0;
  padding: 0 0 8px;
  color: #6d7686;
  font-size: 14px;
  font-weight: 320;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sidemenu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border-radius: 17px;
  padding: 7px 10px;
  color: #2f415d;
  text-decoration: none;
  transition: background .2s, color .2s;
}

.sidemenu-link:hover {
  background: #f7f9fd;
  text-decoration: none;
}

.sidemenu-link-active {
  color: #2b3e59;
  background: #f3f7fc;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid #e1e5eb;
  border-radius: 10px;
  color: #9aa0a9;
  background: #ffffff;
  box-shadow: none;
}

.nav-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.55;
}

.sidemenu-link-active .nav-icon {
  border-color: #dfe4eb;
  color: #8f959f;
  background: #ffffff;
}

.menu-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: inherit;
  font-size: 16px;
  font-weight: 380;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 19px;
  border-radius: 999px;
  padding: 0 8px;
  color: #9aa4b2;
  background: transparent;
  font-size: 10px;
  font-weight: 520;
}

.sidemenu-link-active .menu-count {
  color: #7d8796;
  background: #ffffff;
}

.menu-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: #718096;
}

.menu-caret svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 rgba(29, 45, 72, 0.03);
}

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

.eyebrow {
  margin: 0 0 3px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  font-weight: 780;
}

h2 {
  margin-bottom: 6px;
  font-size: 20px;
  font-weight: 780;
}

h3 {
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 780;
}

h4 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.shell {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 18px 22px 36px;
  overflow: auto;
}

.auth-shell {
  width: min(520px, calc(100vw - 32px));
  margin: 34px auto;
  padding: 0;
  overflow: visible;
}

.auth-panel,
.panel {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-panel);
}

.auth-panel {
  width: min(430px, 100%);
  margin: 64px auto;
  padding: 24px;
}

.password-panel {
  width: min(560px, 100%);
}

.panel {
  padding: 20px;
}

.panel + .panel,
.overview-grid + .panel {
  margin-top: 16px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.tabs {
  display: block;
  min-width: 0;
}

.tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tab-list {
  display: none;
}

.tab-list label {
  display: grid;
  gap: 2px;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 11px;
  color: var(--muted);
  cursor: pointer;
}

.tab-list label:hover {
  border-color: var(--border-soft);
  background: var(--panel-accent);
  color: var(--text);
}

.tab-list label span {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.tab-list label strong {
  color: inherit;
  font-size: 14px;
  font-weight: 800;
}

.tab-list label em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}

.tab-panel {
  display: none;
  min-width: 0;
}

#tab-instancias:checked ~ .tab-list label[for="tab-instancias"],
#tab-releases:checked ~ .tab-list label[for="tab-releases"],
#tab-local-bases:checked ~ .tab-list label[for="tab-local-bases"],
#tab-mcp:checked ~ .tab-list label[for="tab-mcp"],
#tab-mcp-faq:checked ~ .tab-list label[for="tab-mcp-faq"],
#tab-auditoria:checked ~ .tab-list label[for="tab-auditoria"],
#tab-usuarios:checked ~ .tab-list label[for="tab-usuarios"] {
  border-color: #cfd7e3;
  color: var(--primary);
  background: var(--primary-soft);
}

#tab-instancias:checked ~ .tab-panel-instancias,
#tab-releases:checked ~ .tab-panel-main-canonical,
#tab-releases:checked ~ .tab-panel-releases,
#tab-instancias:checked ~ .tab-panel-aws,
#tab-local-bases:checked ~ .tab-panel-local-bases,
#tab-mcp:checked ~ .tab-panel-mcp,
#tab-mcp-faq:checked ~ .tab-panel-mcp-faq,
#tab-auditoria:checked ~ .tab-panel-auditoria,
#tab-usuarios:checked ~ .tab-panel-usuarios {
  display: block;
}

.tab-panel-aws [data-aws-panel] {
  display: none;
}

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

.overview-grid article,
.profile-grid article,
.region-grid article,
.status-grid article,
.metric-grid article,
.onboarding-box,
.form-section {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.overview-grid article {
  padding: 13px 14px;
}

.overview-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overview-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  line-height: 1;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.compact-title {
  margin-bottom: 14px;
}

.form-grid,
.grant-form,
.region-form,
.knowledge-form,
.entity-form {
  display: grid;
  gap: 14px;
}

.grant-form,
.region-form,
.knowledge-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

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

.form-section {
  padding: 16px;
}

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

.filter-bar {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.filter-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 36px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #344054;
  font-size: 12px;
  font-weight: 750;
}

.label-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 8px 10px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  font-size: 13px;
}

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

textarea {
  min-height: 86px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(17, 24, 39, 0.12);
  border-color: var(--primary);
}

.instance-search-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 14px;
}

.instance-search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: min(560px, 100%);
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: #ffffff;
  transition: border-color .18s, box-shadow .18s;
}

.instance-search-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.instance-search-field .ui-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-left: 14px;
  color: #667085;
}

.instance-search-field input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 42px;
  border: 0;
  padding: 8px 44px 8px 10px;
  background: transparent;
  outline: 0;
}

.instance-search-field input:focus {
  border-color: transparent;
  outline: 0;
}

.instance-search-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
}

.instance-search-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.instance-list-table {
  min-width: 980px;
}

.instance-list-table th,
.instance-list-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.instance-list-table .instance-name,
.instance-list-text {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.instance-list-table .badge {
  white-space: nowrap;
}

.instance-actions-cell {
  width: 1%;
}

.instance-list-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.instance-list-actions form {
  display: inline-flex;
}

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

.wide {
  grid-column: span 2;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.check input {
  width: 18px;
  min-height: 18px;
  height: 18px;
}

button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  padding: 8px 14px;
  color: #ffffff;
  background: var(--primary);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s, opacity .18s;
}

button:hover,
.link-button:hover {
  background: var(--primary-hover);
}

button:disabled,
button:disabled:hover {
  color: #8a97aa;
  background: #eef3f8;
  cursor: not-allowed;
  opacity: .72;
}

.link-button.compact {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 10px;
  padding: 0;
}

.icon-button.compact {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 9px;
  padding: 0;
}

.icon-button .ui-icon {
  width: 17px;
  height: 17px;
}

.icon-button.compact .ui-icon {
  width: 16px;
  height: 16px;
}

.icon-button:focus-visible,
.link-button:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(17, 24, 39, 0.14);
  outline-offset: 2px;
}

.ghost-button,
.ghost-link {
  color: var(--text);
  background: #eef3f8;
}

.ghost-button:hover,
.ghost-link:hover {
  color: var(--primary);
  background: #e4ebf4;
}

.danger-button {
  color: #ffffff;
  background: var(--danger);
}

.danger-button:hover,
.danger-link:hover {
  background: #8f1b13;
}

.danger-link {
  color: #ffffff;
  background: var(--danger);
}

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

.icon-button.danger-soft:hover {
  color: #ffffff;
  background: var(--danger);
}

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

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.aws-actions {
  flex-wrap: wrap;
}

.form-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.alert {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  font-size: 13px;
  font-weight: 700;
}

.success {
  color: var(--success);
  background: var(--success-bg);
}

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

.toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2000;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.action-toast {
  position: relative;
  min-height: 68px;
  padding: 13px 42px 13px 15px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(29, 45, 72, 0.16);
  pointer-events: auto;
  animation: toast-in .18s ease-out;
}

.action-toast-success {
  border-left-color: var(--success);
}

.action-toast-error {
  border-left-color: var(--danger);
}

.action-toast-kicker {
  display: block;
  margin-bottom: 4px;
  color: #6b7789;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.action-toast p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 580;
  line-height: 1.42;
}

.action-toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  color: #64748b;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.action-toast-close:hover {
  color: #111827;
  background: #f1f5f9;
}

.action-toast.is-leaving {
  animation: toast-out .22s ease-in forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(.98);
  }
}

.is-async-busy {
  cursor: progress;
}

.icon-button.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.icon-button.is-loading .ui-icon {
  opacity: 0;
}

.icon-button.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(17, 24, 39, 0.22);
  border-top-color: #111827;
  border-radius: 999px;
  animation: button-spin .72s linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

tr.is-row-busy {
  opacity: .72;
}

tr.is-row-updated {
  animation: row-updated 1.5s ease-out;
}

@keyframes row-updated {
  0% {
    background: rgba(17, 24, 39, 0.07);
  }
  100% {
    background: transparent;
  }
}

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: #ffffff;
  vertical-align: middle;
  cursor: help;
}

.help-icon {
  display: block;
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.help-tip:hover {
  color: var(--primary);
  border-color: #cfd7e3;
}

.help-tip:focus {
  outline: 3px solid rgba(17, 24, 39, 0.14);
  outline-offset: 2px;
}

.help-tip.card-tip {
  position: absolute;
  top: 10px;
  right: 10px;
  margin-left: 0;
}

.help-tip::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 50;
  display: none;
  width: min(330px, calc(100vw - 48px));
  transform: translateX(-50%);
  border: 1px solid #1f2937;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: #ffffff;
  background: #111827;
  box-shadow: 0 22px 48px rgba(26, 37, 56, 0.16);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  content: attr(data-tip);
}

.help-tip::before {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  z-index: 51;
  display: none;
  width: 10px;
  height: 10px;
  transform: translateX(-50%) rotate(45deg);
  background: #111827;
  content: "";
}

.help-tip:hover::after,
.help-tip:hover::before,
.help-tip:focus::after,
.help-tip:focus::before {
  display: block;
}

.help-tip.card-tip::after {
  right: 0;
  left: auto;
  transform: none;
}

.help-tip.card-tip::before {
  right: 4px;
  left: auto;
  transform: rotate(45deg);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

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

.profile-grid article,
.region-grid article,
.status-grid article,
.metric-grid article,
.onboarding-box {
  padding: 13px;
}

.profile-grid p {
  min-height: 60px;
  margin-bottom: 10px;
  font-size: 12px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.status-grid article p {
  margin-top: 10px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.metric-grid article {
  position: relative;
  min-height: 72px;
  padding-right: 40px;
}

.metric-grid strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.metric-grid span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.onboarding-box {
  margin-top: 10px;
}

.token-form {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  gap: 12px;
  align-items: end;
}

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

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel-soft);
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 520px;
}

.password-rules {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
}

.password-rules strong {
  color: var(--text);
  font-size: 13px;
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.wizard-steps article {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--panel-soft);
}

.wizard-steps strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.wizard-steps span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.wizard-steps .done {
  border-color: #b7ebce;
  background: var(--success-bg);
}

.wizard-steps .done strong {
  background: var(--success);
}

.installer-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 1.45fr) auto;
  gap: 12px;
  align-items: end;
}

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

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

.install-choice-title {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.install-option {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 88px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 13px 13px 13px 44px;
  background: #ffffff;
  cursor: pointer;
}

.install-option input {
  position: absolute;
  top: 15px;
  left: 14px;
  width: 18px;
  min-height: 18px;
  height: 18px;
}

.install-option:has(input:checked) {
  border-color: #cfd7e3;
  background: var(--primary-soft);
}

.install-option strong {
  font-size: 14px;
}

.install-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.install-history {
  margin-top: 16px;
}

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

.skill-card {
  display: grid;
  gap: 12px;
  min-height: 250px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  background: #ffffff;
}

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

.skill-card h3,
.skill-modal h3 {
  margin: 0;
  color: var(--text);
}

.skill-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.skill-badge {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 7px;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.skill-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.skill-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.skill-card dd {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.skill-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
  gap: 18px;
  align-items: start;
}

.skill-modal .modal-head h2 {
  margin: 2px 0 4px;
}

.skill-modal .modal-head p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.skill-modal-body {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.skill-flow {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  background: #ffffff;
}

.skill-step-list {
  margin: 12px 0 0;
  padding-left: 22px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.skill-side,
.skill-safety,
.prompt-panel {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel-soft);
}

.skill-side ul,
.skill-safety ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.skill-tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.skill-tool-row code {
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 6px 9px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
}

.creation-contract-panel {
  background: #ffffff;
}

.creation-base-url,
.skill-contract {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel-soft);
}

.creation-base-url {
  margin-bottom: 14px;
}

.creation-base-url strong,
.skill-contract h3 {
  display: block;
  margin: 0 0 6px;
  color: var(--text);
}

.creation-base-url p,
.skill-contract p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.creation-base-url code,
.creation-endpoint-card code,
.creation-mode-grid code,
.skill-contract code {
  color: var(--text);
  overflow-wrap: anywhere;
}

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

.creation-endpoint-card {
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px;
  background: #ffffff;
}

.creation-endpoint-card header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.creation-endpoint-card header span,
.skill-contract-endpoints strong span {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: #ffffff;
  background: #111827;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
}

.creation-endpoint-card h3 {
  margin: 0 0 12px;
  color: var(--text);
}

.creation-endpoint-card dl,
.skill-contract-endpoints dl {
  display: grid;
  gap: 9px;
  margin: 0;
}

.creation-endpoint-card dl div,
.skill-contract-endpoints dl div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
}

.creation-endpoint-card dt,
.skill-contract-endpoints dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.creation-endpoint-card dd,
.skill-contract-endpoints dd {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.creation-mode-grid,
.skill-contract-modes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.creation-mode-grid article,
.skill-contract-modes div {
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}

.creation-mode-grid p,
.skill-contract-modes span {
  display: block;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.skill-contract {
  display: grid;
  gap: 14px;
}

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

.skill-contract-endpoints article {
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}

.skill-contract-endpoints strong {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
}

.prompt-panel {
  background: #ffffff;
}

.prompt-panel > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.prompt-panel pre {
  max-width: none;
  max-height: 220px;
  margin: 0;
  overflow: auto;
  border: 1px solid #dbe4ef;
  background: #f8fafc;
  color: var(--text);
  white-space: pre-wrap;
  font: 12px/1.5 "SFMono-Regular", Consolas, monospace;
}

.agent-prompts-panel {
  background: #ffffff;
}

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

.agent-prompt-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel-soft);
}

.agent-prompt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.agent-prompt-head h3 {
  margin: 2px 0 4px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.agent-prompt-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.prompt-eyebrow {
  display: block;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.agent-prompt-card pre {
  max-width: none;
  min-height: 150px;
  max-height: 260px;
  margin: 0;
  overflow: auto;
  border: 1px solid #dbe4ef;
  border-radius: 7px;
  padding: 12px;
  background: #ffffff;
  color: var(--text);
  white-space: pre-wrap;
  font: 12px/1.5 "SFMono-Regular", Consolas, monospace;
}

.mcp-health-grid {
  margin-bottom: 14px;
}

.mcp-health-grid strong {
  overflow-wrap: anywhere;
}

.mcp-counter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.mcp-counter-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 6px 12px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.mcp-counter-strip strong {
  color: var(--text);
  font-size: 14px;
}

.mcp-faq-panel {
  background: #ffffff;
}

.mcp-faq-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.mcp-faq-search {
  display: grid;
  gap: 7px;
  max-width: 760px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mcp-faq-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d7e0ec;
  border-radius: 12px;
  padding: 0 14px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
}

.mcp-faq-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mcp-faq-filters button {
  min-height: 34px;
  border: 1px solid #dbe4ef;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.mcp-faq-filters button.active,
.mcp-faq-filters button:hover {
  border-color: #c7d2e2;
  color: var(--text);
  background: #f3f6fb;
}

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

.mcp-course-index {
  position: sticky;
  top: 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel-soft);
}

.mcp-course-index strong {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 14px;
}

.mcp-course-index ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.mcp-faq-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.mcp-faq-item {
  max-width: none;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
}

.mcp-faq-item summary {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
  list-style: none;
}

.mcp-faq-item summary::-webkit-details-marker {
  display: none;
}

.mcp-faq-item summary::after {
  content: "+";
  margin-left: auto;
  color: var(--muted-2);
  font-size: 18px;
  font-weight: 500;
}

.mcp-faq-item[open] summary {
  border-bottom: 1px solid var(--border-soft);
  background: #f8fafc;
}

.mcp-faq-item[open] summary::after {
  content: "-";
}

.mcp-faq-answer {
  display: grid;
  gap: 12px;
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
}

.mcp-faq-answer p,
.mcp-faq-answer ul,
.mcp-faq-answer ol {
  margin: 0;
}

.mcp-faq-answer ul,
.mcp-faq-answer ol {
  padding-left: 20px;
}

.mcp-faq-answer code {
  color: var(--text);
}

.mcp-term-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.mcp-term-list div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 8px;
}

.mcp-term-list dt {
  color: var(--text);
  font-weight: 750;
}

.mcp-term-list dd {
  margin: 0;
}

.compact-prompt {
  max-width: none;
}

.compact-prompt pre {
  max-width: none;
  min-height: 0;
  max-height: 180px;
}

.mcp-faq-empty {
  margin: 0;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  background: #f8fafc;
}

.agent-recognition-box {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(320px, 1.1fr);
  gap: 16px;
  margin: 0 0 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel-soft);
}

.agent-recognition-box h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
}

.agent-recognition-box p,
.agent-recognition-box ol {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.agent-recognition-box ol {
  padding-left: 20px;
}

.install-prompt-grid {
  margin-bottom: 16px;
}

.installer-ready {
  max-width: 1180px;
}

.temporary-password-panel {
  max-width: 760px;
}

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

.command-panel,
.install-summary {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel-soft);
}

.command-text {
  min-height: 138px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.temporary-password-text {
  min-height: 72px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.install-summary ol {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.flat-box {
  margin: 0;
  background: #ffffff;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 34px 20px;
  overflow: auto;
  background: rgba(15, 23, 42, 0.42);
}

.modal-overlay:target {
  display: flex;
}

.modal-panel {
  width: min(900px, 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}

.modal-panel-wide {
  width: min(1120px, 100%);
}

.modal-panel-narrow {
  width: min(540px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border-soft);
  padding: 18px 20px;
}

.modal-head h2 {
  margin-bottom: 4px;
}

.modal-close {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  min-height: 32px;
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background: #eef3f8;
  font-size: 0;
  font-weight: 800;
  text-decoration: none;
}

.modal-close:hover {
  color: var(--primary);
  background: #e4ebf4;
}

.modal-close::before,
.modal-close::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.modal-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.modal-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.modal-form {
  padding: 20px;
}

.modal-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 20px 20px;
}

.modal-form .modal-actions {
  padding: 4px 0 0;
}

.instance-grants-modal {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 38px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.instance-grants-modal .modal-head {
  flex: 0 0 auto;
}

.instance-grants-body {
  display: grid;
  gap: 18px;
  padding: 20px;
  overflow: auto;
}

.instance-grant-create,
.instance-grant-list {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.instance-grant-create {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.instance-grant-create-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.instance-grant-create-title h4 {
  margin: 0;
  font-size: 15px;
}

.instance-grant-create-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.instance-grant-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(150px, 0.75fr) minmax(140px, 0.65fr) minmax(280px, 1.3fr);
  gap: 12px;
  align-items: end;
}

.instance-grant-grid label {
  min-width: 0;
}

.instance-grant-grid textarea {
  min-height: 74px;
  resize: vertical;
}

.instance-grant-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.instance-grant-confirm {
  max-width: 560px;
  margin: 0;
}

.instance-grant-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.instance-grant-actions .icon-button,
.instance-grant-actions button {
  flex: 0 0 38px;
  width: 38px;
}

.instance-grant-list {
  padding: 18px;
}

.instance-grant-list .section-title {
  margin-bottom: 12px;
}

.instance-grant-list .table-wrap {
  background: var(--panel);
}

.readonly-grid,
.confirm-box {
  display: grid;
  gap: 10px;
  margin: 18px 20px 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel-soft);
}

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

.readonly-grid span,
.confirm-box span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.readonly-grid strong,
.confirm-box strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.hash-text {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

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

.update-apply-modal .modal-head,
.update-package-modal .modal-head {
  min-height: 58px;
  padding: 13px 16px;
}

.update-apply-modal .modal-head h2,
.update-package-modal .modal-head h2 {
  font-size: 17px;
}

.update-apply-modal .modal-head p,
.update-package-modal .modal-head p {
  font-size: 12px;
}

.update-application-form {
  display: block;
  padding: 0;
}

.generic-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  min-height: 440px;
}

.generic-form-main {
  min-width: 0;
  padding: 18px 20px 20px;
}

.generic-form-side {
  min-width: 0;
  border-left: 1px solid var(--border-soft);
  padding: 18px 18px 20px;
  background: #fbfcff;
}

.generic-form-section + .generic-form-section {
  margin-top: 22px;
}

.qepta-gf-section-heading {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  border-bottom: 1px solid #d9dce7;
  padding: 0 2px 8px;
  color: #2c355f;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

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

.update-field-label {
  display: block;
  margin-bottom: 6px;
  color: #344054;
  font-size: 12px;
  font-weight: 750;
}

.target-summary-list {
  display: grid;
  gap: 12px;
}

.target-summary-list div {
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 10px;
}

.target-summary-list span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.target-summary-list strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

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

.tag-list code {
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 5px 9px;
  color: #344054;
  background: #ffffff;
  font-size: 12px;
  line-height: 1.2;
}

.compact-tags {
  gap: 6px;
}

.warning-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.warning-list p {
  border-left: 3px solid #d68a00;
  border-radius: 6px;
  padding: 8px 10px;
  color: #6f4d00;
  background: var(--warning-bg);
  font-size: 12px;
}

.release-select-form {
  border-bottom: 1px solid var(--border-soft);
  padding: 16px 20px;
  background: #fbfcff;
}

.release-select-form .field-grid {
  align-items: end;
}

.form-inline-action {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  min-height: 42px;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.form-divider::before,
.form-divider::after {
  flex: 1 1 auto;
  height: 1px;
  background: var(--border-soft);
  content: "";
}

.side-field {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.embedded-form {
  padding: 0;
}

.embedded-actions {
  padding: 10px 0 0;
}

.manifest-preview {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px;
  background: #f8fafc;
  color: #1f2937;
  font-size: 11px;
  line-height: 1.45;
}

.qepta-upload-modern-host.qepta-upload-modern-ready.access-upload-host {
  --qepta-upload-min-height: 164px;
  --qepta-upload-border: #d7dfef;
  --qepta-upload-border-hover: #111827;
  --qepta-upload-bg: #ffffff;
  --qepta-upload-muted: #63708a;
  --qepta-upload-title: #1c2452;
  --qepta-upload-chip-bg: #eef3f8;
  --qepta-upload-chip-fg: #111827;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: var(--qepta-upload-min-height);
  border: 1px dashed var(--qepta-upload-border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.035) 0%, rgba(255, 255, 255, 0.98) 100%);
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.qepta-upload-modern-host.qepta-upload-modern-ready.access-upload-host:hover,
.qepta-upload-modern-host.qepta-upload-modern-ready.access-upload-host:focus-within,
.qepta-upload-modern-host.qepta-upload-modern-ready.access-upload-host.is-dragging {
  border-color: var(--qepta-upload-border-hover);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.qepta-upload-modern-host.qepta-upload-modern-ready.access-upload-host:focus-within {
  border-color: #b8c3d4;
}

.access-upload-host input[type="file"] {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.access-upload-host input[type="file"]:focus {
  outline: 0;
}

.access-upload-host .qepta-upload-modern {
  position: relative;
  z-index: 1;
  min-height: var(--qepta-upload-min-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 20px;
}

.access-upload-host .qepta-upload-panel {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.access-upload-host .qepta-upload-panel[hidden] {
  display: none !important;
}

.access-upload-host .qepta-upload-icon,
.access-upload-host .qepta-upload-file-icon {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.08) 0%, rgba(17, 24, 39, 0.12) 100%);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.11);
}

.access-upload-host .qepta-upload-icon svg {
  width: 28px;
  height: 28px;
}

.access-upload-host .qepta-upload-copy,
.access-upload-host .qepta-upload-file-meta {
  min-width: 0;
  flex: 1 1 auto;
}

.access-upload-host .qepta-upload-label {
  margin-bottom: 6px;
  color: var(--qepta-upload-chip-fg);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.access-upload-host .qepta-upload-title {
  margin: 0;
  color: var(--qepta-upload-title);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.access-upload-host .qepta-upload-hint,
.access-upload-host .qepta-upload-file-subline {
  margin-top: 5px;
  color: var(--qepta-upload-muted);
  font-size: 12px;
  line-height: 1.45;
}

.access-upload-host .qepta-upload-file-icon {
  color: #111827;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .05em;
}

.access-upload-host .qepta-upload-file-name {
  max-width: 100%;
  overflow: hidden;
  color: #121826;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-upload-host .qepta-upload-file-subline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.access-upload-host .qepta-upload-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--qepta-upload-chip-fg);
  background: var(--qepta-upload-chip-bg);
  font-size: 11px;
  font-weight: 800;
}

.access-upload-host .qepta-upload-actions {
  position: relative;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.access-upload-host .qepta-upload-action {
  pointer-events: auto;
}

.access-upload-host .qepta-upload-action.is-danger {
  color: var(--danger);
  background: var(--danger-bg);
}

.access-upload-host .qepta-upload-action.is-danger:hover {
  color: #ffffff;
  background: var(--danger);
}

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

.update-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  color: var(--text);
  background: #ffffff;
  font-family: var(--home-sidebar-apple-font);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.update-action-button .ui-icon {
  width: 15px;
  height: 15px;
}

.update-action-button:hover {
  border-color: #b8c3d4;
  background: #f8fafc;
  text-decoration: none;
}

.update-action-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.update-action-primary,
.update-action-danger {
  border-color: #111827;
  color: #ffffff;
  background: #111827;
}

.update-action-primary:hover,
.update-action-danger:hover {
  border-color: #000000;
  color: #ffffff;
  background: #000000;
}

.update-action-cancel {
  border-color: #f1b7b2;
  color: var(--danger);
  background: var(--danger-bg);
}

.update-action-cancel:hover {
  border-color: var(--danger);
  color: #ffffff;
  background: var(--danger);
}

.instance-update-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.instance-update-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px;
  background: #ffffff;
}

.instance-update-main {
  min-width: 0;
}

.instance-update-title-row,
.instance-update-meta,
.instance-update-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.instance-update-card h4 {
  margin: 9px 0 4px;
  color: var(--text);
  font-size: 15px;
  font-weight: 780;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.instance-update-card p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.instance-update-meta {
  margin-top: 10px;
  color: #6b778c;
  font-size: 11px;
  font-weight: 650;
}

.instance-update-actions {
  justify-content: flex-end;
  align-self: center;
}

.instance-update-actions form {
  margin: 0;
}

.update-empty-state {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 18px;
  background: #fbfcff;
}

.update-operator-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  border-bottom: 1px solid var(--border-soft);
  padding: 18px 20px;
  background: #fbfcff;
}

.update-operator-copy {
  min-width: 0;
}

.update-operator-copy h3 {
  margin: 6px 0 6px;
  color: var(--text);
  font-size: 22px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.15;
}

.update-operator-copy p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

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

.update-operator-facts div {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px;
  background: #ffffff;
}

.update-operator-facts span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.update-operator-facts strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.operator-card h3,
.update-package-modal .update-detail-grid h3,
.update-package-modal .subsection h3,
.update-package-modal .manifest-details h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 760;
}

.operator-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  list-style: none;
}

.operator-list strong {
  color: var(--text);
}

.update-technical-details {
  color: var(--muted);
}

.update-technical-details summary {
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.update-package-modal .update-technical-details .readonly-grid {
  margin: 14px 0 0;
  border-width: 1px;
  border-radius: 10px;
  padding: 14px;
  background: #fbfcff;
}

.update-package-modal .update-technical-details .technical-grid {
  margin: 14px 0 0;
  padding: 0;
}

.update-package-modal .update-technical-details .technical-items {
  margin: 14px 0 0;
  border-radius: 10px;
}

.update-decision-bar {
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-soft);
  padding-top: 16px;
  background: #ffffff;
}

.update-decision-copy {
  max-width: 520px;
  min-width: 240px;
}

.update-decision-copy strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
}

.update-decision-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.update-decision-actions {
  display: inline-flex;
  align-items: end;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.update-package-modal .readonly-grid {
  margin: 0;
  border-width: 0 0 1px;
  border-radius: 0;
  padding: 14px 20px;
  background: #fbfcff;
}

.update-package-modal .update-warning-grid,
.update-package-modal .update-detail-grid {
  margin: 0;
  padding: 0 20px;
}

.update-package-modal .update-warning-grid {
  padding-top: 16px;
}

.update-package-modal .update-warning-grid article,
.update-package-modal .update-detail-grid article,
.update-package-modal .subsection,
.update-package-modal .manifest-details {
  border-width: 1px 0 0;
  border-radius: 0;
  padding: 16px 0;
  background: #ffffff;
}

.update-package-modal .subsection,
.update-package-modal .manifest-details {
  margin: 0 20px;
}

.update-warning-grid,
.update-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 20px 0;
}

.update-warning-grid article,
.update-detail-grid article,
.subsection,
.manifest-details {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel-soft);
}

.danger-soft-box {
  border-color: #f1b7b2;
  background: var(--danger-bg);
}

.update-warning-grid ul,
.finding-list,
.step-list,
.timeline-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.timeline-list li {
  margin-bottom: 8px;
}

.timeline-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.event-list {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding-left: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.event-list span {
  display: inline;
  margin-right: 6px;
  color: #7b8798;
  font-size: 11px;
}

.apply-confirm-form {
  display: inline-grid;
  grid-template-columns: minmax(120px, 180px) auto;
  gap: 8px;
  align-items: end;
}

.apply-confirm-form label {
  gap: 4px;
}

.update-decision-actions .apply-confirm-form {
  display: inline-flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}

.apply-confirm-label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.execution-page {
  display: grid;
  gap: 16px;
}

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

.execution-head h2 {
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

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

.execution-summary-band {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--border-soft);
}

.execution-summary-band article {
  min-width: 0;
  padding: 13px 14px;
  background: #ffffff;
}

.execution-summary-band span,
.execution-progress-meta,
.execution-phases small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.execution-summary-band strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.execution-progress-panel {
  display: grid;
  gap: 14px;
}

.execution-live-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #c9d6e6;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--primary);
  background: #ffffff;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.execution-live-pill:not(.is-final)::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(6, 118, 71, 0.12);
}

.execution-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}

.execution-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .25s ease;
}

.execution-progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  text-transform: none;
}

.execution-phases {
  display: grid;
  grid-template-columns: repeat(10, minmax(92px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.execution-phases li {
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px;
  background: #ffffff;
}

.phase-dot {
  display: block;
  width: 9px;
  height: 9px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: #b8c3d1;
}

.execution-phases strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
}

.execution-phases small {
  display: block;
  margin-top: 5px;
  text-transform: none;
}

.execution-phases .phase-complete .phase-dot {
  background: var(--success);
}

.execution-phases .phase-current {
  border-color: #b8c3d1;
  background: #f8fafc;
}

.execution-phases .phase-current .phase-dot {
  background: var(--primary);
}

.execution-phases .phase-failed {
  border-color: #f1b7b2;
  background: var(--danger-bg);
}

.execution-phases .phase-failed .phase-dot {
  background: var(--danger);
}

.codex-supervisor-panel {
  display: grid;
  gap: 0;
  overflow: hidden;
  padding: 0;
  border-color: #d9e2ef;
  background: #ffffff;
}

.codex-supervisor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: #ffffff;
}

.codex-supervisor-title {
  display: flex;
  min-width: 0;
  gap: 12px;
  align-items: flex-start;
}

.codex-supervisor-title h2 {
  margin: 0 0 3px;
  font-size: 18px;
  line-height: 1.2;
}

.codex-supervisor-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.codex-supervisor-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid #dce5ef;
  border-radius: 11px;
  color: #ffffff;
  background: #111827;
}

.codex-supervisor-mark .ui-icon {
  width: 18px;
  height: 18px;
}

.codex-supervisor-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.codex-supervisor-meta {
  display: grid;
  grid-template-columns: 1.2fr 1fr 92px 92px;
  gap: 1px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--border-soft);
}

.codex-supervisor-meta span {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 10px 14px;
  background: #fbfcff;
}

.codex-supervisor-meta small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.codex-supervisor-meta strong,
.codex-supervisor-meta code {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.codex-supervisor-meta code,
.hash-text {
  overflow-wrap: anywhere;
}

.codex-supervisor-thread {
  display: grid;
  max-height: 560px;
  overflow: auto;
  gap: 14px;
  margin: 0;
  padding: 20px;
  background: linear-gradient(180deg, #fbfcff 0%, #f6f8fc 100%);
  list-style: none;
}

.codex-supervisor-thread li {
  display: flex;
  max-width: 880px;
  gap: 10px;
  align-items: flex-start;
}

.codex-supervisor-thread time {
  flex: 0 0 auto;
  order: 2;
  padding-top: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.35;
  white-space: nowrap;
}

.codex-supervisor-thread strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 11px;
  font-weight: 860;
  letter-spacing: .08em;
  line-height: 1.1;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.codex-supervisor-thread p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.codex-supervisor-thread li > div {
  min-width: 0;
  max-width: min(760px, 100%);
  border: 1px solid #dce5ef;
  border-radius: 14px;
  padding: 12px 14px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(29, 45, 72, 0.04);
}

.codex-event-assistant,
.codex-event-codex,
.codex-event-tool,
.codex-event-command,
.codex-event-watcher,
.codex-event-approval {
  justify-self: start;
}

.codex-event-assistant::before,
.codex-event-codex::before,
.codex-event-tool::before,
.codex-event-command::before,
.codex-event-watcher::before,
.codex-event-approval::before {
  content: "";
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid #dce5ef;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: inset 0 0 0 6px #f1f5f9;
}

.codex-event-tool::before {
  box-shadow: inset 0 0 0 6px #eef6ff;
}

.codex-event-command::before,
.codex-event-watcher::before {
  box-shadow: inset 0 0 0 6px #eef8f1;
}

.codex-event-approval::before {
  border-color: #f1c2bd;
  box-shadow: inset 0 0 0 6px #fff0ee;
}

.codex-event-user,
.codex-event-operator {
  justify-self: end;
  flex-direction: row-reverse;
  margin-left: auto;
}

.codex-event-user > div,
.codex-event-operator > div {
  border-color: #111827;
  background: #111827;
}

.codex-event-user strong,
.codex-event-user p,
.codex-event-operator strong,
.codex-event-operator p {
  color: #ffffff;
}

.codex-event-system,
.codex-event-supervisor-system,
.codex-event-supervisor-starting,
.codex-event-supervisor-running,
.codex-event-supervisor-succeeded,
.codex-event-supervisor-failed {
  justify-self: center;
  max-width: min(720px, 100%);
  text-align: center;
}

.codex-event-system > div,
.codex-event-supervisor-system > div,
.codex-event-supervisor-starting > div,
.codex-event-supervisor-running > div,
.codex-event-supervisor-succeeded > div,
.codex-event-supervisor-failed > div {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.codex-event-system time,
.codex-event-supervisor-system time,
.codex-event-supervisor-starting time,
.codex-event-supervisor-running time,
.codex-event-supervisor-succeeded time,
.codex-event-supervisor-failed time {
  display: none;
}

.codex-supervisor-thread details {
  margin-top: 8px;
}

.codex-supervisor-thread summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.codex-supervisor-thread pre {
  max-height: 240px;
  overflow: auto;
  margin: 8px 0 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px;
  background: #f8fafc;
  color: #26384f;
  font-size: 12px;
  white-space: pre-wrap;
}

.codex-technical-group {
  display: block !important;
  max-width: min(920px, 100%) !important;
  margin: 0 auto;
}

.codex-technical-group > details {
  border: 1px dashed #cfd9e6;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.68);
}

.codex-technical-group > details > summary {
  color: #667085;
  font-size: 12px;
  font-weight: 820;
}

.codex-technical-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  margin-top: 10px;
}

.codex-technical-list article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px;
  background: #ffffff;
}

.codex-technical-list time {
  display: block;
  padding: 0;
  color: var(--muted);
  font-size: 10px;
}

.codex-technical-list strong {
  margin: 0;
  color: var(--text);
}

.codex-technical-list p {
  color: var(--muted);
}

.codex-technical-list pre {
  max-height: 190px;
}

.codex-supervisor-thread .codex-empty-item {
  display: block;
  border: 1px dashed #cfd9e6;
  padding: 0;
  background: #ffffff;
}

.codex-empty-state {
  display: grid;
  min-height: 168px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.codex-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid #dce5ef;
  border-radius: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 15px;
  font-weight: 900;
}

.codex-empty-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.codex-empty-state strong {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 14px;
}

.codex-empty-state p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
}

.codex-event-system,
.codex-event-supervisor-system {
  background: #ffffff !important;
}

.codex-intervention-board {
  display: grid;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
  background: #ffffff;
}

.codex-intervention-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.codex-intervention-head span {
  color: var(--text);
  font-size: 13px;
  font-weight: 880;
}

.codex-intervention-head small {
  color: var(--muted);
  font-size: 12px;
}

.codex-intervention-list {
  display: grid;
  gap: 10px;
}

.codex-intervention-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 14px;
  border: 1px solid #dce5ef;
  border-left: 4px solid #111827;
  border-radius: 12px;
  padding: 14px;
  background: #fbfcff;
}

.codex-intervention-rejected {
  border-left-color: var(--danger);
}

.codex-intervention-approved {
  border-left-color: var(--success);
}

.codex-intervention-main {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.codex-intervention-main .badge {
  justify-self: start;
}

.codex-intervention-main h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.codex-intervention-main p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
}

.codex-intervention-main dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 2px 0 0;
}

.codex-intervention-main dl div {
  min-width: 0;
}

.codex-intervention-main dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.codex-intervention-main dd {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.codex-intervention-decision {
  display: grid;
  gap: 8px;
  align-content: start;
}

.codex-intervention-decision textarea {
  width: 100%;
  min-height: 68px;
  resize: vertical;
  border: 1px solid #d6e0ec;
  border-radius: 10px;
  padding: 10px 11px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  font-size: 13px;
}

.codex-intervention-decision textarea:focus {
  outline: 0;
  border-color: #aebbcf;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.codex-intervention-decision > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.codex-intervention-decision-readonly {
  display: grid;
  gap: 6px;
  align-content: start;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px 12px;
  background: #ffffff;
}

.codex-intervention-decision-readonly small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.codex-intervention-decision-readonly p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

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

.execution-timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.execution-timeline li {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
  padding: 0 0 10px;
}

.execution-timeline li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.execution-timeline time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.execution-timeline strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.execution-timeline p {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.execution-timeline details {
  margin-top: 8px;
}

.execution-timeline summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.execution-timeline pre {
  max-height: 260px;
  overflow: auto;
  margin: 8px 0 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px;
  background: #f8fafc;
  color: #26384f;
  font-size: 12px;
  white-space: pre-wrap;
}

.execution-side-panel {
  display: grid;
  gap: 16px;
}

.execution-smoke {
  display: grid;
  gap: 8px;
}

.smoke-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--border-soft);
  padding-top: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.apply-confirm-form input {
  min-height: 32px;
  padding: 6px 9px;
}

.kv-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
}

.kv-list div {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 7px;
}

.kv-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.kv-list dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.subsection,
.manifest-details {
  margin: 16px 20px 0;
}

.compact-table-wrap {
  margin-top: 10px;
  max-height: 340px;
}

.manifest-details {
  max-width: none;
}

.manifest-details pre {
  max-width: none;
}

.review-form,
.doc-status-form {
  display: grid;
  gap: 8px;
  min-width: 220px;
  margin-bottom: 8px;
}

.doc-status-form {
  grid-template-columns: 130px minmax(180px, 1fr) auto;
  align-items: center;
}

details {
  max-width: 360px;
}

summary {
  color: var(--primary);
  font-weight: 800;
  cursor: pointer;
}

pre {
  max-width: 520px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.region-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.region-head p {
  margin-bottom: 0;
}

.key-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.split-key-form {
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) auto;
  align-items: end;
}

.key-form textarea {
  min-height: 112px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.danger-zone,
.danger-panel form {
  margin-top: 12px;
}

.danger-panel {
  border-color: #f1b7b2;
}

code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #344054;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.code-nowrap {
  display: inline-block;
  white-space: nowrap;
  overflow-wrap: normal;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 13px;
}

.data-table {
  min-width: 860px;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: top;
}

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

th {
  color: #475467;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 800;
}

td strong {
  display: block;
  font-weight: 800;
}

.muted-line {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
}

.active {
  color: var(--success);
  background: var(--success-bg);
}

.revoked {
  color: var(--danger);
  background: #fee4e2;
}

.expired {
  color: var(--warning);
  background: var(--warning-bg);
}

.neutral {
  color: #344054;
  background: var(--neutral-bg);
}

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

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

.ip-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 150px auto;
  gap: 8px;
  align-items: center;
}

.ip-form input,
.ip-form select {
  min-height: 36px;
  padding: 8px 9px;
}

.agent-profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.agent-profile-form .full {
  grid-column: 1 / 3;
}

.agent-profile-form textarea {
  min-height: 136px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .profile-grid,
  .metric-grid,
  .skill-map-grid,
  .agent-prompt-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .creation-mode-grid,
  .skill-contract-modes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .field-grid,
  .filter-bar,
  .grant-form,
  .region-form,
  .knowledge-form,
  .update-upload-form,
  .update-field-grid,
  .agent-recognition-box,
  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .instance-grant-reason {
    grid-column: 1 / -1;
  }

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

  .mcp-course-index {
    position: static;
  }
}

@media (max-width: 860px) {
  .app-body {
    overflow: auto;
  }

  .app-frame {
    display: block;
  }

  .app-sidenav {
    width: 100%;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid #e2e9f3;
  }

  .sidenav-logo {
    min-height: 72px;
    padding: 16px 18px 8px;
  }

  .sidenav-logo strong {
    font-size: 22px;
  }

  .brand-mark {
    width: 30px;
    height: 27px;
    flex-basis: 30px;
  }

  .menu-search {
    height: 48px;
    margin: 8px 14px 12px;
    border-radius: 14px;
  }

  .sidemenu {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 12px 12px;
  }

  .sidemenu-section {
    display: contents;
  }

  .sidemenu-section-separated {
    border-top: 0;
    padding-top: 0;
  }

  .sidemenu-title {
    display: none;
  }

  .sidemenu-link {
    flex: 0 0 auto;
    min-width: 184px;
    min-height: 52px;
    border-radius: 18px;
    gap: 12px;
    padding: 8px 10px;
  }

  .nav-icon {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }

  .nav-icon svg {
    width: 16px;
    height: 16px;
  }

  .menu-label {
    font-size: 17px;
  }

  .app-main {
    height: auto;
    min-height: calc(100vh - 122px);
  }

  .topbar {
    align-items: flex-start;
    padding: 16px;
  }

  .shell {
    width: 100%;
    padding: 14px 12px 28px;
  }

  .tabs {
    display: block;
  }

  .tab-list {
    display: none;
  }

  .tab-panel {
    min-width: 0;
  }

  .overview-grid,
  .profile-grid,
  .region-grid,
  .status-grid,
  .metric-grid,
  .skill-map-grid,
  .creation-endpoint-grid,
  .creation-mode-grid,
  .skill-contract-endpoints,
  .skill-contract-modes,
  .agent-prompt-grid,
  .agent-recognition-box,
  .skill-modal-grid,
  .install-choice-group,
  .install-choice-group-wide,
  .profile-form,
  .permission-grid,
  .wizard-steps,
  .installer-form,
  .installer-layout,
  .grant-form,
  .region-form,
  .knowledge-form,
  .update-upload-form,
  .generic-form-layout,
  .update-field-grid,
	  .update-warning-grid,
	  .update-detail-grid,
	  .update-operator-brief,
	  .instance-update-card,
	  .field-grid,
	  .filter-bar,
  .token-form,
  .doc-status-form,
  .ip-form,
	  .split-key-form,
  .agent-profile-form {
    grid-template-columns: 1fr;
  }

  .instance-grants-modal {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
  }

  .instance-grants-body {
    padding: 14px;
  }

  .instance-grant-grid,
  .instance-grant-footer,
  .instance-grant-create-title {
    display: grid;
    grid-template-columns: 1fr;
  }

  .instance-grant-actions {
    justify-content: flex-start;
  }

  .instance-search-bar {
    display: grid;
    justify-content: stretch;
		    gap: 8px;
		  }

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

		  .instance-search-count {
		    justify-self: start;
		  }

		  .instance-update-actions,
		  .update-decision-actions {
		    justify-content: flex-start;
	  }

	  .update-decision-bar {
	    display: grid;
	  }

  .execution-summary-band,
  .execution-grid,
  .execution-phases,
  .codex-supervisor-meta {
    grid-template-columns: 1fr;
  }

  .codex-intervention-card,
  .codex-intervention-main dl {
    grid-template-columns: 1fr;
  }

  .execution-timeline li,
  .codex-supervisor-thread li {
    grid-template-columns: 1fr;
  }

  .codex-supervisor-thread {
    padding: 14px;
  }

  .codex-supervisor-thread li {
    max-width: 100%;
  }

  .codex-supervisor-thread time {
    display: none;
  }

  .codex-supervisor-header {
    flex-direction: column;
  }

  .codex-supervisor-actions {
    width: 100%;
    justify-content: space-between;
  }

  .agent-profile-form .full {
    grid-column: auto;
  }

  .generic-form-side {
    border-top: 1px solid var(--border-soft);
    border-left: 0;
  }

  .access-upload-host .qepta-upload-panel {
    align-items: flex-start;
  }

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

  .kv-list div {
    grid-template-columns: 1fr;
  }

  .section-title,
  .page-head {
    display: grid;
  }

  .wide {
    grid-column: 1;
  }

  .panel {
    padding: 16px;
  }
}

@media (max-width: 520px) {
  .topbar {
    display: grid;
  }

  .inline-form,
  .table-actions,
  .form-actions,
  .action-row,
  .apply-confirm-form,
  .modal-actions {
    align-items: stretch;
    display: grid;
  }

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

  .update-operator-facts {
    grid-template-columns: 1fr;
  }

  .modal-overlay {
    padding: 16px 10px;
  }

  .modal-head {
    display: grid;
  }

  .mcp-term-list div {
    grid-template-columns: 1fr;
  }

  .mcp-faq-item summary {
    align-items: flex-start;
  }

  .update-apply-modal .modal-head,
  .update-package-modal .modal-head {
    display: flex;
  }

  .generic-form-main,
  .generic-form-side {
    padding: 16px;
  }

  .access-upload-host .qepta-upload-panel {
    display: grid;
    text-align: left;
  }

  .access-upload-host .qepta-upload-actions {
    justify-content: flex-start;
  }

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

  .execution-head {
    display: grid;
  }
}


/* Mobile action sheet: desktop keeps icon-only actions; phones get one compact trigger per row. */
.mobile-actions-trigger,
.mobile-action-sheet-root {
  display: none;
}

@media (max-width: 620px) {
  .mobile-actions-source {
    display: none !important;
  }

  .mobile-actions-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    color: var(--text);
    background: #f3f6fa;
    font-size: 13px;
    font-weight: 760;
    letter-spacing: 0;
  }

  .mobile-actions-trigger .ui-icon {
    width: 16px;
    height: 16px;
  }

  .mobile-action-sheet-root:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: block;
  }

  .mobile-action-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .42);
  }

  .mobile-action-sheet {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(78vh, 620px);
    overflow: auto;
    border-radius: 22px 22px 0 0;
    border: 1px solid #dbe4ef;
    background: #fff;
    box-shadow: 0 -18px 60px rgba(15, 23, 42, .18);
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  }

  .mobile-action-sheet-handle {
    width: 44px;
    height: 4px;
    margin: 2px auto 12px;
    border-radius: 999px;
    background: #d4dce8;
  }

  .mobile-action-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }

  .mobile-action-sheet-head span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 820;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .mobile-action-sheet-head h2 {
    margin: 2px 0 0;
    color: var(--text);
    font-size: 18px;
    line-height: 1.25;
  }

  .mobile-action-sheet-list {
    display: grid;
    gap: 8px;
  }

  .mobile-action-item-wrap,
  .mobile-action-item-wrap form {
    display: block;
    width: 100%;
  }

  .mobile-action-item {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100% !important;
    min-height: 46px;
    height: auto;
    padding: 10px 12px;
    border: 1px solid #e2e9f3;
    border-radius: 12px;
    color: var(--text);
    background: #f8fafc;
    text-align: left;
    font-size: 14px;
    font-weight: 730;
  }

  .mobile-action-item .ui-icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
  }

  .mobile-action-item-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-action-item.is-primary {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
  }

  .mobile-action-item.is-danger {
    color: #fff;
    border-color: var(--danger);
    background: var(--danger);
  }

  .mobile-action-item:disabled,
  .mobile-action-item-wrap.is-disabled .mobile-action-item {
    color: #8a97aa;
    border-color: #e7edf5;
    background: #f3f6fa;
    opacity: .72;
  }

  body.has-mobile-action-sheet {
    overflow: hidden;
  }
}
