.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-overlay);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: #21262d; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-muted); }
.btn-ghost { background: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: var(--text-sm); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.field label { font-size: var(--text-sm); color: var(--text-muted); }
.field .hint { font-size: var(--text-xs); color: var(--text-faint); }
.field.error label { color: var(--danger); }
.field.error .hint[data-error="1"] { color: var(--danger); }
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
}
.field.error .input, .field.error .select, .field.error .textarea { border-color: var(--danger); }

.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
table.data th, table.data td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data th {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-raised);
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data tbody tr:hover { background: rgba(255,255,255,0.02); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-overlay);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-blue { color: var(--accent-hover); border-color: transparent; background: var(--accent-muted); }
.badge-green { color: var(--success); border-color: transparent; background: var(--success-muted); }
.badge-red { color: var(--danger); border-color: transparent; background: var(--danger-muted); }
.badge-yellow { color: var(--warning); border-color: transparent; background: var(--warning-muted); }

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}
.app-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: var(--space-3);
  align-items: start;
  text-decoration: none;
  color: inherit;
}
.app-card:hover { border-color: var(--border-strong); text-decoration: none; }
.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  object-fit: cover;
}
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
  overflow-x: auto;
}
.tabs button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 10px 14px;
  cursor: pointer;
  margin-bottom: -1px;
}
.tabs button[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.panel-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.panel-state h2 { margin-bottom: 8px; color: var(--text); }
.skeleton {
  background: linear-gradient(90deg, var(--bg-overlay) 25%, #21262d 37%, var(--bg-overlay) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
  border-radius: var(--radius-sm);
  height: 14px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.toast-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
  width: min(360px, calc(100vw - 32px));
}
.toast {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
  font-size: var(--text-sm);
}
.toast.error { border-color: var(--danger); }
.toast.success { border-color: var(--success); }

dialog.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  box-shadow: var(--shadow);
}
dialog.modal::backdrop { background: rgba(1, 4, 9, 0.65); }
.modal-head, .modal-body, .modal-foot { padding: var(--space-4) var(--space-5); }
.modal-head { border-bottom: 1px solid var(--border); }
.modal-foot {
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

.dropzone {
  display: block;
  position: relative;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg);
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-muted); color: var(--text); }
.progress {
  height: 6px;
  background: var(--bg-overlay);
  border-radius: 3px;
  overflow: hidden;
}
.progress > span { display: block; height: 100%; background: var(--accent); width: 0%; }

.list-item {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}
.list-item:hover { background: rgba(255,255,255,0.03); text-decoration: none; }
.list-item.active { background: var(--accent-muted); }

.list-item-global {
  background: rgba(56, 139, 253, 0.05);
  box-shadow: inset 2px 0 0 rgba(56, 139, 253, 0.5);
}
.list-item-global:hover { background: rgba(56, 139, 253, 0.08); }
.list-item-global.active { background: var(--accent-muted); box-shadow: inset 2px 0 0 var(--accent); }
.list-item-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.badge-sm { height: 18px; padding: 0 6px; font-size: 10.5px; letter-spacing: 0.02em; flex: none; }

.thread-note {
  padding: 8px var(--space-4);
  border-bottom: 1px solid var(--border);
  background: rgba(56, 139, 253, 0.04);
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: var(--text-sm); }
.kv dt { color: var(--text-muted); }
.chat-thread { display: flex; flex-direction: column; gap: 8px; padding: var(--space-4); }
.bubble {
  max-width: 72%;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-overlay);
  font-size: var(--text-sm);
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.mine { align-self: flex-end; background: var(--accent-muted); }
.composer {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}
.section { margin-bottom: var(--space-6); }
.section h2 { margin-bottom: var(--space-3); font-size: var(--text-lg); }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
}
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.skel-line { height: 14px; margin-bottom: 10px; }
.skel-line.lg { height: 20px; }
.min-w-0 { min-width: 0; }
.chat-thread {
  flex: 1;
  min-height: 280px;
  max-height: calc(100vh - var(--topbar) - 220px);
  overflow: auto;
}
.split-pane { display: flex; flex-direction: column; }
table.data .app-icon { width: 32px; height: 32px; border-radius: 6px; }

/* Apps catalog — page-scoped, does not restyle other Dev Panel screens */
.apps-catalog { max-width: 1280px; }
.apps-head { margin-bottom: var(--space-4); }
.apps-head h1 { font-size: 22px; line-height: 1.2; }
.apps-count { margin-top: 4px; font-size: var(--text-sm); }
.apps-toolbar-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  margin-bottom: var(--space-4);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.apps-catalog .apps-search {
  width: 100%;
  height: 36px;
}
.apps-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.apps-filters,
.apps-toolbar-side {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}
.apps-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.apps-field-label {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.apps-catalog .apps-select {
  width: auto;
  min-width: 138px;
  max-width: 220px;
  height: 32px;
  padding: 4px 8px;
}
.apps-view { display: flex; gap: 4px; }
.apps-view .icon-btn.is-active {
  border-color: var(--accent);
  color: var(--accent-hover);
  background: var(--accent-muted);
}
.apps-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.apps-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
}
.apps-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.apps-list-head h2 { font-size: var(--text-md); }
.apps-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.apps-row,
.apps-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: start;
  padding: 10px 12px;
}
.apps-row + .apps-row { border-top: 1px solid var(--border); }
.apps-row:hover,
.apps-card:hover { background: rgba(255,255,255,0.025); }
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}
.apps-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.apps-icon,
.apps-icon-skel {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--border);
}
.apps-icon-fallback {
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.apps-row-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.apps-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.apps-name {
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.apps-name:hover { color: var(--accent-hover); text-decoration: underline; }
.apps-flags { display: flex; flex-wrap: wrap; gap: 4px; flex-shrink: 0; }
.apps-id { font-size: 11px; }
.apps-meta {
  font-size: var(--text-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.apps-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
}
.apps-catalog a.btn {
  color: var(--text);
  text-decoration: none;
}
.apps-catalog a.btn:hover { color: var(--text); text-decoration: none; }
.apps-more { position: relative; }
.apps-more > summary {
  list-style: none;
  cursor: pointer;
}
.apps-more > summary::-webkit-details-marker { display: none; }
.apps-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 168px;
  padding: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 8;
}
.apps-more-menu a {
  display: block;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: var(--text-sm);
}
.apps-more-menu a:hover { background: var(--bg-overlay); text-decoration: none; }
.apps-state {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: 28px 16px;
  text-align: center;
}
.apps-state h2 { margin-bottom: 6px; font-size: var(--text-lg); }
.apps-state-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  color: var(--text-faint);
}
.apps-state-icon svg { width: 36px; height: 36px; }
.apps-state-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.apps-state-error { text-align: left; padding: 16px; }
.apps-skel .skel-line { max-width: 70%; }
.apps-catalog a.btn-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.apps-catalog a.btn-primary:hover { color: #fff; background: var(--accent-hover); }
.apps-row-actions { flex-wrap: wrap; }

.form-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.form-section > h2 {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 650;
}
.app-context {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-bottom: 6px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.rel-form .dropzone,
.rel-page .dropzone {
  padding: 14px 12px;
  text-align: left;
}
.dropzone-title { display: block; font-weight: 600; }
.dropzone-file { display: block; margin-top: 4px; font-size: var(--text-sm); }
.dropzone.has-file { border-color: var(--accent); }

.version-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.version-group-title {
  margin: 0;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.version-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.version-item:last-child { border-bottom: 0; }
.version-item:hover { background: rgba(255,255,255,0.025); }

/* Versions workspace — master/detail, not the old stacked upload form */
.ver-page {
  max-width: none;
  min-height: calc(100vh - var(--topbar) - 48px);
  display: flex;
  flex-direction: column;
}
.ver-page > .page-head { margin-bottom: 12px; }
.ver-page a.btn {
  color: inherit;
  text-decoration: none;
}
.ver-page a.btn:hover { color: inherit; text-decoration: none; }
.ver-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  overflow: hidden;
}
.ver-catalog {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--border);
  background: var(--bg);
}
.ver-catalog-head {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ver-catalog-head h2 {
  font-size: var(--text-sm);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ver-catalog-list {
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.ver-catalog-foot {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ver-catalog-count { margin: 0; font-size: var(--text-xs); }
.ver-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.ver-item-list { display: flex; flex-direction: column; }
.ver-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.ver-item:hover { background: rgba(255,255,255,0.03); }
.ver-item.is-selected {
  background: rgba(56, 139, 253, 0.12);
  box-shadow: inset 2px 0 0 var(--accent);
}
.ver-item-main { min-width: 0; }
.ver-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ver-item-name {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.ver-item-meta {
  font-size: var(--text-xs);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ver-item-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ver-item .apps-icon,
.ver-item .apps-icon-fallback {
  width: 32px;
  height: 32px;
  font-size: 12px;
}
.ver-work {
  min-width: 0;
  overflow: auto;
  background: var(--bg-raised);
}
.ver-work-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ver-ident {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.ver-ident-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg);
}
.ver-ident-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ver-ident-top h2 {
  font-size: var(--text-lg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ver-ident-actions { justify-content: flex-end; }
.ver-work-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.ver-work-toolbar h3 { font-size: var(--text-sm); margin: 0; }
.ver-seg { display: flex; gap: 4px; flex-wrap: wrap; }
.ver-install-target { margin: 10px 0 14px; font-size: var(--text-sm); }
.ver-install-target .mono { color: var(--text-muted); }
.ver-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
}
.ver-empty h2,
.ver-empty h3 { margin-bottom: 6px; color: var(--text); }
.ver-empty .btn { margin-top: 12px; }
.ver-empty-work { padding-top: 48px; }
.ver-table { margin-top: 0; }
.ver-table table.data { min-width: 760px; }
.ver-td-actions { white-space: nowrap; }
.ver-create {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
}
.ver-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--bg);
}
.ver-block h3 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.ver-locked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 6px;
}
.ver-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ver-files { display: flex; flex-direction: column; gap: 8px; }
.ver-files-hint { margin-bottom: 8px; }
.ver-create .dropzone {
  padding: 12px;
  text-align: left;
}
.ver-create .field { margin-bottom: 0; }
.ver-install { display: flex; flex-direction: column; gap: 8px; }
.ver-install .field { margin-bottom: 0; }
.rel-page .ver-install { margin: 12px 0; }
.ver-upload { display: flex; flex-direction: column; gap: 6px; }
.ver-current {
  margin-bottom: 10px;
  font-size: var(--text-sm);
  word-break: break-all;
}
.ver-cache-list {
  list-style: none;
  padding: 0;
  margin: 0 0 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-sm);
}
.ver-cache-list li { display: flex; flex-wrap: wrap; gap: 6px; word-break: break-all; }
.rel-page .form-section > .faint { margin-top: 8px; font-size: var(--text-xs); }

@media (max-width: 1100px) {
  .ver-ident {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .ver-ident-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 900px) {
  .ver-workspace { grid-template-columns: 1fr; }
  .ver-catalog {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 42vh;
  }
  .ver-grid { grid-template-columns: 1fr; }
  .apps-row,
  .apps-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .apps-row-actions {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .apps-catalog .apps-select { min-width: 0; flex: 1 1 140px; max-width: 100%; }
  .version-item { grid-template-columns: 1fr; }
}

/* Profile */
.pf { max-width: 880px; }
.pf-hero {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding-bottom: var(--space-6);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}
.pf-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
}
.pf-avatar-empty {
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 600;
  color: var(--text-muted);
}
.pf-id { min-width: 0; }
.pf-id h1 { font-size: var(--text-2xl); line-height: 1.2; }
.pf-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 6px;
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.pf-meta .mono { color: var(--text-faint); font-size: var(--text-xs); align-self: center; }

.pf-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  margin-bottom: var(--space-8);
}
.pf-stat { padding: 14px 18px; }
.pf-stat + .pf-stat { border-left: 1px solid var(--border); }
.pf-stat-value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.pf-stat-label { margin-top: 2px; font-size: var(--text-xs); color: var(--text-muted); }

.pf-block { margin-bottom: var(--space-8); }
.pf-block > h2 { font-size: var(--text-lg); margin-bottom: var(--space-3); }
.pf-bio { white-space: pre-wrap; color: var(--text); }
.pf-lead { color: var(--text-muted); font-size: var(--text-sm); margin-bottom: var(--space-4); max-width: 640px; }

.pf-perm-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-3);
}
.pf-perm-group > h3 {
  padding: 8px 16px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}
.pf-perm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 12px 16px;
}
.pf-perm + .pf-perm { border-top: 1px solid var(--border); }
.pf-perm-text { min-width: 0; }
.pf-perm-title { font-weight: 600; font-size: var(--text-md); }
.pf-perm-desc { margin-top: 2px; font-size: var(--text-sm); color: var(--text-muted); }
.pf-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: var(--text-xs);
  font-weight: 600;
}
.pf-state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pf-state.is-on { color: var(--success); background: var(--success-muted); }
.pf-state.is-off { color: var(--danger); background: var(--danger-muted); }
.pf-req {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.pf-req strong { color: var(--text); font-variant-numeric: tabular-nums; }

.pf-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-2); }
.pf-app {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
}
.pf-app:hover { border-color: var(--border-strong); text-decoration: none; background: rgba(255,255,255,0.02); }
.pf-app-icon { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg-overlay); }
.pf-app-name { font-weight: 600; }

@media (max-width: 640px) {
  .pf-hero { gap: var(--space-4); }
  .pf-avatar { width: 56px; height: 56px; }
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-stat:nth-child(3) { border-left: 0; }
  .pf-stat:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .pf-perm { align-items: flex-start; }
}

