/* =========================================================
   DOCUMIND
   GLOBAL VARIABLES
========================================================= */

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #fbfcfe;

  --ink: #101828;
  --ink-2: #273244;

  --muted: #667085;
  --muted-2: #98a2b3;

  --line: #e7eaf0;
  --soft: #f7f8fb;

  --violet: #6c5ce7;
  --violet-2: #8b7cff;
  --mint: #22c7a5;

  --navy: #0b1220;

  --ring-track: #eceef5;

  --success-bg: #ecfdf5;
  --success-text: #087f5b;

  --warning-bg: #fff7e6;
  --warning-text: #9a6700;

  --shadow:
    0 18px 55px rgba(16, 24, 40, .08);

  --shadow-small:
    0 8px 24px rgba(16, 24, 40, .06);

  --radius: 18px;

  color-scheme: light;
}


/* =========================================================
   DARK THEME
========================================================= */

html[data-theme="dark"] {

  --bg: #080b12;
  --surface: #111722;
  --surface-2: #0d131d;

  --ink: #f4f6fa;
  --ink-2: #d7deea;

  --muted: #a3adbd;
  --muted-2: #778397;

  --line: #242d3b;
  --soft: #151c28;

  --violet: #8b7cff;
  --violet-2: #a99fff;

  --mint: #35d8b5;

  --ring-track: #293242;

  --success-bg: #102b25;
  --success-text: #5ee0c0;

  --warning-bg: #302511;
  --warning-text: #f0bb55;

  --shadow:
    0 18px 55px rgba(0, 0, 0, .32);

  --shadow-small:
    0 8px 24px rgba(0, 0, 0, .24);

  color-scheme: dark;
}


/* =========================================================
   RESET
========================================================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background: var(--bg);
  color: var(--ink);

  transition:
    background-color .25s ease,
    color .25s ease;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

::selection {
  background: rgba(108, 92, 231, .22);
}


/* =========================================================
   BACKGROUND
========================================================= */

body::before {
  content: "";

  position: fixed;
  inset: 0;

  pointer-events: none;

  opacity: .45;

  background-image:
    linear-gradient(
      rgba(16, 24, 40, .025) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(16, 24, 40, .025) 1px,
      transparent 1px
    );

  background-size: 34px 34px;

  mask-image:
    linear-gradient(
      to bottom,
      black,
      transparent 75%
    );
}

html[data-theme="dark"] body::before {
  opacity: .25;

  background-image:
    linear-gradient(
      rgba(255, 255, 255, .025) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, .025) 1px,
      transparent 1px
    );
}

.ambient {
  position: fixed;

  width: 480px;
  height: 480px;

  border-radius: 50%;

  filter: blur(80px);

  pointer-events: none;

  opacity: .18;

  z-index: -1;
}

.ambient-a {
  top: -220px;
  left: -150px;

  background: #7c6df2;
}

.ambient-b {
  right: -200px;
  top: 420px;

  background: #22c7a5;
}

html[data-theme="dark"] .ambient {
  opacity: .10;
}


/* =========================================================
   SHELL
========================================================= */

.shell {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {
  height: 78px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid var(--line);

  transition:
    border-color .25s ease;
}

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

  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  border-radius: 10px;

  color: white;

  background:
    linear-gradient(
      135deg,
      var(--violet),
      #9b8eff
    );

  box-shadow:
    0 8px 22px rgba(108, 92, 231, .25);
}

.top-actions {
  display: flex;
  gap: 9px;
}

.icon-btn {
  width: 40px;
  height: 40px;

  display: grid;
  place-items: center;

  border: 1px solid var(--line);
  border-radius: 11px;

  background: var(--surface);
  color: var(--muted);

  transition:
    background .2s ease,
    border-color .2s ease,
    color .2s ease,
    transform .2s ease;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--violet);
  transform: translateY(-1px);
}

.theme-icon {
  font-size: 17px;
  line-height: 1;
}


/* =========================================================
   HERO
========================================================= */

.hero {
  position: relative;

  min-height: 410px;

  display: flex;
  align-items: center;

  overflow: hidden;

  margin-top: 20px;

  border-radius: 26px;

  background:
    radial-gradient(
      circle at 75% 30%,
      rgba(108, 92, 231, .30),
      transparent 32%
    ),
    radial-gradient(
      circle at 90% 90%,
      rgba(34, 199, 165, .14),
      transparent 30%
    ),
    #0b1220;

  color: white;

  box-shadow:
    0 25px 70px rgba(11, 18, 32, .18);
}

.hero-grid {
  position: absolute;
  inset: 0;

  opacity: .22;

  background-image:
    linear-gradient(
      rgba(255, 255, 255, .05) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, .05) 1px,
      transparent 1px
    );

  background-size: 38px 38px;

  mask-image:
    linear-gradient(
      90deg,
      black 20%,
      transparent 80%
    );
}

.hero-copy {
  position: relative;
  z-index: 2;

  width: 58%;

  padding: 64px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;

  margin-bottom: 18px;

  font-size: 11px;
  font-weight: 800;

  letter-spacing: .14em;
}

.pulse-dot {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: var(--mint);

  box-shadow:
    0 0 0 5px rgba(34, 199, 165, .12);
}

.hero h1 {
  margin: 0;

  font-size: clamp(44px, 5vw, 70px);

  line-height: .98;

  letter-spacing: -.055em;
}

.hero h1 span {
  color: #9f92ff;
}

.hero-copy p {
  max-width: 610px;

  margin: 25px 0 0;

  color: #aeb8c9;

  font-size: 15px;
  line-height: 1.75;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;

  gap: 8px;

  margin-top: 25px;
}

.hero-pills span {
  padding: 7px 11px;

  border: 1px solid rgba(255, 255, 255, .10);

  border-radius: 999px;

  color: #c7cfdb;

  background: rgba(255, 255, 255, .045);

  font-size: 11px;
  font-weight: 700;
}


/* =========================================================
   HERO ORBIT
========================================================= */

.hero-orbit {
  position: absolute;

  right: 5%;
  top: 50%;

  width: 390px;
  height: 390px;

  transform: translateY(-50%);
}

.orbit-ring {
  position: absolute;

  inset: 30px;

  border:
    1px solid rgba(255, 255, 255, .10);

  border-radius: 50%;
}

.ring-two {
  inset: 85px;

  border-color:
    rgba(139, 124, 255, .28);

  border-style: dashed;

  animation:
    spin 20s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.orbit-core {
  position: absolute;

  top: 50%;
  left: 50%;

  width: 92px;
  height: 92px;

  transform: translate(-50%, -50%);

  display: grid;
  place-items: center;

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      #8879f4,
      #5144bc
    );

  box-shadow:
    0 0 60px rgba(108, 92, 231, .45);
}

.orbit-core span {
  font-size: 27px;
}

.orbit-card {
  position: absolute;

  padding: 12px 15px;

  border:
    1px solid rgba(255, 255, 255, .10);

  border-radius: 13px;

  background:
    rgba(255, 255, 255, .06);

  backdrop-filter: blur(14px);

  color: #aeb8c9;

  font-size: 9px;
  font-weight: 800;

  letter-spacing: .12em;
}

.orbit-card b {
  display: block;

  margin-top: 3px;

  color: white;

  font-size: 21px;

  letter-spacing: -.03em;
}

.card-a {
  top: 72px;
  left: 12px;
}

.card-b {
  right: 5px;
  bottom: 70px;
}


/* =========================================================
   WORKSPACE
========================================================= */

.workspace {
  display: grid;

  grid-template-columns: 280px minmax(0, 1fr);

  gap: 18px;

  margin-top: 18px;
}

.sidebar,
.main-panel {
  border: 1px solid var(--line);
  border-radius: 20px;

  background: var(--surface);

  box-shadow: var(--shadow-small);

  transition:
    background-color .25s ease,
    border-color .25s ease,
    color .25s ease,
    box-shadow .25s ease;
}

.sidebar {
  min-height: 620px;

  display: flex;
  flex-direction: column;

  padding: 22px;
}

.side-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.side-kicker {
  color: var(--muted-2);

  font-size: 9px;
  font-weight: 800;

  letter-spacing: .14em;
}

.side-head h2 {
  margin: 5px 0 0;

  font-size: 19px;
  letter-spacing: -.03em;
}

.text-btn {
  border: 0;

  padding: 4px;

  background: transparent;
  color: var(--muted);

  font-size: 11px;
}

.text-btn:hover {
  color: var(--violet);
}

.history-search {
  display: flex;
  align-items: center;
  gap: 8px;

  margin-top: 20px;
  padding: 10px 12px;

  border: 1px solid var(--line);
  border-radius: 11px;

  background: var(--soft);

  transition:
    background .25s ease,
    border-color .25s ease;
}

.history-search span {
  color: var(--muted-2);
}

.history-search input {
  width: 100%;

  border: 0;
  outline: 0;

  background: transparent;
  color: var(--ink);

  font-size: 12px;
}

.history-search input::placeholder {
  color: var(--muted-2);
}

.history-list {
  flex: 1;

  margin-top: 15px;

  overflow: auto;
}

.history-item {
  margin-bottom: 6px;
}

.history-item button {
  width: 100%;

  padding: 12px;

  text-align: left;

  border: 1px solid transparent;
  border-radius: 12px;

  background: transparent;
  color: var(--ink);

  transition:
    background .2s ease,
    border-color .2s ease;
}

.history-item button:hover {
  background: var(--soft);
  border-color: var(--line);
}

.history-name {
  overflow: hidden;

  font-size: 12px;
  font-weight: 700;

  white-space: nowrap;
  text-overflow: ellipsis;
}

.history-meta {
  margin-top: 4px;

  color: var(--muted-2);

  font-size: 9px;
}

.empty-history {
  padding: 28px 8px;

  color: var(--muted);

  font-size: 11px;
  line-height: 1.7;

  text-align: center;
}

.side-foot {
  margin-top: 18px;
  padding-top: 16px;

  border-top: 1px solid var(--line);

  color: var(--muted-2);

  font-size: 9px;
  line-height: 1.6;
}


/* =========================================================
   MAIN PANEL
========================================================= */

.main-panel {
  min-height: 620px;

  padding: 32px;
}


/* =========================================================
   SECTION HEADER
========================================================= */

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin-bottom: 22px;
}

.section-head > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step {
  color: var(--violet);

  font-size: 11px;
  font-weight: 900;

  letter-spacing: .1em;
}

.section-head h2 {
  margin: 0;

  font-size: 22px;

  letter-spacing: -.035em;
}

.micro {
  color: var(--muted-2);

  font-size: 9px;
  font-weight: 800;

  letter-spacing: .12em;
}


/* =========================================================
   UPLOAD
========================================================= */

.upload-zone {
  min-height: 270px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: 30px;

  text-align: center;

  border: 1.5px dashed #cfd4df;
  border-radius: 18px;

  background:
    linear-gradient(
      180deg,
      #fcfdff,
      #f8f9fc
    );

  transition:
    background .25s ease,
    border-color .25s ease,
    transform .2s ease;
}

html[data-theme="dark"] .upload-zone {
  border-color: #354052;

  background:
    linear-gradient(
      180deg,
      #121925,
      #0f151f
    );
}

.upload-zone:hover {
  border-color: var(--violet);
}

.upload-zone.drag {
  border-color: var(--violet);

  background:
    rgba(108, 92, 231, .07);

  transform: scale(1.005);
}

.upload-icon {
  width: 52px;
  height: 52px;

  display: grid;
  place-items: center;

  margin-bottom: 14px;

  border: 1px solid #e2e4ec;
  border-radius: 15px;

  background: white;

  color: var(--violet);

  font-size: 22px;

  box-shadow:
    0 8px 22px rgba(16, 24, 40, .06);
}

html[data-theme="dark"] .upload-icon {
  border-color: #30394a;
  background: #151b28;
}

.upload-zone h3 {
  margin: 0;

  font-size: 18px;
  letter-spacing: -.025em;
}

.upload-zone p {
  margin: 8px 0 0;

  color: var(--muted);

  font-size: 12px;
}

.link-btn {
  padding: 0;

  border: 0;

  background: transparent;
  color: var(--violet);

  font-weight: 800;
}

.upload-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;

  gap: 7px;

  margin-top: 21px;
}

.upload-meta span,
.upload-meta em {
  padding: 6px 9px;

  border-radius: 7px;

  background: var(--soft);

  color: var(--muted);

  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.upload-meta em {
  background: transparent;
}


/* =========================================================
   SELECTED FILE
========================================================= */

.selected-file {
  display: flex;
  align-items: center;
  gap: 12px;

  margin-top: 12px;
  padding: 12px 14px;

  border: 1px solid var(--line);
  border-radius: 13px;

  background: var(--surface);

  transition:
    background .25s ease,
    border-color .25s ease;
}

.file-symbol {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  border-radius: 10px;

  background:
    rgba(108, 92, 231, .10);

  color: var(--violet);
}

.file-info {
  min-width: 0;

  display: flex;
  flex-direction: column;

  flex: 1;
}

.file-info b {
  overflow: hidden;

  font-size: 12px;

  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-info span {
  margin-top: 3px;

  color: var(--muted-2);

  font-size: 9px;
}

.remove-btn {
  width: 30px;
  height: 30px;

  border: 0;
  border-radius: 8px;

  background: var(--soft);
  color: var(--muted);

  font-size: 18px;
}

.remove-btn:hover {
  color: #e5484d;
}


/* =========================================================
   CONTROLS
========================================================= */

.control-row {
  display: grid;

  grid-template-columns: 1fr auto;

  gap: 15px;

  align-items: stretch;

  margin-top: 18px;
}

.depth-card {
  padding: 15px;

  border: 1px solid var(--line);
  border-radius: 15px;

  background: var(--surface);
}

.control-label {
  margin-bottom: 10px;

  color: var(--muted-2);

  font-size: 9px;
  font-weight: 900;

  letter-spacing: .12em;
}

.depth-options {
  display: grid;

  grid-template-columns:
    repeat(3, 1fr);

  gap: 8px;
}

.depth-options button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  padding: 10px;

  border: 1px solid var(--line);
  border-radius: 10px;

  background: var(--surface);
  color: var(--muted);

  font-size: 11px;
  font-weight: 800;

  transition:
    background .2s ease,
    border-color .2s ease,
    color .2s ease;
}

.depth-options button:hover {
  border-color: var(--violet);
}

.depth-options button.active {
  border-color: rgba(108, 92, 231, .45);

  background:
    rgba(108, 92, 231, .09);

  color: var(--violet);
}

.depth-options small {
  margin-top: 4px;

  color: var(--muted-2);

  font-size: 8px;
  font-weight: 500;
}

.primary-btn,
.primary-mini {
  border: 0;

  border-radius: 13px;

  background:
    linear-gradient(
      135deg,
      var(--violet),
      #8173f0
    );

  color: white;

  font-weight: 800;

  box-shadow:
    0 10px 25px rgba(108, 92, 231, .20);

  transition:
    transform .2s ease,
    box-shadow .2s ease,
    opacity .2s ease;
}

.primary-btn {
  min-width: 205px;

  padding: 0 22px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  font-size: 12px;
}

.primary-btn:hover:not(:disabled),
.primary-mini:hover {
  transform: translateY(-2px);

  box-shadow:
    0 14px 30px rgba(108, 92, 231, .28);
}

.primary-btn:disabled {
  opacity: .42;
  box-shadow: none;
}


/* =========================================================
   LOADING
========================================================= */

.loading-view {
  min-height: 560px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
}

.loader-orb {
  width: 82px;
  height: 82px;

  display: grid;
  place-items: center;

  margin-bottom: 24px;

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      #8e80f5,
      #5749c8
    );

  color: white;

  font-size: 24px;

  box-shadow:
    0 0 60px rgba(108, 92, 231, .25);

  animation:
    breathe 1.8s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    transform: scale(1.08);
    box-shadow:
      0 0 80px rgba(108, 92, 231, .38);
  }
}

.loading-title {
  font-size: 22px;
  font-weight: 800;

  letter-spacing: -.035em;
}

.loading-view p {
  margin: 9px 0 20px;

  color: var(--muted);

  font-size: 12px;
}

.progress-track {
  width: min(420px, 80%);

  height: 6px;

  overflow: hidden;

  border-radius: 999px;

  background: var(--soft);
}

#progressBar {
  height: 100%;
  width: 0;

  border-radius: inherit;

  background:
    linear-gradient(
      90deg,
      var(--violet),
      var(--mint)
    );

  transition: width .35s ease;
}

.loading-steps {
  display: flex;

  gap: 22px;

  margin-top: 15px;

  color: var(--muted-2);

  font-size: 9px;
  font-weight: 700;
}

.loading-steps .done {
  color: var(--violet);
}


/* =========================================================
   RESULT HEADER
========================================================= */

.result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;
}

.eyebrow.dark {
  color: var(--violet);
}

.result-top h2 {
  margin: 4px 0 6px;

  font-size: 27px;

  letter-spacing: -.045em;

  overflow-wrap: anywhere;
}

.result-meta {
  color: var(--muted);

  font-size: 11px;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.secondary-btn,
.primary-mini {
  min-height: 38px;

  padding: 0 13px;

  border-radius: 10px;

  font-size: 11px;
}

.secondary-btn {
  border: 1px solid var(--line);

  background: var(--surface);
  color: var(--ink-2);

  transition:
    border-color .2s ease,
    background .2s ease;
}

.secondary-btn:hover {
  border-color: var(--violet);
}

.primary-mini {
  border: 0;
}


/* =========================================================
   METRICS
========================================================= */

.metrics {
  display: grid;

  grid-template-columns:
    repeat(4, 1fr);

  gap: 10px;

  margin-top: 22px;
}

.metric {
  padding: 15px;

  border: 1px solid var(--line);
  border-radius: 14px;

  background: var(--surface);

  transition:
    background .25s ease,
    border-color .25s ease;
}

.metric .value {
  font-size: 21px;
  font-weight: 850;

  letter-spacing: -.035em;
}

.metric .label {
  margin-top: 3px;

  color: var(--ink-2);

  font-size: 10px;
  font-weight: 800;
}

.metric .hint {
  margin-top: 4px;

  color: var(--muted-2);

  font-size: 8px;
}


/* =========================================================
   RESULT GRID
========================================================= */

.result-grid {
  display: grid;

  grid-template-columns:
    minmax(0, 1.45fr)
    minmax(280px, .75fr);

  gap: 12px;

  margin-top: 12px;
}

.brief-card {
  border: 1px solid var(--line);
  border-radius: 17px;

  background: var(--surface);

  transition:
    background .25s ease,
    border-color .25s ease;
}

.feature-card {
  padding: 24px;
}

.insight-card {
  padding: 22px;

  background:
    linear-gradient(
      180deg,
      var(--surface),
      var(--surface-2)
    );
}

.card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;

  color: var(--muted-2);

  font-size: 9px;
  font-weight: 900;

  letter-spacing: .13em;
}

.card-label span {
  color: var(--violet);
}

.summary-text {
  margin: 18px 0 25px;

  color: var(--ink-2);

  font-size: 15px;
  line-height: 1.8;
}

.subsection {
  padding-top: 20px;

  border-top: 1px solid var(--line);
}

.subsection + .subsection {
  margin-top: 20px;
}

.subhead {
  margin-bottom: 11px;

  color: var(--muted-2);

  font-size: 9px;
  font-weight: 900;

  letter-spacing: .12em;
}

.point {
  display: flex;
  gap: 10px;

  padding: 7px 0;

  color: var(--ink-2);

  font-size: 12px;
  line-height: 1.55;
}

.point i {
  width: 6px;
  height: 6px;

  flex: 0 0 6px;

  margin-top: 7px;

  border-radius: 50%;

  background: var(--violet);
}

.tags {
  display: flex;
  flex-wrap: wrap;

  gap: 6px;
}

.tag {
  padding: 7px 9px;

  border-radius: 8px;

  background:
    rgba(108, 92, 231, .09);

  color: var(--violet);

  font-size: 9px;
  font-weight: 800;
}


/* =========================================================
   CLARITY
========================================================= */

.clarity {
  display: flex;
  align-items: center;
  gap: 16px;

  margin-top: 22px;
}

.clarity-ring {
  position: relative;

  width: 82px;
  height: 82px;

  flex: 0 0 82px;

  display: grid;
  place-items: center;

  border-radius: 50%;

  background:
    conic-gradient(
      var(--violet) 0deg,
      var(--ring-track) 0deg
    );
}

.clarity-ring::before {
  content: "";

  position: absolute;

  width: 64px;
  height: 64px;

  border-radius: 50%;

  background: var(--surface);
}

.clarity-ring > div {
  position: relative;
  z-index: 1;

  display: flex;
  align-items: baseline;
}

.clarity-ring b {
  font-size: 20px;
}

.clarity-ring small {
  color: var(--muted-2);

  font-size: 8px;
}

.clarity h3 {
  margin: 0;

  font-size: 15px;
}

.clarity p {
  max-width: 180px;

  margin: 5px 0 0;

  color: var(--muted);

  font-size: 10px;
  line-height: 1.55;
}


/* =========================================================
   INSIGHTS
========================================================= */

.insight-block {
  margin-top: 25px;
  padding-top: 19px;

  border-top: 1px solid var(--line);
}

.cue {
  padding: 9px 0;

  border-bottom: 1px solid var(--line);

  color: var(--ink-2);

  font-size: 10px;
  line-height: 1.55;
}

.cue:last-child {
  border-bottom: 0;
}

.security-box {
  margin-top: 20px;
  padding: 11px 12px;

  border-radius: 10px;

  background: var(--success-bg);
  color: var(--success-text);

  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
}

.security-box.warn {
  background: var(--warning-bg);
  color: var(--warning-text);
}


/* =========================================================
   DETAIL TABS
========================================================= */

.detail-tabs {
  display: flex;
  align-items: center;

  gap: 18px;

  margin-top: 25px;

  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;

  padding: 11px 1px;

  border: 0;

  background: transparent;

  color: var(--muted-2);

  font-size: 10px;
  font-weight: 800;
}

.tab.active {
  color: var(--violet);
}

.tab.active::after {
  content: "";

  position: absolute;

  left: 0;
  right: 0;
  bottom: -1px;

  height: 2px;

  background: var(--violet);
}

.tab-spacer {
  flex: 1;
}

.method-badge {
  padding: 5px 8px;

  border-radius: 6px;

  background: var(--soft);

  color: var(--muted);

  font-size: 8px;
  font-weight: 800;

  letter-spacing: .08em;
}


/* =========================================================
   TAB PANELS
========================================================= */

.tab-panel {
  margin-top: 12px;

  overflow: hidden;

  border: 1px solid var(--line);
  border-radius: 14px;

  background: var(--surface-2);

  transition:
    background .25s ease,
    border-color .25s ease;
}

.text-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 9px 12px;

  border-bottom: 1px solid var(--line);
}

.text-tools span {
  color: var(--muted-2);

  font-size: 8px;
  font-weight: 900;

  letter-spacing: .1em;
}

.text-tools button {
  padding: 4px 0;

  border: 0;

  background: transparent;
  color: var(--violet);

  font-size: 9px;
  font-weight: 800;
}

.tab-panel pre {
  max-height: 360px;

  margin: 0;
  padding: 17px;

  overflow: auto;

  color: var(--ink-2);

  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;

  font-size: 10px;
  line-height: 1.7;

  white-space: pre-wrap;
  overflow-wrap: anywhere;
}


/* =========================================================
   FOOTER
========================================================= */

footer {
  padding: 24px 0 30px;

  text-align: center;

  color: var(--muted-2);

  font-size: 8px;
  font-weight: 900;

  letter-spacing: .15em;
}

footer span {
  margin: 0 5px;

  color: var(--violet);
}


/* =========================================================
   TOAST
========================================================= */

.toast {
  position: fixed;

  left: 50%;
  bottom: 25px;

  z-index: 100;

  max-width: calc(100% - 30px);

  padding: 11px 15px;

  border: 1px solid var(--line);
  border-radius: 10px;

  background: var(--surface);
  color: var(--ink);

  box-shadow: var(--shadow);

  font-size: 11px;
  font-weight: 700;

  opacity: 0;
  pointer-events: none;

  transform:
    translate(-50%, 15px);

  transition:
    opacity .25s ease,
    transform .25s ease,
    background .25s ease,
    color .25s ease;
}

.toast.show {
  opacity: 1;

  transform:
    translate(-50%, 0);
}


/* =========================================================
   UTILITIES
========================================================= */

.hidden {
  display: none !important;
}


/* =========================================================
   FOCUS STATES
========================================================= */

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {

  .hero-copy {
    width: 65%;
    padding: 48px;
  }

  .hero-orbit {
    right: -80px;
    transform:
      translateY(-50%)
      scale(.82);
  }

  .workspace {
    grid-template-columns: 235px minmax(0, 1fr);
  }

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


@media (max-width: 850px) {

  .shell {
    width: min(
      100% - 20px,
      720px
    );
  }

  .hero {
    min-height: 520px;
  }

  .hero-copy {
    width: 100%;
    padding: 38px;
  }

  .hero-orbit {
    opacity: .22;

    right: -100px;
    bottom: -100px;
    top: auto;

    transform: scale(.7);
  }

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

  .sidebar {
    min-height: auto;
  }

  .history-list {
    max-height: 230px;
  }

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

  .primary-btn {
    min-height: 52px;
  }

  .metrics {
    grid-template-columns:
      repeat(2, 1fr);
  }
}


@media (max-width: 600px) {

  .shell {
    width: min(
      100% - 14px,
      100%
    );
  }

  .topbar {
    height: 66px;
  }

  .hero {
    margin-top: 12px;

    min-height: 490px;

    border-radius: 20px;
  }

  .hero-copy {
    padding: 30px 23px;
  }

  .hero h1 {
    font-size: 44px;
  }

  .hero-copy p {
    font-size: 13px;
  }

  .hero-orbit {
    right: -130px;
    bottom: -125px;

    transform: scale(.58);
  }

  .main-panel {
    padding: 20px 15px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;

    gap: 8px;
  }

  .section-head h2 {
    font-size: 19px;
  }

  .upload-zone {
    min-height: 235px;

    padding: 24px 15px;
  }

  .upload-zone h3 {
    font-size: 17px;
  }

  .upload-meta {
    gap: 5px;
  }

  .upload-meta span,
  .upload-meta em {
    padding: 5px 7px;
  }

  .depth-options {
    grid-template-columns: 1fr;
  }

  .depth-options button {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .depth-options small {
    margin-top: 0;
  }

  .result-top {
    flex-direction: column;
  }

  .result-actions {
    width: 100%;
  }

  .secondary-btn,
  .primary-mini {
    flex: 1;
  }

  .result-top h2 {
    font-size: 23px;
  }

  .metrics {
    grid-template-columns:
      repeat(2, 1fr);
  }

  .metric {
    padding: 12px;
  }

  .metric .value {
    font-size: 18px;
  }

  .feature-card,
  .insight-card {
    padding: 18px;
  }

  .summary-text {
    font-size: 13px;
  }

  .detail-tabs {
    gap: 13px;
  }

  .tab {
    font-size: 9px;
  }

  .method-badge {
    display: none;
  }
}


@media (max-width: 400px) {

  .hero h1 {
    font-size: 38px;
  }

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

  .result-actions {
    flex-direction: column;
  }

  .secondary-btn,
  .primary-mini {
    width: 100%;
  }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;

    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;

    transition-duration: .01ms !important;
  }
}
