:root {
  color: #202522;
  background: #f3f5f4;
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
  --ink: #202522;
  --ink-strong: #141916;
  --muted: #68716c;
  --muted-soft: #87908b;
  --line: #d9dfdc;
  --line-strong: #c8d0cc;
  --surface: #ffffff;
  --surface-soft: #f7f9f8;
  --canvas: #f3f5f4;
  --sidebar: #202622;
  --sidebar-soft: #2b332e;
  --green: #237a53;
  --green-dark: #185f3e;
  --green-soft: #e3f1e9;
  --blue: #356d87;
  --blue-soft: #e3eef3;
  --amber: #a96520;
  --amber-soft: #f7ecdc;
  --red: #a33d3d;
  --red-soft: #f7e5e4;
  --shadow-sm: 0 8px 24px rgb(24 32 28 / 6%);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #25845b;
  outline-offset: 2px;
}

.app-root {
  min-height: 100vh;
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 18px;
  background: #edf1ef;
}

.login-panel {
  position: relative;
  display: grid;
  width: min(100%, 408px);
  gap: 18px;
  overflow: hidden;
  padding: 32px;
  background: var(--surface);
  border: 1px solid #cfd7d3;
  border-radius: 8px;
  box-shadow: 0 22px 60px rgb(25 32 29 / 13%);
}

.login-panel::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  content: "";
  background: var(--green);
}

.login-brand,
.sidebar-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.login-brand img,
.sidebar-brand img {
  flex: 0 0 auto;
  border-radius: 6px;
}

.login-brand div,
.sidebar-brand div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.login-brand strong {
  color: var(--ink-strong);
  font-size: 16px;
}

.login-brand span {
  color: var(--muted);
  font-size: 12px;
}

.login-heading {
  padding-top: 18px;
  border-top: 1px solid #e4e8e6;
}

.admin-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  min-height: 560px;
  flex-direction: column;
  padding: 18px 12px 14px;
  color: #eef3f0;
  background: var(--sidebar);
  border-right: 1px solid #313a35;
}

.sidebar-brand {
  min-height: 54px;
  padding: 0 9px 18px;
  border-bottom: 1px solid #39423d;
}

.sidebar-brand strong {
  overflow: hidden;
  color: #ffffff;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand span {
  color: #9da9a3;
  font-size: 11px;
}

.sidebar-label {
  margin: 18px 10px 7px;
  color: #7f8c85;
  font-size: 10px;
  font-weight: 700;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 54px;
  gap: 2px;
  padding: 9px 12px 9px 15px;
  color: #c7d0cb;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.nav-item::before {
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: 0;
  width: 3px;
  content: "";
  background: transparent;
  border-radius: 2px;
}

.nav-item span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item small {
  overflow: hidden;
  color: #87938d;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item:hover {
  color: #ffffff;
  background: #29312d;
  border-color: #36403a;
}

.nav-item[aria-current="page"] {
  color: #ffffff;
  background: #303a34;
  border-color: #3b4740;
}

.nav-item[aria-current="page"]::before {
  background: #62c493;
}

.nav-item[aria-current="page"] small {
  color: #bec9c3;
}

.sidebar-status {
  display: grid;
  margin-top: auto;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 9px;
  padding: 15px 10px 3px;
  color: #d8e0dc;
  border-top: 1px solid #39423d;
}

.status-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  background: #63c795;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgb(99 199 149 / 12%);
}

.sidebar-status div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.sidebar-status strong,
.sidebar-status span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-status strong {
  font-size: 11px;
}

.sidebar-status span {
  color: #849189;
  font-size: 10px;
}

.admin-content {
  min-width: 0;
  min-height: 100vh;
  background: var(--canvas);
}

.content-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 28px;
  background: rgb(255 255 255 / 96%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 18px rgb(30 38 34 / 3%);
}

.content-header > div {
  min-width: 0;
}

.content-header > .button {
  flex: 0 0 auto;
}

.header-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 10px;
}

.header-kicker {
  grid-row: 1;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.content-header h1 {
  grid-row: 1;
  overflow: hidden;
  margin: 0;
  color: var(--ink-strong);
  font-size: 20px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-header p {
  grid-column: 1 / -1;
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-body {
  width: 100%;
  max-width: 1540px;
  padding: 26px 28px 38px;
}

.admin-page {
  display: grid;
  min-width: 0;
  gap: 24px;
}

.section-heading,
.panel-heading {
  min-width: 0;
}

.section-heading h1,
.panel-heading h2,
dialog h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.eyebrow {
  margin: 0 0 4px;
  color: #47745e;
  font-size: 10px;
  font-weight: 700;
}

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

.metric-item {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 132px;
  grid-column: span 2;
  align-content: center;
  gap: 7px;
  overflow: hidden;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid #9aa49f;
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
}

.metric-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.metric-item strong {
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-item small {
  overflow: hidden;
  color: var(--muted-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-release {
  grid-column: span 4;
}

.metric-records {
  border-top-color: var(--blue);
}

.metric-licenses {
  border-top-color: var(--green);
}

.metric-codes {
  border-top-color: var(--amber);
}

.metric-feedback {
  border-top-color: var(--red);
}

.metric-primary {
  color: #ffffff;
  background: #27483a;
  border-color: #27483a;
  border-top-color: #69c899;
}

.metric-primary span,
.metric-primary small {
  color: #cce0d6;
}

.metric-primary strong {
  display: -webkit-box;
  overflow: hidden;
  color: #ffffff;
  font-size: 19px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.overview-workbench {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(320px, 5fr);
  align-items: stretch;
  gap: 24px;
}

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

.manifest-panel {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
}

.upload-section {
  display: grid;
  gap: 14px;
}

.manifest-panel {
  display: grid;
  min-height: 224px;
  grid-template-rows: auto 1fr;
  gap: 20px;
}

.quick-section {
  display: grid;
  min-width: 0;
  gap: 11px;
}

.quick-grid {
  display: grid;
  gap: 8px;
}

.quick-action {
  display: grid;
  min-width: 0;
  min-height: 61px;
  grid-template-columns: minmax(0, 1fr) 22px;
  align-content: center;
  gap: 3px 10px;
  padding: 11px 14px;
  color: #26312b;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.quick-action::after {
  width: 7px;
  height: 7px;
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  justify-self: center;
  content: "";
  border-top: 1px solid #7d8982;
  border-right: 1px solid #7d8982;
  transform: rotate(45deg);
}

.quick-action:hover {
  background: #f7faf8;
  border-color: #adc1b6;
  transform: translateX(2px);
}

.quick-action strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-action span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

label {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: #505954;
  font-size: 11px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  color: var(--ink-strong);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input {
  height: 40px;
  padding: 0 11px;
}

select {
  height: 40px;
  padding: 0 10px;
}

input[type="file"] {
  padding: 7px 9px;
}

textarea {
  min-height: 92px;
  padding: 10px 11px;
  line-height: 1.5;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9aa39e;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #25845b;
  box-shadow: 0 0 0 3px rgb(37 132 91 / 12%);
}

input[readonly] {
  color: #46504b;
  background: #f1f4f2;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.button-primary {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.button-primary:hover:not(:disabled) {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.button-secondary {
  color: #27312c;
  background: #ffffff;
  border-color: var(--line-strong);
}

.button-secondary:hover:not(:disabled) {
  background: #eef2f0;
  border-color: #aeb9b3;
}

.button-danger {
  color: #963434;
  background: #fff8f7;
  border-color: #e4b9b7;
}

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

.button-block {
  width: 100%;
}

.form-error {
  min-height: 18px;
  margin: -7px 0 0;
  color: #b3262d;
  font-size: 12px;
}

.copy-row {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.address-list {
  display: grid;
  align-self: center;
  gap: 14px;
}

.address-field {
  display: grid;
  gap: 7px;
  color: #505954;
  font-size: 11px;
  font-weight: 700;
}

.release-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.editor-state {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 2px 9px;
  color: #5c665f;
  background: #edf1ef;
  border: 1px solid #d7ded9;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.upload-form {
  display: grid;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
}

.release-form-block {
  display: grid;
  min-width: 0;
  gap: 16px;
  padding: 20px 22px;
}

.release-form-block + .release-form-block {
  border-top: 1px solid #e5e9e7;
}

.form-block-heading {
  display: flex;
  align-items: center;
  gap: 9px;
}

.form-block-heading h3 {
  margin: 0;
  color: #27312c;
  font-size: 12px;
  line-height: 1.2;
}

.form-block-index {
  display: inline-flex;
  width: 26px;
  height: 22px;
  align-items: center;
  justify-content: center;
  color: #23704f;
  background: var(--green-soft);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.release-target-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.72fr) minmax(300px, 1.35fr) minmax(150px, 0.72fr);
  align-items: end;
  gap: 18px;
}

.platform-segment {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.platform-segment legend {
  margin-bottom: 7px;
  padding: 0;
  color: #505954;
  font-size: 11px;
  font-weight: 700;
}

.platform-options {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  background: #edf1ef;
  border: 1px solid #d8dfdb;
  border-radius: 6px;
}

.platform-choice {
  position: relative;
  display: block;
}

.platform-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.platform-choice > span {
  display: flex;
  min-width: 0;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  color: #59635d;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.platform-choice strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-choice small {
  color: #88918c;
  font-size: 9px;
  font-weight: 700;
}

.platform-choice input:checked + span {
  color: #175f3e;
  background: #ffffff;
  border-color: #aec8ba;
  box-shadow: 0 2px 8px rgb(30 44 36 / 7%);
}

.platform-choice input:checked + span small {
  color: #4f7b64;
}

.platform-choice input:focus-visible + span {
  outline: 2px solid #25845b;
  outline-offset: 2px;
}

.release-package-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.45fr);
  align-items: start;
  gap: 18px;
}

.release-package-grid textarea {
  min-height: 104px;
}

.upload-actions {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 13px 20px;
  background: #f7f9f8;
  border-top: 1px solid #e2e7e4;
}

.release-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.release-inline-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.release-inline-summary span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.release-inline-summary strong {
  color: var(--ink-strong);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.progress-wrap {
  display: grid;
  min-width: min(100%, 280px);
  grid-template-columns: minmax(90px, 1fr) 38px;
  align-items: center;
  gap: 9px;
  color: #4b5550;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  accent-color: var(--green);
  border: 0;
  border-radius: 4px;
}

.releases-section,
.activation-section,
.interaction-section,
.content-section,
.feedback-section {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
}

.feedback-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.interaction-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

.content-summary .summary-item {
  border-bottom: 1px solid #e5e9e7;
}

.content-summary .summary-item:nth-child(3n) {
  border-right: 0;
}

.content-summary .summary-item:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.summary-item {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 72px;
  align-content: center;
  gap: 4px;
  padding: 12px 16px 12px 19px;
  color: var(--muted);
  border-right: 1px solid #e5e9e7;
  font-size: 10px;
  font-weight: 700;
}

.summary-item:last-child {
  border-right: 0;
}

.summary-item::before {
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 11px;
  width: 3px;
  content: "";
  background: #98a39d;
  border-radius: 2px;
}

.summary-item strong {
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-item[data-tone="info"]::before {
  background: var(--blue);
}

.summary-item[data-tone="success"]::before {
  background: var(--green);
}

.summary-item[data-tone="warning"]::before {
  background: var(--amber);
}

.summary-item[data-tone="danger"]::before {
  background: var(--red);
}

.summary-item[data-tone="muted"]::before {
  background: #79847e;
}

.activation-form {
  display: grid;
  grid-template-columns: 130px 180px minmax(220px, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
}

.content-workbench {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 0.8fr);
  align-items: start;
  gap: 16px;
}

.content-editor-form,
.content-import-form {
  display: grid;
  min-width: 0;
  gap: 16px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
}

.form-section-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid #e5e9e7;
}

.form-section-heading h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 14px;
}

.content-form-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(120px, 0.7fr) minmax(190px, 1.4fr) minmax(100px, 0.55fr) minmax(110px, 0.65fr);
  align-items: end;
  gap: 14px;
}

.content-form-grid textarea {
  min-height: 82px;
}

.content-prompt-field,
.content-answer-field,
.content-explanation-field {
  grid-column: span 2;
}

.toggle-field {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  color: #3d4741;
  background: #f6f8f7;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
}

.toggle-field input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--green);
}

.toggle-warning {
  min-height: 48px;
  color: #76521f;
  background: #fffaf1;
  border-color: #e7d4ad;
}

.content-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.content-import-form .button {
  justify-self: start;
}

.list-toolbar {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
}

.list-toolbar label,
.page-size-control {
  display: grid;
  gap: 5px;
}

.list-toolbar label > span,
.page-size-control > span {
  color: #59635d;
  font-size: 10px;
  font-weight: 700;
}

.list-toolbar select {
  width: auto;
  min-width: 150px;
  min-height: 34px;
  padding: 5px 28px 5px 9px;
}

.content-bulk-toolbar,
.content-selection-summary,
.content-type-disable {
  display: flex;
  min-width: 0;
  align-items: end;
  gap: 8px;
}

.content-bulk-toolbar {
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 11px 13px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.content-selection-summary {
  align-items: center;
}

.content-selection-summary strong {
  min-width: 64px;
  color: var(--ink-strong);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.content-type-disable label {
  display: grid;
  gap: 5px;
}

.content-type-disable label > span {
  color: #59635d;
  font-size: 10px;
  font-weight: 700;
}

.content-type-disable select {
  min-width: 150px;
  min-height: 38px;
}

.list-pagination {
  display: grid;
  min-height: 42px;
  grid-template-columns: auto minmax(100px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.page-size-control {
  grid-template-columns: auto 64px;
  align-items: center;
}

.page-size-control select {
  min-height: 32px;
  padding: 4px 7px;
}

.pagination-range {
  justify-self: center;
  font-variant-numeric: tabular-nums;
}

.pagination-navigation {
  display: grid;
  grid-template-columns: 34px minmax(52px, auto) 34px;
  align-items: center;
  gap: 7px;
}

.pagination-page {
  color: var(--ink-strong);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pagination-button {
  width: 34px;
  min-width: 34px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 15px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.activation-table {
  min-width: 1040px;
}

.feedback-table {
  min-width: 900px;
  table-layout: fixed;
}

.interaction-table {
  min-width: 980px;
}

.content-table {
  min-width: 1040px;
  table-layout: fixed;
}

.content-table th:nth-child(1) {
  width: 44px;
}

.content-table th:nth-child(2) {
  width: 180px;
}

.content-table th:nth-child(3) {
  width: auto;
}

.content-table th:nth-child(4) {
  width: 190px;
}

.content-table th:nth-child(5) {
  width: 170px;
}

.content-table .actions-column {
  width: 150px;
}

.selection-column,
.content-selection-cell {
  text-align: center;
}

.selection-column input,
.content-selection-cell input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}

.selection-column input:disabled,
.content-selection-cell input:disabled {
  cursor: not-allowed;
}

.content-type-cell strong,
.content-type-cell code,
.content-copy-cell strong,
.content-copy-cell span,
.content-meta-cell strong,
.content-meta-cell span {
  display: block;
}

.content-type-cell .status-badge {
  display: inline-flex;
  margin: 6px 0;
}

.content-type-cell code {
  overflow: hidden;
  color: #66716a;
  font-family: Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-copy-cell strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-strong);
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.content-copy-cell span,
.content-meta-cell span {
  overflow: hidden;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-meta-cell strong {
  color: var(--ink-strong);
  font-size: 11px;
}

.content-disabled-row {
  opacity: 0.72;
}

.interaction-table th:last-child,
.interaction-table td:last-child {
  position: static;
  box-shadow: none;
}

.interaction-account strong,
.interaction-settings strong,
.interaction-detail strong {
  display: block;
  color: var(--ink-strong);
}

.interaction-account span,
.interaction-settings span,
.interaction-detail span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.interaction-number {
  color: var(--ink-strong);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.feedback-table th:nth-child(2) {
  width: 138px;
}

.feedback-table th:nth-child(3) {
  width: 260px;
}

.feedback-table td {
  vertical-align: top;
}

.feedback-content {
  width: auto;
}

.feedback-content strong,
.feedback-content .feedback-message {
  display: block;
}

.feedback-content .feedback-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 11px;
  color: #7a837e;
  font-size: 10px;
}

.feedback-content strong {
  margin-top: 8px;
  color: var(--ink-strong);
}

.feedback-content .feedback-message {
  margin-top: 6px;
  color: #505a55;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.feedback-type {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.feedback-type.problem {
  color: #963832;
  background: var(--red-soft);
}

.feedback-type.suggestion {
  color: #2f637b;
  background: var(--blue-soft);
}

.feedback-status-select {
  width: 112px;
}

.feedback-note-cell {
  width: 260px;
}

.feedback-note-cell textarea {
  min-height: 76px;
  resize: vertical;
}

.feedback-table .actions-column {
  width: 92px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #e4e8e6;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #5b655f;
  background: #f1f4f2;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

td {
  color: #303733;
  background: inherit;
  font-size: 12px;
}

tbody tr {
  background: #ffffff;
  transition: background 100ms ease;
}

tbody tr:hover {
  background: #f8faf9;
}

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

th:last-child,
td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  box-shadow: -8px 0 14px rgb(27 34 30 / 4%);
}

th:last-child {
  z-index: 3;
  background: #f1f4f2;
}

.version-cell strong,
.file-cell strong,
.license-cell strong {
  display: block;
  color: var(--ink-strong);
}

.version-cell span,
.file-cell span,
.date-stack span,
.license-cell span,
.activation-code span {
  display: block;
  margin-top: 3px;
  color: #737d77;
  font-size: 10px;
}

.activation-code,
.hash {
  font-family: Consolas, monospace;
  letter-spacing: 0;
}

.hash {
  font-size: 10px;
}

.date-stack,
.license-cell {
  min-width: 168px;
}

.status-badge {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 2px 8px;
  color: #4d5952;
  background: #edf1ef;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.status-badge.active {
  color: #155f3d;
  background: #dff0e7;
}

.status-badge.published {
  color: #2d6178;
  background: #e2eef3;
}

.status-badge.draft {
  color: #6d5b30;
  background: #f4ecda;
}

.status-badge.expired {
  color: #76591f;
  background: #f5ead2;
}

.status-badge.revoked {
  color: #963338;
  background: #f7e1e1;
}

.actions-column {
  width: 224px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.row-actions .button {
  min-height: 31px;
  padding: 0 10px;
  font-size: 11px;
}

.empty-state {
  margin: 0;
  padding: 46px 20px;
  color: #747d78;
  text-align: center;
}

dialog {
  width: min(calc(100% - 32px), 430px);
  padding: 0;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #cfd6d2;
  border-radius: 7px;
  box-shadow: 0 24px 70px rgb(20 26 23 / 24%);
}

dialog::backdrop {
  background: rgb(16 20 18 / 44%);
}

dialog form {
  padding: 22px;
}

dialog p {
  margin: 12px 0 22px;
  color: #535d57;
  line-height: 1.6;
  white-space: pre-line;
}

.codes-dialog textarea {
  min-height: 170px;
  margin-bottom: 18px;
  font-family: Consolas, monospace;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(380px, calc(100vw - 40px));
  padding: 11px 14px;
  color: #ffffff;
  background: #222825;
  border: 1px solid #3e4742;
  border-radius: 5px;
  box-shadow: 0 12px 36px rgb(20 26 23 / 24%);
  font-size: 12px;
}

.toast.error {
  background: #982d33;
  border-color: #b1484d;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .overview-workbench {
    grid-template-columns: 1fr;
  }

  .manifest-panel {
    min-height: 168px;
  }

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

  .interaction-summary,
  .content-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .quick-action {
    min-height: 78px;
  }
}

@media (max-width: 940px) {
  .admin-shell {
    grid-template-columns: 208px minmax(0, 1fr);
  }

  .page-body {
    padding-inline: 22px;
  }

  .metric-release {
    grid-column: 1 / -1;
  }

  .metric-item:not(.metric-release) {
    grid-column: span 3;
  }

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

  .architecture-field {
    grid-row: 1;
    grid-column: 2;
  }

  .platform-segment {
    grid-row: 2;
    grid-column: 1 / -1;
  }

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

  .activation-form {
    grid-template-columns: 130px 180px minmax(220px, 1fr);
  }

  .activation-form .button {
    justify-self: start;
  }

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

@media (max-width: 800px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    z-index: 20;
    height: auto;
    min-height: 0;
    padding: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .sidebar-brand {
    min-height: 52px;
    padding: 8px 16px;
    border-bottom: 0;
  }

  .sidebar-brand img {
    width: 32px;
    height: 32px;
  }

  .sidebar-label {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    min-width: 0;
    overflow-x: hidden;
    padding: 0 10px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 14px rgb(27 34 30 / 4%);
  }

  .nav-item {
    min-width: 0;
    min-height: 48px;
    flex: 1 1 25%;
    padding: 7px 2px 9px;
    color: #66706a;
    text-align: center;
    border: 0;
    border-radius: 0;
  }

  .nav-item::before {
    top: auto;
    right: 20px;
    bottom: 0;
    left: 20px;
    width: auto;
    height: 2px;
  }

  .nav-item:hover {
    color: #31483c;
    background: #f7f9f8;
    border-color: transparent;
  }

  .nav-item[aria-current="page"] {
    color: #176a45;
    background: #f3f8f5;
    border-color: transparent;
  }

  .nav-item small,
  .sidebar-status {
    display: none;
  }

  .nav-item span {
    overflow: visible;
    font-size: 10px;
    line-height: 1.2;
    text-overflow: clip;
    white-space: normal;
  }

  .content-header {
    position: static;
    min-height: 68px;
  }

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

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

  .summary-item {
    border-bottom: 1px solid #e5e9e7;
  }

  .summary-item:nth-child(even) {
    border-right: 0;
  }

  .summary-item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .feedback-summary .summary-item:nth-last-child(2) {
    border-bottom: 1px solid #e5e9e7;
  }

  .feedback-summary .summary-item:last-child {
    border-right: 1px solid #e5e9e7;
  }

  .content-summary .summary-item {
    border-right: 1px solid #e5e9e7;
    border-bottom: 1px solid #e5e9e7;
  }

  .content-summary .summary-item:nth-child(3n) {
    border-right: 0;
  }

  .content-summary .summary-item:nth-last-child(-n + 3) {
    border-bottom: 0;
  }

  .content-bulk-toolbar {
    align-items: stretch;
  }

  .content-type-disable {
    margin-left: auto;
  }

}

@media (max-width: 640px) {
  .login-panel {
    padding: 28px 20px 24px;
  }

  .content-header,
  .page-body {
    padding-inline: 16px;
  }

  .page-body {
    padding-block: 18px 28px;
  }

  .header-kicker,
  .content-header p {
    display: none;
  }

  .header-title {
    display: block;
  }

  .metric-release,
  .metric-item:not(.metric-release) {
    grid-column: span 6;
  }

  .metric-release {
    grid-column: 1 / -1;
  }

  .metric-item {
    min-height: 108px;
    padding: 15px;
  }

  .metric-item strong {
    font-size: 23px;
  }

  .metric-primary strong {
    font-size: 18px;
  }

  .overview-workbench {
    gap: 20px;
  }

  .manifest-panel {
    padding: 18px 14px;
  }

  .manifest-panel {
    min-height: 0;
    gap: 18px;
  }

  .quick-grid,
  .activation-form,
  .content-form-grid {
    grid-template-columns: 1fr;
  }

  .content-prompt-field,
  .content-answer-field,
  .content-explanation-field {
    grid-column: auto;
  }

  .content-editor-form,
  .content-import-form {
    padding: 15px 14px;
  }

  .content-form-actions,
  .content-form-actions .button,
  .content-import-form .button {
    width: 100%;
  }

  .content-bulk-toolbar,
  .content-selection-summary,
  .content-type-disable {
    width: 100%;
  }

  .content-selection-summary,
  .content-type-disable {
    flex-wrap: wrap;
  }

  .content-type-disable {
    margin-left: 0;
  }

  .content-type-disable label {
    min-width: 0;
    flex: 1 1 170px;
  }

  .content-type-disable select,
  .content-type-disable .button {
    width: 100%;
  }

  .list-toolbar label {
    min-width: calc(50% - 5px);
    flex: 1 1 calc(50% - 5px);
  }

  .list-toolbar select {
    width: 100%;
    min-width: 0;
  }

  .list-pagination {
    grid-template-columns: auto 1fr;
    gap: 8px;
  }

  .pagination-range {
    justify-self: end;
  }

  .pagination-navigation {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .quick-action {
    min-height: 62px;
  }

  .release-form-block {
    padding: 17px 14px;
  }

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

  .version-field,
  .architecture-field,
  .platform-segment {
    grid-row: auto;
    grid-column: auto;
  }

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

  .release-editor-heading {
    align-items: flex-end;
  }

  .releases-section .inline-heading {
    align-items: flex-start;
  }

  .release-toolbar {
    align-items: flex-end;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .release-inline-summary {
    justify-content: flex-end;
  }

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

  .copy-row .button,
  .activation-form .button {
    width: 100%;
  }

  .upload-actions {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .upload-actions .button {
    width: 100%;
  }

  .progress-wrap {
    min-width: 0;
  }

  .summary-item {
    padding-inline: 18px 12px;
  }
}

@media (max-width: 400px) {
  .metric-item:not(.metric-release) {
    grid-column: 1 / -1;
  }

  .content-header .button {
    padding-inline: 10px;
  }
}

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