/* Findings skin shared with the Swarm control plane. Keep the original layout
   classes and JavaScript hooks so every board, chain, editor, and setting works. */
:root {
  color-scheme: dark;
  --accent: #55dfb7;
  --bg: #0a1018;
  --glass: #111b26;
  --glass-2: #162331;
  --stroke: #273746;
  --stroke-2: #344858;
  --text: #e9f2f3;
  --muted: #91a5b3;
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow: none;
}
body { background: var(--bg); font-family: var(--font); }
#bg-layer { background-image: radial-gradient(circle at 100% 0, #122534 0, transparent 35%); transition: none; }
#bg-scrim { background: rgba(6, 13, 20, var(--scrim, .55)); }
.glass, .toast { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; box-shadow: none; }
.glass { background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--radius); }

/* Identity and login */
.brand { display: flex; align-items: center; gap: 11px; margin: 0; }
.brand-mark { width: 28px; height: 28px; border: 2px solid var(--accent); border-radius: 9px;
  display: grid; place-items: center; flex: none; color: var(--accent); background: none;
  -webkit-background-clip: initial; background-clip: initial; font-size: 15px; letter-spacing: 0; }
.brand-sub { display: block; color: var(--text); font-size: 20px; font-weight: 760;
  line-height: 1; text-transform: none; letter-spacing: -.03em; }
.brand-sub small { display: block; color: var(--muted); font-size: 10px;
  font-weight: 650; letter-spacing: .17em; margin-top: 2px; }
.login { background: transparent; }
.login-card { width: min(430px, 100%); padding: 30px; border-radius: 18px; }
.login-card .brand { margin-bottom: 27px; }
.login-card h1 { margin: 0 0 5px; font-size: 29px; letter-spacing: -.04em; }
.login-sub { color: var(--muted); margin: 0 0 24px; line-height: 1.5; }
.login-card label { color: #bdd0d9; font-size: 12px; font-weight: 700; }
.login-card input { background: #0c1620; border: 1px solid var(--stroke-2); border-radius: 8px; }
.login-card input:focus { box-shadow: 0 0 0 3px #55dfb71a; }

/* App shell */
.app { grid-template-columns: 300px minmax(0, 1fr); gap: 0; padding: 0; }
.sidebar { min-width: 0; padding: 30px 20px; border: 0; border-right: 1px solid var(--stroke);
  border-radius: 0; background: #0d1721; gap: 10px; }
.sidebar > .brand { margin: 0 12px 32px; }
.sidebar .brand-sub { font-size: 25px; }
.sidebar .brand-sub small { font-size: 12px; }
.sidebar .brand-mark { width: 34px; height: 34px; font-size: 18px; }
.nav-item { border: 0; border-radius: 10px; padding: 16px 16px; color: var(--muted);
  font-size: 18px; font-weight: 650; min-width: 0; line-height: 1.35; }
.nav-item:hover, .nav-item.active { color: var(--text); background: #1a2938; }
.nav-item.active { box-shadow: inset 3px 0 var(--accent); }
.nav-item .count { background: #10202d; border-radius: 7px; padding: 4px 9px; font-size: 15px; }
.nav-label { margin: 23px 14px 9px; color: var(--muted); letter-spacing: .12em;
  font-size: 14px; font-weight: 750; }
.nav-label .mini { width: 32px; height: 32px; font-size: 20px; }
.prog-list { gap: 6px; }
.sidebar-foot { border-top: 1px solid var(--stroke); gap: 5px; }
.sidebar-foot button { text-align: left; border: 0; background: transparent; color: var(--muted);
  padding: 13px 15px; font-size: 17px; }
.sidebar-foot button:hover { color: var(--accent); }
.main { gap: 18px; padding: 32px clamp(20px, 4vw, 62px) 24px; }
.page-intro { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex: none; padding-top: 15px; }
.eyebrow { color: var(--accent); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; font-weight: 800; margin-bottom: 8px; }
.page-intro h1 { font-size: clamp(27px, 3vw, 37px); line-height: 1.1;
  letter-spacing: -.045em; margin: 0; }
.intro-sub { color: var(--muted); margin: 9px 0 0; line-height: 1.5; font-size: 16px; }
.system-pill { display: inline-flex; align-items: center; gap: 7px; flex: none;
  border: 1px solid var(--stroke); border-radius: 99px; padding: 7px 11px;
  color: var(--muted); font-size: 12px; white-space: nowrap; }
.system-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 12px var(--accent); }
.toolbar { flex: none; justify-content: flex-start; padding: 15px; border-radius: 13px; }
.tb-left { flex: 1 1 230px; }
.tb-right { flex: 1 1 auto; justify-content: flex-end; }
.search { background: #0c1620; border: 1px solid var(--stroke-2); border-radius: 8px;
  width: 100%; max-width: 400px; font-size: 16px; padding: 12px 14px; }
.sel { background: #0c1620; border: 1px solid var(--stroke-2); border-radius: 8px;
  font-size: 15px; padding: 11px 13px; }
.seg { border-color: var(--stroke-2); border-radius: 8px; }
.seg button { font-size: 15px; padding: 11px 14px; }
.seg button.on { background: #1b4238; color: #b5f1d9; }
.btn, .ghost, .mini { border-radius: 8px; transition: border-color .12s, color .12s, background .12s; }
.btn { border: 1px solid var(--stroke-2); background: var(--glass-2); font-size: 15px; padding: 11px 15px; }
.btn:hover { transform: none; color: var(--accent); border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #10251f; border-color: var(--accent); }
.btn.primary:hover { background: #83ebca; color: #10251f; }
.ghost { border-color: var(--stroke); }

/* Board, rows, and chains */
.board { gap: 15px; padding-bottom: 8px; }
.column { flex-basis: 400px; }
.col-head { padding: 4px 5px 11px; }
.col-title { font-size: 19px; font-weight: 700; }
.col-count { background: #152330; }
.col-cards { gap: 10px; }
.card { background: var(--glass); border: 1px solid var(--stroke);
  border-left: 4px solid var(--sev, var(--accent)); border-radius: 12px;
  transition: border-color .12s; }
.card:hover, .rowcard:hover { transform: none; box-shadow: none; border-color: var(--accent); }
.card .c-title { color: var(--text); font-size: 21px; line-height: 1.4; font-weight: 700; }
.card .c-sum { color: var(--muted); font-size: 16px; line-height: 1.55; -webkit-line-clamp: 3; }
.card .c-foot { color: var(--muted); font-size: 14px; }
.chip { border-radius: 6px; font-size: 14px; font-weight: 700; padding: 5px 10px; }
.pill, .c-ref, .ctx-ref { background: #0d1b27; border-radius: 6px; font-size: 14px; }
.section-head { background: linear-gradient(180deg, #0a1018 72%, transparent); }
.rowcard { background: var(--glass); min-height: 98px; padding: 17px 20px;
  flex-wrap: wrap; column-gap: 13px; row-gap: 9px; }
.rowcard .r-title { flex: 1 1 55%; min-width: 180px; white-space: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  font-size: 21px; line-height: 1.4; font-weight: 700; }
.rowcard .c-ref, .rowcard .chain-parent-ref { font-size: 14px; }
.rowcard .chip { font-size: 14px; padding: 5px 10px; }
.board.style-row .r-right { flex: 1 1 100%; max-width: none; gap: 12px;
  font-size: 15px; flex-wrap: wrap; overflow: visible; }
.rowcard .pill { font-size: 14px; padding: 4px 9px; }
.section-head .col-title { font-size: 20px; }
.section-empty { font-size: 15px; padding: 10px 4px; }
.chain-child::after { top: 48px; }
.chain-child:last-child::before { height: 53px; }
.tnode { background: var(--glass); border-radius: 12px; }
.ctxmenu { background: #111b26; border-color: var(--stroke-2); box-shadow: 0 18px 45px #0008; }
.ctx-item:hover { background: #193328; }
.ctx-head.back { color: var(--accent); }
.skel-box { background: #143127; box-shadow: 0 10px 28px #0007; }

/* Report and settings panels */
.modal-wrap { background: #050b12c9; }
.modal, .panel { background: var(--glass); border: 1px solid var(--stroke);
  border-radius: 14px; box-shadow: 0 18px 55px #0008; }
.panel.config { background: #121e29; }
.phead { border-bottom-color: var(--stroke); }
.ftitle { font-size: 20px; }
.ftitle:focus { background: #0c1620; }
.field label { color: #bdd0d9; font-weight: 700; letter-spacing: .08em; }
.field input, .field textarea, .field select, .content textarea,
.opt-row input[type=text], .ctx-search, .token-box { background: #0c1620; border-color: var(--stroke-2); }
.field input, .field select, .field textarea { font-size: 15px; }
.md-body, .content .md-body { background: transparent; }
.content .md-body { font-size: 16px; line-height: 1.7; }
.content textarea { font-size: 14.5px; line-height: 1.65; }
.md-body pre { background: #0c1620; }
.tabs button { border-radius: 8px; }
.tabs button.on { background: #1b4238; color: #b5f1d9; border: 1px solid #355044; }
.set-section { border-top-color: var(--stroke); }
.token-box { color: #c4f8e4; }
.toast { background: #162331; border-color: var(--stroke-2); }

@media (max-width: 900px) {
  .main { padding: 22px 17px; }
  .toolbar { align-items: stretch; }
  .tb-right { justify-content: flex-start; }
  .dual { gap: 9px; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { display: flex; flex-direction: column; min-width: 0;
    overflow: visible; padding: 13px 17px 11px; border-right: 0; border-bottom: 1px solid var(--stroke); }
  .sidebar > .brand { margin: 0 10px 4px; }
  .sidebar .nav-item[data-prog=all] { flex: none; width: auto; align-self: flex-start; }
  .nav-label { margin: 4px 10px 0; }
  .prog-list { display: flex; flex-direction: row; flex: none; min-height: 55px;
    overflow-x: auto; overflow-y: hidden; }
  .prog-list .nav-item { flex: none; width: auto; white-space: nowrap; }
  .sidebar-foot { flex-direction: row; margin-top: 0; padding: 2px 4px 0; }
  .main { min-height: 0; min-width: 0; overflow: hidden; padding: 16px 17px; }
  .page-intro { padding-top: 0; }
  .board { min-height: 0; }
}
@media (max-width: 560px) {
  .page-intro { display: block; }
  .system-pill { display: none; }
  .intro-sub { font-size: 15px; }
  .toolbar { gap: 9px; }
  .tb-left, .tb-right { flex: 1 1 100%; }
  .search { max-width: none; }
  .sel { max-width: 100%; }
  .rowcard { min-height: 112px; padding: 16px; row-gap: 10px; }
  .rowcard .r-title { flex: 1 1 100%; min-width: 0; }
  .board.style-row .r-right { gap: 8px; }
  .rowcard .r-asset, .rowcard .r-date { display: none; }
}
