/* ============================================================
   RED PILL HQ — theme
   ============================================================ */
:root {
  --bg:        #08080a;
  --bg-grad:   radial-gradient(1200px 600px at 12% -10%, rgba(225,6,0,.16), transparent 60%),
               radial-gradient(900px 500px at 100% 0%, rgba(225,6,0,.07), transparent 55%);
  --panel:     #101013;
  --panel-2:   #16161a;
  --panel-3:   #1c1c21;
  --line:      #26262d;
  --line-soft: #1e1e24;

  --red:       #e10600;
  --red-hot:   #ff2d20;
  --red-dim:   #7a0d0a;
  --red-glow:  rgba(225,6,0,.35);

  --text:      #f4f4f6;
  --text-2:    #a9a9b4;
  --text-3:    #6e6e7a;

  --up:        #2ee07a;
  --down:      #ff4d4d;
  --warn:      #ffb020;
  --info:      #4d8dff;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a31; border-radius: 20px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a3a44; }

/* ---------------------------------------------------------- layout */
#app { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0c0c0f, #0a0a0c);
  border-right: 1px solid var(--line-soft);
  padding: 20px 14px 14px;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 20px; }
.brand-pill {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #ff5a4d, var(--red) 45%, #6c0703);
  box-shadow: 0 0 18px var(--red-glow), inset 0 0 8px rgba(0,0,0,.45);
  flex: none;
}
.brand-name { font-weight: 800; letter-spacing: .14em; font-size: 13px; }
.brand-sub { font-size: 10px; letter-spacing: .3em; color: var(--red); font-weight: 700; }

#nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .18em;
  color: var(--text-3); padding: 16px 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 10px; cursor: pointer;
  color: var(--text-2); font-weight: 500; font-size: 13.5px;
  border: 1px solid transparent; transition: .14s;
}
.nav-item i {
  font-style: normal; width: 17px; height: 17px; flex: none;
  display: grid; place-items: center; color: var(--text-3); transition: .14s;
}
.nav-item i svg {
  width: 16px; height: 16px; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(225,6,0,.20), rgba(225,6,0,.04));
  border-color: rgba(225,6,0,.35); color: #fff;
}
.nav-item.active i { color: var(--red-hot); }
.nav-badge {
  margin-left: auto; font-family: var(--mono); font-size: 10px; font-weight: 700;
  color: var(--text-3); background: var(--panel-3); padding: 2px 6px; border-radius: 20px;
}
.nav-item.active .nav-badge { color: #fff; background: rgba(225,6,0,.35); }
.nav-badge.done { color: var(--up); background: rgba(46,224,122,.14); }

.sidebar-foot { border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: 10px; }
.ticker-strip { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.tick { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; }
.tick-sym { color: var(--text-3); }
.foot-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-3); }
.linkbtn { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 11px; padding: 0; }
.linkbtn:hover { color: var(--red-hot); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  padding: 26px 32px 18px; border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 15;
  background: rgba(8,8,10,.82); backdrop-filter: blur(14px);
}
.topbar h1 { margin: 0; font-size: 25px; font-weight: 800; letter-spacing: -.02em; }
.page-sub { margin: 4px 0 0; color: var(--text-3); font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.clock { font-family: var(--mono); font-size: 19px; font-weight: 500; letter-spacing: .02em; }
.market-state { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.view { padding: 24px 32px 80px; }

/* ---------------------------------------------------------- primitives */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
@media (max-width: 1500px) { .g5 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 900px)  { .g5 { grid-template-columns: 1fr; } }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1240px) { .g4 { grid-template-columns: repeat(2,minmax(0,1fr)); } .g3, .g-2-1, .g-1-2 { grid-template-columns: 1fr; } }
@media (max-width: 900px) { #app { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .g2, .g4 { grid-template-columns: 1fr; } .view, .topbar { padding-left: 16px; padding-right: 16px; } }

.card {
  background: linear-gradient(180deg, var(--panel), #0d0d10);
  border: 1px solid var(--line-soft); border-radius: var(--r);
  padding: 18px; position: relative; overflow: hidden;
}
.card.flush { padding: 0; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.card.flush .card-head { padding: 16px 18px 12px; margin: 0; border-bottom: 1px solid var(--line-soft); }
.card-title { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text); margin: 0; display: flex; align-items: center; gap: 8px; }
.card-title::before { content: ''; width: 3px; height: 13px; background: var(--red); border-radius: 2px; }
.card-sub { font-size: 12px; color: var(--text-3); margin: 2px 0 0; }
.card-actions { display: flex; gap: 6px; align-items: center; }

.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--text-3); font-weight: 600; }
.stat-value { font-size: 27px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value.sm { font-size: 20px; }
.stat-meta { font-size: 12px; color: var(--text-3); }

.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--text-3); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-3); border: 1px solid var(--line);
  color: var(--text); padding: 7px 12px; border-radius: 9px;
  cursor: pointer; font-size: 12.5px; font-weight: 600; transition: .14s; white-space: nowrap;
}
.btn:hover { background: #24242b; border-color: #34343d; }
.btn.primary { background: linear-gradient(180deg, var(--red-hot), var(--red)); border-color: #ff4a3d; color: #fff; box-shadow: 0 4px 14px rgba(225,6,0,.28); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn.ghost:hover { color: var(--text); border-color: #3a3a44; }
.btn.sm { padding: 4px 9px; font-size: 11.5px; border-radius: 7px; }
.btn.danger { color: var(--down); border-color: rgba(255,77,77,.3); }
.btn.danger:hover { background: rgba(255,77,77,.12); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px;
  background: var(--panel-3); color: var(--text-2); border: 1px solid var(--line);
}
.pill.red   { background: rgba(225,6,0,.14); color: #ff6a5e; border-color: rgba(225,6,0,.3); }
.pill.green { background: rgba(46,224,122,.12); color: var(--up); border-color: rgba(46,224,122,.28); }
.pill.blue  { background: rgba(77,141,255,.12); color: var(--info); border-color: rgba(77,141,255,.28); }
.pill.amber { background: rgba(255,176,32,.12); color: var(--warn); border-color: rgba(255,176,32,.28); }
.pill.gray  { background: var(--panel-3); }
.pill.purple{ background: rgba(166,120,255,.13); color: #b48cff; border-color: rgba(166,120,255,.3); }
.pill.teal  { background: rgba(77,208,225,.12); color: #4dd0e1; border-color: rgba(77,208,225,.28); }

/* ---------------------------------------------------------- tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600; padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft); white-space: nowrap; background: #0e0e11;
  position: sticky; top: 0;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid #17171b; white-space: nowrap; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: rgba(225,6,0,.045); }
table.tbl td.num, table.tbl th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
/* tighter cells for the half-width tables in Finance and Investments */
table.tbl.compact th, table.tbl.compact td { padding-left: 9px; padding-right: 9px; font-size: 12.5px; }
.row-actions { display: flex; gap: 4px; opacity: 0; transition: .12s; }

/* pin the first and last columns of a wide table so the checkbox and the
   edit / delete buttons never scroll out of reach */
table.tbl th.pin-l, table.tbl td.pin-l { position: sticky; left: 0; z-index: 3; background: #0e0e11; }
table.tbl th.pin-r, table.tbl td.pin-r {
  position: sticky; right: 0; z-index: 3; background: #0e0e11;
  box-shadow: -10px 0 14px -10px rgba(0,0,0,.95);
}
table.tbl tbody tr:hover td.pin-l, table.tbl tbody tr:hover td.pin-r { background: #16151a; }
table.tbl tr.sel td { background: rgba(225,6,0,.10) !important; }
.chkbox { width: 15px; height: 15px; accent-color: #e10600; cursor: pointer; vertical-align: middle; }

/* privacy: blur a column's numbers without changing the layout */
.blurnum.on {
  filter: blur(7px); user-select: none; pointer-events: none;
  transition: filter .15s;
}
.eye {
  background: none; border: none; cursor: pointer; color: var(--text-3);
  padding: 0 0 0 5px; font-size: 11px; line-height: 1; vertical-align: middle;
}
.eye:hover { color: var(--text); }
.eye.hidden-on { color: var(--red-hot); }
.bulkbar {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  background: rgba(225,6,0,.10); border-bottom: 1px solid rgba(225,6,0,.28); font-size: 12.5px;
}
tr:hover .row-actions { opacity: 1; }
.iconbtn {
  background: none; border: none; cursor: pointer; color: var(--text-3);
  padding: 3px 6px; border-radius: 6px; font-size: 12px;
}
.iconbtn:hover { color: var(--text); background: var(--panel-3); }
.iconbtn.del:hover { color: var(--down); background: rgba(255,77,77,.12); }

.empty { padding: 34px 18px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ---------------------------------------------------------- checklists */
.block-head {
  display: flex; align-items: center; gap: 10px; margin: 18px 0 8px;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); font-weight: 700;
}
.block-head::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.block-head:first-child { margin-top: 0; }

.task {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid transparent;
  transition: .12s; cursor: pointer; position: relative;
}
.task:hover { background: var(--panel-2); border-color: var(--line-soft); }
.chk {
  flex: none; width: 18px; height: 18px; border-radius: 6px; margin-top: 1px;
  border: 1.6px solid #3a3a44; display: grid; place-items: center;
  font-size: 11px; color: transparent; transition: .14s; background: #0e0e11;
}
.task.done .chk { background: linear-gradient(180deg, var(--red-hot), var(--red)); border-color: var(--red); color: #fff; box-shadow: 0 0 10px var(--red-glow); }
.task-body { flex: 1; min-width: 0; }
.task-text { font-size: 13.5px; line-height: 1.45; }
.task.done .task-text { color: var(--text-3); text-decoration: line-through; text-decoration-color: rgba(225,6,0,.55); }
.task-meta { display: flex; gap: 8px; margin-top: 4px; font-size: 11px; color: var(--text-3); font-family: var(--mono); }
.task .row-actions { position: absolute; right: 8px; top: 8px; }

/* progress */
.pbar { height: 6px; border-radius: 20px; background: #1d1d22; overflow: hidden; }
.pbar > span { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--red), var(--red-hot)); transition: width .35s; }
.pbar.green > span { background: linear-gradient(90deg, #159a52, var(--up)); }
.pbar.amber > span { background: linear-gradient(90deg, #b87700, var(--warn)); }

.ring-wrap { display: flex; align-items: center; gap: 14px; }
.ring-num { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(190px,1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: #0d0d10; border: 1px solid var(--line-soft); border-radius: var(--r); padding: 12px; min-height: 130px; }
.kcol h4 { margin: 0 0 10px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); display: flex; justify-content: space-between; }
.kitem {
  background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 10px 11px; margin-bottom: 8px; cursor: grab; font-size: 12.5px; line-height: 1.4;
}
.kitem:hover { border-color: rgba(225,6,0,.4); }
.kitem.dragging { opacity: .4; }
.kcol.over { border-color: var(--red); background: rgba(225,6,0,.05); }
.kitem-meta { margin-top: 7px; display: flex; gap: 6px; align-items: center; }

/* ---------------------------------------------------------- platform tabs */
.tabs { display: flex; gap: 4px; background: #0d0d10; padding: 4px; border-radius: 11px; border: 1px solid var(--line-soft); width: fit-content; flex-wrap: wrap; }
.tab {
  padding: 6px 13px; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 600;
  color: var(--text-3); border: 1px solid transparent; display: flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text); }
.tab.active { background: linear-gradient(180deg, #202027, #191920); color: #fff; border-color: var(--line); }
.tab .cnt { font-family: var(--mono); font-size: 10px; opacity: .6; }

/* ---------------------------------------------------------- forms / modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(5px);
  display: grid; place-items: center; z-index: 100; padding: 24px; overflow-y: auto;
}
.modal {
  background: linear-gradient(180deg, #141418, #0f0f12);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  width: 100%; max-width: 560px; box-shadow: 0 30px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(225,6,0,.08);
  animation: pop .16s ease-out;
}
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-body { padding: 20px 22px; display: grid; gap: 14px; max-height: 65vh; overflow-y: auto; }
.modal-foot { padding: 15px 22px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 8px; }

.field { display: grid; gap: 6px; }
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 600; }
.field input, .field select, .field textarea {
  background: #0b0b0e; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; outline: none; transition: .14s; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(225,6,0,.14); }
.field textarea { min-height: 74px; resize: vertical; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------------------------------------------------------- toast */
.toast-root { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  background: #16161b; border: 1px solid var(--line); border-left: 3px solid var(--red);
  padding: 11px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 12px 34px rgba(0,0,0,.6);
  animation: slidein .2s ease-out;
}
.toast.ok { border-left-color: var(--up); }
.toast.err { border-left-color: var(--down); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }

/* ---------------------------------------------------------- charts */
svg.chart { display: block; width: 100%; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 14px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend-val { margin-left: auto; font-family: var(--mono); color: var(--text-3); }

.spark { display: block; }

/* ---------------------------------------------------------- ticker tape */
.tape {
  border-bottom: 1px solid var(--line-soft);
  background: #0a0a0c;
  min-height: 46px;
}
.tape:empty { display: none; }

/* inline selects used in card headers */
select.sel, input.sel {
  background: #0b0b0e; border: 1px solid var(--line); border-radius: 9px;
  padding: 6px 9px; font-size: 12.5px; color: var(--text); outline: none; max-width: 210px;
}
select.sel:focus, input.sel:focus { border-color: var(--red); }

/* ---------------------------------------------------------- P&L calendar */
.cal { user-select: none; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr) 78px; gap: 5px; }
.cal-head {
  margin-bottom: 6px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600; text-align: center;
}
.cal-head .cal-wk { color: var(--red); }
.cal-cell {
  aspect-ratio: 1 / .82; border-radius: 8px; border: 1px solid var(--line-soft);
  padding: 5px 6px; display: flex; flex-direction: column; position: relative; overflow: hidden;
  transition: .12s;
}
.cal-cell.empty { border-color: transparent; background: transparent !important; }
.cal-cell.has:hover { border-color: var(--red); transform: translateY(-1px); }
.cal-day { font-size: 10.5px; color: var(--text-3); font-weight: 600; }
.cal-val { font-family: var(--mono); font-size: 11.5px; font-weight: 700; margin-top: auto; }
.cal-n { font-size: 9px; color: var(--text-3); font-family: var(--mono); }
/* on a filled cell the tint carries the meaning, so text goes plain white */
.cal-cell.has .cal-day,
.cal-cell.has .cal-val,
.cal-cell.has .cal-n { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.55); }
.cal-cell.has .cal-n { opacity: .75; }
.cal-cell.wk {
  aspect-ratio: auto; background: #0d0d10; align-items: flex-end; justify-content: center;
  font-family: var(--mono); font-size: 11.5px; font-weight: 700; padding: 6px;
  border-style: dashed; justify-content: center; align-items: center;
}

.year-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 1100px) { .year-grid { grid-template-columns: repeat(3, 1fr); } }
.year-cell {
  border: 1px solid var(--line-soft); border-radius: 10px; padding: 11px 12px;
}
.year-m { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.year-v { font-family: var(--mono); font-size: 16px; font-weight: 700; margin: 4px 0 2px; color: var(--text); }
.year-n { font-size: 10px; color: var(--text-2); opacity: .8; }

/* ---------------------------------------------------------- sticky notes */
.lab-board { columns: 4 260px; column-gap: 14px; }
@media (max-width: 900px) { .lab-board { columns: 1; } }
.sticky {
  break-inside: avoid; margin-bottom: 14px; border-radius: 12px; padding: 14px 15px;
  border: 1px solid var(--line); position: relative; transition: .14s;
  background: linear-gradient(160deg, #17171c, #121216);
}
.sticky:hover { transform: translateY(-2px); border-color: #3a3a44; }
.sticky.red    { border-left: 3px solid var(--red);  background: linear-gradient(160deg, rgba(225,6,0,.10), #111114); }
.sticky.amber  { border-left: 3px solid var(--warn); background: linear-gradient(160deg, rgba(255,176,32,.09), #111114); }
.sticky.green  { border-left: 3px solid var(--up);   background: linear-gradient(160deg, rgba(46,224,122,.08), #111114); }
.sticky.blue   { border-left: 3px solid var(--info); background: linear-gradient(160deg, rgba(77,141,255,.09), #111114); }
.sticky.plain  { border-left: 3px solid #3a3a44; }
.sticky h4 { margin: 0 0 7px; font-size: 13.5px; font-weight: 700; padding-right: 46px; }
.sticky p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-2); white-space: pre-wrap; }
.sticky .row-actions { position: absolute; top: 10px; right: 10px; }
.sticky-tags { margin-top: 10px; display: flex; gap: 5px; flex-wrap: wrap; }

/* ---------------------------------------------------------- link gallery */
.tool-card {
  display: block; border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px;
  background: var(--panel-2); transition: .14s; position: relative;
}
.tool-card:hover { border-color: rgba(225,6,0,.45); transform: translateY(-2px); background: #191920; }
.tool-name { font-size: 13.5px; font-weight: 600; margin-bottom: 5px; }
.tool-url { font-size: 11px; color: var(--text-3); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; }
.tool-note { font-size: 11.5px; color: var(--text-2); margin-top: 7px; }

/* ------------------------------------------------------- field group form */
.group-head {
  grid-column: 1/-1; margin-top: 6px; font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--red-hot); font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.group-head::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }

/* ---------------------------------------------------------- account chips */
.acct-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.acct {
  padding: 7px 13px; border-radius: 10px; cursor: pointer; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2);
  display: flex; flex-direction: column; gap: 1px; line-height: 1.25; min-width: 108px;
}
.acct:hover { color: var(--text); border-color: #3a3a44; }
.acct.active {
  background: linear-gradient(180deg, rgba(225,6,0,.22), rgba(225,6,0,.06));
  border-color: rgba(225,6,0,.5); color: #fff;
}
.acct small { font-size: 10px; color: var(--text-3); font-family: var(--mono); font-weight: 500; }
.acct.active small { color: rgba(255,255,255,.65); }

/* --------------------------------------------------------- bar in a table */
.minibar { height: 6px; border-radius: 20px; background: #1c1c21; overflow: hidden; min-width: 60px; }
.minibar > span { display: block; height: 100%; border-radius: 20px; }
.minibar > span.pos { background: linear-gradient(90deg, #159a52, var(--up)); }
.minibar > span.neg { background: linear-gradient(90deg, #8a1f1f, var(--down)); }

/* row actions readable without hunting for them */
.row-actions { opacity: .35; }
tr:hover .row-actions, .card:hover .row-actions, .sticky:hover .row-actions,
.task:hover .row-actions, [data-col]:hover .row-actions { opacity: 1; }

/* misc */
.flexline { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap-tight { display: flex; flex-wrap: wrap; gap: 8px; }
.hr { height: 1px; background: var(--line-soft); margin: 16px 0; border: 0; }
.note-body { font-size: 13px; line-height: 1.6; color: var(--text-2); white-space: pre-wrap; }
.kbd { font-family: var(--mono); font-size: 11px; background: var(--panel-3); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; }
.loading { color: var(--text-3); font-size: 12px; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 8px var(--up); display: inline-block; animation: pulse 2s infinite; }
.dot-live.closed { background: var(--text-3); box-shadow: none; animation: none; }
@keyframes pulse { 50% { opacity: .35; } }

/* ============================================================
   v2 — identity, chat, screenshots
   ============================================================ */

/* ---------------------------------------------------- who is signed in */
.whoami { margin-bottom: 10px; }
.who {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 9px; border: 1px solid var(--line-soft); border-radius: 10px;
  background: var(--panel-2); font-size: 12px;
}
.who-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); flex: none; box-shadow: 0 0 7px var(--up); }
.who-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .linkbtn { margin-left: auto; }

/* ---------------------------------------------------------------- chat */
.chat-card { display: flex; flex-direction: column; height: calc(100vh - 260px); min-height: 420px; }
.chat-log {
  flex: 1; overflow-y: auto; padding: 14px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.msg { max-width: 78%; align-self: flex-start; }
.msg.mine { align-self: flex-end; }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.msg.mine .msg-head { justify-content: flex-end; }
.msg-who { font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.msg.mine .msg-who { color: var(--red-hot); }
.msg-time { font-size: 10px; color: var(--text-3); font-family: var(--mono); }
.msg-del { opacity: 0; transition: .12s; }
.msg:hover .msg-del { opacity: .7; }
.msg-body {
  background: var(--panel-2); border: 1px solid var(--line-soft);
  padding: 9px 13px; border-radius: 12px; border-top-left-radius: 4px;
  font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.msg.mine .msg-body {
  background: linear-gradient(180deg, rgba(225,6,0,.22), rgba(225,6,0,.10));
  border-color: rgba(225,6,0,.35); border-radius: 12px; border-top-right-radius: 4px;
}
.chat-input {
  display: flex; gap: 9px; padding: 13px 16px; border-top: 1px solid var(--line-soft);
}
.chat-input input {
  flex: 1; background: #0b0b0e; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 13px; outline: none; font-size: 13.5px;
}
.chat-input input:focus { border-color: var(--red); }

/* --------------------------------------------------------- screenshots */
.shot-strip { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 11px; }
.shot { position: relative; width: 122px; height: 82px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.shot img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.shot-del {
  position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,.72);
  border-radius: 6px; opacity: 0; transition: .12s;
}
.shot:hover .shot-del { opacity: 1; }
.shot-zone {
  border: 1.6px dashed var(--line); border-radius: 12px; padding: 18px;
  text-align: center; font-size: 12.5px; color: var(--text-3); cursor: pointer;
  transition: .14s; margin-bottom: 6px;
}
.shot-zone:hover, .shot-zone.over { border-color: var(--red); background: rgba(225,6,0,.05); color: var(--text-2); }
.shot-zone.busy { opacity: .5; pointer-events: none; }
.shot-zone b { color: var(--text); }

/* checkbox rows in the admin access list */
[data-hover]:hover { background: var(--panel-2); }
