/* Loop hub. Warm white and brown, centered 720px column, serif wordmark, floating bottom nav. */
:root {
  --bg: #FDFCFB; --ink: #3F2C2A; --text: #4D3533; --muted: #6F5A57; --soft: #7E6865;
  --line: #E8DFDC; --card: #fff; --card-line: #EFE7E4; --tint: #F5EFED; --tint2: #F7F2F0;
  --brown: #4D3533; --brown-2: #64494A; --ok: #3F7556; --ok-bg: #E9F2EC; --warn: #8E5B22; --warn-bg: #FBF1E4;
  --no: #A3412F; --no-bg: #FBEBE7; --info: #4B5E86; --info-bg: #ECEFF6;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: inherit; text-decoration-color: #CDBDB9; text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: var(--ink); }
ul, ol { list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brown); outline-offset: 2px; border-radius: 6px; }
h1:focus, main:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 80; background: var(--brown); color: var(--bg); padding: 10px 14px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { width: 760px; max-width: calc(100% - 40px); margin: 0 auto; padding: 0 0 150px; }
.wrap:has(#auth-form input[autocomplete="current-password"], #loop-auth-screen) {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto auto 1fr;
  padding: 0;
}
.wrap:has(#auth-form input[autocomplete="current-password"], #loop-auth-screen) > main {
  grid-row: 3;
  padding-block: 16px;
}
.top { position: relative; height: 92px; display: flex; align-items: center; justify-content: center; }
.logo { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; padding: 4px 10px; }
.logo-img { display: block; height: 38px; width: auto; }
.back, .toplink { position: absolute; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--soft); text-decoration: none; padding: 8px 4px; min-height: 40px; display: inline-flex; align-items: center; gap: 4px; max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { left: 0; }
.toplink { right: 0; }
.back:hover, .toplink:hover, .toplink[aria-current] { color: var(--ink); }

/* type */
h1 { font-size: 26px; line-height: 1.25; font-weight: 600; color: var(--ink); margin-top: 18px; letter-spacing: -.2px; }
.hero { text-align: center; }
.hero h1 { font-family: var(--serif); font-weight: 500; font-size: 28px; margin-top: 4px; }
.intro { color: var(--muted); font-size: 15px; line-height: 22px; margin: 8px auto 0; max-width: 520px; }
.lead { font-size: 15px; color: var(--muted); margin-top: 6px; line-height: 22px; max-width: 600px; }
.kicker { font-size: 12px; color: var(--soft); text-transform: uppercase; letter-spacing: .08em; margin-top: 18px; }
.kicker + h1 { margin-top: 4px; }
h2 { font-size: 17px; font-weight: 600; color: var(--ink); margin: 44px 0 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h2 small { font-size: 13px; font-weight: 400; color: var(--soft); }
h2.flat { margin: 0 0 10px; }
h2.center, .center { text-align: center; justify-content: center; }
.sub { font-size: 13.5px; color: var(--muted); margin: -2px 0 10px; line-height: 20px; }
.meta { font-size: 13px; color: var(--soft); margin-top: 8px; }
.d { font-size: 13.5px; color: var(--muted); line-height: 19px; }
.d.sm, .sm.d { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; color: var(--muted); word-break: break-all; }
.pre { white-space: pre-wrap; word-break: break-word; }
.summary { font-size: 16px; line-height: 24px; color: var(--ink); margin-top: 18px; }
.h1row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.h1row h1 { margin-top: 0; }
.ok { color: var(--ok); } .no { color: var(--no); } .warn { color: var(--warn); }

/* rows and lists */
.list > li { border-bottom: 1px dashed var(--line); }
.row { display: flex; align-items: center; gap: 16px; padding: 14px 4px; text-decoration: none; color: inherit; border-radius: 10px; }
.row.click:hover { background: rgba(245, 239, 237, .55); }
.row.click:hover .t { text-decoration: underline; text-decoration-color: #D9CBC7; }
.txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.t { font-size: 15px; color: var(--ink); line-height: 21px; }
.txt .d { overflow-wrap: anywhere; }
.ic { width: 40px; height: 40px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: #fff; background: var(--brown); }
.ic.big { width: 52px; height: 52px; border-radius: 14px; font-size: 20px; }
.ic.line { background: var(--tint); color: var(--text); }
.av0 { background: #4D3533; } .av1 { background: #8A5A44; } .av2 { background: #5E7A66; } .av3 { background: #6B5B8E; } .av4 { background: #A0603A; } .av5 { background: #3F5F7A; }
.chev { color: #A8958F; font-size: 22px; line-height: 1; flex: none; }
.go { font-size: 13px; color: var(--soft); white-space: nowrap; }
.price { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 84px; }
.p { font-size: 15px; color: var(--ink); font-weight: 500; }
.pill { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 4px; font-size: 12.5px; color: var(--muted); background: var(--tint); border-radius: 12px; padding: 4px 10px; flex: none; white-space: nowrap; }
.pill b { color: var(--text); font-weight: 600; }
.pill.warn { color: var(--warn); background: var(--warn-bg); font-weight: 500; }
.pill.no { color: var(--no); background: var(--no-bg); font-weight: 500; }
.pill.muted { color: var(--soft); background: var(--tint); }
.row-title { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* Keep dashboard content between the header and bottom navigation. */
body:has(.nav:not([hidden])) .wrap {
  height: 100dvh;
  padding-bottom: calc(68px + max(24px, env(safe-area-inset-bottom)));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}
body:has(.nav:not([hidden])) main {
  grid-row: 3;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 4px 4px;
}
.vault-editor > summary { cursor: pointer; font-weight: 600; }
.vault-editor[open] > summary { margin-bottom: 10px; }
.cat-groups[aria-label="Agents"] { overflow: clip; }
.connections-list { border: 1px solid var(--card-line); border-radius: 15px; overflow: clip; margin-top: 16px; }
.connections-list > .conn-card { border: 0; border-radius: 0; }
.connections-list > .conn-card + .conn-card { border-top: 1px solid var(--card-line); }
.wrap:has(.home-connections) .view {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.home-connections {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.home-connections > :last-child {
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cat-groups { margin-top: 4px; border: 1px solid var(--card-line); border-radius: 15px; }
.cat-groups > .cat-group { border: 0; border-bottom: 1px solid var(--card-line); border-radius: 0; }
.cat-groups > .cat-add-trigger { width: 100%; }
.cat-group {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 15px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.cat-group:hover { border-color: #DDD0CC; }
.cat-group.open { border-color: #D9C9C4; box-shadow: 0 3px 12px rgba(77, 53, 51, .04); }
.cat-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  text-align: left;
  transition: background .15s;
}
.cat-head:hover { background: rgba(245, 239, 237, .45); }
.cat-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cat-title { font-size: 15.5px; font-weight: 600; color: var(--ink); line-height: 21px; }
.cat-right { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.cat-items { border-top: 1px dashed var(--line); background: #FCF9F7; padding: 2px 12px 4px; }
.cat-items > li:last-child { border-bottom: 0; }
.cat-items .row { padding: 12px 6px; }
.cat-items .row.is-off .t { color: var(--muted); }
.cat-empty { padding: 14px 6px; font-size: 13.5px; color: var(--muted); }

/* Agents page: one row per agent; opening a row shows its setup, settings and activity */
.agent-body { border-top: 1px dashed var(--line); background: #FCF9F7; padding: 2px 16px 18px; }
.agent-facts { font-size: 13px; color: var(--muted); line-height: 19px; margin-top: 14px; overflow-wrap: anywhere; }
.agent-body .conn-drawer { border-top: 0; background: none; padding: 0; }
.agent-body .list > li:last-child { border-bottom: 0; }
.agent-row.is-off .cat-title { color: var(--muted); }
.agent-add { background: transparent; border-style: dashed; }
.agent-add .cat-title { font-weight: 500; }
.cat-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 6px 10px;
  border-top: 1px dashed var(--line);
}

/* Add new category dashed card & inline composer */
.cat-add-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border-radius: 15px;
  border: 1.5px dashed #E1D5D1;
  background: transparent;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.cat-add-trigger:hover {
  border-color: #C7B6B2;
  background: #FAF6F4;
  transform: translateY(-1px);
}
.cat-add-plus {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background .16s ease, color .16s ease;
}
.cat-add-trigger:hover .cat-add-plus {
  background: var(--brown);
  color: var(--bg);
}
.cat-add-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cat-add-title { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 20px; }
.cat-add-card {
  background: var(--card);
  border: 1px solid #DFD2CE;
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 6px 22px rgba(77, 53, 51, .06);
}
.cat-add-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.cat-add-head h3 { font-size: 15.5px; font-weight: 600; color: var(--ink); margin: 0; }
.cat-pick-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cat-pick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 148px;
  overflow-y: auto;
  padding: 2px 0;
}
.cat-pick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  padding: 5px 10px;
  border-radius: 14px;
  border: 1px solid #EAE0DC;
  background: var(--tint2);
  color: var(--text);
  transition: background .14s, border-color .14s, color .14s;
}
.cat-pick:hover { border-color: #C7B6B2; background: var(--tint); }
.cat-pick[aria-pressed=true] {
  background: var(--brown);
  border-color: var(--brown);
  color: var(--bg);
}
.held { color: var(--warn); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 500; border-radius: 10px; padding: 2px 8px; vertical-align: 1px; white-space: nowrap; }
.tag.ok { color: var(--ok); background: var(--ok-bg); }
.tag.warn { color: var(--warn); background: var(--warn-bg); }
.tag.no { color: var(--no); background: var(--no-bg); }
.tag.info { color: var(--info); background: var(--info-bg); }
.tag.muted, .tag.brown { color: #7A5F55; background: #F3ECE9; }
.statusline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 28px; }
.stats a { display: flex; flex-direction: column; gap: 2px; height: 100%; background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; padding: 14px; text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.stats a:hover { border-color: #D3C3BF; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(77, 53, 51, .06); }
.stats a.hot { border-color: #E6C9A4; background: #FFFBF5; }
.stats b { font-size: 22px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12.5px; color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 500; border-radius: 9px; padding: 9px 14px; min-height: 40px; border: 1px solid #E0D5D1; background: var(--card); color: var(--text); white-space: nowrap; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover { border-color: #C7B6B2; }
.btn.fill { background: var(--brown); border-color: var(--brown); color: var(--bg); }
.btn.fill:hover { background: #3A2826; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--tint); }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn.big { width: 100%; padding: 14px; font-size: 16px; border-radius: 12px; min-height: 50px; }
.btn.danger { background: var(--no); border-color: var(--no); color: #fff; }
.btn.danger-outline { color: var(--no); border-color: #E7C3BB; }
.btn.danger-outline:hover { background: var(--no-bg); }
.btn:disabled, .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.acts.center { justify-content: center; }
.acts.stack { flex-direction: column; }
.saved { font-size: 13px; color: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip { font-size: 13px; color: var(--muted); border: 1px solid #EDE4E1; background: var(--card); border-radius: 16px; padding: 6px 12px; min-height: 34px; }
.chip span { color: var(--soft); margin-left: 2px; }
.chip[aria-pressed=true] { background: var(--brown); border-color: var(--brown); color: var(--bg); }
.chip[aria-pressed=true] span { color: #E2D4D0; }

/* cards, notes, callouts */
.card { margin-top: 20px; border: 1px solid var(--card-line); background: var(--card); border-radius: 16px; padding: 20px 22px; }
.note { background: var(--tint2); border-radius: 14px; padding: 16px 18px; font-size: 13.5px; color: var(--muted); line-height: 20px; margin-top: 28px; }
.note .acts { margin-top: 10px; }
.callout { display: block; margin-top: 18px; background: var(--tint2); border: 1px solid #EEE4E0; border-radius: 12px; padding: 13px 16px; font-size: 13.5px; color: var(--text); line-height: 20px; }
.callout .acts { margin-top: 10px; }
.callout.warn { background: var(--warn-bg); border-color: #F0DDC2; color: #6E4718; }
.callout.bad { background: var(--no-bg); border-color: #F0CFC7; color: #7E2F22; }
.callout .spin.sm { vertical-align: -3px; margin-right: 6px; }
.banner-slot:empty { display: none; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--info-bg); color: #36466A; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; margin-top: 4px; }
.banner.warn { background: var(--warn-bg); color: #6E4718; }

/* forms */
.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 16px 0 6px; }
.card > .lbl:first-child, form > .lbl:first-child { margin-top: 0; }
input[type=text], input[type=number], input[type=search], input:not([type]), textarea { width: 100%; border: 1px solid #E3D9D5; background: #fff; border-radius: 10px; padding: 11px 13px; font-size: 15px; line-height: 21px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 84px; }
input:focus, textarea:focus { outline: none; border-color: #B9A39E; box-shadow: 0 0 0 3px rgba(77, 53, 51, .12); }
input[aria-invalid=true] { border-color: var(--no); }
.hint { font-size: 12.5px; color: var(--soft); margin-top: 8px; line-height: 18px; }
.field-err { font-size: 13px; color: var(--no); margin-top: 8px; }
.search { margin-top: 22px; border: 1px solid #EDE4E1; background: #fff; border-radius: 12px; padding: 0 14px; display: flex; gap: 10px; align-items: center; }
.search:focus-within { border-color: #B9A39E; box-shadow: 0 0 0 3px rgba(77, 53, 51, .12); }
.search input { border: 0; padding: 13px 0; background: none; box-shadow: none !important; }
.sicon { color: #A8958F; font-size: 18px; }

/* code blocks */
.code { font-family: var(--mono); font-size: 12.5px; line-height: 19px; background: #FAF6F4; border: 1px solid #EFE6E2; border-radius: 10px; padding: 12px 14px; overflow: auto; max-height: 420px; white-space: pre; color: #3F2C2A; text-align: left; }
.code.mini { max-height: 180px; white-space: pre-wrap; }
.code.result { max-height: 520px; }
.codewrap { position: relative; }
.codewrap .code { padding-right: 76px; white-space: pre-wrap; word-break: break-all; }
.copybtn { position: absolute; top: 8px; right: 8px; }
h3.lbl { margin-top: 18px; }

/* tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.tab { font-size: 13.5px; color: var(--muted); border: 1px solid #EDE4E1; background: var(--card); border-radius: 16px; padding: 7px 14px; min-height: 36px; }
.tab[aria-selected=true] { background: var(--brown); border-color: var(--brown); color: var(--bg); }
.tabpanel { margin-top: 12px; }

/* agent header and danger */
.ah { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.ah h1 { margin-top: 0; }
.danger { margin-top: 44px; padding-top: 4px; }
.danger h2 { color: var(--no); margin-top: 0; }

/* empty, loading */
.empty { text-align: center; background: var(--tint2); border-radius: 16px; padding: 28px 22px; margin-top: 14px; }
.empty .et { font-size: 16px; font-weight: 600; color: var(--ink); margin: 0; }
.empty h1.et { font-size: 20px; }
.empty .ed { font-size: 13.5px; color: var(--muted); margin: 6px auto 0; max-width: 440px; line-height: 20px; }
.empty.err { background: var(--no-bg); }
.loading { text-align: center; padding: 48px 0; color: var(--soft); font-size: 14px; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #EDE4E1; border-top-color: var(--brown); animation: spin .8s linear infinite; margin: 10px auto; }
.spin.sm { display: inline-block; width: 14px; height: 14px; border-width: 2px; margin: 0; vertical-align: -2px; }
.btn.fill .spin.sm { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }

/* nav */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(24px, env(safe-area-inset-bottom)); background: var(--brown); border-radius: 26px; padding: 7px; display: flex; gap: 4px; box-shadow: 0 8px 24px rgba(77, 53, 51, .25); z-index: 20; }
.nav a { position: relative; height: 40px; padding: 0 12px; border-radius: 20px; display: flex; align-items: center; gap: 6px; color: #E9DEDB; font-size: 13px; text-decoration: none; transition: background .15s; white-space: nowrap; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a[aria-current=page] { background: var(--brown-2); color: #fff; }
.nav a:focus-visible { outline-color: #fff; }
.nav svg { flex: none; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #E8A65B; color: #3F2C2A; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* toast */
.toast { position: fixed; left: 50%; top: 20px; transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--ink); color: var(--bg); font-size: 14px; padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 4px); }
.toast.ok { background: #2F4F3D; }
.toast.err { background: #7E2F22; }
.noscript { text-align: center; padding: 40px; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .wrap { max-width: calc(100% - 32px); padding-bottom: 130px; }
  .top { height: 76px; }
  .logo-img { height: 32px; }
  .back, .toplink { font-size: 13px; }
  h1 { font-size: 23px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .stats a { padding: 10px 6px; overflow-wrap: anywhere; }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 18px 16px; }
  .row { gap: 12px; }
  .pill { max-width: 46%; }
  .appr-side { align-items: stretch; flex-basis: 100%; }
  .appr-amt { align-items: flex-start; flex-direction: row; gap: 8px; align-items: baseline; }
  .appr-acts { justify-content: flex-start; }
  .li { flex-direction: column; gap: 2px; }
  .li dd { text-align: left; }
  .nav { left: 12px; right: 12px; transform: none; justify-content: space-between; border-radius: 22px; padding: 6px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .nav a { flex: 1; flex-direction: column; justify-content: center; gap: 2px; height: 50px; padding: 0 2px; font-size: 11px; border-radius: 16px; }
  .nav .badge { position: absolute; top: 3px; right: calc(50% - 22px); }
  .amt { font-size: 36px; }
}
@media (max-width: 380px) {
  .stats b { font-size: 19px; }
  .go { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: .001s !important; animation-iteration-count: 1 !important; }
}
@media (forced-colors: active) {
  .radio, .btn, .chip, .tab { border: 1px solid ButtonText; }
  .offer input:checked + label .radio { background: Highlight; }
}

/* Loop Gateway components */
input[type=url], input[type=password], select {
  width: 100%;
  border: 1px solid #E3D9D5;
  background: #fff;
  color: var(--ink);
  font: inherit;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 15px;
  line-height: 21px;
  transition: border-color .15s, box-shadow .15s;
}
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
select:focus { outline: none; border-color: #B9A39E; box-shadow: 0 0 0 3px rgba(77, 53, 51, .12); }

.inline-code {
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--tint);
  padding: 1px 6px;
  border-radius: 6px;
  color: var(--ink);
}

.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field .lbl { margin: 0 0 6px; }
.code-input { font-family: var(--mono); font-size: 13px; line-height: 1.5; }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }

.seg {
  display: inline-flex;
  background: var(--tint);
  border: 1px solid #EAE0DC;
  border-radius: 11px;
  padding: 3px;
  gap: 3px;
}
.seg + .form-grid { margin-top: 16px; }
.seg-btn {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed=true] {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(77, 53, 51, .1);
}

/* Home connect card */
.connect-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.connect-head h2 { margin: 0; }
.profile-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.profile-pick select {
  width: auto;
  min-width: 132px;
  padding: 6px 30px 6px 11px;
  font-size: 13.5px;
  border-radius: 9px;
}
.endpoint-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FAF6F4;
  border: 1px solid #EFE6E2;
  border-radius: 10px;
  padding: 7px 8px 7px 13px;
  margin-top: 12px;
}
.endpoint-url {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  overflow-x: auto;
  white-space: nowrap;
}

/* Transport & profile tags */
.tag.transport {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--tint);
}
.tag.transport.stdio { color: var(--muted); background: var(--tint); }
.tag.profile { color: var(--muted); background: var(--tint); }

/* Connections action bar & cards */
.bar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.bar-actions h2 { margin: 0; }
.bar-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.conn-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.conn-card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color .15s;
}
.conn-card:hover { border-color: #DFD2CE; }
.conn-card.disabled .conn-title { color: var(--muted); }
.conn-head { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.conn-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.conn-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.conn-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.conn-title { font-size: 15.5px; font-weight: 600; color: var(--ink); }
.conn-desc { font-size: 13.5px; color: var(--text); line-height: 19px; }
.conn-sub { font-family: var(--mono); font-size: 12.5px; color: var(--muted); word-break: break-all; }
.drawer-desc-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.drawer-desc-form input { flex: 1; min-width: 220px; }
.conn-err {
  font-size: 13px;
  color: var(--no);
  background: var(--no-bg);
  border: 1px solid #F0CFC7;
  border-radius: 8px;
  padding: 7px 10px;
  line-height: 18px;
}
.conn-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Connection expandable drawer */
.conn-drawer {
  border-top: 1px dashed var(--line);
  background: #FCF9F7;
  padding: 16px 18px 18px;
}
.drawer-sec { margin-top: 16px; }
.drawer-sec:first-child { margin-top: 0; }
.drawer-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--soft);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Tool toggle rows & inline tester */
.tool-list { display: flex; flex-direction: column; gap: 8px; }
.tool-item {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 12px;
  padding: 11px 13px;
}
.tool-item.off { background: var(--tint2); }
.tool-item.off .tool-name { color: var(--soft); text-decoration: line-through; text-decoration-color: #CDBDB9; }
.tool-row { display: flex; align-items: flex-start; gap: 10px; }
.tool-check {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--brown);
  cursor: pointer;
  flex: none;
}
.tool-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tool-name { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink); word-break: break-word; }
.tool-desc { font-size: 13px; color: var(--muted); line-height: 18px; }

.tool-tester {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.schema-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.schema-param {
  background: var(--tint2);
  border: 1px solid #EAE0DC;
  border-radius: 7px;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}
.schema-param .req { color: var(--no); font-weight: 600; }
.tester-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tester-out { margin-top: 2px; }

/* Vault list */
.secret-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  flex-wrap: wrap;
}
.secret-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.oauth-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .conn-head, .conn-drawer { padding-left: 14px; padding-right: 14px; }
}

/* Agents tab and import-from-agents panel */
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
label.tool-row, label.tool-item { cursor: pointer; }
label.tool-item.off { cursor: default; }
.tool-name .tag { margin-left: 4px; }
.tool-desc.mono { word-break: break-all; }

/* Sign-in and secret viewing */
.nav[hidden], .toplink[hidden] { display: none; }
#loop-auth-screen { width: min(100%, 460px); margin-inline: auto; }
#loop-clerk-mount { display: grid; place-items: center; margin-top: 22px; }
#loop-clerk-mount > * { max-width: 100%; }
#loop-clerk-mount .loop-clerk-title { font-family: var(--serif); }
#loop-auth-screen .acts { margin-top: 16px; }
.secret-row { flex-wrap: wrap; }
.secret-row.focus { outline: 2px solid var(--brown); outline-offset: 2px; border-radius: 12px; }
.reveal-box { flex-basis: 100%; margin-top: 12px; }
.reveal-box .code { word-break: break-all; white-space: pre-wrap; }

/* Live top approval banner */
.approval-banner {
  background: var(--warn-bg);
  border: 1px solid #EACBA2;
  border-radius: 16px;
  padding: 14px 16px;
  margin: 4px 0 18px;
  color: #5C3A12;
  box-shadow: 0 4px 16px rgba(142, 91, 34, .08);
}
.approval-banner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--warn);
}
.approval-count {
  background: #F3DEC0;
  color: #6E4718;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 10px;
  padding: 2px 8px;
  text-transform: none;
  letter-spacing: 0;
}
.approval-list {
  display: flex;
  flex-direction: column;
}
/* Many approvals at once never push the page away: the banner stops at about a third of the
   window and its list scrolls, with the heading and count always in view. */
body:has(.nav:not([hidden])) .approval-banner { display: flex; flex-direction: column; max-height: max(180px, 34vh); }
body:has(.nav:not([hidden])) .approval-banner-head { flex: none; }
body:has(.nav:not([hidden])) .approval-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; margin-right: -8px; padding-right: 8px; }
.approval-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px dashed #E4C49A;
}
.approval-item:first-child { border-top: 0; padding-top: 2px; }
.approval-item:last-child { padding-bottom: 2px; }
.approval-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.approval-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.approval-agent {
  background: #F2DBBA;
  color: #6B4315;
}
.approval-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 20px;
  overflow-wrap: anywhere;
}
.approval-reason {
  font-size: 13.5px;
  color: #6E4718;
  line-height: 19px;
}
.approval-detail {
  font-size: 12px;
  color: #5C3A12;
  background: rgba(255, 252, 246, .78);
  border: 1px solid #EDD3AE;
  border-radius: 8px;
  padding: 6px 9px;
  line-height: 17px;
  overflow-wrap: anywhere;
}
.approval-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  flex-wrap: wrap;
}

/* Compact selects */
select.select-sm {
  width: auto;
  min-width: 118px;
  padding: 5px 28px 5px 10px;
  font-size: 13px;
  line-height: 18px;
  min-height: 34px;
  border-radius: 9px;
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
}

/* Skills browser */
.skill-group { margin-top: 28px; }
.skill-group:first-child { margin-top: 18px; }
.skill-group > h2 { margin: 0 0 12px; }
.snippet-code {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  line-height: 1.55;
}
.codewrap .code.snippet-code { word-break: break-word; }
.skill-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.skill-drawer-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
  padding: 6px 0;
}

/* Typed vault badges */
.secret-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.tag.vault-type { color: #6B534B; background: var(--tint); }
.tag.vault-payment { color: #6E4718; background: #F5E7D3; }
.tag.vault-login { color: var(--info); background: var(--info-bg); }
.tag.vault-api_key { color: #7A5F55; background: #F3ECE9; }
.tag.vault-note { color: var(--muted); background: var(--tint2); }

/* Connection & tool approval controls */
.drawer-rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 12px;
  padding: 11px 13px;
}
.drawer-rule-copy {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.drawer-rule-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.tool-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.tool-policy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid #E5D9D5;
  background: var(--tint2);
  color: var(--muted);
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.tool-policy-btn:hover { border-color: #C7B6B2; color: var(--ink); }
.tool-policy-btn.ask {
  background: var(--warn-bg);
  border-color: #E8C598;
  color: var(--warn);
}
.tool-policy-btn.ask:hover { background: #F7E5CC; }
.tool-policy-btn.auto {
  background: var(--ok-bg);
  border-color: #BFD9C8;
  color: var(--ok);
}
.tool-policy-btn.auto:hover { background: #DCECE1; }
.tool-policy-btn:disabled { opacity: .55; cursor: not-allowed; }

/* Settings approval rules */
.policy-list { margin-top: 4px; }
.policy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  flex-wrap: wrap;
}
.policy-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.policy-copy {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.policy-name { font-size: 14.5px; font-weight: 500; color: var(--ink); }
.policy-row select.select-sm { min-width: 142px; }

@media (max-width: 640px) {
  .approval-item { flex-direction: column; }
  .approval-acts { width: 100%; }
  .policy-row select.select-sm,
  .drawer-rule-row select.select-sm { width: 100%; }
}

.vault-group { margin: 12px 0 30px; }
.vault-group h2 { margin: 0; align-items: center; font-size: 16px; }
.vault-group h2 button { width: 40px; height: 40px; font-size: 20px; }
.vault-group li + li { border-top: 1px dotted var(--line); }
.vault-group .secret-row { display: block; padding: 0 4px; }
.vault-group summary { display: flex; gap: 24px; align-items: center; min-height: 66px; cursor: pointer; overflow-wrap: anywhere; }
.vault-group summary::-webkit-details-marker { display: none; }
.vault-group summary svg { flex: none; }
.vault-group .secret-acts { margin: 10px 0 16px; }
.vault-empty { padding: 16px 0; font-size: 14px; color: var(--soft); }

.payment-dialog {
  margin: auto; width: min(520px, calc(100% - 28px)); max-height: calc(100dvh - 28px);
  overflow: auto; border: 0; border-radius: 14px; background: var(--bg); color: var(--text);
  box-shadow: 0 16px 48px #35232330;
}
.payment-dialog::backdrop { background: rgb(57 37 35 / 36%); }
.payment-dialog header { position: relative; padding: 58px 30px 42px; }
.payment-dialog h2 { margin: 0; display: block; text-align: center; font: 500 26px var(--serif); }
.payment-dialog header button { position: absolute; top: 20px; right: 20px; width: 38px; height: 38px; font-size: 21px; }
.payment-fields { padding: 24px 30px 30px; display: grid; gap: 20px; }
.payment-fields label { display: grid; min-width: 0; gap: 6px; font-size: 12px; color: var(--muted); }
.payment-fields input { width: 100%; min-width: 0; height: 35px; border: 1px solid var(--card-line); border-radius: 8px; padding: 6px 10px; background: white; }
.payment-fields input::placeholder { color: var(--soft); }
.payment-fields label > span { display: flex; align-items: center; gap: 6px; }
.payment-lock { position: relative; width: 10px; height: 8px; border: 1px solid; border-radius: 2px; margin: 3px 0 0 2px; }
.payment-lock::before { content: ''; position: absolute; left: 1px; top: -5px; width: 6px; height: 5px; border: 1px solid; border-radius: 4px 4px 0 0; }
.payment-expiry { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.payment-dialog footer { display: flex; justify-content: flex-end; gap: 12px; padding: 18px 25px; border-top: 1px solid var(--card-line); }
.payment-dialog button:disabled { color: var(--soft); background: var(--tint); border-color: transparent; opacity: .6; }

.connection-summary {
  width: 100%; display: flex; align-items: center; gap: 8px; min-height: 38px;
  padding: 4px 12px; text-align: left;
}
.connection-summary .conn-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.connection-summary:hover { background: var(--tint); }
.connection-summary:focus-visible { outline-offset: -3px; }
.connection-chevron { font-size: 20px; color: var(--soft); }
.connection-summary[aria-expanded="true"] .connection-chevron { transform: rotate(90deg); }
.conn-head .conn-meta:empty { display: none; }

.memory-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.memory-toolbar input[type="search"] { flex: 1 1 200px; min-width: 0; }

.loop-dialog {
  margin: auto; width: min(520px, calc(100% - 28px)); max-height: calc(100dvh - 28px);
  overflow: auto; border: 0; border-radius: 14px; padding: 28px;
  color: var(--text); background: var(--bg); box-shadow: 0 16px 48px #35232330;
}
.loop-dialog::backdrop { background: rgb(57 37 35 / 36%); }
.loop-dialog > h2 { justify-content: center; margin: 0 0 24px; font: 500 25px var(--serif); }
.loop-dialog .acts { justify-content: flex-end; }
.agent-command { overflow-wrap: anywhere; padding: 14px; background: var(--tint); border-radius: 10px; }

.agent-setup-heading, .agent-setup-box { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.agent-setup-heading { flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.agent-setup-heading h2 { font-size: 16px; margin: 0; }
.agent-setup-switch { display: flex; padding: 3px; border-radius: 8px; background: var(--tint); }
.agent-setup-switch button { padding: 4px 9px; border-radius: 6px; font-size: 13px; }
.agent-setup-switch [aria-pressed="true"] { background: var(--card); box-shadow: 0 1px 3px #35232320; }
.agent-setup-box { padding: 14px; border: 1px solid var(--card-line); border-radius: 10px; background: var(--card); }
.agent-setup-box .agent-command { padding: 0; min-width: 0; background: transparent; font: 14px/1.6 var(--mono); }

/* ==========================================================================
   Instinct pass (2026-11-20). Source of truth: Doop canvas MUChXhf3N2,
   page "v2 · Instinct", guideline "brand-instinct". Reference: app.instinct.com/vault.
   One quiet 720px column, list-first, dotted hairlines, no boxed cards or chip soup,
   icon-only nav pill with tooltip labels. Overrides only; delete this block to revert.
   ========================================================================== */
:root {
  --ink: #4D3533; --text: #4D3533; --muted: rgba(77, 53, 51, .7); --soft: rgba(77, 53, 51, .5);
  --hair: rgba(77, 53, 51, .16); --line: rgba(77, 53, 51, .16);
}
body { font-size: 14px; line-height: 21px; letter-spacing: -.15px; color: var(--ink); }

/* header: small centered wordmark; Settings is the text link at the top right */
.top { height: 64px; }
.logo-img { height: 28px; }
.back { font-size: 13px; }

/* type */
h1 { font-size: 22px; }
h2 { font-size: 17px; font-weight: 600; margin: 56px 0 4px; min-height: 32px; align-items: center; justify-content: flex-start; gap: 8px; }
h2 small { font-size: 13px; color: var(--soft); }
.sub, .lead, .intro, .d { color: var(--muted); font-size: 14px; }
.d.sm, .sm.d { font-size: 13px; }
.t { font-size: 14px; line-height: 21px; color: var(--ink); }
.meta { font-size: 13px; color: var(--soft); }
.kicker { text-transform: none; letter-spacing: 0; font-size: 13px; }

/* rows: Instinct list rhythm */
.list > li { border-bottom: 1px dotted var(--hair); }
.list > li:last-child { border-bottom: 0; }
.row { padding: 16px 0; gap: 16px; border-radius: 0; }
.row.click:hover { background: transparent; }
.row.click:hover .t { text-decoration: underline; text-decoration-color: rgba(77, 53, 51, .3); text-underline-offset: 3px; }
.chev { color: var(--soft); font-size: 18px; }

/* status labels: quiet text, colored only when it matters */
.pill, .tag { background: transparent !important; padding: 0; border-radius: 0; font-size: 13px; font-weight: 400; color: var(--soft); }
.pill b { font-weight: 400; color: inherit; }
.pill.warn, .tag.warn { color: var(--warn); }
.pill.no, .tag.no { color: var(--no); }
.tag.ok { color: var(--ok); }
.pill.warn::before, .pill.no::before, .tag.warn::before, .tag.no::before, .tag.ok::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }

/* buttons: small pills */
.btn { min-height: 32px; padding: 6px 14px; font-size: 13px; font-weight: 600; border-radius: 999px; border-color: rgba(77, 53, 51, .18); background: transparent; color: var(--ink); }
.btn:hover { border-color: rgba(77, 53, 51, .4); }
.btn.fill { background: var(--brown); border-color: var(--brown); color: #fff; }
.btn.sm { min-height: 30px; padding: 5px 12px; font-size: 13px; }
.btn.ghost { border-color: transparent; }
.btn.big { border-radius: 999px; min-height: 44px; font-size: 14px; }

/* filter chips: text tabs instead of boxed chips */
.chips { gap: 18px; margin-top: 24px; }
.chip { border: 0; background: transparent; padding: 4px 0; min-height: 0; border-radius: 0; font-size: 14px; color: var(--soft); }
.chip[aria-pressed=true] { background: transparent; color: var(--ink); font-weight: 600; box-shadow: inset 0 -1.5px 0 var(--ink); }
.chip[aria-pressed=true] span, .chip span { color: var(--soft); font-weight: 400; }

/* unbox every card/list container */
.card { border: 0; background: transparent; border-radius: 0; padding: 0; margin-top: 40px; }
.cat-groups, .connections-list { border: 0; border-radius: 0; background: transparent; margin-top: 4px; overflow: visible; }
.cat-groups > .cat-group, .cat-group, .conn-card, .connections-list > .conn-card { border: 0; border-bottom: 1px dotted var(--hair); border-radius: 0; background: transparent; box-shadow: none; }
.connections-list > .conn-card + .conn-card { border-top: 0; }
.cat-group:hover, .cat-group.open, .conn-card:hover { border-color: var(--hair); box-shadow: none; }
.cat-head, .connection-summary { padding: 16px 0; gap: 16px; background: transparent !important; }
.cat-head:hover .cat-title, .connection-summary:hover .conn-title { text-decoration: underline; text-decoration-color: rgba(77, 53, 51, .3); text-underline-offset: 3px; }
.cat-title, .conn-title { font-size: 14px; font-weight: 400; line-height: 21px; color: var(--ink); }
.cat-items { border-top: 0; background: transparent; padding: 0 0 8px 56px; }
.cat-items .row { padding: 12px 0; }
.agent-add { border: 0; }
.agent-add .cat-title { font-weight: 400; color: var(--muted); }

/* add-category trigger: a quiet "+" row */
.cat-add-trigger { border: 0 !important; background: transparent !important; padding: 16px 0; border-radius: 0; }
.cat-add-plus { background: transparent !important; border: 0 !important; width: 40px; height: 40px; color: var(--ink); }
.cat-add-title { font-weight: 400; font-size: 14px; }

/* empty states: plain tertiary text like "No cards saved" */
.empty { text-align: left; background: transparent; border-radius: 0; padding: 12px 0 0; margin-top: 0; }
.empty .et { font-size: 14px; font-weight: 400; color: var(--soft); }
.empty .ed { font-size: 14px; color: var(--soft); margin-top: 2px; }
.empty .acts { justify-content: flex-start; }

/* inputs: underline search like the Doop memory frame */
.memory-toolbar { margin-top: 40px; gap: 12px; }
.memory-toolbar input[type="search"], input[type="search"] { border: 0; border-bottom: 1px dotted rgba(77, 53, 51, .3); border-radius: 0; background: transparent; padding: 8px 0; min-height: 40px; box-shadow: none; }
.memory-toolbar input[type="search"]:focus { outline: none; border-bottom-color: var(--ink); }

/* home */
.home-lede { margin-top: 40px; font-size: 14px; color: var(--muted); }
.home-lede a { text-decoration: none; color: inherit; }
.home-lede a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(77, 53, 51, .3); }
.home-lede b { color: var(--ink); font-weight: 600; }
.home-lede .warn { color: var(--warn); }
.home-sec h2, .home-connections h2 { justify-content: flex-start; }
.home-add { margin-left: auto; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 300; color: var(--ink); text-decoration: none; border-radius: 999px; }
.home-add:hover { background: rgba(77, 53, 51, .06); }
.home-ic { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.home-ic.mark { border-radius: 8px; background: #F1EEEC; font-size: 15px; font-weight: 600; }
.home-ic.mark.claude { background: #F6E7E1; color: #C8613F; }
.home-ic.mark.logo { background: none; }
.home-ic.mark.logo img { width: 26px; height: 26px; display: block; }
.home-st { font-size: 13px; color: var(--soft); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; flex: none; }
.home-st i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.home-st.ok { color: var(--ok); }
.home-st.warn { color: var(--warn); }
.home-rows .row .btn { pointer-events: none; }
.cat-head .home-ic { margin: -9px 0; }

/* nav: Instinct pill, icon-only, label as tooltip */
.nav { height: 52px; padding: 0 4px; gap: 4px; align-items: center; border-radius: 26px; box-shadow: 0 8px 24px rgba(77, 53, 51, .18); }
.nav a { width: 52px; height: 44px; flex: none; padding: 0; justify-content: center; border-radius: 22px; color: rgba(255, 255, 255, .72); }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a[aria-current=page] { background: rgba(255, 255, 255, .12); color: #fff; }
.nav svg { width: 20px; height: 20px; }
.nav .nl { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translate(-50%, 4px); background: #fff; color: var(--ink); font-size: 13px; line-height: 18px; padding: 4px 10px; border-radius: 999px; box-shadow: 0 2px 10px rgba(77, 53, 51, .14); opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; white-space: nowrap; }
.nav a:hover .nl, .nav a:focus-visible .nl { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 640px) {
  .nav a { flex: none; width: 48px; height: 44px; flex-direction: row; }
  .cat-items { padding-left: 0; }
}
/* home is one scrolling column now, not a fixed stats + scroller grid */
.wrap:has(.home-connections) .view { height: auto; display: block; }
.home-connections { display: block; }
.home-connections > :last-child { overflow: visible; }
.home-lede + .home-sec > h2 { margin-top: 40px; }
/* section "+" buttons sit at the right edge, count stays next to the title */
h2 > button, h2 > .btn, h2 > a:last-child { margin-left: auto; }
.empty .ed { margin-left: 0; margin-right: 0; text-align: left; }
.agent-row .cat-head { gap: 16px; }
.agent-row .cat-head .home-ic { margin: -9px 0; }
.agent-body { padding: 0 0 16px 56px; }
/* memory scope filters: text tabs, not filled pills */
/* settings labels: sentence case like Instinct */
.lbl { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]):not([type=search]), select, textarea { border-color: rgba(77, 53, 51, .18); }
@media (max-width: 640px) { .agent-body { padding-left: 0; } }

/* Connections category filter: one line, scrolls sideways when it overflows */
.chips.chips-scroll { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; padding-bottom: 2px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.chips.chips-scroll.at-end { -webkit-mask-image: none; mask-image: none; }
.chips.chips-scroll::-webkit-scrollbar { display: none; }
.chips.chips-scroll .chip { flex: 0 0 auto; white-space: nowrap; }

/* Category pills (Connections filter) */
.chips.chips-scroll { gap: 8px; margin-top: 22px; padding: 2px 0 4px; }
.chips.chips-scroll .chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--hair); background: transparent;
  color: var(--muted); font-size: 13.5px; font-weight: 500; box-shadow: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.chips.chips-scroll .chip span {
  margin: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tint2); color: var(--soft); font-size: 12px; font-weight: 500;
}
.chips.chips-scroll .chip:hover { border-color: var(--soft); color: var(--ink); }
.chips.chips-scroll .chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; box-shadow: none; }
.chips.chips-scroll .chip[aria-pressed=true] span { background: rgba(255,255,255,.16); color: var(--bg); }
.chips.chips-scroll .chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Category pills: always-visible thin scrollbar instead of the edge fade */
.chips.chips-scroll { scrollbar-width: auto; -webkit-mask-image: none; mask-image: none; padding-bottom: 10px; }
.chips.chips-scroll::-webkit-scrollbar { display: block; height: 6px; }
.chips.chips-scroll::-webkit-scrollbar-track { background: var(--tint2); border-radius: 999px; }
.chips.chips-scroll::-webkit-scrollbar-thumb { background: rgba(77, 53, 51, .35); border-radius: 999px; }
.chips.chips-scroll::-webkit-scrollbar-thumb:hover { background: rgba(77, 53, 51, .55); }
@supports not selector(::-webkit-scrollbar) {
  .chips.chips-scroll { scrollbar-width: thin; scrollbar-color: rgba(77, 53, 51, .35) var(--tint2); }
}

/* Category pills: thin scrollbar only on hover; edge fade hints at more when idle */
.chips.chips-scroll { padding-bottom: 8px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.chips.chips-scroll.at-end, .chips.chips-scroll:hover { -webkit-mask-image: none; mask-image: none; }
.chips.chips-scroll::-webkit-scrollbar { height: 4px; }
.chips.chips-scroll::-webkit-scrollbar-track, .chips.chips-scroll::-webkit-scrollbar-thumb { background: transparent; }
.chips.chips-scroll:hover::-webkit-scrollbar-track { background: var(--tint2); }
.chips.chips-scroll:hover::-webkit-scrollbar-thumb { background: rgba(77, 53, 51, .35); }
.chips.chips-scroll:hover::-webkit-scrollbar-thumb:hover { background: rgba(77, 53, 51, .55); }
@supports not selector(::-webkit-scrollbar) {
  .chips.chips-scroll { scrollbar-color: transparent transparent; }
  .chips.chips-scroll:hover { scrollbar-color: rgba(77, 53, 51, .35) var(--tint2); }
}

/* ===== Home: control panel (master switch, agent and connection switches) ===== */
.sw { position: relative; flex: none; width: 40px; height: 24px; border-radius: 999px; background: rgba(77, 53, 51, .18); transition: background .18s ease; cursor: pointer; }
.sw .sw-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(53, 35, 35, .25); transition: transform .18s ease; }
.sw.on { background: var(--ok); }
.sw.on .sw-knob { transform: translateX(16px); }
.sw:hover { filter: brightness(.96); }
.sw:disabled { opacity: .5; cursor: progress; }
.sw:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 999px; }

.ctl-master { margin-top: 32px; display: flex; align-items: center; gap: 20px; padding: 20px 22px; border-radius: 18px; background: var(--ok-bg); border: 1px solid rgba(63, 117, 86, .18); }
.ctl-master.is-paused { background: var(--warn-bg); border-color: rgba(142, 91, 34, .22); }
.ctl-master-copy { flex: 1; min-width: 0; }
.ctl-master-title { display: flex; align-items: center; gap: 9px; font-family: var(--serif); font-size: 22px; line-height: 28px; color: var(--ink); }
.ctl-master .d { margin-top: 4px; }
.ctl-master .d b { color: var(--ink); font-weight: 600; }
.ctl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(63, 117, 86, .16); }
.ctl-master.is-paused .ctl-dot { background: var(--warn); box-shadow: 0 0 0 4px rgba(142, 91, 34, .16); }
.ctl-master .sw { width: 52px; height: 30px; }
.ctl-master .sw .sw-knob { width: 24px; height: 24px; }
.ctl-master .sw.on .sw-knob { transform: translateX(22px); }

.ctl-sec.is-dim { opacity: .55; }
.ctl-sec h2 { margin-top: 44px; }
.ctl-row { padding: 12px 0; gap: 14px; }
.ctl-row > .txt { flex: 1; min-width: 0; text-decoration: none; color: inherit; display: block; }
.ctl-row > .txt:hover .t { text-decoration: underline; text-decoration-color: rgba(77, 53, 51, .3); text-underline-offset: 3px; }
.ctl-row.is-off .t, .ctl-row.is-off .home-ic { opacity: .55; }
.ctl-st { display: block; font-size: 13px; line-height: 18px; color: var(--soft); }
.ctl-st.warn { color: var(--warn); }
.ctl-st.no { color: var(--no); }
.ctl-dup { font-size: 11.5px; color: var(--warn); border: 1px solid rgba(142, 91, 34, .3); border-radius: 999px; padding: 0 7px; margin-left: 6px; vertical-align: 1px; }
.ctl-search { width: 100%; margin-top: 6px; }
.ctl-chips { margin-top: 14px !important; }
.chips.chips-scroll .chip.warn:not([aria-pressed=true]) { color: var(--warn); border-color: rgba(142, 91, 34, .35); }
.ctl-group { margin-top: 18px; }
.ctl-group-head { display: flex; align-items: center; gap: 10px; padding: 8px 0 2px; border-bottom: 1px solid var(--hair); }
.ctl-group-title { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--muted); text-transform: uppercase; }
.ctl-group-count { font-size: 12.5px; color: var(--soft); }
.ctl-bulk { margin-left: auto; font-weight: 500 !important; color: var(--soft) !important; }
.ctl-bulk:hover { color: var(--ink) !important; }
@media (max-width: 640px) {
  .ctl-master { padding: 16px; gap: 14px; }
  .ctl-master-title { font-size: 19px; }
}

/* ===== Memory: the brain graph, with Activity beside it ===== */
.mem-stage { margin-top: 22px; }
.mem-brain-shell { position: relative; height: 420px; border-radius: 18px; border: 1px solid var(--card-line); background: #FAF6F4; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7); }
.mem-brain-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.mem-brain-canvas[data-cursor="grab"] { cursor: grab; }
.mem-brain-canvas[data-cursor="grabbing"] { cursor: grabbing; }
.mem-brain-canvas[data-cursor="pointer"] { cursor: pointer; }
.mem-brain-zoom { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 253, 249, .92); border: 1px solid var(--card-line); backdrop-filter: blur(8px); }
.mem-zoom-btn { min-width: 28px; height: 28px; padding: 0 7px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.mem-zoom-btn:hover { background: var(--tint); }
.mem-zoom-fit { font-size: 12px; padding: 0 10px; }
.mem-node-acts { position: absolute; left: 0; top: 0; z-index: 2; padding: 4px; will-change: transform; }
.mem-node-acts.is-card { width: min(300px, calc(100% - 32px)); padding: 0; border-radius: 12px; background: rgba(255, 253, 249, .98); border: 1px solid var(--card-line); box-shadow: 0 12px 28px -12px rgba(77, 53, 51, .28), 0 1px 3px rgba(77, 53, 51, .06); }
.mem-node-card { padding: 12px 14px 0; }
.mem-node-text { margin: 0; max-height: 220px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; font-size: 13px; line-height: 19px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.mem-node-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 8px; font-size: 11.5px; color: var(--soft); }
.mem-node-kind { color: var(--muted); }
.mem-node-kind::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--mem-c, var(--soft)); vertical-align: 1px; }
.mem-node-btns { display: flex; gap: 6px; }
.is-card .mem-node-btns { justify-content: flex-end; margin-top: 10px; padding: 8px 10px 10px; border-top: 1px dotted rgba(77, 53, 51, .14); }
.is-card .mem-node-del { box-shadow: none; }
.mem-node-del.mem-node-copy { color: var(--ink); }
.mem-node-del.mem-node-copy:hover { color: var(--ink); border-color: rgba(77, 53, 51, .3); }
.mem-node-del { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(255, 253, 249, .96); border: 1px solid var(--card-line); box-shadow: 0 2px 10px rgba(77, 53, 51, .1); font-size: 12px; font-weight: 500; color: var(--muted); }
.mem-node-del:hover { color: var(--no); border-color: #F0CFC7; }
.mem-node-del.is-armed { color: #fff; background: var(--no); border-color: var(--no); }
.mem-node-del:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.mem-brain-notice { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.mem-brain-notice > .d { max-width: 360px; }
.mem-empty-ic { display: inline-flex; width: 52px; height: 52px; border-radius: 16px; align-items: center; justify-content: center; background: var(--tint); color: var(--ink); }
.mem-empty-title { justify-content: center; margin: 14px 0 4px; font-family: var(--serif); font-weight: 500; font-size: 21px; min-height: 0; }
.mem-off-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }

.s-global { --mem-c: #8A5A44; }
.s-preference { --mem-c: #4B5E86; }
.s-project { --mem-c: #3F7556; }
.s-fact { --mem-c: #B07A2A; }

/* Activity: a button on the graph that opens a wide panel over its right side, so agents' memories
   get room to be read. Back-to-back saves from one agent share a header; each memory is a Kind-colored
   dash, up to 6 lines of text, and its kind and tags. */
.mem-feed-btn { position: absolute; top: 12px; right: 12px; z-index: 3; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 11px; border-radius: 999px; background: rgba(255, 253, 249, .94); border: 1px solid var(--card-line); backdrop-filter: blur(8px); box-shadow: 0 2px 10px rgba(77, 53, 51, .08); font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.mem-feed-btn:hover { border-color: rgba(77, 53, 51, .3); background: #fff; }
.mem-feed-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.mem-feed-btn svg { color: var(--muted); }
.mem-feed-btn-n { height: 18px; padding: 0 7px; margin-right: -4px; border-radius: 999px; background: var(--brown); color: var(--bg); font-size: 11px; line-height: 18px; }
.mem-feed { position: absolute; top: 8px; right: 8px; bottom: 8px; z-index: 4; width: clamp(280px, 36%, 400px); display: flex; flex-direction: column; min-height: 0; border-radius: 14px; background: rgba(255, 253, 249, .985); border: 1px solid var(--card-line); box-shadow: 0 18px 40px -18px rgba(63, 44, 42, .32), 0 2px 6px rgba(63, 44, 42, .05); opacity: 0; transform: translateX(24px); pointer-events: none; transition: opacity .18s ease-out, transform .22s cubic-bezier(.2, .8, .2, 1); }
.mem-feed.is-open { opacity: 1; transform: none; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .mem-feed { transition: none; } }
.mem-brain-shell.feed-open .mem-brain-zoom { right: calc(clamp(280px, 36%, 400px) + 20px); }
.mem-feed-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 12px 10px 18px; border-bottom: 1px dotted rgba(77, 53, 51, .14); }
.mem-feed-ht { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.mem-feed-t { margin: 0; min-height: 0; font-family: var(--serif); font-size: 19px; font-weight: 500; line-height: 1.2; color: var(--ink); }
.mem-feed-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--soft); }
.mem-feed-new { flex: none; height: 22px; padding: 0 10px; border-radius: 999px; background: var(--brown); color: var(--bg); font-size: 11.5px; font-weight: 500; cursor: pointer; }
.mem-feed-new[hidden] { display: none; }
.mem-feed-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); cursor: pointer; }
.mem-feed-x:hover { background: var(--tint2); color: var(--ink); }
.mem-feed-list { flex: 1 1 auto; min-height: 0; list-style: none; margin: 0; padding: 4px 10px 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; -webkit-mask-image: linear-gradient(#000 calc(100% - 48px), transparent); mask-image: linear-gradient(#000 calc(100% - 48px), transparent); }
.mem-feed-list.is-end { -webkit-mask-image: none; mask-image: none; }
.mem-run { padding: 12px 0 10px; border-bottom: 1px dotted rgba(77, 53, 51, .14); }
.mem-run:last-child { border-bottom: 0; }
.mem-run-h { display: flex; align-items: center; gap: 8px; min-width: 0; height: 22px; padding: 0 8px; margin-bottom: 4px; font-size: 12.5px; color: var(--soft); }
.mem-run-h .home-ic.mark.mem-act-av { flex: none; width: 18px; height: 18px; border-radius: 5px; font-size: 10px; }
.mem-run-h .home-ic.mark.logo.mem-act-av img { width: 13px; height: 13px; }
.mem-run-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-run-who b { font-size: 13px; font-weight: 600; color: var(--ink); }
.mem-run-h time { flex: none; font-size: 12px; white-space: nowrap; }
.mem-run-list { list-style: none; margin: 0; padding: 0; }
.mem-act { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 9px; text-align: left; color: inherit; cursor: pointer; }
.mem-act:hover { background: var(--tint2); }
.mem-act[aria-pressed=true] { background: var(--tint); }
.mem-act:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.mem-act-k { flex: none; width: 10px; height: 2px; margin-top: 10px; border-radius: 1px; background: var(--mem-c, var(--soft)); }
.mem-act-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mem-act-q { display: -webkit-box; -webkit-line-clamp: 6; line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; line-height: 20px; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
.mem-act[aria-pressed=true] .mem-act-q { display: block; -webkit-line-clamp: unset; line-clamp: none; }
.mem-act-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11.5px; line-height: 16px; color: var(--soft); }
.mem-act-kind { color: var(--muted); }
.mem-act-more { display: block; margin: -4px 0 4px 28px; padding: 0; font-size: 12px; line-height: 16px; color: var(--muted); text-decoration: underline; text-decoration-color: rgba(77, 53, 51, .25); text-underline-offset: 2px; cursor: pointer; }
.mem-act-more:hover { color: var(--ink); }
.mem-feed-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 40px; padding: 0 18px; border-top: 1px dotted rgba(77, 53, 51, .14); font-size: 12px; color: var(--soft); }
.mem-feed-foot button { font-size: 12px; font-weight: 500; color: var(--ink); cursor: pointer; }
.mem-feed-foot button:hover { text-decoration: underline; text-underline-offset: 2px; }
.mem-feed-empty { padding: 16px 18px; font-size: 13px; line-height: 19px; color: var(--soft); }

/* Wide windows: Memory uses the same 720px column as Home, Vault and Settings (and slides with it
   the same way, so the title never jumps between tabs). The graph fills that column down to the nav. */
@media (min-width: 980px) {
  .wrap:has(.mem-stage) > main { --hm-shift: max(0px, calc(228px - (100vw - 760px) / 2)); margin-left: var(--hm-shift); margin-right: calc(-1 * var(--hm-shift)); }
  .wrap:has(.mem-stage) .view { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); }
  body:has(.nav:not([hidden])) .wrap:has(.mem-stage) main { overflow: visible; min-width: 0; }
  .mem-stage { position: relative; min-height: 0; padding-bottom: 4px; }
  .mem-brain-shell { height: 100%; min-height: 200px; }
}
/* The side menu: Home's rail exactly, starting at the same height as on Home, Vault and Settings.
   Hidden below 980px with every rail. */
.hm-rail.mem-rail { top: 46px; }
.mem-rail .hm-jump > .mem-jump-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-rail-k2 { margin-top: 22px; }
@media (max-width: 640px) {
  .mem-brain-shell { height: 340px; }
  .mem-feed { width: calc(100% - 16px); }
  .mem-brain-shell.feed-open .mem-brain-zoom { right: 12px; }
}
.ctl-sec.ctl-first > h2 { margin-top: 32px; }
/* Home: category pills sit in the Connections heading, between the title and the + */
h2.ctl-head { gap: 14px; flex-wrap: nowrap; }
h2.ctl-head .ctl-chips { flex: 1 1 auto; min-width: 0; margin: 0 !important; padding-top: 8px; font-size: 13.5px; }
h2.ctl-head .home-add { flex: none; }
.ctl-head + .ctl-search { margin-top: 10px; }
h2.ctl-head .ctl-chips { padding-top: 10px !important; padding-bottom: 6px !important; } /* + the 4px hover scrollbar = pills centered on the + */
/* Home: search sits above the Connections heading */
.home-connections > .ctl-search { margin-top: 32px; }
.home-connections > .ctl-search + h2.ctl-head { margin-top: 16px; }

/* Structured approval details (every field visible, no sibling truncation) */
.approval-kv {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.approval-kv-row {
  display: grid;
  grid-template-columns: minmax(110px, max-content) minmax(0, 1fr);
  gap: 4px 10px;
  align-items: baseline;
}
.approval-kv-row dt {
  font-weight: 600;
  color: #7C4F19;
  overflow-wrap: anywhere;
}
.approval-kv-row dd {
  margin: 0;
  color: #4A2D0C;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.approval-kv-group {
  margin-top: 4px;
  padding-top: 5px;
  border-top: 1px dashed #E8CA9D;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.approval-kv-group:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.approval-kv-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #8E5B22;
}
.approval-kv-secrets {
  background: #F9E8CE;
  border-radius: 6px;
  padding: 4px 7px;
  margin-top: 2px;
}
.approval-kv-secrets dt,
.approval-kv-secrets dd {
  color: #5C3308;
  font-weight: 600;
}
@media (max-width: 640px) {
  .approval-kv-row {
    grid-template-columns: 1fr;
    gap: 1px;
  }
}

/* Connections: Probe-first Add Connection panel, collapsible Advanced, Import summary */
.conn-panel-card {
  margin-top: 16px;
  padding: 20px 22px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-line);
  box-shadow: 0 6px 24px rgba(77, 53, 51, .05);
}
.add-conn-step {
  margin-top: 0;
}
.add-conn-step p {
  margin: 0;
}
.advanced-details {
  border-top: 1px dotted var(--hair);
  padding-top: 10px;
}
.advanced-details > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.advanced-details > summary::-webkit-details-marker {
  display: none;
}
.advanced-details > summary::before {
  content: '›';
  display: inline-block;
  font-size: 16px;
  line-height: 1;
  transition: transform .15s ease;
}
.advanced-details[open] > summary::before {
  transform: rotate(90deg);
}
.advanced-details > summary:hover {
  color: var(--ink);
}
.advanced-details .advanced-body {
  margin-top: 14px;
}
.advanced-local-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--tint2);
}
.probe-key-field {
  margin-top: 10px;
}
.import-summary-group {
  margin-top: 8px;
}
.import-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.import-summary-list {
  margin: 8px 0 0 18px;
  list-style: disc;
  font-size: 13px;
  line-height: 19px;
}
.import-summary-list li + li {
  margin-top: 3px;
}
/* Connections list: search and filter pills stay put; the rows scroll in their own box below them */
body:has(.nav:not([hidden])) .wrap:has(.home-connections) main { overflow: visible; min-width: 0; }
.wrap:has(.home-connections) .view { height: 100%; }
.home-connections { display: flex; flex-direction: column; height: 100%; min-height: 0; min-width: 0; }
.home-connections > * { flex: none; }
.home-connections > .ctl-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-right: -16px; padding-right: 16px; padding-bottom: 24px; }
.home-connections > .ctl-scroll > .ctl-group:first-child { margin-top: 10px; }
/* Rows run down behind the nav pill and fade out above it instead of stopping at a gap */
body:has(.nav:not([hidden])) .wrap:has(.home-connections) { padding-bottom: 0; }
.home-connections > .ctl-scroll {
  padding-bottom: calc(86px + max(24px, env(safe-area-inset-bottom)));
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 104px), transparent calc(100% - 62px));
  mask-image: linear-gradient(to bottom, #000 calc(100% - 104px), transparent calc(100% - 62px));
}
/* ===== Home at scale: Profile Switcher, folding groups, Jump to rail ===== */
.hm-bar { position: relative; z-index: 20; display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.hm-meta { flex: 1; min-width: 0; text-align: right; font-size: 13px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-fold { flex: none; font-size: 13px; font-weight: 500; color: var(--muted); padding: 6px 0; }
.hm-fold:hover { color: var(--ink); }
.hm-jump-sel { flex: none; width: auto; max-width: 150px; font-size: 13px; padding: 6px 28px 6px 10px; min-height: 0; border-radius: 999px; }

.hm-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; width: 300px; max-height: min(460px, 60vh); overflow-y: auto; padding: 8px; background: var(--card); border: 1px solid rgba(77, 53, 51, .14); border-radius: 14px; box-shadow: 0 18px 40px -12px rgba(63, 44, 42, .28), 0 2px 6px rgba(63, 44, 42, .06); }
.hm-menu-q { width: 100%; margin: 0 0 6px; font-size: 13.5px; }
.hm-menu-k { padding: 10px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.hm-menu-empty { padding: 10px; font-size: 13px; color: var(--soft); }
.hm-opt { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 10px; border-radius: 9px; font-size: 13.5px; color: var(--ink); text-align: left; }
.hm-opt:hover, .hm-opt:focus-visible { background: var(--tint2); outline: none; }
.hm-opt[aria-selected=true], .pf-opt[aria-checked=true] { background: var(--tint); }
.hm-opt-name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-opt-n { font-size: 12px; color: var(--soft); white-space: nowrap; }
.hm-opt-check { flex: none; color: var(--brown); visibility: hidden; }
.hm-opt[aria-selected=true] .hm-opt-check { visibility: visible; }
.hm-menu-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 8px 4px 2px; border-top: 1px dotted var(--hair); }
.hm-menu-a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
.hm-menu-a:hover, .hm-menu-a:focus-visible { background: var(--tint2); color: var(--ink); outline: none; }

/* Profile Switcher & Copy Connection bar */
.pf-bar { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.pf-wrap { position: relative; flex: none; }
.pf-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 14px; border: 1px solid var(--hair); border-radius: 999px; background: var(--card); font-size: 13.5px; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.pf-btn:hover { border-color: rgba(77, 53, 51, .34); }
.pf-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pf-ic { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.pf-k { color: var(--soft); }
.pf-name { font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-chev { color: var(--muted); transition: transform .15s; flex: none; }
.pf-btn[aria-expanded=true] .pf-chev { transform: rotate(180deg); }
.pf-connect { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid var(--hair); border-radius: 999px; background: var(--tint); font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; cursor: pointer; transition: background .15s, border-color .15s; }
.pf-connect:hover { background: #EDE3DF; border-color: rgba(77, 53, 51, .3); }
.pf-connect:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pf-menu { left: auto; right: 0; width: 300px; }
.pf-check { flex: none; display: inline-flex; align-items: center; color: var(--brown); visibility: hidden; }
.pf-opt[aria-checked=true] .pf-check { visibility: visible; }
.pf-menu-manage { margin-left: auto; max-width: 165px; overflow: hidden; }
.pf-menu-manage span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Scoped profile banner, add hints & inline profile chips */
.pf-scope-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: var(--tint2); font-size: 13px; line-height: 19px; color: var(--muted); }
.pf-scope-bar b { color: var(--ink); font-weight: 600; }
.pf-add-hint { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--tint2); font-size: 13px; color: var(--muted); }
.pf-add-hint strong { color: var(--ink); font-weight: 600; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pf-chip { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--hair); background: var(--card); font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background .14s, border-color .14s, color .14s; }
.pf-chip:hover { border-color: rgba(77, 53, 51, .38); color: var(--ink); }
.pf-chip[aria-pressed=true] { background: var(--brown); border-color: var(--brown); color: var(--bg); }
.pf-chip:disabled { opacity: .55; cursor: progress; }
.pf-chip-ic { display: inline-flex; align-items: center; }
.pf-chip-ic:empty { display: none; }

/* Profile Manager dialog */
.pf-mgr-head-acts { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.pf-mgr-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px dotted var(--hair); }
.pf-mgr-tab { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--hair); background: transparent; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
.pf-mgr-tab:hover { border-color: rgba(77, 53, 51, .35); color: var(--ink); }
.pf-mgr-tab[aria-selected=true] { background: var(--tint); border-color: rgba(77, 53, 51, .28); color: var(--ink); font-weight: 600; }
.pf-mgr-counts { margin: 0 0 14px; font-size: 13px; color: var(--soft); }
.pf-mgr-sec { margin-top: 22px; padding-top: 18px; border-top: 1px dotted var(--hair); }
.pf-mgr-sec h4 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.pf-mgr-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pf-key-list { margin: 0; padding: 0; list-style: none; }
.pf-key-list > li + li { border-top: 1px dotted var(--hair); }
.pf-key-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 10px; text-align: left; cursor: pointer; transition: background .12s; }
.pf-key-row:hover { background: var(--tint2); }
.pf-key-row.is-off .pf-key-n { opacity: .6; }
.pf-key-row .home-ic.pf-key-av { width: 30px; height: 30px; border-radius: 8px; font-size: 12px; }
.pf-key-row .home-ic.mark.logo.pf-key-av img { width: 18px; height: 18px; }
.pf-key-c { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pf-key-n { font-size: 13.5px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-key-st { font-size: 12px; color: var(--soft); }
.pf-key-st.is-ok { color: var(--ok); }
.pf-mgr-danger h4 { color: var(--no); margin-bottom: 6px; }
.pf-mgr-confirm { margin-top: 12px; }
.pf-mgr-confirm p { margin: 0; }
.st-rule-acts { display: inline-flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; }

.hm > .hm-body { flex: 1 1 auto; min-height: 0; position: relative; display: flex; flex-direction: column; margin-top: 8px; }
.hm-body > .ctl-scroll { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-right: -16px; padding-right: 16px; padding-bottom: calc(86px + max(24px, env(safe-area-inset-bottom))); -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 104px), transparent calc(100% - 62px)); mask-image: linear-gradient(to bottom, #000 calc(100% - 104px), transparent calc(100% - 62px)); }
.hm-group.is-open + .hm-group, .hm-group + .hm-group.is-open { margin-top: 22px; }
.hm-head { display: flex; align-items: center; gap: 10px; width: 100%; height: 46px; padding: 0 2px; border-bottom: 1px dotted rgba(77, 53, 51, .22); text-align: left; cursor: pointer; }
.hm-head:disabled { cursor: default; opacity: 1; }
.hm-head:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.hm-chev { flex: none; color: var(--muted); transition: transform .15s; }
.hm-head[aria-expanded=false] .hm-chev { transform: rotate(-90deg); }
.hm-head-l { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-head[aria-expanded=false] .hm-head-l { font-weight: 500; color: var(--muted); }
.hm-head:hover .hm-head-l { color: var(--ink); }
.hm-head-n { flex: none; font-size: 13px; color: var(--soft); }
.hm-head.is-warn .hm-head-l, .hm-head.is-warn .hm-chev, .hm-head.is-warn .hm-head-n { color: var(--warn); }
.hm-note { padding: 10px 2px 0; font-size: 13px; line-height: 19px; color: var(--soft); }
.hm-note a { color: var(--muted); }

.hm-rail { display: none; position: absolute; top: 0; bottom: 0; right: calc(100% + 32px); width: 180px; overflow-y: auto; scrollbar-width: none; padding: 6px 0 110px; }
.hm-rail::-webkit-scrollbar { display: none; }
.hm-rail-k { padding: 0 10px 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.hm-jump { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; color: var(--muted); text-align: left; }
.hm-jump > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-jump-n { font-size: 12px; color: var(--soft); }
.hm-jump:hover { color: var(--ink); }
.hm-jump[aria-current=true] { background: var(--tint); color: var(--ink); font-weight: 500; }
.hm-jump.is-warn, .hm-jump.is-warn .hm-jump-n { color: var(--warn); }
/* The rail needs about 228px left of the 720px column. Where the window is too narrow to center
   both, the column slides right just enough to make room; from about 1180px wide it is centered again. */
@media (min-width: 980px) {
  .hm-rail { display: block; }
  .hm-jump-sel { display: none; }
  .wrap:has(.hm-rail) > main { --hm-shift: max(0px, calc(228px - (100vw - 760px) / 2)); margin-left: var(--hm-shift); margin-right: calc(-1 * var(--hm-shift)); }
}
@media (max-width: 640px) {
  .hm-meta { display: none; }
  .hm-bar { gap: 10px; }
  .lib-top { flex-wrap: wrap; align-items: flex-start; gap: 12px; }
  .pf-bar { flex-wrap: wrap; }
  .pf-k { display: none; }
  .pf-btn { padding-left: 12px; }
  .pf-name { max-width: 120px; }
  .pf-menu { left: 0; right: auto; width: min(300px, calc(100vw - 32px)); }
  .hm-bar > .hm-jump-sel { margin-left: auto; max-width: 112px; }
  .hm-fold { display: none; }
  .hm-menu { width: min(300px, calc(100vw - 32px)); }
}

/* Connection logos: the connection's own logo, or a letter tile, with a corner badge for where it runs. */
.conn-logo { position: relative; flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.conn-logo > img, .conn-logo-letter { width: 32px; height: 32px; border-radius: 8px; }
.conn-logo > img { display: block; object-fit: contain; background: #fff; box-shadow: inset 0 0 0 1px var(--card-line); padding: 3px; }
.conn-logo-letter { display: inline-flex; align-items: center; justify-content: center; background: var(--tile, #8A5A44); color: #fff; font-size: 15px; font-weight: 600; line-height: 1; }
.conn-logo-badge { position: absolute; right: -1px; bottom: -1px; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--bg); color: var(--muted); box-shadow: 0 0 0 1px var(--line); }
.conn-logo-badge svg { width: 11px; height: 11px; display: block; }
.ctl-row.is-off .conn-logo { opacity: .55; }
.conn-card .connection-summary .conn-logo { width: 32px; height: 32px; }
.conn-card .connection-summary .conn-logo > img, .conn-card .connection-summary .conn-logo-letter { width: 26px; height: 26px; border-radius: 7px; font-size: 13px; }
.conn-card .connection-summary .conn-logo-badge { width: 15px; height: 15px; }
.conn-card .connection-summary .conn-logo-badge svg { width: 9px; height: 9px; }
.logo-dialog-now { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; font-size: 14px; color: var(--muted); }
.logo-dialog .hint { margin: -4px 0 0; font-size: 13px; color: var(--soft); }
.logo-dialog .acts { flex-wrap: wrap; gap: 8px; }

/* Jump to: keep the counts off the rail's edge. */
.hm-jump { padding: 0 14px 0 10px; }
.hm-jump-n { flex: none; min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }

/* Home: Needs you approvals and memory conflicts, Activity, Your Loop, and skills inside each category.
   Every row keeps the 40px icon lane connection logos use, so the lists line up. */
.hm-lane { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.hm-lane.is-warn { color: var(--warn); }
.hm-acts { flex: none; display: flex; align-items: center; gap: 8px; }
.hm-need-more { margin-top: 6px; font-size: 13px; color: var(--muted); }
.hm-need-more summary { display: inline-block; cursor: pointer; font-weight: 500; list-style: none; }
.hm-need-more summary::-webkit-details-marker { display: none; }
.hm-need-more summary:hover { color: var(--ink); }
.hm-need-more[open] summary { margin-bottom: 6px; }
.hm-need-more p { margin: 0 0 6px; line-height: 19px; }

.hm-head-static { cursor: default; padding-left: 2px; }
.hm-head-a { flex: none; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; }
.hm-head-a:hover { color: var(--ink); text-decoration: underline; }
.hm-feed { margin: 0; padding: 6px 0 2px; }
.hm-ev { display: flex; align-items: center; gap: 14px; min-height: 40px; font-size: 13.5px; color: var(--muted); }
.hm-ev-lane { flex: none; width: 40px; display: inline-flex; justify-content: center; }
.hm-ev-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-ev-t b { font-weight: 600; color: var(--ink); }
.hm-ev.is-failed .hm-ev-t { color: var(--no); }
.hm-ev-at { flex: none; font-size: 12px; color: var(--soft); font-variant-numeric: tabular-nums; }

.hm-hub { color: inherit; text-decoration: none; }
.hm-hub .t, .hm-hub .ctl-st { display: block; }
.hm-hub:hover .t { text-decoration: underline; text-decoration-color: rgba(77, 53, 51, .3); text-underline-offset: 3px; }
.hm-hub-m { flex: none; font-size: 13px; color: var(--muted); white-space: nowrap; }
.hm-hub-m.is-warn { color: var(--warn); }
.hm-go { flex: none; display: inline-flex; color: var(--soft); }

.hm-lib { display: flex; align-items: center; gap: 12px; margin: 40px 0 8px; }
.hm-lib .hm-lib-t { flex: 1; margin: 0; font-size: 17px; font-weight: 600; color: var(--ink); }
.seg.hm-kinds { flex: none; border-radius: 999px; }
.hm-kinds .seg-btn { border-radius: 999px; padding: 6px 14px; font-size: 13px; }
.hm-kinds .seg-btn span { margin-left: 4px; font-weight: 400; color: var(--soft); }
.hm-kinds .seg-btn:disabled { opacity: .45; cursor: default; }
.hm-kinds .seg-btn:disabled:hover { color: var(--muted); }
.hm-jump.is-lib-first { margin-top: 12px; }

.hm-skill .hm-lane { color: var(--soft); }
.hm-skill.is-member { padding-left: 28px; }
.hm-fam { text-align: left; }
.hm-fam:hover .t { text-decoration: underline; text-decoration-color: rgba(77, 53, 51, .3); text-underline-offset: 3px; }
.hm-fam-n { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--soft); }
.hm-fam-chev { flex: none; display: inline-flex; color: var(--muted); }
.hm-fam-chev .hm-chev { transform: rotate(-90deg); }
.hm-fam[aria-expanded=true] + .hm-fam-chev .hm-chev { transform: none; }
.hm-more { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 4px 4px 4px 58px; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; text-align: left; }
.hm-more:hover { color: var(--ink); }

@media (max-width: 640px) {
  .hm-acts .btn { padding-left: 10px; padding-right: 10px; }
  .hm-need { flex-wrap: wrap; }
  .hm-need .hm-acts { margin-left: 54px; }
  .hm-hub-m { display: none; }
  .hm-lib { flex-wrap: wrap; }
}

/* Home rows: a soft rounded tint on hover that reaches past the text edges without moving anything. */
.hm .list > li > .ctl-row, .hm-ev { position: relative; isolation: isolate; }
.hm .list > li > .ctl-row::before, .hm-ev::before {
  content: ''; position: absolute; inset: 1px -12px; z-index: -1;
  border-radius: 10px; background: rgba(77, 53, 51, .06); opacity: 0; transition: opacity .12s;
}
.hm .list > li > .ctl-row:hover::before, .hm-ev:hover::before,
.hm .list > li > .ctl-row:focus-within::before { opacity: 1; }
@media (max-width: 640px) {
  .hm .list > li > .ctl-row::before, .hm-ev::before { inset: 1px -8px; }
}

/* Header Settings: plain text with a quiet underline, so it reads as a link. */
.toplink {
  font-size: 13.5px; font-weight: 500; color: var(--muted);
  text-decoration: underline; text-decoration-color: rgba(77, 53, 51, .28);
  text-decoration-thickness: 1px; text-underline-offset: 4px;
  transition: color .15s, text-decoration-color .15s;
}
.toplink:hover, .toplink[aria-current] { color: var(--ink); text-decoration-color: currentColor; }

/* ---------- Settings popup ----------
   A centered popup over the current page. A menu on the left splits it into sections so
   none of them scrolls. Opens with a short fade and rise; closes the same way. */
html.st-lock, html.st-lock body { overflow: hidden; }
.st-root { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; --st-dot: var(--bg); }
.st-veil { position: absolute; inset: 0; background: rgba(63, 44, 42, .26); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity .18s ease-out; }
.st-sheet {
  position: relative; display: flex; width: min(780px, calc(100vw - 32px)); height: 560px; max-height: calc(100vh - 32px);
  background: var(--bg); border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(63, 44, 42, .22), 0 2px 8px rgba(63, 44, 42, .08);
  opacity: 0; transform: translateY(10px) scale(.98);
  transition: opacity .2s ease-out, transform .22s cubic-bezier(.2, .8, .2, 1);
}
.st-root.is-open .st-veil { opacity: 1; }
.st-root.is-open .st-sheet { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .st-veil, .st-sheet { transition: none; transform: none; }
}

.st-side { width: 210px; flex: none; display: flex; flex-direction: column; padding: 22px 14px 16px; border-right: 1px dotted rgba(77, 53, 51, .16); }
.st-ttl { margin: 0; padding: 0 10px 16px; font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.2; color: var(--ink); display: block; }
.st-tabs { display: flex; flex-direction: column; gap: 2px; }
.st-tab { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 9px; font-size: 13.5px; color: rgba(77, 53, 51, .7); text-align: left; }
.st-tab svg { flex: none; }
.st-tab:hover { color: var(--ink); background: rgba(77, 53, 51, .04); }
.st-tab[aria-selected=true] { background: var(--tint); color: var(--ink); font-weight: 500; --st-dot: var(--tint); }
.st-foot { margin: auto 0 0; padding: 0 10px; font-size: 12px; color: rgba(77, 53, 51, .5); }

.st-body { flex: 1; min-width: 0; position: relative; overflow-y: auto; }
.st-pane { padding: 22px 28px 18px; }
.st-pane[hidden] { display: none; }
.st-wait { display: grid; place-items: center; height: 100%; }
.st-x { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; color: rgba(77, 53, 51, .6); z-index: 1; }
.st-x:hover { background: var(--tint); color: var(--ink); }

.st-h { margin: 0; font-size: 17px; line-height: 22px; font-weight: 600; color: var(--ink); }
.st-sub { margin: 3px 0 0; padding-right: 32px; font-size: 13px; line-height: 18px; color: rgba(77, 53, 51, .65); }
.st-narrow { max-width: 440px; }
.st-grp { margin: 14px 0 2px; font-size: 12.5px; line-height: 16px; font-weight: 600; color: rgba(77, 53, 51, .55); }
.st-rt { display: block; font-size: 13.5px; line-height: 18px; color: var(--ink); }
.st-rs { display: block; margin: 1px 0 0; font-size: 12.5px; line-height: 16px; color: rgba(77, 53, 51, .6); }
.st-rs a { color: inherit; text-decoration: underline; text-decoration-color: rgba(77, 53, 51, .3); text-underline-offset: 3px; }
.st-rs a:hover { color: var(--ink); }
.st-after { margin-top: 8px; }
.st-before { margin: 0 0 10px; }
.st-note { font-size: 12.5px; color: rgba(77, 53, 51, .55); }

.st-rule { display: flex; align-items: center; gap: 16px; min-height: 44px; padding: 4px 0; border-bottom: 1px dotted rgba(77, 53, 51, .14); }
.st-rules > .st-rule:last-child, .st-grp + .st-rule { border-bottom: 0; }
.st-rule-c { flex: 1; min-width: 0; }

.st-seg { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: 999px; background: var(--tint); }
.st-seg button { padding: 3px 11px; line-height: 18px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: rgba(77, 53, 51, .62); transition: background .15s, color .15s, box-shadow .15s; }
.st-seg button:hover { color: var(--ink); }
.st-seg button[aria-pressed=true] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(77, 53, 51, .12); }
.st-seg-lg button { padding: 5px 14px; font-size: 13px; }

.st-opts { margin-top: 6px; }
.st-opt { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 11px 0; text-align: left; border-bottom: 1px dotted rgba(77, 53, 51, .14); }
.st-opt:last-child { border-bottom: 0; }
.st-opt-c { flex: 1; min-width: 0; }
.st-radio { width: 18px; height: 18px; flex: none; margin-top: 1px; border-radius: 999px; border: 1.5px solid rgba(77, 53, 51, .35); transition: border .15s; }
.st-opt:hover .st-radio { border-color: rgba(77, 53, 51, .6); }
.st-opt[aria-checked=true] .st-radio { border: 5px solid var(--brown); }

.st-check { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.st-check input { margin-top: 3px; accent-color: var(--brown); }

.st-form { max-width: 360px; margin-top: 8px; }
.st-field { display: block; margin-top: 16px; }
.st-lbl { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 500; color: rgba(77, 53, 51, .7); }
.st-field input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid rgba(77, 53, 51, .16); border-radius: 10px; background: var(--card); font: inherit; font-size: 13.5px; color: var(--ink); }
.st-field input:focus { outline: none; border-color: rgba(77, 53, 51, .45); box-shadow: 0 0 0 3px rgba(77, 53, 51, .08); }
.st-acts { margin-top: 20px; }

.st-acct { display: flex; align-items: center; gap: 14px; margin-top: 24px; padding: 14px 0; border-top: 1px dotted rgba(77, 53, 51, .14); border-bottom: 1px dotted rgba(77, 53, 51, .14); }
.st-plan-bar { margin-top: 14px; }
.st-plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-top: 10px; }
.st-plan-card { padding: 12px 14px; border: 1px solid rgba(77, 53, 51, .14); border-radius: 10px; background: rgba(255, 255, 255, .45); }
.st-plan-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.st-plan-price { font-size: 12px; font-weight: 600; color: rgba(77, 53, 51, .68); white-space: nowrap; }
.st-av { width: 40px; height: 40px; flex: none; border-radius: 999px; background: var(--tint); display: grid; place-items: center; color: var(--ink); }

/* Phones: the section menu becomes a row of tabs above the content. */
@media (max-width: 640px) {
  .st-root { padding: 10px; align-items: end; }
  .st-sheet { flex-direction: column; width: calc(100vw - 20px); height: min(720px, calc(100vh - 20px)); border-radius: 18px; }
  .st-side { width: auto; padding: 18px 14px 8px; border-right: 0; border-bottom: 1px dotted rgba(77, 53, 51, .16); }
  .st-ttl { padding: 0 6px 10px; font-size: 20px; }
  .st-tabs { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .st-tabs::-webkit-scrollbar { display: none; }
  .st-tab { flex: none; height: 32px; padding: 0 10px; }
  .st-tab svg { display: none; }
  .st-foot { display: none; }
  .st-pane { padding: 18px 18px 16px; }
  .st-x { top: 12px; right: 10px; }
}

/* ===========================
   Home agents, Library page, agent popups
   =========================== */
/* Home: agents are rows like the rest; a row opens that agent's popup. */
.hm-agent { width: 100%; text-align: left; color: inherit; cursor: pointer; }
.hm-agent .txt { display: block; }
.hm-agent .t, .hm-agent .ctl-st { display: block; }
.hm-agent:hover .t { text-decoration: underline; text-decoration-color: rgba(77, 53, 51, .3); text-underline-offset: 3px; }
.hm-agent:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
.hm-agent .ctl-st.is-ok { color: var(--ok); }
.hm-agent.is-off .t, .hm-agent.is-off .home-ic { opacity: .55; }
.hm-agent-add .t { color: var(--muted); }
.hm-agent-add:hover .t { color: var(--ink); }
.hm-inline { padding: 0; font: inherit; font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-color: rgba(77, 53, 51, .3); text-underline-offset: 3px; cursor: pointer; }

/* Page header shared by Home, Memory and Vault: title, one line, Profile Switcher on the right. */
.lib-top { position: relative; z-index: 20; display: flex; align-items: flex-end; gap: 16px; margin-top: 28px; }
.lib-top-c { flex: 1; min-width: 0; }
.lib-t { margin: 0; font-family: var(--serif); font-size: 34px; font-weight: 500; line-height: 1.1; color: var(--ink); }
.lib-sub { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.lib-top-r { flex: none; }
/* With the rail beside the list, the bar under search has nothing left to show. */
@media (min-width: 980px) {
  .hm-libpage .hm-bar:not(:has(.hm-fold)) { display: none; }
}
.hm-libpage > .ctl-search { margin-top: 20px; }
.hm-libpage .ctl-scroll > .hm-lib:first-child { margin-top: 18px; }

/* Agent popup: the Settings sheet with the agent in the side column. */
.ap-in { display: contents; }
.ap-who { display: flex; align-items: center; gap: 10px; padding: 0 6px 18px; }
.ap-who .home-ic.ap-mark { width: 36px; height: 36px; border-radius: 11px; }
.ap-who .home-ic.mark.logo.ap-mark img { width: 24px; height: 24px; }
.ap-who-c { min-width: 0; }
.ap-name { margin: 0; font-family: var(--serif); font-size: 17px; font-weight: 500; line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; }
.ap-st { margin-top: 2px; font-size: 12px; color: var(--soft); }
.ap-st.is-ok { color: var(--ok); }
.ap-st i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--ok); vertical-align: 1px; }
.ap-side-foot { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 0 10px; }
.ap-side-a { padding: 0; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.ap-side-a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.ap-side-a.is-no { color: var(--no); }
.ap-msg { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 40px; text-align: center; color: var(--muted); font-size: 14px; }
.ap-after { margin-top: 10px; }
.ap-after a { color: inherit; }

.ap-feed { margin-top: 14px; }
.ap-ev { display: flex; align-items: center; gap: 12px; min-height: 38px; border-bottom: 1px dotted rgba(77, 53, 51, .12); font-size: 13px; color: var(--ink); }
.ap-ev:last-child { border-bottom: 0; }
.ap-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--ok); }
.ap-dot.is-no { background: var(--no); }
.ap-ev-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-ev-t em { font-style: normal; color: rgba(77, 53, 51, .6); }
.ap-ev-at { flex: none; font-size: 12.5px; color: rgba(77, 53, 51, .55); white-space: nowrap; }
.ap-link { margin-top: 10px; padding: 0; font-size: 13px; color: var(--muted); text-decoration: underline; text-decoration-color: rgba(77, 53, 51, .3); text-underline-offset: 3px; cursor: pointer; }
.ap-link:hover { color: var(--ink); }
.ap-empty { margin: 18px 0 0; font-size: 13.5px; line-height: 20px; color: var(--muted); }

.ap-select { height: 30px; padding: 0 10px; border: 1px solid rgba(77, 53, 51, .18); border-radius: 999px; background: var(--card); font: inherit; font-size: 12.5px; color: var(--ink); }
.ap-secrets { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 20px; margin-top: 6px; }
.ap-secret { display: flex; align-items: center; gap: 10px; min-height: 30px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; color: var(--ink); cursor: pointer; min-width: 0; }
.ap-secret span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-secret input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--brown); }

.ap-tabs { margin-top: 18px; }
.ap-code { position: relative; margin-top: 12px; border-radius: 12px; background: #3F2C2A; }
.ap-code pre { margin: 0; padding: 16px 84px 16px 16px; max-height: 190px; overflow: auto; font: 12.5px/1.6 ui-monospace, 'SF Mono', Menlo, monospace; color: #F3EAE7; white-space: pre-wrap; word-break: break-all; }
.ap-copy { position: absolute; right: 10px; top: 10px; height: 28px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.ap-copy:hover { background: rgba(255, 255, 255, .22); }
.ap-warn { margin-top: 10px; }
.ap-key { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding-top: 14px; border-top: 1px dotted rgba(77, 53, 51, .14); }
.ap-wait-sm { height: 120px; }

/* Connect an agent: one column, steps on top, buttons pinned at the bottom. */
.ap-flow .ap-in { display: flex; flex: 1; min-width: 0; min-height: 0; }
.ap-flow-in { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.ap-flow-top { padding: 24px 28px 0; }
.ap-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0 40px 0 0; font-size: 12px; color: rgba(77, 53, 51, .55); }
.ap-steps li + li::before { content: '·'; margin-right: 6px; }
.ap-steps li[aria-current=step] { color: var(--ink); font-weight: 500; }
.ap-flow-t { margin: 8px 0 0; font-family: var(--serif); font-size: 26px; font-weight: 500; line-height: 1.15; color: var(--ink); }
.ap-flow-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 28px 16px; }
.ap-flow-foot { display: flex; align-items: center; gap: 10px; padding: 14px 28px 18px; border-top: 1px dotted rgba(77, 53, 51, .14); }
.ap-grow { flex: 1; }
.ap-back { padding-left: 0; border-color: transparent; }
.ap-lbl { margin: 0 0 8px; font-size: 12.5px; font-weight: 500; color: rgba(77, 53, 51, .55); }
.ap-grid + .ap-lbl { margin-top: 20px; }
.ap-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.ap-app { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border: 1px solid rgba(77, 53, 51, .12); border-radius: 12px; text-align: left; color: var(--ink); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ap-app:hover { border-color: rgba(77, 53, 51, .3); }
.ap-app[aria-pressed=true] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.ap-app:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ap-app .home-ic.ap-mark-sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.ap-app .home-ic.mark.logo.ap-mark-sm img { width: 22px; height: 22px; }
.ap-app-c { flex: 1; min-width: 0; }
.ap-app-n { display: block; font-size: 14px; font-weight: 500; }
.ap-app-d { display: block; font-size: 12px; color: rgba(77, 53, 51, .55); }
.ap-name-f { margin-top: 0; }
/* One-screen Connect: the sheet hugs the command, no footer until the agent checks in. */
.st-sheet.ap-quick { width: min(640px, calc(100vw - 32px)); height: auto; max-height: min(560px, calc(100vh - 48px)); }
.ap-quick .ap-flow-body { padding-bottom: 24px; }
.ap-quick .ap-waitrow { margin-top: 12px; }
.ap-flow-rules { margin-top: 10px; }
.ap-flow-rules .st-rule { min-height: 56px; }
.ap-waitrow { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--tint); font-size: 13.5px; color: var(--ink); }
.ap-pulse { width: 10px; height: 10px; flex: none; border-radius: 50%; background: #C9A77A; box-shadow: 0 0 0 4px rgba(201, 167, 122, .25); animation: ap-pulse 1.6s ease-in-out infinite; }
.ap-waitrow.is-ok .ap-pulse { background: var(--ok); box-shadow: 0 0 0 4px rgba(63, 117, 86, .18); animation: none; }
@keyframes ap-pulse { 50% { box-shadow: 0 0 0 7px rgba(201, 167, 122, .08); } }
@media (prefers-reduced-motion: reduce) { .ap-pulse { animation: none; } }

@media (max-width: 640px) {
  .ap-who { padding: 0 6px 12px; }
  .ap-side-foot { flex-direction: row; gap: 16px; margin-top: 10px; padding: 0 6px; }
  .ap-root .st-rule { flex-wrap: wrap; row-gap: 8px; padding: 8px 0; }
  .ap-root .st-rule-c { flex: 1 1 170px; }
  .ap-root .st-rule > .st-seg { margin-left: auto; }
  .ap-secrets, .ap-grid { grid-template-columns: 1fr; }
  .ap-flow-top { padding: 20px 18px 0; }
  .ap-flow-body { padding: 16px 18px; }
  .ap-flow-foot { padding: 12px 18px 16px; }
  .ap-flow-t { font-size: 22px; }
  .st-rule .st-seg { flex-wrap: wrap; justify-content: flex-end; }
  .lib-t { font-size: 28px; }
}

#vault-list-slot > .vault-group:first-child { margin-top: 23px; }

/* Settings as a page laid out like Home: header, then the sections in one scrolling list with a
   side menu. Where Home has its search box, Settings leaves the same room, so both menus line up. */
.st-page { --st-dot: var(--bg); }
.st-page > .hm-body { margin-top: 68px; }
.st-page .st-body { overflow: visible; padding-top: 23px; }
.st-page .st-pane { padding: 0 0 44px; }
.st-page .st-sub { padding-right: 0; }
.st-page .st-wait { min-height: 200px; }

/* Settings rows run the full width like Home's: what it is on the left, the control on the right. */
.st-rule-wide { margin-top: 14px; border-top: 1px dotted rgba(77, 53, 51, .14); border-bottom: 0; padding-top: 14px; }
.st-check-row { cursor: pointer; }
.st-check-row input { flex: none; width: 18px; height: 18px; accent-color: var(--brown); }

/* ===========================
   Top header chrome (Profile Switcher left + Connect pill right)
   =========================== */
.top { position: relative; height: 64px; display: flex; align-items: center; justify-content: center; z-index: 30; }
.top-left { position: absolute; left: 0; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; }
.top-right { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; }
.top-left .pf-btn { height: 34px; padding: 0 10px 0 12px; font-size: 13px; gap: 6px; }
.top-left .pf-menu { left: 0; right: auto; }
/* Profile in the side column, beside the page title and above the side menu (Jump to).
   A quiet select, not a pill: the same width and edge as the side menu below it. */
.pf-side { display: none; }
@media (min-width: 980px) {
  .pf-side { display: block; position: absolute; right: calc(100% + 32px); width: 180px; z-index: 25; }
  .pf-side .pf-wrap { display: block; }
  /* Bare text line, JumpItem height: no label, icon, border or fill at rest */
  .pf-side .pf-btn { width: 100%; height: 30px; padding: 0 8px 0 10px; gap: 6px; border: 0; border-radius: 8px; background: transparent; font-size: 13px; font-weight: 500; color: var(--ink); }
  .pf-side .pf-btn:hover, .pf-side .pf-btn[aria-expanded=true] { background: var(--tint); }
  .pf-side .pf-ic { display: none; }
  .pf-side .pf-name { flex: 1; min-width: 0; max-width: none; font-weight: 500; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pf-side .pf-chev { color: var(--soft); }
  .pf-side .pf-btn[aria-expanded=true] .pf-chev { transform: none; }
  .pf-side .pf-menu { top: calc(100% + 6px); left: 0; right: auto; width: 220px; padding: 4px; border-radius: 12px; border-color: var(--hair); box-shadow: 0 8px 24px rgba(63, 44, 42, .10); }
  .pf-side .pf-menu .hm-menu-k { display: none; }
  .pf-side .pf-opt { height: 30px; gap: 8px; padding: 0 8px; border-radius: 6px; font-size: 13px; }
  .pf-side .pf-opt .hm-opt-name { font-weight: 400; }
  .pf-side .pf-opt[aria-checked=true] .hm-opt-name { font-weight: 500; }
  .pf-side .pf-opt .pf-check { display: none; }
  .pf-side .hm-menu-foot { flex-direction: column; align-items: stretch; gap: 0; margin-top: 4px; padding: 4px 0 0; border-top: 1px solid var(--hair); }
  .pf-side .hm-menu-a { height: 28px; padding: 0 8px; border-radius: 6px; font-weight: 400; }
  .pf-side .hm-menu-a svg { display: none; }
  .pf-side .pf-menu-manage { margin-left: 0; max-width: none; }
}
.top-connect {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 14px; border-radius: 999px;
  background: var(--brown); color: var(--bg);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .12s;
}
.top-connect:hover { background: var(--brown-2); }
.top-connect:active { transform: scale(.98); }
.top-connect:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (max-width: 640px) {
  .top { height: 60px; }
  .logo-img { height: 24px; }
  .top-left .pf-btn { padding: 0 8px 0 10px; font-size: 12.5px; }
  .top-left .pf-name { max-width: 96px; }
  .top-connect { padding: 0 12px; font-size: 12.5px; }
}

/* ===========================
   Compact, balanced Home rows (.hm-libpage)
   =========================== */
.mem-top .lib-top { margin-top: 16px; }
.hm-libpage .lib-top { margin-top: 16px; }
.hm-libpage > .ctl-search { margin-top: 14px; }
.hm-libpage .list > li { border-bottom: 1px dotted rgba(77, 53, 51, .12); }
.hm-libpage .list > li:last-child { border-bottom: 0; }
.hm-libpage .list > li > .ctl-row::before { display: none; }
.hm-libpage .ctl-row { padding: 8px 10px; gap: 11px; min-height: 46px; border-radius: 10px; transition: background .12s; }
.hm-libpage .ctl-row:hover { background: var(--tint2); }
.hm-libpage .conn-logo { width: 32px; height: 32px; }
.hm-libpage .conn-logo > img,
.hm-libpage .conn-logo-letter { width: 28px; height: 28px; border-radius: 7px; font-size: 13px; }
.hm-libpage .conn-logo-badge { width: 15px; height: 15px; right: -2px; bottom: -2px; }
.hm-libpage .conn-logo-badge svg { width: 9px; height: 9px; }
.hm-libpage .hm-lane { width: 32px; height: 32px; }
.hm-libpage .ctl-row .txt { flex: 1; min-width: 0; text-align: left; cursor: pointer; }
.hm-libpage .ctl-row .t { font-size: 13.5px; line-height: 18px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-libpage .ctl-st { display: block; font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.hm-libpage .hm-lib { margin: 22px 0 4px; }
.hm-libpage .ctl-scroll > .hm-lib:first-child { margin-top: 12px; }
.hm-libpage .hm-lib .hm-lib-t { font-size: 15px; font-weight: 600; }
.hm-libpage .hm-kinds .seg-btn { padding: 4px 11px; font-size: 12px; }
.hm-libpage .hm-more { min-height: 36px; padding: 4px 10px 4px 53px; font-size: 12.5px; }
.hm-libpage .hm-skill.is-member { padding-left: 22px; }

.hm-conn-row { width: 100%; text-align: left; cursor: pointer; }
.hm-conn-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; text-align: left; cursor: pointer; }
.hm-conn-row .txt, .hm-conn-main .txt { display: block; }
.hm-conn-row .t, .hm-conn-main .t { display: block; }
.hm-conn-row:hover .t, .hm-conn-main:hover .t { text-decoration: underline; text-decoration-color: rgba(77, 53, 51, .3); text-underline-offset: 3px; }
.hm-conn-row:focus-visible, .hm-conn-main:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 10px; }
.vault-conn-btn { width: 100%; text-align: left; }

/* ===========================
   Profile Manager items & tabs
   =========================== */
.pf-mgr-sec-tabs { margin: 2px 0 14px; border-radius: 999px; }
.pf-mgr-sec-tabs .seg-btn { border-radius: 999px; padding: 5px 13px; font-size: 12.5px; }
.pf-mgr-body { min-height: 160px; }
.pf-mgr-search { width: 100%; margin-top: 8px; font-size: 13px; min-height: 34px !important; padding: 5px 0 !important; }
.pf-mgr-items { max-height: 280px; overflow-y: auto; border: 1px solid var(--hair); border-radius: 10px; padding: 6px 10px; margin-top: 8px; background: var(--card); }
.pf-mgr-items-group { padding: 8px 2px 4px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--soft); display: flex; align-items: center; justify-content: space-between; }
.pf-mgr-items-group:first-child { padding-top: 2px; }
.pf-mgr-item { display: flex; align-items: center; gap: 10px; padding: 6px 2px; border-bottom: 1px dotted rgba(77, 53, 51, .12); font-size: 13px; cursor: pointer; }
.pf-mgr-item:last-child { border-bottom: 0; }
.pf-mgr-item input { accent-color: var(--brown); width: 15px; height: 15px; flex: none; }
.pf-mgr-item-n { flex: 1; min-width: 0; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-mgr-item-m { flex: none; font-size: 11.5px; color: var(--soft); white-space: nowrap; }
.pf-mgr-items-empty { padding: 10px 2px; }

/* ===========================
   Connection Popup (.cp-*)
   =========================== */
.cp-sheet { width: min(820px, calc(100vw - 32px)); height: min(620px, calc(100vh - 32px)); }
.cp-add-sheet { width: min(620px, calc(100vw - 32px)); height: min(620px, calc(100vh - 32px)); }
.cp-in { display: contents; }
.cp-add-sheet .cp-in { display: flex; flex: 1; min-width: 0; min-height: 0; }
.cp-head { display: flex; align-items: center; gap: 10px; padding: 0 6px 18px; }
.cp-head-c { min-width: 0; }
.cp-head .conn-logo { width: 34px; height: 34px; }
.cp-head .conn-logo > img,
.cp-head .conn-logo-letter { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; }
.cp-head .conn-logo-badge { width: 15px; height: 15px; }
.cp-head .conn-logo-badge svg { width: 9px; height: 9px; }
.cp-st.is-warn { color: var(--warn); }
.cp-st.is-no { color: var(--no); }
.cp-tab-badge { margin-left: auto; font-size: 11.5px; color: var(--soft); font-variant-numeric: tabular-nums; }
.cp-alert { margin: 14px 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--ink); font-size: 13px; line-height: 19px; }
.cp-alert.is-no, .cp-alert.bad { background: var(--no-bg); }
.cp-alert-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cp-alert-copy { flex: 1; min-width: 180px; }
.cp-alert-copy strong { display: block; font-size: 13.5px; color: var(--ink); }
.cp-alert-sub { margin: 2px 0 0; font-size: 12.5px; line-height: 18px; color: var(--muted); }
.cp-rules { margin-top: 14px; }
.cp-sec { margin-top: 18px; padding-top: 16px; border-top: 1px dotted rgba(77, 53, 51, .14); }
.cp-sec > .st-grp:first-child { margin-top: 0; }
.cp-hint { margin-top: 6px; }
.cp-desc-form, .cp-key-form { margin-top: 10px; }
.cp-desc-form input, .cp-key-form input { height: 36px; padding: 6px 11px; font-size: 13px; }
.cp-meta { display: grid; gap: 8px; margin-top: 10px; }
.cp-meta-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px 12px; align-items: baseline; font-size: 13px; }
.cp-meta-row dt { color: var(--soft); font-weight: 500; }
.cp-meta-row dd { margin: 0; color: var(--ink); word-break: break-word; }
.cp-reauth { margin: 0 0 0 8px; font-size: 12.5px; }
.cp-tools-top, .cp-tool-bar { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.cp-tool-search { width: 100%; font-size: 13px; min-height: 36px !important; padding: 6px 0 !important; }
.cp-tool-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.cp-tool-list > li, .cp-tool-item { border: 0; border-radius: 0; background: transparent; border-bottom: 1px dotted rgba(77, 53, 51, .12); padding: 9px 0; }
.cp-tool-list > li:last-child, .cp-tool-item:last-child { border-bottom: 0; }
.cp-tool-item.off { background: transparent; opacity: .72; }
.cp-tool-head, .cp-tool-row { display: flex; align-items: flex-start; gap: 10px; }
.cp-tool-info { flex: 1; min-width: 0; }
.cp-tool-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cp-tool-name { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink); word-break: break-word; }
.cp-tool-desc { font-size: 12px; line-height: 17px; color: var(--muted); margin-top: 2px; }
.cp-tool-acts { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.cp-tool-test { margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--tint2); border-top: 0; }
.cp-tool-out { margin-top: 8px; padding: 10px; border-radius: 8px; background: #3F2C2A; color: #F3EAE7; font: 12px/1.5 var(--mono); max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.cp-url { padding: 8px 10px; border-radius: 8px; background: var(--tint2); font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-all; margin-top: 8px; }
.cp-confirm { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--no-bg); font-size: 12.5px; width: 100%; }
.cp-confirm-t { margin: 0 0 8px; font-weight: 500; color: var(--no); line-height: 17px; }
.cp-confirm-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cp-confirm-rules { margin-top: 14px; }
.cp-oauth-acts { margin-top: 18px; }
.cp-add-tabs { margin-top: 12px; }
.cp-empty { padding: 12px 0; }
.cp-ann { font-size: 11px; }

@media (max-width: 640px) {
  .cp-sheet, .cp-add-sheet { width: calc(100vw - 20px); height: min(720px, calc(100vh - 20px)); }
  .cp-head { padding: 0 6px 12px; }
  .cp-meta-row { grid-template-columns: 1fr; gap: 2px; }
  .cp-tool-row, .cp-tool-head { flex-wrap: wrap; }
  .cp-tool-acts { width: 100%; justify-content: flex-end; }
}
