:root {
  --bg: #161616;
  --bg-0: #0e0e0e;
  --panel: #2a2a2e;
  --panel-2: #232326;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f2f2f5;
  --muted: #9a9aa3;
  --accent: #3d9dff;
  --accent-2: #6ec8ff;
  --ok: #3ecf8e;
  --warn: #e8b84a;
  --bad: #ff6b81;
  --gold: #e4c25a;
  --ml: #ffe600;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --top: 48px;
  --rail: 78px;
  --right: 280px;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg-0); color: var(--text); font: 13px/1.45 "Segoe UI", "Helvetica Neue", Arial, sans-serif; overflow: hidden; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

.hy-top {
  position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: #000; border-bottom: 1px solid #1c1c1c;
}
.hy-brand { display: flex; align-items: center; gap: 10px; }
.hy-logo {
  width: 28px; height: 28px; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #7ad4ff 0%, #2b7fff 42%, #0b3d8c 100%);
  box-shadow: 0 0 0 2px #111, 0 0 12px #3d9dff66;
}
.hy-brand strong { font-size: 15px; font-weight: 650; letter-spacing: 0.02em; }
.hy-top-right { display: flex; align-items: center; gap: 10px; }
.hy-quota {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 99px; background: #1a1a1a; border: 1px solid #2e2e32;
  color: #cfd3dc; font-size: 12px;
}
.hy-quota::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(#7ad4ff, #2b7fff); }
.hy-menu-btn {
  background: transparent; border: 1px solid #2e2e32; color: #cfd3dc;
  border-radius: 8px; padding: 5px 10px; font-size: 12px;
}
.hy-menu-btn:hover { border-color: #3d9dff; color: #fff; }
.hy-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
  background: linear-gradient(135deg, #3d9dff, #6ec8ff); color: #061018;
}
.hy-avatar.bad { background: #5a1c28; color: #ffd0d6; }

.hy-poc-menu {
  position: fixed; top: calc(var(--top) + 6px); right: 16px; z-index: 50;
  width: 240px; background: #1c1c1f; border: 1px solid #333; border-radius: 10px;
  padding: 8px; box-shadow: 0 12px 40px #0008;
}
.hy-poc-menu a {
  display: block; color: #ddd; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: 12px;
}
.hy-poc-menu a:hover, .hy-poc-menu a.on { background: #2a2a30; color: #fff; }

.hy-rail {
  position: fixed; top: var(--top); left: 0; bottom: 0; width: var(--rail); z-index: 30;
  background: #141414; border-right: 1px solid #1f1f1f;
  display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 4px;
}
.hy-rail a {
  width: 64px; text-decoration: none; color: #8d8d95;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px 6px; border-radius: 10px;
}
.hy-rail a .ico {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; background: #1c1c1c;
}
.hy-rail a .ico svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.hy-rail a .lbl { font-size: 10px; line-height: 1.2; text-align: center; }
.hy-rail a.on { color: #7ad4ff; }
.hy-rail a.on .ico { background: #1a3a5c; box-shadow: 0 0 0 1px #3d9dff55; }
.hy-rail a.lock { opacity: 0.38; }
.hy-rail a.lock .ico { background: #181818; }

.hy-stage {
  position: fixed; top: var(--top); left: var(--rail); right: var(--right); bottom: 0;
  background: #1a1a1c;
}
.hy-canvas, .hy-empty-canvas {
  position: absolute; inset: 0;
}
.hy-canvas { z-index: 1; }
.hy-empty-canvas { z-index: 0; background:
  radial-gradient(ellipse at 50% 40%, #242428 0%, #1a1a1c 55%, #121214 100%); }
.hy-canvas canvas { display: block; width: 100%; height: 100%; }
.hy-canvas .tools {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 3;
}
.hy-canvas .tools button {
  background: #2a2a2ecc; color: #eee; border: 1px solid #3a3a40; border-radius: 8px; padding: 6px 10px; font-size: 12px;
}

.float-panel {
  position: absolute; z-index: 5; top: 16px; left: 16px; width: 340px;
  background: #2c2c31; border: 1px solid #3a3a42; border-radius: 14px;
  padding: 14px; box-shadow: 0 18px 50px #0007;
}
.float-panel h2 { margin: 0 0 12px; font-size: 15px; font-weight: 650; }
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px;
}
.seg button {
  border: 0; border-radius: 10px; padding: 10px 8px; background: #1f1f24; color: #bdbdc4;
}
.seg button.on { background: #3a3a44; color: #fff; box-shadow: inset 0 0 0 1px #555; }
.prompt-box {
  background: #1c1c20; border-radius: 10px; padding: 10px; min-height: 92px; position: relative;
}
.prompt-box textarea {
  width: 100%; height: 88px; resize: none; border: 0; background: transparent; outline: none; color: #eee;
}
.prompt-box .count { position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: #7a7a82; }
.drop {
  border: 1px dashed #4a4a52; border-radius: 10px; padding: 16px; text-align: center; color: #9a9aa3;
  background: #1c1c20; margin-bottom: 10px;
}
.drop strong { display: block; color: #eee; margin-bottom: 4px; }
.float-panel > select,
#pg-model {
  width: 100%;
  margin: 0 0 10px;
  background: #1c1c20;
  border: 1px solid #3a3a42;
  border-radius: 8px;
  padding: 8px 10px;
  color: #eee;
}
.thumb {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  background: transparent;
  border-radius: 8px;
  margin: 8px auto;
}
.row-opt {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 2px; color: #ddd; font-size: 13px;
}
.switch {
  width: 36px; height: 20px; border-radius: 99px; background: #3a3a42; position: relative; border: 0;
}
.switch.on { background: #3d9dff; }
.switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on i { left: 18px; }
select.field, .field {
  width: 100%; background: #1c1c20; border: 1px solid #3a3a42; border-radius: 8px; padding: 8px 10px;
}
.btn-gen {
  width: 100%; margin-top: 12px; border: 0; border-radius: 10px; padding: 11px 14px;
  color: #fff; font-weight: 650; font-size: 14px;
  background: linear-gradient(90deg, #2f7dff 0%, #4eb7ff 100%);
  box-shadow: 0 6px 18px #2f7dff44;
}
.btn-gen:disabled { opacity: .5; }
.path-mini { font-size: 11px; color: #8d8d95; margin-top: 8px; }
.path-mini.native { color: #e8b84a; }
.studio-web-note { margin: 0 0 10px; line-height: 1.45; }
.studio-web-note a { color: #7ad4ff; }

.hy-right {
  position: fixed; top: var(--top); right: 0; bottom: 0; width: var(--right); z-index: 30;
  background: #1c1c1f; border-left: 1px solid #26262a; display: flex; flex-direction: column;
}
.hy-rtabs { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; border-bottom: 1px solid #26262a; }
.hy-rtabs button {
  background: transparent; border: 0; color: #8d8d95; padding: 12px 4px; font-size: 12px;
}
.hy-rtabs button.on { color: #fff; box-shadow: inset 0 -2px 0 #3d9dff; }
.hy-rtools { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #26262a; }
.hy-rtools span { width: 16px; height: 16px; border-radius: 4px; background: #2c2c32; }
.hy-rbody { flex: 1; overflow: auto; padding: 16px; }
.hy-empty-copy { color: #8d8d95; text-align: center; margin-top: 48px; line-height: 1.7; }
.hy-empty-ico {
  width: 72px; height: 72px; margin: 40px auto 12px; border-radius: 12px;
  background: linear-gradient(180deg, #2a2a32, #1a1a1e);
  display: grid; place-items: center; color: #6a6a74; font-size: 28px;
}
.asset-chip {
  display: block; width: 100%; text-align: left; background: #25252a; color: #eee;
  border: 1px solid #333; border-radius: 8px; padding: 8px 10px; margin: 0 0 8px; font-size: 12px;
}
.asset-chip.prev { border-color: #3d9dff44; }

.hy-eval {
  position: absolute; z-index: 6; left: 370px; right: 16px; bottom: 16px;
  max-width: 640px;
}
.eval-box {
  background: #2c2c31ee; border: 1px solid #3a3a42; border-radius: 12px; padding: 14px;
}
.eval-box.fail { border-color: #ff6b8155; background: #241418ee; }
.fail-steps { margin: 8px 0 12px 18px; padding: 0; color: #d8d8de; }
.fail-steps li { margin: 4px 0; }
.fail-hero {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none; padding: 24px 24px 180px 370px;
}
.fail-hero img {
  max-width: min(420px, 46vw);
  max-height: 48vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 18px 50px #0008;
  background: #111;
}
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.issue-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.rate-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.rate-row input { width: 100%; background: #1c1c20; border: 1px solid #3a3a42; border-radius: 6px; padding: 6px; }
.btn {
  background: linear-gradient(90deg, #2f7dff, #4eb7ff); color: #fff; border: 0; border-radius: 8px; padding: 8px 12px;
}
.btn.ghost { background: transparent; border: 1px solid #3a3a42; color: #eee; }
.btn.gold { background: linear-gradient(90deg, #2f7dff, #4eb7ff); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.hy-docs {
  position: fixed; z-index: 25; top: var(--top); left: var(--rail); right: var(--right); bottom: 0;
  overflow: auto; background: #161616; padding: 28px 32px 80px;
}
.hy-docs.full { right: 0; z-index: 28; }
.hy-docs.hidden, .hidden { display: none !important; }
.hy-docs section { max-width: 1100px; margin: 0 auto; }
.ml-page h1 { font-size: 32px; margin: 0 0 8px; }
.ml-page .sub { color: var(--accent-2); font-size: 18px; margin: 0 0 12px; }
.q-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
.q-toc a {
  font-size: 12px; color: #cfe6ff; border: 1px solid #3d9dff55; border-radius: 99px;
  padding: 4px 10px; text-decoration: none;
}
.q-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 0; margin-bottom: 10px; }
.q-card > summary {
  display: flex; justify-content: space-between; gap: 12px; align-items: start;
  cursor: pointer; list-style: none; padding: 14px 16px;
}
.q-card > summary::-webkit-details-marker { display: none; }
.q-q { font-weight: 650; font-size: 15px; }
.q-body { padding: 0 16px 16px; border-top: 1px solid var(--line); }
.q-body p { margin: 10px 0; }
.ev-draw { margin-top: 12px; background: #111; border-radius: 8px; padding: 8px 12px; }
.ev-draw summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.ev-grid { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; margin-top: 10px; font-size: 12px; }
.ev-row { display: contents; }
.ev-row b { color: var(--muted); font-weight: 500; }
.ev-row span { overflow-wrap: anywhere; font-family: var(--mono); }
.hy-docs h1, .hy-docs h2 { font-weight: 650; letter-spacing: -0.02em; }
.kicker { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; color: var(--muted); }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.card h3, .card h2 { margin: 0 0 10px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 10px; font-size: 13px; }
.kv b { color: var(--muted); font-weight: 500; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); }
.badge.confirmed { color: var(--ok); border-color: #3ecf8e55; }
.badge.partial { color: var(--warn); border-color: #e8b84a55; }
.badge.needs { color: #c9d4e0; border-color: var(--line); }
.badge.bad { color: var(--bad); }
.errbox { background: #2a1218; border: 1px solid #ff6b8155; color: #ffd0d6; padding: 12px; border-radius: 10px; font-size: 13px; }
.callout { border-left: 3px solid var(--accent); padding: 10px 14px; background: #1a2430; border-radius: 0 10px 10px 0; }
pre { background: #111; padding: 12px; border-radius: 8px; overflow: auto; font-size: 12px; font-family: var(--mono); }
.mono { font-family: var(--mono); font-size: 12px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.metric { background: #1c1c20; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.metric b { display: block; font-size: 22px; }
.metric span { color: var(--muted); font-size: 12px; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.pipeline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pipeline span { background: var(--panel-2); border: 1px solid var(--line); padding: 10px 12px; border-radius: 10px; }
.pipeline .arr { background: none; border: 0; color: var(--accent); padding: 0; }
.flow { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; align-items: center; margin: 16px 0; }
.flow .box { background: var(--panel-2); border: 1px solid var(--line); padding: 12px 8px; text-align: center; border-radius: 10px; }
.flow .arr { color: var(--accent); text-align: center; }
.hero h1 { font-size: 32px; margin: 0 0 8px; }
.hero p.sub { color: var(--accent-2); font-size: 16px; margin: 0 0 18px; }
.sku { display: grid; grid-template-columns: 140px 1fr; gap: 12px; }
.status-run { color: var(--warn); }
.status-done { color: var(--ok); }
.status-fail { color: var(--bad); }
.q-card h3 { margin: 0 0 8px; font-size: 16px; }
.tree { display: grid; gap: 6px; background: var(--panel-2); padding: 16px; border-radius: 12px; border: 1px solid var(--line); }
.mode-switch { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.mode-switch button { background: transparent; color: var(--muted); border: 0; padding: 8px 12px; flex: 1; }
.mode-switch button.on { background: #1a3a5c; color: #fff; }
.path-banner { border-radius: 10px; padding: 12px 14px; margin: 14px 0 18px; font-size: 13px; }
.path-banner.th { background: #10263f; border: 1px solid #3d7cff55; }
.path-banner.native { background: #2a1c08; border: 1px solid #e4c25a55; }
.present-hud {
  position: fixed; top: var(--top); left: var(--rail); right: var(--right); z-index: 35;
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px; background: #111820; border-bottom: 1px solid #3d9dff44; color: #7ad4ff;
}
.present-hud.hidden { display: none; }
.present-hud button { background: transparent; color: #7ad4ff; border: 1px solid #3d9dff55; border-radius: 6px; padding: 4px 10px; }
.viewer { height: 360px; background: #111; border: 1px solid var(--line); border-radius: 12px; position: relative; overflow: hidden; }
.viewer canvas { display: block; width: 100%; height: 100%; }
.viewer .tools { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; }
.lock-note { color: #9a9aa3; font-size: 12px; line-height: 1.6; }

@media (max-width: 1100px) {
  :root { --right: 0px; --rail: 56px; }
  .hy-right { display: none; }
  .float-panel { width: min(340px, calc(100% - 24px)); }
  .grid-2, .grid-3, .sku, .flow { grid-template-columns: 1fr; }
}
