/* Accumulation phase panel. Namespaced .ph-* — cannot collide with style.css,
 * theme-v4.css or cas.css. Colour means one thing: green = accumulation
 * (the phase we act on), amber = markup (context only, tested as NOT an edge). */
.phase-card { display: flex; flex-direction: column; gap: 10px; }
.ph-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-head .label { flex: 1 1 auto; }
.ph-meta { font-size: 10px; color: var(--text-dimmer); font-variant-numeric: tabular-nums; }

.ph-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; }
.ph-cell { background: var(--bg-card); padding: 6px 8px; min-width: 0; }
.ph-k { font-size: 9px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-dimmer); white-space: nowrap; }
.ph-v { font-size: 14px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.ph-note { font-size: 9px; color: var(--text-dimmer); line-height: 1.4; }

.ph-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ph-tab { background: var(--bg-card-alt); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 6px; padding: 4px 9px; font-size: 10px;
  font-weight: 600; cursor: pointer; }
.ph-tab.active { color: var(--text); border-color: #14432f; background: #0d2119; }
.ph-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ph-cohorts { margin-bottom: 6px; }
.ph-cohort { background: var(--bg-card-alt); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 6px; padding: 4px 9px; font-size: 10px;
  font-weight: 600; cursor: pointer; }
.ph-cohort.active { color: var(--text); border-color: #14432f; background: #0d2119; }
.ph-cohort:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.ph-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.ph-t { width: 100%; border-collapse: collapse; font-size: 11px;
  font-variant-numeric: tabular-nums; }
table.ph-t th { font-size: 9px; letter-spacing: .05em; text-transform: uppercase;
  font-weight: 600; color: var(--text-dimmer); text-align: right; padding: 3px 5px;
  border-bottom: 1px solid var(--border); white-space: nowrap; }
table.ph-t th:first-child, table.ph-t td:first-child { text-align: left; }
table.ph-t td { padding: 4px 5px; text-align: right; color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,.04); white-space: nowrap; }
table.ph-t tr:last-child td { border-bottom: 0; }
.ph-num { font-variant-numeric: tabular-nums; }
.ph-strong { font-weight: 700; }
.ph-dim { color: var(--text-dimmer); }
.ph-sym { font-weight: 600; }
.ph-uni { font-size: 8px; color: var(--text-dimmer); margin-left: 4px;
  border: 1px solid var(--border); border-radius: 3px; padding: 0 3px; }
.ph-up { color: var(--green); } .ph-dn { color: var(--red); }

.ph-tag { font-size: 8px; font-weight: 700; letter-spacing: .04em; padding: 1px 5px;
  border-radius: 999px; border: 1px solid var(--border); color: var(--text-dim); }
.ph-tag-accumulation { color: #10b981; border-color: #14432f; background: #0d2119; }
.ph-tag-markup { color: #f59e0b; border-color: #4a3410; background: #241a06; }
.ph-tag-distribution, .ph-tag-markdown { color: #ef4444; border-color: #4a1414; }

/* base-range bar: fill shows where price sits inside its own base */
.ph-base { position: relative; height: 16px; min-width: 120px; border-radius: 4px;
  background: var(--bg-card-alt); border: 1px solid var(--border); overflow: hidden; }
.ph-base-fill { position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(16,185,129,.22); }
.ph-base-txt { position: relative; font-size: 9px; color: var(--text-dim);
  line-height: 16px; padding-left: 5px; }

.ph-empty { font-size: 11px; color: var(--text-dimmer); padding: 14px 4px;
  text-align: center; line-height: 1.5; }
.ph-foot { font-size: 9px; color: var(--text-dimmer); line-height: 1.45;
  border-top: 1px solid var(--border); padding-top: 6px; }
@media (max-width: 560px) { .ph-strip { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* sortable headers */
table.ph-t th.ph-sortable { cursor: pointer; user-select: none; }
table.ph-t th.ph-sortable:hover { color: var(--text-dim); }
table.ph-t th.ph-sorted { color: var(--accent); }
table.ph-t th.ph-sortable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* phase filter chips */
.ph-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 2px; }
.ph-chip { background: var(--bg-card-alt); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 999px; padding: 3px 9px; font-size: 10px;
  font-weight: 600; cursor: pointer; white-space: nowrap; }
.ph-chip .ph-chip-n { color: var(--text-dimmer); font-weight: 500; margin-left: 2px; }
.ph-chip.active { color: var(--text); border-color: var(--accent); }
.ph-chip.active.ph-chip-accumulation { color: #10b981; border-color: #14432f; background: #0d2119; }
.ph-chip.active.ph-chip-markup { color: #f59e0b; border-color: #4a3410; background: #241a06; }
.ph-chip.active.ph-chip-distribution,
.ph-chip.active.ph-chip-markdown { color: #ef4444; border-color: #4a1414; }
.ph-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* a base that has held long enough to clear the maturity gate */
.ph-mature { color: var(--green); font-weight: 700; }
