:root {
  color-scheme: light;
  --ink: #172132;
  --muted: #6f7b8d;
  --line: #e4e9f0;
  --line-soft: #edf0f4;
  --surface: #ffffff;
  --surface-soft: #fafbfd;
  --surface-muted: #f1f4f8;
  --surface-tint: #f6f2ff;
  --input: #ffffff;
  --canvas: #f5f7fa;
  --navy: #15243b;
  --navy-soft: #213450;
  --accent: #e86f3c;
  --accent-dark: #cc5425;
  --blue: #3276d2;
  --green: #188566;
  --success: #188566;
  --warning: #a86713;
  --danger: #b5473f;
  --shadow: 0 10px 30px rgba(23, 33, 50, 0.06);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8eef7;
  --muted: #aab6c7;
  --line: #344155;
  --line-soft: #2b3748;
  --surface: #1b2432;
  --surface-soft: #202b3b;
  --surface-muted: #273345;
  --surface-tint: #29253c;
  --input: #151e2b;
  --canvas: #111720;
  --navy: #0b111b;
  --navy-soft: #26354b;
  --accent: #ff8654;
  --accent-dark: #ff9d76;
  --blue: #79b4ff;
  --green: #58c9a3;
  --success: #58c9a3;
  --warning: #f1b75e;
  --danger: #ff8d84;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 24px 18px 18px; color: #dce5f1;
  background: linear-gradient(180deg, var(--navy) 0%, #101c2f 100%);
  z-index: 20;
}
.brand, .login-brand { display: flex; align-items: center; gap: 12px; }
.brand { padding: 0 10px 26px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px;
  background: var(--accent); color: white; font-size: 15px; font-weight: 900; letter-spacing: -1px;
  box-shadow: 0 8px 20px rgba(232, 111, 60, 0.25);
}
.brand-mark.large { width: 52px; height: 52px; font-size: 18px; border-radius: 16px; }
.brand strong, .login-brand strong { display: block; color: #fff; font-size: 16px; }
.brand span, .login-brand span { display: block; margin-top: 2px; font-size: 11px; color: #93a5bc; }

.side-nav { display: grid; gap: 4px; }
.side-nav a {
  min-height: 44px; display: grid; grid-template-columns: 27px 1fr auto; align-items: center;
  gap: 8px; padding: 9px 12px; border-radius: 10px; color: #afbed1; font-size: 14px;
  transition: background .18s ease, color .18s ease;
}
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: var(--navy-soft); color: #fff; box-shadow: inset 3px 0 var(--accent); }
.side-nav b { min-width: 22px; padding: 3px 7px; border-radius: 20px; background: rgba(255,255,255,.08); font-size: 11px; text-align: center; }
.nav-icon { font-size: 17px; text-align: center; color: #8fa4bf; }
.side-nav a.active .nav-icon { color: #ff9c73; }
.sidebar-section { margin: 26px 12px 8px; color: #6f829c; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-user {
  display: grid; grid-template-columns: 38px 1fr auto auto; align-items: center; gap: 7px;
  margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user strong { display: block; max-width: 120px; overflow: hidden; color: #fff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user span { display: block; margin-top: 2px; color: #8295ae; font-size: 10px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #2c4260; font-weight: 800; }
.icon-button { border: 0; padding: 8px; color: inherit; background: transparent; cursor: pointer; }
.theme-toggle {
  display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; color: #d9e4f1; background: rgba(255,255,255,.06); font-size: 17px;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.theme-toggle:hover { border-color: rgba(255,255,255,.24); color: #fff; background: rgba(255,255,255,.11); transform: translateY(-1px); }
.mobile-theme-toggle { margin-left: auto; border-color: var(--line); color: var(--ink); background: var(--surface-muted); }
.login-theme-toggle { position: absolute; top: 24px; right: 24px; border-color: var(--line); color: var(--ink); background: var(--surface-soft); }

.main { min-width: 0; padding: 38px 42px 60px; }
.mobile-header { display: none; }
.messages { position: fixed; z-index: 40; top: 20px; right: 24px; width: min(390px, calc(100vw - 48px)); }
.message { margin-bottom: 8px; padding: 13px 16px; border: 1px solid #badccc; border-radius: 10px; background: #ecf8f2; box-shadow: var(--shadow); color: #17674f; font-size: 13px; }
.message.error { border-color: #f1c6c0; color: #9c362d; background: #fff1ef; }

.page-head, .detail-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  max-width: 1500px; margin: 0 auto 26px;
}
.page-head.compact { align-items: start; margin-bottom: 20px; }
.page-head h1, .detail-head h1 { margin: 6px 0 7px; font-size: clamp(28px, 3vw, 42px); line-height: 1.08; letter-spacing: -.035em; }
.page-head p, .detail-head p { max-width: 780px; margin: 0; color: var(--muted); line-height: 1.55; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.button {
  display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 750;
  font-size: 13px; white-space: nowrap; cursor: pointer; transition: .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.button.primary { color: #fff; background: var(--accent); box-shadow: 0 8px 18px rgba(232,111,60,.18); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { border-color: #ced7e3; color: #34445b; background: #fff; }
.button.secondary:hover, .button.ghost:hover { border-color: #aebed0; background: #f8fafc; }
.button.ghost { border-color: var(--line); color: #58677b; background: transparent; }
.button.wide, .wide { width: 100%; }

.filter-bar {
  display: grid; grid-template-columns: minmax(240px, 1fr) 190px 210px auto; gap: 10px;
  max-width: 1500px; margin: 0 auto 22px; padding: 11px; border: 1px solid var(--line);
  border-radius: 13px; background: var(--surface); box-shadow: 0 6px 20px rgba(24,36,53,.04);
}
.search-field { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfd; }
.search-field span { color: #8290a3; font-size: 19px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; }
.filter-bar select { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; color: #4b596b; background: #fafbfd; }
.attention-banner {
  display: flex; max-width: 1500px; margin: 0 auto 14px; align-items: center; justify-content: space-between;
  gap: 12px; padding: 11px 14px; border: 1px solid #f0d38a; border-radius: 9px; color: #725616;
  background: #fff8df; font-size: 11px;
}
.attention-banner span { font-weight: 800; }
.attention-banner b { font-size: 10px; }
.nav-alert { color: #fff !important; background: #c97718 !important; }

.artifact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; max-width: 1500px; margin: 0 auto; }
.artifact-card {
  min-height: 300px; display: flex; flex-direction: column; padding: 20px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 3px 14px rgba(23,33,50,.035);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.artifact-card:hover { transform: translateY(-2px); border-color: #ccd5e0; box-shadow: var(--shadow); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.category-pill { display: inline-flex; padding: 6px 9px; border-radius: 6px; color: #49627d; background: #ecf2f8; font-size: 10px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.category-pill.extension { color: #765a16; background: #fff3cb; }
.category-pill.processing { color: #176951; background: #dff6ed; }
.category-pill.print_form { color: #7b4777; background: #f5e7f4; }
.status-dot { color: #66758a; font-size: 11px; }
.status-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #aab4c0; }
.status-dot.active::before { background: #25a37c; box-shadow: 0 0 0 3px #daf4eb; }
.status-dot.draft::before { background: #e4a732; }
.status-dot.review::before { background: var(--blue); }
.status-dot.approved::before { background: var(--success); }
.status-dot.deprecated::before { background: var(--warning); }
.status-dot.archived::before { background: var(--muted); }
.card-title { margin-bottom: 8px; font-size: 19px; font-weight: 820; line-height: 1.25; letter-spacing: -.015em; }
.card-title:hover { color: var(--accent-dark); }
.artifact-card > p { min-height: 62px; margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.ai-snippet { display: flex; gap: 8px; margin: -2px 0 14px; padding: 9px 10px; border-radius: 8px; color: #66758a; background: #f6f2ff; font-size: 11px; line-height: 1.4; }
.ai-snippet span, .ai-heading > span { display: grid; flex: 0 0 auto; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: white; background: #7156b8; font-size: 9px; font-weight: 900; }
.analysis-line { margin: -2px 0 14px; color: #778496; font-size: 10px; }
.analysis-line.queued, .analysis-line.running { color: #4a70a0; }
.analysis-line.waiting_key, .analysis-line.failed { color: #a26624; }
.card-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; padding: 13px 0; border-top: 1px solid var(--line); }
.card-meta span, .card-meta b { display: block; }
.card-meta span { margin-bottom: 3px; color: #8a96a6; font-size: 9px; text-transform: uppercase; }
.card-meta b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.card-footer span { overflow: hidden; color: #8390a0; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.card-footer a { display: grid; flex: 0 0 auto; width: 29px; height: 29px; place-items: center; border-radius: 50%; color: #66758a; background: #f1f4f8; }

.empty-state { max-width: 520px; margin: 90px auto; text-align: center; }
.empty-state > div { color: #b1bdcb; font-size: 50px; }
.empty-state h2 { margin-bottom: 5px; }
.empty-state p { margin: 0 0 18px; color: var(--muted); }
.permission-denied { max-width: 600px; }
.permission-denied h1 { margin-bottom: 7px; font-size: 28px; }
.breadcrumbs { max-width: 1500px; margin: 0 auto 22px; color: #8a96a6; font-size: 12px; }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs span { margin: 0 8px; }
.detail-head { align-items: flex-start; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.detail-head > div:first-child { max-width: 850px; }
.detail-head h1 { margin-top: 12px; }
.inline-pills { display: flex; align-items: center; gap: 13px; }
.head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 4px 16px rgba(23,33,50,.035); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, .8fr); gap: 16px; max-width: 1500px; margin: 0 auto 16px; }
.detail-grid > .panel { padding: 23px; }
.panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.panel-title h2 { margin: 4px 0 0; font-size: 20px; }
.text-link { color: var(--blue); font-size: 12px; font-weight: 700; }
.counter { min-width: 30px; padding: 5px 9px; border-radius: 20px; color: #647286; background: #eef2f6; font-size: 11px; font-weight: 800; text-align: center; }
.metadata-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--line); }
.metadata-grid > div { min-width: 0; padding: 12px 14px; background: #fafbfd; }
.metadata-grid .wide { grid-column: 1 / -1; }
.metadata-grid dt { margin-bottom: 4px; color: #8793a2; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.metadata-grid dd { margin: 0; font-size: 12px; font-weight: 700; }
.hash { overflow: hidden; color: #6e7a89; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px !important; text-overflow: ellipsis; white-space: nowrap; }
.compatibility, .notes { margin-top: 16px; }
.compatibility > span, .notes > span { display: block; margin-bottom: 8px; color: #8793a2; font-size: 9px; font-weight: 750; text-transform: uppercase; }
.compatibility > div { display: flex; flex-wrap: wrap; gap: 7px; }
.compatibility b { padding: 6px 9px; border: 1px solid #d9e2ec; border-radius: 7px; color: #52647a; background: #f7f9fb; font-size: 10px; }
.compatibility em, .muted { color: var(--muted); font-style: normal; }
.notes p { margin: 0; color: #5f6e80; font-size: 13px; line-height: 1.55; }
.ai-panel { display: flex; flex-direction: column; background: linear-gradient(145deg, #fff 40%, #faf7ff); }
.ai-heading { display: flex; align-items: center; gap: 10px; }
.ai-heading b, .ai-heading small { display: block; }
.ai-heading small { margin-top: 2px; color: #9084a9; font-size: 9px; }
.ai-panel > p { color: #536174; font-size: 13px; line-height: 1.65; }
.ai-panel > small { margin-bottom: 16px; color: #9a91aa; font-size: 9px; }
.ai-panel form { margin-top: auto; }
.analysis-status { align-self: flex-start; margin-top: 14px; padding: 5px 8px; border-radius: 20px; color: #66758a; background: #eef2f6; font-size: 9px; font-weight: 800; }
.analysis-status.queued, .analysis-status.running { color: #315f96; background: #e8f2ff; }
.analysis-status.ready { color: #147257; background: #def5ec; }
.analysis-status.waiting_key { color: #826a24; background: #fff3ce; }
.analysis-status.failed { color: #9b4036; background: #fbe8e5; }
.analysis-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 14px; }
.analysis-facts span { padding: 5px 7px; border-radius: 6px; color: #6d7887; background: #f2f4f7; font-size: 9px; }
.analysis-list { margin-bottom: 13px; color: #59687a; font-size: 10px; line-height: 1.45; }
.analysis-list > b { color: #48586d; }
.analysis-list ul { margin: 5px 0 0; padding-left: 17px; }
.analysis-list.warning { color: #8a6427; }
.section-panel { max-width: 1500px; margin: 0 auto 16px; padding: 23px; }
.audit-filter { grid-template-columns: minmax(280px, 1fr) minmax(180px, .35fr) auto; }
.audit-action { display: inline-flex; padding: 4px 6px; border-radius: 5px; color: #52647a; background: #eef3f8; font-size: 9px; }
.pagination { display: flex; max-width: 1500px; margin: 8px auto 0; align-items: center; justify-content: center; gap: 18px; color: #7d8998; font-size: 11px; }
.pagination a { color: var(--blue); font-weight: 750; }

.system-ok { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 20px; color: #167458; background: #e2f6ef; font-size: 10px; font-weight: 800; }
.system-ok i { width: 7px; height: 7px; border-radius: 50%; background: #23a57d; box-shadow: 0 0 0 3px rgba(35,165,125,.15); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; max-width: 1500px; margin: 0 auto 16px; }
.metric-card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 3px 13px rgba(23,33,50,.03); }
.metric-card span, .metric-card b, .metric-card small { display: block; }
.metric-card span { color: #7e8b9c; font-size: 9px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.metric-card b { margin: 9px 0 4px; font-size: 27px; letter-spacing: -.04em; }
.metric-card small { color: #8d98a6; font-size: 9px; }
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 1500px; margin: 0 auto; }
.status-grid > .section-panel { width: 100%; min-width: 0; }
.quota-track { height: 9px; border-radius: 20px; overflow: hidden; background: #edf1f5; }
.quota-track span { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, #2a7dcc, #47a786); }
.quota-caption { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: #7c8999; font-size: 9px; }
.quota-caption b { color: #5c6a7c; }
.disk-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.disk-facts span { padding: 8px 10px; border-radius: 7px; color: #798697; background: #f5f7f9; font-size: 9px; }
.queue-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.queue-grid > div { padding: 14px 8px; border-radius: 9px; background: #f7f9fb; text-align: center; }
.queue-grid b, .queue-grid span { display: block; }
.queue-grid b { font-size: 21px; }
.queue-grid span { margin-top: 4px; color: #8490a0; font-size: 8px; text-transform: uppercase; }
.backup-list { display: grid; }
.backup-list > div { display: grid; grid-template-columns: 38px 1fr; padding: 10px 0; border-top: 1px solid var(--line); }
.backup-list > div:first-child { border-top: 0; }
.backup-icon { display: grid; grid-row: 1 / 3; width: 30px; height: 30px; place-items: center; border-radius: 8px; color: #fff; background: #526d8c; font-size: 8px; font-weight: 900; }
.backup-list b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.backup-list small { margin-top: 3px; color: #8b96a5; font-size: 9px; }
.status-note { margin: 12px 0 0; color: #8793a2; font-size: 9px; }
.activity-list { display: grid; }
.activity-list > div { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.activity-list > div:first-child { border-top: 0; }
.activity-list i { width: 6px; height: 6px; border-radius: 50%; background: #79a3d1; }
.activity-list p { margin: 0; color: #687689; font-size: 10px; }
.activity-list p b { color: #435267; }
.activity-list time { color: #95a0ad; font-size: 8px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 9px 12px; border-bottom: 1px solid var(--line); color: #8a96a6; font-size: 9px; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
td { padding: 13px 12px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td b, td span { display: block; }
td span { margin-top: 3px; color: #7f8b9b; font-size: 10px; }
.deployment-status { display: inline-flex; padding: 5px 8px; border-radius: 20px; color: #826a24; background: #fff3ce; font-size: 9px; font-weight: 800; }
.deployment-status.installed { color: #147257; background: #def5ec; }
.deployment-status.removed { color: #7b8795; background: #edf0f4; }
.row-actions { text-align: right; white-space: nowrap; }
.text-button { border: 0; padding: 5px; color: #7a8797; background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.text-button.success { color: var(--green); }
.inline-empty { padding: 24px; border: 1px dashed #d6dde6; border-radius: 10px; color: var(--muted); background: #fafbfd; font-size: 12px; text-align: center; }
.version-list { display: grid; }
.version-row { display: grid; grid-template-columns: 46px minmax(180px, 1fr) minmax(150px, .4fr) auto; align-items: center; gap: 14px; padding: 13px 4px; border-top: 1px solid var(--line); }
.version-row:first-child { border-top: 0; }
.version-badge { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 10px; color: #5a6c82; background: #eef3f8; font-size: 11px; font-weight: 850; }
.version-main b, .version-main span, .version-meta span { display: block; }
.version-main b { font-size: 12px; }
.version-main span, .version-meta { margin-top: 3px; color: #8490a0; font-size: 10px; }
.version-actions { display: flex; gap: 13px; color: var(--blue); font-size: 10px; font-weight: 700; }

.form-panel { max-width: 980px; margin: 0 auto; padding: 25px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-field { min-width: 0; }
.form-field.wide { grid-column: 1 / -1; }
.form-field label { display: block; margin-bottom: 7px; color: #46556a; font-size: 11px; font-weight: 750; }
.form-field sup { color: var(--accent); }
.form-field input:not([type="checkbox"]):not([type="file"]), .form-field select, .form-field textarea, .login-form input {
  width: 100%; min-height: 42px; border: 1px solid #d7dee8; border-radius: 8px; padding: 10px 11px;
  outline: 0; color: var(--ink); background: #fff; transition: border .15s, box-shadow .15s;
}
.form-field textarea { resize: vertical; }
.form-field select[multiple] { min-height: 120px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, .login-form input:focus { border-color: #8aadd6; box-shadow: 0 0 0 3px rgba(50,118,210,.09); }
.form-field small { display: block; margin-top: 5px; color: #8a96a6; font-size: 9px; line-height: 1.4; }
.form-field > input[type="file"] { width: 100%; padding: 10px; border: 1px dashed #c8d2de; border-radius: 8px; color: #677589; background: #fafbfd; font-size: 11px; }
.field-error, .form-error { display: block; margin-top: 6px; color: #a83d31; font-size: 11px; }
.form-error { margin-bottom: 15px; padding: 11px 13px; border: 1px solid #f0c5bf; border-radius: 8px; background: #fff3f1; }
.field-hint { margin-top: 8px; color: #926b28; font-size: 10px; }
.field-hint.success { color: #147257; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.dropzone { position: relative; display: grid; min-height: 190px; place-items: center; align-content: center; padding: 24px; border: 1.5px dashed #bdc9d8; border-radius: 12px; background: #fafbfd; cursor: pointer; transition: .18s; text-align: center; }
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: #fff8f4; }
.dropzone.has-file { border-style: solid; border-color: #70bca2; background: #f0fbf7; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone b { margin: 8px 0 3px; font-size: 14px; }
.dropzone > span { color: var(--muted); font-size: 11px; }
.dropzone small { max-width: 440px; margin-top: 10px; color: #8490a0; }
.drop-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: var(--accent); background: #ffe9df; font-size: 21px; }

.download-layout { display: grid; grid-template-columns: minmax(0, 630px) 270px; justify-content: center; gap: 18px; margin-top: 30px; }
.download-card { padding: 28px; }
.download-card h1 { margin: 7px 0 7px; font-size: 30px; }
.download-card > p { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.file-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; }
.file-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 10px; color: #fff; background: var(--navy-soft); font-size: 10px; font-weight: 900; }
.file-preview b, .file-preview span { display: block; }
.file-preview b { font-size: 12px; }
.file-preview span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.download-card .form-field { margin-top: 15px; }
.download-note { align-self: start; padding: 20px; border-radius: 12px; color: #d8e2ef; background: var(--navy); font-size: 11px; line-height: 1.55; }
.download-note b { color: #fff; font-size: 12px; }
.download-note ol { margin: 13px 0 0; padding-left: 18px; }
.download-note li { margin-bottom: 9px; }

.directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1500px; margin: 0 auto; align-items: start; }
.directory-card { padding: 20px; }
.compact-form { display: grid; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.compact-form .form-field label { font-size: 10px; }
.compact-form input:not([type="checkbox"]), .compact-form select, .compact-form textarea { min-height: 36px; padding: 8px 9px; font-size: 11px; }
.directory-list { display: grid; max-height: 290px; margin-top: 8px; overflow-y: auto; }
.directory-list > div { padding: 10px 4px; border-bottom: 1px solid #edf0f4; }
.directory-list b, .directory-list span { display: block; }
.directory-list b { font-size: 11px; }
.directory-list span { margin-top: 3px; color: #8793a2; font-size: 9px; }
.directory-list p { color: var(--muted); font-size: 11px; text-align: center; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, .75fr); }
.login-panel { display: flex; flex-direction: column; padding: 48px 6vw; color: white; background: radial-gradient(circle at 15% 20%, #294563, transparent 34%), linear-gradient(145deg, #172b46, #0d1727); }
.login-brand { align-self: flex-start; }
.login-copy { max-width: 720px; margin: auto 0; }
.login-copy h1 { margin: 16px 0; font-size: clamp(40px, 5vw, 72px); line-height: .98; letter-spacing: -.055em; }
.login-copy p { max-width: 600px; color: #aebcd0; font-size: 16px; line-height: 1.65; }
.login-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding-top: 26px; border-top: 1px solid rgba(255,255,255,.1); }
.login-stat-row b, .login-stat-row span { display: block; }
.login-stat-row b { font-size: 18px; }
.login-stat-row span { margin-top: 4px; color: #8295ae; font-size: 10px; text-transform: uppercase; }
.login-form-wrap { position: relative; display: grid; place-items: center; padding: 35px; background: var(--surface); }
.login-form { width: min(390px, 100%); }
.login-form h2 { margin: 9px 0 6px; font-size: 30px; letter-spacing: -.03em; }
.login-form > p { margin: 0 0 28px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.login-form label { display: block; margin: 15px 0 7px; color: #46556a; font-size: 11px; font-weight: 750; }
.login-form .button { margin-top: 20px; }
.login-form > small { display: block; margin-top: 18px; color: #9aa4b1; font-size: 9px; text-align: center; }
.login-form .errorlist { margin: 0; padding: 0; list-style: none; }

/* Readable type scale: supporting text never drops below 12px. */
body { font-size: 15px; line-height: 1.5; }
.brand span, .login-brand span { font-size: 12px; }
.side-nav b { font-size: 12px; }
.sidebar-section { font-size: 12px; }
.sidebar-user strong { font-size: 14px; }
.sidebar-user span { font-size: 12px; }
.message { font-size: 14px; }
.page-head p, .detail-head p { font-size: 15px; }
.eyebrow { font-size: 12px; }
.button { min-height: 44px; font-size: 14px; }
.search-field input, .filter-bar select { font-size: 14px; }
.attention-banner, .attention-banner b { font-size: 13px; }
.category-pill { font-size: 12px; }
.status-dot { font-size: 12px; }
.artifact-card > p { font-size: 14px; }
.ai-snippet { font-size: 13px; }
.ai-snippet span, .ai-heading > span { font-size: 12px; }
.analysis-line { font-size: 12px; }
.card-meta span { font-size: 12px; }
.card-meta b { font-size: 13px; }
.card-footer span { font-size: 12px; }
.breadcrumbs { font-size: 13px; }
.text-link { font-size: 13px; }
.counter { font-size: 12px; }
.metadata-grid dt { font-size: 12px; }
.metadata-grid dd { font-size: 14px; }
.hash { font-size: 12px !important; }
.compatibility > span, .notes > span { font-size: 12px; }
.compatibility b { font-size: 12px; }
.notes p, .ai-panel > p { font-size: 14px; }
.ai-heading small, .ai-panel > small { font-size: 12px; }
.analysis-status { font-size: 12px; }
.analysis-facts span { font-size: 12px; }
.analysis-list { font-size: 13px; }
.audit-action { font-size: 12px; }
.pagination { font-size: 13px; }
.system-ok { font-size: 12px; }
.metric-card span { font-size: 12px; }
.metric-card small { font-size: 12px; }
.quota-caption { font-size: 12px; }
.disk-facts span { font-size: 12px; }
.queue-grid span { font-size: 12px; }
.backup-icon { font-size: 12px; }
.backup-list b { font-size: 13px; }
.backup-list small, .status-note { font-size: 12px; }
.activity-list p { font-size: 12px; }
.activity-list time { font-size: 12px; }
table { font-size: 13px; }
th { font-size: 12px; }
td span { font-size: 12px; }
.deployment-status { font-size: 12px; }
.text-button { font-size: 12px; }
.inline-empty { font-size: 13px; }
.version-badge { font-size: 13px; }
.version-main b { font-size: 14px; }
.version-main span, .version-meta { font-size: 12px; }
.version-actions { font-size: 12px; }
.form-field label { font-size: 13px; }
.form-field input:not([type="checkbox"]):not([type="file"]), .form-field select, .form-field textarea, .login-form input {
  min-height: 46px; font-size: 14px;
}
.form-field small { font-size: 12px; }
.form-field > input[type="file"] { font-size: 13px; }
.field-error, .form-error, .field-hint { font-size: 12px; }
.dropzone b { font-size: 16px; }
.dropzone > span, .dropzone small { font-size: 13px; }
.download-card > p { font-size: 14px; }
.file-icon { font-size: 12px; }
.file-preview b { font-size: 14px; }
.file-preview span { font-size: 12px; }
.download-note { font-size: 13px; }
.download-note b { font-size: 14px; }
.compact-form .form-field label { font-size: 12px; }
.compact-form input:not([type="checkbox"]), .compact-form select, .compact-form textarea { min-height: 42px; font-size: 13px; }
.directory-list b { font-size: 13px; }
.directory-list span { font-size: 12px; }
.directory-list p { font-size: 13px; }
.login-stat-row span { font-size: 12px; }
.login-form > p { font-size: 14px; }
.login-form label { font-size: 13px; }
.login-form > small { font-size: 12px; }
.form-field .required,
.form-field [aria-hidden="true"],
.form-field sup { font-size: 12px; }

/* Complete dark palette for application and authentication pages. */
html[data-theme="dark"] .sidebar {
  color: #dce6f4;
  background: linear-gradient(180deg, #0b111b 0%, #080d15 100%);
}
html[data-theme="dark"] .side-nav a { color: #b8c6d9; }
html[data-theme="dark"] .side-nav a:hover { background: rgba(255,255,255,.08); }
html[data-theme="dark"] .sidebar-section { color: #8ea0b8; }
html[data-theme="dark"] .sidebar-user { border-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .avatar { color: #f2f6fb; background: #30435f; }
html[data-theme="dark"] .message { border-color: #315f50; color: #9be0c7; background: #17342c; }
html[data-theme="dark"] .message.error { border-color: #6c403e; color: #ffb2aa; background: #3a2325; }
html[data-theme="dark"] .button.secondary {
  border-color: #46566c; color: #dce5f1; background: var(--surface-soft);
}
html[data-theme="dark"] .button.secondary:hover,
html[data-theme="dark"] .button.ghost:hover { border-color: #61738d; background: var(--surface-muted); }
html[data-theme="dark"] .button.ghost { color: #c2cede; }
html[data-theme="dark"] .filter-bar { box-shadow: 0 8px 24px rgba(0,0,0,.18); }
html[data-theme="dark"] .search-field,
html[data-theme="dark"] .filter-bar select { color: var(--ink); background: var(--input); }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #718097; opacity: 1; }
html[data-theme="dark"] .attention-banner { border-color: #6f5a2b; color: #f2d58e; background: #332c1c; }
html[data-theme="dark"] .artifact-card:hover { border-color: #53647c; }
html[data-theme="dark"] .category-pill { color: #b8d4f2; background: #263c55; }
html[data-theme="dark"] .category-pill.extension { color: #f4d885; background: #443a20; }
html[data-theme="dark"] .category-pill.processing { color: #9be0c7; background: #203e35; }
html[data-theme="dark"] .category-pill.print_form { color: #e6b8e3; background: #402d43; }
html[data-theme="dark"] .status-dot { color: #b2bfd0; }
html[data-theme="dark"] .status-dot.active::before { box-shadow: 0 0 0 3px #23463b; }
html[data-theme="dark"] .ai-snippet { color: #c8c2df; background: var(--surface-tint); }
html[data-theme="dark"] .analysis-line { color: #aab7c9; }
html[data-theme="dark"] .card-meta span,
html[data-theme="dark"] .card-footer span,
html[data-theme="dark"] .breadcrumbs { color: #9daabc; }
html[data-theme="dark"] .card-footer a { color: #c5d0df; background: var(--surface-muted); }
html[data-theme="dark"] .empty-state > div { color: #64738a; }
html[data-theme="dark"] .counter,
html[data-theme="dark"] .version-badge { color: #c0ccdc; background: var(--surface-muted); }
html[data-theme="dark"] .metadata-grid > div,
html[data-theme="dark"] .file-preview,
html[data-theme="dark"] .inline-empty { background: var(--surface-soft); }
html[data-theme="dark"] .metadata-grid dt,
html[data-theme="dark"] .compatibility > span,
html[data-theme="dark"] .notes > span { color: #a4b0c1; }
html[data-theme="dark"] .hash,
html[data-theme="dark"] .notes p { color: #bdc8d7; }
html[data-theme="dark"] .compatibility b { border-color: #405068; color: #c8d4e3; background: var(--surface-soft); }
html[data-theme="dark"] .ai-panel { background: linear-gradient(145deg, var(--surface) 40%, #252238); }
html[data-theme="dark"] .ai-heading small,
html[data-theme="dark"] .ai-panel > small { color: #aaa2be; }
html[data-theme="dark"] .ai-panel > p,
html[data-theme="dark"] .analysis-list { color: #c1ccda; }
html[data-theme="dark"] .analysis-status { color: #c4cfde; background: var(--surface-muted); }
html[data-theme="dark"] .analysis-status.queued,
html[data-theme="dark"] .analysis-status.running { color: #a9ccfa; background: #223851; }
html[data-theme="dark"] .analysis-status.ready { color: #9be0c7; background: #203e35; }
html[data-theme="dark"] .analysis-status.waiting_key { color: #efd48e; background: #443a20; }
html[data-theme="dark"] .analysis-status.failed { color: #ffb2aa; background: #46282a; }
html[data-theme="dark"] .analysis-facts span { color: #b9c5d5; background: var(--surface-muted); }
html[data-theme="dark"] .audit-action { color: #c4d3e5; background: var(--surface-muted); }
html[data-theme="dark"] .system-ok { color: #a5e4ce; background: #203e35; }
html[data-theme="dark"] .metric-card { box-shadow: 0 6px 18px rgba(0,0,0,.15); }
html[data-theme="dark"] .metric-card span,
html[data-theme="dark"] .metric-card small,
html[data-theme="dark"] .quota-caption,
html[data-theme="dark"] .activity-list time { color: #a4b1c3; }
html[data-theme="dark"] .quota-caption b,
html[data-theme="dark"] .activity-list p b { color: #d4deea; }
html[data-theme="dark"] .quota-track { background: var(--surface-muted); }
html[data-theme="dark"] .disk-facts span,
html[data-theme="dark"] .queue-grid > div { color: #b9c5d5; background: var(--surface-soft); }
html[data-theme="dark"] .queue-grid span,
html[data-theme="dark"] .backup-list small,
html[data-theme="dark"] .status-note,
html[data-theme="dark"] .activity-list p { color: #a6b3c5; }
html[data-theme="dark"] .backup-icon { background: #47688d; }
html[data-theme="dark"] td { border-color: var(--line-soft); }
html[data-theme="dark"] th,
html[data-theme="dark"] td span { color: #a5b2c4; }
html[data-theme="dark"] .deployment-status { color: #efd48e; background: #443a20; }
html[data-theme="dark"] .deployment-status.installed { color: #9be0c7; background: #203e35; }
html[data-theme="dark"] .deployment-status.removed { color: #bac5d3; background: var(--surface-muted); }
html[data-theme="dark"] .text-button { color: #b4c0d0; }
html[data-theme="dark"] .version-row,
html[data-theme="dark"] .backup-list > div,
html[data-theme="dark"] .activity-list > div,
html[data-theme="dark"] .directory-list > div { border-color: var(--line-soft); }
html[data-theme="dark"] .version-main span,
html[data-theme="dark"] .version-meta,
html[data-theme="dark"] .directory-list span { color: #a5b2c4; }
html[data-theme="dark"] .form-field label,
html[data-theme="dark"] .login-form label { color: #d1dbe8; }
html[data-theme="dark"] .form-field input:not([type="checkbox"]):not([type="file"]),
html[data-theme="dark"] .form-field select,
html[data-theme="dark"] .form-field textarea,
html[data-theme="dark"] .login-form input {
  border-color: #405068; color: var(--ink); background: var(--input);
}
html[data-theme="dark"] .form-field small { color: #a5b2c4; }
html[data-theme="dark"] .form-field > input[type="file"] { border-color: #46566d; color: #bdc9d8; background: var(--input); }
html[data-theme="dark"] .form-error { border-color: #70413f; color: #ffb2aa; background: #3a2325; }
html[data-theme="dark"] .field-error { color: #ffaaa2; }
html[data-theme="dark"] .field-hint { color: #e1c377; }
html[data-theme="dark"] .field-hint.success { color: #8cdbbe; }
html[data-theme="dark"] .dropzone { border-color: #53647a; background: var(--surface-soft); }
html[data-theme="dark"] .dropzone:hover,
html[data-theme="dark"] .dropzone.dragging { background: #302920; }
html[data-theme="dark"] .dropzone.has-file { border-color: #4d9a80; background: #1d372f; }
html[data-theme="dark"] .dropzone small { color: #a5b2c4; }
html[data-theme="dark"] .drop-icon { background: #4a2b22; }
html[data-theme="dark"] .directory-list p { color: var(--muted); }
html[data-theme="dark"] .login-form-wrap { background: var(--canvas); }
html[data-theme="dark"] .login-form > small { color: #a4b1c3; }
html[data-theme="dark"] .mobile-header { background: rgba(17,23,32,.94); }

@media (max-width: 1100px) {
  .main { padding: 30px 26px 50px; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; min-height: 42px; }
  .detail-grid { grid-template-columns: 1fr; }
  .directory-grid { grid-template-columns: 1fr; }
  .directory-card { display: grid; grid-template-columns: minmax(260px, .7fr) 1fr; gap: 20px; }
  .directory-card .panel-title { grid-column: 1 / -1; }
  .directory-list { margin-top: 0; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: 270px; transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 60px rgba(0,0,0,.25); }
  .main { padding: 76px 18px 40px; }
  .mobile-header { position: fixed; z-index: 15; top: 0; right: 0; left: 0; display: flex; height: 56px; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(10px); }
  .page-head, .detail-head { align-items: stretch; flex-direction: column; }
  .head-actions { justify-content: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.wide { grid-column: auto; }
  .status-grid { grid-template-columns: 1fr; }
  .download-layout { grid-template-columns: 1fr; }
  .download-note { order: -1; }
  .login-page { grid-template-columns: 1fr; }
  .login-panel { min-height: 42vh; padding: 28px 25px; }
  .login-copy { margin: 60px 0 30px; }
  .login-copy h1 { font-size: clamp(34px, 10vw, 52px); }
  .login-stat-row { display: none; }
  .login-form-wrap { min-height: 58vh; }
}

@media (max-width: 580px) {
  .page-head .button { width: 100%; }
  .filter-bar { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .filter-bar select, .filter-bar .button { min-height: 42px; }
  .metric-grid { grid-template-columns: 1fr; }
  .queue-grid { grid-template-columns: repeat(2, 1fr); }
  .artifact-grid { grid-template-columns: 1fr; }
  .artifact-card { min-height: 280px; }
  .metadata-grid { grid-template-columns: 1fr; }
  .metadata-grid .wide { grid-column: auto; }
  .detail-head .button { flex: 1 1 auto; }
  .version-row { grid-template-columns: 42px 1fr; }
  .version-meta, .version-actions { grid-column: 2; }
  .directory-card { display: block; }
  .directory-list { margin-top: 15px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .login-form-wrap { padding: 32px 20px; }
}

/* Calm, progressive interface: common actions stay visible, advanced tools open on demand. */
.nav-disclosure {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.09);
}
.nav-disclosure > summary {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 9px;
  color: #91a3bb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}
.nav-disclosure > summary::-webkit-details-marker,
.filter-disclosure > summary::-webkit-details-marker,
.form-advanced > summary::-webkit-details-marker,
.directory-create > summary::-webkit-details-marker,
.action-menu > summary::-webkit-details-marker,
.technical-details > summary::-webkit-details-marker { display: none; }
.nav-disclosure > summary:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-disclosure > summary > span:last-child,
.filter-disclosure > summary > span:last-child,
.form-advanced > summary > span:last-child,
.technical-details > summary > span:last-child { transition: transform .18s ease; }
.nav-disclosure[open] > summary > span:last-child,
.filter-disclosure[open] > summary > span:last-child,
.form-advanced[open] > summary > span:last-child,
.technical-details[open] > summary > span:last-child { transform: rotate(180deg); }
.nav-disclosure .side-nav { margin-top: 4px; }

.page-head-simple { margin-bottom: 24px; }
.page-head-simple h1 { margin-top: 0; }
.page-head-simple p { max-width: 660px; }

.filter-bar-simple {
  position: relative;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  overflow: visible;
}
.filter-bar-simple .search-field { min-height: 44px; }
.filter-bar-simple .search-submit { min-width: 92px; }
.filter-disclosure { position: relative; }
.filter-disclosure > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.filter-disclosure > summary b {
  padding: 2px 6px;
  border-radius: 10px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 12px;
}
.filter-popover {
  position: absolute;
  z-index: 12;
  top: calc(100% + 8px);
  right: 0;
  width: min(380px, calc(100vw - 40px));
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(18,28,42,.16);
}
.filter-popover label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 750; }
.filter-popover select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--input); }
.filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.active-filters {
  display: flex;
  margin: -8px 0 18px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.active-filters a { color: var(--blue); font-weight: 750; }

.artifact-card {
  min-height: 0;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 5px 18px rgba(23,33,50,.04);
}
.artifact-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.artifact-card > p { min-height: 0; margin-bottom: 16px; }
.ai-snippet {
  margin: 0 0 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}
.ai-snippet span { flex: 0 0 auto; }
.card-meta { margin-top: auto; }
.card-footer a {
  display: inline-flex;
  width: auto;
  height: auto;
  border-radius: 0;
  color: var(--blue);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.guided-form { max-width: 1040px; margin-inline: auto; padding: 0; overflow: hidden; }
.form-section { padding: 26px 30px; border-bottom: 1px solid var(--line-soft); }
.form-section-head {
  display: flex;
  margin-bottom: 22px;
  align-items: flex-start;
  gap: 12px;
}
.form-section-head > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 13px;
  font-weight: 850;
}
.form-section-head h2 { margin: 0; font-size: 18px; }
.form-section-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.form-advanced { margin: 16px 30px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.form-advanced > summary {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}
.form-advanced > summary > span:first-child { display: grid; gap: 2px; }
.form-advanced > summary small { color: var(--muted); font-size: 12px; font-weight: 500; }
.form-advanced > .form-grid { padding: 0 16px 18px; }
.sticky-actions { margin: 0; padding: 18px 30px; background: var(--surface); }

.directory-card .panel-title p { margin: 5px 0 0; color: var(--muted); font-size: 13px; font-weight: 400; }
.directory-create { margin: 14px 0 18px; }
.directory-create > summary { display: flex; width: 100%; justify-content: center; list-style: none; }
.directory-create[open] > summary { margin-bottom: 14px; color: var(--blue); }
.directory-create .compact-form { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }

.action-menu { position: relative; }
.action-menu > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.action-menu > div {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  display: grid;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.action-menu > div a { padding: 10px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.action-menu > div a:hover { color: var(--blue); background: var(--surface-muted); }
.technical-details { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.technical-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.technical-details .metadata-grid { margin-top: 14px; }

html[data-theme="dark"] .artifact-card { box-shadow: 0 5px 18px rgba(0,0,0,.14); }
html[data-theme="dark"] .ai-snippet { background: transparent; }
html[data-theme="dark"] .card-footer a { color: var(--blue); background: transparent; }
html[data-theme="dark"] .filter-popover,
html[data-theme="dark"] .action-menu > div { box-shadow: 0 18px 50px rgba(0,0,0,.38); }

@media (max-width: 800px) {
  .filter-bar-simple { grid-template-columns: 1fr auto; }
  .filter-bar-simple .search-field { grid-column: 1 / -1; }
  .filter-disclosure { position: static; }
  .filter-popover { position: static; width: 100%; margin-top: 8px; box-shadow: none; }
  .filter-disclosure[open] { grid-column: 1 / -1; }
  .guided-form { margin-inline: 0; }
  .form-section { padding: 22px 18px; }
  .form-advanced { margin: 14px 18px; }
  .sticky-actions { padding: 16px 18px; }
}

@media (max-width: 580px) {
  .filter-bar-simple { grid-template-columns: 1fr 1fr; }
  .filter-bar-simple .search-submit,
  .filter-bar-simple .filter-disclosure { width: 100%; }
  .filter-disclosure > summary { justify-content: center; }
  .active-filters { align-items: flex-start; flex-direction: column; }
  .artifact-card { min-height: 0; }
  .head-actions .action-menu { flex: 1 1 auto; }
  .action-menu > summary { justify-content: center; }
  .action-menu > div { right: auto; left: 0; }
}

/* 1C inventory agents */
.inventory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: start;
  gap: 20px;
}
.inventory-main,
.inventory-side {
  min-width: 0;
  display: grid;
  gap: 20px;
}
.token-reveal {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--success) 40%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--success) 9%, var(--surface));
}
.token-reveal p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.token-value {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.token-value code {
  min-width: 0;
  flex: 1;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--input);
  font-size: 13px;
  white-space: nowrap;
}
.agent-list { display: grid; }
.agent-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) minmax(180px, auto);
  gap: 14px;
  padding: 20px 0;
  border-top: 1px solid var(--line-soft);
}
.agent-row:first-child { padding-top: 4px; border-top: 0; }
.agent-row:last-child { padding-bottom: 0; }
.agent-state {
  display: flex;
  justify-content: center;
  padding-top: 7px;
}
.agent-state i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 13%, transparent);
}
.agent-state.seen i {
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 14%, transparent);
}
.agent-state.waiting i {
  background: var(--warning);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 15%, transparent);
}
.agent-main > p {
  margin: 5px 0 12px;
  color: var(--muted);
  font-size: 13px;
}
.agent-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.agent-title > b { font-size: 16px; }
.agent-title > span {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
  font-size: 12px;
  font-weight: 750;
}
.agent-title > span.muted {
  color: var(--muted);
  background: var(--surface-muted);
}
.agent-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 13px;
}
.agent-facts b { color: var(--ink); }
.platform-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}
.platform-pills span,
.extension-match {
  display: inline-flex;
  margin: 2px 4px 2px 0;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 11%, transparent);
  font-size: 12px;
  font-weight: 700;
}
.extension-match.unmatched {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 12%, transparent);
}
.inventory-table {
  min-width: 860px;
  table-layout: fixed;
  font-size: 13px;
}
.inventory-table th {
  padding: 11px 10px;
  font-size: 11px;
}
.inventory-table th:nth-child(1) { width: 16%; }
.inventory-table th:nth-child(2) { width: 28%; }
.inventory-table th:nth-child(3) { width: 13%; }
.inventory-table th:nth-child(4) { width: 31%; }
.inventory-table th:nth-child(5) { width: 12%; }
.inventory-table td {
  padding: 16px 10px;
  vertical-align: top;
}
.inventory-table td > span,
.inventory-table td > b + span {
  font-size: 12px;
  line-height: 1.45;
}
.inventory-base-cell > b {
  font-size: 13px;
  line-height: 1.4;
}
.inventory-platform-cell,
.inventory-seen-cell {
  white-space: nowrap;
}
.inventory-extensions-cell {
  min-width: 270px;
}
.extensions-disclosure {
  width: 100%;
}
.extensions-disclosure > summary {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface-soft);
  cursor: pointer;
  list-style: none;
  transition: border-color .15s ease, background .15s ease;
}
.extensions-disclosure > summary::-webkit-details-marker { display: none; }
.extensions-disclosure > summary:hover {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
  background: var(--surface-muted);
}
.extensions-count {
  display: inline-flex;
  flex: 1;
  align-items: center;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}
.extensions-count::before {
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--warning);
  content: "";
}
.extensions-toggle {
  display: inline-flex;
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
}
.extensions-toggle-open { display: none; }
.extensions-disclosure[open] .extensions-toggle-closed { display: none; }
.extensions-disclosure[open] .extensions-toggle-open { display: inline-flex; }
.extension-list {
  display: grid;
  max-height: 360px;
  gap: 8px;
  margin-top: 8px;
  padding-right: 4px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.extension-item {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface-soft);
}
.extension-item-head {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}
.extension-item .extension-match {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.extension-linked {
  display: inline-flex;
  margin: 0 0 0 auto;
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
}
.extension-link-form {
  width: 100%;
  min-width: 0;
  margin-top: 7px;
}
.extension-link-form .text-button {
  min-width: 38px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
}
.extensions-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.agent-meta {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}
.sync-status {
  color: var(--success);
  font-weight: 750;
}
.sync-status.partial { color: var(--warning); }
.sync-status.failed { color: var(--danger); }
.agent-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}
.agent-actions form { margin: 0; }
.text-button {
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.inventory-warning {
  color: var(--warning) !important;
  font-weight: 750;
}

.probe-result {
    display: block;
    width: max-content;
    max-width: 100%;
    margin-top: 0.38rem;
    padding: 0.14rem 0.45rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.78rem;
    line-height: 1.35;
}

.probe-result.success {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 40%, transparent);
}

.probe-result.warning {
    color: var(--warning);
    border-color: color-mix(in srgb, var(--warning) 40%, transparent);
}

.probe-result.error {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}

.probe-detail {
    display: block;
    max-width: 26rem;
    margin-top: 0.32rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.4;
    white-space: normal;
}
.inline-link-form {
  display: flex;
  min-width: 230px;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
}
.inline-link-form select {
  min-width: 0;
  min-height: 34px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--input);
  font-size: 12px;
}
.setup-steps ol {
  display: grid;
  gap: 15px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.installer-hash {
    display: block;
    margin-top: 0.7rem;
    padding: 0.65rem;
    border-radius: 0.6rem;
    overflow-wrap: anywhere;
    font-size: 0.78rem;
    line-height: 1.45;
}
.setup-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}
.setup-steps li > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  font-size: 13px;
  font-weight: 850;
}
.setup-steps p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.setup-steps code {
  color: var(--ink);
  font-size: 12px;
}

@media (max-width: 1540px) {
  .inventory-layout { grid-template-columns: 1fr; }
  .inventory-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .token-reveal { grid-template-columns: 1fr; }
  .agent-row { grid-template-columns: 12px minmax(0, 1fr); }
  .agent-meta {
    grid-column: 2;
    align-items: flex-start;
    text-align: left;
  }
  .agent-actions { justify-content: flex-start; }
  .inventory-side { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .token-value { align-items: stretch; flex-direction: column; }
  .token-value .button { width: 100%; }
}

/* Review and lifecycle workflow */
.workflow-panel {
  max-width: 1500px;
  display: grid;
  gap: 18px;
  margin: 0 auto 20px;
  padding: 22px;
}
.workflow-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.workflow-current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.workflow-current > b { font-size: 15px; }
.workflow-summary dl,
.review-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 24px;
  margin: 0;
}
.workflow-summary dl > div,
.review-meta > div { display: grid; gap: 2px; }
.workflow-summary dt,
.review-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}
.workflow-summary dd,
.review-meta dd { margin: 0; font-size: 13px; font-weight: 700; }
.candidate-version {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, auto);
  align-items: center;
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}
.candidate-version > div:first-child > b { margin-left: 8px; font-size: 15px; }
.candidate-version p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.candidate-version blockquote,
.review-main blockquote {
  margin: 9px 0 0;
  padding: 8px 11px;
  border-left: 3px solid var(--warning);
  color: var(--ink);
  background: color-mix(in srgb, var(--warning) 8%, transparent);
  font-size: 13px;
}
.workflow-actions,
.lifecycle-actions,
.review-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.workflow-actions form,
.lifecycle-actions form,
.review-actions form { margin: 0; }
.review-decision-form {
  min-width: min(420px, 100%);
  display: grid;
  gap: 8px;
}
.review-decision-form textarea,
.workflow-popover textarea,
.workflow-popover select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--input);
  font: inherit;
  font-size: 13px;
}
.review-decision-form > div { display: flex; justify-content: flex-end; gap: 8px; }
.lifecycle-actions {
  justify-content: flex-start;
  padding-top: 2px;
  border-top: 1px solid var(--line-soft);
}
.lifecycle-actions details { position: relative; }
.lifecycle-actions summary { list-style: none; }
.lifecycle-actions details[open] { width: min(440px, 100%); }
.workflow-popover {
  display: grid;
  gap: 10px;
  margin-top: 8px !important;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.workflow-popover label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.review-badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 12px !important;
  font-weight: 800;
}
.review-badge.review { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.review-badge.approved { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.review-badge.rejected { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.review-badge.draft { color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.workflow-history { display: grid; }
.workflow-history > div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
  padding: 13px 0;
  border-top: 1px solid var(--line-soft);
}
.workflow-history > div:first-child { border-top: 0; }
.workflow-history-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  font-size: 12px;
  font-weight: 800;
}
.workflow-history p { display: grid; gap: 3px; margin: 0; }
.workflow-history small { color: var(--muted); font-size: 12px; }
.workflow-history em { color: var(--ink); font-size: 13px; font-style: normal; }
.workflow-tabs {
  max-width: 1500px;
  display: flex;
  overflow-x: auto;
  gap: 6px;
  margin: 0 auto 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}
.workflow-tabs a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}
.workflow-tabs a.active { color: var(--ink); background: var(--surface-muted); }
.workflow-tabs b {
  min-width: 21px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 11%, transparent);
  font-size: 12px;
  text-align: center;
}
.review-list { display: grid; }
.review-row {
  display: grid;
  grid-template-columns: 12px minmax(260px, 1fr) minmax(250px, auto) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
}
.review-row:first-child { border-top: 0; }
.review-state { align-self: stretch; display: flex; justify-content: center; padding-top: 10px; }
.review-state span { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.review-state.review span { background: var(--blue); }
.review-state.rejected span { background: var(--danger); }
.review-state.draft span { background: var(--warning); }
.review-state.approved span { background: var(--success); }
.review-main > a {
  display: inline-block;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 800;
}
.review-main > p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.review-meta dd.overdue { color: var(--danger); }
.compact-empty { margin-block: 45px; }

@media (max-width: 1050px) {
  .review-row { grid-template-columns: 12px minmax(0, 1fr) auto; }
  .review-meta { grid-column: 2 / -1; justify-content: flex-start; }
}

@media (max-width: 760px) {
  .workflow-summary { flex-direction: column; }
  .workflow-summary dl { justify-content: flex-start; }
  .candidate-version { grid-template-columns: 1fr; }
  .workflow-actions { justify-content: flex-start; }
  .review-row { grid-template-columns: 10px minmax(0, 1fr); }
  .review-meta,
  .review-actions { grid-column: 2; justify-content: flex-start; }
}

/* Discovery: fast search, tags, favorites and saved views */
.catalog-heading .heading-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.saved-view-badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  font-size: 12px;
  font-weight: 800;
}
.catalog-filter {
  position: relative;
  grid-template-columns: minmax(320px, 1fr) auto auto;
  align-items: center;
  overflow: visible;
}
.search-wrap { position: relative; min-width: 0; }
.catalog-filter .search-field {
  min-height: 46px;
  color: var(--ink);
  background: var(--input);
}
.search-field kbd {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 12px;
  font-family: inherit;
  white-space: nowrap;
}
.search-suggestions {
  position: absolute;
  z-index: 18;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 20px 50px rgba(18,28,42,.18);
}
.search-suggestions a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
}
.search-suggestions a:first-child { border-top: 0; }
.search-suggestions a:hover,
.search-suggestions a.active { background: var(--surface-muted); }
.search-suggestions a > span:last-child { min-width: 0; display: grid; gap: 3px; }
.search-suggestions b {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-suggestions small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suggestion-marker {
  color: var(--warning);
  font-size: 18px;
  text-align: center;
}
.suggestion-empty { padding: 18px; color: var(--muted); font-size: 13px; text-align: center; }
.expanded-filter-popover {
  width: min(620px, calc(100vw - 40px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.expanded-filter-popover .filter-actions { grid-column: 1 / -1; }
.catalog-tools {
  position: relative;
  max-width: 1500px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: -8px auto 18px;
}
.catalog-tools .active-filters { flex: 1; margin: 0; }
.save-filter { position: relative; }
.save-filter > summary { list-style: none; }
.save-filter > summary::-webkit-details-marker { display: none; }
.save-filter > form {
  position: absolute;
  z-index: 14;
  top: calc(100% + 8px);
  right: 0;
  width: min(370px, calc(100vw - 40px));
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.save-filter label,
.tag-create-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.save-filter input,
.tag-create-form input,
.tag-create-form select {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--input);
}
.saved-filter-caption { max-width: 1500px; margin: -8px auto 18px; }
.card-top-actions { display: flex; align-items: center; gap: 9px; }
.card-top-actions form,
.head-actions form { margin: 0; }
.favorite-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 19px;
  cursor: pointer;
}
.favorite-icon:hover,
.favorite-icon.active {
  border-color: color-mix(in srgb, var(--warning) 45%, var(--line));
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
}
.favorite-button {
  border-color: var(--line);
  color: var(--muted);
  background: var(--surface);
}
.favorite-button.active {
  border-color: color-mix(in srgb, var(--warning) 45%, var(--line));
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 9%, var(--surface));
}
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.card-tags { margin: -5px 0 14px; }
.detail-tags { margin-top: 14px; }
.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 11%, transparent);
  font-size: 12px;
  font-weight: 750;
}
.tag-pill.cyan { color: #16839a; background: color-mix(in srgb, #2bbbd1 13%, transparent); }
.tag-pill.green { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.tag-pill.amber { color: var(--warning); background: color-mix(in srgb, var(--warning) 13%, transparent); }
.tag-pill.violet { color: #8367ca; background: color-mix(in srgb, #8367ca 13%, transparent); }
.tag-pill.red { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.tag-pill.gray { color: var(--muted); background: var(--surface-muted); }
.tag-directory-layout {
  max-width: 1500px;
  display: grid;
  grid-template-columns: minmax(280px, .45fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  margin: 0 auto;
}
.tag-directory-layout .section-panel { width: 100%; margin: 0; }
.tag-create-form { display: grid; gap: 14px; }
.tag-directory-list { display: grid; }
.tag-directory-list > div {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line-soft);
}
.tag-directory-list > div:first-child { border-top: 0; }
.tag-directory-list > div > span { color: var(--muted); font-size: 13px; }
.tag-directory-list form { margin: 0; }
.saved-nav { margin-top: 12px; }
.saved-nav .side-nav a { min-height: 38px; }
.catalog-pagination { margin-top: 22px; }

html[data-theme="dark"] .search-suggestions,
html[data-theme="dark"] .save-filter > form {
  box-shadow: 0 20px 50px rgba(0,0,0,.42);
}
html[data-theme="dark"] .tag-pill.cyan { color: #67d9eb; }
html[data-theme="dark"] .tag-pill.violet { color: #b9a4f5; }

@media (max-width: 800px) {
  .catalog-filter { grid-template-columns: 1fr auto; }
  .catalog-filter .search-wrap { grid-column: 1 / -1; }
  .expanded-filter-popover { grid-template-columns: 1fr; }
  .expanded-filter-popover .filter-actions { grid-column: 1; }
  .tag-directory-layout { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .catalog-filter { grid-template-columns: 1fr 1fr; }
  .catalog-filter .filter-disclosure,
  .catalog-filter .search-submit { width: 100%; }
  .search-field kbd { display: none; }
  .catalog-tools { flex-direction: column; }
  .catalog-tools .active-filters,
  .save-filter,
  .save-filter > summary { width: 100%; }
  .save-filter > summary { justify-content: center; }
  .save-filter > form { position: static; width: 100%; margin-top: 8px; }
  .tag-directory-list > div { grid-template-columns: 1fr auto; }
  .tag-directory-list > div > span { grid-column: 1; }
}

/* Personal notification center */
.is-hidden { display: none !important; }
.notification-layout {
  max-width: 1500px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .34fr);
  align-items: start;
  gap: 16px;
  margin: 0 auto;
}
.notification-layout .section-panel { width: 100%; margin: 0; }
.notification-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.notification-toolbar .workflow-tabs {
  width: auto;
  margin: 0;
  border: 0;
  background: var(--surface-muted);
}
.notification-kind-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}
.notification-kind-filter label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.notification-kind-filter select {
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--input);
}
.notification-list { display: grid; }
.notification-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 17px 4px;
  border-top: 1px solid var(--line-soft);
}
.notification-row:first-child { border-top: 0; }
.notification-row.unread {
  margin-inline: -10px;
  padding-inline: 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--blue) 6%, var(--surface));
}
.notification-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 11px;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 11%, transparent);
  font-size: 18px;
  font-weight: 800;
}
.notification-row.decision .notification-icon,
.notification-row.version .notification-icon { color: var(--success); background: color-mix(in srgb, var(--success) 11%, transparent); }
.notification-row.deployment .notification-icon { color: var(--violet, #8065c4); background: color-mix(in srgb, #8065c4 11%, transparent); }
.notification-row.inventory .notification-icon,
.notification-row.reminder .notification-icon { color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.notification-copy { min-width: 0; }
.notification-copy > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.notification-copy > div > span { font-weight: 800; }
.notification-copy h2 {
  margin: 5px 0 3px;
  font-size: 15px;
  line-height: 1.35;
}
.notification-row.unread .notification-copy h2 { color: var(--ink); }
.notification-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.notification-row > form { margin: 0; }
.notification-settings {
  position: sticky;
  top: 24px;
}
.notification-settings > p {
  margin: -6px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.notification-settings form { display: grid; gap: 10px; }
.notification-settings form > label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface-soft);
  cursor: pointer;
}
.notification-settings input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
.notification-settings label b,
.notification-settings label small { display: block; }
.notification-settings label b { font-size: 13px; }
.notification-settings label small { margin-top: 3px; color: var(--muted); font-size: 12px; }

@media (max-width: 1000px) {
  .notification-layout { grid-template-columns: 1fr; }
  .notification-settings { position: static; }
}

@media (max-width: 680px) {
  .notification-toolbar { align-items: stretch; flex-direction: column; }
  .notification-toolbar .workflow-tabs { width: 100%; }
  .notification-kind-filter { justify-content: space-between; }
  .notification-row { grid-template-columns: 38px minmax(0, 1fr); }
  .notification-row > form { grid-column: 2; }
}

/* Management analytics */
.analytics-heading { align-items: center; }
.export-menu { position: relative; }
.export-menu > summary { list-style: none; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-menu > div {
  position: absolute;
  z-index: 12;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.export-menu a {
  display: block;
  padding: 10px 11px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.export-menu a:hover { color: var(--ink); background: var(--surface-muted); }
.analytics-filter {
  display: grid;
  grid-template-columns: 160px 145px 145px minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
  max-width: 1500px;
  margin: 0 auto 18px;
  padding: 12px;
}
.analytics-filter label { display: grid; gap: 6px; }
.analytics-filter label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.analytics-filter select,
.analytics-filter input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--input);
}
.analytics-form-errors {
  grid-column: 1 / -1;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  font-size: 12px;
}
.analytics-form-errors ul { margin: 0; padding-left: 18px; }
.analytics-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 12px;
  max-width: 1500px;
  margin: 0 auto 16px;
}
.analytics-metrics article,
.analytics-quality-grid article {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 3px 14px rgba(23,33,50,.035);
}
.analytics-metrics article.attention,
.analytics-quality-grid article.attention {
  border-color: color-mix(in srgb, var(--warning) 38%, var(--line));
  background: color-mix(in srgb, var(--warning) 5%, var(--surface));
}
.analytics-metrics span,
.analytics-quality-grid span {
  display: block;
  min-height: 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  text-transform: uppercase;
}
.analytics-metrics b {
  display: block;
  margin: 7px 0 3px;
  font-size: 29px;
  line-height: 1;
}
.analytics-metrics small,
.analytics-quality-grid small {
  color: var(--muted);
  font-size: 11px;
}
.analytics-trend-panel { max-width: 1500px; }
.analytics-panel-title { align-items: center; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; }
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
.chart-legend span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--blue);
}
.chart-legend .downloads::before { background: var(--accent); }
.chart-legend .installs::before { background: var(--success); }
.analytics-chart {
  display: flex;
  height: 245px;
  align-items: stretch;
  gap: clamp(3px, .6vw, 10px);
  padding: 22px 4px 0;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 100% 25%;
}
.chart-group {
  display: grid;
  flex: 1 1 0;
  min-width: 3px;
  grid-template-rows: 1fr 25px;
  gap: 5px;
}
.chart-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 2px;
}
.chart-bars i {
  width: min(8px, 30%);
  min-height: 0;
  border-radius: 3px 3px 0 0;
  background: var(--blue);
  opacity: .88;
}
.chart-bars i.downloads { background: var(--accent); }
.chart-bars i.installs { background: var(--success); }
.chart-group > span {
  overflow: visible;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
  white-space: nowrap;
}
.analytics-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 1500px;
  margin: 16px auto 0;
}
.analytics-two-column > .section-panel { width: 100%; margin: 0; }
.distribution-list { display: grid; gap: 13px; }
.distribution-list > div {
  display: grid;
  grid-template-columns: minmax(125px, .75fr) minmax(90px, 1fr) 35px 38px;
  align-items: center;
  gap: 10px;
}
.distribution-list > div > div {
  height: 7px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-muted);
}
.distribution-list > div > div i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}
.distribution-list > div > b { font-size: 13px; text-align: right; }
.distribution-list > div > small { color: var(--muted); font-size: 11px; text-align: right; }
.status-distribution .status-dot { font-size: 12px; }
.analytics-ranking { display: grid; }
.analytics-ranking > a,
.analytics-ranking > div:not(.inline-empty) {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 72px 72px;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
}
.analytics-ranking > :first-child { border-top: 0; }
.analytics-ranking > a:hover b { color: var(--accent-dark); }
.analytics-ranking > a > span,
.analytics-ranking > div > span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 7px;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  font-size: 11px;
  font-weight: 850;
}
.analytics-ranking div b,
.analytics-ranking div small,
.analytics-ranking p b,
.analytics-ranking p small { display: block; }
.analytics-ranking div b {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.analytics-ranking div small,
.analytics-ranking p small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.analytics-ranking p { margin: 0; text-align: right; }
.analytics-ranking p b { font-size: 14px; }
.analytics-quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1500px;
  margin: 16px auto;
}
.analytics-quality-grid article { display: flex; min-height: 145px; flex-direction: column; }
.analytics-quality-grid article > b {
  margin: 8px 0 4px;
  font-size: 27px;
  line-height: 1;
}
.analytics-quality-grid article > a {
  margin-top: auto;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}
.analytics-attention { max-width: 1500px; }
.attention-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.attention-columns h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 13px;
}
.attention-columns h3 span {
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 20px;
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 10%, transparent);
  font-size: 10px;
  text-align: center;
}
.attention-columns a {
  display: block;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
.attention-columns a:hover b { color: var(--accent-dark); }
.attention-columns a b,
.attention-columns a small { display: block; }
.attention-columns a b { font-size: 12px; line-height: 1.35; }
.attention-columns a small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.attention-columns p { margin: 0; padding: 11px 0; color: var(--muted); font-size: 11px; }

html[data-theme="dark"] .export-menu > div { box-shadow: 0 20px 50px rgba(0,0,0,.42); }

@media (max-width: 1250px) {
  .analytics-metrics { grid-template-columns: repeat(3, 1fr); }
  .analytics-filter { grid-template-columns: 140px 135px 135px minmax(190px, 1fr) auto; }
}

@media (max-width: 900px) {
  .analytics-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-filter .button { width: 100%; }
  .analytics-two-column { grid-template-columns: 1fr; }
  .analytics-quality-grid { grid-template-columns: repeat(2, 1fr); }
  .attention-columns { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 620px) {
  .analytics-heading { align-items: stretch; flex-direction: column; }
  .export-menu,
  .export-menu > summary { width: 100%; }
  .export-menu > div { position: static; width: 100%; margin-top: 7px; }
  .analytics-filter { grid-template-columns: 1fr; }
  .analytics-metrics { grid-template-columns: repeat(2, 1fr); }
  .analytics-quality-grid { grid-template-columns: 1fr; }
  .analytics-chart { height: 205px; overflow-x: auto; }
  .chart-group { flex-basis: 14px; min-width: 14px; }
  .distribution-list > div { grid-template-columns: minmax(110px, .8fr) minmax(70px, 1fr) 28px; }
  .distribution-list > div > small { display: none; }
  .analytics-ranking > a,
  .analytics-ranking > div:not(.inline-empty) {
    grid-template-columns: 25px minmax(0, 1fr) 55px;
  }
  .analytics-ranking > a > p:last-child,
  .analytics-ranking > div > p:last-child { display: none; }
}

/* Integrations and read-only API */
.api-version-badge {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, var(--success) 35%, var(--line));
  border-radius: 20px;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 8%, var(--surface));
  font-size: 12px;
  font-weight: 850;
}
.integration-token-reveal { max-width: 1500px; margin-inline: auto; }
.integration-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 365px;
  align-items: start;
  gap: 16px;
  max-width: 1500px;
  margin: 0 auto;
}
.integration-main,
.integration-side { display: grid; gap: 16px; }
.integration-layout .section-panel { width: 100%; margin: 0; }
.integration-side { position: sticky; top: 24px; }
.integration-token-list { display: grid; }
.integration-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 150px 95px;
  align-items: center;
  gap: 14px;
  padding: 17px 2px;
  border-top: 1px solid var(--line-soft);
}
.integration-row:first-child { border-top: 0; }
.integration-row.disabled { opacity: .68; }
.integration-state i {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 12%, transparent);
}
.integration-row.disabled .integration-state i {
  background: var(--muted);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 12%, transparent);
}
.integration-copy { min-width: 0; }
.integration-copy > div:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.integration-copy h3 { margin: 0; font-size: 15px; }
.integration-copy .state {
  padding: 3px 7px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}
.integration-copy .state.active { color: var(--success); background: color-mix(in srgb, var(--success) 10%, transparent); }
.integration-copy .state.revoked,
.integration-copy .state.expired { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.integration-copy > p {
  margin: 5px 0 8px;
  color: var(--muted);
  font-size: 11px;
}
.integration-copy code,
.api-docs code,
.integration-security code {
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .94em;
}
.integration-scopes { display: flex; flex-wrap: wrap; gap: 5px; }
.integration-scopes span {
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 9%, transparent);
  font-size: 9px;
  font-weight: 750;
}
.integration-copy > small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.integration-usage { text-align: right; }
.integration-usage > b,
.integration-usage > span,
.integration-usage > small { display: block; }
.integration-usage > b { font-size: 18px; }
.integration-usage > span { margin-bottom: 5px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.integration-usage > small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.integration-actions { display: grid; justify-items: end; gap: 4px; }
.integration-actions form { margin: 0; }
.text-button.danger { color: var(--danger); }
.integration-form textarea { resize: vertical; }
.scope-field > label:first-child { margin-bottom: 4px; }
.scope-field ul,
.integration-edit-form ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.scope-field ul label,
.integration-edit-form ul label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.scope-field input[type="checkbox"],
.integration-edit-form input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}
.integration-security ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.integration-security li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.integration-security li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 900;
}
.api-docs .panel-title { align-items: start; }
.api-docs .panel-title > code {
  max-width: 50%;
  overflow: hidden;
  padding: 7px 9px;
  border-radius: 7px;
  background: var(--surface-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.api-intro {
  margin: -3px 0 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.api-endpoint-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.api-endpoint-list article {
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface-soft);
}
.api-endpoint-list article > b { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.api-endpoint-list article > b span {
  display: inline-flex;
  margin-right: 7px;
  padding: 3px 5px;
  border-radius: 4px;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, transparent);
  font-size: 8px;
  letter-spacing: .04em;
}
.api-endpoint-list p { min-height: 34px; margin: 8px 0 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.api-endpoint-list small { color: var(--muted); font-size: 9px; }
.api-example { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.api-example > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  font-size: 10px;
}
.api-example pre {
  margin: 0;
  overflow-x: auto;
  padding: 13px;
  color: var(--ink);
  background: var(--input);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  line-height: 1.5;
}
.api-limits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.api-limits span {
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 9px;
}
.integration-edit-card { max-width: 850px; }
.integration-edit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.integration-edit-form .span-two { grid-column: 1 / -1; }
.integration-edit-form textarea { resize: vertical; }

@media (max-width: 1100px) {
  .integration-layout { grid-template-columns: 1fr; }
  .integration-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .integration-row { grid-template-columns: 15px minmax(0, 1fr) 90px; }
  .integration-actions { grid-column: 2 / -1; grid-row: 2; grid-auto-flow: column; justify-content: start; justify-items: start; }
  .integration-usage { font-size: 10px; }
  .api-endpoint-list { grid-template-columns: 1fr; }
  .api-endpoint-list p { min-height: 0; }
}

@media (max-width: 580px) {
  .integration-side { grid-template-columns: 1fr; }
  .integration-row { grid-template-columns: 13px minmax(0, 1fr); }
  .integration-usage { grid-column: 2; text-align: left; }
  .integration-actions { grid-column: 2; grid-auto-flow: row; }
  .api-docs .panel-title > code { display: none; }
  .integration-edit-form { grid-template-columns: 1fr; }
  .integration-edit-form .span-two { grid-column: 1; }
}

/* Security center and file integrity */
.integrity-status-banner {
  display: flex;
  max-width: 1500px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -7px auto 16px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--success) 28%, var(--line));
  border-radius: 10px;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 6%, var(--surface));
  font-size: 11px;
}
.integrity-status-banner.warning {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
}
.integrity-status-banner span,
.integrity-status-banner b { display: block; }
.integrity-status-banner b { margin-bottom: 3px; font-size: 12px; }
.integrity-status-banner strong { font-size: 11px; }
.security-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1500px;
  margin: 0 auto 16px;
}
.security-metrics article {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.security-metrics article.attention {
  border-color: color-mix(in srgb, var(--warning) 35%, var(--line));
  background: color-mix(in srgb, var(--warning) 5%, var(--surface));
}
.security-metrics article.danger {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
}
.security-metrics span,
.security-metrics b,
.security-metrics small { display: block; }
.security-metrics span {
  min-height: 25px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}
.security-metrics b { margin: 8px 0 3px; font-size: 28px; line-height: 1; }
.security-metrics small { color: var(--muted); font-size: 10px; }
.security-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr);
  gap: 16px;
  max-width: 1500px;
  margin: 16px auto 0;
}
.security-grid > .section-panel { width: 100%; margin: 0; }
.security-session-list { display: grid; }
.security-session-list article {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line-soft);
}
.security-session-list article:first-child { border-top: 0; }
.session-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  font-size: 13px;
  font-weight: 850;
}
.security-session-list article > div { min-width: 0; }
.security-session-list article > div b,
.security-session-list article > div p,
.security-session-list article > div small { display: block; }
.security-session-list article > div b { font-size: 13px; }
.security-session-list article > div p {
  overflow: hidden;
  margin: 4px 0;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.security-session-list article > div small { color: var(--muted); font-size: 9px; }
.security-session-list form { margin: 0; }
.current-session {
  padding: 5px 8px;
  border-radius: 20px;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 9%, transparent);
  font-size: 9px;
  font-weight: 800;
}
.status-pill {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 20px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 9px;
  font-weight: 850;
}
.status-pill.running,
.status-pill.queued { color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.status-pill.completed { color: var(--success); background: color-mix(in srgb, var(--success) 10%, transparent); }
.status-pill.failed { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.integrity-summary { margin: 8px 0 13px; }
.integrity-summary b,
.integrity-summary span { display: block; }
.integrity-summary b { font-size: 26px; }
.integrity-summary span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.integrity-panel .quota-track { margin-bottom: 13px; }
.integrity-counts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-bottom: 12px;
}
.integrity-counts span {
  padding: 8px;
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 9px;
}
.integrity-counts b { color: var(--ink); font-size: 12px; }
.integrity-panel > small { color: var(--muted); font-size: 9px; }
.integrity-issues-panel { max-width: 1500px; }
.integrity-result {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 9%, transparent);
  font-size: 9px;
  font-weight: 800;
}
.security-event-filter select {
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--input);
  font-size: 10px;
}
.login-attempt-list { display: grid; }
.login-attempt-list article {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto 65px;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
.login-attempt-list article:first-child { border-top: 0; }
.login-attempt-list article > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.login-attempt-list article > i.success { background: var(--success); }
.login-attempt-list article > i.failed { background: var(--warning); }
.login-attempt-list article > i.blocked { background: var(--danger); }
.login-attempt-list article > div b,
.login-attempt-list article > div span { display: block; }
.login-attempt-list article > div b { font-size: 11px; }
.login-attempt-list article > div span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.attempt-outcome {
  padding: 4px 7px;
  border-radius: 20px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 8px;
  font-weight: 800;
}
.attempt-outcome.success { color: var(--success); background: color-mix(in srgb, var(--success) 9%, transparent); }
.attempt-outcome.failed { color: var(--warning); background: color-mix(in srgb, var(--warning) 9%, transparent); }
.attempt-outcome.blocked { color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); }
.login-attempt-list time { color: var(--muted); font-size: 9px; text-align: right; }
.scan-history { display: grid; }
.scan-history article {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 48px 48px;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
.scan-history article:first-child { border-top: 0; }
.scan-history article > div b,
.scan-history article > div small,
.scan-history article > p b,
.scan-history article > p span { display: block; }
.scan-history article > div b { font-size: 11px; }
.scan-history article > div small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.scan-history article > p { margin: 0; text-align: right; }
.scan-history article > p b { font-size: 12px; }
.scan-history article > p span { color: var(--muted); font-size: 8px; }
.security-policy-note {
  margin: 12px 0 0;
  padding: 10px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 9px;
  line-height: 1.5;
}

@media (max-width: 950px) {
  .security-grid { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .security-metrics { grid-template-columns: repeat(2, 1fr); }
  .security-session-list article { grid-template-columns: 34px minmax(0, 1fr); }
  .security-session-list article > form,
  .security-session-list .current-session { grid-column: 2; justify-self: start; }
  .login-attempt-list article { grid-template-columns: 8px minmax(0, 1fr) auto; }
  .login-attempt-list time { grid-column: 2; text-align: left; }
  .scan-history article { grid-template-columns: 72px minmax(0, 1fr) 45px; }
  .scan-history article > p:last-child { display: none; }
}
/* Stage 8: collaboration, discussions and internal work queue */
.collaboration-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: 16px;
  max-width: 1500px;
  margin: 0 auto 16px;
}
.collaboration-grid > .panel { min-width: 0; margin: 0; }
.discussion-form {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}
.discussion-form p { margin: 0 0 12px; }
.discussion-form label,
.task-create label,
.collaboration-filter label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.discussion-form textarea,
.discussion-form select,
.discussion-form input[type="file"],
.task-create textarea,
.task-create select,
.task-create input,
.task-status-form select,
.work-action select,
.collaboration-filter select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--surface);
}
.form-hint {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.discussion-list { display: grid; gap: 2px; }
.discussion-comment {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.avatar.compact { width: 34px; height: 34px; font-size: 12px; }
.discussion-comment header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}
.discussion-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.discussion-attachments a {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--accent);
  font-size: 13px;
}
.discussion-comment header time,
.discussion-comment header span {
  color: var(--muted);
  font-size: 12px;
}
.discussion-comment header span {
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--surface-muted);
}
.discussion-comment p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.task-list { display: grid; gap: 10px; }
.task-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid #7890ad;
  border-radius: 11px;
  background: var(--surface-muted);
}
.task-card.priority-high { border-left-color: var(--danger); }
.task-card.done,
.task-card.cancelled { opacity: .76; }
.task-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.task-card > header > div { display: flex; flex-wrap: wrap; gap: 6px; }
.task-card h3,
.work-main h3 { margin: 10px 0 5px; font-size: 16px; line-height: 1.3; }
.task-card > p { margin: 0 0 9px; color: var(--muted); line-height: 1.5; }
.task-status,
.task-priority {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
}
.task-status.todo { color: #3d6795; background: #e7f1fc; }
.task-status.in_progress { color: #836019; background: #fff0c8; }
.task-status.done { color: #176f56; background: #def3eb; }
.task-status.cancelled { color: var(--muted); background: var(--surface); }
.task-priority { color: var(--muted); background: var(--surface); }
.task-priority.high { color: var(--danger); }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12px; }
.task-card time,
.work-due { color: var(--muted); font-size: 12px; white-space: nowrap; }
.task-card time.overdue,
.work-due .overdue { color: var(--danger); font-weight: 800; }
.task-checklist {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.task-checklist button {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 8px;
  border: 0;
  padding: 6px 2px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.task-checklist button.done { color: var(--muted); text-decoration: line-through; }
.task-checklist button:disabled { cursor: default; }
.task-status-form {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}
.task-create { margin-top: 14px; }
.task-create > summary { width: 100%; list-style: none; }
.task-create > summary::-webkit-details-marker { display: none; }
.task-create > form {
  margin-top: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-muted);
}
.task-create p { margin: 0 0 12px; }
.task-create .helptext {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.collaboration-filter {
  grid-template-columns: minmax(180px, .35fr) minmax(180px, .35fr) auto;
  align-items: end;
}
.metrics-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card.attention { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.work-queue { display: grid; gap: 1px; }
.work-row {
  display: grid;
  grid-template-columns: 160px minmax(260px, 1fr) 110px minmax(180px, .42fr);
  gap: 14px;
  align-items: center;
  padding: 15px 4px;
  border-top: 1px solid var(--line);
}
.work-row.done,
.work-row.cancelled { opacity: .74; }
.work-state { display: flex; flex-wrap: wrap; gap: 5px; }
.work-main h3 { margin-top: 0; }
.work-main h3 a { color: var(--ink); }
.work-main > p { margin: 0 0 7px; color: var(--muted); }
.work-action {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 7px;
}

[data-theme="dark"] .task-status.todo { color: #a9cff8; background: #263d58; }
[data-theme="dark"] .task-status.in_progress { color: #ffd784; background: #493c22; }
[data-theme="dark"] .task-status.done { color: #91e1c2; background: #203f36; }

@media (max-width: 1100px) {
  .collaboration-grid { grid-template-columns: 1fr; }
  .work-row { grid-template-columns: 140px minmax(220px, 1fr) 100px; }
  .work-action { grid-column: 2 / -1; }
}

@media (max-width: 700px) {
  .collaboration-grid { display: block; }
  .collaboration-grid > .panel { margin-bottom: 12px; }
  .metrics-grid.compact { grid-template-columns: 1fr; }
  .collaboration-filter { grid-template-columns: 1fr; }
  .work-row { grid-template-columns: 1fr; }
  .work-action { grid-column: auto; }
  .task-status-form,
  .work-action { grid-template-columns: 1fr; }
}

/* Enterprise security and integration controls */
.compact-auth {
  min-height: calc(100vh - 40px);
  display: grid;
  place-items: center;
}
.compact-auth .login-form-wrap { width: min(480px, 100%); }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.mfa-panel { max-width: 980px; margin-inline: auto; }
.mfa-setup-grid {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: center;
}
.mfa-qr {
  width: 220px;
  height: 220px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
}
.secret-code {
  display: inline-block;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-muted);
  font-size: 14px;
  letter-spacing: 1px;
  word-break: break-all;
}
.recovery-codes pre {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface-muted);
  font-size: 15px;
  line-height: 1.7;
}
.security-good {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--success) 45%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--success) 8%, var(--surface));
}
.security-good p { margin: 4px 0 0; color: var(--muted); }
.user-security-link {
  margin-left: 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}
.malware-status.clean { color: var(--success); }
.malware-status.infected,
.malware-status.error { color: var(--danger); }

@media (max-width: 700px) {
  .mfa-setup-grid { grid-template-columns: 1fr; }
}

/* Stage 9: operations monitoring and release history */
.system-ok.warning {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
}
.operations-incidents {
  display: grid;
  gap: 8px;
  max-width: 1500px;
  margin: 0 auto 16px;
}
.incident-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 17px;
  border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--line));
  border-left: 4px solid var(--warning);
  border-radius: 11px;
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
}
.incident-card.critical {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}
.incident-card span,
.incident-card time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.incident-card h2 { margin: 3px 0 4px; font-size: 17px; }
.incident-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.operations-check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.operations-check-grid > div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 9px;
  align-items: flex-start;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-muted);
}
.check-indicator,
.heartbeat-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 12%, transparent);
}
.operations-check-grid .warning .check-indicator {
  background: var(--warning);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 12%, transparent);
}
.operations-check-grid .critical .check-indicator,
.operations-check-grid .error .check-indicator,
.heartbeat-list .stale .heartbeat-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 12%, transparent);
}
.operations-check-grid p { margin: 0; }
.operations-check-grid small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.heartbeat-list,
.operations-history,
.release-list { display: grid; }
.heartbeat-list > div,
.operations-history > div,
.release-list > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.heartbeat-list > div:first-child,
.operations-history > div:first-child,
.release-list > div:first-child { border-top: 0; }
.heartbeat-list p,
.operations-history p,
.release-list p { margin: 0; }
.heartbeat-list small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.heartbeat-list time,
.operations-history time,
.release-list time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.heartbeat-list .stale { color: var(--danger); }
.operations-history > div { grid-template-columns: auto minmax(0, 1fr) auto; }
.release-list > div { grid-template-columns: 55px minmax(0, 1fr) auto; }
.release-list b { color: var(--accent); }
.release-list p { color: var(--muted); }

@media (max-width: 700px) {
  .incident-card { display: block; }
  .incident-card time { display: block; margin-top: 8px; }
  .operations-check-grid { grid-template-columns: 1fr; }
  .heartbeat-list > div,
  .operations-history > div,
  .release-list > div { grid-template-columns: auto minmax(0, 1fr); }
  .heartbeat-list time,
  .operations-history time,
  .release-list time { grid-column: 2; }
}
