:root {
  color-scheme: dark;
  --bg: #070a0e;
  --panel: rgba(17, 22, 29, 0.88);
  --panel-strong: rgba(22, 29, 38, 0.96);
  --border: rgba(155, 171, 196, 0.22);
  --muted: #93a0af;
  --text: #eef3f7;
  --gold: #e1b847;
  --green: #69d28a;
  --red: #ff7c70;
  --cyan: #70cbd4;
  --shadow: 0 18px 70px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(112, 203, 212, 0.16), transparent 32rem),
    radial-gradient(circle at 82% 8%, rgba(225, 184, 71, 0.11), transparent 30rem),
    linear-gradient(140deg, #070a0e 0%, #111720 46%, #080b10 100%);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.hero,
.dashboard,
.admin-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(16, 21, 28, 0.94), rgba(9, 13, 18, 0.88));
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 430px);
  gap: 28px;
  align-items: end;
  padding: 30px;
}

.main-tabs {
  display: inline-flex;
  gap: 6px;
  margin-top: 18px;
  padding: 4px;
  border: 1px solid rgba(155, 171, 196, 0.16);
  border-radius: 8px;
  background: rgba(7, 10, 14, 0.48);
}

.main-tab {
  min-height: 34px;
  padding: 0 14px;
  color: #cfd9e5;
  border: 1px solid transparent;
  background: transparent;
}

.main-tab.active {
  color: #11161d;
  background: linear-gradient(180deg, #f4cf66, #d6a733);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

h2 {
  font-size: 22px;
}

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

.lead {
  max-width: 600px;
  margin: 16px 0 0;
  font-size: 16px;
}

.session-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(155, 171, 196, 0.18);
  border-radius: 8px;
  background: rgba(7, 10, 14, 0.5);
}

.session-title {
  margin: 0 0 4px;
  color: var(--text);
  font-weight: 800;
}

.session-subtitle,
.status-line {
  margin: 0;
  min-height: 22px;
  color: var(--muted);
}

.live-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  margin: -2px 0 0;
  padding: 4px 8px;
  border: 1px solid rgba(155, 171, 196, 0.16);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(155, 171, 196, 0.06);
  font-size: 12px;
  font-weight: 750;
}

.live-status::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.live-status.ok {
  color: var(--green);
}

.live-status.paused {
  color: var(--gold);
}

.live-status.error {
  color: var(--red);
}

.status-line {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.session-actions,
.button-row,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  color: #11161d;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #f4cf66, #d6a733);
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

button:disabled {
  color: #768292;
  background: #242b35;
  cursor: not-allowed;
}

.icon-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  color: #dce5ee;
  border: 1px solid rgba(155, 171, 196, 0.28);
  background: rgba(155, 171, 196, 0.08);
  font-size: 24px;
  line-height: 1;
}

.quiet-button {
  color: #dce5ee;
  border: 1px solid rgba(155, 171, 196, 0.28);
  background: rgba(155, 171, 196, 0.08);
}

.danger-button {
  color: #ffd7d3 !important;
  border-color: rgba(255, 124, 112, 0.42) !important;
  background: rgba(255, 124, 112, 0.1) !important;
}

.danger-button:hover {
  border-color: rgba(255, 124, 112, 0.72) !important;
  background: rgba(255, 124, 112, 0.18) !important;
}

.status-line.ok {
  color: var(--green);
}

.status-line.error {
  color: var(--red);
}

.toast-region {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 1px solid rgba(155, 171, 196, 0.2);
  border-left: 4px solid var(--cyan);
  border-radius: 8px;
  color: var(--text);
  background: rgba(15, 20, 27, 0.96);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  font-weight: 650;
  transform: translateY(0);
  opacity: 1;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.ok {
  border-left-color: var(--green);
}

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

.toast.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
}

.setup-dialog {
  width: min(620px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid rgba(155, 171, 196, 0.24);
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  box-shadow: var(--shadow);
}

.setup-dialog::backdrop {
  background: rgba(2, 5, 9, 0.72);
  backdrop-filter: blur(4px);
}

.setup-modal {
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  padding: 22px;
  background: linear-gradient(135deg, rgba(18, 24, 32, 0.98), rgba(7, 10, 14, 0.98));
}

.setup-modal-header,
.setup-modal-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.setup-steps {
  display: grid;
  gap: 10px;
  margin: 22px 0;
  padding: 0;
  counter-reset: setup-step;
  list-style: none;
}

.setup-steps li {
  position: relative;
  display: grid;
  gap: 3px;
  min-height: 56px;
  padding: 10px 12px 10px 54px;
  border: 1px solid rgba(155, 171, 196, 0.14);
  border-radius: 8px;
  background: rgba(7, 10, 14, 0.46);
  counter-increment: setup-step;
}

.setup-steps li::before {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #11161d;
  background: linear-gradient(180deg, #f4cf66, #d6a733);
  font-weight: 900;
  content: counter(setup-step);
}

.setup-steps strong {
  color: var(--text);
}

.setup-steps span {
  color: var(--muted);
  font-size: 13px;
}

.setup-steps code {
  color: var(--cyan);
  font: 0.95em ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.setup-modal-actions {
  justify-content: flex-end;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
  gap: 1px;
  margin-top: 14px;
  overflow: hidden;
}

.panel {
  min-width: 0;
  padding: 22px;
  background: var(--panel);
}

.notes-panel {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(155, 171, 196, 0.16);
  background: rgba(10, 14, 19, 0.82);
}

.products-panel {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(155, 171, 196, 0.16);
}

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

.product-access-card,
.product-access-empty {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(155, 171, 196, 0.18);
  border-radius: 10px;
  background: rgba(4, 8, 12, 0.48);
}

.product-security {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(155, 171, 196, 0.16);
  border-radius: 7px;
  background: rgba(7, 10, 14, 0.52);
}

.product-security > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.product-security span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.product-security strong {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-security[data-status="clean"] strong {
  color: var(--green);
}

.product-security[data-status="flagged"] strong,
.product-security[data-status="failed"] strong {
  color: var(--red);
}

.product-security[data-status="pending"] strong {
  color: var(--gold);
}

.product-security a {
  flex: 0 0 auto;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.product-security a:hover {
  text-decoration: underline;
}

.product-access-card.is-active {
  border-color: rgba(105, 210, 138, 0.3);
  box-shadow: inset 3px 0 0 rgba(105, 210, 138, 0.72);
}

.product-access-card.is-expired {
  border-color: rgba(225, 184, 71, 0.3);
  box-shadow: inset 3px 0 0 rgba(225, 184, 71, 0.62);
}

.product-access-card header,
.product-manager-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.product-access-card h3,
.grant-heading h3 {
  margin: 0;
  font-size: 20px;
}

.product-status {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(155, 171, 196, 0.1);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.product-status.ok {
  color: #baf3c9;
  background: rgba(105, 210, 138, 0.14);
}

.product-status.warn {
  color: #f2d47b;
  background: rgba(225, 184, 71, 0.13);
}

.product-expiry {
  display: grid;
  gap: 3px;
}

.product-expiry span,
.product-release-facts dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.product-release-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.product-release-facts dd {
  min-width: 0;
  margin: 3px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-release-message,
.product-access-empty span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.panel-heading strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 20px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid rgba(155, 171, 196, 0.1);
}

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

dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  white-space: normal;
}

.pill-ok,
.pill-bad,
.pill-warn {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.pill-ok {
  color: #092411;
  background: var(--green);
}

.pill-bad {
  color: #2c0805;
  background: var(--red);
}

.pill-warn {
  color: #241b03;
  background: var(--gold);
}

.download-button {
  width: 100%;
  margin-top: 18px;
}

.security-scan {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.security-scan::before {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.security-scan.ok {
  color: var(--green);
}

.security-scan.warn {
  color: var(--gold);
}

.security-scan a {
  color: inherit;
  font-weight: 800;
  text-decoration: none;
}

.security-scan a:hover {
  text-decoration: underline;
}

.security-scan span + span {
  color: var(--muted);
}

.security-scan .scan-hint {
  flex-basis: 100%;
  color: #b8c4d0;
  line-height: 1.4;
}

.release-notes,
pre {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  color: #c9d3df;
  font: 13px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace;
  white-space: pre-wrap;
}

.release-notes p {
  margin: 0 0 8px;
}

.release-notes a {
  color: var(--cyan);
}

.one-time-key-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  margin: 14px 0;
}

.one-time-key {
  min-width: 0;
  max-height: none;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(112, 203, 212, 0.34);
  border-radius: 6px;
  color: var(--cyan);
  background: rgba(2, 4, 8, 0.58);
  word-break: break-all;
}

.one-time-key-wrap button {
  min-height: auto;
}

.admin-panel {
  margin-top: 20px;
  padding: 24px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

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

.admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.summary-item {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid rgba(155, 171, 196, 0.14);
  border-radius: 8px;
  background: rgba(7, 10, 14, 0.46);
}

.summary-item strong {
  font-size: 22px;
  line-height: 1;
}

.summary-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.summary-item.ok strong {
  color: var(--green);
}

.summary-item.warn strong {
  color: var(--gold);
}

.summary-item.bad strong {
  color: var(--red);
}

.release-health {
  display: grid;
  grid-template-columns: minmax(160px, 0.85fr) minmax(0, 1.8fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(155, 171, 196, 0.14);
  border-radius: 8px;
  background: rgba(7, 10, 14, 0.45);
}

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

.admin-release-health .release-health {
  grid-template-columns: 1fr;
  margin: 0;
}

.release-health.ok {
  border-color: rgba(105, 221, 135, 0.18);
}

.release-health.warn {
  border-color: rgba(225, 184, 71, 0.24);
}

.release-health-title {
  display: grid;
  gap: 4px;
}

.release-health-title span,
.release-health-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.release-health-title strong {
  min-width: 0;
  overflow: hidden;
  color: #f2f6fb;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.release-health-facts dd {
  min-width: 0;
  margin: 2px 0 0;
  overflow: hidden;
  color: #dbe6f1;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-health-actions {
  display: flex;
  justify-content: flex-end;
}

.release-health-actions button {
  min-height: 34px;
  padding: 0 12px;
  color: #dce5ee;
  border: 1px solid rgba(155, 171, 196, 0.24);
  background: rgba(155, 171, 196, 0.09);
}

.grant-form {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(155, 171, 196, 0.14);
  border-radius: 8px;
  background: rgba(7, 10, 14, 0.45);
}

.grant-heading,
.grant-actions {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.grant-heading p,
.grant-actions p {
  margin: 0;
}

.grant-identity {
  display: grid;
  grid-template-columns: 1fr 1.15fr 100px 1fr;
  gap: 12px;
}

.grant-products,
.pending-products,
.product-manager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grant-product,
.pending-product,
.product-manager-card {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(155, 171, 196, 0.16);
  border-radius: 9px;
  background: rgba(3, 7, 11, 0.42);
  opacity: 0.62;
  transition: border-color 150ms ease, opacity 150ms ease, background 150ms ease;
}

.grant-product.is-selected,
.pending-product.is-selected,
.product-manager-card {
  opacity: 1;
}

.grant-product.is-selected,
.pending-product.is-selected {
  border-color: rgba(112, 203, 212, 0.38);
  background: rgba(112, 203, 212, 0.06);
}

.product-toggle,
.lifetime-toggle {
  display: flex !important;
  grid-template-columns: none !important;
  gap: 9px !important;
  align-items: center;
}

.product-toggle input,
.lifetime-toggle input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 0;
}

.product-toggle span {
  display: grid;
  gap: 2px;
}

.product-toggle small,
.duration-field small {
  color: var(--muted);
  font-weight: 500;
}

.duration-field > span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.grant-actions button {
  min-width: 190px;
}

.grant-form label {
  display: grid;
  gap: 6px;
  color: #cdd7e1;
  font-weight: 650;
}

fieldset.wide-field,
.admin-edit fieldset {
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid rgba(155, 171, 196, 0.24);
  border-radius: 8px;
}

fieldset.wide-field label,
.admin-edit fieldset label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.wide-field {
  grid-column: span 2;
}

input,
select {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  color: var(--text);
  border: 1px solid rgba(155, 171, 196, 0.3);
  border-radius: 6px;
  background: rgba(2, 4, 8, 0.7);
  outline: none;
}

input:focus {
  border-color: rgba(112, 203, 212, 0.78);
  box-shadow: 0 0 0 3px rgba(112, 203, 212, 0.16);
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-top: 18px;
}

.filter-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(155, 171, 196, 0.16);
  border-radius: 8px;
  background: rgba(7, 10, 14, 0.42);
}

.filter-tab {
  min-height: 34px;
  padding: 0 12px;
  color: #cfd9e5;
  border: 1px solid transparent;
  background: transparent;
}

.filter-tab.active {
  color: #11161d;
  background: linear-gradient(180deg, #f4cf66, #d6a733);
}

.search-field {
  display: grid;
  gap: 6px;
  width: min(320px, 100%);
  color: #cdd7e1;
  font-weight: 650;
}

.search-field span {
  font-size: 13px;
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-pagination {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.admin-pagination button {
  min-height: 34px;
  padding: 0 12px;
  color: #dce5ee;
  border: 1px solid rgba(155, 171, 196, 0.24);
  background: rgba(155, 171, 196, 0.09);
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr) minmax(360px, 1.25fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px;
  border: 1px solid rgba(155, 171, 196, 0.14);
  border-radius: 8px;
  background: rgba(7, 10, 14, 0.42);
}

.admin-row.is-revoked {
  opacity: 0.68;
}

.admin-row.is-pending {
  border-color: rgba(225, 184, 71, 0.22);
  background: rgba(18, 16, 9, 0.36);
}

.admin-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.admin-main strong,
.admin-main span,
.admin-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-main span {
  color: var(--muted);
  font-size: 13px;
}

.admin-note {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #d0b96b;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-badge {
  display: inline-flex;
  width: fit-content;
  padding: 2px 7px;
  border: 1px solid rgba(155, 171, 196, 0.2);
  border-radius: 999px;
  color: #cfd9e5;
  background: rgba(155, 171, 196, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.admin-badge.ok {
  color: #092411;
  border-color: transparent;
  background: var(--green);
}

.admin-badge.warn {
  color: #241b03;
  border-color: transparent;
  background: var(--gold);
}

.admin-badge.bad {
  color: #2c0805;
  border-color: transparent;
  background: var(--red);
}

.admin-badge.ok-soft {
  color: #baf3c9;
  border-color: rgba(105, 210, 138, 0.25);
  background: rgba(105, 210, 138, 0.1);
}

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

.admin-meta div {
  min-width: 0;
}

.admin-meta dt {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.admin-meta dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #dbe6f1;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-actions button {
  min-height: 34px;
  padding: 0 11px;
  color: #dce5ee;
  border: 1px solid rgba(155, 171, 196, 0.24);
  background: rgba(155, 171, 196, 0.09);
}

.pending-grant {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(4, auto);
  gap: 8px;
  align-items: center;
}

.pending-grant button {
  min-height: 34px;
  padding: 0 11px;
  color: #dce5ee;
  border: 1px solid rgba(155, 171, 196, 0.24);
  background: rgba(155, 171, 196, 0.09);
}

.admin-edit {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(180px, 1fr) 100px minmax(220px, 1fr);
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(112, 203, 212, 0.18);
  border-radius: 8px;
  background: rgba(2, 4, 8, 0.34);
}

.product-manager,
.pending-products {
  grid-column: 1 / -1;
}

.product-manager-card.is-active {
  border-color: rgba(105, 210, 138, 0.24);
}

.product-manager-card.is-expired {
  border-color: rgba(225, 184, 71, 0.28);
}

.product-manager-card.is-missing {
  border-style: dashed;
}

.product-manager-card header div {
  display: grid;
  gap: 3px;
}

.product-manager-card header span:not(.product-status) {
  color: var(--muted);
  font-size: 12px;
}

.product-manager-fields {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto minmax(130px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.product-manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-manager-fields button,
.product-manager-actions button {
  min-height: 38px;
  padding: 0 11px;
  color: #dce5ee;
  border: 1px solid rgba(155, 171, 196, 0.24);
  background: rgba(155, 171, 196, 0.09);
}

.admin-edit label {
  display: grid;
  gap: 6px;
  color: #cdd7e1;
  font-size: 13px;
  font-weight: 700;
}

.admin-edit .edit-note {
  grid-column: span 2;
}

.admin-edit-actions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 8px;
}

.admin-edit-actions button {
  min-height: 34px;
  color: #dce5ee;
  border: 1px solid rgba(155, 171, 196, 0.24);
  background: rgba(155, 171, 196, 0.09);
}

.admin-detail {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 6px;
}

.admin-detail section {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(155, 171, 196, 0.12);
  border-radius: 8px;
  background: rgba(7, 10, 14, 0.38);
}

.admin-detail h3 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
}

.admin-detail ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-detail li {
  min-width: 0;
  overflow: hidden;
  color: #cbd5df;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  margin: 0;
  padding: 22px;
  border: 1px dashed rgba(155, 171, 196, 0.22);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin: 20px 0 0;
  color: rgba(147, 160, 175, 0.82);
  font-size: 12px;
  font-weight: 650;
}

.site-footer span + span::before {
  margin-right: 14px;
  color: rgba(147, 160, 175, 0.42);
  content: "/";
}

@media (max-width: 900px) {
  .shell {
    width: min(100vw - 20px, 680px);
    padding: 20px 0;
  }

  .hero,
  .dashboard,
  .grant-form,
  .grant-identity,
  .grant-products,
  .pending-products,
  .product-manager,
  .product-manager-fields,
  .product-access-grid,
  .product-release-facts,
  .admin-release-health,
  .release-health,
  .release-health-facts,
  .admin-row,
  .admin-meta,
  .admin-edit,
  .pending-grant,
  .admin-detail,
  .one-time-key-wrap {
    grid-template-columns: 1fr;
  }

  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .main-tabs {
    display: flex;
  }

  .search-field {
    width: 100%;
  }

  .wide-field {
    grid-column: auto;
  }

  .admin-edit .edit-note {
    grid-column: auto;
  }

  .panel-heading {
    display: block;
  }

  .panel-heading strong {
    display: block;
    margin-top: 4px;
    text-align: left;
  }

  .setup-dialog {
    width: calc(100vw - 20px);
  }
}

@media (max-width: 420px) {
  .shell {
    width: calc(100vw - 14px);
  }

  .hero,
  .panel,
  .admin-panel {
    padding: 16px;
  }

  h1 {
    font-size: 32px;
  }

  .facts div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .setup-modal {
    padding: 16px;
  }

  .setup-steps li {
    padding-right: 10px;
  }
}
