:root {
      color-scheme: dark;
      --ink: #f7f7f7;
      --muted: #a9a9a9;
      --line: #2b2b2b;
      --panel: #0b0b0b;
      --surface: #050505;
      --surface-soft: #101010;
      --accent: #ffffff;
      --accent-dark: #dcdcdc;
      --ok: #78f0a4;
      --warn: #ffd166;
      --miss: #ff6b7a;
      --cyan: #00ffcc;
      --pink: #ff0055;
    }

    * {
      box-sizing: border-box;
    }

    [hidden] {
      display: none !important;
    }

    .visually-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    html {
      min-height: 100%;
      background: var(--surface);
      overscroll-behavior-y: none;
    }

    body {
      margin: 0;
      min-height: 100vh;
      background:
        linear-gradient(rgba(18, 18, 18, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(18, 18, 18, 0.3) 1px, transparent 1px),
        var(--surface);
      background-size: 40px 40px;
      animation: gridPulse 6s infinite ease-in-out;
      color: var(--ink);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      letter-spacing: 0;
      overflow-x: hidden;
      overscroll-behavior-y: none;
    }

    .shell {
      width: min(1120px, calc(100vw - 32px));
      margin: 0 auto;
      padding: 28px 0;
    }

    header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      padding: 12px 0 22px;
      border-bottom: 1px solid var(--line);
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .brand-home {
      min-height: auto;
      border: 0;
      padding: 0;
      background: transparent;
      color: inherit;
      box-shadow: none;
      cursor: pointer;
    }

    .brand-home:hover {
      color: var(--ink);
      border-color: transparent;
      background: transparent;
    }

    .nekst-mark {
      width: 58px;
      height: 58px;
      position: relative;
      perspective: 700px;
    }

    .nekst-logo-container {
      position: absolute;
      inset: 13px;
      transform-style: preserve-3d;
      animation: miniCrazyOrbit 12s infinite linear;
    }

    .nekst-box-frame {
      position: absolute;
      inset: 0;
      border: 3px solid #ffffff;
      background: transparent;
      box-shadow: 0 0 12px rgba(255,255,255,0.35), inset 0 0 10px rgba(255,255,255,0.12);
      animation: miniBoxMorph 4s infinite ease-in-out, miniGlitchColor 7s infinite linear;
    }

    .nekst-logo-text {
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      width: 100%;
      color: #fff;
      font-size: 5px;
      font-weight: 500;
      user-select: none;
      mix-blend-mode: difference;
    }

    .nekst-logo-text::before,
    .nekst-logo-text::after {
      content: "Nekst_Lab";
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      background: #050505;
    }

    .nekst-logo-text::before {
      left: 2px;
      text-shadow: -1px 0 var(--pink);
      clip: rect(8px, 80px, 18px, 0);
      animation: miniTextGlitch 3s infinite linear alternate-reverse;
    }

    .nekst-logo-text::after {
      left: -2px;
      text-shadow: -1px 0 var(--cyan), 0 1px #0000ff;
      clip: rect(18px, 80px, 30px, 0);
      animation: miniTextGlitch2 2.5s infinite linear alternate-reverse;
    }

    @keyframes miniCrazyOrbit {
      0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(1); }
      20% { transform: rotateX(20deg) rotateY(-35deg) rotateZ(10deg) scale(1.08); }
      35% { transform: rotateX(-45deg) rotateY(60deg) rotateZ(-20deg) scale(0.9); filter: hue-rotate(90deg); }
      50% { transform: rotateX(10deg) rotateY(180deg) rotateZ(180deg) scale(1.12); }
      65% { transform: rotateX(70deg) rotateY(45deg) rotateZ(220deg) scale(0.92); }
      80% { transform: rotateX(-20deg) rotateY(-70deg) rotateZ(320deg) scale(1.1); filter: hue-rotate(270deg); }
      100% { transform: rotateX(0deg) rotateY(360deg) rotateZ(360deg) scale(1); }
    }

    @keyframes miniBoxMorph {
      0%, 100% {
        border-radius: 0;
        border-width: 3px;
        transform: skew(0deg);
      }
      25% {
        border-radius: 0;
        transform: skew(-8deg, -4deg) scaleX(1.08);
        border-width: 5px;
      }
      50% {
        border-radius: 22% 8% 22% 8%;
        border-width: 2px;
      }
      75% {
        transform: scale(0.92) rotate(-5deg);
        border-width: 6px;
      }
    }

    @keyframes miniGlitchColor {
      0%, 19%, 21%, 69%, 71%, 100% {
        border-color: #ffffff;
        box-shadow: 0 0 12px rgba(255,255,255,0.35), inset 0 0 10px rgba(255,255,255,0.12);
      }
      20% {
        border-color: var(--pink);
        box-shadow: 0 0 18px var(--pink);
      }
      70% {
        border-color: var(--cyan);
        box-shadow: 0 0 18px var(--cyan);
      }
    }

    @keyframes miniTextGlitch {
      0% { clip: rect(3px, 80px, 14px, 0); transform: skew(0.4deg); }
      25% { clip: rect(16px, 80px, 3px, 0); transform: skew(-0.2deg); }
      50% { clip: rect(2px, 80px, 9px, 0); transform: skew(1deg); }
      75% { clip: rect(11px, 80px, 26px, 0); transform: skew(-0.4deg); }
      100% { clip: rect(18px, 80px, 10px, 0); transform: skew(0deg); }
    }

    @keyframes miniTextGlitch2 {
      0% { clip: rect(15px, 80px, 4px, 0); transform: translateX(-1px); }
      30% { clip: rect(20px, 80px, 8px, 0); transform: translateX(-2px); }
      60% { clip: rect(25px, 80px, 3px, 0); transform: translateX(-1px); }
      100% { clip: rect(21px, 80px, 16px, 0); transform: translateX(0); }
    }

    @keyframes gridPulse {
      0%, 100% { background-size: 40px 40px; }
      50% { background-size: 42px 42px; }
    }

    h1 {
      margin: 0;
      font-size: 28px;
      line-height: 1.1;
      font-weight: 760;
    }

    .brand-beta {
      position: relative;
      top: -0.65em;
      margin-left: 3px;
      color: var(--cyan);
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.08em;
    }

    .status {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      color: var(--muted);
      font-size: 14px;
      white-space: nowrap;
    }

    .header-actions {
      display: inline-flex;
      align-items: center;
      gap: 16px;
      margin-left: auto;
    }

    .header-auth-actions {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .auth-nav-link {
      color: var(--ink);
      font-size: 14px;
      font-weight: 700;
      text-decoration: underline;
      text-underline-offset: 4px;
      white-space: nowrap;
    }

    .auth-nav-link:hover {
      color: var(--accent-dark);
    }

    .dot {
      width: 9px;
      height: 9px;
      border-radius: 999px;
      background: var(--warn);
    }

    .dot.ok {
      background: var(--ok);
    }

    main {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 360px;
      gap: 22px;
      padding-top: 24px;
      align-items: start;
    }

    .admin-icon-link {
      width: 34px;
      min-width: 34px;
      min-height: 34px;
      padding: 2px;
      display: inline-grid;
      place-items: center;
      border: 0;
      background: transparent;
      color: #ffffff;
      box-shadow: none;
    }

    .admin-icon-link:hover,
    .admin-icon-link.active {
      color: var(--accent-dark);
      background: transparent;
      border: 0;
    }

    .admin-icon-link > .admin-icon {
      width: 28px;
      height: 28px;
      max-width: 28px;
      max-height: 28px;
      display: block;
      object-fit: contain;
      border-radius: 0;
    }

    .tab-panel {
      display: none;
    }

    .tab-panel.active {
      display: block;
    }

    .workspace {
      display: grid;
      gap: 16px;
    }

    .workflow-copy {
      margin: 0;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.55;
    }

    .workflow-copy strong {
      display: block;
      margin-bottom: 4px;
      color: var(--ok);
      font-size: 15px;
    }

    .panel {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 18px;
      box-shadow: 0 0 0 1px rgba(255,255,255,0.02), 0 10px 30px rgba(0,0,0,0.35);
    }

    .dropzone {
      display: grid;
      place-items: center;
      min-height: 330px;
      border: 1px solid #1d1d1d;
      border-radius: 8px;
      background: #f7f7f7;
      color: #050505;
      text-align: center;
      padding: 36px 24px;
      box-shadow: inset 0 0 0 1px rgba(0,0,0,0.02), 0 10px 24px rgba(0,0,0,0.22);
      transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
    }

    .dropzone.dragging {
      border-color: var(--cyan);
      background: #ffffff;
      transform: translateY(-1px);
    }

    .dropzone-content {
      display: grid;
      justify-items: center;
      gap: 10px;
      width: min(470px, 100%);
    }

    .upload-icon {
      width: 58px;
      height: 58px;
      margin-bottom: 4px;
      color: #050505;
    }

    .upload-icon path {
      stroke: currentColor;
      stroke-width: 1.8;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .drop-copy {
      margin: 0;
      color: #050505;
      font-size: 24px;
      line-height: 1.2;
      font-weight: 520;
    }

    .drop-or {
      margin: -2px 0 0;
      color: #050505;
      font-size: 18px;
      line-height: 1.2;
      font-weight: 420;
    }

    .file-name {
      margin: 0;
      color: #4b4b4b;
      font-size: 14px;
      overflow-wrap: anywhere;
      min-height: 18px;
      transition: color 120ms ease;
    }

    .file-name.error {
      color: #9b111e;
      font-weight: 650;
    }

    .file-name.notice {
      color: #050505;
      font-weight: 650;
    }

    .file-preview {
      width: 96px;
      height: 96px;
      display: grid;
      place-items: center;
      margin: 2px 0 0;
      padding: 0;
      border: 1px solid #d8d8d8;
      border-radius: 8px;
      background: #ffffff;
      color: #050505;
      overflow: hidden;
      box-shadow: 0 8px 18px rgba(0,0,0,0.16);
    }

    .file-preview[hidden] {
      display: none;
    }

    .file-preview img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .file-preview-icon {
      min-width: 54px;
      padding: 18px 8px;
      border: 2px solid #050505;
      border-radius: 4px;
      color: #050505;
      font-size: 14px;
      font-weight: 760;
      line-height: 1;
      text-transform: uppercase;
    }

    .file-preview:not(.image-preview-ready) {
      cursor: default;
    }

    .actions {
      display: none;
    }

    .submit-row {
      display: grid;
      grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.25fr);
      gap: 10px;
      margin-top: 6px;
      align-items: start;
    }

    button,
    .file-button {
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 10px 12px;
      background: #111;
      color: var(--ink);
      font: inherit;
      font-size: 14px;
      font-weight: 650;
      cursor: pointer;
    }

    button.primary {
      border-color: var(--accent);
      background: var(--accent);
      color: #050505;
      box-shadow: 0 0 18px rgba(255,255,255,0.16);
    }

    .button-with-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      white-space: nowrap;
    }

    button > svg,
    .file-button > svg {
      width: 16px;
      height: 16px;
      max-width: 16px;
      max-height: 16px;
      flex: 0 0 16px;
    }

    .button-with-icon > svg {
      width: 16px;
      height: 16px;
      flex: 0 0 auto;
      stroke: currentColor;
      stroke-width: 2;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    button:hover,
    .file-button:hover {
      border-color: var(--accent-dark);
    }

    .dropzone .file-button {
      min-height: 52px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      margin: 0;
      border-color: #050505;
      background: #050505;
      color: #ffffff;
      font-size: 20px;
      font-weight: 560;
      line-height: 1.05;
    }

    .dropzone .file-button:hover {
      background: #151515;
      border-color: #151515;
    }

    .dropzone .file-button svg {
      width: 25px;
      height: 25px;
      flex: 0 0 auto;
    }

    .dropzone .file-button path {
      stroke: currentColor;
      stroke-width: 1.9;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .upload-actions {
      display: grid;
      grid-template-columns: minmax(170px, 1fr) minmax(150px, 1fr);
      gap: 8px;
      width: min(430px, 100%);
      align-items: stretch;
    }

    .camera-button {
      min-height: 52px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      border-color: #050505;
      background: #050505;
      color: #ffffff;
      font-size: 20px;
      line-height: 1.05;
      font-weight: 560;
      white-space: nowrap;
    }

    .camera-button:hover {
      background: #151515;
      border-color: #151515;
    }

    .camera-button svg {
      width: 27px;
      height: 27px;
      flex: 0 0 auto;
    }

    .camera-button path,
    .camera-button circle {
      stroke: currentColor;
      stroke-width: 1.9;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .camera-panel {
      position: fixed;
      inset: 0;
      z-index: 80;
      display: grid;
      place-items: center;
      padding: 24px;
      background: rgba(0,0,0,0.72);
      backdrop-filter: blur(2px);
    }

    .camera-panel[hidden] {
      display: none;
    }

    .camera-dialog {
      width: min(430px, 100%);
      display: grid;
      gap: 12px;
      padding: 14px;
      border: 1px solid rgba(255,255,255,0.18);
      border-radius: 8px;
      background: #f7f7f7;
      color: #050505;
      box-shadow: 0 24px 80px rgba(0,0,0,0.6);
    }

    .camera-panel video {
      width: 100%;
      aspect-ratio: 3 / 4;
      max-height: min(72vh, 720px);
      border-radius: 7px;
      background: #050505;
      object-fit: cover;
    }

    .camera-panel.landscape-stream .camera-dialog {
      width: min(700px, 100%);
    }

    .camera-panel.landscape-stream video {
      aspect-ratio: 16 / 9;
      max-height: min(58vh, 520px);
    }

    .camera-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .camera-actions button {
      min-height: 42px;
      border-color: #050505;
      background: #050505;
      color: #ffffff;
    }

    .camera-actions button:hover {
      background: #151515;
      border-color: #151515;
    }

    .camera-message {
      min-height: 18px;
      margin: 0;
      color: #4b4b4b;
      font-size: 13px;
      line-height: 1.35;
    }

    .image-preview-panel {
      position: fixed;
      inset: 0;
      z-index: 90;
      display: grid;
      place-items: center;
      padding: 24px;
      background: rgba(0,0,0,0.78);
      backdrop-filter: blur(2px);
    }

    .image-preview-panel[hidden] {
      display: none;
    }

    .image-preview-dialog {
      width: min(860px, 100%);
      max-height: calc(100vh - 48px);
      display: grid;
      gap: 12px;
      padding: 14px;
      border: 1px solid rgba(255,255,255,0.18);
      border-radius: 8px;
      background: #f7f7f7;
      color: #050505;
      box-shadow: 0 24px 80px rgba(0,0,0,0.62);
    }

    .image-preview-dialog img {
      width: 100%;
      max-height: min(72vh, 760px);
      border-radius: 7px;
      background: #050505;
      object-fit: contain;
    }

    .image-preview-caption {
      margin: 0;
      color: #4b4b4b;
      font-size: 13px;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .image-preview-dialog button {
      justify-self: end;
      min-width: 96px;
      border-color: #050505;
      background: #050505;
      color: #ffffff;
    }

    button.primary:hover {
      background: var(--accent-dark);
    }

    button:disabled {
      opacity: 0.55;
      cursor: not-allowed;
    }

    input[type="file"] {
      position: absolute;
      inline-size: 1px;
      block-size: 1px;
      opacity: 0;
    }

    label {
      display: block;
      color: var(--muted);
      font-size: 14px;
      font-weight: 650;
      margin: 12px 0 6px;
    }

    select {
      width: 100%;
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 9px 11px;
      background: #050505;
      color: var(--ink);
      font: inherit;
      font-size: 14px;
      font-weight: 620;
    }

    .destination-note {
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }

    .destination-label {
      margin-top: 14px;
    }

    .zip-option {
      display: flex;
      align-items: center;
      gap: 9px;
      margin-top: 12px;
      color: var(--ink);
      font-size: 14px;
      font-weight: 650;
    }

    .zip-option input {
      position: static;
      inline-size: 16px;
      block-size: 16px;
      opacity: 1;
      accent-color: var(--accent);
    }

    .privacy-note {
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
    }

    a {
      color: var(--cyan);
      text-decoration: none;
    }

    a:hover {
      text-decoration: underline;
    }

    .output {
      display: grid;
      gap: 12px;
    }

    .output.record-opened {
      animation: recordOpenedPulse 1400ms ease;
    }

    .record-notice {
      min-height: 18px;
      margin: 0;
      color: var(--ok);
      font-size: 13px;
      opacity: 0;
      transform: translateY(-4px);
      transition: opacity 180ms ease, transform 180ms ease;
    }

    .record-notice.active {
      opacity: 1;
      transform: translateY(0);
    }

    @keyframes recordOpenedPulse {
      0% {
        border-color: var(--line);
        box-shadow: 0 0 0 1px rgba(255,255,255,0.02), 0 10px 30px rgba(0,0,0,0.35);
      }
      18% {
        border-color: var(--ok);
        box-shadow: 0 0 0 1px rgba(120,240,164,0.65), 0 0 28px rgba(120,240,164,0.22);
      }
      100% {
        border-color: var(--line);
        box-shadow: 0 0 0 1px rgba(255,255,255,0.02), 0 10px 30px rgba(0,0,0,0.35);
      }
    }

    .result-state {
      margin: 0;
      font-size: 18px;
      font-weight: 760;
    }

    .result-state.ok {
      color: var(--ok);
    }

    .result-state.miss,
    .result-state.error {
      color: var(--miss);
    }

    dl {
      display: grid;
      gap: 10px;
      margin: 0;
    }

    dt {
      color: var(--muted);
      font-size: 12px;
      font-weight: 760;
      text-transform: uppercase;
    }

    dd {
      margin: 3px 0 0;
      overflow-wrap: anywhere;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
      font-size: 13px;
      line-height: 1.45;
    }

    .side {
      display: grid;
      gap: 16px;
    }

    .progress-steps {
      display: grid;
      gap: 8px;
      margin: 0;
      padding: 0;
      list-style: none;
    }

    .progress-bar {
      height: 6px;
      border: 1px solid var(--line);
      border-radius: 999px;
      overflow: hidden;
      background: #050505;
    }

    .progress-fill {
      height: 100%;
      width: 0%;
      background: #fff;
      box-shadow: 0 0 14px rgba(255,255,255,0.65);
      transition: width 220ms ease;
    }

    .progress-steps li {
      display: flex;
      align-items: center;
      gap: 9px;
      color: var(--muted);
      font-size: 13px;
    }

    .progress-dot {
      width: 9px;
      height: 9px;
      border-radius: 999px;
      border: 1px solid #98a6b0;
      background: #050505;
    }

    .progress-steps li.active .progress-dot {
      border-color: var(--accent);
      background: var(--accent);
      box-shadow: 0 0 0 5px rgba(11,107,203,0.13);
      animation: pulse 1s ease-in-out infinite;
    }

    .progress-steps li.done .progress-dot {
      border-color: var(--ok);
      background: var(--ok);
    }

    @keyframes pulse {
      0%, 100% {
        transform: scale(0.9);
      }
      50% {
        transform: scale(1.2);
      }
    }

    .steps {
      margin: 0;
      padding-left: 18px;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.55;
    }

    .warning-list {
      margin: 0;
      padding-left: 18px;
      color: var(--warn);
      font-size: 14px;
      line-height: 1.45;
    }

    .empty {
      color: var(--muted);
      font-size: 14px;
      line-height: 1.45;
      margin: 0;
    }

    .proofs-header {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      margin-bottom: 12px;
    }

    .proofs-header h2 {
      margin: 0;
      font-size: 18px;
      line-height: 1.2;
    }

    .table-wrap {
      overflow-x: auto;
      overflow-y: auto;
      max-height: 360px;
      border: 1px solid var(--line);
      border-radius: 8px;
    }

    .audit-table-wrap {
      max-height: 320px;
    }

    .proofs-table-wrap {
      max-height: 420px;
    }

    .users-table-wrap {
      max-height: 320px;
    }

    .pager {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      margin-top: 10px;
      color: var(--muted);
      font-size: 13px;
    }

    .pager button {
      min-height: 34px;
      padding: 7px 10px;
      font-size: 13px;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      background: #050505;
      min-width: 680px;
    }

    .proofs-table {
      min-width: 1080px;
      table-layout: fixed;
    }

    .proofs-table th:nth-child(1),
    .proofs-table td:nth-child(1) {
      width: 24%;
    }

    .proofs-table th:nth-child(2),
    .proofs-table td:nth-child(2) {
      width: 25%;
    }

    .proofs-table th:nth-child(3),
    .proofs-table td:nth-child(3) {
      width: 25%;
    }

    .proofs-table th:nth-child(4),
    .proofs-table td:nth-child(4) {
      width: 14%;
    }

    .proofs-table th:nth-child(5),
    .proofs-table td:nth-child(5) {
      width: 10%;
    }

    .proofs-table th:nth-child(6),
    .proofs-table td:nth-child(6) {
      width: 48px;
    }

    th,
    td {
      padding: 10px 12px;
      border-bottom: 1px solid var(--line);
      text-align: left;
      vertical-align: top;
      font-size: 13px;
    }

    th {
      color: var(--muted);
      font-size: 12px;
      text-transform: uppercase;
      background: #101010;
    }

    tr:last-child td {
      border-bottom: 0;
    }

    .mono {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
      overflow-wrap: anywhere;
    }

    .proofs-table .mono {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .delete-button {
      width: 34px;
      min-height: 34px;
      display: inline-grid;
      place-items: center;
      padding: 0;
      border-color: #3a1d23;
      color: var(--miss);
      background: #10080a;
    }

    .delete-button svg {
      width: 16px;
      height: 16px;
      stroke: currentColor;
      stroke-width: 2;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .table-actions {
      display: flex;
      gap: 8px;
      align-items: center;
      white-space: nowrap;
    }

    .small-action-button {
      min-height: 34px;
      padding: 7px 10px;
      font-size: 13px;
    }

    .admin-section {
      margin-bottom: 16px;
      padding-bottom: 16px;
      border-bottom: 1px solid var(--line);
    }

    .admin-section:last-child {
      margin-bottom: 0;
      padding-bottom: 0;
      border-bottom: 0;
    }

    .admin-section-title {
      margin: 0 0 12px;
      font-size: 18px;
      line-height: 1.2;
      color: var(--ink);
    }

    .admin-settings {
      display: grid;
      gap: 10px;
    }

    .admin-settings h2 {
      margin: 0;
      font-size: 18px;
      line-height: 1.2;
    }

    .mock-payment-panel {
      display: grid;
      gap: 10px;
      margin-top: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px;
      background: rgba(255,255,255,0.035);
    }

    .mock-payment-panel[hidden] {
      display: none;
    }

    .mock-payment-panel strong {
      display: block;
      margin-bottom: 4px;
      color: var(--ink);
      font-size: 14px;
    }

    .mock-payment-panel p {
      margin: 0;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
    }

    .mock-payment-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .payment-method-choices {
      display: grid;
      gap: 8px;
    }

    .payment-method-choice,
    .payment-method-admin-row {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      background: rgba(255,255,255,0.03);
    }

    .payment-method-admin-row {
      display: grid;
      gap: 10px;
    }

    .payment-method-admin-top {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto auto;
      gap: 10px;
      align-items: center;
    }

    .payment-method-choice {
      display: grid;
      place-items: center;
      width: 100%;
      min-height: 70px;
      border-radius: 6px;
      padding: 12px 18px;
      text-align: center;
      transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
    }

    .payment-method-choice.selected {
      box-shadow: 0 0 0 3px var(--accent);
      transform: translateY(-1px);
    }

    .payment-method-choice.dimmed {
      opacity: 0.42;
      filter: grayscale(0.7) brightness(0.72);
    }

    .payment-method-choice.dimmed:hover,
    .payment-method-choice.dimmed:focus-visible {
      opacity: 0.72;
      filter: grayscale(0.35) brightness(0.9);
    }

    .payment-logo {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      min-width: 0;
      min-height: 0;
      border-radius: 0;
      padding: 0;
      font-weight: 800;
      letter-spacing: 0;
      line-height: 1;
      box-shadow: none;
    }

    .payment-method-choice-stripe_card {
      border-color: #000;
      background: #000;
      color: #fff;
    }

    .payment-logo-stripe_card {
      background: transparent;
      color: #fff;
      font-size: 20px;
      font-weight: 500;
    }

    .payment-method-choice-paypal {
      border-color: #ffc439;
      border-radius: 999px;
      background: #ffc439;
      color: #003087;
    }

    .payment-logo-paypal {
      background: transparent;
      color: #003087;
      font-size: 24px;
      font-style: italic;
    }

    .payment-logo-paypal span {
      color: #0070ba;
      font-size: 32px;
      font-style: italic;
    }

    .payment-method-choice-apple_pay {
      border-color: #111;
      background: #fff;
      color: #111;
    }

    .payment-logo-apple_pay {
      background: transparent;
      color: #111;
      font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
      font-size: 31px;
      font-weight: 600;
    }

    .payment-method-choice-text,
    .payment-method-admin-identity > div {
      display: grid;
      gap: 3px;
      min-width: 0;
    }

    .payment-method-choice-text strong,
    .payment-method-admin-identity strong {
      color: var(--ink);
      font-size: 14px;
      line-height: 1.2;
    }

    .payment-method-choice-text span,
    .payment-method-admin-identity span {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.3;
    }

    .payment-settings-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }

    .payment-setting-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      min-height: 44px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 8px 10px;
      background: rgba(255,255,255,0.03);
      color: var(--muted);
      font-size: 13px;
    }

    .payment-setting-row select {
      min-width: 150px;
    }

    .payment-method-admin-list {
      display: grid;
      gap: 8px;
    }

    .payment-method-admin-identity {
      display: flex;
      gap: 10px;
      align-items: center;
      min-width: 0;
    }

    .payment-method-toggle {
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--muted);
      font-size: 13px;
      white-space: nowrap;
    }

    .payment-method-credentials {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      padding-top: 10px;
      border-top: 1px solid var(--line);
    }

    .payment-method-credential-note {
      grid-column: 1 / -1;
      margin: 0;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.4;
    }

    .account-shell {
      display: grid;
      gap: 16px;
    }

    .account-card,
    .auth-box {
      display: grid;
      gap: 10px;
    }

    .auth-forms {
      display: grid;
      gap: 16px;
    }

    .auth-dialog {
      position: relative;
      z-index: 1;
      width: min(330px, 100%);
      max-height: min(760px, calc(100vh - 40px));
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #080808;
      padding: 18px;
      box-shadow: 0 180px 520px 220px rgba(0,0,0,0.78), 0 54px 190px 96px rgba(0,0,0,0.68);
    }

    .modal-close-button {
      display: inline-grid;
      place-items: center;
      width: 38px;
      min-width: 38px;
      height: 38px;
      min-height: 38px;
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 0;
      background: #111;
      color: var(--ink);
      font-size: 20px;
      font-weight: 700;
      line-height: 1;
    }

    .modal-close-button:hover {
      border-color: var(--ink);
    }

    .auth-box {
      padding: 0;
      border: 0;
      background: transparent;
      position: relative;
    }

    .saved-proof-dialog {
      position: relative;
      z-index: 1;
      width: min(340px, 100%);
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #080808;
      padding: 18px;
      box-shadow: 0 140px 420px 170px rgba(0,0,0,0.76), 0 44px 150px 80px rgba(0,0,0,0.64);
    }

    .saved-proof-message {
      margin: 0 0 14px;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.45;
    }

    .auth-title-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 2px;
    }

    .auth-forms .auth-title-row {
      justify-content: flex-end;
    }

    .auth-forms #loginForm .auth-title-row,
    .auth-forms #registerForm .auth-title-row {
      position: absolute;
      top: 0;
      right: 0;
      margin: 0;
    }

    .auth-forms #forgotPasswordForm .auth-title-row,
    .auth-forms #resetPasswordForm .auth-title-row {
      justify-content: space-between;
    }

    .auth-title-row .admin-section-title {
      margin: 0;
    }

    .auth-box input {
      width: 100%;
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 9px 11px;
      background: #050505;
      color: var(--ink);
      font: inherit;
      font-size: 14px;
    }

    .auth-box input:disabled {
      color: var(--muted);
      opacity: 0.72;
      cursor: not-allowed;
    }

    .password-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 42px;
      gap: 8px;
      align-items: end;
    }

    .password-row input {
      min-width: 0;
    }

    .auth-help {
      margin: -2px 0 2px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }

    .auth-links {
      display: flex;
      flex-wrap: wrap;
      gap: 10px 16px;
      align-items: center;
      justify-content: center;
    }

    .text-link {
      min-height: auto;
      border: 0;
      padding: 0;
      background: transparent;
      color: var(--accent-dark);
      font-size: 13px;
      font-weight: 700;
      text-decoration: underline;
      text-underline-offset: 3px;
      box-shadow: none;
    }

    .text-link:hover {
      color: var(--ink);
      border-color: transparent;
    }

    .account-details {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      margin: 0;
    }

    .account-details div {
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #050505;
    }

    .account-details dt {
      color: var(--muted);
      font-size: 11px;
      font-weight: 760;
      text-transform: uppercase;
    }

    .account-details dd {
      margin: 5px 0 0;
      overflow-wrap: anywhere;
    }

    .pin-row {
      display: grid;
      grid-template-columns: minmax(160px, 1fr) 42px auto;
      gap: 8px;
      align-items: end;
    }

    .pin-row .button-with-icon {
      justify-self: start;
    }

    .pin-row input,
    .pin-display {
      width: 100%;
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 9px 11px;
      background: #050505;
      color: var(--ink);
      font: inherit;
      font-size: 14px;
      font-weight: 620;
    }

    .icon-button {
      width: 42px;
      min-height: 42px;
      display: inline-grid;
      place-items: center;
      padding: 0;
    }

    .icon-button svg {
      width: 17px;
      height: 17px;
      max-width: 17px;
      max-height: 17px;
      stroke: currentColor;
      stroke-width: 2;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .pin-message {
      min-height: 18px;
      margin: 0;
      color: var(--muted);
      font-size: 13px;
    }

    .pin-message.ok {
      color: var(--ok);
    }

    .pin-message.error {
      color: var(--miss);
    }

    .admin-section-spacer {
      margin-top: 10px;
    }

    .env-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .wallet-generator {
      display: grid;
      grid-template-columns: minmax(180px, 1fr) auto;
      gap: 8px;
      align-items: end;
    }

    .wallet-destination-groups {
      display: grid;
      gap: 12px;
    }

    .wallet-destination-group {
      display: grid;
      gap: 10px;
      padding: 12px 0;
      border-bottom: 1px solid var(--line);
    }

    .wallet-destination-group:last-child {
      border-bottom: 0;
    }

    .wallet-destination-header {
      display: grid;
      grid-template-columns: 16px minmax(0, 1fr);
      gap: 10px;
      align-items: center;
      min-height: 44px;
    }

    .chain-light {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
    }

    .chain-light.ready {
      background: var(--ok);
    }

    .chain-light.not-ready {
      background: var(--miss);
    }

    .destination-control-detail {
      display: grid;
      gap: 2px;
      min-width: 0;
    }

    .destination-control-detail strong {
      color: var(--ink);
      font-size: 14px;
      line-height: 1.2;
    }

    .destination-control-detail span,
    .destination-visibility {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.2;
    }

    .switch {
      position: relative;
      display: inline-block;
      width: 46px;
      height: 26px;
    }

    .switch input {
      position: absolute;
      opacity: 0;
      width: 1px;
      height: 1px;
    }

    .switch-slider {
      position: absolute;
      inset: 0;
      cursor: pointer;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: #101010;
      transition: background 0.16s ease, border-color 0.16s ease;
    }

    .switch-slider::before {
      content: "";
      position: absolute;
      width: 18px;
      height: 18px;
      left: 3px;
      top: 3px;
      border-radius: 50%;
      background: var(--muted);
      transition: transform 0.16s ease, background 0.16s ease;
    }

    .switch input:checked + .switch-slider {
      border-color: rgba(120, 240, 164, 0.45);
      background: rgba(120, 240, 164, 0.16);
    }

    .switch input:checked + .switch-slider::before {
      transform: translateX(20px);
      background: var(--ok);
    }

    .switch input:focus-visible + .switch-slider {
      outline: 2px solid var(--ink);
      outline-offset: 2px;
    }

    .env-field {
      display: grid;
      gap: 6px;
    }

    .env-input-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 42px;
      gap: 8px;
    }

    .destination-toggle-row {
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
    }

    .destination-toggle-control {
      display: inline-grid;
      grid-template-columns: 46px 28px;
      gap: 8px;
      align-items: center;
    }

    .env-input-row input {
      width: 100%;
      min-width: 0;
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 9px 11px;
      background: #050505;
      color: var(--ink);
      font: inherit;
      font-size: 13px;
    }

    .site-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px 18px;
      margin-top: 28px;
      padding: 18px 0 0;
      border-top: 1px solid var(--line);
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
    }

    .site-footer > div {
      display: flex;
      flex-wrap: wrap;
      gap: 8px 14px;
      align-items: center;
    }

    .footer-legal {
      min-width: 0;
    }

    .footer-meta {
      color: var(--muted);
      font-size: 11px;
    }

    .footer-separator {
      color: var(--line);
    }

    .site-footer a,
    .legal-page a {
      color: var(--accent-dark);
      text-decoration: none;
      text-underline-offset: 3px;
    }

    .site-footer a:hover,
    .legal-page a:hover {
      text-decoration: underline;
    }

    .site-footer strong {
      color: var(--ink);
      font-weight: 700;
    }

    #buildVersion {
      padding: 2px 8px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--accent-dark);
      white-space: nowrap;
    }

    .legal-page {
      max-width: 820px;
      margin: 34px auto 0;
      padding: 28px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(11, 11, 11, 0.88);
      color: var(--ink);
      line-height: 1.65;
    }

    .legal-page h1,
    .legal-page h2 {
      margin: 0;
      line-height: 1.2;
      letter-spacing: 0;
    }

    .legal-page h1 {
      font-size: clamp(30px, 5vw, 52px);
    }

    .legal-page h2 {
      margin-top: 28px;
      font-size: 18px;
    }

    .legal-page p,
    .legal-page li {
      color: var(--muted);
    }

    .legal-page ul {
      display: grid;
      gap: 10px;
      margin: 12px 0 0;
      padding-left: 22px;
    }

    .legal-page strong {
      color: var(--ink);
    }

    .legal-date {
      margin: 10px 0 24px;
      color: var(--accent-dark);
      font-size: 13px;
    }

    .pin-modal {
      position: fixed;
      inset: 0;
      display: none;
      place-items: center;
      padding: 20px;
      background: rgba(0,0,0,0.72);
      z-index: 20;
    }

    .pin-modal.active {
      display: grid;
    }

    .pin-modal.active::after {
      content: "";
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      height: 48vh;
      pointer-events: none;
      background: linear-gradient(
        to bottom,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0.28) 48%,
        rgba(0,0,0,0) 100%
      );
      z-index: 0;
    }

    .auth-modal {
      align-items: center;
    }

    .pin-pad {
      position: relative;
      z-index: 1;
      width: min(330px, 100%);
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #080808;
      padding: 18px;
      box-shadow: 0 190px 540px 230px rgba(0,0,0,0.78), 0 58px 200px 102px rgba(0,0,0,0.68);
    }

    .pin-pad h2 {
      margin: 0 0 12px;
      font-size: 18px;
    }

    .pin-display {
      margin-bottom: 12px;
      text-align: center;
      letter-spacing: 4px;
      font-size: 18px;
    }

    .keypad-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
    }

    .keypad-grid button {
      min-height: 52px;
      font-size: 18px;
    }

    @media (max-width: 820px) {
      main {
        grid-template-columns: 1fr;
      }

      header {
        align-items: flex-start;
        flex-direction: column;
      }

      .header-actions {
        width: 100%;
        justify-content: space-between;
      }

      .submit-row {
        grid-template-columns: 1fr;
        display: grid;
      }

      .proofs-header {
        align-items: stretch;
        flex-direction: column;
      }

      .proofs-header .button-with-icon {
        align-self: flex-start;
      }

      .pin-row {
        grid-template-columns: 1fr 42px;
      }

      .pin-row .button-with-icon {
        grid-column: 1 / -1;
        justify-self: start;
      }

      .env-grid {
        grid-template-columns: 1fr;
      }

      .payment-settings-grid {
        grid-template-columns: 1fr;
      }

      .payment-setting-row {
        align-items: flex-start;
        flex-direction: column;
      }

      .payment-setting-row select {
        width: 100%;
      }

      .payment-method-admin-top {
        grid-template-columns: 1fr;
        align-items: stretch;
      }

      .payment-method-toggle {
        justify-content: space-between;
      }

      .payment-method-credentials {
        grid-template-columns: 1fr;
      }

      .auth-forms,
      .account-details {
        grid-template-columns: 1fr;
      }

      .wallet-generator {
        grid-template-columns: 1fr;
      }

      .upload-actions {
        grid-template-columns: 1fr;
      }

      .site-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
        border-top: 1px solid var(--line);
        font-size: 13px;
      }

      .footer-meta {
        display: flex;
        gap: 6px;
        font-size: 11px;
      }
    }

    @media (max-width: 640px) {
      .shell {
        width: min(100% - 24px, 1120px);
        padding: 20px 0;
      }

      .panel {
        padding: 14px;
      }

      .table-wrap {
        max-height: 420px;
        overflow-x: auto;
        overflow-y: auto;
        border: 1px solid var(--line);
      }

      .pager {
        justify-content: space-between;
      }

      .button-with-icon {
        width: auto;
        max-width: 100%;
      }

      .admin-settings > .button-with-icon {
        justify-self: start;
      }

      .destination-toggle-row {
        grid-template-columns: minmax(0, 1fr) auto;
      }
    }
