:root {
  --bg: #f5f7fc;
  --surface: #ffffff;
  --surface-2: #fbfcff;
  --ink: #1f2433;
  --ink-soft: #4a5065;
  --muted: #7b8199;
  --line: #e7eaf4;
  --line-strong: #d6dbea;
  --primary: #6c5ce7;
  --primary-2: #8f7bff;
  --primary-soft: #efeaff;
  --mint: #12b3a0;
  --mint-soft: #e0f8f3;
  --peach: #f28f4c;
  --peach-soft: #fff1e5;
  --sky: #3d9be9;
  --sky-soft: #e6f2fd;
  --danger: #e0556f;
  --danger-soft: #ffe8ed;
  --warn: #d99a1d;
  --warn-soft: #fff6e0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(31, 36, 51, .05), 0 4px 12px rgba(31, 36, 51, .04);
  --shadow-md: 0 6px 24px rgba(31, 36, 51, .08);
  --shadow-lg: 0 24px 60px rgba(31, 36, 51, .16);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 8% -10%, #ece7ff 0%, rgba(236,231,255,0) 60%),
    radial-gradient(900px 500px at 100% 0%, #e2f8f3 0%, rgba(226,248,243,0) 55%),
    var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }

/* ---------------------------------------------------------------- layout */
#app { display: grid; grid-template-columns: 292px minmax(0, 1fr) 0; height: 100vh; overflow: hidden; }
#app.trace-open { grid-template-columns: 292px minmax(0, 1fr) 400px; }

.sidebar {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 14px; overflow-y: auto;
  background: rgba(255, 255, 255, .66);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.3px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 17px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 60%, var(--mint) 100%);
  color: #fff; box-shadow: var(--shadow-sm);
}
.brand small { font-weight: 600; color: var(--muted); font-size: 10.5px; letter-spacing: .2px; display: block; }
.section-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--muted);
  padding: 4px 4px 0;
}
.registry { display: flex; flex-direction: column; gap: 8px; }
.reg-card {
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 13px;
  padding: 10px 11px; cursor: pointer; transition: .16s ease; box-shadow: var(--shadow-sm);
}
.reg-card:hover { transform: translateY(-1px); border-color: var(--primary-2); box-shadow: var(--shadow-md); }
.reg-card.active { border-color: var(--primary); background: linear-gradient(180deg, #fff, var(--primary-soft)); }
.reg-card .name { font-weight: 650; font-size: 13.5px; display: flex; gap: 6px; align-items: center; }
.reg-card .id { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.reg-card .row { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.reg-card .empty { color: var(--muted); font-size: 12px; padding: 10px; text-align: center; }

main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 16px 24px 12px;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.72); backdrop-filter: blur(10px);
}
.topbar .titles { min-width: 0; }
.topbar h1 { margin: 0; font-size: 19px; letter-spacing: -.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { color: var(--muted); font-size: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.topbar .tools { display: flex; gap: 8px; align-items: center; }
input.search {
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 13px; width: 190px; background: #fff; outline: none;
}
input.search:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-soft); }

.tabs { display: flex; gap: 4px; padding: 8px 20px 0; border-bottom: 1px solid var(--line); overflow-x: auto; background: rgba(255,255,255,.5); }
.tab {
  border: none; background: transparent; padding: 9px 13px; border-radius: 10px 10px 0 0; cursor: pointer;
  color: var(--ink-soft); font-weight: 600; font-size: 13px; white-space: nowrap; position: relative;
}
.tab:hover { background: #fff; color: var(--ink); }
.tab.active { color: var(--primary); background: #fff; box-shadow: inset 0 -2px 0 var(--primary); }
.tab .count { font-size: 10.5px; background: var(--primary-soft); color: var(--primary); padding: 1px 6px; border-radius: 999px; margin-left: 5px; }

.content { flex: 1; overflow-y: auto; padding: 20px 24px 60px; }

/* ---------------------------------------------------------------- trace */
.trace {
  border-left: 1px solid var(--line); background: rgba(255,255,255,.82); backdrop-filter: blur(12px);
  display: none; flex-direction: column; overflow: hidden;
}
#app.trace-open .trace { display: flex; }
.trace header {
  display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; font-weight: 700; font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.trace header .close { margin-left: auto; }
#trace-list { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 7px; }
.ev {
  border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: 10px; padding: 8px 10px;
  background: #fff; font-size: 12px; animation: slidein .18s ease;
}
@keyframes slidein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ev .line1 { display: flex; gap: 6px; align-items: baseline; }
.ev .tool { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--ink); }
.ev .when { margin-left: auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.ev .sum { color: var(--ink-soft); word-break: break-word; margin-top: 2px; }
.ev.ok { border-left-color: var(--mint); }
.ev.rejected { border-left-color: var(--danger); background: var(--danger-soft); }
.ev.pending { border-left-color: var(--peach); background: var(--peach-soft); }
.ev.commit { border-left-color: var(--primary); }
.ev.session { border-left-color: var(--sky); }
.ev.hook { border-left-color: var(--warn); background: var(--warn-soft); }
.ev pre { margin: 6px 0 0; font-size: 10.5px; max-height: 180px; overflow: auto; background: #f7f8fc; padding: 6px; border-radius: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(18,179,160,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(18,179,160,.5);} 70% { box-shadow: 0 0 0 8px rgba(18,179,160,0);} 100% { box-shadow: 0 0 0 0 rgba(18,179,160,0);} }
.dot.off { background: var(--line-strong); animation: none; }

/* --------------------------------------------------------------- widgets */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); margin-bottom: 14px;
}
.card.tight { padding: 12px 14px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head h3 { margin: 0; font-size: 14.5px; letter-spacing: -.2px; }
.card-head .spacer { margin-left: auto; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.center { display: grid; place-items: center; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 12px 0; }

.btn {
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font-weight: 620; font-size: 12.5px;
  padding: 7px 12px; border-radius: 10px; cursor: pointer; transition: .14s ease; display: inline-flex; gap: 6px; align-items: center;
}
.btn:hover { border-color: var(--primary-2); color: var(--primary); background: #fdfcff; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(108,92,231,.28); }
.btn.primary:hover { filter: brightness(1.05); color: #fff; }
.btn.mint { background: var(--mint-soft); border-color: #b9ece3; color: #0a7f71; }
.btn.mint:hover { background: #d3f5ee; color: #08695e; }
.btn.danger { background: var(--danger-soft); border-color: #ffc9d4; color: #b23249; }
.btn.danger:hover { background: #ffdbe3; color: #92263a; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--primary-soft); color: var(--primary); }
.btn.sm { padding: 4px 9px; font-size: 11.5px; border-radius: 8px; }
.btn.wide { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { border: none; background: transparent; cursor: pointer; padding: 2px 5px; border-radius: 7px; color: var(--muted); font-size: 13px; }
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650;
  padding: 3px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
}
.pill.gray { background: #f1f3f9; color: var(--ink-soft); border-color: var(--line); }
.pill.violet { background: var(--primary-soft); color: #4a3fd0; }
.pill.mint { background: var(--mint-soft); color: #0a7f71; }
.pill.peach { background: var(--peach-soft); color: #a85d22; }
.pill.sky { background: var(--sky-soft); color: #1e6ea8; }
.pill.red { background: var(--danger-soft); color: #a82c44; }
.pill.amber { background: var(--warn-soft); color: #96690c; }
.pill.clickable { cursor: pointer; }
.pill.clickable:hover { filter: brightness(.96); }

.chip {
  display: inline-flex; gap: 6px; align-items: center; background: #f7f8fd; border: 1px solid var(--line);
  border-radius: 9px; padding: 3px 8px; font-size: 12px; max-width: 100%;
}
.chip .x { cursor: pointer; color: var(--muted); }
.chip .x:hover { color: var(--danger); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.field label { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .3px; text-transform: uppercase; }
.field input, .field textarea, .field select {
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; background: #fff; outline: none; width: 100%;
}
.field textarea { min-height: 74px; resize: vertical; font-family: inherit; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-soft); }
.field .hint { font-size: 11px; color: var(--muted); }
.inline-edit { position: relative; }
.editable { border-radius: 8px; padding: 2px 6px; margin-left: -6px; cursor: text; transition: .12s; white-space: pre-wrap; word-break: break-word; }
.editable:hover { background: var(--primary-soft); }
.editable-empty { color: var(--muted); font-style: italic; }

.editor { border: 1px dashed var(--primary-2); border-radius: 12px; padding: 10px; background: #fdfcff; margin-top: 6px; }
.editor textarea { width: 100%; min-height: 90px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px; font-family: var(--mono); font-size: 12px; }
.editor .row { margin-top: 8px; }

pre.code, pre.diff {
  font-family: var(--mono); font-size: 12px; line-height: 1.55; background: #fbfcff; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; overflow: auto; margin: 0; white-space: pre;
}
pre.diff .add { color: #12805c; background: #e7f8f0; display: block; }
pre.diff .del { color: #b23249; background: #ffeef1; display: block; }
pre.diff .hunk { color: #4a3fd0; background: var(--primary-soft); display: block; }
pre.diff .ctx { color: #4a5065; display: block; }
pre.diff .meta { color: var(--muted); display: block; font-weight: 700; }

/* ---------------------------------------------------------------- tree */
.action-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); margin-bottom: 12px; overflow: hidden; }
.action-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px; cursor: pointer; background: linear-gradient(180deg,#fff,#fcfdff); }
.action-head:hover { background: #fafbff; }
.action-head .aid { font-family: var(--mono); font-size: 11.5px; color: var(--primary); background: var(--primary-soft); padding: 2px 7px; border-radius: 7px; }
.action-head h4 { margin: 0; font-size: 14px; letter-spacing: -.2px; }
.action-body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.action-body.collapsed { display: none; }
.sub-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sub-item { border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; background: #fdfdff; }
.sub-item .head { display: flex; gap: 8px; align-items: center; }
.sub-item .sid { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.sub-item .content { font-size: 12.5px; color: var(--ink-soft); white-space: pre-wrap; margin-top: 4px; }
.tree-indent { margin-left: 14px; border-left: 2px dashed var(--line); padding-left: 10px; }

/* ---------------------------------------------------------------- misc */
.empty-state {
  border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 30px; text-align: center; color: var(--muted);
  background: rgba(255,255,255,.6);
}
.empty-state .big { font-size: 28px; margin-bottom: 6px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-sm); }
.stat .k { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.stat .v { font-size: 22px; font-weight: 750; letter-spacing: -.6px; }
.stat .v small { font-size: 12px; color: var(--muted); font-weight: 600; }

#modal-root { position: fixed; inset: 0; display: none; z-index: 60; }
#modal-root.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(24, 28, 45, .38); backdrop-filter: blur(3px); }
.modal {
  position: relative; margin: 5vh auto; width: min(760px, 94vw); max-height: 90vh; overflow: auto;
  background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); padding: 22px 24px; animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(10px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { margin: 0 0 4px; font-size: 18px; letter-spacing: -.4px; }
.modal .steps { display: flex; gap: 6px; margin: 12px 0 16px; }
.modal .steps .s { flex: 1; height: 5px; border-radius: 99px; background: var(--line); }
.modal .steps .s.on { background: linear-gradient(90deg, var(--primary), var(--mint)); }
.modal .footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--mint); border-radius: 12px;
  padding: 10px 14px; box-shadow: var(--shadow-md); min-width: 260px; max-width: 420px; font-size: 12.5px;
  animation: slidein .2s ease;
}
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast .t { font-weight: 700; margin-bottom: 2px; }
.toast pre { margin: 4px 0 0; font-size: 11px; white-space: pre-wrap; color: var(--ink-soft); }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; font-size: 12.5px; }
.kv .k { color: var(--muted); font-weight: 600; }
.charter-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.charter-card { border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; background: #fff; }
.charter-card h5 { margin: 0 0 8px; font-size: 12px; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.charter-card .item { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; padding: 2px 0; }
.charter-card .item .txt { flex: 1; word-break: break-word; }
.charter-card.n2f { border-top: 3px solid var(--peach); }
.charter-card.scope { border-top: 3px solid var(--mint); }
.charter-card.oos { border-top: 3px solid var(--sky); }
.charter-card.allow { border-top: 3px solid var(--primary); }
.charter-card.forbid { border-top: 3px solid var(--danger); }
.charter-card.ev { border-top: 3px solid var(--warn); }

.banner { border-radius: 14px; padding: 11px 14px; margin-bottom: 14px; font-size: 13px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.banner.info { background: var(--sky-soft); border-color: #cbe6fa; color: #1d5f8f; }
.banner.warn { background: var(--warn-soft); border-color: #f6e2b3; color: #7d5806; }
.banner.danger { background: var(--danger-soft); border-color: #ffcdd8; color: #94253c; }
.banner.mint { background: var(--mint-soft); border-color: #bdece4; color: #0a6f63; }
.banner .b-actions { margin-left: auto; display: flex; gap: 6px; }

.stepper { display: flex; flex-direction: column; gap: 0; }
.step { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 6px 0; }
.step .marker { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: #f1f3f9; color: var(--muted); }
.step.done .marker { background: var(--mint); color: #fff; }
.step.active .marker { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-soft); }
.step.fail .marker { background: var(--danger); color: #fff; }
.step .body { font-size: 12.5px; }
.step .body b { font-size: 13px; }

.split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
@media (max-width: 1180px) { .split { grid-template-columns: 1fr; } #app.trace-open { grid-template-columns: 250px minmax(0,1fr) 340px; } }
@media (max-width: 900px) { #app, #app.trace-open { grid-template-columns: 1fr; } .sidebar, .trace { display: none !important; } }

table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl tr:hover td { background: #fafbff; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { margin-left: auto; }
.seg { display: flex; background: #f1f3f9; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 620; color: var(--ink-soft); cursor: pointer; }
.seg button.on { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.hide { display: none !important; }
.scroll-y { max-height: 420px; overflow-y: auto; }

/* ---------------------------------------------- not-to-forget checklist */
.check-list { display: flex; flex-direction: column; gap: 6px; }
.check-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2, #fbfcfe);
}
.check-row.done { border-color: #bfe8d4; background: #f2fbf6; }
.check-row .tick {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; cursor: pointer; font-size: 15px; line-height: 1;
  border: 1.5px solid var(--line-strong); background: #fff; color: var(--muted);
}
.check-row .tick.on { border-color: #34b083; background: #e7f8f0; color: #12805c; font-weight: 800; }
.check-row .tick:hover { transform: translateY(-1px); }
.check-body { min-width: 0; }
.check-text { font-size: 14px; font-weight: 600; color: var(--ink, #1d2233); overflow-wrap: anywhere; }
.check-mini { margin: 10px 0 0; padding-left: 18px; }
.check-mini li { font-size: 13px; color: #8a4b00; margin: 2px 0; }

/* ---------------------------------------------------------- inbox detail */
.ask-question { font-size: 15px; font-weight: 650; color: var(--ink, #1d2233); }
.ask-detail {
  margin-top: 10px; padding: 12px 14px; border-left: 3px solid var(--primary-2, #6b5bff);
  background: var(--primary-soft, #f2f0ff); border-radius: 0 12px 12px 0;
}
.ask-detail-body { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; color: #33384d; overflow-wrap: anywhere; }
.ask-message { width: 100%; min-height: 84px; resize: vertical; }
.field textarea.ask-message { width: 100%; }

/* ---------------------------------------------------------- fix commands */
.fix-card .fix-command {
  margin: 6px 0 10px; padding: 12px 14px; border-radius: 12px;
  background: #f7f5ff; border: 1px solid #e2dcff; white-space: pre-wrap; font-size: 14px; line-height: 1.5;
}
.fix-report {
  margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.5;
  background: #f2fbf6; border: 1px solid #bfe8d4; white-space: pre-wrap;
}
.fix-report.red { background: #fff4f5; border-color: #f4c2ca; }
.fix-report.amber { background: #fff9ef; border-color: #f2dcb6; }

/* --------------------------------------------- guided runs (v2) */
.tick-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; margin-top: 6px;
}
.tick-row .grow { flex: 1 1 auto; min-width: 0; }
.tick-row.active { border-color: #b9e6cf; background: #f6fdf9; }
.trail { max-height: 220px; overflow: auto; }
.mint { color: #0f7a4d; }

/* --------------------------------------------- hold-to-read tooltips (v2)
   Nothing appears for the first three seconds — the pointer has to rest on the element.
   The card is deliberately small, never covers the control and disappears on any input. */
.tipbox {
  position: fixed; z-index: 9000; max-width: 320px;
  padding: 9px 11px; border-radius: 10px;
  background: #1f2433; color: #f4f6fb; font-size: 12.5px; line-height: 1.5;
  box-shadow: 0 10px 30px rgba(15, 20, 35, .28);
  pointer-events: none; opacity: 0; animation: tipIn .16s ease-out forwards;
}
@keyframes tipIn { to { opacity: 1; } }

/* Greyed hints live in placeholder only: they vanish the moment you type and are never a value. */
input::placeholder, textarea::placeholder { color: #a8b0c4; opacity: 1; }
input:focus::placeholder, textarea:focus::placeholder { color: #c3c9d8; }

/* ===================================================================== v4 · accounts */
.brand-logo { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; background: #05070d;
              box-shadow: 0 0 0 1px rgba(60,120,200,.35); }
.rotate-btn { background: linear-gradient(180deg, #14375c, #0e2540); border: 1px solid #2f7fd0; color: #dcecff; }
.rotate-btn:hover { filter: brightness(1.12); }
.app-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
              padding: 10px 16px 14px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line);
              background: var(--surface); }
.app-footer a { color: var(--primary); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
.app-footer .sep { opacity: .5; }
#account-mini { margin-bottom: 4px; }
.token-mono { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; word-break: break-all; }
.key-box { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: var(--surface-2);
           border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px 12px; user-select: all; }
.danger-zone { border: 1px solid var(--danger-soft); background: #fff8f9; border-radius: 12px; padding: 12px 14px; }
