.app-tab-panel,
.next-home-row,
.next-home-row > *,
.next-hourly-card,
.next-hourly-wrap {
  min-width: 0;
  max-width: 100%;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  padding: 5px 4px max(5px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(0, 174, 255, 0.65);
  background: rgba(2, 11, 26, 0.96);
  box-shadow: 0 -8px 22px rgba(0, 93, 176, 0.18);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 44px;
  min-height: 44px;
  padding: 2px 0;
  color: var(--muted);
  font-size: 9px;
  text-decoration: none;
}

.bottom-nav-item img {
  width: 27px;
  height: 26px;
  object-fit: contain;
}

.bottom-nav-item.is-active {
  color: #67caff;
  text-shadow: 0 0 8px rgba(0, 174, 255, 0.5);
}

.is-public-mode .bottom-nav {
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
}

.footer {
  padding-bottom: 78px;
}

.next-global-banner {
  width: min(1180px, calc(100% - 24px));
  margin: 10px auto 0;
  padding: 10px 14px;
  border: 1px solid #9c7f3e;
  border-radius: var(--radius-sm);
  background: rgba(92, 67, 18, 0.9);
  color: #fff1bd;
  font-size: 14px;
  font-weight: 700;
}

.next-engine-pill.is-running {
  border-color: var(--green);
  color: var(--green);
}

.next-engine-pill.is-stopped,
.next-engine-pill.is-error {
  border-color: var(--red);
  color: var(--red);
}

.next-home-row {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
}

.is-public-mode #next-system-status {
  grid-row: 1;
  grid-column: 1;
}

.is-public-mode #next-learning-card {
  grid-row: 2;
  grid-column: 1;
}

.is-public-mode #next-flow-profile {
  grid-row: 1 / span 2;
  grid-column: 2;
}

.next-learning-card {
  min-width: 0;
  overflow: hidden;
}

.next-learning-lead {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.next-learning-section {
  min-width: 0;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.next-learning-title {
  margin: 0 0 6px;
  color: #b8dced;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.next-learning-activity,
.next-learning-counts,
.next-learning-empty {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.55;
}

.next-learning-activity { color: #e8f8ff; font-weight: 700; }
.next-learning-counts,
.next-learning-empty { color: var(--muted); }

.next-learning-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  min-width: 0;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
}

.next-learning-row:last-child { border-bottom: 0; }

.next-learning-main {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  gap: 3px 6px;
  align-items: baseline;
  overflow-wrap: anywhere;
}

.next-learning-symbol,
.next-learning-time { color: var(--muted); }
.next-learning-value { color: #d6edf7; text-align: right; overflow-wrap: anywhere; }
.next-learning-change { min-width: 20px; color: var(--muted); font-weight: 900; }
.next-learning-change.is-up,
.next-learning-pnl.is-positive { color: #4ce7bd; }
.next-learning-change.is-down,
.next-learning-pnl.is-negative { color: #ff758c; }
.next-learning-current { color: #ffd981; }
.next-learning-origin,
.next-learning-samples { color: var(--muted); }
.next-learning-origin.is-learned { color: #ff4d4d; font-weight: 800; }
.next-learning-candidate { grid-column: 1 / -1; }

.next-learning-switch {
  grid-column: 1 / -1;
  color: #c9a7ff;
  font-size: 11px;
}

.next-panel-message {
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
}

.next-panel-message.is-error {
  border-color: var(--red);
  color: #ffb6c0;
}

.next-kv {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.next-kv span {
  color: var(--muted);
}

.next-kv strong {
  overflow-wrap: anywhere;
  text-align: right;
}

.next-symbol-list,
.next-flow-grid,
.next-selection-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.next-symbol-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.next-symbol-card,
.next-flow-card,
.next-ea-symbol {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(4, 15, 28, 0.42);
}

.next-pair {
  color: var(--cyan);
}

.next-legend,
.next-restrictions,
.next-ea-symbol p {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.next-flow-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.next-flow-card h3,
.next-ea-symbol h4,
.next-ea-symbol p {
  margin: 4px 0;
}

.next-flow-summary {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
  gap: 3px 8px;
  align-items: center;
}

.next-flow-summary strong {
  overflow-wrap: anywhere;
  text-align: right;
}

.next-flow-summary span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.next-symbol-card {
  display: grid;
  gap: 4px;
}

.next-symbol-summary {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.next-spread {
  font-size: 12px;
  font-weight: 700;
}

.next-spread.is-ok { color: var(--green); }
.next-spread.is-alert { color: var(--yellow); }

.next-room-head { align-items: center; }

.next-room-state {
  margin-left: auto;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.next-room-state.is-running { border-color: var(--green); color: var(--green); }
.next-room-state.is-stopped { border-color: var(--red); color: var(--red); }

.next-room-lead,
.next-room-note {
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.next-room-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.next-room-item {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(4, 15, 28, 0.42);
  font-size: 12px;
}

.next-room-item span { color: var(--muted); }
.next-room-item strong { overflow-wrap: anywhere; }

.next-ea-side { margin: 5px 0; }
.next-ea-policy { color: var(--yellow); }

.next-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.next-filters label {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.next-filters select {
  min-height: 44px;
  max-width: 100%;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
}

.next-ea-card {
  min-width: 0;
}

.next-ea-summary {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 12px;
}

.next-ea-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.next-ea-detail {
  max-height: 65dvh;
  overflow: auto;
}

.next-reason {
  color: var(--muted);
  font-size: 12px;
}

.next-reason summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.next-restriction-other {
  color: var(--muted);
  font-size: 12px;
}

.next-restriction-other summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.next-selection-policy {
  margin: 6px 0;
  color: var(--muted);
}

.next-selection-demo-note {
  margin: 8px 0 0;
  color: #b8dced;
  font-size: 12px;
  line-height: 1.45;
}

.next-selection-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.orch-ea-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(4, 15, 28, 0.42);
}

.orch-ea-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 6px;
}

.orch-ea-name { min-width: 0; overflow-wrap: anywhere; }
.orch-ea-rank { flex: 0 0 auto; color: #60e1ff; font-size: 12px; font-weight: 800; }
.orch-ea-rank.is-top { color: #ff4d4d; }
.orch-ea-symbol { color: var(--muted); font-size: 12px; text-align: right; }

.orch-ea-judgement {
  grid-column: 1 / -1;
  color: #c3d4e2;
  font-size: 13px;
}

.orch-ea-judgement.is-top { color: #ffd538; }
.orch-ea-judgement.is-ev_ok { color: #4ce7bd; }
.orch-ea-judgement.is-explore { color: #65c8ff; }
.orch-ea-judgement.is-explore_used { color: #c9a7ff; }
.orch-ea-judgement.is-none { color: var(--muted); }

.orch-ea-demo-meta { color: #b8dced; font-size: 12px; }
.orch-ea-card .next-restrictions,
.orch-ea-card .next-restriction-other { grid-column: 1 / -1; }

.next-hourly-wrap {
  max-height: 62dvh;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

#next-hourly-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

#next-hourly-table th,
#next-hourly-table td {
  min-width: 60px;
  padding: 5px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  text-align: center;
  white-space: nowrap;
}

#next-hourly-table th {
  position: sticky;
  z-index: 3;
  top: 0;
  background: #173653;
}

#next-hourly-table th:first-child,
#next-hourly-table td:first-child {
  position: sticky;
  left: 0;
  width: 112px;
  min-width: 112px;
  max-width: 112px;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

#next-hourly-table tbody td:first-child {
  z-index: 2;
  background: #071727;
}

#next-hourly-table th:first-child {
  z-index: 4;
  background: #173653;
}

.next-hourly-name small,
.next-hourly-cell small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.next-hourly-cell {
  width: 100%;
  min-width: 44px;
  min-height: 44px;
  padding: 2px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

#next-hourly-table td.is-positive {
  background: rgba(36, 135, 94, 0.45);
}

#next-hourly-table td.is-negative {
  background: rgba(145, 46, 65, 0.42);
}

#next-hourly-table td.is-neutral {
  background: rgba(71, 100, 129, 0.48);
}

#next-hourly-table .is-current-hour {
  box-shadow: inset 0 0 0 2px var(--cyan);
}

.next-hourly-detail {
  min-height: 44px;
  margin-top: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* SHADOW EA x symbol matrices: preserve readable columns and scroll inside the card. */
.ea-shadow-stats-row,
#ea-shadow-stats-card,
.shadow-stats-block,
.shadow-matrix-scroll-wrap {
  min-width: 0;
  max-width: 100%;
}

.shadow-matrix-scroll-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
}

.shadow-matrix-table {
  width: max-content;
  min-width: max-content;
  table-layout: auto;
  transform: none;
  zoom: 1;
}

.shadow-matrix-table .shadow-ea-corner-head,
.shadow-matrix-table .shadow-ea-head-col {
  box-sizing: border-box;
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  white-space: nowrap;
}

.shadow-matrix-table .shadow-ea-name-wrap,
.shadow-matrix-table .shadow-ea-name-text,
.shadow-matrix-table .shadow-sym-head,
.shadow-matrix-table .shadow-stat-matrix-cell,
.shadow-matrix-table .stat-cell-box,
.shadow-matrix-table .stat-cell-top,
.shadow-matrix-table .stat-cell-bottom {
  white-space: nowrap;
}

.shadow-matrix-table .shadow-ea-name-text,
.shadow-matrix-table .shadow-sym-head,
.shadow-matrix-table .stat-cell-top {
  font-size: 12px;
}

.shadow-matrix-table .shadow-sym-head,
.shadow-matrix-table .shadow-stat-matrix-cell {
  box-sizing: border-box;
  width: 104px;
  min-width: 104px;
  max-width: 104px;
}

.shadow-matrix-table .stat-cell-box {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.shadow-matrix-table .stat-cell-top,
.shadow-matrix-table .stat-cell-bottom {
  max-width: 100%;
}

.shadow-matrix-table .stat-cell-bottom,
.shadow-matrix-table .sc-n {
  font-size: 10px;
}

.next-monitor-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.next-monitor-line {
  display: grid;
  gap: 3px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line, #d7dce2);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.next-monitor-details {
  color: var(--dim, #8795a8);
  font-size: 11px;
}

.next-monitor-details summary {
  cursor: pointer;
  color: var(--muted, #aab8c8);
}

.next-monitor-raw {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

/* BRIEF-070D: public home is read at a glance, with OWL and EA characters leading. */
.is-public-mode [data-app-panel="home"] {
  gap: 12px;
}

.is-public-mode [data-app-panel="home"] .card {
  border-color: rgba(0, 195, 255, 0.72);
  background:
    linear-gradient(145deg, rgba(6, 38, 72, 0.98), rgba(2, 12, 29, 0.98));
  box-shadow: inset 0 0 28px rgba(0, 150, 255, 0.08), 0 0 15px rgba(0, 174, 255, 0.13);
}

.is-public-mode .public-owl-hero {
  display: grid;
  grid-template-columns: minmax(135px, 0.36fr) minmax(0, 0.64fr);
  gap: 14px;
  min-height: 218px;
  padding: 10px 14px 12px;
  overflow: hidden;
}

.public-owl-portrait {
  position: relative;
  display: grid;
  align-content: end;
  justify-items: center;
  min-width: 0;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 58%, rgba(0, 211, 255, 0.24), transparent 62%);
}

.public-owl-portrait::after {
  position: absolute;
  right: 6%;
  bottom: 9px;
  left: 6%;
  height: 2px;
  content: "";
  background: #12caff;
  box-shadow: 0 0 12px #12caff;
}

.public-owl-portrait img {
  width: min(100%, 184px);
  height: 170px;
  object-fit: contain;
  filter: drop-shadow(0 0 13px rgba(0, 198, 255, 0.48));
}

.public-owl-portrait strong {
  position: relative;
  z-index: 1;
  margin-top: -22px;
  padding: 3px 10px;
  border: 1px solid #16c8ff;
  border-radius: 999px;
  background: rgba(2, 17, 42, 0.94);
  color: #bdeeff;
  font-size: 12px;
}

.public-owl-command {
  align-self: center;
  min-width: 0;
}

.public-command-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  color: #f3fbff;
  font-size: clamp(18px, 3vw, 28px);
}

.public-owl-speech {
  position: relative;
  margin: 0 0 8px;
  padding: 8px 11px;
  border: 1px solid rgba(92, 218, 255, 0.6);
  border-radius: 12px;
  background: rgba(7, 31, 59, 0.94);
  color: #f2fbff;
  font-size: 15px;
  line-height: 1.45;
}

.public-owl-speech::before {
  position: absolute;
  top: 12px;
  left: -7px;
  width: 12px;
  height: 12px;
  border-bottom: 1px solid rgba(92, 218, 255, 0.6);
  border-left: 1px solid rgba(92, 218, 255, 0.6);
  content: "";
  background: rgba(7, 31, 59, 0.94);
  transform: rotate(45deg);
}

.public-owl-history {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(92, 218, 255, 0.2);
  color: var(--muted);
  font-size: 11px;
}

.public-owl-history-title { color: #bdeeff; font-size: 11px; }
.public-owl-history p { margin: 0; line-height: 1.4; overflow-wrap: anywhere; }

.public-important-events {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(92, 218, 255, 0.32);
  font-size: 11px;
}

.public-important-title { color: #bdeeff; font-size: 12px; }
.public-important-current,
.public-important-unavailable {
  margin: 0;
  color: #ff4d4d;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.public-important-empty { margin: 0; color: var(--muted); }
.public-important-list { display: grid; gap: 6px; min-width: 0; }

.public-important-event {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(92, 218, 255, 0.2);
  border-radius: 8px;
  background: rgba(5, 25, 49, 0.64);
}

.public-important-event.is-restricted {
  border-color: rgba(255, 77, 77, 0.75);
  box-shadow: inset 0 0 12px rgba(255, 77, 77, 0.08);
}

.public-important-event.is-done { opacity: 0.7; }

.public-important-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 6px;
  min-width: 0;
}

.public-important-time { flex: 0 0 auto; color: #f2d377; font-weight: 800; }
.public-important-name { min-width: 0; color: #f2fbff; overflow-wrap: anywhere; }
.public-important-currency,
.public-important-badge {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.public-important-currency { background: rgba(18, 202, 255, 0.14); color: #8ceaff; }
.public-important-badge { background: rgba(255, 77, 77, 0.16); color: #ff4d4d; }
.public-important-restriction,
.public-important-symbols,
.public-important-rule { margin: 0; overflow-wrap: anywhere; }
.public-important-restriction { color: #f2d377; }
.public-important-symbols { color: #c3d4e2; }
.public-important-rule { color: var(--muted); font-size: 10px; line-height: 1.4; }

.public-live-dot {
  color: var(--green);
  font-size: 13px;
  text-shadow: 0 0 10px var(--green);
}

.public-visual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.public-visual-stat {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  min-height: 74px;
  padding: 8px;
  border: 1px solid rgba(0, 184, 255, 0.48);
  border-radius: 10px;
  background: rgba(2, 18, 40, 0.86);
}

.public-visual-icon {
  color: #4bd3ff;
  font-size: 27px;
  font-weight: 900;
  text-align: center;
  text-shadow: 0 0 10px currentColor;
}

.public-visual-copy {
  display: grid;
  min-width: 0;
}

.public-visual-copy small,
.public-section-head span,
.public-flow-head span {
  color: var(--muted);
  font-size: 10px;
}

.public-visual-copy strong {
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 14px;
}

.public-visual-stat.is-side .public-visual-icon { color: #38e4c1; }
.public-visual-stat.is-go { border-color: rgba(32, 239, 157, 0.7); }
.public-visual-stat.is-go .public-visual-icon,
.public-visual-stat.is-go strong { color: var(--green); }
.public-visual-stat.is-wait .public-visual-icon,
.public-visual-stat.is-wait strong { color: var(--yellow); }

.is-public-mode .next-home-row {
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 12px;
}

.is-public-mode .public-ea-team,
.is-public-mode .public-flow-profile {
  padding: 12px;
}

.public-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.public-ea-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.public-ea-card {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  min-height: 72px;
  padding: 5px 7px 5px 2px;
  overflow: hidden;
  border: 1px solid rgba(0, 174, 255, 0.36);
  border-radius: 9px;
  background: rgba(3, 20, 43, 0.78);
}

.public-ea-character {
  width: 54px;
  height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 0 7px rgba(0, 190, 255, 0.35));
}

.public-ea-copy {
  display: grid;
  min-width: 0;
}

.public-ea-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
}

.public-ea-copy .public-ea-rank {
  color: #ff4d4d;
  font-weight: 800;
}

.public-ea-copy .public-ea-expected { color: #b8dced; }

.public-ea-copy strong {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-ea-copy span {
  color: var(--muted);
  font-size: 10px;
}

.public-ea-copy .is-ready { color: var(--green); }
.public-ea-empty { color: var(--muted); font-size: 12px; }

.public-flow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.public-flow-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(0, 185, 255, 0.55);
  border-radius: 11px;
  background:
    radial-gradient(circle at 70% 15%, rgba(0, 121, 255, 0.14), transparent 42%),
    rgba(1, 15, 34, 0.9);
}

.public-flow-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.public-flow-pair {
  color: #60e1ff;
  font-size: 16px;
  letter-spacing: 0.04em;
}

.public-flow-quote {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(0, 174, 255, 0.34);
  border-radius: 8px;
}

.public-flow-quote .public-diagram-metric {
  grid-template-columns: 16px minmax(0, 1fr);
  padding: 4px;
  border-right: 1px solid rgba(0, 174, 255, 0.28);
  border-bottom: 0;
}

.public-flow-quote .public-diagram-metric:last-child { border-right: 0; }

.public-flow-quote .public-diagram-icon { font-size: 11px; }
.public-flow-quote .public-diagram-metric strong { font-size: 10px; }

.public-flow-chain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 0;
}

.public-flow-step {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.public-flow-step small {
  color: var(--muted);
  font-size: 8px;
}

.public-flow-node {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 10px;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 0 10px currentColor, inset 0 0 10px rgba(255, 255, 255, 0.06);
}

.public-flow-node.is-up { color: #09d4ff; }
.public-flow-node.is-down { color: #ff4f72; }
.public-flow-node.is-balance { color: #ffd538; }
.public-flow-node.is-transition { color: #ce67ff; }
.public-flow-node.is-unknown { color: #6d89a7; }
.public-flow-arrow { color: #50d8ff; font-size: 25px; font-weight: 900; }

.public-diagram-metrics {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid rgba(0, 174, 255, 0.34);
  border-radius: 8px;
  overflow: hidden;
}

.public-diagram-metric {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  padding: 6px;
  border-bottom: 1px solid rgba(0, 174, 255, 0.28);
}

.public-diagram-metric:last-child { border: 0; }
.public-diagram-icon { grid-row: 1 / 3; color: #25d8ff; font-size: 18px; font-weight: 900; }
.public-diagram-metric small { color: var(--muted); font-size: 9px; }
.public-diagram-metric strong { overflow-wrap: anywhere; font-size: 11px; line-height: 1.2; }
.public-diagram-metric.is-side strong { color: #4ce7bd; }
.public-diagram-metric.is-trend strong { color: #f2d377; font-size: 16px; }
.public-trend-secondary { grid-column: 2; color: var(--muted); font-size: 10px; }
.public-diagram-metric.is-location strong { color: #c9a7ff; }

.public-flow-diagram {
  display: grid;
  grid-template-columns: minmax(92px, 0.72fr) minmax(150px, 1.28fr);
  gap: 7px;
}

.public-va-diagram {
  position: relative;
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  min-height: 116px;
  padding: 7px 7px 23px 38px;
  border: 1px solid rgba(0, 212, 255, 0.48);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 73, 116, 0.08), rgba(0, 211, 255, 0.08));
}

.public-va-level {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 2px 5px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.3);
  font-size: 9px;
}

.public-va-level.is-vah strong { color: #ff6384; }
.public-va-level.is-poc strong { color: #3bcdff; }
.public-va-level.is-val strong { color: #42e6ca; }

.public-va-current {
  position: absolute;
  left: 4px;
  z-index: 1;
  width: 31px;
  padding: 2px;
  border: 1px solid #fff;
  border-radius: 999px;
  background: #ff416d;
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 0 8px #ff416d;
  transform: translateY(-50%);
  transition: top 220ms ease;
}

.public-va-diagram.is-above .public-va-current { top: 13%; }
.public-va-diagram.is-inside .public-va-current { top: 48%; }
.public-va-diagram.is-below .public-va-current { top: 78%; }
.public-va-diagram.is-unknown .public-va-current { top: 48%; background: #607993; box-shadow: none; }

.public-va-relation {
  position: absolute;
  right: 5px;
  bottom: 4px;
  left: 5px;
  color: #c9a7ff;
  font-size: 9px;
  font-weight: 800;
  text-align: right;
}

.public-flow-card.is-above { border-top-color: #ff6384; }
.public-flow-card.is-inside { border-top-color: #ffd538; }
.public-flow-card.is-below { border-top-color: #42e6ca; }

.public-flow-summary {
  margin: 7px 0 0;
  overflow: hidden;
  color: #d9f7ff;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 699px) {
  .is-public-mode .public-owl-hero {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 8px;
    min-height: 198px;
    padding: 8px;
  }

  .public-owl-portrait img { height: 148px; }
  .public-owl-portrait strong { padding: 2px 7px; font-size: 10px; }
  .public-command-head { margin-bottom: 7px; font-size: 16px; }
  .public-owl-speech { margin-bottom: 6px; padding: 6px 8px; font-size: 12px; }
  .public-owl-history { gap: 3px; padding-top: 6px; font-size: 10px; }
  .public-important-events { gap: 5px; margin-top: 6px; padding-top: 6px; font-size: 10px; }
  .public-important-title { font-size: 11px; }
  .public-important-event { padding: 5px 6px; }
  .public-important-rule { font-size: 9px; }
  .public-visual-grid { grid-template-columns: 1fr; gap: 5px; }
  .public-visual-stat { grid-template-columns: 29px minmax(0, 1fr); min-height: 44px; padding: 4px 6px; }
  .public-visual-icon { font-size: 21px; }
  .public-visual-copy { grid-template-columns: 67px minmax(0, 1fr); align-items: center; }
  .public-visual-copy strong { font-size: 13px; }
  .is-public-mode .next-home-row { grid-template-columns: 1fr; }
  .public-ea-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .public-ea-card { display: grid; grid-template-columns: 1fr; justify-items: center; min-height: 92px; padding: 3px; }
  .public-ea-character { width: 58px; height: 58px; }
  .public-ea-copy { width: 100%; text-align: center; }
  .public-ea-copy strong { font-size: 9px; }
  .public-ea-copy span { font-size: 9px; }
  .public-flow-grid {
    grid-template-columns: 1fr;
  }
  .public-diagram-metric { grid-template-columns: 21px minmax(0, 1fr); }
  .public-flow-head { grid-template-columns: 1fr; }
  .public-flow-pair { text-align: center; }
  .public-flow-quote .public-diagram-metric { grid-template-columns: 14px minmax(0, 1fr); }
  .public-flow-diagram { grid-template-columns: 92px minmax(0, 1fr); }
}

@media (max-width: 699px) {
  .next-home-row,
  .next-monitor-row,
  .next-flow-grid,
  .next-selection-list,
  .next-symbol-list {
    grid-template-columns: 1fr;
  }

  .next-room-grid { grid-template-columns: 1fr; }

  .is-public-mode #next-system-status,
  .is-public-mode #next-learning-card,
  .is-public-mode #next-flow-profile {
    grid-row: auto;
    grid-column: auto;
  }

  .next-learning-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .next-learning-value { text-align: left; }

  .next-kv {
    grid-template-columns: minmax(90px, 0.8fr) minmax(0, 1.2fr);
  }

  .bottom-nav {
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
    overflow-x: auto;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav-item {
    min-width: 44px;
    min-height: 44px;
  }

  .bottom-nav-item span {
    font-size: 9px;
  }

  .next-filters label {
    flex: 1 1 92px;
  }

  .next-flow-card {
    cursor: pointer;
  }

  .next-flow-detail {
    display: none;
  }

  .next-flow-card.is-expanded .next-flow-detail {
    display: block;
  }

  /* The VPS public home keeps every BRIEF-070 summary visible without
     inheriting the taller single-column layout used by the home monitor. */
  .is-public-mode .next-flow-grid,
  .is-public-mode .next-room-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 359px) {
  .is-public-mode #next-system-status .next-kv:nth-of-type(n + 8),
  .is-public-mode .next-room-note {
    display: none;
  }
}

@media (max-width: 430px) {
  .next-hourly-card .next-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .next-hourly-card .next-filters label {
    width: auto;
    min-width: 0;
  }

  .next-hourly-card .next-filters label:first-child {
    grid-column: 1 / -1;
  }

  .next-hourly-card .next-filters select {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 359px) {
  .bottom-nav-item img {
    width: 21px;
    height: 21px;
  }

  .bottom-nav-item span {
    font-size: 8px;
    letter-spacing: -0.04em;
  }
}
