/* Card-specific styles for the "operator" harbor course (class prefix .hb-operator-).
 * Kubernetes objects are cargo crates on the sea: a cube, the object name and a few chips. The Database CR
 * is a paper manifest; code cards are paper tickets; the run trace is the harbour log. */
.hb-operator { min-width:0; }
.hb-operator .hb-panels { grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); }
.hb-operator .hb-yaml { margin-top:0; }

/* Crates: one object each. Ghost = desired but absent; gone = deleted; fresh = just changed. */
.hb-operator-crate { display:flex; align-items:center; gap:8px; min-width:0; padding:6px 10px 6px 6px; border:2px solid #b59c61; border-radius:12px; background:linear-gradient(#fff7d8,#f5e5b6); box-shadow:0 3px 0 #ab905b; color:#4b553d; transition:opacity .3s,filter .3s; }
.hb-operator-crate>div { min-width:0; }
.hb-operator-crate b { display:block; font:800 12px var(--mono); color:#3f4a38; overflow-wrap:anywhere; }
.hb-operator-crate-cube { flex-shrink:0; width:30px; height:34px; display:grid; place-items:center; }
.hb-operator-crate-cube svg { width:30px; height:34px; }
.hb-operator-chips { display:flex; flex-wrap:wrap; gap:3px; margin-top:3px; }
.hb-operator-chips .hb-chip { font-size:10px; padding:0 5px; white-space:normal; overflow-wrap:anywhere; }
.hb-operator-crate.ghost { border-style:dashed; border-color:#a8b5a8; background:#fffdf4; box-shadow:none; }
.hb-operator-crate.ghost .hb-operator-crate-cube { opacity:.45; }
.hb-operator-crate.ghost b { color:#6a7a74; }
.hb-operator-crate.gone { opacity:.6; filter:grayscale(.7); border-style:dashed; box-shadow:none; }
.hb-operator-crate.gone b { text-decoration:line-through; }
.hb-operator-crate.fresh .hb-operator-crate-cube svg { animation:hb-drop .65s cubic-bezier(.2,.8,.3,1) both; }
.hb-operator-crate.fresh { border-color:#a98048; background:linear-gradient(#fff3cf,#ffe6a8); }
.hb-operator-crate.changed { animation:hb-pulse .5s ease-in-out 2; }
.hb-operator-crate.empty { border:2px dashed #b4c2b0; background:#fffdf4; box-shadow:none; min-height:46px; }
.hb-operator-crate.empty .hb-operator-crate-cube { border:2px dashed #c3cdbd; border-radius:7px; width:24px; height:26px; margin:0 3px; }
.hb-operator-crate.empty b { font:700 11px var(--sans); color:#7a8a84; }
.hb-operator-crate.small { padding:4px 8px 4px 4px; gap:6px; }
.hb-operator-crate.small .hb-operator-crate-cube,.hb-operator-crate.small .hb-operator-crate-cube svg { width:24px; height:27px; }
.hb-operator-crate.small b { font-size:11px; }

/* Diff board: one paper card per object, desired → actual, then the action. */
.hb-operator-top { margin-top:6px; }
.hb-operator-objs { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); gap:14px; }
.hb-operator-obj .hb-panel-head>b { font-size:13px; }
.hb-operator-obj.failed { border-color:#c38a7c; }
.hb-operator-diff { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:end; gap:6px; margin:0 0 10px; }
.hb-operator-cell { display:flex; flex-direction:column; gap:4px; min-width:0; }
.hb-operator-cell>small { font:700 10px var(--sans); color:#6b7159; }
.hb-operator-vs { padding-bottom:12px; font:800 16px var(--mono); color:#7a8f86; }
.hb-operator-result { display:flex; align-items:flex-start; gap:6px; margin-top:10px; padding:6px 8px; border-radius:9px; font-size:12px; animation:hb-frame-in .3s ease-out both; }
.hb-operator-result code { min-width:0; padding:0; border:0; background:none; font:700 11px/1.5 var(--mono); overflow-wrap:anywhere; }
.hb-operator-result.ok { background:#dff2d6; color:#2d694b; }
.hb-operator-result.bad { background:#f8e1da; color:#9c3d2d; }
.hb-operator-result.warn { background:#fff1c9; color:#7a5a20; }
.hb-operator-result.ok code { color:#2d694b; }.hb-operator-result.bad code { color:#9c3d2d; }.hb-operator-result.warn code { color:#7a5a20; }

/* Workqueue: three edits flow into one key. */
.hb-operator-flow { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:10px 14px; }
.hb-operator-edits { display:flex; flex-direction:column; gap:6px; }
.hb-operator-edit { padding:3px 10px 3px 4px; }
.hb-operator-edit svg { width:26px; height:29px; }
.hb-operator-flow-arrow { font:800 24px var(--mono); color:#4f7f86; }
.hb-operator-queue { display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px 12px 12px; border:2px dashed #6f9ea0; border-radius:16px; background:#e4f6f02e; }
.hb-operator-queue>small { font:800 11px var(--mono); color:#2b5a66; letter-spacing:.4px; }
.hb-operator-one { grid-template-columns:minmax(0,420px); justify-content:center; }

/* ownerReferences: the CR on top, its children below. */
.hb-operator-tree { display:flex; flex-direction:column; align-items:center; gap:14px; padding:2px 0 8px; }
.hb-operator-owner { position:relative; }
.hb-operator-owner::after { content:''; position:absolute; left:50%; top:100%; height:14px; border-left:2px dashed #6f9ea0; }
.hb-operator-children { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr)); gap:12px; width:100%; padding-top:10px; border-top:2px dashed #6f9ea0; }
.hb-operator-child { position:relative; display:flex; flex-direction:column; align-items:stretch; gap:6px; min-width:0; }
.hb-operator-stamp { align-self:center; padding:2px 8px; border-radius:6px; font:800 10.5px var(--mono); transform:rotate(-3deg); animation:hb-frame-in .35s ease-out both; }
.hb-operator-stamp.bad { background:#c76750; color:#fff; box-shadow:0 2px 0 #8f4f36; }
.hb-operator-stamp.ok { background:#5c9a68; color:#fff; box-shadow:0 2px 0 #3f7656; }

/* Code cards: triggers, palette, program, world, trace. */
.hb-operator-triggers { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.hb-operator-trigger { display:flex; align-items:center; gap:9px; padding:6px 10px 6px 6px; border:2px solid #b59c61; border-radius:11px; background:linear-gradient(#fff7d8,#f5e5b6); box-shadow:0 3px 0 #ab905b; font:600 12px/1.5 var(--sans); color:#4b553d; transition:opacity .3s; }
.hb-operator-trigger>span { flex-shrink:0; width:22px; height:22px; border-radius:50%; display:grid; place-items:center; background:#e6efe0; border:2px solid #8baeb0; font:800 11px var(--mono); color:#2f5560; }
.hb-operator-trigger.now { border-color:#a98048; background:#ffe9b0; box-shadow:0 3px 0 #9a7848,0 0 0 4px #fff6; }
.hb-operator-trigger.ok>span { background:#5c9a68; border-color:#3f7656; color:#fff; }
.hb-operator-trigger.bad>span { background:#c76750; border-color:#8f4f36; color:#fff; }
.hb-operator-trigger.warn>span { background:#efc25c; border-color:#a98048; color:#5a4419; }
.hb-operator-trigger.ok,.hb-operator-trigger.bad,.hb-operator-trigger.warn { opacity:.8; }
.hb-operator-palette { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,250px),1fr)); gap:7px; }
.hb-operator-card { display:flex; flex-direction:column; align-items:flex-start; gap:2px; min-width:0; padding:7px 10px; border:2px solid #b8a576; border-radius:11px; background:linear-gradient(#fffbea,#f6ebc8); box-shadow:0 3px 0 #b39a62; color:#3f4a38; text-align:left; cursor:pointer; transition:transform .15s,opacity .2s; }
.hb-operator-card:hover:not(:disabled) { transform:translateY(-2px); }
.hb-operator-card code { max-width:100%; padding:0; border:0; background:none; font:700 11px/1.45 var(--mono); color:#3f4a38; overflow-wrap:anywhere; }
.hb-operator-card small { font:600 10.5px/1.4 var(--sans); color:#6b7159; }
.hb-operator-card.ret { border-color:#8baeb0; background:linear-gradient(#f2f8ee,#dceee2); box-shadow:0 3px 0 #7a9fa6; }
.hb-operator-card.used { cursor:default; opacity:.5; transform:none; box-shadow:none; border-style:dashed; }
.hb-operator-card.used small { color:#2d694b; font-weight:800; }
.hb-operator-prog { padding:10px 12px; border:2px solid #748f83; border-radius:14px; background:#fff6db; box-shadow:0 4px 0 #98a589; }
.hb-operator-sig { font:700 11px/1.5 var(--mono); color:#64508a; overflow-wrap:anywhere; }
.hb-operator-prog .hb-order { margin:7px 0 7px 10px; }
.hb-operator-empty { margin:8px 0 8px 10px; padding:12px; border:2px dashed #c8bd99; border-radius:10px; text-align:center; font-size:12px; color:#7a7d65; }
.hb-operator-line code { display:block; padding:0; border:0; background:none; font:700 11px/1.45 var(--mono); color:#3f4a38; overflow-wrap:anywhere; }
.hb-operator-line small { display:block; font:600 10.5px/1.4 var(--sans); color:#6b7159; }
.hb-operator-world { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr)); gap:10px; }
.hb-operator-trace { max-height:340px; }
.hb-operator-trace li { overflow-wrap:anywhere; }
.hb-operator-trace li code { padding:0 4px; margin-right:2px; border:1px solid #c8bd99; border-radius:4px; background:#fff9e8; font:700 10.5px var(--mono); color:#5b5236; }
.hb-operator-mark { display:inline-block; width:16px; }
.hb-operator-run { margin-top:6px; padding-top:6px !important; border-top:1px dashed #b9c1ab; font-weight:800; color:#2b5a66; }
.hb-operator-run:first-child { margin-top:0; padding-top:2px !important; border-top:0; }
.hb-operator-attempt { padding-left:16px !important; font-size:11px; color:#6b7a6e; }
.hb-operator-after { padding-left:16px !important; color:#7a5a20; }

/* Demo pieces: the controller loop, rows of crates, a terminal line. Every frame keeps the same rows, and the
 * scene keeps a floor height, so the board below does not jump as the frames change. */
.hb-operator-scene { min-height:150px; justify-content:center; }
.hb-operator-scene>.hb-operator-mini-row:first-child { min-height:26px; align-items:center; }
.hb-operator-scene .hb-operator-queue { align-self:center; max-width:100%; padding:6px 8px 8px; }
.hb-operator-scene .hb-ticket { min-width:0; padding:4px 8px 4px 4px; font-size:10.5px; overflow-wrap:anywhere; }
.hb-operator-scene .hb-ticket svg { flex-shrink:0; width:24px; height:27px; }
.hb-operator-mini-row { display:flex; flex-wrap:wrap; justify-content:center; gap:5px; }
.hb-operator-mini-row .hb-operator-crate.small { padding:3px 6px 3px 3px; gap:4px; border-radius:9px; }
.hb-operator-mini-row .hb-operator-crate.small .hb-operator-crate-cube,.hb-operator-mini-row .hb-operator-crate.small .hb-operator-crate-cube svg { width:20px; height:22px; }
.hb-operator-mini-row .hb-operator-crate.small b { font-size:9.5px; }
.hb-operator-mini-row .hb-chip { font-size:8.5px; padding:0 4px; }
.hb-operator-ctrl { display:flex; align-items:center; justify-content:center; gap:6px; margin:0 auto; padding:5px 10px; border:2px solid #64508a; border-radius:20px; background:#efe8f8; box-shadow:0 3px 0 #64508a; font:800 10px var(--mono); color:#3c2c5c; max-width:100%; overflow-wrap:anywhere; }
.hb-operator-ctrl span { flex-shrink:0; width:9px; height:9px; border:2px solid #64508a; border-right-color:transparent; border-radius:50%; animation:hb-operator-spin 1.6s linear infinite; }
.hb-operator-mini-cmd { align-self:center; padding:4px 9px; border-radius:7px; background:#2f4f4c; color:#e8f5e9; font:700 10px var(--mono); max-width:100%; overflow-wrap:anywhere; }
@keyframes hb-operator-spin { to { transform:rotate(360deg); } }

@media(max-width:560px) {
  .hb-operator-scene { min-height:270px; }
  .hb-operator-diff { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:4px; }
  .hb-operator-crate.small { padding:4px 6px 4px 3px; }
  .hb-operator-prog { padding:8px; }
  .hb-operator-prog .hb-order { margin-left:0; }
  .hb-operator-prog .hb-order li { flex-wrap:wrap; }
  .hb-operator-prog .hb-order-body { flex-basis:calc(100% - 40px); }
  .hb-operator-prog .hb-order-tools { margin-left:auto; }
  .hb-operator-flow-arrow { transform:rotate(90deg); }
}
