:root {
  --bg: #150d1a;
  --bg-elevated: #1c1220;
  --card: #221726;
  --border: #3a2a40;
  --accent: #f2b134;
  --accent-hover: #ffc965;
  --accent-dark: #d99a1f;
  --accent-tint: #2e2210;
  --on-accent: #241505;
  --text-primary: #f7f1ea;
  --text-muted: #9c8aa3;
  --placeholder: #6b5a72;
  --danger: #fb7185;
  --danger-tint: #2e1620;
  --amber: #fb923c;
  --amber-tint: #2e1c10;
  --success: #4ade80;
  --success-tint: #132a1c;

  --font-display: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --font-body: -apple-system, "Segoe UI", system-ui, sans-serif;

  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(242, 177, 52, 0.07), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(242, 177, 52, 0.05), transparent 45%);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.01em;
}

.wrap {
  width: 100%;
  max-width: 420px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 22px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
  color: var(--text-primary);
}

.brand-name .tag {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  padding: 30px 28px;
}

.card h2 {
  font-size: 17px;
  margin-bottom: 6px;
}

.card .lede {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 24px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14.5px;
}

.field select {
  cursor: pointer;
}

.field textarea {
  resize: vertical;
  min-height: 70px;
}

.field input.key-input {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input.key-input::placeholder {
  color: var(--placeholder);
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-body);
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.field-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 7px 0 0;
  line-height: 1.5;
}

.success-banner {
  background: var(--success-tint);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 20px;
}

.generated-credential-banner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.generated-credential-row {
  display: flex;
}

.warn-banner {
  background: var(--amber-tint);
  color: var(--amber);
  border: 1px solid rgba(251, 146, 60, 0.3);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.error-banner {
  background: var(--danger-tint);
  color: var(--danger);
  border: 1px solid rgba(251, 113, 133, 0.3);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 18px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn:disabled {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-color: var(--border);
  cursor: not-allowed;
}

.btn:disabled:hover {
  background: var(--bg-elevated);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.footnote {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 18px;
}

/* License status page */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-active { background: var(--success-tint); color: var(--success); }
.status-expiring_soon { background: var(--amber-tint); color: var(--amber); }
.status-expired { background: var(--danger-tint); color: var(--danger); }
.status-revoked { background: var(--danger-tint); color: var(--danger); }
.status-pending { background: var(--bg-elevated); color: var(--text-muted); }

.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.kv-row:last-of-type {
  border-bottom: none;
}

.kv-row .k {
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kv-row .v {
  font-weight: 600;
}

.license-key {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

/* Admin area: wide layout with top nav (Dashboard, Devices, ...) */

body.admin-body {
  display: block;
  align-items: initial;
  justify-content: initial;
  padding: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.topbar .brand {
  margin-bottom: 0;
  justify-content: flex-start;
}

.topnav {
  display: flex;
  gap: 4px;
}

.topnav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
}

.topnav a:hover {
  color: var(--text-primary);
}

.topnav a.active {
  background: var(--accent-tint);
  color: var(--accent);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 20px;
  border-left: 1px solid var(--border);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-name {
  font-family: var(--font-display);
  font-size: 12.5px;
  color: var(--text-muted);
}

.admin-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 32px 72px;
}

.admin-main .wrap {
  max-width: 420px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.page-header h1 {
  font-size: 19px;
}

/* Pairing code card */

.pairing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pairing-card .pairing-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.pairing-card .pairing-code-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pairing-card .pairing-code {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.btn-copy {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}

.btn-copy:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.btn-copy.btn-copy-done {
  color: var(--success);
  border-color: var(--success);
}

.pairing-card .pairing-note {
  color: var(--text-muted);
  font-size: 12.5px;
  white-space: nowrap;
  text-align: right;
}

/* Tabs */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.tabs a {
  padding: 10px 16px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs a:hover {
  color: var(--text-primary);
}

.tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Table */

.table-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 11px 20px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

tr:last-child td {
  border-bottom: none;
}

.mono {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.was-blocked-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 100px;
  background: var(--danger-tint);
  color: var(--danger);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  width: auto;
}

.btn-danger {
  background: var(--danger-tint);
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.3);
}

.btn-danger:hover {
  background: rgba(251, 113, 133, 0.18);
}

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

/* Side drawer (confirmation pages) */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 4, 13, 0.6);
  z-index: 40;
  display: flex;
  justify-content: flex-end;
}

.drawer-overlay-click {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.drawer-panel {
  position: relative;
  z-index: 1;
  width: 440px;
  max-width: 92vw;
  height: 100vh;
  background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
}

.drawer-header h2 {
  font-size: 16px;
}

.drawer-close {
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
}

.drawer-close:hover {
  color: var(--text-primary);
}

.drawer-body {
  padding: 24px 26px;
  overflow-y: auto;
  min-height: 0;
}

.drawer-footer {
  display: flex;
  gap: 10px;
  padding: 18px 26px;
  border-top: 1px solid var(--border);
}

.drawer-footer .btn {
  flex: 1;
  width: auto;
}

.drawer-summary {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.drawer-summary .main-line {
  font-weight: 600;
  font-size: 14px;
}

.drawer-summary .sub-line {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: var(--font-display);
}

.consequence-heading {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.consequence-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.consequence-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  font-size: 13.5px;
  line-height: 1.5;
}

.consequence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
}

.consequence-dot.danger { background: var(--danger); }
.consequence-dot.muted { background: var(--text-muted); }
.consequence-dot.accent { background: var(--accent); }

.history-list {
  display: flex;
  flex-direction: column;
}

.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.history-row:last-child {
  border-bottom: none;
}

.history-action {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.history-timestamp {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.btn-alert {
  background: var(--amber-tint);
  color: var(--amber);
  border-color: rgba(251, 146, 60, 0.3);
}

.btn-alert:hover {
  background: rgba(251, 146, 60, 0.18);
}

/* Dashboard hero + stat cards */

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: 24px;
  margin-bottom: 10px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.hero-actions .btn {
  width: auto;
  padding: 10px 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.stat-card .stat-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-card .stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 100px;
  background: var(--bg-elevated);
  overflow: hidden;
  margin-top: 12px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
}

.progress-fill.warn {
  background: var(--amber);
}

.detail-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.detail-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}

.detail-panel .panel-header h3 {
  font-size: 13px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.detail-panel .kv-list {
  padding: 4px 22px;
}

.detail-panel .kv-row {
  padding: 13px 0;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding: 18px 22px;
  background: var(--danger-tint);
  border: 1px solid rgba(251, 113, 133, 0.25);
  border-radius: var(--radius);
}

.danger-zone-title {
  font-weight: 600;
  font-size: 13.5px;
}

.danger-zone-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.danger-zone .btn {
  width: auto;
  padding: 10px 16px;
  flex-shrink: 0;
}

/* Addons page */

.page-intro {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: -10px 0 22px;
  max-width: 560px;
}

.page-intro-wide {
  max-width: none;
  white-space: nowrap;
}

.addon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.addon-card {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

.addon-card:hover {
  border-color: var(--accent);
}

.addon-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.addon-card-name {
  font-weight: 600;
  font-size: 15px;
}

.addon-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.addon-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.addon-status-pill.success { background: var(--success-tint); color: var(--success); }
.addon-status-pill.amber { background: var(--amber-tint); color: var(--amber); }
.addon-status-pill.muted { background: var(--bg-elevated); color: var(--text-muted); }

#AddonDrawerStatus {
  margin-bottom: 14px;
}

.addon-drawer-description {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0 0 20px;
}

.addon-progress-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  font-family: var(--font-display);
}

#AddonDrawerProgress {
  margin: 20px 0 4px;
}

#AddonDrawerError {
  margin-top: 16px;
}

/* Overlay visibility is toggled via the `hidden` attribute from JS, not a
   class - the author rule above (`display: flex`) otherwise beats the UA
   stylesheet's `[hidden] { display: none }`, so it has to be restated here
   with matching specificity to actually take effect. */
.drawer-overlay[hidden] {
  display: none;
}

/* Identity page */

.identity-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  align-items: start;
}

.identity-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  /* A grid item won't shrink below its content's intrinsic width by
     default - without this, the long unbreakable install command forces
     the whole grid column (and the page) wider instead of scrolling
     inside .identity-code where it's meant to. */
  min-width: 0;
}

.identity-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.identity-card-top h3 {
  font-size: 15px;
}

.identity-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 16px;
}

.identity-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 100px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.identity-pill-set {
  background: var(--success-tint);
  border-color: rgba(74, 222, 128, 0.3);
  color: var(--success);
}

.identity-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.identity-pill-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.identity-pill-open:hover {
  color: var(--accent);
  background: var(--bg-elevated);
}

/* Input, .local suffix, and Save button all on one compact row - not a
   stacked form, this is a single setting, not a multi-field form. */
.identity-inline-form {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.add-user-form {
  display: flex;
  gap: 10px;
  /* stretch, not center - the input and .btn-sm have different padding/
     font-size, so centering leaves their heights visibly mismatched;
     stretch forces both to the row's full height instead. */
  align-items: stretch;
}

.add-user-form .btn {
  width: auto;
}

/* A short, single value (a username) doesn't need to stretch to fill the
   card - letting it do so makes the submit button land far from what it
   acts on. Capped to a sane width instead, button right beside it. */
.compact-text-input {
  width: 220px;
  padding: 11px 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
}

.compact-text-input:focus {
  outline: none;
  border-color: var(--accent);
}

.identity-input-row {
  display: flex;
  align-items: stretch;
  flex: 1;
}

.identity-input-row input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-right: none;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13.5px;
}

.identity-input-row input:focus {
  outline: none;
  border-color: var(--accent);
  z-index: 1;
}

.identity-suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: none;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 12.5px;
  flex-shrink: 0;
}

.identity-inline-form .btn {
  width: auto;
  flex-shrink: 0;
}

.identity-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.identity-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
}

.identity-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.identity-step-title {
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 10px;
}

.identity-step-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.identity-step-body .field-hint {
  margin: 10px 0 0;
}

.identity-step-body code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-display);
  font-size: 11.5px;
  color: var(--accent);
}

.identity-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.identity-tab {
  background: transparent;
  border: none;
  padding: 8px 4px 10px;
  margin-right: 18px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}

.identity-tab:hover {
  color: var(--text-primary);
}

.identity-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.identity-os-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.identity-os-tab {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 13px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.identity-os-tab.active {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent);
}

.identity-code-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
  max-width: 100%;
}

/* Visibility is toggled via the `hidden` attribute from JS (identity.js),
   not a class - the author rules above otherwise beat the UA stylesheet's
   `[hidden] { display: none }`, so it has to be restated here with
   matching specificity to actually take effect. */
.identity-code-row[hidden],
.identity-tab-panel[hidden] {
  display: none;
}

.identity-code {
  flex: 1;
  min-width: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text-primary);
  overflow-x: auto;
  white-space: pre;
}

.identity-copy-btn {
  flex-shrink: 0;
  align-self: center;
}

/* Dashboard identity nudge */

.integrity-warning {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, var(--danger-tint), var(--card));
  border: 1px solid rgba(251, 113, 133, 0.35);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.integrity-warning-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--danger-tint);
  color: var(--danger);
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.integrity-warning-body {
  flex: 1;
}

.integrity-warning-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--danger);
  margin-bottom: 3px;
}

.integrity-warning-desc {
  font-size: 12.5px;
  color: var(--text-muted);
}

.identity-nudge {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, var(--accent-tint), var(--card));
  border: 1px solid rgba(242, 177, 52, 0.3);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.identity-nudge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 18px;
  flex-shrink: 0;
}

.identity-nudge-body {
  flex: 1;
}

.identity-nudge-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 3px;
}

.identity-nudge-desc {
  font-size: 12.5px;
  color: var(--text-muted);
}

.identity-nudge-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.identity-nudge-actions .btn {
  width: auto;
  padding: 9px 16px;
}

.identity-nudge-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
}

.identity-nudge-dismiss:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
