/* css/expand2.css — Cortex depth module
   OWNS: History / Brains / Templates surfaces.
   Reuses app.css shared components + tokens. Calm dark bioluminescent. */

/* ===== History ===== */
.hist {
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  height: 100%;
  overflow: auto;
}

.hist-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-2);
}

.hist-stat {
  background: var(--bg-3);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  padding: var(--s-3);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hist-stat .n {
  font-size: var(--fs-h3);
  color: var(--t-1);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.hist-stat .l {
  font-size: var(--fs-fine);
  color: var(--t-3);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.hist-spark {
  width: 100%;
  height: 40px;
  display: block;
}

.hist-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.hist-day {
  font-size: var(--fs-fine);
  color: var(--t-3);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-top: var(--s-2);
}

.hist-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 6px 0;
  border-bottom: 1px solid var(--stroke);
}
.hist-row:last-child { border-bottom: 0; }

.hist-verb {
  font-size: var(--fs-fine);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--bg-3);
  border: 1px solid var(--stroke);
  color: var(--acc-2);
  white-space: nowrap;
}

.hist-sum {
  flex: 1;
  font-size: var(--fs-cap);
  color: var(--t-2);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hist-time {
  font-size: var(--fs-fine);
  color: var(--t-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ===== Brains ===== */
.brain-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin: var(--s-3) 0;
}

.brain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: var(--s-3);
  background: var(--bg-3);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  transition: border-color .15s var(--ease);
}
.brain-row.is-current {
  border-color: var(--acc);
  box-shadow: var(--glow);
}

.brain-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--fs-cap);
  color: var(--t-1);
  min-width: 0;
}
.brain-meta .sub {
  font-size: var(--fs-fine);
  color: var(--t-3);
  overflow: hidden;
  text-overflow: ellipsis;
}

.brain-acts {
  display: flex;
  gap: var(--s-1);
  flex-shrink: 0;
}

/* ===== Templates ===== */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
}

.tpl-card {
  background: var(--bg-3);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  cursor: pointer;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
  text-align: center;
}
.tpl-card:hover {
  border-color: var(--acc);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.tpl-icon {
  font-size: 32px;
  line-height: 1;
}

.tpl-name {
  font-weight: 700;
  color: var(--t-1);
  margin-top: var(--s-2);
}

.tpl-desc {
  font-size: var(--fs-fine);
  color: var(--t-3);
  margin-top: 4px;
}

@media (max-width: 560px) {
  .tpl-grid { grid-template-columns: 1fr; }
  .hist-stats { grid-template-columns: repeat(2, 1fr); }
}
