/* ==========================================================================
   WEHATESKIDS // SKID TERMINAL — full-screen synthetic training workstation
   Dedicated .whk-* class system. Enters via #atkEnterPc → whkPc.enter().
   Palette: near-black, crimson/dark red, off-white, muted gray. No purple.
   100% browser-state fiction. No network I/O of any kind.
   ========================================================================== */

.whk-pc {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  background: #08080a;
  color: #d9d9de;
  font-family: "Inter", system-ui, sans-serif;
  overflow: hidden;
}
body.whk-locked {
  overflow: hidden;
}

/* ---------- boot sequence ---------- */
.whk-boot {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050506;
  transition: opacity 420ms ease;
}
.whk-boot.gone { opacity: 0; pointer-events: none; }
.whk-boot-in {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: clamp(11px, 1.6vw, 15px);
  letter-spacing: 0.14em;
  color: #a9a9b2;
}
.whk-boot-in span { opacity: 0; color: #a9a9b2; }
.whk-boot-in span.on { opacity: 1; transition: opacity 140ms linear; }
.whk-boot-in span.what { color: #d9d9de; }
.whk-boot-in .ok { color: #54d17a; }
.whk-boot-watermark {
  position: absolute;
  right: 18px;
  bottom: 14px;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: #41414a;
}

/* ---------- desktop ---------- */
.whk-desktop {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(1400px 700px at 74% -8%, rgba(193, 18, 31, 0.09), transparent 58%),
    radial-gradient(900px 520px at 8% 88%, rgba(193, 18, 31, 0.06), transparent 52%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.016) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.016) 0 1px, transparent 1px 46px),
    #070709;
}
.whk-watermark {
  position: absolute;
  right: 16px;
  bottom: 10px;
  z-index: 2;
  text-align: right;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: #43434c;
  line-height: 1.9;
  pointer-events: none;
  user-select: none;
}
.whk-watermark b { color: #6e1520; }

/* ---------- desktop icons ---------- */
.whk-desk-icons {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
}
.whk-desk-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 76px;
  padding: 10px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #c8c8cf;
  cursor: pointer;
}
.whk-desk-icon:hover { background: rgba(255, 255, 255, 0.05); border-color: #2c2c34; }
.whk-desk-icon.is-selected { background: rgba(193, 18, 31, 0.16); border-color: #b3121f; }
.whk-desk-icon:focus-visible { outline: none; border-color: #e5383b; }
.whk-desk-ico {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #f2e7e8;
  background: #101014;
  border: 1px solid #4a4a55;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.5);
  border-radius: 3px;
}
.whk-desk-icon.real .whk-desk-ico { color: #e8e8ee; background: #1b1b22; }
.whk-desk-icon.terminal .whk-desk-ico { color: #1a0a0c; background: #f0f0f3; }
.whk-desk-icon.warn .whk-desk-ico { color: #f2d9da; background: #2a0d10; border-color: #84202b; }
.whk-desk-label {
  max-width: 76px;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  line-height: 1.35;
  text-align: center;
  color: #ccccd4;
  text-shadow: 0 1px 2px #000;
}

/* ---------- window manager ---------- */
.whk-wins {
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
}
.whk-win {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  min-width: 300px;
  min-height: 200px;
  background: #0a0a0e;
  border: 1px solid #2c2c34;
  border-radius: 6px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.6);
  opacity: 0.92;
  transition: opacity 120ms linear;
}
.whk-win.is-focus { opacity: 1; border-color: #3f3f49; }
.whk-win.is-max { top: 0 !important; left: 0 !important; width: 100% !important; height: calc(100% - 48px) !important; border-radius: 0; }
.whk-win-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 8px 0 10px;
  background: #16161c;
  border-bottom: 1px solid #26262d;
  border-radius: 6px 6px 0 0;
  user-select: none;
  touch-action: none;
  cursor: default;
}
@media (min-width: 821px) {
  .whk-win-bar { cursor: grab; }
}
.whk-win-bar.dragging { cursor: grabbing; }
.whk-win-appico {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 1px solid #4a4a55;
  border-radius: 3px;
  display: grid;
  place-items: center;
  font-size: 0.52rem;
  font-weight: 800;
  color: #e8e8ee;
  background: #1b1b22;
}
.whk-win-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: #c6c6cd;
}
.whk-win.is-focus .whk-win-title { color: #ececef; }
.whk-win-ctrls { display: flex; gap: 4px; flex: 0 0 auto; }
.whk-win-ctrls button {
  width: 26px;
  height: 24px;
  display: grid;
  place-items: center;
  background: #101015;
  border: 1px solid #26262d;
  color: #a3a3ac;
  font-size: 0.66rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 3px;
}
.whk-win-ctrls button:hover { border-color: #b3121f; color: #e5383b; }
.whk-win-ctrls button:focus-visible { outline: none; border-color: #e5383b; }
.whk-win-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px;
  background: #0a0a0e;
}
.whk-btn-back { display: none !important; }

/* ---------- start menu ---------- */
.whk-start {
  position: absolute;
  left: 8px;
  bottom: calc(48px + 8px);
  z-index: 40;
  width: 300px;
  max-width: calc(100vw - 16px);
  background: #0b0b10;
  border: 1px solid #2c2c34;
  border-radius: 6px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.75);
  display: none;
  flex-direction: column;
  padding: 6px;
}
.whk-start.open { display: flex; }
.whk-start-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 12px;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: #e8e8ee;
  font-weight: 700;
}
.whk-start-brand b { color: #e5383b; }
.whk-start-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #c8c8d0;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-align: left;
  cursor: pointer;
}
.whk-start-item:hover { background: rgba(193, 18, 31, 0.12); border-color: #3a1a1e; color: #ececef; }
.whk-start-item:focus-visible { outline: none; border-color: #e5383b; }
.whk-start-item .whk-sico {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 0.55rem;
  font-weight: 800;
  color: #f2e7e8;
  background: #16161d;
  border: 1px solid #3a3a44;
  border-radius: 3px;
}
.whk-start-sep { border-top: 1px solid #1e1e26; margin: 5px 4px; }
.whk-start-item.danger { color: #ef8b94; }
.whk-start-item.danger:hover { background: rgba(193, 18, 31, 0.18); border-color: #7c1f29; color: #ffb4ba; }

/* ---------- taskbar ---------- */
.whk-taskbar {
  position: relative;
  z-index: 50;
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  background: #0d0d12;
  border-top: 1px solid #232329;
}
.whk-start-btn {
  height: 32px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: #15151c;
  border: 1px solid #2c2c34;
  border-radius: 4px;
  color: #d9d9de;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.whk-start-btn:hover { border-color: #b3121f; }
.whk-start-btn .whk-sq {
  width: 12px;
  height: 12px;
  display: inline-block;
  background: #b3121f;
  transform: rotate(45deg);
}
.whk-task-running {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.whk-task-btn {
  position: relative;
  height: 34px;
  max-width: 150px;
  padding: 0 12px;
  background: #121217;
  border: 1px solid #232329;
  border-radius: 4px;
  color: #b6b6bf;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.whk-task-btn:hover { border-color: #55555f; color: #d9d9de; }
.whk-task-btn.is-active { color: #ececef; border-color: #4a2026; background: #1c1113; }
.whk-task-btn.is-active::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 2px;
  height: 2px;
  background: #e5383b;
  border-radius: 2px;
}
.whk-task-tray {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex: 0 0 auto;
}
.whk-tray-ico {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #8f8f99;
  border-radius: 4px;
  cursor: default;
}
.whk-tray-ico svg { width: 16px; height: 16px; }
.whk-task-clock {
  margin-left: 4px;
  padding: 0 8px;
  text-align: right;
  font-size: 0.66rem;
  line-height: 1.45;
  letter-spacing: 0.04em;
  color: #a5a5ae;
  font-variant-numeric: tabular-nums;
}
.whk-task-clock b { display: block; color: #ccccd3; font-weight: 600; }

/* ---------- shared labels / panels ---------- */
.whk-k { font-size: 0.6rem; letter-spacing: 0.2em; color: #e5383b; margin: 0; }
.whk-dim { color: #8a8a93; }
.whk-mono { font-family: var(--mono, "JetBrains Mono", monospace); }
.whk-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}
.whk-field > span { font-size: 0.6rem; letter-spacing: 0.16em; color: #83838d; }
.whk-field > input, .whk-field > select {
  height: 30px;
  padding: 0 8px;
  background: #101016;
  border: 1px solid #26262d;
  border-radius: 3px;
  color: #e2e2e7;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 0.72rem;
}
.whk-field > input:focus, .whk-field > select:focus { outline: none; border-color: #e5383b; }
.whk-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .whk-grid2 { grid-template-columns: 1fr; } }
.whk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  padding: 0 16px;
  background: #16161d;
  border: 1px solid #2c2c34;
  border-radius: 3px;
  color: #d9d9de;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  cursor: pointer;
}
.whk-btn:hover { border-color: #b3121f; color: #ececef; }
.whk-btn:focus-visible { outline: none; border-color: #e5383b; }
.whk-btn.primary { background: #a61421; border-color: #7a0f19; color: #fff1f1; font-weight: 600; }
.whk-btn.primary:hover { background: #c1121f; border-color: #e5383b; }
.whk-btn.small { height: 26px; padding: 0 10px; font-size: 0.62rem; }
.whk-note { font-size: 0.64rem; line-height: 1.6; color: #777781; margin: 0; }

/* ---------- PuTTY window ---------- */
.whk-putty-cfg {
  display: flex;
  height: 100%;
  min-height: 0;
}
.whk-putty-rail {
  flex: 0 0 150px;
  background: #0d0d12;
  border-right: 1px solid #1f1f26;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.whk-putty-rail b {
  padding: 7px 10px;
  border-radius: 3px;
  background: rgba(193, 18, 31, 0.14);
  color: #ececef;
  border-left: 2px solid #e5383b;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  font-weight: 500;
}
.whk-putty-rail span {
  padding: 6px 10px;
  color: #70707a;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}
.whk-putty-cfgform {
  flex: 1;
  min-width: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.whk-putty-title { margin: 0; font-size: 0.74rem; letter-spacing: 0.14em; color: #ececef; font-weight: 600; }
.whk-radio { display: flex; gap: 12px; align-items: center; font-size: 0.68rem; color: #b6b6bf; }
.whk-radio label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.whk-radio input { accent-color: #e5383b; }
.whk-putty-ctrls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.whk-putty-note { font-size: 0.62rem; color: #6d6d77; line-height: 1.6; max-width: 320px; }

/* ---------- terminal ---------- */
.whk-term {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #050507;
}
.whk-term-out {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 13px;
  line-height: 1.3;
  color: #d5d5db;
  scrollbar-width: thin;
  scrollbar-color: #3a3a42 #050507;
  white-space: pre-wrap;
  word-break: break-word;
}
.whk-term-out::-webkit-scrollbar { width: 6px; }
.whk-term-out::-webkit-scrollbar-thumb { background: #3a3a42; }
.whk-term-line { margin: 0; min-height: 1.3em; }
.whk-term-line.red { color: #e5383b; }
.whk-term-line.acc { color: #54d17a; }
.whk-term-line.dim { color: #8a8a93; }
.whk-term-line.warn { color: #f0b24b; }
.whk-term-line.err { color: #ff6b6b; }
.whk-term-art {
  margin: 0;
  font-size: 13px;
  line-height: 1.28;
  color: #e8e8ee;
  letter-spacing: 0;
  white-space: pre;
  transform-origin: top left;
  text-shadow: 0 0 14px rgba(193, 18, 31, 0.35);
}
.whk-term-form {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 0;
  padding: 6px 12px 8px;
  background: #050507;
}
.whk-term-p {
  flex: 0 0 auto;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 13px;
  line-height: 1.3;
  color: #e5383b;
  white-space: pre;
}
.whk-term-iptwrap {
  position: relative;
  flex: 1;
  min-width: 0;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 13px;
  line-height: 1.3;
}
.whk-term-in {
  position: absolute;
  inset: 0;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: transparent;
  caret-color: transparent;
  font: inherit;
}
.whk-term-echo { color: #e8e8ee; white-space: pre; }
.whk-term-cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  margin: 2px 0 0 1px;
  background: #d9d9de;
  vertical-align: text-bottom;
  animation: whk-blink 1.06s steps(1) infinite;
}
@keyframes whk-blink { 50% { opacity: 0; } }

/* ---------- DSTAT window ---------- */
.whk-dstat-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
@media (max-width: 420px) { .whk-dstat-metrics { grid-template-columns: repeat(2, 1fr); } }
.whk-dstat-metric {
  border: 1px solid #1f1f26;
  background: #0d0d13;
  border-radius: 4px;
  padding: 8px 10px;
}
.whk-dstat-metric span { display: block; font-size: 0.58rem; letter-spacing: 0.16em; color: #83838d; }
.whk-dstat-metric b { display: block; margin-top: 3px; font-size: 0.92rem; color: #ececef; font-variant-numeric: tabular-nums; }
.whk-dstat-label { font-size: 0.58rem; letter-spacing: 0.2em; color: #54d17a; margin: 0 0 8px; }
.whk-dstat-label b { color: #e8e8ee; }
.whk-telemetry {
  border: 1px solid #1f1f26;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.whk-telemetry-head, .whk-telemetry-row {
  display: grid;
  grid-template-columns: 74px 1fr 1fr 1fr 0.9fr 0.9fr;
  gap: 6px;
  padding: 5px 10px;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 0.62rem;
}
.whk-telemetry-head { color: #8a8a93; background: #0f0f16; border-bottom: 1px solid #1f1f26; letter-spacing: 0.08em; }
.whk-telemetry-row { color: #c4c4cb; border-bottom: 1px solid #14141a; }
.whk-telemetry-row:last-child { border-bottom: none; }
.whk-telemetry-scroll { max-height: 180px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3a3a42 #0a0a0e; }
.whk-verdict {
  margin: 0;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 0.64rem;
  line-height: 1.6;
  color: #f0b24b;
  border: 1px solid #3a2a12;
  background: #161006;
  padding: 8px 10px;
  border-radius: 4px;
}

/* ---------- booter window ---------- */
.whk-booter-log {
  height: 130px;
  overflow-y: auto;
  margin: 12px 0;
  background: #07070a;
  border: 1px solid #1f1f26;
  border-radius: 4px;
  padding: 8px 10px;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 0.66rem;
  line-height: 1.7;
  color: #b8b8c0;
  scrollbar-width: thin;
}
.whk-booter-log .hit { color: #e5383b; }
.whk-booter-log .ok { color: #54d17a; }
.whk-booter-log .dim { color: #6d6d77; }
.whk-booter-status { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 4px; }
.whk-booter-status span { font-size: 0.62rem; letter-spacing: 0.16em; color: #83838d; }
.whk-booter-status b { font-size: 0.72rem; letter-spacing: 0.14em; color: #ececef; }
.whk-booter-status b.running { color: #e5383b; }
.whk-booter-status b.done { color: #54d17a; }
.whk-claim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.whk-claim-cell { border: 1px solid #1f1f26; border-radius: 4px; padding: 8px 10px; background: #0d0d13; }
.whk-claim-cell span { display: block; font-size: 0.58rem; letter-spacing: 0.16em; color: #83838d; }
.whk-claim-cell em { font-style: normal; display: block; margin-top: 3px; font-size: 0.8rem; font-family: var(--mono, "JetBrains Mono", monospace); color: #ececef; font-variant-numeric: tabular-nums; }
.whk-claim-cell.observed em { color: #54d17a; }
.whk-claim-notice {
  margin: 10px 0 0;
  font-size: 0.62rem;
  line-height: 1.65;
  color: #f0b24b;
  font-family: var(--mono, "JetBrains Mono", monospace);
}

/* ---------- notes / thispc / recycle ---------- */
.whk-notes-doc {
  background: #0f0f14;
  border: 1px solid #1f1f26;
  border-radius: 4px;
  padding: 14px;
}
.whk-notes-doc .whk-k { margin-bottom: 10px; }
.whk-notes-doc ul { margin: 0; padding-left: 16px; }
.whk-notes-doc li { font-size: 0.72rem; line-height: 1.8; color: #c0c0c8; }
.whk-filelist { list-style: none; margin: 0; padding: 0; border: 1px solid #1f1f26; border-radius: 4px; }
.whk-filelist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid #14141a;
  font-size: 0.72rem;
  color: #c8c8d0;
}
.whk-filelist li:last-child { border-bottom: none; }
.whk-fileico { font-size: 0.6rem; font-weight: 800; color: #d9a8ab; width: 22px; text-align: center; }
.whk-empty { text-align: center; padding: 30px 10px; color: #6d6d77; font-size: 0.7rem; line-height: 1.8; }

/* ---------- disconnect overlay ---------- */
.whk-bye {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050506;
  opacity: 0;
  transition: opacity 260ms linear;
}
.whk-bye.show { opacity: 1; }
.whk-bye p {
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: clamp(12px, 2vw, 16px);
  letter-spacing: 0.2em;
  color: #d9d9de;
}

/* ---------- responsive: mobile ---------- */
@media (max-width: 820px) {
  .whk-desktop { overflow: hidden; }
  .whk-desk-icons { left: 8px; top: 8px; gap: 4px; flex-direction: row; flex-wrap: wrap; padding: 4px; }
  .whk-desk-icon { width: 64px; padding: 7px 4px; }
  .whk-desk-ico { width: 34px; height: 34px; }
  .whk-win {
    position: fixed;
    left: 6px;
    right: 6px;
    top: 6px;
    bottom: 54px;
    width: auto;
    min-width: 0;
    height: auto;
    max-height: none;
    border-radius: 6px;
    transform: none;
  }
  .whk-win.is-max { top: 0 !important; left: 0 !important; right: 0 !important; bottom: 54px !important; width: auto !important; height: auto !important; border-radius: 0; }
  .whk-win-bar { cursor: default; }
  .whk-btn-back { display: inline-grid !important; }
  .whk-start { left: 6px; right: 6px; bottom: calc(54px + 6px); width: auto; max-width: none; }
  .whk-term-out, .whk-term-p, .whk-term-iptwrap { font-size: 12px; }
  .whk-putty-rail { flex-basis: 110px; }
  .whk-taskbar { height: 48px; flex: 0 0 48px; }
}