/* ============================================================================
   How it works — Athrios Value OS operating model (compact console)
   ~1040 wide · ~640 tall · stacked rows: demand IN → 3 layers → value OUT.
   ========================================================================== */
.hiw-wrap { max-width: 1140px; margin: 0 auto; }

.hiw-panel {
  position: relative; background: linear-gradient(180deg, #0b1018, var(--ink-base));
  border: 1px solid var(--line-strong); border-radius: var(--r-xl);
  box-shadow: 0 40px 120px -45px rgba(0,0,0,0.85), 0 0 0 1px rgba(255,255,255,0.02) inset;
  overflow: hidden;
}
.hiw-panel::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.16), transparent); }

/* titlebar */
.hiw-bar { height: 50px; display: flex; align-items: center; gap: 14px; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.015); }
.hiw-bar .mk { width: 22px; height: 22px; }
.hiw-bar .ti { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; color: var(--text-hi); letter-spacing: -0.01em; }
.hiw-bar .sep { width: 1px; height: 18px; background: var(--line); }
.hiw-bar .sub { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-lo); }
.hiw-bar .live { margin-left: auto; display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-lo); }
.hiw-bar .live .d { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 3px var(--ember-tint); }
.hiw-bar .live.proven .d { background: var(--fn-green); box-shadow: 0 0 0 3px var(--fn-green-tint); }
.hiw-replay { width: 30px; height: 30px; border-radius: var(--r-sm); border: 1px solid var(--line); background: transparent; color: var(--text-lo); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--dur) var(--ease); }
.hiw-replay:hover { color: var(--text-hi); border-color: var(--line-strong); background: rgba(255,255,255,0.04); }
.hiw-replay svg { width: 15px; height: 15px; }

/* flow body */
.os-flow { position: relative; padding: 11px clamp(16px,2vw,22px) 13px;
  display: flex; flex-direction: column; gap: 7px;
  background-image: linear-gradient(rgba(255,255,255,0.013) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.013) 1px, transparent 1px);
  background-size: 46px 46px;
}
.dotmk { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dotmk.em { background: var(--ember); box-shadow: 0 0 0 3px var(--ember-tint); }
.dotmk.gr { background: var(--fn-green); box-shadow: 0 0 0 3px var(--fn-green-tint); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: var(--r-full); font-size: 12px; font-weight: 500; border: 1px solid var(--line); background: var(--ink-card); color: var(--text-mid); white-space: nowrap; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.chip.demand { border-color: var(--ember-line); background: var(--ember-tint); color: #ffd9cf; font-size: 11.5px; padding: 5px 11px; }
.chip.exec { border-color: var(--fn-purple-line); background: var(--fn-purple-tint); color: #ddd2ff; }
.chip.more { color: var(--text-lo); border-style: dashed; }

/* input strip */
.os-input { position: relative; display: flex; align-items: center; gap: 14px; padding: 8px 16px; border: 1px solid var(--ember-line); border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(255,74,46,0.06), rgba(255,74,46,0.015)); flex-wrap: wrap; }
.os-inlabel { display: flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ember); white-space: nowrap; }
.os-inchips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.chip.demand.sel { background: var(--ember); color: var(--text-on-ember); border-color: var(--ember); font-weight: 600; box-shadow: 0 6px 18px -8px rgba(255,74,46,0.7); }
.chip.demand.sel .seltag { margin-left: 7px; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
/* selected demand flows into Value Intelligence */
.os-input::after { content: ""; position: absolute; left: 26px; top: 100%; width: 2px; height: 11px; transform: translateX(-50%); background: linear-gradient(var(--ember), transparent); opacity: 0; transition: opacity 0.5s var(--ease); }
.os-input.flowing::after { opacity: 0.7; }

/* layer rows */
.os-row { display: grid; grid-template-columns: 184px 1fr 240px; align-items: center; column-gap: clamp(16px,2vw,26px); padding: 9px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: rgba(255,255,255,0.012); transition: opacity 0.5s var(--ease), border-color 0.5s var(--ease); }
.os-row[data-state="idle"] { opacity: 0.4; border-color: var(--line-subtle); }
.os-row[data-state="done"] { border-color: var(--line-strong); }
.os-row.l2 { background: linear-gradient(180deg, rgba(139,92,246,0.08), rgba(139,92,246,0.02)); border-color: var(--fn-purple-line); box-shadow: 0 22px 56px -32px rgba(139,92,246,0.7); padding: 17px 16px; }
.os-row.l3 { align-items: stretch; }
/* value thread — connectors between the key outputs */
/* value thread — continuous flow into Business Value Out */
.os-row.l1 .os-card, .os-row.l2 .os-card, .os-row.l3 .os-card { position: relative; }
.os-row.l1 .os-card::after, .os-row.l2 .os-card::after, .os-row.l3 .os-card::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 16px; transform: translateX(-50%); opacity: 0; transition: opacity 0.55s var(--ease); pointer-events: none; z-index: 1; }
.os-row.l1 .os-card::after { background: linear-gradient(var(--ember), var(--fn-purple)); box-shadow: 0 0 16px 1.5px rgba(139,92,246,0.65); }
.os-row.l2 .os-card::after { background: linear-gradient(var(--fn-purple), var(--fn-green)); box-shadow: 0 0 16px 1.5px rgba(34,197,94,0.55); }
.os-row.l3 .os-card::after { background: linear-gradient(var(--fn-green), rgba(34,197,94,0.2)); box-shadow: 0 0 16px 1.5px rgba(34,197,94,0.55); }
.os-row.l1[data-state="done"] .os-card::after, .os-row.l2[data-state="done"] .os-card::after, .os-row.l3[data-state="done"] .os-card::after { opacity: 1; }

.os-meta { display: flex; flex-direction: column; gap: 4px; }
.os-kind { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.os-name { font-family: var(--font-display); font-weight: 800; font-size: clamp(16px,1.5vw,20px); color: var(--text-hi); letter-spacing: -0.02em; line-height: 1.08; }
.os-purpose { font-size: 12px; color: var(--text-mid); line-height: 1.4; }

.os-mid { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.os-signals { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-lo); letter-spacing: 0.01em; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.os-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.os-micro { font-size: 10.5px; color: var(--text-faint); font-family: var(--font-mono); letter-spacing: 0.01em; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }

/* output card */
.os-card { display: flex; flex-direction: column; gap: 4px; padding: 15px 18px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.012)); box-shadow: 0 10px 30px -20px rgba(0,0,0,0.7); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.os-card .oc-ey { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.os-card .oc-v { font-family: var(--font-display); font-weight: 800; font-size: clamp(18px,1.8vw,25px); color: var(--text-hi); letter-spacing: -0.022em; line-height: 1.06; }
.os-card .oc-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-lo); letter-spacing: 0.01em; }
/* Layer 02 output — the engine's result, most prominent */
.os-row.l2 .os-card { padding: 18px 20px; box-shadow: 0 18px 48px -20px rgba(139,92,246,0.6); }
.os-row.l2 .os-card .oc-v { font-size: clamp(20px,2.1vw,28px); }
.os-card.em { border-color: var(--ember-line); background: linear-gradient(180deg, rgba(255,74,46,0.13), rgba(255,74,46,0.02)); box-shadow: 0 14px 40px -24px rgba(255,74,46,0.6); }
.os-card.em .oc-v { color: var(--ember); }
.os-card.pu { border-color: var(--fn-purple-line); background: linear-gradient(180deg, rgba(139,92,246,0.13), rgba(139,92,246,0.02)); }
.os-card.pu .oc-v { color: #c9b8ff; }
.os-card.gr { border-color: var(--fn-green-line); background: linear-gradient(180deg, rgba(34,197,94,0.14), rgba(34,197,94,0.03)); box-shadow: 0 14px 40px -24px rgba(34,197,94,0.6); }
.os-card.gr .oc-v { color: var(--fn-green); font-size: clamp(16px,1.55vw,21px); }
.os-row.l3 .os-card { box-shadow: 0 8px 24px -20px rgba(34,197,94,0.5); }

/* layer 03 modules — human review primary, controls/proof secondary */
.os-mods { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 11px; }
.l3mod.human { background: var(--fn-purple-tint); border-color: var(--fn-purple-line); box-shadow: 0 12px 34px -24px rgba(139,92,246,0.6); }
.l3mod { display: flex; flex-direction: column; gap: 6px; padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ink-card); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); min-width: 0; }
.l3mod .lm-head { display: flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 700; font-size: 12.5px; color: var(--text-hi); letter-spacing: -0.01em; }
.l3mod .lm-ico { width: 22px; height: 22px; flex-shrink: 0; border-radius: var(--r-xs); border: 1px solid var(--fn-purple-line); background: var(--fn-purple-tint); color: var(--fn-purple); display: flex; align-items: center; justify-content: center; }
.l3mod .lm-ico svg { width: 13px; height: 13px; }
.l3mod .lm-list, .l3mod .lm-roles { font-family: var(--font-mono); font-size: 11px; color: var(--text-mid); line-height: 1.75; letter-spacing: 0.01em; }
.l3mod .lm-sub { font-family: var(--font-ui); font-size: 11.5px; color: var(--text-mid); line-height: 1.45; }
.l3mod .lm-list .lm-minor { color: var(--text-faint); opacity: 0.7; }
.l3mod .lm-avs { display: flex; gap: 5px; }
.l3mod .lm-av { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--fn-purple); background: linear-gradient(180deg, rgba(139,92,246,0.4), rgba(139,92,246,0.16)); border: 1px solid var(--fn-purple-line); }
.l3mod .lm-av svg { width: 12px; height: 12px; }
.l3mod .lm-av.ok { color: var(--fn-green); background: linear-gradient(180deg, rgba(34,197,94,0.4), rgba(34,197,94,0.16)); border-color: var(--fn-green-line); }
.l3mod .lm-st { align-self: flex-start; margin-top: auto; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); border: 1px solid var(--line); border-radius: var(--r-full); padding: 3px 9px; }
.l3mod .lm-st.on { color: var(--fn-green); border-color: var(--fn-green-line); background: var(--fn-green-tint); }
.l3mod .lm-st.neutral.on { color: var(--text-hi); border-color: var(--line-strong); background: rgba(255,255,255,0.04); }
.l3mod.done { border-color: var(--fn-green-line); }
.l3mod.human { background: var(--fn-purple-tint); border-color: var(--fn-purple-line); }
.l3mod.human.done { background: var(--fn-green-tint); border-color: var(--fn-green-line); }

/* quality gate bar */
.os-gatebar { display: flex; align-items: center; gap: 11px; padding: 9px 13px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--ink-card); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.os-gatebar .gb-ico { display: flex; color: var(--text-lo); flex-shrink: 0; }
.os-gatebar .gb-ico svg { width: 17px; height: 17px; }
.os-gatebar .gb-txt { font-size: 12.5px; font-weight: 600; color: var(--text-mid); }
.os-gatebar .gb-st { margin-left: auto; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-lo); white-space: nowrap; flex-shrink: 0; }
.os-gatebar.pass { border-style: solid; border-color: var(--fn-green-line); background: var(--fn-green-tint); }
.os-gatebar.pass .gb-ico, .os-gatebar.pass .gb-st { color: var(--fn-green); }
.os-gatebar.pass .gb-txt { color: var(--text-hi); }

/* output bar — executive result (single line) */
.os-outbar { position: relative; display: flex; align-items: center; gap: 0; padding: 16px 20px; border: 1px solid var(--fn-green-line); border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(34,197,94,0.13), rgba(34,197,94,0.035)); box-shadow: 0 22px 64px -32px rgba(34,197,94,0.65), 0 0 0 1px rgba(34,197,94,0.08) inset; flex-wrap: nowrap; opacity: 0.5; transition: opacity 0.6s var(--ease); }
.os-outbar.on { opacity: 1; }
.os-outbar .ob-label { display: flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fn-green); white-space: nowrap; padding-right: 18px; margin-right: 4px; border-right: 1px solid var(--fn-green-line); flex-shrink: 0; }
.os-outbar .ob-proof { display: flex; flex-wrap: nowrap; flex: 1; min-width: 0; }
.ob-pi { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: clamp(13px,1.25vw,16px); color: var(--text-hi); letter-spacing: -0.015em; padding: 0 clamp(12px,1.4vw,20px); white-space: nowrap; transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.ob-pi + .ob-pi { border-left: 1px solid var(--fn-green-line); }
.ob-pi svg { width: 14px; height: 14px; color: var(--fn-green); flex-shrink: 0; }
@media (max-width: 760px){ .os-outbar, .os-outbar .ob-proof { flex-wrap: wrap; } }

/* final line — the seal of the model */
.hiw-final { position: relative; display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; padding-top: 18px; transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.hiw-final::before { content: ""; position: absolute; top: -2px; left: 50%; transform: translateX(-50%); width: 2px; height: 16px; background: linear-gradient(var(--fn-green), transparent); box-shadow: 0 0 12px 1px rgba(34,197,94,0.5); border-radius: 2px; }
.hiw-final span { font-family: var(--font-display); font-weight: 800; font-size: clamp(17px,1.9vw,24px); letter-spacing: -0.015em; color: var(--fn-green); }
.hiw-final .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); }

/* responsive */
@media (max-width: 820px){
  .os-row { grid-template-columns: 1fr; row-gap: 12px; }
  .os-mods { grid-template-columns: 1fr; }
  .os-input { gap: 10px; }
}
