/* axis.theunmade.xyz — action page replica
   Layout metrics, colors and copy mirror hub.axisrobotics.ai /action?id=5697. */

@font-face { font-family: Borna; src: url(assets/fonts/Borna-Regular-CyziTbGU.otf) format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Borna; src: url(assets/fonts/Borna-Medium-uY7zZZTT.otf) format("opentype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Borna; src: url(assets/fonts/Borna-SemiBold-DVhQPaki.otf) format("opentype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: Borna; src: url(assets/fonts/Borna-Bold-FGIs5Tk0.otf) format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --green: #48ff88;
  --green-deep: #00ff47;
  --green-soft: #55ff99;
  --blue: #69e0ff;
  --red: #ff5858;
  --line: rgba(255, 255, 255, 0.2);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: #000;
  color: #fff;
  font-family: Borna, ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- page */
.action-page { display: flex; height: 100vh; min-height: 0; flex-direction: column; overflow: hidden; }

/* ---------------------------------------------------------------- header */
.action-header {
  position: relative; display: flex; flex-shrink: 0; align-items: center;
  justify-content: space-between; padding: 20px 16px;
  border-bottom: 1px solid var(--line);
}
.action-header-left { display: flex; align-items: center; justify-content: space-between; min-width: 0; }
.action-logo { height: 32px; width: auto; cursor: pointer; display: block; }
.vdiv { width: 1px; height: 36px; background: var(--line); margin: 0 16px; }
.task-name { font-size: 16px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(50vw - 260px); }

.action-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; }
.timer-digit {
  display: flex; width: 26px; padding: 1.5px 6px; justify-content: center; align-items: center;
  align-self: stretch; font-size: 24px; font-weight: 600; margin-right: 4px; border-radius: 4px;
  background: rgba(72, 255, 136, 0.15); color: var(--green); font-variant-numeric: tabular-nums;
}
.timer-colon { display: flex; align-items: center; justify-content: center; margin-right: 4px; color: var(--green); font-size: 24px; font-weight: 600; }

.action-right { display: flex; align-items: center; justify-content: center; }
.action-metric { display: flex; align-items: center; justify-content: center; }
.action-metric.spaced { margin: 0 16px; }
.action-metric img { height: 14px; width: 14px; }
.action-metric .lbl { font-size: 12px; color: rgba(255, 255, 255, 0.5); margin: 0 4px; }
.action-metric .val { font-size: 12px; color: #fff; }
.action-close {
  display: flex; height: 36px; width: 36px; align-items: center; justify-content: center;
  border-radius: 9999px; background: #1d1d1d; border: none; cursor: pointer; margin-left: 16px; padding: 0;
}
.action-close img { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- body */
.action-body { width: 100%; flex: 1; min-height: 0; padding: 12px 20px; }
.action-body-inner { display: flex; height: 100%; width: 100%; gap: 20px; align-items: stretch; justify-content: space-between; }

/* left column */
.col-left { position: relative; width: 300px; flex-shrink: 0; align-self: stretch; min-height: 0; }
.left-scroll { display: flex; flex-direction: column; gap: 24px; height: 100%; overflow-y: auto; padding-bottom: 80px; scrollbar-width: none; }
.left-scroll::-webkit-scrollbar { display: none; }
.left-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 80px; background: linear-gradient(to bottom, transparent, #000); pointer-events: none; }

.section { display: flex; flex-shrink: 0; flex-direction: column; gap: 12px; }
.section.tight { gap: 8px; }
.section-title { font-size: 16px; font-weight: 700; text-transform: uppercase; line-height: 1; color: #fff; }
.section-head { display: flex; align-items: center; gap: 8px; }
.goal-desc { font-size: 14px; line-height: 1.2; color: #fff; margin: 0; }

.steps-track { position: relative; display: flex; flex-direction: column; gap: 16px; }
.steps-track::before { content: ""; position: absolute; left: 16px; top: 16px; bottom: 16px; width: 1px; background: rgba(255, 255, 255, 0.2); }
.step { display: flex; align-items: center; gap: 12px; position: relative; }
.step-num {
  position: relative; z-index: 1; flex-shrink: 0; border-radius: 9999px; padding: 1px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05));
}
.step-num > div { display: flex; height: 32px; width: 32px; align-items: center; justify-content: center; border-radius: 9999px; background: #000; font-size: 13px; font-weight: 500; }
.step-num svg { width: 14px; height: 14px; }
.step-label { font-size: 13px; font-weight: 500; color: #fff; }
.step.done .step-label { color: rgba(255, 255, 255, 0.5); text-decoration: line-through; }
.step.active .step-num { box-shadow: 0 0 0 1px rgba(72, 255, 136, 0.5), 0 0 12px rgba(72, 255, 136, 0.25); }

.ctrl-img { width: 100%; display: block; user-select: none; border-radius: 12px; }

/* center: simulator */
.col-sim { display: flex; min-height: 0; min-width: 0; flex: 1; flex-direction: column; align-self: stretch; }
.sim-panel {
  position: relative; min-height: 0; flex: 1; overflow: hidden; border-radius: 12px;
  border: 1px solid var(--line); background: #000;
}
.sim-panel.expanded { position: fixed; inset: 0; z-index: 99999; margin: auto; height: 85vh; width: 90vw; border-radius: 16px; border-color: rgba(255, 255, 255, 0.15); }
.sim-expand-scrim { position: fixed; inset: 0; z-index: 99998; background: rgba(0, 0, 0, 0.8); }
#viewport { position: relative; width: 100%; height: 100%; }
#viewport canvas { display: block; width: 100%; height: 100%; }
.sim-grid {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(0, 255, 71, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 255, 71, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

.sim-hints { position: absolute; right: 12px; top: 56px; z-index: 10; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; pointer-events: none; user-select: none; }
.hint { display: flex; align-items: flex-start; gap: 8px; line-height: 1; }
.hint .ic { display: flex; height: 14px; width: 14px; flex-shrink: 0; align-items: center; justify-content: center; color: #fff; }
.hint .ic img { width: 14px; height: 14px; }
.hint .dot { display: block; height: 10px; width: 10px; border-radius: 9999px; background: var(--blue); box-shadow: 0 0 6px rgba(0, 0, 0, 0.7), 0 0 8px rgba(105, 224, 255, 0.6); }
.hint .sq { display: block; height: 11px; width: 11px; border-radius: 2px; border: 1.6px solid var(--green-soft); box-shadow: 0 0 6px rgba(0, 0, 0, 0.6), 0 0 7px rgba(85, 255, 153, 0.4); }
.hint .txt { display: flex; flex-direction: column; gap: 4px; }
.hint .t1 { font-size: 12px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85); }
.hint .t2 { font-size: 10.5px; color: rgba(255, 255, 255, 0.6); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85); }
.hint.dim .t1 { color: rgba(255, 255, 255, 0.6); }
.hint .flag { width: 14px; height: 14px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9)); }
.hint .flag.lit { filter: drop-shadow(0 0 6px rgba(72, 255, 136, 0.4)); }

.sim-actions { position: absolute; top: 12px; right: 12px; z-index: 10; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: flex; align-items: center; justify-content: center; gap: 4px; height: 32px; min-width: 32px;
  border-radius: 8px; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
  background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); color: #fff; padding: 0 6px;
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.7); }
.icon-btn.on { background: rgba(0, 255, 71, 0.18); border-color: rgba(0, 255, 71, 0.35); }
.icon-btn.on:hover { background: rgba(0, 255, 71, 0.24); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .chip { font-size: 10px; font-weight: 600; line-height: 1; }

.sim-sens {
  position: absolute; bottom: 12px; left: 12px; right: 12px; z-index: 10; display: flex; align-items: center;
  gap: 12px; padding: 6px 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.5);
}
.sim-sens .lbl { font-size: 12px; color: rgba(255, 255, 255, 0.6); white-space: nowrap; }
.sim-sens input { flex: 1; height: 4px; accent-color: var(--green-deep); cursor: pointer; }
.sim-sens .val { font-size: 12px; color: rgba(255, 255, 255, 0.8); width: 36px; text-align: right; }

.sim-status {
  position: absolute; left: 12px; top: 12px; z-index: 10; font-size: 12px; padding: 5px 10px; border-radius: 9999px;
  background: rgba(0, 0, 0, 0.55); border: 1px solid var(--line); color: rgba(255, 255, 255, 0.75);
}
.sim-status.paused { color: var(--green); border-color: rgba(72, 255, 136, 0.4); }

.guide-box {
  position: absolute; z-index: 5; pointer-events: none; border: 1px dashed rgba(72, 255, 136, 0.85);
  border-radius: 6px; background: rgba(72, 255, 136, 0.08); transform-origin: center;
}
.guide-box.pulse { animation: guidance-pulse 1.6s ease-in-out infinite; }
@keyframes guidance-pulse { 0%, 100% { opacity: 0.25; transform: scale(0.97); } 50% { opacity: 0.85; transform: scale(1.03); } }

.loading-overlay { position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #000; }
.loading-overlay .ring { width: 34px; height: 34px; border-radius: 9999px; border: 2px solid rgba(72, 255, 136, 0.25); border-top-color: var(--green); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay .msg { font-size: 12px; color: var(--green); letter-spacing: 0.02em; }
.loading-overlay .bar { width: 220px; height: 3px; border-radius: 9999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.loading-overlay .bar > i { display: block; height: 100%; width: 0; background: var(--green); transition: width 0.25s ease; }

.sim-error { display: flex; height: 100%; align-items: center; justify-content: center; color: var(--green); font-size: 14px; }

.arm-cam { position: absolute; left: 12px; bottom: 56px; z-index: 10; width: 176px; height: 110px; border-radius: 8px; border: 1px solid var(--line); background: #000; overflow: hidden; }
.arm-cam canvas { display: block; width: 100%; height: 100%; }

/* right column */
.col-right { display: flex; flex-direction: column; gap: 24px; width: 300px; flex-shrink: 0; align-self: stretch; min-height: 0; overflow-y: auto; scrollbar-width: none; padding-bottom: 8px; }
.col-right::-webkit-scrollbar { display: none; }

.panel { position: relative; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 12px; background: rgba(255, 255, 255, 0.02); padding: 10px 0 12px; }
.panel-label { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: rgba(255, 255, 255, 0.78); padding: 0 12px; }
.panel-body { padding: 0 12px; }
.slots-num { margin-top: 22px; font-size: 32px; line-height: 1; color: #fff; font-family: var(--mono); }
.slots-sub { margin-top: 4px; font-size: 13px; color: rgba(255, 255, 255, 0.5); }

.diff-row { display: flex; align-items: center; justify-content: space-between; height: 16px; }
.diff-row .grp { display: flex; align-items: center; gap: 4px; }
.diff-row .lbl { font-size: 13px; color: rgba(255, 255, 255, 0.5); }
.diff-row .val { font-size: 13px; color: #fff; }
.diff-icons { display: flex; align-items: center; }
.diff-icons img { height: 16px; width: 16px; }

.action-stats-tabs { display: flex; flex-shrink: 0; flex-direction: column; gap: 12px; }
.action-stats-tabs__nav { display: flex; align-items: center; gap: 2px; }
.action-stats-tabs__nav button {
  display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 8px; font-size: 14px;
  font-weight: 500; color: rgba(255, 255, 255, 0.64); transition: 0.15s; cursor: pointer; background: transparent; border: none;
}
.action-stats-tabs__nav button:hover { color: #fff; }
.action-stats-tabs__nav button.active { background: #16181c; color: #fff; }
.dist-row { display: flex; height: 20px; align-items: center; gap: 8px; }
.dist-row + .dist-row { margin-top: 6px; }
.dist-label { width: 72px; flex-shrink: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.75); }
.dist-bar { height: 8px; min-width: 0; flex: 1; overflow: hidden; border-radius: 9999px; background: rgba(255, 255, 255, 0.1); }
.dist-bar > i { display: block; height: 100%; border-radius: 9999px; background: rgba(72, 255, 136, 0.75); }
.dist-count { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.6); }
.dist-avg { margin: 8px 0 0; font-size: 12px; color: rgba(255, 255, 255, 0.45); }
.rank-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.rank-badge { display: flex; width: 40px; align-items: center; }
.rank-badge img { height: 16px; width: 16px; object-fit: contain; }
.rank-badge span { font-size: 13px; font-weight: 500; color: #fff; }
.rank-name { width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; color: #fff; }
.rank-time { width: 40px; text-align: right; font-size: 13px; color: #fff; }
.rank-row.you .rank-badge span, .rank-row.you .rank-name, .rank-row.you .rank-time { color: var(--green); }
.panel.goal-ref { padding-bottom: 8px; }
.panel.goal-ref img { display: block; width: calc(100% - 16px); margin: 8px 8px 0; border-radius: 6px; max-height: 150px; object-fit: contain; background: #0b0b0d; }

/* ---------------------------------------------------------------- modals */
.modal-mask { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(3px); }
.modal-card { width: 420px; max-width: calc(100vw - 32px); border-radius: 12px; background: #0a0a0b; border: 1px solid rgba(72, 255, 136, 0.35); padding: 24px; position: relative; }
.modal-card.err { border-color: rgba(255, 88, 88, 0.45); }
.modal-x { position: absolute; right: 12px; top: 12px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: #1d1d1d; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.modal-x img { width: 14px; height: 14px; }
.modal-inner { display: flex; flex-direction: column; align-items: center; }
.modal-icon { display: block; }
.modal-title { font-size: 24px; font-weight: 700; line-height: 26px; margin: 20px 0; text-align: center; color: var(--green); }
.modal-card.err .modal-title { color: var(--red); }
.modal-sub { font-size: 14px; color: rgba(255, 255, 255, 0.7); margin: 8px 0 0; text-align: center; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; margin-top: 20px; }
.modal-tile { min-width: 182px; border-radius: 24px; background: rgba(255, 255, 255, 0.06); padding: 16px; display: flex; flex-direction: column; justify-content: space-between; }
.modal-tile .cap { display: flex; align-items: center; }
.modal-tile .cap img { width: 16px; height: 16px; }
.modal-tile .cap span { font-size: 13px; color: rgba(255, 255, 255, 0.7); margin-left: 4px; }
.modal-tile .big { font-size: 17px; font-weight: 500; line-height: 1.05; color: #fff; margin-top: 24px; word-break: break-word; }
.modal-single { width: 100%; text-align: center; background: rgba(255, 255, 255, 0.06); border-radius: 24px; padding: 16px; margin-top: 20px; }
.modal-single .cap { font-size: 13px; color: rgba(255, 255, 255, 0.7); }
.modal-single .big { font-size: 20px; font-weight: 500; line-height: 1.1; margin-top: 16px; color: #fff; }
.modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; width: 100%; }
.btn { flex: 1; height: 40px; border-radius: 8px; border: 1px solid transparent; font-size: 14px; font-weight: 600; cursor: pointer; color: #fff; }
.btn.basic { background: rgba(255, 255, 255, 0.08); }
.btn.basic:hover { background: rgba(255, 255, 255, 0.13); }
.btn.green { background: var(--green); color: #04110a; }
.btn.red { background: #ff7a7a; color: #2a0b0b; }
.btn.green:hover, .btn.red:hover { filter: brightness(1.06); }

/* ---------------------------------------------------------------- attribution */
.task-attribution-badge {
  display: inline-flex; min-height: 20px; align-items: center; justify-content: center;
  border: 1px solid rgba(72, 255, 136, 0.42); border-radius: 999px; padding: 2px 8px;
  background: #48ff881a; color: #48ff88; font: inherit; font-size: 10px; font-weight: 700;
  line-height: 1; letter-spacing: 0.08em; cursor: help; transition: border-color 0.15s ease, background 0.15s ease;
}
.task-attribution-badge:hover, .task-attribution-badge:focus-visible { border-color: #48ff88d1; background: #48ff882e; outline: none; }
.attribution-popover {
  position: fixed; z-index: 1200; max-width: min(440px, 100vw - 24px); border: 1px solid rgba(72, 255, 136, 0.2);
  border-radius: 14px; background: #121512; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48); padding: 14px 16px;
}
.task-attribution-content { width: min(400px, 100vw - 56px); color: rgba(255, 255, 255, 0.76); font-size: 12px; line-height: 1.5; }
.task-attribution-content p { margin: 0; }
.task-attribution-notice { color: rgba(255, 255, 255, 0.9); }
.task-attribution-section { margin-top: 14px; }
.task-attribution-heading { font-weight: 700; color: #fff; margin-bottom: 4px; }
.task-attribution-links { margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.task-attribution-links a { color: #48ff88; text-decoration: none; }
.task-attribution-links a:hover { text-decoration: underline; }
.task-attribution-license-list { display: flex; flex-direction: column; gap: 2px; }

/* ---------------------------------------------------------------- mobile */
.mobile-note { padding: 24px 16px; }
.mobile-note h2 { font-size: 32px; font-weight: 700; margin: 30px 0 10px; }
.mobile-note p { font-size: 14px; color: rgba(255, 255, 255, 0.7); text-align: center; line-height: 16.8px; margin: 0; }
.copy-link { display: flex; align-items: center; justify-content: center; background: var(--green); width: 100%; border-radius: 10px; padding: 12px; margin: 16px 0; cursor: pointer; border: none; font-size: 15px; font-weight: 600; color: #04110a; }
.copy-link img { width: 20px; height: 20px; margin-right: 10px; }
.mobile-note .hintline { font-size: 12px; color: rgba(255, 255, 255, 0.7); text-align: center; }

@media (max-width: 1023px) {
  .action-body { padding: 12px; }
  .col-left, .col-right { width: 100%; }
  .action-body-inner { flex-direction: column; }
}
