/* AutoRig task page (2026-11-10): one dark screen, the model first. */
:root {
  --bg: #0b0d11; --bg2: #151922; --panel: rgba(20, 24, 32, .82); --line: rgba(255, 255, 255, .09);
  --txt: #eef1f6; --dim: #8d97a8; --acc: #7cf2c9; --acc-ink: #06281d; --warn: #ffc857; --bad: #ff6b7a;
  --r: 12px; --bar: 52px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt); }
body.t4 { font: 14px/1.4 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.t4-bar { position: fixed; inset: 0 0 auto 0; height: var(--bar); z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 0 14px; background: linear-gradient(#0b0d11ee, #0b0d1100); pointer-events: none; }
.t4-bar > * { pointer-events: auto; }
.t4-logo { display: flex; align-items: center; gap: 8px; color: var(--txt); text-decoration: none; letter-spacing: .2px; }
.t4-logo svg { width: 22px; height: 22px; color: var(--acc); }
.t4-title { min-width: 60px; flex: 1 1 auto; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t4-title h1, .t4-title h2 { display: inline; margin: 0; font: inherit; font-weight: 500; }
.t4-chip { padding: 2px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--dim); font-size: 12px; text-transform: lowercase; }
.t4-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.t4-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--txt); font: inherit; font-weight: 500; cursor: pointer;
  text-decoration: none; backdrop-filter: blur(10px); transition: background .15s, border-color .15s, transform .1s; }
.t4-btn:hover { border-color: rgba(255, 255, 255, .22); background: rgba(34, 40, 52, .9); }
.t4-btn:active { transform: translateY(1px); }
.t4-btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); font-weight: 650; }
.t4-btn.primary:hover { background: #99f7d7; }
.t4-btn.wide { width: 100%; height: 44px; }
.t4-btn:disabled { opacity: .5; cursor: default; }
.t4-user { display: inline-flex; align-items: center; justify-content: center; height: 36px; min-width: 36px; padding: 0 10px; border-radius: 99px;
  color: var(--dim); text-decoration: none; font-weight: 500; white-space: nowrap; flex: none; }
.t4-user.in { padding: 0; width: 36px; background: var(--bg2); color: var(--txt); overflow: hidden; border: 1px solid var(--line); }
.t4-user img { width: 100%; height: 100%; object-fit: cover; }

.t4-stage { position: relative; height: 100vh; height: 100dvh; min-height: 420px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 38%, #262c3a 0%, #151922 46%, #0b0d11 100%); }
.t4-stage.drop::after { content: ""; position: absolute; inset: 10px; border: 2px dashed var(--acc); border-radius: 18px; pointer-events: none; z-index: 25; }
.t4-view, .t4-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
.t4-picture { position: absolute; inset: 0; margin: auto; max-width: min(70vw, 560px); max-height: 62vh; border-radius: 16px; box-shadow: 0 30px 80px #0009; }
.t4-load { position: absolute; inset: 0 0 auto 0; height: 2px; z-index: 31; background: transparent; }
.t4-load i { display: block; height: 100%; width: 0; background: var(--acc); box-shadow: 0 0 12px var(--acc); transition: width .2s; }

.t4-status { position: absolute; left: 50%; top: calc(var(--bar) + 10px); transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 9px;
  max-width: calc(100vw - 28px); padding: 8px 14px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(12px); white-space: nowrap; overflow: hidden; }
.t4-status b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.t4-status span { color: var(--dim); font-variant-numeric: tabular-nums; }
.t4-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); flex: none; }
.t4-status[data-kind="work"] .t4-dot { animation: t4pulse 1.1s ease-in-out infinite; }
.t4-status[data-kind="warn"] .t4-dot { background: var(--warn); }
.t4-status[data-kind="fail"] .t4-dot { background: var(--bad); }
.t4-st-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: transparent; }
.t4-st-bar i { display: block; height: 100%; background: var(--acc); transition: width .6s; }
@keyframes t4pulse { 50% { opacity: .25; transform: scale(.7); } }

.t4-dock { position: absolute; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 12px; pointer-events: none; }
.t4-clips, .t4-modes { display: flex; gap: 6px; max-width: 100%; overflow-x: auto; scrollbar-width: none; pointer-events: auto; padding: 5px;
  border-radius: 14px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(12px); }
.t4-clips:empty { display: none; }
.t4-clips::-webkit-scrollbar, .t4-modes::-webkit-scrollbar { display: none; }
.t4-chipbtn { height: 32px; padding: 0 12px; border-radius: 9px; border: 0; background: transparent; color: var(--dim); font: inherit; font-weight: 500;
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; transition: background .12s, color .12s; }
.t4-chipbtn:hover { color: var(--txt); background: rgba(255, 255, 255, .06); }
.t4-chipbtn.on { color: var(--acc-ink); background: var(--acc); }
.t4-chipbtn.icon { padding: 0 8px; }
.t4-pp { min-width: 36px; justify-content: center; color: var(--txt); }
.t4-modes.norig .rig { display: none; }
.t4-stats { position: absolute; left: 14px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 19; color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; pointer-events: none; }

.t4-drawer { position: absolute; top: calc(var(--bar) + 6px); right: 12px; z-index: 28; width: min(340px, calc(100vw - 24px)); max-height: calc(100% - var(--bar) - 20px);
  overflow: auto; padding: 14px; border-radius: 16px; background: rgba(17, 20, 27, .94); border: 1px solid var(--line); backdrop-filter: blur(16px);
  box-shadow: 0 24px 70px #000a; animation: t4in .16s ease-out; }
@keyframes t4in { from { opacity: 0; transform: translateY(-6px); } }
.t4-drawer header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 15px; }
.t4-x { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--dim); font-size: 20px; cursor: pointer; }
.t4-x:hover { background: rgba(255, 255, 255, .07); color: var(--txt); }
.t4-targets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.t4-target { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--bg2); color: var(--txt); font: inherit; cursor: pointer; text-align: left; transition: border-color .12s, background .12s; }
.t4-target:hover { border-color: var(--acc); background: #1b2230; }
.t4-target b { font-weight: 600; }
.t4-target span { color: var(--dim); font-size: 12px; letter-spacing: .5px; }
.t4-target.locked span::after { content: " · 🔒"; }
.t4-opts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 2px 2px; color: var(--dim); }
.t4-opts label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.t4-opts input { accent-color: var(--acc); }
.t4-job { margin-top: 12px; padding: 10px 12px 12px; border-radius: var(--r); background: var(--bg2); position: relative; overflow: hidden; }
.t4-job > i { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .06); }
.t4-job > i > i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .4s; }
.t4-job.failed { color: var(--bad); }
.t4-job.failed > i > i { background: var(--bad); }
.t4-pay { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.t4-pay p { margin: 0 0 2px; color: var(--dim); }
.t4-pay.pulse { animation: t4nudge .5s; }
@keyframes t4nudge { 30% { transform: translateX(-5px); } 60% { transform: translateX(4px); } }
.t4-plan { justify-content: space-between; padding: 0 14px; }
.t4-plan s { opacity: .55; margin-right: 4px; }
.t4-wait { color: var(--acc) !important; }
.t4-muted { color: var(--dim); margin: 6px 2px; }
.t4-toast { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 40; padding: 9px 14px; border-radius: 10px;
  background: #000c; border: 1px solid var(--line); max-width: calc(100vw - 28px); }

.t4-about { max-width: 760px; margin: 0 auto; padding: 22px 16px 40px; color: var(--dim); }
.t4-about p { margin: 0 0 10px; }
.t4-about .tv3-tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 12px 0; }
.t4-about .tv3-tags li { padding: 2px 9px; border: 1px solid var(--line); border-radius: 99px; font-size: 12px; }
.t4-about nav { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 18px; }
.t4-about a { color: var(--dim); }
.t4-about a:hover { color: var(--txt); }

@media (max-width: 980px) { .t4-stats { display: none; } }
@media (max-width: 760px) {
  .t4-btn span { display: none; }
  .t4-btn { padding: 0 10px; }
  .t4-btn.primary span { display: inline; }
  .t4-logo b, .t4-chip { display: none; }
  .t4-stats { display: none; }
  .t4-drawer { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 72%; }
  .t4-clips, .t4-modes { justify-content: flex-start; }
}
