.wide-field {
  grid-column: 1 / -1;
}

.account-create-note {
  padding: 10px 12px;
  border-radius: 7px;
  background: #edf7f3;
  color: #316158;
  font-size: 12px;
  line-height: 1.6;
}

.heading-actions,
.pill-stack,
.account-chip-list {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.account-metrics {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.account-metrics .metric { padding: 13px 15px; }
.account-metrics .metric strong { font-size: 22px; }

.account-toolbar,
.device-toolbar { flex-wrap: wrap; }

.account-toolbar input,
.device-toolbar input {
  flex: 1 1 280px;
  min-width: 220px;
  width: auto;
}

.entity-cell,
.device-summary-cell,
.security-cell {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.entity-cell strong {
  color: #20332f;
  font-size: 13px;
  font-family: Inter,"Segoe UI","Microsoft YaHei",system-ui,sans-serif;
}

.entity-cell code,
.account-chip-list code {
  color: #53645f;
  font-family: Consolas,monospace;
  font-size: 11px;
  word-break: normal;
  white-space: nowrap;
}

.entity-cell span,
.device-summary-cell small,
.security-cell small,
.muted {
  color: var(--muted);
  font-size: 11px;
}

.device-model {
  font-weight: 650;
  color: #28423c;
  white-space: nowrap;
}

.device-identity { min-width: 210px; }

.account-chip-list {
  align-items: flex-start;
  flex-direction: column;
  min-width: 165px;
}

.pill-stack {
  align-items: flex-start;
  min-width: 160px;
}

#account-table td:first-child,
#device-table td:first-child { min-width: 220px; }

#account-table td.actions,
#device-table td.actions {
  position: sticky;
  right: 0;
  background: #fff;
  box-shadow: -8px 0 12px -12px #173f3a66;
}

#account-table tr:hover td.actions,
#device-table tr:hover td.actions { background: #fbfcfc; }

.release-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
  padding: 22px 24px;
  border-color: #a9cec4;
  background: linear-gradient(120deg, #edf8f4 0%, #fff 58%, #fbf7ed 100%);
  box-shadow: 0 8px 28px #173f3a10;
}

.release-current-copy > div {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.release-current-copy strong {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -.03em;
}

.release-current-copy p,
.release-form-intro p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.release-eyebrow {
  color: var(--green2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}

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

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

.release-steps {
  display: grid;
  grid-template-columns: auto minmax(28px, 1fr) auto minmax(28px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 8px 14px;
  color: #48605b;
  font-size: 12px;
  font-weight: 650;
}

.release-steps span { display: flex; align-items: center; gap: 7px; }
.release-steps b { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #dceee8; color: var(--green); }
.release-steps i { height: 1px; background: #cfddd9; }

.release-form-card { border-top: 3px solid var(--green2); }
.release-form-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 13px; border-bottom: 1px solid #e5ecea; }
.release-publish-action { grid-column: 1 / -1; align-items: center; }
.release-publish-action button { min-height: 44px; padding-inline: 20px; font-weight: 700; }
.release-publish-action small { color: var(--muted); }
.release-advanced { margin-top: 18px; padding: 0; overflow: hidden; }
.release-advanced summary { padding: 15px 17px; cursor: pointer; font-weight: 650; }
.release-advanced-body { padding: 0 17px 17px; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  .release-current { align-items: flex-start; flex-direction: column; padding: 18px; }
  .release-steps { grid-template-columns: 1fr; align-items: start; }
  .release-steps i { display: none; }
  .release-form-intro { flex-direction: column; }
  .release-publish-action { align-items: flex-start; flex-direction: column; }
}

.wide-field textarea {
  resize: vertical;
  border: 1px solid #bcc9c6;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

.upload-progress {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #cfe0dc;
  border-radius: 7px;
  background: #f5faf8;
}

.upload-progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}

.upload-progress-heading span {
  color: var(--green2);
  font-variant-numeric: tabular-nums;
}

.upload-progress progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #dfeae7;
}

.upload-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #dfeae7;
}

.upload-progress progress::-webkit-progress-value,
.upload-progress progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--green2);
}

.upload-progress small {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.upload-progress.error {
  border-color: #e9b9b4;
  background: #fff5f4;
}

.upload-progress.error .upload-progress-heading span,
.upload-progress.error small {
  color: var(--danger);
}

.section-note {
  margin: -3px 2px 10px;
  color: #687875;
  font-size: 12px;
  line-height: 1.6;
}

td.actions .button-link {
  display: inline-block;
  margin: 1px 5px 1px 0;
}

.confirm-dialog {
  width: min(520px, calc(100% - 30px));
  border: 0;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 20px 70px #0005;
}

.confirm-dialog::backdrop {
  background: #102b2577;
}

.confirm-dialog form {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.confirm-dialog h2 {
  margin: 0;
  font-size: 20px;
}

.confirm-dialog p {
  margin: 0;
  color: #687875;
  line-height: 1.7;
}

.confirm-dialog label {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.confirm-dialog small {
  display: block;
  padding: 9px;
  background: #f5f7f6;
  border-radius: 6px;
  word-break: break-all;
}

.button-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bcc9c6;
  border-radius: 6px;
  padding: 8px 10px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

/* Management and governance workspace */
.topbar {
  gap: 18px;
}

.topbar-brand {
  flex: 0 0 auto;
}

.topbar-tools {
  min-width: 0;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
}

.topbar-tools[hidden] { display: none; }

.global-search-trigger,
.top-counter {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: #71928d;
  background: #ffffff0d;
  color: #e9f4f1;
}

.global-search-trigger {
  width: min(360px, 34vw);
  justify-content: space-between;
  color: #bfd2ce;
}

.global-search-trigger kbd {
  padding: 2px 6px;
  border: 1px solid #ffffff32;
  border-radius: 4px;
  background: #0d2e2966;
  color: #e9f4f1;
  font-size: 10px;
}

.top-counter b {
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #f7cf78;
  color: #4d3810;
  text-align: center;
  font-size: 11px;
}

.shell { grid-template-columns: 220px minmax(0, 1fr); }

nav { gap: 2px; }

.nav-group {
  margin: 15px 12px 5px;
  color: #83918e;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}

.nav-group:first-child { margin-top: 0; }

nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 7px;
}

nav button i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #edf3f1;
  color: #49635d;
  font-size: 11px;
  font-style: normal;
}

nav button.active i {
  background: #d3e9e2;
  color: var(--green);
}

.nav-count {
  min-width: 20px;
  margin-left: auto;
  padding: 2px 5px;
  border-radius: 999px;
  background: #f7cf78;
  color: #5a420f;
  font-size: 10px;
  text-align: center;
}

main { max-width: none; padding: 24px 30px 64px; }

.overview-secondary { margin-top: 14px; }

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

.workbench-lane {
  min-height: 260px;
  padding: 0;
  overflow: hidden;
}

.workbench-lane .card-heading {
  padding: 14px 15px 11px;
  border-bottom: 1px solid #e8eeec;
}

.workbench-lane h3 { margin: 0; }

.text-button {
  padding: 2px 3px;
  border: 0;
  background: transparent;
  color: var(--green2);
  font-size: 11px;
}

.workbench-list { display: grid; }
.workbench-list.empty { padding: 58px 18px; }

.workbench-item {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid #edf1f0;
  border-radius: 0;
  text-align: left;
}

.workbench-item:last-child { border-bottom: 0; }
.workbench-item > span:first-child { min-width: 0; display: grid; gap: 4px; }
.workbench-item b { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.workbench-item small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.governance-toolbar,
.operations-toolbar { flex-wrap: wrap; }

.governance-toolbar input,
.operations-toolbar input { flex: 1 1 270px; width: auto; }

.governance-metrics .metric { padding: 13px 15px; }
.governance-metrics .metric strong { font-size: 22px; }

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
  margin: -3px 0 9px;
}

.filter-chips span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8f2ef;
  color: #355c53;
  font-size: 10px;
}

.block { display: block; margin-top: 5px; }
.danger-text { color: var(--danger)!important; }

.operation-progress {
  min-width: 110px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.operation-progress progress { width: 76px; height: 7px; accent-color: var(--green2); }
.operation-progress span { color: var(--muted); font-size: 10px; }

.legacy-operation-tables {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.legacy-operation-tables > summary { padding: 13px 16px; cursor: pointer; color: #53645f; font-size: 12px; }
.legacy-operation-body { padding: 0 14px 14px; }

.search-dialog {
  width: min(760px, calc(100% - 30px));
  max-height: min(720px, calc(100vh - 40px));
  margin: 9vh auto auto;
  padding: 0;
  border: 0;
  border-radius: 13px;
  box-shadow: 0 24px 80px #071d1955;
}

.search-dialog::backdrop,
.side-drawer::backdrop { background: #102b2577; backdrop-filter: blur(2px); }
.search-dialog-shell { display: grid; }
.search-dialog-head { display: flex; gap: 9px; padding: 13px; border-bottom: 1px solid var(--line); }
.search-dialog-head input { flex: 1; font-size: 15px; }
.search-results { max-height: 62vh; overflow: auto; padding: 9px 13px 16px; }
.search-results.loading { padding: 35px; color: var(--muted); text-align: center; }
.search-results section h3 { display: flex; gap: 7px; margin: 11px 6px 5px; color: #566661; font-size: 11px; }
.search-results section h3 small { color: #8b9895; }
.search-results section > button {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border: 0;
  border-radius: 7px;
  text-align: left;
}
.search-results section > button > span { min-width: 0; display: grid; gap: 3px; }
.search-results section > button b { overflow: hidden; text-overflow: ellipsis; }
.search-results section > button small { color: var(--muted); }
.search-results section > button code { max-width: 260px; overflow: hidden; color: #6a7b77; font-size: 10px; text-overflow: ellipsis; }

.side-drawer {
  width: min(720px, calc(100% - 36px));
  max-width: none;
  height: 100dvh;
  max-height: none;
  inset: 0 0 0 auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: #f6f8f7;
  box-shadow: -20px 0 70px #0d2c2655;
}

.drawer-shell { min-height: 100%; display: grid; grid-template-rows: auto auto 1fr; }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 20px; border-bottom: 1px solid var(--line); background: #fff; }
.drawer-head span { color: var(--green2); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.drawer-head h2 { max-width: 470px; margin: 3px 0 0; overflow: hidden; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-head-actions { display: flex; gap: 7px; }
.drawer-content { min-width: 0; padding: 16px 20px 40px; overflow: auto; }
.drawer-summary,
.drawer-section { margin-bottom: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.drawer-summary > div:first-child { display: flex; gap: 6px; flex-wrap: wrap; }
.drawer-summary > p,
.drawer-prose { margin: 13px 0; color: #40534e; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.drawer-summary dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin: 13px 0 0; }
.drawer-summary dl div { min-width: 0; padding: 8px 0; border-top: 1px solid #edf1f0; }
.drawer-summary dt { color: var(--muted); font-size: 10px; }
.drawer-summary dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 12px; }
.drawer-actions,
.drawer-inline-action { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.drawer-inline-action select { flex: 1; min-width: 180px; }
.drawer-section h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 13px; }
.drawer-section h3 small { min-width: 20px; padding: 2px 5px; border-radius: 999px; background: #eef2f1; color: var(--muted); text-align: center; }
.partial-warning { margin: 12px 20px 0; padding: 10px 12px; border: 1px solid #efcf99; border-radius: 7px; background: #fff7e8; color: #81500e; font-size: 11px; }
.compact-empty { padding: 18px; }

.linked-list,
.linked-objects { display: grid; gap: 6px; }
.linked-list button,
.linked-objects > div { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 9px 10px; border: 1px solid #e6ecea; border-radius: 7px; background: #fbfcfc; text-align: left; }
.linked-list button > span,
.linked-objects > div > span { min-width: 0; display: grid; gap: 3px; }
.linked-list button small,
.linked-objects code { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.token-list { display: flex; flex-wrap: wrap; gap: 6px; }
.token-list code { padding: 5px 7px; border-radius: 5px; background: #f0f4f3; color: #49615b; font-size: 10px; }

.timeline { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline::before { position: absolute; top: 6px; bottom: 6px; left: 5px; width: 1px; background: #d8e3e0; content: ''; }
.timeline li { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 10px; padding: 0 0 16px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li > i { z-index: 1; width: 11px; height: 11px; margin-top: 3px; border: 2px solid #fff; border-radius: 50%; background: #91a19d; box-shadow: 0 0 0 1px #cbd8d5; }
.timeline li > i.ok { background: var(--ok); }
.timeline li > i.warn { background: var(--warning); }
.timeline li > i.bad { background: var(--danger); }
.timeline li > div { min-width: 0; display: grid; gap: 3px; }
.timeline strong { font-size: 12px; }
.timeline span { color: var(--muted); font-size: 10px; }
.timeline p { margin: 4px 0 0; color: #42534f; font-size: 11px; line-height: 1.6; white-space: pre-wrap; }
.timeline small { width: fit-content; padding: 2px 6px; border-radius: 999px; background: #eef2f1; color: #586a65; font-size: 9px; }

.json-block { max-height: 290px; margin: 0; overflow: auto; padding: 11px; border-radius: 7px; background: #142723; color: #d9e8e4; font: 10px/1.55 Consolas,monospace; white-space: pre-wrap; word-break: break-word; }

body[data-density="compact"] th,
body[data-density="compact"] td { padding-top: 6px; padding-bottom: 6px; }
body[data-density="compact"] table { font-size: 11px; }
body[data-density="compact"] .entity-cell { gap: 2px; }

@media (max-width: 1260px) {
  .top-counter { display: none; }
  .global-search-trigger { width: min(400px, 42vw); }
  .workbench-lanes { grid-template-columns: 1fr 1fr; }
  .workbench-lane:last-child { grid-column: 1 / -1; }
}

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  aside { min-width: 0; overflow: hidden; }
  nav { max-width: 100%; }
  .nav-group { display: none; }
  nav button { flex: 0 0 auto; }
  nav button i { display: none; }
  .topbar-brand span,
  .topbar-session > #current-admin,
  #density-toggle { display: none; }
  .topbar-tools { justify-content: flex-start; }
  .global-search-trigger { width: min(230px, 32vw); }
}

@media (max-width: 720px) {
  .topbar-brand span,
  .global-search-trigger span,
  .global-search-trigger kbd,
  #density-toggle { display: none; }
  .global-search-trigger { width: 38px; }
  .global-search-trigger::before { content: '搜'; }
  .workbench-lanes { grid-template-columns: 1fr; }
  .workbench-lane:last-child { grid-column: auto; }
  .side-drawer { width: 100%; }
  .drawer-summary dl { grid-template-columns: 1fr; }
  .drawer-head { padding: 13px 14px; }
  .drawer-content { padding: 12px 12px 30px; }
  .drawer-head-actions #drawer-copy-id { display: none; }
}
