:root {
  color-scheme: light;
  --ink: #17201d;
  --ink-strong: #0f1714;
  --muted: #66726d;
  --muted-light: #89938f;
  --line: #dce3df;
  --line-strong: #c7d1cc;
  --surface: #ffffff;
  --surface-subtle: #f7f9f8;
  --canvas: #f2f5f3;
  --accent: #187b59;
  --accent-dark: #0d6044;
  --accent-soft: #e8f4ef;
  --danger: #b42332;
  --danger-soft: #fff0f1;
  --warning: #805b0b;
  --warning-soft: #fff3cf;
  --radius: 8px;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button,
a,
input { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(24, 123, 89, 0.2);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.topbar-inner {
  width: 100%;
  max-width: 1464px;
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 750;
  text-decoration: none;
}

.brand-mark,
.product-mark {
  display: grid;
  place-items: center;
  color: #ffffff;
  border: 1px solid #343438;
  background: #171719;
  box-shadow: none;
  font-weight: 800;
  line-height: 1;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  font-size: 18px;
}

.topbar nav {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar nav a,
.link-button {
  position: relative;
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  border: 0;
  background: transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.topbar nav a::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  background: transparent;
}

.topbar nav a:hover,
.link-button:hover { color: var(--ink-strong); }

.topbar nav a.is-active { color: var(--ink-strong); }
.topbar nav a.is-active::after { background: var(--accent); }
.topbar form { margin: 0 0 0 4px; }

.page {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 38px 32px 72px;
}

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

h1 {
  margin-bottom: 7px;
  color: var(--ink-strong);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  color: var(--ink-strong);
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: 0;
}

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

.page-heading {
  min-height: 78px;
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.page-heading.compact {
  min-height: auto;
  align-items: center;
}

.metrics {
  min-width: 380px;
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  border-left: 1px solid var(--line-strong);
}

.metrics span {
  padding: 2px 20px;
  color: var(--muted);
}

.metrics strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-strong);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.workspace {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.create-panel,
.settings-panel,
.table-region,
.device-panel,
.license-key-panel,
.account-panel,
.audit-region {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.create-panel,
.settings-panel { padding: 22px; }

.table-region,
.device-panel,
.license-key-panel,
.account-panel,
.audit-region { overflow: hidden; }

.section-heading,
.panel-heading {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.section-heading { padding: 0 18px; }
.panel-heading { min-height: auto; margin: -2px 0 20px; padding-bottom: 17px; }
.section-heading h2,
.panel-heading h2 { margin: 0; }
.section-heading span { color: var(--muted); }

.stack-form { display: grid; gap: 16px; }

.stack-form label {
  display: grid;
  gap: 7px;
  color: #3f4945;
  font-weight: 650;
}

input {
  width: 100%;
  height: 42px;
  padding: 8px 11px;
  color: var(--ink-strong);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

input::placeholder { color: #77827d; }

input:hover { border-color: #9eaaa4; }

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24, 123, 89, 0.12);
}

button {
  min-height: 40px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 120ms ease;
}

button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.primary {
  padding: 9px 15px;
  color: #ffffff;
  border: 1px solid var(--accent);
  background: var(--accent);
  font-weight: 750;
}

.primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  min-height: 50px;
  padding: 13px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:not(:has(.empty)):hover { background: #fbfcfb; }

th {
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 12px;
  font-weight: 750;
}

td:first-child { white-space: normal; }

.key-link,
.action-link,
.back-link {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.key-link:hover,
.action-link:hover,
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.subtext {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.status {
  min-height: 25px;
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.status.active { color: #075c41; background: #dff5eb; }
.status.pending { color: var(--warning); background: var(--warning-soft); }
.status.expired,
.status.disabled { color: #8e1d2a; background: #ffe4e7; }

.feature-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 190px;
}

.feature-chip {
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.feature-chip.is-on {
  color: #176348;
  border-color: #b9dfce;
  background: #edf9f3;
}

.feature-chip.is-off {
  color: #7e1d29;
  border-color: #efbec4;
  background: #fff1f2;
}

.empty {
  height: 158px;
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-strong { color: #59655f; font-weight: 650; }

.created-section {
  margin-bottom: 28px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  border: 1px solid #bfded1;
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.created-section h2 { margin-bottom: 4px; }
.created-section p { margin-bottom: 0; }

.created-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.created-key {
  padding: 9px 11px;
  border: 1px solid #b7d8ca;
  border-radius: 6px;
  background: var(--surface);
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.alert {
  margin-bottom: 22px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.alert.success {
  color: #075c41;
  border-color: #afd8c7;
  background: var(--accent-soft);
}

.alert.error {
  color: #7e1d29;
  border-color: #efbec4;
  background: var(--danger-soft);
}

.page.license-detail-page {
  max-width: none;
  padding: 0;
  background: #eef2ef;
}

.detail-hero {
  color: #ffffff;
  background: #111a16;
}

.detail-hero-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 32px 0;
}

.detail-overview {
  min-height: 126px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.detail-title { min-width: 0; }

.detail-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.detail-title-row h1 {
  margin: 0;
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 38px;
  font-weight: 720;
}

.detail-title p {
  max-width: 70ch;
  margin: 12px 0 0;
  color: #9eada6;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.detail-hero .back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: #8ed6b8;
  font-size: 13px;
}

.detail-hero .status.active { color: #bff2dd; background: #174c3a; }
.detail-hero .status.pending { color: #ffe8a3; background: #4f4119; }
.detail-hero .status.expired,
.detail-hero .status.disabled { color: #ffc4ca; background: #54262d; }

.detail-summary {
  margin: 30px 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #34423c;
}

.detail-summary div {
  min-width: 0;
  padding: 22px 24px 24px;
  border-left: 1px solid #34423c;
}

.detail-summary div:first-child {
  padding-left: 0;
  border-left: 0;
}

.detail-summary dt {
  margin-bottom: 7px;
  color: #8f9f98;
  font-size: 12px;
  font-weight: 650;
}

.detail-summary dd {
  margin: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.detail-content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 32px 72px;
}

.license-key-panel { margin-bottom: 24px; }

.secret-disclosure { padding: 0 22px 22px; }

.secret-disclosure summary {
  width: max-content;
  min-height: 42px;
  padding-top: 12px;
  color: var(--accent-dark);
  font-weight: 750;
  cursor: pointer;
}

.secret-disclosure summary:focus-visible {
  outline: 3px solid rgba(24, 123, 89, 0.2);
  outline-offset: 2px;
}

.secret-content {
  margin-top: 8px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}

.secret-content code {
  display: block;
  color: var(--ink-strong);
  font: 700 20px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
  user-select: all;
}

.secret-content p,
.legacy-key-copy > p {
  margin: 8px 0 0;
  font-size: 12px;
}

.legacy-key-copy { padding: 20px 22px 22px; }
.legacy-key-copy > p { max-width: 90ch; margin-top: 0; }

.legacy-key-form {
  max-width: 760px;
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.legacy-key-form label {
  display: grid;
  gap: 7px;
  color: #3f4945;
  font-weight: 650;
}

.inline-error {
  margin: 20px 22px 22px;
  padding: 12px 14px;
  color: #7e1d29;
  border: 1px solid #efbec4;
  border-radius: 6px;
  background: var(--danger-soft);
}

.detail-workspace {
  display: grid;
  grid-template-columns: minmax(350px, 0.76fr) minmax(0, 1.74fr);
  gap: 24px;
  align-items: start;
}

.detail-settings {
  padding: 0;
  overflow: hidden;
}

.detail-settings .panel-heading {
  min-height: 68px;
  margin: 0;
  padding: 0 24px;
}

.password-control {
  margin: 0 24px;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.password-control-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.password-control-copy strong { font-size: 14px; }
.password-control-copy span { color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.password-control-copy small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.password-control form { flex: 0 0 auto; }

.settings-form {
  gap: 20px;
  padding: 24px;
}

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

.toggle-row {
  min-height: 70px;
  padding: 4px 0 18px;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 20px !important;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.feature-flags {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line, #e5e7eb);
}

.feature-selection {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}

.feature-options {
  margin-top: 4px;
  border-top: 1px solid var(--line, #e5e7eb);
  border-bottom: 1px solid var(--line, #e5e7eb);
}

.feature-options > summary {
  min-height: 52px;
  padding: 6px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink-strong);
  cursor: pointer;
  list-style: none;
}

.feature-options > summary::-webkit-details-marker { display: none; }

.feature-options > summary:focus-visible {
  outline: 3px solid rgba(49, 94, 251, 0.16);
  outline-offset: 3px;
}

.feature-options-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.feature-options-copy strong { font-size: 13px; }
.feature-options-copy small { color: var(--muted); font-size: 11px; font-weight: 500; }

.feature-options-action {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.feature-options[open] .feature-options-action { color: var(--muted); }
.feature-options-content { padding: 4px 0 12px; }

.feature-options .feature-selection {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 0;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.feature-options .toggle-row {
  min-height: 58px;
  padding: 8px 8px 10px 0;
}

.form-section-label {
  margin: 0 0 2px;
  color: var(--muted, #6b7280);
  font-size: 12px;
  font-weight: 700;
}

.toggle-copy { display: grid; gap: 2px; }
.toggle-copy strong { color: var(--ink-strong); }
.toggle-copy small { color: var(--muted); font-size: 12px; font-weight: 450; }

.switch-control {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
}

.switch-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  border: 1px solid #aeb8b3;
  border-radius: 999px;
  background: #cbd3cf;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(15, 23, 20, 0.2);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.switch-control input:checked + .switch-track {
  border-color: var(--accent);
  background: var(--accent);
}

.switch-control input:checked + .switch-track::after { transform: translateX(18px); }
.switch-control input:focus-visible + .switch-track { outline: 3px solid rgba(24, 123, 89, 0.2); outline-offset: 2px; }

.danger-link {
  min-height: 36px;
  padding: 0 9px;
  color: var(--danger);
  border: 1px solid transparent;
  background: transparent;
  font-weight: 700;
}

.danger-link:hover {
  border-color: #efbec4;
  background: var(--danger-soft);
}

.danger-link:disabled {
  color: var(--muted-light);
  border-color: transparent;
  background: transparent;
}

.detail-devices .section-heading { min-height: 68px; padding: 0 22px; }

.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-title h2 { margin: 0; }
.section-title span { color: var(--muted); font-size: 12px; font-weight: 650; }
.device-table { min-height: 286px; }
.device-table table { min-width: 680px; }

.device-empty {
  min-height: 286px;
  display: grid;
  place-content: center;
  gap: 5px;
  color: var(--muted);
  text-align: center;
}

.device-empty strong { color: #4f5b56; font-weight: 650; }
.device-empty span { font-size: 12px; font-variant-numeric: tabular-nums; }

.account-panel { margin-top: 24px; }
.account-panel .section-heading { min-height: 68px; padding: 0 22px; }
.account-table { min-height: 160px; }
.account-table table { min-width: 760px; }

.audit-feed {
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.audit-list { display: grid; }

.audit-item {
  min-height: 68px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 190px 170px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.audit-item:last-child { border-bottom: 0; }
.audit-item time { color: var(--muted); font-variant-numeric: tabular-nums; }
.audit-item p { margin: 0; color: var(--ink); }

.audit-action {
  justify-self: start;
  padding: 3px 6px;
  border-radius: 4px;
  color: #3d4944;
  background: #edf1ef;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.audit-empty {
  padding: 52px 20px;
  color: var(--muted);
  text-align: center;
}

.narrow-page { max-width: 560px; margin: 0 auto; }

.login-page {
  max-width: none;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0;
}

.login-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(390px, 0.86fr) minmax(520px, 1.14fr);
  background: var(--surface);
}

.login-brand-panel {
  min-height: 100%;
  padding: 46px clamp(42px, 5vw, 88px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #ffffff;
  background: #111a16;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  align-self: flex-start;
  color: #ffffff;
  font-size: 17px;
  font-weight: 750;
  text-decoration: none;
}

.product-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  box-shadow: none;
  font-size: 23px;
}

.login-brand-copy { max-width: 510px; }

.brand-rule {
  width: 72px;
  height: 3px;
  margin-bottom: 30px;
  background: #43b98a;
}

.login-brand-title {
  margin-bottom: 18px;
  color: #ffffff;
  font-size: clamp(38px, 4vw, 62px);
  font-weight: 720;
  line-height: 1.16;
  letter-spacing: 0;
}

.login-brand-copy > p:last-child {
  margin: 0;
  color: #aebdb6;
  font-size: 16px;
}

.login-brand-footer {
  margin: 0;
  color: #81928a;
  font-size: 12px;
}

.login-form-panel {
  min-height: 100%;
  padding: 48px clamp(32px, 8vw, 120px);
  display: grid;
  place-items: center;
  background: var(--surface);
}

.login-form-content { width: min(100%, 420px); }

.login-mobile-brand {
  display: none;
  align-items: center;
  gap: 11px;
  margin-bottom: 50px;
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 750;
}

.login-heading { margin-bottom: 34px; }

.login-heading h1 {
  margin-bottom: 9px;
  font-size: 34px;
  line-height: 1.18;
}

.login-heading p { margin: 0; font-size: 15px; }
.login-form { gap: 20px; }
.login-form label { gap: 8px; }
.login-form input { height: 46px; }
.login-submit { min-height: 46px; margin-top: 6px; }

@media (max-width: 980px) {
  .page { padding: 30px 22px 60px; }
  .topbar-inner { padding: 0 22px; }
  .workspace,
  .detail-workspace { grid-template-columns: 1fr; }
  .create-panel { max-width: none; }
  .detail-hero-inner,
  .detail-content { padding-right: 22px; padding-left: 22px; }
  .login-shell { grid-template-columns: minmax(330px, 0.8fr) minmax(450px, 1.2fr); }
}

@media (max-width: 760px) {
  .login-shell { display: block; }
  .login-brand-panel { display: none; }
  .page.login-page { padding: 0; }
  .login-form-panel {
    min-height: 100vh;
    min-height: 100svh;
    padding: 110px 24px 48px;
    place-items: start center;
  }
  .login-mobile-brand { display: flex; }
  .page-heading { display: block; }
  .metrics {
    min-width: 0;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }
  .metrics span { padding: 0 12px; }
  .metrics span:first-child { padding-left: 0; }
  .created-section { grid-template-columns: 1fr; }
  .detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-summary div:nth-child(3) {
    padding-left: 0;
    border-top: 1px solid #34423c;
    border-left: 0;
  }
  .detail-summary div:nth-child(4) { border-top: 1px solid #34423c; }
}

@media (max-width: 620px) {
  .topbar-inner { padding: 0 14px; gap: 14px; }
  .brand > span:last-child { display: none; }
  .topbar nav { gap: 0; }
  .topbar nav a,
  .link-button { padding: 0 8px; font-size: 13px; }
  .topbar nav a::after { right: 8px; left: 8px; }
  .topbar form { margin-left: 0; }
  .page { padding: 24px 14px 48px; }
  .detail-hero-inner { padding: 30px 14px 0; }
  .detail-overview { min-height: 112px; }
  .detail-title-row { align-items: flex-start; }
  .detail-title-row h1 { width: 100%; font-size: 29px; overflow-wrap: anywhere; }
  .detail-title p { margin-top: 9px; }
  .detail-summary { margin-top: 24px; }
  .detail-summary div {
    min-width: 0;
    padding: 15px 12px 17px;
  }
  .detail-summary div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .detail-summary dd { font-size: 14px; }
  .detail-content { padding: 18px 14px 48px; }
  .detail-workspace { gap: 16px; }
  .license-key-panel { margin-bottom: 16px; }
  .account-panel { margin-top: 16px; }
  .legacy-key-form { grid-template-columns: 1fr; }
  .detail-settings .panel-heading { padding: 0 20px; }
  .password-control { margin: 0 20px; align-items: flex-start; flex-direction: column; }
  .settings-form { padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .section-heading { padding: 0 14px; }
  .audit-feed { margin-top: 16px; }
  .device-empty { min-height: 220px; }
  .audit-item {
    padding: 16px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
  }
  .audit-item p { grid-column: 1 / -1; }
  th,
  td { padding: 12px 14px; }
  .login-form-panel { padding: 84px 20px 40px; }
  .login-mobile-brand { margin-bottom: 44px; }
  .login-heading h1 { font-size: 30px; }
}

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

/* Operations console refresh: compact data density with clear status hierarchy. */
:root {
  --ink: #202938;
  --ink-strong: #111827;
  --muted: #667085;
  --muted-light: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #cfd5df;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --canvas: #f3f5f8;
  --accent: #315efb;
  --accent-dark: #2447c7;
  --accent-soft: #eef2ff;
  --danger: #c4324b;
  --danger-soft: #fff1f3;
  --warning: #986b16;
  --warning-soft: #fff8e5;
}

body { background: var(--canvas); color: var(--ink); }
.topbar { height: 62px; border-bottom-color: #dde2ea; }
.topbar-inner { max-width: 1520px; padding: 0 36px; }
.brand { gap: 10px; font-size: 15px; letter-spacing: 0; }
.brand-mark { width: 30px; height: 30px; border-color: #111827; background: #111827; box-shadow: none; font-size: 17px; }
.topbar nav a.is-active::after { background: var(--accent); }
.topbar nav a:hover, .link-button:hover { color: var(--ink-strong); }
.page { max-width: 1520px; padding: 40px 36px 72px; }
h1 { font-size: 30px; font-weight: 750; }
h2 { font-size: 16px; font-weight: 750; }
p { color: var(--muted); }

.dashboard-heading { min-height: 70px; margin-bottom: 26px; align-items: center; }
.dashboard-heading h1 { margin-bottom: 6px; }
.dashboard-heading p:last-child { margin-bottom: 0; font-size: 14px; }
.dashboard-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #2fbd78; box-shadow: 0 0 0 3px #ddf7eb; }
.meta-divider { width: 1px; height: 17px; background: var(--line-strong); }

.overview-grid { margin-bottom: 22px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.overview-card { min-width: 0; min-height: 132px; padding: 18px 18px 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.overview-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.overview-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.overview-card > strong { display: block; margin-top: 16px; color: var(--ink-strong); font-size: 28px; line-height: 1; font-weight: 760; font-variant-numeric: tabular-nums; }
.overview-note { display: block; margin-top: 11px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.overview-primary { border-color: #263a94; background: #1d2d70; }
.overview-primary .overview-label, .overview-primary .overview-note { color: #cbd5ff; }
.overview-primary > strong { color: #ffffff; }
.overview-symbol { width: 9px; height: 9px; border: 2px solid #91a6ff; border-radius: 50%; }
.overview-dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-green { background: #32bd7b; }
.dot-yellow { background: #e7ae3c; }
.dot-blue { background: #5d8df7; }
.dot-violet { background: #9271e8; }

.operations-strip { min-height: 74px; margin-bottom: 18px; padding: 12px 16px; display: flex; align-items: center; gap: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.operations-intro { min-width: 126px; display: grid; gap: 2px; }
.operations-intro strong { color: var(--ink-strong); font-size: 13px; }
.operations-intro span { color: var(--muted); font-size: 11px; }
.quick-filters { min-width: 0; display: flex; flex: 1; align-items: center; gap: 4px; overflow-x: auto; }
.quick-filter { min-height: 46px; padding: 5px 15px; display: inline-flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid transparent; border-radius: 6px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.quick-filter:hover { color: var(--ink-strong); background: var(--surface-subtle); }
.quick-filter.is-active { color: var(--accent-dark); border-color: #cbd5ff; background: var(--accent-soft); }
.quick-filter strong { color: var(--ink-strong); font-size: 14px; font-variant-numeric: tabular-nums; }
.quick-filter.is-active strong { color: var(--accent-dark); }

.workspace { grid-template-columns: minmax(286px, 320px) minmax(0, 1fr); gap: 18px; }
.create-panel, .settings-panel, .table-region, .device-panel, .license-key-panel, .account-panel, .audit-region { border-color: var(--line); border-radius: 8px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.02); }
.create-panel { position: sticky; top: 80px; padding: 21px; }
.panel-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-title-row h2 { margin-bottom: 0; }
.panel-index { color: #98a2b3; font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.panel-description { margin: 9px 0 21px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.create-panel .stack-form { gap: 13px; }
.create-panel .stack-form label { gap: 6px; font-size: 13px; }
.create-panel input { height: 39px; }
.create-panel .feature-flags { margin-top: 3px; }
.create-panel .feature-selection { max-height: 360px; }
.primary { border-color: var(--accent); background: var(--accent); }
.primary:hover { border-color: var(--accent-dark); background: var(--accent-dark); }

.dashboard-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.create-card-menu { position: relative; flex: 0 0 auto; }
.create-card-trigger {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ffffff;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.create-card-trigger::before { content: "+"; font-size: 18px; font-weight: 400; line-height: 1; }
.create-card-trigger:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.create-card-trigger:focus-visible { outline: 3px solid rgba(49, 94, 251, 0.24); outline-offset: 2px; }
.create-card-trigger::-webkit-details-marker { display: none; }
.create-card-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(390px, calc(100vw - 28px));
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(16, 24, 40, 0.16), 0 2px 6px rgba(16, 24, 40, 0.08);
}
.create-card-popover .panel-title-row h2 { margin-bottom: 0; }
.create-card-popover .panel-description { margin-bottom: 19px; }
.create-card-popover .stack-form { gap: 13px; }
.create-card-popover .stack-form label { gap: 6px; font-size: 13px; }
.create-card-popover input { height: 39px; }
.create-card-popover .feature-options { margin-top: 3px; }
.create-card-popover .feature-options .feature-selection { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.create-card-popover .primary { width: 100%; }

.table-region { min-width: 0; }
.table-toolbar { padding: 18px 18px 16px; border-bottom: 1px solid var(--line); }
.table-toolbar-title { margin-bottom: 15px; display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.table-toolbar-title h2 { margin: 0; font-size: 18px; }
.result-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.filter-form { display: grid; grid-template-columns: minmax(180px, 1.35fr) repeat(6, minmax(102px, 1fr)) auto auto; gap: 8px; align-items: center; }
.search-field { min-width: 0; height: 38px; padding: 0 10px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49, 94, 251, 0.12); }
.search-field > span { color: var(--muted); font-size: 19px; line-height: 1; transform: translateY(-1px); }
.search-icon { position: relative; width: 13px; height: 13px; flex: 0 0 13px; border: 1.7px solid #667085; border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; right: -4px; bottom: -3px; width: 6px; height: 1.7px; border-radius: 2px; background: #667085; transform: rotate(45deg); transform-origin: left center; }
.search-field input { height: 34px; padding: 5px 0; border: 0; box-shadow: none; }
.search-field input:focus { box-shadow: none; }
.filter-form select { width: 100%; height: 38px; padding: 0 9px; color: #344054; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); }
.filter-form select:focus { outline: 3px solid rgba(49, 94, 251, 0.12); border-color: var(--accent); }
.filter-submit { min-height: 38px; padding: 0 13px; color: #ffffff; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); font-weight: 700; white-space: nowrap; }
.filter-submit:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.clear-filters { color: var(--accent-dark); font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.clear-filters:hover { text-decoration: underline; text-underline-offset: 3px; }

.table-scroll { overflow-x: auto; }
.table-region table { min-width: 930px; }
.table-region th, .table-region td { padding: 13px 16px; }
.table-region th { color: #667085; background: #f8fafc; font-size: 11px; letter-spacing: 0.02em; text-transform: none; }
.table-region td { color: #344054; font-size: 13px; }
.table-region td:first-child { min-width: 170px; }
.key-link { color: #294fcb; font-weight: 750; }
.key-link:hover, .action-link:hover, .back-link:hover { color: var(--accent-dark); }
.table-number { color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.usage-cell { width: 112px; display: grid; gap: 6px; }
.usage-copy { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.usage-copy strong { color: var(--ink-strong); font-size: 12px; font-variant-numeric: tabular-nums; }
.usage-copy span { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.usage-track { height: 5px; display: block; overflow: hidden; border-radius: 999px; background: #e8ecf2; }
.usage-fill { height: 100%; display: block; border-radius: inherit; background: #4d77f4; }
.usage-fill.is-warning { background: #e4ad3e; }
.usage-fill.is-full { background: #d35a6e; }
.feature-summary { min-width: 70px; align-items: center; gap: 4px; }
.feature-summary strong { color: var(--ink-strong); font-size: 13px; font-variant-numeric: tabular-nums; }
.feature-summary span { color: var(--muted); font-size: 11px; }
.status { border-radius: 5px; font-size: 11px; }
.status.active { color: #087443; background: #e4f7ed; }
.status.pending { color: #8a6115; background: #fff4d6; }
.status.expired, .status.disabled { color: #a5263c; background: #ffe8ec; }
.empty { height: 190px; padding: 54px 20px; }
.empty strong, .empty span { display: block; }
.empty strong { margin-bottom: 5px; color: #344054; }
.empty span { color: var(--muted); font-size: 12px; }

.pagination { min-height: 59px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }
.pagination-actions { display: flex; align-items: center; gap: 3px; }
.page-number, .page-arrow { min-width: 30px; height: 30px; padding: 0 8px; display: inline-grid; place-items: center; color: #667085; border: 1px solid transparent; border-radius: 5px; text-decoration: none; font-size: 12px; }
.page-number:hover, .page-arrow:hover { color: var(--accent-dark); border-color: #cbd5ff; background: var(--accent-soft); }
.page-number.is-current { color: #ffffff; border-color: var(--accent); background: var(--accent); font-weight: 750; }
.page-arrow.is-disabled { color: #c0c6d0; pointer-events: none; }

.created-section { margin-bottom: 22px; padding: 18px 20px; border-color: #c9d5ff; border-radius: 8px; background: #f4f6ff; }
.created-section h2 { margin-bottom: 4px; }
.created-section p { font-size: 12px; }
.created-key { border-color: #d7defb; border-radius: 5px; }
.alert { border-color: var(--line); border-radius: 6px; }
.alert.success { color: #087443; border-color: #bce8d0; background: #edfbf3; }
.alert.error { color: #a5263c; border-color: #f2c3ca; background: #fff3f5; }

@media (max-width: 1220px) {
  .page { padding-right: 24px; padding-left: 24px; }
  .topbar-inner { padding-right: 24px; padding-left: 24px; }
  .overview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-form { grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(125px, 1fr)); }
  .filter-submit { grid-column: span 1; }
}

@media (max-width: 980px) {
  .page { padding: 30px 22px 60px; }
  .topbar-inner { padding: 0 22px; }
  .dashboard-heading { align-items: flex-start; }
  .dashboard-meta { margin-top: 7px; }
  .workspace { grid-template-columns: 1fr; }
  .filter-form { grid-template-columns: minmax(200px, 1fr) repeat(2, minmax(130px, 1fr)); }
  .clear-filters { justify-self: start; }
}

/* Keep secondary authenticated surfaces in the same visual system as the dashboard. */
.detail-hero { background: #151e3f; }
.detail-hero .back-link { color: #b7c4ff; }
.detail-title p { color: #b5bfd8; }
.detail-hero .status.active { color: #d5ddff; background: #2d3d79; }
.detail-hero .status.pending { color: #ffe8a3; background: #5b4c1b; }
.detail-hero .status.expired,
.detail-hero .status.disabled { color: #ffc9d0; background: #643040; }
.detail-summary { border-top-color: #3a4770; }
.detail-summary div { border-left-color: #3a4770; }
.detail-summary dt { color: #aab6d0; }
.detail-content { background: #f3f5f8; }
.login-brand-panel { background: #151e3f; }
.brand-rule { background: #8fa5ff; }
.login-brand-copy > p:last-child { color: #b5bfd8; }
.login-brand-footer { color: #8f9bbb; }

@media (max-width: 760px) {
  .page { padding: 24px 14px 48px; }
  .topbar-inner { padding: 0 14px; }
  .dashboard-heading { display: block; }
  .dashboard-actions { margin-top: 18px; align-items: flex-start; justify-content: space-between; }
  .dashboard-meta { flex-wrap: wrap; white-space: normal; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .overview-card { min-height: 118px; padding: 15px; }
  .overview-card > strong { margin-top: 13px; font-size: 24px; }
  .overview-note { margin-top: 8px; }
  .overview-primary { grid-column: 1 / -1; min-height: 106px; }
  .overview-primary > strong { margin-top: 12px; }
  .operations-strip { display: block; padding: 13px; }
  .operations-intro { margin-bottom: 10px; }
  .quick-filters { margin: 0 -5px; padding-bottom: 2px; }
  .quick-filter { min-height: 40px; padding: 4px 10px; gap: 10px; font-size: 12px; }
  .table-toolbar { padding: 16px 14px 14px; }
  .table-toolbar-title { margin-bottom: 13px; }
  .filter-form { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .filter-submit { grid-column: auto; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .pagination-actions { width: 100%; justify-content: flex-end; }
  .created-section { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .brand > span:last-child { display: none; }
  .topbar nav a, .link-button { padding: 0 8px; font-size: 13px; }
  .topbar nav a::after { right: 8px; left: 8px; }
  .dashboard-heading h1 { font-size: 27px; }
  .dashboard-actions { display: block; }
  .create-card-menu { margin-top: 14px; }
  .create-card-popover { right: auto; left: 0; }
  .feature-options .feature-selection,
  .create-card-popover .feature-options .feature-selection { grid-template-columns: 1fr; }
  .filter-form { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .filter-submit { width: 100%; }
  .clear-filters { justify-self: start; }
}

/* Desktop detail layout: use the available canvas and present feature controls as tiles. */
.detail-hero-inner,
.detail-content {
  max-width: none;
}

.topbar-inner { max-width: none; padding-right: 64px; padding-left: 64px; }
.detail-hero-inner { padding-right: 64px; padding-left: 64px; }
.detail-content { padding: 34px 64px 84px; }

.detail-hero-inner { padding-top: 38px; padding-bottom: 34px; }

.detail-hero-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.82fr) minmax(760px, 1.8fr);
  align-items: end;
  gap: 56px;
}

.detail-overview { min-height: 0; }

.detail-summary {
  margin: 0;
  border: 1px solid #344477;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
}

.detail-summary div,
.detail-summary div:first-child {
  padding: 18px 22px 20px;
}

.detail-summary div:first-child { border-left: 0; }

.detail-workspace {
  grid-template-columns: minmax(500px, 0.9fr) minmax(620px, 1.6fr);
  gap: 24px;
}

.feature-options {
  margin-top: 6px;
  border: 0;
}

.feature-options > summary {
  min-height: 58px;
  padding: 8px 2px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.feature-options[open] > summary { margin-bottom: 14px; }
.feature-options-content { padding: 0; }

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

.feature-options .feature-toggle {
  min-width: 0;
  min-height: 58px;
  padding: 10px 12px;
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  border: 1px solid #e0e5ed;
  border-bottom: 1px solid #e0e5ed;
  border-radius: 7px;
  background: #ffffff;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.feature-options .feature-toggle:hover {
  border-color: #b9c6ee;
  background: #fbfcff;
  box-shadow: 0 2px 7px rgba(31, 54, 112, 0.06);
}

.feature-options .feature-toggle:has(input:checked) {
  border-color: #c3cffb;
  background: #f4f6ff;
}

.feature-options .feature-toggle:has(input:disabled) {
  color: #98a2b3;
  border-color: #e7e9ee;
  background: #f8f9fb;
}

.feature-options .feature-toggle .toggle-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.feature-options .feature-toggle .toggle-copy strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.35;
}

.feature-options .feature-toggle .switch-control {
  width: 36px;
  height: 20px;
  flex-basis: 36px;
  transform: scale(0.86);
  transform-origin: right center;
}

.feature-panel {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.02);
}

.feature-panel .feature-options { margin: 0; padding: 0 24px; }
.feature-panel .feature-options > summary { border-top: 0; }
.feature-panel .feature-options .feature-selection { grid-template-columns: repeat(6, minmax(160px, 1fr)); }

.settings-submit { width: 100%; }

.device-table { min-height: 0; }
.device-empty { min-height: 160px; }

.create-card-popover {
  width: min(620px, calc(100vw - 28px));
}

.create-card-popover .feature-options .feature-selection {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1320px) {
  .detail-hero-grid { grid-template-columns: minmax(360px, 0.75fr) minmax(680px, 1.25fr); gap: 32px; }
  .feature-panel .feature-options .feature-selection { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
}

@media (max-width: 980px) {
  .detail-hero-inner,
  .detail-content { padding-right: 32px; padding-left: 32px; }
  .detail-hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .detail-workspace { grid-template-columns: 1fr; }
  .feature-options .feature-selection,
  .create-card-popover .feature-options .feature-selection { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .feature-panel .feature-options { padding-right: 20px; padding-left: 20px; }
}

@media (max-width: 620px) {
  .detail-hero-inner,
  .detail-content { padding-right: 14px; padding-left: 14px; }
  .feature-options .feature-selection,
  .create-card-popover .feature-options .feature-selection { grid-template-columns: 1fr; }
  .feature-panel .feature-options { padding-right: 14px; padding-left: 14px; }
}

/* Detail record header: compact, light, and aligned with the operations console. */
.license-detail-page .detail-hero {
  color: var(--ink);
  border-bottom: 1px solid #dfe4ec;
  background: #ffffff;
}

.license-detail-page .detail-hero-inner {
  padding-top: 22px;
  padding-bottom: 20px;
}

.license-detail-page .detail-hero-grid {
  grid-template-columns: minmax(360px, 0.78fr) minmax(680px, 1.22fr);
  align-items: center;
  gap: 32px;
}

.license-detail-page .detail-hero .back-link {
  margin-bottom: 11px;
  color: #315efb;
  font-size: 12px;
}

.license-detail-page .detail-title-row {
  gap: 11px;
}

.license-detail-page .detail-title-row h1 {
  color: #111827;
  font-size: 28px;
  line-height: 1.15;
}

.license-detail-page .detail-title p {
  margin-top: 8px;
  color: #667085;
  font-size: 13px;
}

.license-detail-page .detail-hero .status.active {
  color: #176b48;
  background: #e7f7ee;
}

.license-detail-page .detail-hero .status.pending {
  color: #8a6115;
  background: #fff4d6;
}

.license-detail-page .detail-hero .status.expired,
.license-detail-page .detail-hero .status.disabled {
  color: #a5263c;
  background: #ffe8ec;
}

.license-detail-page .detail-summary {
  margin: 0;
  border-color: #dfe4ec;
  border-radius: 8px;
  background: #f8fafc;
}

.license-detail-page .detail-summary div,
.license-detail-page .detail-summary div:first-child {
  padding: 14px 18px 15px;
  border-left-color: #dfe4ec;
}

.license-detail-page .detail-summary div:first-child {
  padding-left: 18px;
  border-left: 0;
}

.license-detail-page .detail-summary dt {
  margin-bottom: 5px;
  color: #667085;
  font-size: 11px;
}

.license-detail-page .detail-summary dd {
  color: #111827;
  font-size: 14px;
}

.license-detail-page .detail-content {
  padding-top: 24px;
  background: #f3f5f8;
}

.license-detail-page .license-key-panel {
  margin-bottom: 20px;
}

.license-detail-page .license-key-panel .section-heading {
  min-height: 52px;
}

.license-detail-page .secret-disclosure {
  padding: 0 18px 8px;
}

.license-detail-page .secret-disclosure summary {
  min-height: 34px;
  padding-top: 8px;
  font-size: 12px;
}

.license-detail-page .detail-workspace {
  grid-template-columns: minmax(420px, 0.76fr) minmax(700px, 1.24fr);
  gap: 20px;
}

.license-detail-page .detail-settings .panel-heading,
.license-detail-page .detail-devices .section-heading {
  min-height: 60px;
}

.license-detail-page .password-control {
  padding-top: 12px;
  padding-bottom: 12px;
}

.license-detail-page .settings-form {
  gap: 17px;
  padding: 20px 24px 22px;
}

.license-detail-page .feature-panel {
  margin-top: 20px;
  border-color: #dfe4ec;
}

.license-detail-page .feature-panel .feature-options {
  padding-right: 20px;
  padding-left: 20px;
}

.license-detail-page .feature-panel .feature-options > summary {
  min-height: 54px;
}

@media (max-width: 1320px) {
  .license-detail-page .detail-hero-grid {
    grid-template-columns: minmax(340px, 0.72fr) minmax(650px, 1.28fr);
    gap: 24px;
  }

  .license-detail-page .detail-workspace {
    grid-template-columns: minmax(380px, 0.72fr) minmax(650px, 1.28fr);
  }
}

@media (max-width: 980px) {
  .license-detail-page .detail-hero-inner,
  .license-detail-page .detail-content { padding-right: 32px; padding-left: 32px; }
  .license-detail-page .detail-hero-grid,
  .license-detail-page .detail-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .license-detail-page .detail-hero-inner,
  .license-detail-page .detail-content { padding-right: 14px; padding-left: 14px; }
  .license-detail-page .detail-title-row h1 { font-size: 26px; }
  .license-detail-page .detail-summary div,
  .license-detail-page .detail-summary div:first-child { padding-right: 12px; padding-left: 12px; }
}

/* Reference-based operations pass: Airtable structure with Linear precision. */
body:has(.license-detail-page) {
  --detail-primary: #181d26;
  --detail-primary-active: #0d1218;
  --detail-link: #1b61c9;
  --detail-ink: #181d26;
  --detail-body: #333840;
  --detail-muted: #667085;
  --detail-line: #dddddd;
  --detail-soft: #f8fafc;
  --detail-canvas: #f4f6f8;
}

body:has(.license-detail-page) .topbar {
  border-bottom-color: var(--detail-line);
  background: #ffffff;
}

body:has(.license-detail-page) .topbar-inner {
  max-width: 1280px;
  padding-right: 48px;
  padding-left: 48px;
}

body:has(.license-detail-page) .brand {
  color: var(--detail-ink);
  font-weight: 600;
}

body:has(.license-detail-page) .topbar nav a,
body:has(.license-detail-page) .link-button {
  color: var(--detail-muted);
  font-weight: 500;
}

body:has(.license-detail-page) .topbar nav a.is-active,
body:has(.license-detail-page) .topbar nav a:hover,
body:has(.license-detail-page) .link-button:hover {
  color: var(--detail-ink);
}

body:has(.license-detail-page) .topbar nav a.is-active::after {
  background: var(--detail-link);
}

.license-detail-page {
  color: var(--detail-body);
  background: var(--detail-canvas);
}

.license-detail-page .detail-hero {
  border-bottom: 1px solid var(--detail-line);
  background: #ffffff;
}

.license-detail-page .detail-hero-inner {
  max-width: 1280px;
  padding: 24px 48px 22px;
}

.license-detail-page .detail-hero-grid {
  grid-template-columns: minmax(340px, 0.8fr) minmax(640px, 1.2fr);
  gap: 40px;
}

.license-detail-page .detail-hero .back-link {
  margin-bottom: 10px;
  color: var(--detail-link);
  font-size: 12px;
  font-weight: 500;
}

.license-detail-page .detail-title-row {
  gap: 12px;
}

.license-detail-page .detail-title-row h1 {
  color: var(--detail-ink);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0;
}

.license-detail-page .detail-title p {
  margin-top: 8px;
  color: var(--detail-muted);
  font-size: 14px;
}

.license-detail-page .detail-hero .status {
  border-radius: 6px;
  font-weight: 500;
}

.license-detail-page .detail-hero .status.active {
  color: #006400;
  background: #e9f6ed;
}

.license-detail-page .detail-hero .status.pending {
  color: #805b0b;
  background: #fff3cf;
}

.license-detail-page .detail-hero .status.expired,
.license-detail-page .detail-hero .status.disabled {
  color: #8e1d2a;
  background: #ffe8ec;
}

.license-detail-page .detail-summary {
  border-color: var(--detail-line);
  border-radius: 8px;
  background: var(--detail-soft);
}

.license-detail-page .detail-summary div,
.license-detail-page .detail-summary div:first-child {
  padding: 15px 18px 16px;
  border-left-color: var(--detail-line);
}

.license-detail-page .detail-summary div:first-child {
  border-left: 0;
}

.license-detail-page .detail-summary dt {
  margin-bottom: 5px;
  color: var(--detail-muted);
  font-size: 11px;
  font-weight: 500;
}

.license-detail-page .detail-summary dd {
  color: var(--detail-ink);
  font-size: 15px;
  font-weight: 600;
}

.license-detail-page .detail-content {
  max-width: 1280px;
  padding: 24px 48px 72px;
  background: var(--detail-canvas);
}

.license-detail-page .license-key-panel,
.license-detail-page .detail-settings,
.license-detail-page .detail-devices,
.license-detail-page .feature-panel,
.license-detail-page .account-panel,
.license-detail-page .audit-feed {
  border-color: var(--detail-line);
  border-radius: 10px;
  box-shadow: none;
}

.license-detail-page .license-key-panel {
  margin-bottom: 20px;
}

.license-detail-page .license-key-panel .section-heading,
.license-detail-page .detail-settings .panel-heading,
.license-detail-page .detail-devices .section-heading,
.license-detail-page .account-panel .section-heading,
.license-detail-page .audit-feed .section-heading {
  min-height: 56px;
  padding-right: 24px;
  padding-left: 24px;
}

.license-detail-page .secret-disclosure {
  padding: 0 24px 8px;
}

.license-detail-page .secret-disclosure summary {
  min-height: 34px;
  padding-top: 8px;
  color: var(--detail-link);
  font-size: 12px;
  font-weight: 500;
}

.license-detail-page .detail-workspace {
  grid-template-columns: minmax(400px, 0.8fr) minmax(620px, 1.2fr);
  align-items: stretch;
  gap: 20px;
}

.license-detail-page .detail-settings,
.license-detail-page .detail-devices {
  min-height: 100%;
}

.license-detail-page .detail-settings {
  display: flex;
  flex-direction: column;
}

.license-detail-page .detail-settings .settings-form {
  gap: 17px;
  padding: 20px 24px 22px;
}

.license-detail-page .detail-settings .settings-submit {
  border-color: var(--detail-primary);
  background: var(--detail-primary);
  font-weight: 500;
}

.license-detail-page .detail-settings .settings-submit:hover {
  border-color: var(--detail-primary-active);
  background: var(--detail-primary-active);
}

.license-detail-page .detail-devices {
  display: flex;
  flex-direction: column;
}

.license-detail-page .device-table {
  min-height: 0;
}

.license-detail-page .device-empty {
  min-height: 150px;
  flex: 1 1 auto;
}

.license-detail-page .device-usage {
  margin: auto 24px 24px;
  padding-top: 18px;
  border-top: 1px solid var(--detail-line);
}

.license-detail-page .device-usage-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: var(--detail-muted);
  font-size: 12px;
}

.license-detail-page .device-usage-header strong {
  color: var(--detail-ink);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.license-detail-page .device-usage-track {
  height: 6px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.license-detail-page .device-usage-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--detail-link);
}

.license-detail-page .device-usage-note {
  display: block;
  margin-top: 8px;
  color: var(--detail-muted);
  font-size: 11px;
}

.license-detail-page .feature-panel {
  margin-top: 20px;
}

.license-detail-page .feature-panel .feature-options {
  margin: 0;
  padding: 0 24px;
  border: 0;
}

.license-detail-page .feature-panel .feature-options > summary {
  min-height: 56px;
  border: 0;
}

.license-detail-page .feature-panel .feature-options[open] > summary {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--detail-line);
}

.license-detail-page .feature-panel .feature-options .feature-selection {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.license-detail-page .feature-panel .feature-toggle {
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--detail-line);
  border-radius: 8px;
  background: #ffffff;
}

.license-detail-page .feature-panel .feature-toggle:hover {
  border-color: #b8c2ce;
  background: var(--detail-soft);
  box-shadow: none;
}

.license-detail-page .feature-panel .feature-toggle:has(input:checked) {
  border-color: #c3d1e0;
  background: #f8fafc;
}

.license-detail-page .feature-panel .feature-toggle .toggle-copy strong {
  color: var(--detail-ink);
  font-size: 13px;
  font-weight: 500;
}

.license-detail-page .feature-panel .feature-toggle .switch-control {
  transform: none;
}

.license-detail-page .switch-control input:checked + .switch-track {
  border-color: var(--detail-link);
  background: var(--detail-link);
}

.license-detail-page .account-panel,
.license-detail-page .audit-feed {
  margin-top: 20px;
}

.license-detail-page .account-panel .device-empty,
.license-detail-page .audit-empty {
  min-height: 140px;
}

@media (max-width: 1320px) {
  body:has(.license-detail-page) .topbar-inner,
  .license-detail-page .detail-hero-inner,
  .license-detail-page .detail-content { padding-right: 32px; padding-left: 32px; }

  .license-detail-page .detail-hero-grid {
    grid-template-columns: minmax(320px, 0.72fr) minmax(600px, 1.28fr);
    gap: 24px;
  }

  .license-detail-page .detail-workspace {
    grid-template-columns: minmax(360px, 0.72fr) minmax(580px, 1.28fr);
  }
}

@media (max-width: 980px) {
  .license-detail-page .detail-hero-grid,
  .license-detail-page .detail-workspace { grid-template-columns: 1fr; }
  .license-detail-page .detail-devices { min-height: 260px; }
}

@media (max-width: 620px) {
  body:has(.license-detail-page) .topbar-inner,
  .license-detail-page .detail-hero-inner,
  .license-detail-page .detail-content { padding-right: 14px; padding-left: 14px; }
  .license-detail-page .detail-title-row h1 { font-size: 26px; }
  .license-detail-page .feature-panel .feature-options { padding-right: 14px; padding-left: 14px; }
}

/* Desktop detail surface: use the available PC canvas and make navigation explicit. */
body:has(.license-detail-page) .topbar-inner,
.license-detail-page .detail-hero-inner,
.license-detail-page .detail-content {
  max-width: none;
}

body:has(.license-detail-page) .topbar-inner {
  padding-right: 64px;
  padding-left: 64px;
}

.license-detail-page .detail-hero-inner,
.license-detail-page .detail-content {
  padding-right: 64px;
  padding-left: 64px;
}

.license-detail-page .detail-hero-inner {
  padding-top: 20px;
  padding-bottom: 18px;
}

.license-detail-page .detail-hero-grid {
  grid-template-columns: minmax(440px, 0.68fr) minmax(820px, 1.32fr);
  gap: 48px;
}

.license-detail-page .detail-hero .back-link {
  width: max-content;
  min-height: 36px;
  margin-bottom: 12px;
  padding: 0 12px 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--detail-ink);
  border: 1px solid #cfd5df;
  border-radius: 6px;
  background: #ffffff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.license-detail-page .detail-hero .back-link > span:first-child {
  color: var(--detail-link);
  font-size: 18px;
  line-height: 1;
}

.license-detail-page .detail-hero .back-link:hover {
  color: var(--detail-ink);
  border-color: #9aa5b4;
  background: var(--detail-soft);
  text-decoration: none;
}

.license-detail-page .detail-title-row h1 {
  font-size: 30px;
}

.license-detail-page .detail-summary {
  width: 100%;
}

.license-detail-page .detail-content {
  padding-top: 24px;
}

@media (max-width: 1320px) {
  body:has(.license-detail-page) .topbar-inner,
  .license-detail-page .detail-hero-inner,
  .license-detail-page .detail-content { padding-right: 32px; padding-left: 32px; }
  .license-detail-page .detail-hero-grid {
    grid-template-columns: minmax(360px, 0.72fr) minmax(620px, 1.28fr);
    gap: 28px;
  }
}

@media (max-width: 620px) {
  body:has(.license-detail-page) .topbar-inner,
  .license-detail-page .detail-hero-inner,
  .license-detail-page .detail-content { padding-right: 14px; padding-left: 14px; }
}

/* Admin login: brand presence on the left, clear operational entry on the right. */
body:has(.login-page) {
  background: #f7f7f5;
}

body:has(.login-page) .page.login-page {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0;
}

body:has(.login-page) .login-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(520px, 0.92fr) minmax(600px, 1.08fr);
  background: #f7f7f5;
}

body:has(.login-page) .login-brand-panel {
  position: relative;
  min-height: 100%;
  padding: 38px 52px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: #f8fafc;
  border-right: 1px solid #263149;
  background: #111827;
}

body:has(.login-page) .login-brand-panel::before {
  content: "777";
  position: absolute;
  right: -24px;
  bottom: -66px;
  color: #182238;
  font-size: 250px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
  user-select: none;
}

body:has(.login-page) .login-brand-header,
body:has(.login-page) .login-brand-copy,
body:has(.login-page) .login-brand-footer {
  position: relative;
  z-index: 1;
}

body:has(.login-page) .login-brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

body:has(.login-page) .login-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
}

body:has(.login-page) .login-brand .product-mark {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  color: #111827;
  background: #ffffff;
  font-size: 22px;
}

body:has(.login-page) .login-brand-name {
  display: grid;
  gap: 2px;
}

body:has(.login-page) .login-brand-name strong {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.25;
}

body:has(.login-page) .login-brand-name small {
  color: #9faac0;
  font-size: 11px;
  font-weight: 500;
}

body:has(.login-page) .login-console-label {
  padding: 5px 8px;
  color: #aab5cb;
  border: 1px solid #344057;
  border-radius: 4px;
  font: 700 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}

body:has(.login-page) .login-brand-copy {
  width: min(100%, 500px);
  margin: 54px 0 34px;
}

body:has(.login-page) .login-brand-title {
  margin: 0;
  color: #ffffff;
  font-size: 48px;
  font-weight: 590;
  line-height: 1.13;
  letter-spacing: 0;
}

body:has(.login-page) .login-brand-title span {
  color: #aeb9cd;
}

body:has(.login-page) .login-brand-description {
  max-width: 36ch;
  margin: 18px 0 0;
  color: #9faac0;
  font-size: 14px;
  line-height: 1.7;
}

body:has(.login-page) .login-control-map {
  width: min(100%, 440px);
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid #303c54;
  border-radius: 8px;
  background: #151e30;
}

body:has(.login-page) .login-control-map-head,
body:has(.login-page) .login-control-row {
  min-height: 52px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

body:has(.login-page) .login-control-map-head {
  min-height: 42px;
  color: #76839b;
  border-bottom: 1px solid #303c54;
  font-size: 10px;
  font-weight: 700;
}

body:has(.login-page) .login-control-row + .login-control-row {
  border-top: 1px solid #273249;
}

body:has(.login-page) .login-control-row > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

body:has(.login-page) .login-control-row strong {
  color: #f4f6fa;
  font-size: 13px;
  font-weight: 600;
}

body:has(.login-page) .login-control-row > span {
  color: #8d99af;
  font-size: 11px;
}

body:has(.login-page) .login-control-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}

body:has(.login-page) .login-control-dot.dot-blue { background: #7c8cff; }
body:has(.login-page) .login-control-dot.dot-coral { background: #f07867; }
body:has(.login-page) .login-control-dot.dot-amber { background: #e5b85c; }

body:has(.login-page) .login-brand-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #6f7b92;
  font-size: 10px;
}

body:has(.login-page) .login-form-panel {
  min-height: 100%;
  padding: 48px 72px;
  display: grid;
  place-items: center;
  background: #f7f7f5;
}

body:has(.login-page) .login-form-content {
  width: min(100%, 460px);
  animation: login-enter 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

body:has(.login-page) .login-mobile-brand {
  display: none;
}

body:has(.login-page) .login-form-meta {
  margin-bottom: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

body:has(.login-page) .login-security-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #475467;
}

body:has(.login-page) .login-security-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #315efb;
}

body:has(.login-page) .login-heading {
  margin-bottom: 32px;
}

body:has(.login-page) .login-heading h1 {
  margin-bottom: 9px;
  color: #181d26;
  font-size: 34px;
  font-weight: 620;
  line-height: 1.18;
  letter-spacing: 0;
}

body:has(.login-page) .login-heading p {
  margin: 0;
  color: #667085;
  font-size: 14px;
}

body:has(.login-page) .login-form {
  gap: 19px;
}

body:has(.login-page) .login-form label {
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

body:has(.login-page) .login-form input {
  height: 49px;
  padding: 0 14px;
  color: #181d26;
  border-color: #cbd2dc;
  border-radius: 7px;
  background: #ffffff;
}

body:has(.login-page) .login-form input:hover {
  border-color: #aeb7c4;
}

body:has(.login-page) .login-form input:focus {
  border-color: #315efb;
  box-shadow: 0 0 0 3px rgba(49, 94, 251, 0.14);
}

body:has(.login-page) .login-submit {
  min-height: 49px;
  margin-top: 3px;
  color: #ffffff;
  border-color: #315efb;
  border-radius: 7px;
  background: #315efb;
  box-shadow: 0 5px 14px rgba(49, 94, 251, 0.18);
  font-weight: 650;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

body:has(.login-page) .login-submit:hover {
  border-color: #2447c7;
  background: #2447c7;
  box-shadow: 0 7px 18px rgba(49, 94, 251, 0.24);
  transform: translateY(-1px);
}

body:has(.login-page) .login-submit:active {
  transform: translateY(0);
}

body:has(.login-page) .login-access-note {
  margin: 24px 0 0;
  color: #98a2b3;
  font-size: 11px;
  text-align: center;
}

@keyframes login-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1120px) {
  body:has(.login-page) .login-shell {
    grid-template-columns: minmax(440px, 0.88fr) minmax(520px, 1.12fr);
  }

  body:has(.login-page) .login-brand-panel { padding-right: 42px; padding-left: 42px; }
  body:has(.login-page) .login-brand-title { font-size: 42px; }
  body:has(.login-page) .login-form-panel { padding-right: 52px; padding-left: 52px; }
}

@media (max-width: 900px) {
  body:has(.login-page) .login-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(.login-page) .login-brand-panel { display: none; }

  body:has(.login-page) .login-form-panel {
    min-height: 100vh;
    min-height: 100svh;
    padding: 44px 28px;
  }

  body:has(.login-page) .login-mobile-brand {
    margin-bottom: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #181d26;
    font-size: 16px;
    font-weight: 650;
  }

  body:has(.login-page) .login-mobile-brand .product-mark {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    font-size: 20px;
  }
}

@media (max-height: 700px) and (min-width: 901px) {
  body:has(.login-page) .login-brand-panel { padding-top: 30px; padding-bottom: 28px; }
  body:has(.login-page) .login-brand-copy { margin-top: 34px; margin-bottom: 24px; }
  body:has(.login-page) .login-brand-title { font-size: 42px; }
  body:has(.login-page) .login-brand-description { margin-top: 12px; }
  body:has(.login-page) .login-control-map { margin-top: 24px; }
  body:has(.login-page) .login-control-map-head { min-height: 36px; }
  body:has(.login-page) .login-control-row { min-height: 46px; }
  body:has(.login-page) .login-form-meta { margin-bottom: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  body:has(.login-page) .login-form-content { animation: none; }
  body:has(.login-page) .login-submit { transition: none; }
}
