/* ============================================================
   LECTRON UI KIT — application shell styles (library screen)
   ============================================================ */
/* Scoped for the marketing-site mock: sized by its frame, not the viewport. */
.lx-app { display: flex; flex-direction: column; height: 100%; background: var(--bg); color: var(--text); }

/* ---- Title bar (macOS) ---- */
.titlebar { height: 38px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 12px;
  background: var(--bg-sunken); border-bottom: 1px solid var(--border); -webkit-app-region: drag; }
.tl-lights { display: flex; gap: 8px; }
.tl-lights i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.titlebar .tl-title { flex: 1; text-align: center; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); letter-spacing: .02em; }
.titlebar .tl-title b { color: var(--text-secondary); font-weight: 500; }
.tl-actions { display: flex; align-items: center; gap: 4px; }

/* ---- Body grid ---- */
.body { flex: 1; display: grid; grid-template-columns: var(--sidebar-w) minmax(0,1fr) var(--inspector-w); min-height: 0; }
.body[data-inspector="false"] { grid-template-columns: var(--sidebar-w) minmax(0,1fr); }

/* ---- Sidebar ---- */
.sidebar { background: var(--bg-sunken); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.sb-brand { display: flex; align-items: center; gap: 9px; padding: 12px 14px 10px; }
.sb-brand .word { font-family: var(--font-mono); font-size: 16px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); }
.sb-search { padding: 4px 12px 12px; }
.sb-scroll { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.sb-group { margin-top: 10px; }
.sb-group__label { font-family: var(--font-mono); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint); padding: 6px 8px 5px; display: flex; justify-content: space-between; }
.sb-item { display: flex; align-items: center; gap: 9px; height: 28px; padding: 0 8px; border-radius: var(--r-sm); cursor: pointer; color: var(--text-secondary);
  font-family: var(--font-sans); font-size: 12.5px; transition: background var(--dur-fast), color var(--dur-fast); }
.sb-item:hover { background: var(--surface-inset); color: var(--text); }
.sb-item[data-active="true"] { background: var(--accent-weak); color: var(--text); }
.sb-item[data-active="true"] .sb-ic { color: var(--accent); }
.sb-ic { width: 15px; height: 15px; color: var(--text-muted); flex: none; display: inline-flex; }
.sb-ic svg { width: 100%; height: 100%; }
.sb-item .sb-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-count { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.sb-swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.sb-foot { border-top: 1px solid var(--border); padding: 10px 14px; }
.sb-meter { height: 5px; border-radius: var(--r-pill); background: var(--border); overflow: hidden; margin-top: 7px; }
.sb-meter i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); }
.sb-meter-row { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }

/* ---- Center column ---- */
.center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.toolbar { height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); background: var(--bg); flex-wrap: nowrap; overflow: hidden; }
.tb-title { font-family: var(--font-sans); font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; flex: none; }
.tb-sub { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-spacer { flex: 1; min-width: 8px; }
.toolbar .searchbox { flex: 0 1 auto; min-width: 90px; }
.tb-seg, .toolbar .btn { flex: none; }
.tb-seg { display: flex; background: var(--surface-inset); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px; gap: 2px; }
.tb-seg button { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 22px; border: none; background: transparent; color: var(--text-muted); border-radius: var(--r-xs); cursor: pointer; }
.tb-seg button svg { width: 14px; height: 14px; }
.tb-seg button[data-on="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-xs); }

.selbar { height: 32px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--accent-weak); border-bottom: 1px solid var(--accent-line); font-family: var(--font-mono); font-size: 11px; color: var(--text); }
.selbar .x { margin-left: auto; display: flex; gap: 8px; }

.tablewrap { flex: 1; overflow: auto; min-height: 0; }
.dt { width: 100%; border-collapse: separate; border-spacing: 0; font-family: var(--font-mono); font-size: 11.5px; }
.dt thead th { position: sticky; top: 0; z-index: 2; background: var(--bg-sunken); color: var(--text-muted); font-weight: 500; font-size: 9px;
  letter-spacing: .05em; text-transform: uppercase; text-align: left; padding: 0 12px; height: 30px; white-space: nowrap; border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; }
.dt thead th.n { text-align: right; }
.dt thead th:hover { color: var(--text-secondary); }
.dt thead th .ar { color: var(--accent); margin-left: 4px; }
.dt tbody td { padding: 0 12px; height: var(--row-h); border-bottom: 1px solid var(--border-subtle); white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text); }
.dt tbody tr { cursor: pointer; transition: background var(--dur-fast); }
.dt tbody tr:hover { background: var(--surface-inset); }
.dt tbody tr[data-active="true"] { background: var(--accent-weak); }
.dt tbody tr[data-active="true"] td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.dt td.n { text-align: right; color: var(--text-secondary); }
.dt td.prim { color: var(--text); font-weight: 500; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.dt .gut { width: 32px; }
.cb { width: 14px; height: 14px; border: 1.5px solid var(--border-strong); border-radius: var(--r-xs); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.cb[data-on="true"] { background: var(--accent); border-color: var(--accent); }
.cb svg { width: 10px; height: 10px; stroke: var(--text-on-accent); stroke-width: 3; fill: none; opacity: 0; }
.cb[data-on="true"] svg { opacity: 1; }
.celltag { display: inline-flex; align-items: center; gap: 5px; height: 17px; padding: 0 7px 0 6px; border-radius: var(--r-pill); font-size: 9.5px; color: var(--text-secondary); background: var(--surface-inset); border: 1px solid var(--border); }
.celltag i { width: 6px; height: 6px; border-radius: 2px; }
.cellstat { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 10.5px; }
.cellstat i { width: 6px; height: 6px; border-radius: 50%; }
.cellscore { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cellscore .bar { width: 44px; height: 4px; border-radius: var(--r-pill); background: var(--border); overflow: hidden; }
.cellscore .bar i { display: block; height: 100%; background: var(--accent); }
.cellscore .v { min-width: 40px; text-align: right; color: var(--text); }

/* ---- Terminal dock ---- */
.termdock { flex: none; border-top: 1px solid var(--term-border); background: var(--term-bg); }
.termdock.closed { height: 30px; }
.termdock.open { height: var(--terminal-h); display: flex; flex-direction: column; }
.term-bar { height: 30px; display: flex; align-items: center; gap: 9px; padding: 0 12px; background: var(--term-chrome); cursor: pointer; flex: none; }
.term-bar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--data-green); }
.term-bar .t { font-family: var(--font-mono); font-size: 11px; color: var(--term-fg); }
.term-bar .sub { font-family: var(--font-mono); font-size: 10px; color: var(--term-dim); }
.term-bar .tag { margin-left: auto; font-family: var(--font-mono); font-size: 9px; color: var(--term-dim); border: 1px solid var(--term-border); border-radius: var(--r-xs); padding: 1px 6px; }
.term-body { flex: 1; overflow-y: auto; padding: 10px 14px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.55; color: var(--term-fg); }
.tline { white-space: pre-wrap; word-break: break-word; }
.tline + .tline { margin-top: 2px; }
.t-path { color: var(--term-cyan); }
.t-prompt { color: var(--term-prompt); }
.t-dim { color: var(--term-dim); }
.t-ok { color: var(--term-green); }
.t-err { color: var(--term-red); }
.t-ai { color: var(--term-violet); }
.term-input { display: flex; align-items: center; gap: 8px; padding: 4px 14px 12px; font-family: var(--font-mono); font-size: 11.5px; }
.term-input input { flex: 1; background: transparent; border: none; outline: none; color: var(--term-fg); font-family: var(--font-mono); font-size: 11.5px; caret-color: var(--accent); }
.term-input input::placeholder { color: var(--term-dim); }

/* ---- Inspector ---- */
.inspector { background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.insp-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--border-subtle); }
.insp-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; color: var(--text-muted); display: flex; align-items: center; gap: 7px; }
.insp-title { font-family: var(--font-sans); font-size: 16px; font-weight: 600; line-height: 1.25; color: var(--text); margin: 9px 0 6px; text-wrap: pretty; }
.insp-authors { font-family: var(--font-sans); font-size: 12px; color: var(--text-secondary); }
.insp-scroll { flex: 1; overflow-y: auto; padding: 14px 16px; }
.insp-sec { margin-bottom: 16px; }
.insp-sec h5 { font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 8px; font-weight: 500; }
.insp-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-family: var(--font-mono); font-size: 11px; }
.insp-meta dt { color: var(--text-muted); }
.insp-meta dd { margin: 0; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.insp-abstract { font-family: var(--font-serif); font-size: 13.5px; line-height: 1.6; color: var(--text-secondary); text-wrap: pretty; }
.insp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.analysis { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.analysis:last-child { border: none; }
.analysis .ic { width: 26px; height: 26px; border-radius: var(--r-sm); background: var(--surface-inset); display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); flex: none; }
.analysis .ic svg { width: 14px; height: 14px; }
.analysis .lbl { flex: 1; font-family: var(--font-sans); font-size: 12px; color: var(--text); }
.analysis .lbl small { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.analysis .val { font-family: var(--font-mono); font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.insp-foot { border-top: 1px solid var(--border-subtle); padding: 12px 16px; display: flex; gap: 8px; }

/* shared small button (reused from core) */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; height: var(--h-md); padding:0 12px; font-family:var(--font-sans); font-size:12.5px; font-weight:500; line-height:1; white-space:nowrap; cursor:pointer; border:1px solid transparent; border-radius:var(--r-sm); transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast); }
.btn svg { width: 14px; height: 14px; }
.btn--primary { background: var(--accent); color: var(--text-on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn--secondary:hover { background: var(--surface-inset); }
.btn--ghost { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover { background: var(--accent-weak); color: var(--text); }
.btn--block { flex: 1; }
.iconbtn { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; color:var(--text-secondary); background:transparent; border:1px solid transparent; border-radius:var(--r-sm); cursor:pointer; transition: background var(--dur-fast), color var(--dur-fast); }
.iconbtn svg { width:15px; height:15px; }
.iconbtn:hover { background:var(--accent-weak); color:var(--text); }
.iconbtn[data-on="true"] { background: var(--accent-weak); color: var(--accent); }

.searchbox { display:flex; align-items:center; gap:7px; height:28px; padding:0 9px; background:var(--surface); border:1px solid var(--border-strong); border-radius:var(--r-sm); }
.searchbox svg { width:14px; height:14px; color:var(--text-muted); flex:none; }
.searchbox input { flex:1; min-width:0; border:none; outline:none; background:transparent; font-family:var(--font-mono); font-size:12px; color:var(--text); }
.searchbox input::placeholder { color:var(--text-faint); }
.searchbox .kbd { font-family:var(--font-mono); font-size:9px; color:var(--text-faint); border:1px solid var(--border); border-radius:var(--r-xs); padding:1px 5px; }
