:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #273548;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --border: #334155;
  --danger: #f87171;
  color-scheme: dark;
}

/* The HTML5 hidden attribute must win over any class-based display rule.
   Author classes like .btn { display: inline-block } otherwise outrank
   the user-agent [hidden] { display: none }, leaving "hidden" elements
   visually rendered. */
[hidden] { display: none !important; }

/* Anti-FOUC: hide member-only dashboard cards before first paint when the
   share_role cookie says guest. app.js re-applies the authoritative role
   from /api/me once it resolves. */
html[data-role="guest"] #publish-card,
html[data-role="guest"] #pages-card { display: none; }

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* Landing page */
.landing { display: grid; place-items: center; min-height: 100vh; }
.hero {
  text-align: center;
  max-width: 520px;
  padding: 2rem;
}
.hero h1 { font-size: 2.5rem; margin: 0 0 .5rem; }
.hero .tagline { font-size: 1.1rem; color: var(--muted); margin: 0 0 .25rem; }
.hero .sub { color: var(--muted); margin: 0 0 2rem; }
.hero .small { font-size: .85rem; color: var(--muted); margin-top: 1rem; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem 1.1rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.btn:hover { background: #32465e; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: var(--danger); }

/* Topbar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 1.5rem;
  min-height: 3.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 600; }
.topbar .user { display: flex; gap: .75rem; align-items: center; font-size: .9rem; color: var(--muted); }

/* Env + version pills (left of avatar in topbar) */
.env-version { display: inline-flex; align-items: center; gap: .4rem; margin-right: .5rem; }
.env-pill {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.env-pill-prod  { background: #166534; color: white; }
.env-pill-dev   { background: #c2410c; color: white; }
.env-pill-local { background: #475569; color: white; }
.version-pill {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .75rem;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  cursor: pointer;
}
.version-pill:hover { color: var(--text); border-color: var(--accent); }

/* New-version glow + popover. The .new class is added by topbar.js when
   the device hasn't yet seen the current prod release. Any interaction
   (pill click, popover click, ×) marks the version as seen and removes
   both the class and the popover. */
@keyframes version-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent); }
  50%      { box-shadow: 0 0 12px 4px var(--accent); }
}
.version-pill.new {
  animation: version-glow 1.6s ease-in-out infinite;
  color: var(--text);
  border-color: var(--accent);
}
.env-version { position: relative; }
.version-popover {
  position: absolute;
  top: calc(100% + .35rem);
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .35rem .55rem;
  font-size: .8rem;
  color: var(--text);
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
  cursor: pointer;
}
.version-popover:hover { border-color: var(--accent); }
.version-popover-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 .15rem;
}
.version-popover-close:hover { color: var(--text); }

/* Env-aware top border on body */
body.env-dev   { border-top: 4px solid #c2410c; }
body.env-prod  { border-top: 4px solid #166534; }
body.env-local { border-top: 4px solid #475569; }

/* Changelog modal styles (reuses .modal base) */
.changelog-modal .modal-content { max-width: 720px; }
.changelog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 1rem;
}
.changelog-header h3 { margin: 0; }
.changelog-body { font-size: .9rem; line-height: 1.55; }
.changelog-body h4 { margin: 1rem 0 .5rem; color: var(--text); font-size: 1rem; }
.changelog-body h5 { margin: .9rem 0 .35rem; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.changelog-body hr { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.changelog-body ul { padding-left: 1.25rem; margin: .25rem 0; }
.changelog-body li { margin-bottom: .2rem; }
.changelog-body code {
  background: var(--bg);
  padding: .05rem .3rem;
  border-radius: 3px;
  font-size: .85em;
}

/* Avatar menu */
.avatar-menu { position: relative; }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.avatar:hover { filter: brightness(1.1); }
.avatar.role-admin { background: #be185d; }
.avatar.role-member { background: var(--accent); }
.avatar.role-guest { background: #475569; }
.avatar-dropdown {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .35rem 0;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.avatar-dropdown[hidden] { display: none; }
.avatar-dropdown-header {
  padding: .5rem .75rem .6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .35rem;
}
.avatar-dropdown-header .email {
  color: var(--text);
  font-size: .9rem;
  word-break: break-all;
}
.avatar-dropdown-header .role {
  font-size: .75rem;
  color: var(--muted);
  text-transform: capitalize;
}
.avatar-dropdown a {
  display: block;
  padding: .5rem .75rem;
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
}
.avatar-dropdown a:hover { background: var(--panel-2); }

/* Container + cards */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  gap: 1.5rem;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  min-width: 0; /* prevent long content (e.g. the install one-liner) from busting the grid track */
}
.card h2 { margin: 0 0 .25rem; font-size: 1.25rem; }
.card .muted, .muted { color: var(--muted); font-size: .92rem; }
.card > p { margin: 0 0 1rem; }

/* Forms */
form label {
  display: block;
  margin: 0 0 1rem;
}
form label > span {
  display: block;
  font-size: .85rem;
  color: var(--muted);
  margin: 0 0 .35rem;
}
input, select, textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem .75rem;
  font-size: .95rem;
  font-family: inherit;
}
textarea { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85rem; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.file-row input[type=file] {
  padding: .4rem;
}

/* Drop zone for HTML upload */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin: 0 0 1rem;
}
.dropzone:hover,
.dropzone.dragging { border-color: var(--accent); background: var(--panel-2); }
.dropzone.has-file { border-style: solid; border-color: #16a34a; }
.dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--muted);
  margin: 0 auto 1rem;
}
.dropzone.has-file .dropzone-icon { color: #16a34a; }
.dropzone-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 .3rem; }
.dropzone-sub { margin: 0; }
.dropzone-filename {
  margin-top: 1rem;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: .85rem;
  color: #16a34a;
}

/* Results */
.result {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
}
.result code {
  background: var(--bg);
  padding: .15rem .35rem;
  border-radius: 4px;
  word-break: break-all;
}
.result.error { border-color: var(--danger); color: var(--danger); }

/* Pages list */
.pages { display: grid; gap: .75rem; }
.page-row {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .75rem 1rem;
  background: var(--panel-2);
  border-radius: 8px;
}
.page-row .meta { font-size: .82rem; color: var(--muted); }
.page-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.page-row.archived { opacity: .65; }
.page-row.archived .title { text-decoration: line-through; text-decoration-thickness: 1px; }
.badge.danger { background: var(--danger); color: white; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: white; }
.page-row .title { font-weight: 500; }
.page-row a { color: var(--accent); text-decoration: none; }
.page-row a:hover { text-decoration: underline; }
.badge {
  font-size: .7rem;
  background: var(--bg);
  color: var(--muted);
  padding: .15rem .45rem;
  border-radius: 999px;
  margin-left: .5rem;
}

/* Admin */
.users-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: .9rem;
}
.users-table th, .users-table td {
  padding: .5rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.users-table th { color: var(--muted); font-weight: 500; font-size: .8rem; }
.users-table .badge.admin { background: #be185d; color: white; }
.users-table .badge.member { background: var(--accent); color: white; }
.users-table .badge.guest { background: var(--panel-2); color: var(--text); }
.users-table .badge.active { background: #166534; color: white; }
.users-table .badge.pending { background: #92400e; color: white; }
.users-table .badge.expired,
.users-table .badge.revoked { background: var(--danger); color: white; }
.token-marker {
  display: inline-block;
  margin-left: .35rem;
  cursor: help;
  opacity: .85;
}

/* Admin two-column layout with left sidebar */
.admin-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  max-width: none;
  margin: 2rem 0;
}
.admin-content { display: grid; gap: 1.5rem; }
.admin-sidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  align-self: start;
  position: sticky;
  top: 1rem;
}
.admin-sidebar h3 {
  margin: 0 0 .75rem;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.admin-sidebar nav { display: grid; gap: .15rem; }
.admin-sidebar nav a {
  display: block;
  padding: .5rem .75rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  font-size: .95rem;
}
.admin-sidebar nav a:hover { background: var(--panel-2); }
.admin-sidebar nav a.active {
  background: var(--accent);
  color: white;
  font-weight: 500;
}
@media (max-width: 720px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
}
.btn.small { padding: .25rem .55rem; font-size: .8rem; }
.role-select {
  width: auto;
  padding: .2rem .4rem;
  font-size: .8rem;
  margin-right: .25rem;
}
.roles-explainer ul { margin: 0; padding-left: 1.25rem; }
.roles-explainer li { margin-bottom: .35rem; color: var(--muted); font-size: .9rem; }
.roles-explainer li strong { color: var(--text); }
.filters { display: flex; gap: 1rem; margin: .5rem 0 0; font-size: .9rem; flex-wrap: wrap; }
.filters select, .filters input[type="search"] { width: auto; }

/* Activity drawer (slide-in panel on the right) */
.drawer[hidden] { display: none; }
.drawer {
  position: fixed; inset: 0;
  z-index: 20;
  display: flex; justify-content: flex-end;
}
.drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
}
.drawer-panel {
  position: relative;
  width: min(560px, 100%);
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(0,0,0,.25);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.drawer-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.drawer-header h3 { margin: 0 0 .15rem; font-size: 1.05rem; word-break: break-all; }
.drawer-subtitle { font-size: .85rem; }
.drawer-body { padding: 1rem 1.25rem; overflow-y: auto; flex: 1; }
.drawer-body h4 { margin: 1.25rem 0 .5rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.drawer-summary dl.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .35rem 1rem;
  margin: 0;
  font-size: .9rem;
}
.drawer-summary dl.kv dt { color: var(--muted); }
.drawer-summary dl.kv dd { margin: 0; }
.activity-log {
  list-style: none;
  margin: 0; padding: 0;
  display: grid; gap: .5rem;
}
.activity-log li {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  gap: .5rem;
  align-items: baseline;
  padding: .5rem .75rem;
  background: var(--panel-2);
  border-radius: 6px;
  font-size: .9rem;
}
.activity-log li.error { color: #f87171; }
.activity-icon { font-size: 1rem; }
.activity-text { word-break: break-all; }
.activity-meta { font-size: .8rem; white-space: nowrap; }
@media (max-width: 560px) {
  .activity-log li { grid-template-columns: 1.5rem 1fr; }
  .activity-meta { grid-column: 1 / -1; padding-left: 2rem; }
}
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.modal-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%; max-width: 520px;
  max-height: 80vh; overflow-y: auto;
}
.modal-content h3 { margin: 0 0 1rem; }
.modal-section-title {
  margin: 1.25rem 0 .5rem;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.activity-log { max-height: 240px; overflow-y: auto; }
.activity-row {
  padding: .35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.activity-row:last-child { border-bottom: none; }
.activity-row .when { display: inline-block; min-width: 11rem; font-size: .75rem; }

/* QR modal */
.qr-modal-content { text-align: center; max-width: 380px; }
.qr-modal-content img {
  display: block;
  margin: 1rem auto;
  background: white;
  padding: .5rem;
  border-radius: 8px;
  max-width: 100%;
}
.qr-modal-content a { color: var(--accent); word-break: break-all; }
.qr-actions { display: flex; gap: .5rem; justify-content: center; margin-top: 1rem; }

/* Publish-success modal */
.publish-success-content { max-width: 32rem; }
.publish-success-content h3 { color: var(--text); margin: 0 0 .25rem; }
.pub-page-title {
  font-size: 1rem;
  margin: .6rem 0 .25rem;
  color: var(--muted);
}
.pub-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin: .5rem 0 1rem;
  word-break: break-all;
  user-select: all;
  color: var(--text);
}
.pub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
  margin-top: .75rem;
}
.pub-actions .btn.primary { margin-right: auto; }

/* Shared radio-row style used by /profile and /admin/settings */
.theme-option {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .25rem;
  cursor: pointer;
}
.theme-option input[type=radio] { width: auto; margin: 0; }
.theme-option .small { font-size: .8em; }

/* Icon-only action row */
.page-actions { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; justify-content: flex-end; }
.user-actions { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover, .icon-btn:focus-visible {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--border);
  outline: none;
}
.icon-btn.danger:hover, .icon-btn.danger:focus-visible {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}
.icon-btn.restore:hover, .icon-btn.restore:focus-visible {
  color: #fff;
  background: #16a34a;
  border-color: #16a34a;
}

/* Edit modal */
.edit-content { max-width: 36rem; }
.edit-slug-line { margin-bottom: .5rem; }
.edit-dropzone {
  padding: .8rem 1rem;
  margin: 0 0 .8rem;
  min-height: auto;
}
.edit-dropzone .dropzone-title { font-size: .95rem; }
.edit-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
#edit-people-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem .8rem;
  margin-top: .6rem;
}
#edit-people-section legend { padding: 0 .3rem; color: var(--muted); }
.edit-people-add { display: flex; gap: .4rem; margin-top: .4rem; }
.edit-people-add input { flex: 1; }
.password-input-row { display: flex; gap: .4rem; align-items: center; }
.password-input-row input { flex: 1; }
#edit-error { color: var(--danger); margin-top: .5rem; }

/* Kebab menu (Archive/Restore + Delete) — kept for any unforeseen reuse */
.kebab-wrap { position: relative; display: inline-block; }
.kebab-btn { padding: .25rem .55rem; font-weight: 700; line-height: 1; }
.kebab-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 50;
  min-width: 9rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
  padding: .25rem;
  display: flex;
  flex-direction: column;
}
.kebab-menu[hidden] { display: none; }
.kebab-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  text-align: left;
  padding: .5rem .65rem;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  margin: 2px 0;
}
.kebab-item:first-child { margin-top: 0; }
.kebab-item:last-child { margin-bottom: 0; }
.kebab-item:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.kebab-item.danger { color: var(--danger); }
.kebab-item.danger:hover { background: var(--danger); border-color: var(--danger); color: #0f172a; }

/* Toast (clipboard confirmation, etc.) */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(20, 22, 28, .92);
  color: #fff;
  padding: .55rem 1rem;
  border-radius: 999px;
  font-size: .9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 1000;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Activity modal list */
.activity-list { max-height: 60vh; overflow-y: auto; }
.activity-row {
  padding: .35rem 0;
  border-bottom: 1px solid var(--border, rgba(0,0,0,.08));
  font-size: .92rem;
}
.activity-row:last-child { border-bottom: 0; }
.activity-row .when { margin-right: .5rem; }

/* Profile — install-skill guide */
.install-hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.install-tabs { display: flex; gap: .5rem; margin: 1rem 0 .75rem; flex-wrap: wrap; }
.install-subtabs { display: flex; gap: .35rem; margin: .75rem 0 .5rem; flex-wrap: wrap; }
.install-subtabs .btn { padding: .35rem .8rem; font-size: .85rem; }
.install-panel ol, .install-subpanel ol { padding-left: 1.25rem; margin: .5rem 0; }
.install-panel li, .install-subpanel li { margin: .35rem 0; }
.install-panel pre, .install-subpanel pre {
  background: var(--panel-2);
  padding: .75rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow-x: auto;
  font-size: .85rem;
  line-height: 1.45;
  margin: .5rem 0;
}
.install-panel code, .install-subpanel code { font-size: .9em; }
#install-section h3 { margin: 0 0 .5rem; }
.install-banner {
  padding: .6rem .8rem;
  border-radius: 4px;
  border-left: 3px solid var(--accent);
  background: var(--panel-2);
  margin: .5rem 0 1rem;
}
.install-banner-on { border-left-color: #22c55e; }
.install-banner-off { border-left-color: var(--accent); }

/* Admin Settings — warning banner under the external-sharing toggle when off */
.external-sharing-banner {
  padding: .6rem .8rem;
  border-radius: 4px;
  border-left: 3px solid #f59e0b;
  background: var(--panel-2);
  margin: .5rem 0 0;
  font-size: .9rem;
}

/* Publish-success modal — notice when external sharing is disabled */
.pub-external-notice {
  margin: .75rem 0;
  padding: .55rem .75rem;
  border-radius: 4px;
  border-left: 3px solid #f59e0b;
  background: var(--panel-2);
  font-size: .9rem;
  color: var(--text);
}

/* Profile — "Next steps" card shown when skill is installed org-wide */
.install-next-steps {
  padding: .9rem 1rem;
  border-radius: 6px;
  border-left: 3px solid #22c55e;
  background: var(--panel-2);
  margin: .5rem 0 1rem;
}
.install-next-steps h4 { margin: 0 0 .5rem; font-size: 1rem; }
.install-next-steps ol { padding-left: 1.25rem; margin: 0; }
.install-next-steps li { margin: .35rem 0; }
.install-next-steps pre {
  background: var(--panel);
  padding: .65rem .85rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: .85rem;
  line-height: 1.45;
  margin: .35rem 0 0;
}

/* Wraps a <pre> with an absolutely-positioned Copy button in the corner. */
.copy-wrap { position: relative; }
.copy-wrap pre { padding-right: 4.25rem; }
.copy-wrap .copy-btn {
  position: absolute;
  top: .35rem;
  right: .35rem;
}

/* Token card — status indicator (does a token exist for this user?) */
.token-status {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .75rem;
  font-size: .9rem;
}
.token-status-dot {
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}
.token-status.on .token-status-dot { background: #22c55e; }
.token-status.off .token-status-dot { background: var(--muted); }

/* Token result — inline token + copy button on one line */
.token-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.token-row .token-value {
  background: var(--panel-2);
  padding: .2rem .45rem;
  border-radius: 4px;
  word-break: break-all;
}
.install-next-steps code { font-size: .9em; }

/* Collapsed manual install disclosure */
#install-manual { margin-top: .5rem; }
#install-manual > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: .9rem;
  padding: .35rem 0;
  user-select: none;
}
#install-manual[open] > summary { margin-bottom: .5rem; }
#install-manual > summary:hover { color: var(--accent); }

/* Admin settings — checkbox row */
.settings-checkbox {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 1rem 0 .25rem;
  cursor: pointer;
}
.settings-checkbox input { width: auto; margin: 0; }

/* Install modal (admin /settings) */
.install-modal-content { max-width: 760px; }
.install-modal-content .modal-close {
  position: absolute;
  top: .75rem;
  right: .9rem;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}
.install-modal-content .modal-close:hover { color: var(--text); }
.install-modal-content { position: relative; }

/* Long-retention badge — shown next to the days input in the edit modal,
   and inline on admin-pages rows. */
.lr-badge {
  display: inline-block;
  font-size: .7rem;
  background: rgba(99, 102, 241, .18);
  color: #a5b4fc;
  padding: .1rem .4rem;
  border-radius: 6px;
  margin-left: .4rem;
  font-weight: 500;
  letter-spacing: .02em;
}
.badge.lr {
  background: #6366f1;
  color: #ffffff;
  border-color: rgba(99, 102, 241, .6);
}
