:root {
  --bg: #090b10;
  --card: #121620;
  --muted: #969eaf;
  --lime: #c7ff45;
  --line: #252b38;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(circle at 70% 10%, #20281d 0, transparent 25%), var(--bg);
  color: #f5f7fa;
  font-family: Inter, "PingFang SC", sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
nav {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(5vw, 24px);
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
nav div {
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  font-size: 21px;
  font-weight: 800;
}
.brand:before {
  content: "◩";
  color: var(--lime);
  margin-right: 8px;
}
.pill,
.cta {
  background: var(--lime);
  color: #10130b !important;
  padding: 11px 18px;
  border-radius: 8px;
  font-weight: 800;
  border: 0;
  display: inline-block;
  cursor: pointer;
}
main {
  max-width: 1200px;
  margin: auto;
  padding: 60px 24px;
  min-height: calc(100vh - 130px);
}
.hero {
  min-height: 500px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 50px;
}
.hero h1 {
  font-size: clamp(50px, 7vw, 90px);
  line-height: 0.96;
  margin: 24px 0;
}
.hero em {
  color: var(--lime);
  font-style: normal;
}
.hero p {
  color: var(--muted);
  font-size: 19px;
  max-width: 600px;
  line-height: 1.8;
}
.tag {
  color: var(--lime);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 13px;
}
.visual {
  aspect-ratio: 1.25;
  background: linear-gradient(135deg, #2a3227, #10151c);
  border: 1px solid #465233;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 70px;
  box-shadow: 0 30px 90px #000;
}
.visual small {
  display: block;
  font-size: 13px;
  color: var(--lime);
}
.features,
.grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.features article,
.card {
  background: rgba(18, 22, 32, 0.9);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.features b {
  color: var(--lime);
}
.features p,
.hint,
small {
  color: var(--muted);
  display: block;
}
.auth {
  max-width: 430px;
  margin: 50px auto;
}
.auth h1 {
  font-size: 38px;
}
.auth form,
.upload {
  display: grid;
  gap: 18px;
}
label {
  display: grid;
  gap: 8px;
  color: #ccd1da;
}
input,
select,
button {
  background: #0d1017;
  border: 1px solid #303746;
  color: #fff;
  border-radius: 8px;
  padding: 11px;
  font: inherit;
}
.inline {
  display: inline;
}
.inline button {
  padding: 7px;
}
.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 30px;
}
.pagehead h1 {
  font-size: 42px;
  margin: 10px 0;
}
.page-intro {
  margin: 0;
  color: var(--muted);
}
.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 5px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d1017;
}
.workspace-label {
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
}
.workspace-switcher button {
  padding: 9px 13px;
  cursor: pointer;
  color: var(--muted);
  border: 0;
  border-radius: 7px;
  background: transparent;
}
.workspace-switcher button.active {
  color: #0d1017;
  background: var(--lime);
}
.workspace-panel[hidden] {
  display: none;
}
.section-heading h2 {
  margin: 8px 0;
  font-size: 28px;
}
.section-heading p {
  margin: 0;
}
.balance {
  color: var(--muted);
}
.balance strong {
  display: block;
  color: var(--lime);
  font-size: 40px;
}
.grid {
  grid-template-columns: 420px 1fr;
}
.image-tools {
  margin-bottom: 22px;
}
.image-workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 14px;
}
.image-workspace-head h2 {
  margin: 8px 0;
  font-size: 30px;
}
.image-workflow-note {
  display: grid;
  gap: 5px;
  min-width: 280px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d1017;
}
.image-workflow-note span {
  font-size: 12px;
  color: var(--muted);
}
.feature-notice {
  margin: 10px 0 0;
  color: #c9d1df;
  font-size: 13px;
}
.image-editor {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
}
.image-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.control-section {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.control-section div {
  display: grid;
  gap: 4px;
}
.control-section small,
.canvas-head small {
  color: var(--muted);
}
.control-step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  color: var(--lime);
  border: 1px solid var(--lime);
  border-radius: 50%;
  font-size: 12px;
}
.image-file-picker {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 112px;
  padding: 18px;
  text-align: center;
  border: 1px dashed #525b6d;
  border-radius: 10px;
  background: #0d1017;
  cursor: pointer;
}
.image-file-picker:hover {
  border-color: var(--lime);
}
.image-file-picker small {
  color: var(--muted);
}
.image-file-picker input {
  max-width: 100%;
  margin-top: 8px;
}
.brush-section {
  margin-top: 4px;
}
.brush-control {
  display: grid;
  grid-template-columns: auto 1fr 38px;
  gap: 10px;
  align-items: center;
}
.brush-control input {
  padding: 0;
}
.brush-control output {
  text-align: right;
  color: var(--lime);
}
.secondary-action {
  cursor: pointer;
}
.image-submit-area {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.image-submit-area .image-message {
  min-height: 20px;
}
.image-canvas-panel {
  min-height: 560px;
  display: flex;
  flex-direction: column;
}
.canvas-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.canvas-head div {
  display: grid;
  gap: 5px;
}
.canvas-state {
  height: fit-content;
  padding: 6px 9px;
  color: var(--muted);
  background: #2b3040;
  border-radius: 99px;
  font-size: 12px;
}
.canvas-state.ready {
  color: var(--lime);
}
.image-empty-state {
  flex: 1;
  min-height: 430px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #0d1017;
}
.image-empty-state[hidden] {
  display: none;
}
.empty-frame {
  width: 72px;
  height: 54px;
  margin-bottom: 8px;
  border: 2px solid #525b6d;
  border-radius: 8px;
  box-shadow: inset 14px -12px 0 -10px #525b6d;
}
.image-tools-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
}
.image-tools-head h2 {
  margin: 8px 0;
  font-size: 30px;
}
.image-tabs {
  display: flex;
  gap: 8px;
}
.image-tabs button {
  cursor: pointer;
}
.image-tabs button.active {
  border-color: var(--lime);
  color: var(--lime);
}
.image-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 14px;
  align-items: end;
  margin-top: 20px;
}
.image-form[hidden],
.mask-stage[hidden] {
  display: none;
}
.image-message {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: var(--lime);
}
.mask-stage {
  position: relative;
  grid-column: 1 / -1;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  line-height: 0;
}
.mask-stage img {
  display: block;
  max-width: 100%;
  max-height: 520px;
}
.mask-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
  opacity: 0.55;
}
.mask-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}
.mask-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.modes[hidden] {
  display: none;
}
.processing-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.mode-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
}
.mode-section h3 {
  margin: 0 0 6px;
}
.mode-section .modes {
  grid-template-columns: 1fr;
  margin-top: 10px;
}
.modes label,
.single-mode {
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 8px;
}
.single-mode {
  display: flex;
  align-items: center;
  gap: 10px;
}
.single-mode[hidden] {
  display: none;
}
.single-mode div {
  display: grid;
  gap: 3px;
}
.single-mode small {
  color: var(--muted);
}
.estimate {
  padding: 15px;
  background: #192011;
  border-radius: 8px;
}
.poll-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #2a2113;
  color: #e8c37a;
  font-size: 13px;
}
.poll-notice[hidden] {
  display: none;
}
.combined-workspace {
  display: grid;
  gap: 18px;
}
.combined-upload {
  width: 100%;
}
.task-history {
  width: 100%;
}
.editor-guide {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.region-editor {
  display: grid;
  gap: 12px;
}
.region-editor[hidden] {
  display: none;
}
.video-stage {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #050608;
  line-height: 0;
  user-select: none;
  touch-action: none;
}
.video-stage video {
  display: block;
  width: 100%;
  min-height: 460px;
  max-height: 680px;
  object-fit: contain;
}
.region-overlay {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid var(--lime);
  background: rgba(185, 255, 72, 0.14);
  cursor: move;
  line-height: normal;
  touch-action: none;
  z-index: 3;
}
.region-overlay[hidden] {
  display: none;
}
.region-overlay.selected {
  border-width: 3px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75);
  z-index: 4;
}
.watermark-region {
  border-color: #ff9f43;
  background: rgba(255, 159, 67, 0.16);
}
.watermark-region .region-label,
.watermark-region .resize-handle {
  background: #ff9f43;
}
.region-overlay:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.draw-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  cursor: crosshair;
  touch-action: none;
}
.draw-layer.active {
  display: block;
}
.draw-layer.active + .region-overlay {
  z-index: 3;
  pointer-events: none;
}
.region-label {
  position: absolute;
  top: 5px;
  left: 7px;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--lime);
  color: #10140a;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}
.resize-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid #10140a;
  border-radius: 50%;
  background: var(--lime);
}
.resize-handle.nw { left: -9px; top: -9px; cursor: nwse-resize; }
.resize-handle.ne { right: -9px; top: -9px; cursor: nesw-resize; }
.resize-handle.sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.resize-handle.se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.region-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.region-toolbar div {
  display: grid;
  gap: 4px;
}
.region-toolbar .region-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}
.region-actions button.active {
  border-color: var(--lime);
  color: var(--lime);
}
.region-toolbar small {
  color: var(--muted);
}
.region-toolbar button {
  flex: 0 0 auto;
  padding: 8px 10px;
  cursor: pointer;
}
.estimate strong {
  color: var(--lime);
}
.upload-progress {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1017;
}
.upload-progress[hidden] {
  display: none;
}
.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #252b38;
}
.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
  transition: width 0.15s ease;
}
.progress-copy {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}
.progress-copy strong {
  color: var(--lime);
}
.cta:disabled {
  cursor: wait;
  opacity: 0.65;
}
video {
  width: 100%;
  border-radius: 8px;
}
.task {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.status {
  font-size: 12px;
  padding: 6px 9px;
  border-radius: 99px;
  background: #2b3040;
}
.status.success {
  color: var(--lime);
}
.status.failed,
.error {
  color: #ff7676;
}
.admin-grid {
  grid-template-columns: 1fr 1fr;
}
.wide {
  grid-column: 1/-1;
}
.table {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
td,
th {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
td form {
  display: flex;
  gap: 6px;
}
footer {
  text-align: center;
  color: #616978;
  padding: 25px;
  border-top: 1px solid var(--line);
}
@media (max-width: 760px) {
  .processing-sections {
    grid-template-columns: 1fr;
  }
  header nav span {
    display: none;
  }
  .workspace-switcher {
    width: 100%;
  }
  .workspace-switcher button {
    flex: 1;
  }
  .hero,
  .grid,
  .features,
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding-top: 30px;
  }
  .hero h1 {
    font-size: 54px;
  }
  .visual {
    order: -1;
  }
  .pagehead {
    align-items: start;
    flex-direction: column;
  }
  .image-tools-head,
  .image-workspace-head,
  .mask-toolbar,
  .canvas-head {
    align-items: stretch;
    flex-direction: column;
  }
  .image-workflow-note {
    min-width: 0;
  }
  .image-editor {
    grid-template-columns: 1fr;
  }
  .image-canvas-panel {
    min-height: 420px;
  }
  .image-empty-state {
    min-height: 300px;
  }
  .image-form {
    grid-template-columns: 1fr;
  }
  .image-message,
  .mask-stage,
  .mask-toolbar {
    grid-column: auto;
  }
  .wide {
    grid-column: auto;
  }
  .task {
    grid-template-columns: 1fr auto;
  }
  main {
    padding: 35px 16px;
  }
  td form {
    min-width: 360px;
  }
}
