:root {
  color-scheme: dark;
  --bg: #090b0d;
  --surface: #121518;
  --surface-raised: #171b1f;
  --line: #30363c;
  --line-soft: #252b30;
  --text: #f4f5f7;
  --muted: #9da5ad;
  --accent: #e1e5e9;
  --ok: #4ac784;
  --bad: #ff7272;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 18% -10%, rgba(52, 72, 62, .22), transparent 42%),
    radial-gradient(circle at 82% 0%, rgba(40, 48, 56, .35), transparent 36%),
    radial-gradient(circle at 50% -20%, #14191d 0, var(--bg) 42%);
  color: var(--text);
  font: 15px "Segoe UI", Arial, sans-serif;
}
body.public-portal {
  background:
    radial-gradient(ellipse at 12% -8%, rgba(70, 98, 82, .26), transparent 44%),
    radial-gradient(circle at 88% 8%, rgba(48, 58, 68, .28), transparent 34%),
    linear-gradient(180deg, #0c0f12 0%, var(--bg) 55%);
}

header, .site-header {
  height: 76px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background:
    linear-gradient(90deg, rgba(28,34,38,.35), transparent 42%),
    rgba(7, 9, 11, .96);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--text);
  text-decoration: none;
}
.brand img {
  display: block;
  width: 174px;
  height: 48px;
  object-fit: contain;
}
.brand span {
  border-left: 1px solid var(--line);
  padding-left: 18px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
}

nav, .site-nav {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
a, .link { color: var(--accent); text-decoration: none; }
a:hover, .link:hover { color: #fff; }
.link { background: none; border: 0; padding: 0; cursor: pointer; height: auto; }
.nav-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #b7c0c6;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.04); border-color: var(--line-soft); }
.nav-link.is-active {
  color: #fff;
  background: rgba(255,255,255,.07);
  border-color: #3c454d;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.nav-logout { margin: 0 0 0 4px; }
.nav-logout-btn { cursor: pointer; background: none; }

main { width: min(100% - 48px, 1280px); margin: 0 auto; padding: 38px 0 64px; }
.narrow { max-width: 430px; margin: 9vh auto; }

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.heading-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.heading-actions form { margin: 0; }
.eyebrow {
  margin: 0 0 6px;
  color: #858e96;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}
.status-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px rgba(74,199,132,.5); }

.card {
  background: linear-gradient(180deg, #15191c 0, var(--surface) 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 12px 34px rgba(0,0,0,.12);
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { margin: 0 0 2px; }
.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 11px;
  vertical-align: 2px;
}

h1, h2 { margin: 0 0 16px; line-height: 1.15; }
h1 { font-size: 29px; }
h2 { font-size: 19px; }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.error { color: var(--bad); }
.nowrap { white-space: nowrap; }
.block { display: block; margin-top: 4px; }
.release-form { display: grid; grid-template-columns: minmax(180px, .45fr) minmax(280px, 1fr); gap: 14px; align-items: end; }
.release-form > div { min-width: 0; }
.release-notes { grid-column: 1 / -1; }
.release-modules { grid-column: 1 / -1; margin: 2px 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.release-modules legend { padding: 0 7px; color: var(--muted); font-size: 13px; }
.module-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.release-submit { grid-column: 1 / -1; justify-self: start; width: auto; max-width: 100%; }
.release-form input[type="file"] { padding: 4px; color: var(--muted); }
.release-form input[type="file"]::file-selector-button {
  height: 30px;
  margin-right: 10px;
  border: 1px solid #555f67;
  border-radius: 5px;
  background: #242a2f;
  color: var(--text);
  padding: 0 11px;
  cursor: pointer;
}
.release-form input[type="file"]::file-selector-button:hover { background: #30373d; border-color: #737e87; }
.releases-table { table-layout: fixed; min-width: 1100px; }
.releases-table th:nth-child(1) { width: 14%; }
.releases-table th:nth-child(2) { width: 18%; }
.releases-table th:nth-child(3) { width: 13%; }
.releases-table th:nth-child(4) { width: 8%; }
.releases-table th:nth-child(5) { width: 12%; }
.releases-table th:nth-child(6) { width: 15%; }
.releases-table th:nth-child(7) { width: 160px; }
.releases-table td { overflow: hidden; }
.releases-table td.actions { overflow: visible; }
.releases-table td.actions .inline { display: block; margin: 0 0 6px; }
.releases-table td.actions .inline:last-child { margin-bottom: 0; }
.releases-table td.actions button { width: 100%; }
.release-hash { display: block; overflow: hidden; color: #cbd1d5; font-family: Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.releases-table form.inline { margin: 0; }
.updates-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
  align-items: start;
}
.updates-top-grid > .card { margin-bottom: 0; min-width: 0; }
.updates-top-grid .release-form { grid-template-columns: 1fr; }
.updates-top-grid .module-options { grid-template-columns: 1fr 1fr; }
.canary-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.canary-form > div { flex: 1; min-width: 220px; }
.canary-form select { width: 100%; }
.feedback-grid { display: grid; gap: 16px; }
.feedback-card { margin: 0; }
.feedback-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.feedback-head h2 { margin: 9px 0 0; }
.feedback-head time, .feedback-meta { color: var(--muted); font-size: 12px; }
.feedback-message { white-space: pre-wrap; line-height: 1.55; }
.feedback-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.feedback-images a { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #0d1012; }
.feedback-images img { display: block; width: 100%; height: 110px; object-fit: cover; }
.feedback-images span { display: block; overflow: hidden; padding: 7px 9px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.feedback-review { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; gap: 9px; align-items: end; padding-top: 15px; border-top: 1px solid var(--line-soft); }
.feedback-review textarea { min-height: 62px; }

.feedback-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  align-items: start;
}
.feedback-card-compact {
  padding: 14px 15px 15px;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0,0,0,.16);
}
.feedback-card-compact .feedback-head { gap: 10px; margin-bottom: 8px; }
.feedback-card-compact .feedback-head-main h2 { margin: 6px 0 4px; font-size: 16px; }
.feedback-card-compact .feedback-message {
  margin: 0 0 10px;
  max-height: 7.5em;
  overflow: auto;
  font-size: 13px;
  line-height: 1.45;
}
.feedback-card-compact .feedback-images {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.feedback-thumb {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1012;
  color: inherit;
  text-align: left;
  cursor: zoom-in;
}
.feedback-thumb img { display: block; width: 100%; height: 78px; object-fit: cover; }
.feedback-thumb span {
  display: block;
  overflow: hidden;
  padding: 5px 7px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feedback-card-compact .feedback-review {
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: 12px;
}
.feedback-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-actions button { flex: 1; min-width: 140px; }

.feedback-lightbox[hidden] { display: none !important; }
.feedback-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}
.feedback-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(3px);
}
.feedback-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(88vh, 900px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #101316;
  box-shadow: 0 28px 80px rgba(0,0,0,.45);
}
.feedback-lightbox-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.feedback-lightbox-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171b1f;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.feedback-lightbox-panel img {
  display: block;
  width: 100%;
  max-height: calc(88vh - 84px);
  object-fit: contain;
  border-radius: 8px;
  background: #07090b;
}
body.lightbox-open { overflow: hidden; }
.result-times { display: grid; gap: 4px; color: var(--muted); font-size: 12px; text-align: right; }
.result-details { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 12px; margin: 18px 0 0; }
.result-details div { min-width: 0; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 8px; background: #0d1012; }
.result-details dt { margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.result-details dd { margin: 0; overflow-wrap: anywhere; }
.result-comment { margin-top: 12px; padding: 12px; border-left: 2px solid #7e888f; background: #0d1012; }
.result-comment p { margin: 6px 0 0; white-space: pre-wrap; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.grow { flex: 1; min-width: 180px; }
.create-user-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) minmax(190px, .8fr) auto;
  gap: 12px;
  align-items: end;
}

label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
input, select {
  width: 100%;
  height: 40px;
  background: #0d1012;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 11px;
  outline: none;
}
input:focus, select:focus { border-color: #69737b; box-shadow: 0 0 0 2px rgba(105,115,123,.14); }
input::placeholder { color: #6f777e; }
textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  background: #0d1012;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  outline: none;
  font: inherit;
}
textarea:focus { border-color: #69737b; box-shadow: 0 0 0 2px rgba(105,115,123,.14); }
textarea::placeholder { color: #6f777e; }

button, .button {
  min-height: 40px;
  border: 1px solid #555f67;
  border-radius: 7px;
  background: #242a2f;
  color: #fff;
  padding: 0 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  white-space: nowrap;
}
button:hover, .button:hover { background: #30373d; border-color: #737e87; }
button:disabled { opacity: .45; cursor: default; background: #20252a; border-color: #3e464d; }
button.primary { background: #30363c; border-color: #727c84; font-weight: 600; }
button.secondary, .button.secondary { background: #181c20; border-color: #3d454c; }
button.compact { min-height: 36px; padding: 0 12px; }
.danger { border-color: #7e3b3b; background: #281718; color: #ffd7d7; }
.danger:hover { border-color: #b15353; background: #3a2021; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: auto; }
th, td { text-align: left; border-bottom: 1px solid var(--line-soft); padding: 13px 10px; vertical-align: middle; }
th { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.018); }
.users-table th:nth-child(1) { width: 10%; }
.users-table th:nth-child(2) { width: 27%; }
.users-table th:nth-child(3) { width: 12%; }
.users-table th:nth-child(4) { width: 14%; }
.users-table th:nth-child(5) { width: 37%; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 9px;
  font-size: 12px;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: #7e858b; }
.pill.active { color: #b8e9cc; border-color: #28533b; background: #102019; }
.pill.active .pill-dot { background: var(--ok); }
.pill.blocked { color: #d6a5a5; border-color: #573232; background: #211313; }
.pill.blocked .pill-dot { background: var(--bad); }
.pill.archived { color: #d8c69a; border-color: #564a2f; background: #1c1911; }
.pill.archived .pill-dot { background: #c9b98e; }

form.inline { display: inline-flex; gap: 7px; margin: 6px 0 0; }
.role-name { color: var(--muted); font-size: 12px; margin-bottom: 1px; }
.owner-badge {
  display: inline-block;
  width: fit-content;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #3d5a45;
  background: #14241a;
  color: #b8e9cc;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.role-form select { width: 178px; height: 36px; }
.user-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-actions form { margin: 0; }
.password-form { display: flex; align-items: center; gap: 7px; }
.password-form input { width: 170px; }

.message {
  border: 1px solid #254936;
  border-left: 3px solid var(--ok);
  border-radius: 6px;
  padding: 11px 14px;
  background: #101c16;
  margin-bottom: 16px;
}
.message-error {
  border-color: #5d3030;
  border-left-color: var(--bad);
  background: #211313;
}

.notice, .empty-state {
  border: 1px dashed #384047;
  border-radius: 10px;
  background: #101316;
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #111518;
}
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { font-size: 20px; font-weight: 600; }

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.workspace-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, #171b1f 0, #111417 75%);
}
.workspace-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.workspace-card h2 { margin: 12px 0 4px; font-size: 22px; }
.workspace-owner { color: var(--muted); font-size: 12px; }
.workspace-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 20px 0 15px;
}
.workspace-metrics div {
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0d1012;
}
.workspace-metrics span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.workspace-metrics strong { font-size: 18px; }
.workspace-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.workspace-delete { min-width: 0; }
.workspace-delete > summary { list-style: none; user-select: none; }
.workspace-delete > summary::-webkit-details-marker { display: none; }
.workspace-delete[open] { flex: 1 1 100%; }
.delete-confirmation {
  margin-top: 10px;
  padding: 15px;
  border: 1px solid #693838;
  border-radius: 9px;
  background: #1b1112;
}
.delete-confirmation > strong { display: block; color: #ffd4d4; }
.delete-confirmation > p { margin: 8px 0 14px; color: #c6a9a9; font-size: 12px; line-height: 1.55; }
.delete-confirmation form { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px 10px; align-items: end; }
.delete-confirmation label { grid-column: 1 / 3; margin: 0; }
.delete-actions { display: flex; }

.user-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.user-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #0f1215;
}
.user-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}
.user-card-head > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.user-login { font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
.user-last-login { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; font-size: 12px; }
.user-last-login span { color: var(--muted); }
.role-editor { display: flex; align-items: end; gap: 8px; }
.role-editor button { min-width: 82px; }
.user-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.password-form { flex: 1; justify-content: flex-end; }
.password-form input { width: min(100%, 180px); }

.catalog-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.catalog-category {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #0d1012;
}
.catalog-category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.catalog-category-heading h3 { margin: 0; font-size: 17px; }
.catalog-category-heading > span { color: var(--muted); font-size: 12px; }
.catalog-list { display: grid; gap: 8px; margin-top: 10px; }
.catalog-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid #2b3237;
  border-radius: 8px;
  background: #13171a;
}
.catalog-item.archived { opacity: .78; }
.catalog-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.catalog-item-head > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.catalog-item-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-charge-type { color: var(--muted); font-size: 11px; }
.record-state {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 10px;
}
.record-state.active { color: #b8e9cc; border-color: #28533b; background: #102019; }
.record-state.archived { color: #d8c69a; border-color: #564a2f; background: #1c1911; }
.catalog-batches { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.catalog-batches-label, .catalog-no-batches { color: var(--muted); font-size: 10px; }
.batch-chip {
  padding: 3px 7px;
  border: 1px solid #374047;
  border-radius: 10px;
  background: #0d1012;
  color: #d8dde1;
  font-size: 10px;
}
.batch-chip.archived { color: #c9b98e; border-color: #51472f; }
.catalog-empty { margin: 12px 2px 2px; color: var(--muted); font-size: 12px; }

.correction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.correction-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #0e1114;
}
.correction-title { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.correction-title span { color: #747d84; }
.correction-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; margin-top: 5px; }
.correction-card dl {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 14px 0;
}
.correction-card dl div { min-width: 0; padding: 8px; border-radius: 6px; background: #15191c; }
.correction-card dt { color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.correction-card dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.correction-comment { margin: 0; padding-top: 12px; border-top: 1px solid var(--line-soft); white-space: pre-wrap; color: #d9dde0; }

.compare-selector { position: sticky; top: 12px; z-index: 2; }
.compare-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 36px minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
}
.compare-field { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 9px; align-items: start; }
.compare-field > div { min-width: 0; }
.compare-field small { display: block; margin-top: 6px; color: #747d84; font-size: 10px; line-height: 1.4; }
.compare-step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  margin-top: 20px;
  border: 1px solid #4b555d;
  border-radius: 50%;
  color: #d8dde1;
  font-size: 11px;
  font-weight: 700;
}
.compare-arrow { align-self: center; display: flex; flex-direction: column; align-items: center; color: var(--muted); padding-top: 7px; }
.compare-arrow span { font-size: 21px; line-height: 1; }
.compare-arrow small { margin-top: 3px; font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.compare-direction {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 4px 0 14px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0e1114;
}
.compare-direction > div:not(.direction-mark) { display: grid; gap: 3px; }
.compare-direction span { color: #7f8991; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.compare-direction strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.compare-direction small { color: var(--muted); font-size: 10px; }
.direction-mark { text-align: center; color: #89939b; font-size: 24px; }
.comparison-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 18px;
}
.comparison-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 11px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #111518;
}
.comparison-summary span { color: var(--muted); font-size: 11px; }
.comparison-summary strong { font-size: 20px; }
.comparison-summary .summary-new { border-color: #314b5e; background: #101820; }
.comparison-summary .summary-changed { border-color: #584a2e; background: #19160f; }
.comparison-heading { align-items: flex-start; }
.comparison-heading .muted { max-width: 700px; margin: 7px 0 0; font-size: 12px; line-height: 1.5; }
.comparison-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.check-column { width: 58px; }
.row-check { width: 17px; height: 17px; accent-color: #7f8b94; }
.record-type { color: var(--muted); font-size: 12px; }
.comparison-label { display: block; margin-top: 3px; }
.comparison-description { max-width: 620px; margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.diff-state { display: inline-block; padding: 4px 8px; border-radius: 12px; font-size: 11px; border: 1px solid var(--line); }
.diff-state.same { color: #aab1b7; }
.diff-state.changed { color: #f0d29b; border-color: #5c4b2e; background: #1e1910; }
.diff-state.new { color: #a8c9e4; border-color: #334d61; background: #101a22; }
.diff-state.target-only { color: #b6adb9; border-color: #49404d; background: #171419; }
.comparison-unchanged { padding: 0; overflow: hidden; }
.comparison-unchanged > summary {
  padding: 16px 20px;
  cursor: pointer;
  color: #c8cdd1;
  list-style-position: inside;
}
.comparison-unchanged[open] > summary { border-bottom: 1px solid var(--line-soft); }
.comparison-unchanged .table-wrap { padding: 0 14px 8px; }

.public-portal main { width: min(100% - 48px, 1440px); padding-top: 46px; }
.portal-hero {
  display: grid;
  grid-template-columns: minmax(320px, .8fr) minmax(580px, 1.2fr);
  gap: 42px;
  align-items: start;
}
.portal-intro { padding: 42px 12px 20px 0; }
.portal-intro h1 {
  max-width: 650px;
  margin-bottom: 20px;
  font-size: clamp(34px, 4vw, 58px);
  letter-spacing: -.035em;
}
.portal-intro > p:not(.eyebrow) {
  max-width: 610px;
  color: #a8b0b7;
  font-size: 17px;
  line-height: 1.65;
}
.portal-points { display: grid; gap: 10px; margin-top: 34px; }
.portal-points > div {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 2px 12px;
  padding: 13px 15px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(18, 21, 24, .72);
}
.portal-points span { grid-row: 1 / span 2; color: #737c84; font-size: 11px; padding-top: 3px; }
.portal-points strong { font-size: 14px; }
.portal-points small { color: var(--muted); font-size: 12px; }
.portal-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(24,28,32,.96), rgba(12,15,17,.98));
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
.portal-forms { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(320px, 1.2fr); gap: 12px; }
.portal-form-card, .account-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: #101316;
}
.portal-form-card h2, .account-card h2 { margin-bottom: 22px; font-size: 24px; }
.portal-form-card label { margin-top: 12px; }
.portal-submit { width: 100%; margin-top: 18px; }
.portal-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.access-request, .approval-access {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 2px;
  padding: 0;
  border: 0;
}
.access-request legend, .approval-access legend {
  width: 100%;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}
.check-option {
  display: flex !important;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  margin: 0 !important;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c0f12;
  cursor: pointer;
}
.check-option input { width: 17px; height: 17px; margin: 0; accent-color: #aeb7be; }
.check-option span { color: #e6e9eb; font-size: 13px; }
.form-note, .portal-hint { margin: 10px 0 0; color: #7f878e; font-size: 11px; line-height: 1.5; }
.workspace-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 24px; }
.workspace-chips span {
  padding: 7px 10px;
  border: 1px solid #354139;
  border-radius: 20px;
  background: #101b15;
  color: #c2dfce;
  font-size: 12px;
}
.portal-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.portal-actions form { margin: 0; }
.account-shell {
  display: grid;
  gap: 18px;
  width: min(100%, 1120px);
  margin: 22px auto 0;
}
.account-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: end;
  padding: 34px 36px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(76, 110, 92, .18), transparent 48%),
    linear-gradient(145deg, rgba(26,31,36,.98), rgba(11,14,16,.99));
  box-shadow: 0 30px 80px rgba(0,0,0,.28);
  position: relative;
  overflow: hidden;
}
.account-hero::after {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.05), transparent 68%);
  pointer-events: none;
}
.account-hero-copy { position: relative; z-index: 1; }
.account-hero h1 { margin: 7px 0 12px; font-size: clamp(34px, 4.2vw, 52px); letter-spacing: -.02em; }
.account-lead {
  max-width: 640px;
  margin: 0;
  color: #a8b0b7;
  line-height: 1.65;
  font-size: 14.5px;
}
.account-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: end;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(24,28,32,.96), rgba(12,15,17,.98));
  box-shadow: 0 30px 80px rgba(0,0,0,.24);
}
.account-heading h1 { margin: 7px 0 10px; font-size: clamp(32px, 4vw, 48px); }
.account-heading > div:first-child > p:last-child {
  max-width: 720px;
  margin: 0;
  color: #a8b0b7;
  line-height: 1.65;
}
.account-download {
  display: grid;
  gap: 10px;
  min-width: 250px;
  position: relative;
  z-index: 1;
}
.account-version,
.account-download span { color: var(--muted); font-size: 11px; text-align: center; letter-spacing: .04em; }
.account-download .button { width: 100%; min-height: 44px; }
.account-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 4px 0;
}
.account-section-heading h2 { margin: 5px 0 0; font-size: 25px; }
.account-section-heading > span {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #cbd1d5;
  font-size: 13px;
}
.account-workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.account-workspace-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111518;
}
.account-workspace-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.account-workspace-title span { color: #7f8991; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.account-workspace-title h3 { margin: 5px 0 0; font-size: 22px; }
.account-workspace-title strong {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid #354139;
  border-radius: 16px;
  background: #101b15;
  color: #c2dfce;
  font-size: 11px;
}
.account-permissions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.account-permissions span {
  padding: 5px 8px;
  border: 1px solid #343c42;
  border-radius: 6px;
  background: #0c0f12;
  color: #b7bec4;
  font-size: 11px;
}
.account-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #0e1114;
}
.account-footer p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.request-grid { display: grid; gap: 12px; }
.request-card { padding: 18px; border: 1px solid var(--line-soft); border-radius: 10px; background: #0f1215; }
.request-head { display: flex; justify-content: space-between; gap: 20px; }
.request-head h3 { margin: 0 0 4px; font-size: 18px; }
.request-head strong { color: #b7c0c7; font-size: 13px; }
.request-head time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.request-contacts { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: 12px; }
.request-access { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.message-warning { border-color: #665b35; background: #211d12; color: #e2d39c; }
.request-comment { margin: 14px 0 0; padding: 11px 12px; border-left: 2px solid #515a61; background: #121619; color: #c6cbd0; }
.approval-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.3fr);
  gap: 10px;
  align-items: end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.approval-access { margin: 0; }
.approval-note { grid-column: 1 / 3; }
.activation-shell { display: grid; place-items: center; min-height: calc(100vh - 190px); }
.activation-card {
  width: min(100%, 620px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(24,28,32,.98), rgba(12,15,17,.99));
  box-shadow: 0 30px 80px rgba(0,0,0,.32);
}
.activation-card h1 { margin: 8px 0 12px; font-size: 32px; }
.activation-form { margin-top: 22px; }
.activation-form label { margin-top: 13px; }
.totp-steps { padding-left: 1.2rem; margin: 0 0 1rem; }
.totp-qr-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 6px 0 18px;
  padding: 18px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(160deg, rgba(36, 46, 42, .35), transparent 55%),
    rgba(10, 12, 14, .92);
}
.totp-qr-frame {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #3a444c;
  background: #f4f5f7;
  box-shadow: inset 0 0 0 1px rgba(18, 21, 24, .06);
}
.totp-qr-image {
  display: block;
  width: 220px;
  height: 220px;
  image-rendering: pixelated;
}
.totp-qr-caption {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .02em;
  text-align: center;
}
.totp-manual {
  margin: 0 0 4px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(8, 10, 12, .55);
  padding: 0 14px 2px;
}
.totp-manual summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 0;
  color: var(--accent);
  font-size: 13px;
  user-select: none;
}
.totp-manual summary::-webkit-details-marker { display: none; }
.totp-manual summary::before {
  content: "▸";
  display: inline-block;
  width: 1.1em;
  color: #7f878e;
  transition: transform .15s ease;
}
.totp-manual[open] summary::before { transform: rotate(90deg); }
.totp-manual .form-note { margin-top: 0; }
.totp-secret {
  margin: 8px 0 14px;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 14px;
  letter-spacing: .04em;
  word-break: break-all;
  user-select: all;
}
.download-client { margin: 22px 8px 0 0; }
.reject-form { display: flex; justify-content: flex-end; gap: 8px; margin-top: 9px; }
.reject-form input { max-width: 360px; }

@media (max-width: 1000px) {
  .updates-top-grid { grid-template-columns: 1fr; }
  .release-form, .feedback-review { grid-template-columns: 1fr; }
  .release-notes { grid-column: 1; }
  .module-options { grid-template-columns: 1fr 1fr; }
  .create-user-grid { grid-template-columns: 1fr 1fr; }
  .create-user-grid button { width: 100%; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .workspace-grid, .user-grid, .correction-grid, .catalog-columns { grid-template-columns: 1fr; }
  .result-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-arrow { display: none; }
  .comparison-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-hero, .portal-forms { grid-template-columns: 1fr; }
  .portal-intro { padding-top: 10px; }
  .account-workspace-grid { grid-template-columns: 1fr; }
  .approval-form { grid-template-columns: 1fr 1fr; }
  .approval-note { grid-column: 1 / 3; }
}

@media (max-width: 620px) {
  .module-options { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  header, .site-header { height: auto; min-height: 68px; padding: 10px 18px; }
  .brand img { width: 138px; height: 40px; }
  .brand span { display: none; }
  .site-nav { gap: 4px; }
  .nav-link { height: 30px; padding: 0 9px; font-size: 11.5px; }
  main { width: min(100% - 28px, 1280px); padding: 24px 0 48px; }
  .card { padding: 16px; }
  .create-user-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr; }
  .user-card-actions, .password-form { align-items: stretch; flex-direction: column; }
  .password-form input { width: 100%; }
  .correction-card dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  nav { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
  .public-portal main { width: min(100% - 24px, 1440px); }
  .portal-panel, .portal-form-card, .account-card { padding: 14px; }
  .account-heading, .account-hero { grid-template-columns: 1fr; padding: 22px; }
  .account-download { min-width: 0; }
  .account-footer { align-items: stretch; flex-direction: column; }
  .portal-two, .approval-form { grid-template-columns: 1fr; }
  .approval-note { grid-column: 1; }
  .access-request, .approval-access { flex-direction: column; }
  .reject-form { flex-direction: column; }
  .reject-form input { max-width: none; }
  .delete-confirmation form { grid-template-columns: 1fr; }
  .delete-confirmation label { grid-column: 1; }
  .delete-actions button { width: 100%; }
  .compare-direction { grid-template-columns: 1fr; }
  .direction-mark { transform: rotate(90deg); }
  .comparison-summary { grid-template-columns: 1fr; }
  .result-details { grid-template-columns: 1fr; }
  .result-times { text-align: left; }
  .comparison-actions { width: 100%; justify-content: stretch; }
  .comparison-actions button { width: 100%; }
  .feedback-grid-compact { grid-template-columns: 1fr; }
}
.role-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.role-feature-grid-balanced .role-feature-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  min-height: 100%;
  padding: 20px;
  border-radius: 14px;
  background:
    linear-gradient(165deg, rgba(24,29,33,.98), rgba(13,16,18,.99));
  box-shadow: 0 14px 36px rgba(0,0,0,.18);
}
.role-feature-card-head h2 {
  margin: 6px 0 0;
  font-size: 22px;
  letter-spacing: -.01em;
}
.module-options-tiles {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  align-content: start;
}
.check-option-tile {
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #2f373e;
  border-radius: 10px;
  background: #0e1215;
  transition: border-color .15s ease, background .15s ease;
}
.check-option-tile:hover {
  border-color: #465159;
  background: #12171b;
}
.check-option-tile:has(input:checked) {
  border-color: #3d5346;
  background: #101914;
}
.check-option-tile span { font-size: 13px; font-weight: 600; }
.role-feature-save {
  width: 100%;
  margin-top: auto;
}
@media (max-width: 900px) {
  .role-feature-grid { grid-template-columns: 1fr; }
  .module-options-tiles { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .account-hero { grid-template-columns: 1fr; }
  .account-download { min-width: 0; }
}
