/* Recall Lab: the app's dark theme tokens and component styles (button, badge, input, select,
 * settings card, table), copied from Neoro-MAS-Frontend so the page looks like the app. */
:root {
 color-scheme: dark;
 --background: #030303;
 --foreground: oklch(0.985 0 0);
 --secondary: #151515;
 --muted: #252525;
 --muted-foreground: #979797;
 --primary: #0163ff;
 --accent: #01388a;
 --destructive: oklch(0.704 0.191 22.216);
 --emerald: oklch(0.696 0.17 162.48);
 --line: #252525;
 --row-line: oklch(1 0 0 / 5%);
 --ring: oklch(0.556 0 0);
 --radius: 0.625rem;
}

*,
*::before,
*::after {
 box-sizing: border-box;
}
[hidden] {
 display: none !important;
}
html {
 font-family: Inter, ui-sans-serif, system-ui, sans-serif;
 -webkit-font-smoothing: antialiased;
}
body {
 margin: 0;
 background: var(--background);
 color: var(--foreground);
 font-size: 14px;
 line-height: 20px;
}
h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
 margin: 0;
 padding: 0;
}
ul,
ol {
 list-style: none;
}
button,
input,
select {
 font: inherit;
 color: inherit;
}
svg {
 flex-shrink: 0;
}

/* Text helpers */
.text-muted {
 color: var(--muted-foreground);
 font-weight: 400;
}
.text-destructive {
 color: var(--destructive);
}
.text-sm {
 font-size: 14px;
 line-height: 20px;
}
.caption {
 display: block;
 color: var(--muted-foreground);
 font-size: 12px;
 line-height: 20px;
}
.strong {
 font-weight: 500;
}
.truncate {
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}

/* Buttons */
.btn {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 6px;
 border: none;
 font-size: 14px;
 font-weight: 500;
 white-space: nowrap;
 cursor: pointer;
 outline: none;
 transition: all 0.15s;
}
.btn:focus-visible {
 box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 30%, transparent);
}
.btn:disabled {
 pointer-events: none;
 opacity: 0.5;
}
.btn svg {
 width: 16px;
 height: 16px;
}
.btn-primary {
 height: 40px;
 padding: 0 12px;
 border-radius: var(--radius);
 background: linear-gradient(to right in oklab, var(--accent) 0%, var(--primary) 100%);
 color: #fff;
}
.btn-primary:hover {
 opacity: 0.9;
}
.btn-block {
 width: 100%;
}
.inline-action {
 height: 32px;
 padding: 0 12px;
 border: 1px solid var(--line);
 border-radius: 999px;
 background: transparent;
 font-size: 12px;
}
.inline-action:hover {
 background: var(--line);
}

/* Form fields */
.label {
 display: flex;
 gap: 4px;
 margin-bottom: 6px;
 font-size: 14px;
 font-weight: 500;
 line-height: 12px;
}
.input,
.select select {
 width: 100%;
 min-width: 0;
 height: 36px;
 padding: 4px 12px;
 border: 1px solid var(--muted);
 border-radius: 8px;
 background: var(--secondary);
 font-size: 14px;
 outline: none;
 transition: box-shadow 0.15s;
}
.input::placeholder {
 color: var(--muted-foreground);
}
.input:focus-visible,
.select select:focus-visible {
 border-color: var(--ring);
 box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 30%, transparent);
}
.input.invalid {
 border-color: var(--destructive);
}
.select {
 position: relative;
}
.select select {
 appearance: none;
 padding-right: 36px;
 border-color: var(--line);
 cursor: pointer;
}
.select select:disabled {
 cursor: not-allowed;
 opacity: 0.5;
}
.select svg {
 position: absolute;
 top: 10px;
 right: 12px;
 width: 16px;
 height: 16px;
 color: var(--muted-foreground);
 pointer-events: none;
}

/* Badge (outline) */
.badge {
 display: inline-flex;
 align-items: center;
 height: 20px;
 padding: 2px 8px;
 border: 1px solid var(--line);
 border-radius: 24px;
 font-size: 14px;
 font-weight: 500;
 line-height: 20px;
 white-space: nowrap;
 text-transform: capitalize;
}
.badge.queued {
 color: var(--muted-foreground);
}
.badge.running {
 border-color: color-mix(in oklab, var(--primary) 40%, transparent);
 color: var(--primary);
}
.badge.done {
 border-color: color-mix(in oklab, var(--emerald) 40%, transparent);
 color: var(--emerald);
}
.badge.failed,
.badge.refused {
 border-color: color-mix(in oklab, var(--destructive) 40%, transparent);
 color: var(--destructive);
}
.badge.plain {
 text-transform: none;
}

/* Password gate */
.gate {
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 min-height: 100dvh;
 padding: 40px 16px;
}
.logo {
 width: auto;
 height: 48px;
 margin-bottom: 40px;
 color: var(--foreground);
}
.gate-title {
 margin-bottom: 8px;
 font-size: 18px;
 font-weight: 500;
 line-height: 28px;
}
.gate-sub {
 color: var(--muted-foreground);
 font-size: 14px;
 font-weight: 400;
 line-height: 20px;
}
.gate-form {
 width: 100%;
 max-width: 384px;
 margin-top: 48px;
}
.form-error {
 margin-top: 6px;
 color: var(--destructive);
 font-size: 12px;
 line-height: 16px;
}
.gate-button {
 margin-top: 32px;
}

/* Lab page */
.page {
 width: 100%;
 max-width: 1024px;
 margin: 0 auto;
 padding: 40px 16px;
}
.page-header {
 margin-bottom: 32px;
}
.page-header h1 {
 font-size: 30px;
 font-weight: 600;
 line-height: 36px;
}
.page-header p {
 max-width: 672px;
 margin-top: 8px;
 color: var(--muted-foreground);
}
.choices {
 display: grid;
 grid-template-columns: 1fr;
 gap: 12px;
}
.choice {
 padding: 16px 20px;
 border: 1px solid transparent;
 border-radius: 16px;
 background: var(--secondary);
 text-align: left;
 cursor: pointer;
 transition: border-color 0.15s;
}
.choice:hover {
 border-color: var(--line);
}
.choice[aria-pressed="true"] {
 border-color: var(--primary);
}
.choice-head {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 8px;
}
.choice-name {
 font-size: 18px;
 font-weight: 600;
 line-height: 28px;
}
.choice p {
 margin-top: 4px;
 color: var(--muted-foreground);
}
.two-cards {
 display: grid;
 gap: 24px;
 margin-top: 24px;
}
.two-cards > .card {
 min-width: 0;
 margin-top: 0;
}

/* Settings section card */
.card {
 margin-top: 24px;
 padding: 24px;
 border-radius: 16px;
 background: var(--secondary);
}
.card h2 {
 margin-bottom: 24px;
 font-size: 18px;
 font-weight: 600;
 line-height: 28px;
}
.tile {
 border: 1px solid var(--line);
 border-radius: 14px;
}

/* Space left */
.big {
 color: var(--primary);
 font-size: 24px;
 font-weight: 600;
 line-height: 32px;
}
.bar {
 height: 8px;
 margin-top: 12px;
 overflow: hidden;
 border-radius: 999px;
 background: var(--muted);
}
.bar div {
 height: 100%;
 border-radius: 999px;
 background: var(--primary);
}
.bar.full div {
 background: var(--destructive);
}
.tiles {
 display: grid;
 grid-template-columns: 1fr 1fr;
 gap: 12px;
 margin-top: 24px;
}
.tiles .tile {
 padding: 12px 16px;
}
.tiles dt {
 color: var(--muted-foreground);
 font-size: 12px;
 line-height: 20px;
}
.tiles dd {
 font-size: 18px;
 font-weight: 600;
 line-height: 28px;
}
.note {
 margin-top: 16px;
 color: var(--muted-foreground);
 font-size: 12px;
 line-height: 20px;
}

/* Upload */
.full-note {
 margin-bottom: 16px;
}
.caption + .select {
 margin-top: 8px;
}
.agent-note {
 margin-top: 8px;
}
.files-head {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 12px;
 margin-top: 24px;
}
.files-label {
 font-weight: 500;
}
.picked {
 display: grid;
 gap: 8px;
 max-height: 192px;
 margin-top: 12px;
 padding-right: 4px;
 overflow-y: auto;
}
.picked:empty {
 display: none;
}
.picked li {
 display: flex;
 align-items: center;
 gap: 12px;
 padding: 10px 12px;
}
.picked .name {
 flex: 1;
 min-width: 0;
}
.picked .size {
 color: var(--muted-foreground);
 font-size: 12px;
}
.picked-hint {
 margin-top: 12px;
}
.upload-button {
 margin-top: 24px;
}
.message {
 margin-top: 12px;
}
.doc-icon {
 width: 20px;
 height: 20px;
 color: var(--muted-foreground);
}

/* This session */
.jobs {
 display: grid;
 gap: 12px;
}
.job {
 padding: 16px;
}
.job-head {
 display: flex;
 align-items: center;
 gap: 12px;
}
.job-head > div {
 flex: 1;
 min-width: 0;
}
.job-name {
 font-weight: 500;
}
.job-meta {
 color: var(--muted-foreground);
 font-size: 12px;
 line-height: 16px;
}
.stages {
 display: flex;
 flex-wrap: wrap;
 gap: 8px 16px;
 margin-top: 12px;
}
.stages li {
 display: flex;
 align-items: center;
 gap: 6px;
 font-size: 12px;
 line-height: 16px;
}
.stages svg,
.stages .circle {
 width: 16px;
 height: 16px;
}
.stages .done svg {
 color: var(--emerald);
}
.stages .running svg {
 color: var(--primary);
 animation: spin 1s linear infinite;
}
.stages .failed svg {
 color: var(--destructive);
}
.stages .waiting {
 color: var(--muted-foreground);
}
.stages .circle {
 border: 1px solid color-mix(in oklab, var(--muted-foreground) 40%, transparent);
 border-radius: 999px;
}
.job-error {
 margin-top: 12px;
 color: var(--destructive);
 font-size: 12px;
 line-height: 20px;
}
@keyframes spin {
 to {
  transform: rotate(360deg);
 }
}

/* Files table */
.summary {
 display: flex;
 flex-wrap: wrap;
 gap: 8px;
 margin-bottom: 16px;
}
.table-wrap {
 width: 100%;
 overflow-x: auto;
}
table {
 width: 100%;
 border-collapse: collapse;
 font-size: 14px;
}
tr {
 border-bottom: 1px solid var(--row-line);
 transition: background-color 0.15s;
}
tbody tr:last-child {
 border-bottom: 0;
}
tbody tr:hover {
 background: color-mix(in oklab, var(--muted) 20%, transparent);
}
th {
 height: 40px;
 padding: 16px;
 color: var(--muted-foreground);
 font-size: 12px;
 font-weight: 500;
 text-align: left;
 white-space: nowrap;
}
td {
 padding: 16px;
 vertical-align: middle;
 white-space: nowrap;
}
.num {
 text-align: right;
}
td.file {
 max-width: 280px;
}
td .sub {
 color: var(--muted-foreground);
 font-size: 12px;
 line-height: 16px;
}
td .sub.error {
 color: var(--destructive);
}
td .stage {
 margin-top: 4px;
}

@media (min-width: 640px) {
 .page {
  padding-right: 24px;
  padding-left: 24px;
 }
 .choices {
  grid-template-columns: repeat(3, 1fr);
 }
}
@media (min-width: 1024px) {
 .two-cards {
  grid-template-columns: 1fr 1fr;
 }
}

/* ---- Motion ---- */
body {
 overflow-x: clip;
}
/* A slow blue glow behind the page. */
.glow {
 position: fixed;
 top: 0;
 right: 0;
 left: 0;
 z-index: -1;
 height: 80vh;
 background:
  radial-gradient(40% 50% at 30% 25%, color-mix(in oklab, var(--primary) 16%, transparent), transparent 70%),
  radial-gradient(35% 45% at 75% 15%, color-mix(in oklab, var(--accent) 28%, transparent), transparent 70%);
 filter: blur(40px);
 pointer-events: none;
 animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
 from {
  transform: translate3d(-3%, -2%, 0) scale(1);
 }
 to {
  transform: translate3d(3%, 4%, 0) scale(1.08);
 }
}

/* Gate: the parts rise in, the logo's dots twinkle in a circle, a wrong password shakes the field. */
.gate > *,
.page > * {
 animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.gate > :nth-child(2),
.page > :nth-child(2) {
 animation-delay: 0.07s;
}
.gate > :nth-child(3),
.page > :nth-child(3) {
 animation-delay: 0.14s;
}
.gate > :nth-child(4),
.page > :nth-child(4) {
 animation-delay: 0.21s;
}
.page > :nth-child(5) {
 animation-delay: 0.28s;
}
@keyframes rise {
 from {
  opacity: 0;
  transform: translateY(14px);
 }
}
.logo path[fill="#0163FF"]:nth-child(n + 4) {
 transform-box: fill-box;
 transform-origin: center;
 animation: twinkle 2.4s ease-in-out infinite both;
}
.logo path:nth-child(10) {
 animation-delay: 0s;
}
.logo path:nth-child(7) {
 animation-delay: 0.15s;
}
.logo path:nth-child(4) {
 animation-delay: 0.3s;
}
.logo path:nth-child(5) {
 animation-delay: 0.45s;
}
.logo path:nth-child(6) {
 animation-delay: 0.6s;
}
.logo path:nth-child(9) {
 animation-delay: 0.75s;
}
.logo path:nth-child(12) {
 animation-delay: 0.9s;
}
.logo path:nth-child(11) {
 animation-delay: 1.05s;
}
.logo path:nth-child(8) {
 animation-delay: 1.2s;
}
@keyframes twinkle {
 0%,
 100% {
  opacity: 1;
  transform: scale(1);
 }
 50% {
  opacity: 0.35;
  transform: scale(0.7);
 }
}
.input.invalid {
 animation: shake 0.4s;
}
@keyframes shake {
 20%,
 60% {
  transform: translateX(-6px);
 }
 40%,
 80% {
  transform: translateX(6px);
 }
}

/* Index cards lift on hover; the picked one glows. */
.choice {
 transition:
  border-color 0.15s,
  transform 0.2s,
  box-shadow 0.2s;
}
.choice:hover {
 transform: translateY(-2px);
}
.choice[aria-pressed="true"] {
 box-shadow: 0 10px 30px -14px color-mix(in oklab, var(--primary) 70%, transparent);
}

/* Primary button: a light sweep on hover, moving stripes while it works. */
.btn-primary {
 position: relative;
 overflow: hidden;
 isolation: isolate;
}
.btn-primary::after {
 content: "";
 position: absolute;
 inset: 0;
 z-index: -1;
 background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 25%) 50%, transparent 70%);
 transform: translateX(-100%);
}
.btn-primary:hover::after {
 transform: translateX(100%);
 transition: transform 0.7s ease;
}
.btn-primary.busy {
 opacity: 1;
}
.btn-primary.busy::before {
 content: "";
 position: absolute;
 top: 0;
 right: 0;
 bottom: 0;
 left: -40px;
 z-index: -1;
 background: repeating-linear-gradient(-45deg, rgb(255 255 255 / 14%) 0 10px, transparent 10px 20px);
 animation: stripes 0.8s linear infinite;
}
@keyframes stripes {
 to {
  transform: translateX(28.28px);
 }
}

/* Space bar fills smoothly; a shimmer runs on it while a job writes to this index. */
.bar div {
 position: relative;
 overflow: hidden;
 transition:
  width 0.8s cubic-bezier(0.2, 0.7, 0.2, 1),
  background-color 0.3s;
}
.bar.live div::after {
 content: "";
 position: absolute;
 inset: 0;
 background: linear-gradient(90deg, transparent, rgb(255 255 255 / 45%), transparent);
 transform: translateX(-100%);
 animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
 to {
  transform: translateX(100%);
 }
}

/* Jobs slide in; a finished step's tick pops; a running badge has a beating dot. */
.job {
 animation: slide-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
 transition: border-color 0.6s;
}
.job.finished {
 border-color: color-mix(in oklab, var(--emerald) 35%, var(--line));
}
@keyframes slide-in {
 from {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
 }
}
.stages .icon {
 display: inline-flex;
}
.stages .done svg,
.stages .failed svg,
.job-badge .badge {
 animation: pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
@keyframes pop {
 from {
  opacity: 0;
  transform: scale(0.3);
 }
}
.badge.running::before {
 content: "";
 width: 6px;
 height: 6px;
 margin-right: 6px;
 border-radius: 50%;
 background: currentColor;
 animation: beat 1.2s ease-in-out infinite;
}
@keyframes beat {
 50% {
  opacity: 0.3;
  transform: scale(0.6);
 }
}

@media (prefers-reduced-motion: reduce) {
 *,
 *::before,
 *::after {
  animation: none !important;
  transition: none !important;
 }
}
