@font-face { font-family: "Noto Sans"; src: url("/fonts/noto-sans-400.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Noto Sans"; src: url("/fonts/noto-sans-500.woff2") format("woff2"); font-weight: 500; font-display: block; }
@font-face { font-family: "Noto Sans"; src: url("/fonts/noto-sans-600.woff2") format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: "Noto Sans"; src: url("/fonts/noto-sans-700.woff2") format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-500.woff2") format("woff2"); font-weight: 500; font-display: block; }

:root { --sb: 8px; --ease: cubic-bezier(.2, .7, .2, 1); --mono: "JetBrains Mono", ui-monospace, Consolas, monospace; color-scheme: dark; }
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.5 "Noto Sans", system-ui, sans-serif; font-variant-numeric: lining-nums; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
dialog:focus-visible { outline: none; }
.ico { width: 18px; height: 18px; flex: none; stroke-width: 1.75; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.mono { font-family: var(--mono); }

* { scrollbar-width: thin; scrollbar-color: var(--thumb) transparent; }
::-webkit-scrollbar { width: var(--sb); height: var(--sb); }
::-webkit-scrollbar-thumb { background: var(--thumb); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.main { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; height: 100%; }
.scroll { flex: 1; overflow-y: auto; scrollbar-gutter: stable; }
.wrap { max-width: 1340px; margin: 0 auto; padding: 32px calc(40px - var(--sb)) 96px 40px; }
.progress { position: absolute; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); }

.rise { animation: rise .38s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.fade { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; } }
.domino > * { animation: fade .3s ease both; animation-delay: calc(var(--i, 0) * 40ms); }
.ph { display: inline-block; border-radius: 6px; background: var(--ph); vertical-align: middle; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.spinner { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; vertical-align: middle; }
.spinner.sm { width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--r-btn); font-weight: 600; font-size: 14px; white-space: nowrap; border: 1px solid transparent; transition: background-color .18s, border-color .18s, color .18s, transform .1s; }

.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn .ico { width: 17px; height: 17px; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { border-color: var(--line-2); background: var(--panel); }
.btn-ghost:hover { border-color: var(--line-3); background: var(--hover); }
.btn-wide { width: 100%; justify-content: center; }
.btn-danger-ghost { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.is-armed { background: var(--danger) !important; color: #fff !important; border-color: var(--danger) !important; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-btn); color: var(--muted); transition: background-color .18s, color .18s, transform .1s; flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }

.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm .ico { width: 16px; height: 16px; }
.help { display: inline-grid; place-items: center; color: var(--muted); cursor: help; vertical-align: middle; margin-left: 4px; }
.help .ico { width: 15px; height: 15px; }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; margin-left: auto; }
.count[hidden] { display: none; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--hover); color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-purple { background: var(--purple-soft); color: var(--purple-text); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; background: var(--hover); color: var(--muted); font: 500 11.5px var(--mono); }

.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-size: 11.5px; font-weight: 700; flex: none; color: #0f1214; }
.avatar.sm { width: 24px; height: 24px; font-size: 9.5px; }
.avatar.sm .ico { width: 14px; height: 14px; }
.tone-green { background: #4ac578; }
.tone-purple { background: #a993f7; }
.tone-amber { background: #e9c46a; }
.tone-blue { background: #60a5fa; }
.tone-pink { background: #f472b6; }
.tone-muted { background: var(--hover-strong); color: var(--muted); }
.avatar-agent { background: var(--purple-soft); color: var(--purple-text); }
.people-stack { display: inline-flex; }
.people-stack .avatar + .avatar { margin-left: -3px; box-shadow: 0 0 0 2px var(--panel); }

.field { display: grid; gap: 6px; }
.field > .dd { justify-self: start; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field input, .field textarea { height: 40px; padding: 0 12px; border-radius: var(--r-in); border: 1px solid var(--line-2); background: var(--input); transition: border-color .18s, box-shadow .18s; }
.field textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input.is-bad { border-color: var(--danger); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.note { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.note .ico { width: 16px; height: 16px; }
.note-bad { color: var(--danger); }

.dd { position: relative; display: inline-block; }
.dd-btn { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 14px; min-width: 150px; justify-content: space-between; border-radius: var(--r-in); border: 1px solid var(--line-2); background: var(--input); transition: border-color .18s; }
.dd-btn:hover { border-color: var(--line-3); }
.dd-btn .ico, .switcher-btn > .ico:last-child, .profile-chip > .ico:last-child { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.is-open > .dd-btn > .ico:last-child, .is-open > .switcher-btn > .ico:last-child, .is-open > .profile-chip > .ico:last-child { transform: rotate(180deg); }
.dd-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 100%; padding: 6px; border-radius: var(--r-card); border: 1px solid var(--line-2); background: var(--menu); box-shadow: var(--shadow); opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top; pointer-events: none; transition: opacity .16s, transform .16s var(--ease); }
.is-open > .dd-menu { opacity: 1; transform: none; pointer-events: auto; }
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; border-radius: calc(var(--r-card) - 4px); text-align: left; white-space: nowrap; transition: background-color .15s; }
.dd-item:hover { background: var(--hover); }
.dd-item > .ico:last-child:not(:first-child) { margin-left: auto; opacity: 0; color: var(--accent); }
.dd-item.is-on > .ico:last-child:not(:first-child) { opacity: 1; }
.dd-item > .ico:first-child { color: var(--muted); }
.dd-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dd-head b, .dd-head small { display: block; }
.dd-head small { color: var(--muted); }
.dd-up-auto { top: auto; bottom: calc(100% + 6px); transform-origin: bottom; }
.dd-menu.dd-up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom; }

.switch { position: relative; width: 40px; height: 24px; border-radius: 12px; background: var(--line-3); transition: background-color .2s; flex: none; }
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"] span { transform: translateX(16px); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-2); color: var(--muted); font-weight: 500; font-size: 13px; transition: background-color .18s, border-color .18s, color .18s; }
.pill .ico { width: 16px; height: 16px; }
.pill:hover { color: var(--text); border-color: var(--line-3); }
.pill.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.pill-tag { height: 28px; font: 500 12px var(--mono); }
.pill-tag .ico { width: 14px; height: 14px; }

.seg { position: relative; display: inline-flex; padding: 4px; border-radius: calc(var(--r-btn) + 4px); background: var(--seg); gap: 2px; }
.seg button { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: var(--r-btn); color: var(--muted); font-weight: 600; font-size: 13px; transition: color .2s; }
.seg button.is-on { color: var(--text); }
.seg button .count { margin-left: 2px; }
.seg-marker { position: absolute; top: 4px; left: 0; height: 32px; border-radius: var(--r-btn); background: var(--panel); box-shadow: var(--shadow-sm); transition: transform .28s var(--ease), width .28s var(--ease); }
.seg-big { display: flex; }
.seg-big button { flex: 1; justify-content: center; height: 40px; }
.seg-big .seg-marker { height: 40px; }

.card { border-radius: var(--r-card); border: 1px solid var(--line); background: var(--panel); }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-head h1 { font-size: 28px; line-height: 1.2; }
.page-head .sub { margin-top: 6px; color: var(--muted); max-width: 640px; }
.page-head .sub b { color: var(--text); font-weight: 600; }
.page-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.updated { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; min-width: 190px; justify-content: flex-end; }

.sec { padding-bottom: 40px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sec-head h2 { font-size: 19px; }
.sec-line { color: var(--muted); margin: -8px 0 16px; max-width: 680px; }
.sub-head { display: flex; align-items: center; gap: 2px; margin: 28px 0 12px; }
.sub-head h3 { font-size: 14px; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.swatch { display: flex; flex-direction: column; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.swatch-chip { position: relative; display: block; width: 100%; height: 104px; background: var(--c, var(--ph)); border-bottom: 1px solid var(--line); }
.swatch-edit { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(0,0,0,.28); color: #fff; opacity: 0; transition: opacity .18s; }
.on-light .swatch-edit { background: rgba(0,0,0,.08); color: #0f1214; }
.swatch-chip:hover .swatch-edit, .swatch-chip:focus-visible .swatch-edit { opacity: 1; }
.swatch-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 12px 14px 4px; }
.swatch-meta b { flex-basis: 100%; }
.swatch-use { padding: 0 14px 14px; color: var(--muted); font-size: 12.5px; }
.swatch.is-ph .swatch-chip { animation: pulse 1.4s infinite; }
.swatch.is-ph .swatch-meta { display: grid; gap: 8px; padding-bottom: 16px; }
.copy { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 7px; border-radius: 6px; font: 500 12px var(--mono); color: var(--muted); transition: background-color .15s, color .15s; }
.copy .ico { width: 14px; height: 14px; }
.copy:hover { background: var(--hover); color: var(--text); }
.copy.is-copied { color: var(--ok); }
.role-badge { margin-left: auto; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; background: var(--hover); color: var(--muted); }
.role-primary, .role-accent { background: var(--accent-soft); color: var(--accent-text); }

.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pair { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--panel); }
.pair-demo { display: flex; align-items: center; gap: 10px; width: 150px; height: 56px; padding: 0 12px; border-radius: calc(var(--r-card) - 4px); border: 1px solid var(--line); font-size: 12px; flex: none; }
.pair-demo b { font-size: 22px; }
.pair-demo span { line-height: 1.25; }
.pair.is-ph .pair-demo { background: var(--ph); animation: pulse 1.4s infinite; }
.pair-meta { display: grid; gap: 2px; }
.pair-meta small { color: var(--muted); font-size: 12px; }
.ratio { font: 600 14px var(--mono); }
.grade { justify-self: start; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; }
.grade-ok { background: var(--ok-soft); color: var(--ok); }
.grade-warn { background: var(--warn-soft); color: var(--warn); }
.grade-bad { background: var(--danger-soft); color: var(--danger); }

.fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; margin-bottom: 20px; }
.font-card { display: flex; align-items: center; gap: 16px; padding: 14px 14px 14px 16px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--panel); }
.font-aa { display: grid; place-items: center; width: 64px; height: 64px; border-radius: calc(var(--r-card) - 4px); background: var(--hover); font-size: 34px; flex: none; }
.font-card.is-ph .font-aa { background: var(--ph); }
.font-meta { display: grid; flex: 1; min-width: 0; }
.font-meta small { color: var(--text-2); font-size: 12.5px; }
.font-meta small.muted { color: var(--muted); }
.scale { border-radius: var(--r-card); border: 1px solid var(--line); background: var(--panel); }
.scale-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 20px; padding: 16px 20px; min-height: 64px; }
.scale-row + .scale-row { border-top: 1px solid var(--line); }
.scale-meta { display: grid; }
.scale-meta small { color: var(--muted); font: 500 12px var(--mono); }
.scale-sample { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.logo-card { display: flex; flex-direction: column; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.logo-stage { display: grid; place-items: center; height: 160px; background: var(--bg, #fff); border-bottom: 1px solid var(--line); }
.logo-stage img { height: 84px; width: auto; }
.logo-card.is-ph .logo-stage { background: var(--ph); animation: pulse 1.4s infinite; }
.is-missing .logo-stage { background: repeating-linear-gradient(-45deg, var(--hover) 0 8px, transparent 8px 16px); }
.missing { display: grid; justify-items: center; gap: 4px; color: var(--muted); }
.logo-meta { padding: 14px 16px 6px; flex: 1; }
.logo-meta dl { display: grid; gap: 4px; margin: 10px 0 0; }
.logo-meta dl div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.logo-meta dt { color: var(--muted); display: inline-flex; align-items: center; }
.logo-meta dd { margin: 0; text-align: right; }
.logo-foot { padding: 8px 16px 16px; }

.icon-set { border-radius: var(--r-card); border: 1px solid var(--line); background: var(--panel); padding: 16px; }
.icon-set-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; font-size: 13px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.icon-cell { display: grid; place-items: center; height: 52px; border-radius: calc(var(--r-card) - 4px); background: var(--hover); transition: background-color .15s, color .15s; }
.icon-cell:hover { background: var(--accent-soft); color: var(--accent-text); }
.icon-cell .ico { width: 22px; height: 22px; }
.icon-cell.is-ph { background: var(--ph); }

.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rule { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--panel); }
.rule b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.rule-do .rule-ico, .rule-do b { color: var(--ok); }
.rule-dont .rule-ico, .rule-dont b { color: var(--danger); }

.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 64px 20px; border-radius: var(--r-card); border: 1px dashed var(--line-3); }
.empty-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); }
.empty-ico .ico { width: 26px; height: 26px; }
.empty h2 { font-size: 18px; }
.empty p { color: var(--muted); max-width: 420px; margin-bottom: 8px; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; width: 280px; border-radius: var(--r-in); border: 1px solid var(--line-2); background: var(--input); color: var(--muted); transition: border-color .18s; }
.search:focus-within { border-color: var(--accent); }
.search input { border: 0; background: none; flex: 1; min-width: 0; color: var(--text); height: 100%; }
.tags-row { margin-bottom: 18px; }
.table-card { overflow-x: auto; }
.lib-cols { display: grid; grid-template-columns: minmax(280px, 1fr) 130px 150px 70px 110px; gap: 16px; align-items: center; min-width: 820px; }
.table-head { padding: 12px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; }
.row { width: 100%; padding: 14px 20px; text-align: left; transition: background-color .15s; }
.row + .row { border-top: 1px solid var(--line); }
button.row:hover { background: var(--hover); }
.row-title { display: grid; gap: 6px; font-weight: 600; }
.row-title small { display: flex; flex-wrap: wrap; gap: 6px; font-weight: 400; }
.row.is-stale { opacity: .6; }
.stale { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font-size: 12px; }
.stale .ico { width: 14px; height: 14px; }
.row-empty { padding: 28px 20px; color: var(--muted); text-align: center; }
.kind { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.kind .ico { width: 16px; height: 16px; color: var(--muted); }

.list-card .rows > * + * { border-top: 1px solid var(--line); }
.prop { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 90px; align-items: center; gap: 14px; width: 100%; padding: 14px 18px; text-align: left; transition: background-color .15s; }
.prop:hover { background: var(--hover); }
.prop-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--purple-soft); color: var(--purple-text); }
.prop.is-ph .prop-ico { background: var(--ph); }
.prop.is-ph > div { display: grid; gap: 8px; }
.prop-main { display: grid; min-width: 0; }
.prop-main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.when { text-align: right; font-size: 12.5px; }
.status { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status .ico { width: 15px; height: 15px; }
.status-purple { background: var(--purple-soft); color: var(--purple-text); }
.status-amber { background: var(--warn-soft); color: var(--warn); }
.status-green { background: var(--ok-soft); color: var(--ok); }
.status-muted { background: var(--hover); color: var(--muted); }
.seg + .card { margin-top: 18px; }

.map-card { padding: 8px; margin-top: 16px; }
.map { aspect-ratio: 1000 / 620; display: grid; }
.map-wait { display: grid; place-items: center; }
.map-svg { width: 100%; height: 100%; }
.m-link { stroke: var(--line-3); stroke-width: 1.2; }
.m-link-page { stroke: var(--line-2); stroke-dasharray: 2 3; transition: opacity .25s; }
.m-node circle { fill: var(--panel-2); stroke: var(--line-3); stroke-width: 1.5; transition: fill .18s, stroke .18s; }
.m-node text { fill: var(--text-2); font-size: 12.5px; font-weight: 600; text-anchor: middle; }
.m-root circle { fill: var(--accent-soft); stroke: var(--accent); }
.m-root text { fill: var(--accent-text); font-size: 13px; }
.m-client circle { fill: var(--panel); stroke: var(--primary); stroke-width: 2; }
.m-client, .m-project { cursor: pointer; }
.m-client:hover circle, .m-project:hover circle { fill: var(--hover); stroke: var(--accent); }
.m-project text { font-weight: 500; font-size: 11.5px; fill: var(--muted); }
.m-page { cursor: pointer; transition: opacity .25s, r .15s; stroke: var(--panel); stroke-width: 2; }
.m-page:hover { r: 9; }
.m-page.is-stale { opacity: .35; }
.is-off { opacity: .08 !important; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot-brand { fill: var(--k-brand); background: var(--k-brand); }
.dot-process { fill: var(--k-process); background: var(--k-process); }
.dot-knowledge { fill: var(--k-knowledge); background: var(--k-knowledge); }
.dot-agents { fill: var(--k-agents); background: var(--k-agents); }

.settings { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 40px; align-items: start; }
.set-side { position: sticky; top: 32px; display: grid; gap: 14px; }
.set-side .page-head { margin: 0; }
.set-system { display: inline-flex; align-items: center; gap: 7px; height: 26px; margin-bottom: 10px; padding: 0 10px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.set-system .ico { width: 15px; height: 15px; }
.set-side .set-menu { position: static; }
.set-menu, .rail { position: sticky; top: 0; display: grid; gap: 2px; }
.set-menu a, .rail a { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: var(--r-btn); color: var(--muted); font-weight: 500; transition: color .2s; }
.set-menu a:hover, .rail a:hover { color: var(--text); }
.set-menu a.is-on, .rail a.is-on { color: var(--text); font-weight: 600; }
.rail-marker { position: absolute; top: 0; left: 0; right: 0; border-radius: var(--r-btn); background: var(--hover-strong); transition: transform .28s var(--ease), height .28s var(--ease); }
.person, .agent, .act { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.person-main { display: grid; flex: 1; min-width: 0; }
.person-main small { color: var(--muted); }
.you { display: inline-flex; height: 18px; padding: 0 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-text); font-size: 10.5px; font-weight: 700; vertical-align: 2px; }
.grant { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--hover); font-size: 12.5px; font-weight: 500; }
.grant .ico { width: 15px; height: 15px; color: var(--accent-text); }
.person.is-ph, .agent.is-ph, .act.is-ph { min-height: 62px; }
.role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.role-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.role-card p { flex: 1; font-size: 13px; }
.role-card.is-ph { min-height: 140px; }
.role-top { display: flex; align-items: center; justify-content: space-between; }
.role-foot { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; }
.role-foot .btn { margin-left: auto; }
.act-main { flex: 1; }
.act-main b { font-weight: 600; }
.act-more { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; border-top: 1px solid var(--line); color: var(--accent-text); font-weight: 600; font-size: 13px; transition: background .2s, color .2s; }
.act-more:hover { background: var(--hover); }
.act-more:disabled { color: var(--muted); }
.act-more .ico { width: 16px; height: 16px; }
.dlg-body.act-body { padding: 0; gap: 0; }
.act-body .rows > .act + .act { border-top: 1px solid var(--line); }
.act-body .rows > .act:not(.is-ph) { animation: act-in .26s var(--ease) backwards; animation-delay: calc(min(var(--i, 0), 10) * 25ms); }
.act-end { padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; text-align: center; }
@keyframes act-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .act-body .rows > .act:not(.is-ph) { animation: none; } }

.perm-list { display: grid; margin-top: 18px; border-radius: var(--r-card); border: 1px solid var(--line); }
.perm { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; }
.perm + .perm { border-top: 1px solid var(--line); }
.perm small { display: block; color: var(--muted); font-size: 12.5px; }

dialog.dlg { width: min(560px, calc(100vw - 24px)); max-height: min(720px, calc(100dvh - 48px)); padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-dlg); background: var(--panel); color: var(--text); box-shadow: var(--shadow-lg); display: none; flex-direction: column; overflow: hidden; }
dialog.dlg[open] { display: flex; animation: fall .24s var(--ease); }
dialog.dlg.is-closing { animation: rise-out .16s ease forwards; }
dialog.dlg-wide { width: min(760px, calc(100vw - 24px)); }
dialog::backdrop { background: var(--backdrop); animation: fade .2s ease; }
@keyframes fall { from { opacity: 0; transform: translateY(-14px) scale(.98); } }
@keyframes rise-out { to { opacity: 0; transform: translateY(-8px) scale(.98); } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 16px 20px; border-bottom: 1px solid var(--line); flex: none; }
.dlg-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dlg-title h2 { font-size: 17px; }
.dlg-title small { color: var(--muted); font-size: 12.5px; }
.dlg-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.dlg-swatch { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); flex: none; transition: background-color .2s; }
.dlg-tabs { margin: 14px 20px 0; align-self: flex-start; flex: none; }
.dlg-body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding: 20px calc(20px - var(--sb)) 20px 20px; display: grid; gap: 16px; align-content: start; }
.dlg-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); flex: none; }
.c-contrast .sub-head { margin-top: 4px; }
.mini-pairs { display: grid; gap: 8px; }
.mini-pair { display: grid; grid-template-columns: 52px 1fr auto 64px; align-items: center; gap: 12px; }
.mini-demo { display: grid; place-items: center; height: 36px; border-radius: 8px; border: 1px solid var(--line); font-weight: 700; font-size: 16px; }
.mini-pair .ratio { text-align: right; }
.timeline { display: grid; }
.tl-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.tl-row + .tl-row { border-top: 1px solid var(--line); }
.tl-main { flex: 1; display: grid; }
.tl-main small { color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fact { display: grid; gap: 6px; align-content: start; padding: 12px; border-radius: calc(var(--r-card) - 2px); background: var(--hover); }
.fact .label { color: var(--muted); font-size: 12px; font-weight: 600; }
.fact b { font-weight: 600; font-size: 13px; }
.fact .status { justify-self: start; }
.curator { display: flex; gap: 12px; padding: 14px; border-radius: var(--r-card); border: 1px solid var(--purple-line); background: var(--purple-soft); }
.curator > .ico { color: var(--purple-text); margin-top: 2px; }
.curator p { color: var(--text-2); margin-top: 2px; }
.diff { margin: 0; padding: 10px 0; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--code); font: 13px/1.7 var(--mono); overflow-x: auto; }
.diff span { display: block; padding: 0 14px; white-space: pre; }
.diff i { display: inline-block; width: 16px; font-style: normal; color: var(--muted); }
.d-add { background: var(--ok-soft); }
.d-add i { color: var(--ok); }
.d-del { background: var(--danger-soft); }
.d-del i { color: var(--danger); }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.prose { color: var(--text-2); line-height: 1.7; }
.prose h3 { margin: 18px 0 6px; font-size: 15px; color: var(--text); }
.prose p { margin: 0 0 10px; }
.prose ul { margin: 0 0 10px; padding-left: 20px; }
.prose code { font: 12.5px var(--mono); padding: 2px 6px; border-radius: 5px; background: var(--hover); }
.do-list { display: grid; gap: 4px; }
.do-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px; text-align: left; font-weight: 500; transition: background-color .18s, color .18s; }
.do-row:hover { background: var(--hover); }
.do-row > span:not(.help) { flex: 1; }
.do-row > .ico { color: var(--muted); }
.do-danger, .do-danger > .ico { color: var(--danger); }
.do-row.is-armed > .ico { color: #fff; }
.grow-swap { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .25s var(--ease), opacity .2s; margin-top: -16px; }
.grow-swap > div { overflow: hidden; }
.grow-swap.is-open { grid-template-rows: 1fr; opacity: 1; margin-top: 0; }
.grow-swap .dd-btn { min-width: 220px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 14px; border-radius: 12px; background: var(--tip-bg); color: var(--tip-text); box-shadow: var(--shadow-lg); font-weight: 500; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast > .ico { color: #4ac578; }
.toast-undo { height: 30px; padding: 0 10px; border-radius: 8px; font-weight: 700; color: #a993f7; }
.toast-undo:hover { background: rgba(255,255,255,.08); }
.toast:not(:has(.toast-undo)) { padding-right: 16px; }
.tip { position: fixed; top: 0; left: 0; z-index: 100; max-width: 260px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--tip-line); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); background: var(--tip-bg); color: var(--tip-text); font-size: 12.5px; line-height: 1.4; pointer-events: none; opacity: 0; transition: opacity .12s; }
.tip.is-on { opacity: 1; }

.signin { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: var(--signin-bg); }
.signed-in .signin { display: none; }
body:not(.signed-in) .shell { visibility: hidden; }
.signin-card { display: grid; gap: 16px; width: min(380px, 100%); padding: 32px; border-radius: var(--r-dlg); border: 1px solid var(--line-2); background: var(--panel); box-shadow: var(--shadow-lg); animation: rise .4s var(--ease); }
.signin-card .logo { margin-bottom: 8px; }
.signin-card .btn { margin-top: 6px; height: 42px; }

.mock-bar { position: fixed; right: 16px; bottom: 16px; z-index: 95; display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 10px; background: #0f1214; color: #8a9196; font-size: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.mock-bar a, .mock-bar button { height: 26px; padding: 0 9px; border-radius: 7px; color: #f0f0f0; display: inline-grid; place-items: center; font-weight: 600; }
.mock-bar a:hover, .mock-bar button:hover { background: #252c31; }
.mock-bar a.is-on { background: #4ac578; color: #0f1214; }

@media (max-width: 900px) {
	.settings { grid-template-columns: 1fr; gap: 16px; }
	.set-side { position: static; }
	.set-menu, .rail { position: static; display: flex; overflow-x: auto; gap: 4px; }
	.set-menu a, .rail a { flex: none; }
	.rail-marker { display: none; }
	.set-menu a.is-on, .rail a.is-on { background: var(--hover-strong); }
	.rules { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.wrap { padding: 20px calc(16px - var(--sb)) 96px 16px; }
	.page-head { flex-direction: column; gap: 12px; margin-bottom: 20px; }
	.page-head h1 { font-size: 23px; }
	.form-grid { grid-template-columns: 1fr; }
	.facts { grid-template-columns: 1fr; }
	.search { width: 100%; }
	.swatches { grid-template-columns: 1fr 1fr; gap: 10px; }
	.swatch-chip { height: 80px; }
	.swatch-use { display: none; }
	.swatch-meta { display: grid; justify-items: start; gap: 4px; }
	.role-badge { margin-left: 0; }
	.pair-demo { width: 120px; }
	.scale-row { grid-template-columns: 1fr; gap: 6px; padding: 14px 16px; }
	.scale-sample { white-space: normal; }
	.prop { grid-template-columns: 36px minmax(0, 1fr); }
	.prop .status { grid-column: 2; justify-self: start; }
	.prop .when { display: none; }
	.person, .agent { flex-wrap: wrap; }
	.grants, .agent > .muted { order: 3; width: 100%; padding-left: 46px; }
	.agent .btn { margin-left: auto; }
	.updated { justify-content: flex-start; min-width: 0; }
	.mini-pair { grid-template-columns: 44px 1fr auto; }
	.mini-pair .ratio { display: none; }
	.mock-bar { right: 8px; bottom: 8px; }
	.btn-collapse { padding: 0 11px; }
	.btn-collapse span { display: none; }
}

.scroll.is-locked { overflow: hidden; scrollbar-gutter: auto; }
.wrap.wrap-full { max-width: none; height: 100%; padding: 0; }

/* Settings, Agents: the address to add, and the two lists under their small heads */
.conn-url { width: 100%; margin-bottom: 18px; }
.sub-head { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; color: var(--muted); font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.sub-head .ico { width: 14px; height: 14px; }
.sub-head .btn { margin-left: auto; font-family: "Noto Sans", system-ui, sans-serif; font-size: 13px; text-transform: none; letter-spacing: 0; }
