:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.1);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --surface: #f5f5f7;
  --accent: #0071e3;
  --accent-dark: #005bb5;
  --warm: #bf5a1f;
  --blue: #0071e3;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.055);
  --soft-shadow: 0 8px 22px rgba(0, 0, 0, 0.045);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 52%, #ffffff 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
}

body.is-history-open {
  overflow: hidden;
}

body.is-auth-open {
  overflow: hidden;
}

body.has-result {
  overflow: hidden;
}

body.is-busy::after {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(245, 245, 247, 0.18);
  backdrop-filter: blur(2px);
  content: "";
}

button,
input,
select {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.app-shell {
  display: block;
  min-height: 100vh;
}

.workspace {
  padding: clamp(28px, 4vw, 48px) clamp(24px, 5vw, 72px) 52px;
}

body.has-result .app-shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

body.has-result .workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: 14px 32px 28px;
}

.topbar,
.history-header,
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.result-actions {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

body.has-result .result-header {
  flex: 0 0 auto;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  margin-bottom: 40px;
}

body.has-result .topbar {
  z-index: 120;
  overflow: visible;
  min-height: 42px;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  margin-bottom: 8px;
  border-radius: 16px;
  padding: 0 14px;
  background: rgba(251, 251, 253, 0.82);
  backdrop-filter: blur(24px);
}

.brand-lockup {
  grid-column: 2;
  display: grid;
  justify-items: center;
  text-align: center;
}

body.has-result .brand-lockup {
  grid-column: 1;
  justify-items: start;
  text-align: left;
}

.brand-lockup p {
  max-width: 560px;
  margin: 12px 0 0;
  color: #6e6e73;
  font-size: clamp(1.04rem, 1.8vw, 1.34rem);
  font-weight: 560;
  line-height: 1.28;
}

body.has-result .brand-lockup p {
  display: none;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2.9rem, 5.4vw, 5rem);
  font-weight: 680;
  line-height: 1;
  letter-spacing: 0;
}

body.has-result h1 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

body.has-result .brand-lockup h1 {
  cursor: pointer;
}

.brand-lockup h1:focus-visible {
  border-radius: 6px;
  outline: 3px solid rgba(0, 113, 227, 0.22);
  outline-offset: 5px;
}

h2 {
  margin-bottom: 0;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 0.98rem;
  font-weight: 700;
}

.docs-link,
.download-button,
.primary-button,
.ghost-button,
.analyze-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 15px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.docs-link,
.ghost-button {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  backdrop-filter: blur(18px);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 720;
  backdrop-filter: blur(18px);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.icon-button:hover {
  border-color: rgba(0, 0, 0, 0.16);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--soft-shadow);
}

.icon-button::before {
  font-size: 0.78rem;
  line-height: 1;
}

.icon-button[aria-label="History"]::before {
  content: "↺";
}

.icon-button[aria-label="API Docs"]::before {
  content: "</>";
}

.icon-button[aria-label="GitHub"]::before {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  background: currentColor;
  -webkit-mask: url("/static/github-mark.svg") center / contain no-repeat;
  mask: url("/static/github-mark.svg") center / contain no-repeat;
}

.topbar .docs-link {
  align-self: center;
}

.topbar-actions {
  grid-column: 3;
  display: flex;
  flex-shrink: 0;
  justify-self: end;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.auth-box {
  display: flex;
  align-items: center;
}

.auth-entry,
.auth-session {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 720;
  white-space: nowrap;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.auth-pill:hover {
  border-color: rgba(0, 0, 0, 0.16);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--soft-shadow);
}

.auth-avatar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1;
  text-transform: uppercase;
  backdrop-filter: blur(18px);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.auth-avatar-button:hover,
.auth-avatar-button[aria-expanded="true"] {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--soft-shadow);
}

.auth-account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 160;
  display: grid;
  min-width: 220px;
  gap: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(18px);
}

body.has-result .auth-account-menu {
  top: calc(100% + 8px);
}

.auth-account-menu[hidden] {
  display: none;
}

.auth-account-menu span {
  overflow: hidden;
  padding: 3px 4px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-account-menu button {
  min-height: 34px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 720;
}

.auth-account-menu button:hover {
  background: rgba(245, 245, 247, 0.95);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal-overlay {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(245, 245, 247, 0.62);
  backdrop-filter: blur(18px);
}

.auth-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.1);
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
}

.auth-modal-close:hover {
  background: rgba(0, 0, 0, 0.055);
  color: var(--ink);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form-title {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 680;
  letter-spacing: 0;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.auth-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
}

.auth-form input:focus {
  border-color: rgba(0, 113, 227, 0.45);
  outline: 3px solid rgba(0, 113, 227, 0.14);
}

.auth-submit-button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  background: #111113;
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 720;
  transition: background 160ms ease, transform 160ms ease;
}

.auth-submit-button:hover {
  background: #000;
}

.auth-cancel-button {
  min-height: 38px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-cancel-button:hover {
  background: rgba(245, 245, 247, 0.96);
}

.auth-mode-toggle {
  justify-self: center;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
}

.auth-mode-toggle:hover {
  color: var(--ink);
}

.auth-status {
  min-height: 18px;
  margin: 0;
  color: #bf5a1f;
  font-size: 0.82rem;
  font-weight: 650;
  text-align: center;
  white-space: normal;
}

body.has-result .topbar-actions {
  grid-column: 3;
  gap: 10px;
}

body.has-result .docs-link,
body.has-result .ghost-button,
body.has-result .download-button,
body.has-result .compact-action,
body.has-result .icon-button {
  width: auto;
  min-width: fit-content;
  flex-shrink: 0;
  min-height: 36px;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: none;
}

.topbar-actions .icon-button,
.result-actions .download-button,
.result-actions .reanalyze-mode-control,
.result-actions .compact-action {
  width: auto;
  min-width: fit-content;
  flex-shrink: 0;
  overflow: visible;
  white-space: nowrap;
  text-overflow: clip;
}

.primary-button,
.download-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 650;
  box-shadow: none;
}

.analyze-button {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  align-self: center;
  margin-top: -6px;
  min-width: 196px;
  min-height: 46px;
  border: 0;
  padding: 0 20px 0 24px;
  background: linear-gradient(180deg, #1684ff 0%, #0071e3 100%);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(0, 113, 227, 0.14);
  transform: translateZ(0);
}

.analyze-button::after {
  content: "›";
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.9;
  transform: translateY(-1px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.analyze-button.is-loading::after {
  width: 14px;
  height: 14px;
  background: conic-gradient(from 90deg, rgba(255, 255, 255, 0.18), #fff);
  border-radius: 50%;
  content: "";
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0);
  opacity: 1;
  transform: none;
  animation: spin 0.75s linear infinite;
}

.analyze-button:hover {
  background: linear-gradient(180deg, #0d7df5 0%, var(--accent-dark) 100%);
  box-shadow: 0 10px 22px rgba(0, 113, 227, 0.18);
}

.analyze-button:hover::after {
  transform: translate(2px, -1px);
}

.analyze-button.is-loading,
.analyze-button.is-loading:disabled {
  opacity: 1;
  background: linear-gradient(180deg, #0d7df5 0%, #006edb 100%);
  box-shadow: 0 8px 18px rgba(0, 113, 227, 0.16);
}

.upload-form .primary-button,
.compact-action {
  align-self: end;
  min-width: 96px;
  min-height: 38px;
  padding-inline: 20px;
}

.reanalyze-mode-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px 0 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.reanalyze-mode-control select {
  min-height: 26px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  outline: 0;
}

.reanalyze-mode-control:focus-within {
  border-color: rgba(0, 113, 227, 0.38);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.08);
}

.primary-button:hover,
.download-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: none;
}

.docs-link:hover,
.ghost-button:hover {
  border-color: rgba(0, 0, 0, 0.16);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--soft-shadow);
}

.result-panel,
.history-panel,
.status-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.tool-surface {
  width: min(920px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 28px;
  padding: clamp(22px, 3vw, 34px);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px);
}

body.has-result .tool-surface {
  position: fixed;
  top: 56px;
  left: 50%;
  z-index: 55;
  width: min(1040px, calc(100vw - 28px));
  max-height: calc(100vh - 90px);
  margin: 0;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  transform: translateX(-50%);
  animation: controls-in 180ms ease-out;
}

body.has-result.source-collapsed .tool-surface {
  display: none;
}

.source-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(560px, 100%);
  margin: 0 auto 24px;
  border-radius: 999px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.04);
}

.source-tabs::after {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  z-index: 0;
  width: calc((100% - 10px) / 2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.08);
  content: "";
  transition: transform 180ms cubic-bezier(0.2, 0, 0, 1);
}

.source-tabs:has(.source-tab[data-source-tab="arxiv"].active)::after {
  transform: translateX(100%);
}

body.has-result .source-tabs {
  margin-bottom: 14px;
}

.source-tab {
  position: relative;
  z-index: 1;
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

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

.source-panel {
  display: none;
}

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

.source-panel[data-source-panel="arxiv"].active {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
  max-height: calc(100vh - 285px);
}

body:not(.has-result) .source-panel[data-source-panel="arxiv"].active {
  display: block;
  max-height: none;
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 16px;
  width: min(760px, 100%);
  margin: 0 auto;
}

body.has-result .upload-form {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  width: min(760px, 100%);
}

.arxiv-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 18px;
}

.arxiv-direct-form {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.arxiv-filter-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.arxiv-query,
.compact-select {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.arxiv-query label,
.arxiv-direct-form label,
.compact-select span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.arxiv-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.arxiv-input-wrap:focus-within {
  border-color: rgba(0, 113, 227, 0.42);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.arxiv-query input,
.arxiv-direct-form input,
.compact-select select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.arxiv-input-wrap input {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px 0 20px;
  background: transparent;
  box-shadow: none;
}

.arxiv-search-button {
  display: inline-grid;
  place-items: center;
  min-width: 104px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 760;
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.arxiv-search-button:hover {
  background: var(--accent-dark);
  box-shadow: 0 8px 18px rgba(0, 113, 227, 0.18);
}

.arxiv-search-button:disabled {
  cursor: default;
  opacity: 0.72;
  box-shadow: none;
}

.arxiv-query input:focus,
.arxiv-direct-form input:focus,
.compact-select select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 122, 109, 0.14);
}

.arxiv-input-wrap input:focus {
  outline: 0;
}

.arxiv-search-status {
  min-height: 22px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.8rem;
}

.popular-searches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 20px 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 680;
}

.popular-searches[hidden] {
  display: none;
}

.popular-searches span {
  margin-right: 2px;
}

.popular-searches button {
  min-height: 30px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 720;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.popular-searches button:hover {
  border-color: rgba(0, 113, 227, 0.22);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--soft-shadow);
}

.arxiv-results {
  display: grid;
  min-height: 0;
  gap: 14px;
  max-height: min(52vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

body:not(.has-result) .arxiv-results {
  max-height: none;
  overflow: visible;
  overscroll-behavior: auto;
  padding-right: 0;
}

.arxiv-results::-webkit-scrollbar {
  width: 8px;
}

.arxiv-results::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

.arxiv-results::-webkit-scrollbar-track {
  background: transparent;
}

.arxiv-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0 2px;
}

.arxiv-pagination[hidden] {
  display: none;
}

.arxiv-pagination .result-meta {
  min-width: 110px;
  text-align: center;
  font-weight: 700;
}

.arxiv-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 106px;
  gap: 20px;
  border: 1px solid rgba(0, 0, 0, 0.075);
  border-radius: 18px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.78);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.arxiv-card:hover {
  border-color: rgba(0, 0, 0, 0.16);
  background: var(--panel-solid);
  box-shadow: var(--soft-shadow);
}

.arxiv-card h3 {
  margin-bottom: 8px;
  font-size: clamp(1.04rem, 1.5vw, 1.24rem);
  line-height: 1.18;
}

.arxiv-card p {
  line-height: 1.46;
}

.arxiv-authors {
  margin-bottom: 10px;
}

.arxiv-abstract {
  display: -webkit-box;
  margin-bottom: 0;
  overflow: hidden;
  color: #424245;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.arxiv-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.arxiv-card-actions a,
.arxiv-card-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
}

.arxiv-card-actions button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.arxiv-card-actions .arxiv-analyze {
  min-height: 40px;
  font-size: 0.84rem;
  box-shadow: 0 7px 16px rgba(0, 113, 227, 0.12);
}

.drop-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: center;
  gap: 14px;
  min-height: 340px;
  width: 100%;
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 248, 250, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 32px rgba(0, 0, 0, 0.045);
  cursor: pointer;
  text-align: center;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

body.has-result .drop-zone {
  grid-template-columns: minmax(0, 1fr);
  min-height: 220px;
  padding: 22px;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: rgba(0, 113, 227, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 16px 38px rgba(0, 0, 0, 0.065);
  transform: translateY(-1px);
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.upload-empty-state,
.upload-selected-state {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(100%, 620px);
}

.upload-empty-state[hidden],
.upload-selected-state[hidden] {
  display: none;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(180deg, #eaf4ff, #f7fbff);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 760;
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.12);
}

body.has-result .drop-icon {
  width: 52px;
  height: 56px;
}

body.has-result .drop-meta {
  display: block;
}

.drop-title {
  overflow-wrap: anywhere;
  max-width: 100%;
  color: var(--ink);
  font-size: clamp(1.18rem, 2vw, 1.36rem);
  font-weight: 760;
  line-height: 1.15;
}

.drop-choice {
  color: var(--accent);
  font-size: 0.98rem;
  font-weight: 700;
}

.folder-button {
  min-height: 42px;
  padding: 0 24px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.folder-button:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.folder-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
}

.drop-meta,
.result-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.drop-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.upload-ready-title {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 760;
}

.upload-file-list {
  width: 100%;
  overflow: hidden;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.upload-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 30px;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.055);
  text-align: left;
}

.upload-file-row:first-child {
  border-top: 0;
}

.upload-file-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-file-size {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
}

.upload-remove-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.12rem;
  line-height: 1;
}

.upload-remove-button:hover {
  background: rgba(0, 0, 0, 0.055);
  color: var(--ink);
}

.add-files-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 720;
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.clear-upload-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
}

.clear-upload-button:hover {
  border-color: rgba(0, 0, 0, 0.14);
  background: #fff;
}

.upload-actions .analyze-button {
  min-width: 172px;
  margin-top: 0;
}

.upload-batch-status {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 113, 227, 0.16);
  border-radius: 14px;
  background: rgba(0, 113, 227, 0.06);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 650;
}

.upload-batch-status.warning {
  border-color: rgba(184, 118, 0, 0.2);
  background: rgba(255, 183, 0, 0.1);
}

.project-nav {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(0, 0, 0, 0.075);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.project-workspace > .result-header {
  display: none;
}

.project-nav.single-paper {
  margin-bottom: 10px;
}

.project-nav.single-paper .paper-nav-row {
  display: none;
}

.project-header-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.project-title-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.project-active-title {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 760;
  line-height: 1.28;
  text-align: center;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

.project-section-label {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-name-button,
.project-name-input {
  min-width: 0;
  width: min(260px, 100%);
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 720;
}

.project-name-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-align: left;
}

.project-name-button span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-name-button:hover {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.035);
}

.project-name-button:disabled {
  cursor: default;
}

.project-name-edit-icon {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 720;
  opacity: 0;
}

.project-name-button:hover .project-name-edit-icon,
.project-name-button:focus-visible .project-name-edit-icon {
  opacity: 1;
}

.project-name-input:disabled {
  border-color: transparent;
  background: transparent;
  padding-inline: 0;
}

.project-status-summary,
.project-count {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}

.project-actions,
.paper-nav-row,
.project-nav-actions,
.project-paper-list {
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-actions {
  justify-content: flex-end;
  flex-shrink: 0;
  min-width: 0;
}

.analysis-mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  padding: 0 2px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
  white-space: nowrap;
}

.paper-nav-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.paper-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 0;
  justify-content: flex-end;
  padding-left: 8px;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.paper-navigator-current {
  display: block;
  flex: 0 0 auto;
  min-width: 76px;
  text-align: center;
}

.paper-navigator-current span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 680;
}

.paper-navigator-current strong {
  min-width: 0;
  max-width: min(300px, 28vw);
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paper-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.project-paper-list {
  align-items: stretch;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.project-paper-item,
.compare-tab {
  flex: 0 0 auto;
  min-height: 28px;
  max-width: 160px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
}

.project-paper-item span {
  min-width: 0;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-paper-item small {
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.045);
  color: var(--muted);
  font-size: 0.66rem;
  padding: 1px 5px;
  text-transform: capitalize;
}

.project-paper-item small.failed {
  background: rgba(210, 45, 45, 0.09);
  color: #b42318;
}

.project-paper-item.active {
  border-color: rgba(0, 113, 227, 0.25);
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent-dark);
}

.compare-tab {
  display: inline-flex;
  border-style: dashed;
  background: transparent;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.project-more-menu {
  position: relative;
}

.project-more-menu summary {
  cursor: pointer;
  list-style: none;
}

.project-more-menu summary::-webkit-details-marker {
  display: none;
}

.project-more-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  display: grid;
  gap: 4px;
  min-width: 190px;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.project-more-list button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  text-align: left;
}

.project-more-list .workspace-download-menu,
.project-more-list .workspace-reanalyze-menu {
  position: relative;
}

.project-more-list .workspace-download-menu summary,
.project-more-list .workspace-reanalyze-menu summary {
  display: flex;
  align-items: center;
  min-height: 32px;
  border-radius: 8px;
  padding: 0 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 650;
  list-style: none;
}

.project-more-list .workspace-download-menu summary::-webkit-details-marker,
.project-more-list .workspace-reanalyze-menu summary::-webkit-details-marker {
  display: none;
}

.project-more-list .workspace-download-menu summary:hover,
.project-more-list .workspace-reanalyze-menu summary:hover {
  background: rgba(0, 0, 0, 0.055);
}

.project-more-list .workspace-download-menu .download-menu-list,
.project-more-list .workspace-reanalyze-menu .workspace-submenu-list {
  top: 0;
  right: calc(100% + 8px);
}

.workspace-submenu-list {
  position: absolute;
  z-index: 35;
  display: grid;
  gap: 4px;
  min-width: 140px;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.project-more-list button:hover {
  background: rgba(0, 0, 0, 0.055);
}

.project-more-list button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.project-empty-state {
  display: grid;
  gap: 10px;
  padding: 28px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.mode-group {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: center;
  gap: 0;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 28px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.mode-group legend {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

body.has-result .mode-group legend {
  font-size: 0.94rem;
}

.mode-group::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 60px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.045);
  content: "";
}

.mode-group::after {
  position: absolute;
  left: 4px;
  bottom: 4px;
  z-index: 0;
  width: calc((100% - 8px) / 3);
  height: 52px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  content: "";
  transition: transform 180ms cubic-bezier(0.2, 0, 0, 1);
}

.mode-group:has(input[value="standard"]:checked)::after {
  transform: translateX(100%);
}

.mode-group:has(input[value="one_page"]:checked)::after {
  transform: translateX(200%);
}

.mode-group label {
  position: relative;
  z-index: 1;
  min-width: 0;
  cursor: pointer;
}

.mode-group input {
  position: absolute;
  opacity: 0;
}

.mode-group span {
  display: grid;
  align-content: center;
  gap: 2px;
  place-items: center;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 720;
  line-height: 1.1;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.mode-group strong {
  font-size: 0.86rem;
  font-weight: 760;
}

.mode-group small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-form .analyze-button {
  justify-self: center;
  align-self: center;
  margin-top: 2px;
}

body.has-result .mode-group span {
  min-height: 52px;
  font-size: 0.88rem;
}

.mode-group label:hover span {
  color: var(--ink);
}

.mode-group input:checked + span {
  color: var(--ink);
}

.mode-group input:checked + span small {
  color: rgba(29, 29, 31, 0.62);
}

.mode-group label:hover input:checked + span {
  color: var(--ink);
}

.status-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 70;
  display: grid;
  justify-items: center;
  width: min(320px, calc(100vw - 48px));
  gap: 12px;
  margin-top: 0;
  border-radius: 22px;
  padding: 22px 20px 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(28px) saturate(1.2);
  transform: translate(-50%, -50%);
  animation: status-in 180ms ease-out;
}

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

.status-panel p {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 760;
  max-width: 100%;
  text-align: center;
  white-space: normal;
}

.spinner {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes status-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 8px)) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes controls-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

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

.result-panel {
  margin-top: 20px;
  padding: clamp(20px, 3vw, 30px);
}

body.has-result .result-panel {
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: hidden;
  padding: 0;
}

body.has-result .result-header {
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 8px 16px;
  background: rgba(245, 245, 247, 0.76);
  backdrop-filter: blur(22px);
}

body.has-result .result-header > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

body.has-result .result-header .eyebrow,
body.has-result .result-header .result-meta {
  display: none;
}

body.has-result .result-header h2 {
  display: -webkit-box;
  overflow: hidden;
  max-width: none;
  margin: 0;
  color: #2d2d30;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

.reading-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.42fr) minmax(420px, 0.58fr);
  align-items: start;
  gap: 16px;
  margin-top: 20px;
}

body.has-result .reading-layout {
  grid-template-columns: minmax(460px, 480px) minmax(0, 1fr);
  align-items: stretch;
  flex: 1;
  min-height: 0;
  gap: 22px;
  margin-top: 0;
}

.analysis-column {
  min-width: 0;
}

body.has-result .analysis-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-right: 0;
  padding: 10px 0 0;
  background: transparent;
  overscroll-behavior: contain;
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

body.has-result .analysis-column::-webkit-scrollbar {
  width: 8px;
}

body.has-result .analysis-column::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

.pdf-panel {
  position: sticky;
  top: 18px;
  display: grid;
  grid-template-rows: minmax(560px, calc(100vh - 160px));
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--soft-shadow);
}

body.has-result .pdf-panel {
  position: static;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 0;
  background: #f5f5f7;
  box-shadow: none;
}

.download-menu {
  position: relative;
}

.download-menu summary {
  list-style: none;
  cursor: pointer;
}

.download-menu summary::-webkit-details-marker {
  display: none;
}

.download-menu[open] summary {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.download-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.download-menu-list p {
  margin: 8px 8px 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.download-menu-list p:first-child {
  margin-top: 4px;
}

body.has-result .download-menu-list {
  top: calc(100% + 6px);
}

.download-menu-list a {
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
}

.download-menu-list a:hover {
  background: #f0f7ff;
  color: var(--accent);
}

.download-menu-list a[hidden] {
  display: none;
}

.pdf-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.pdf-panel-header h3 {
  margin-bottom: 0;
}

.pdf-panel-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.pdf-panel-actions .result-meta {
  margin-bottom: 0;
}

.pdf-panel iframe {
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 0;
  border-radius: inherit;
  background: #f5f5f7;
}

body.has-result .pdf-panel iframe,
body.has-result .pdf-placeholder {
  min-height: 0;
}

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

.pdf-placeholder {
  display: grid;
  min-height: 560px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.pdf-placeholder[hidden] {
  display: none;
}

.empty-state {
  display: grid;
  min-height: 330px;
  place-items: center;
  text-align: center;
}

.result-panel.empty-state {
  display: none;
  min-height: 0;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.empty-copy {
  max-width: 440px;
}

.tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0 0 16px;
  border-bottom: 0;
  border-radius: 999px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.04);
}

.workspace-tab-list {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tabs .result-actions {
  margin-left: auto;
}

body.has-result .tabs {
  position: sticky;
  top: -10px;
  z-index: 3;
  flex: 0 0 auto;
  margin-bottom: 10px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.045);
  backdrop-filter: blur(18px);
}

body.has-result .tab-button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.tab-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.tabs .download-button {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  box-shadow: none;
}

body.has-result .tabs .download-button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.tabs .download-menu[open] .download-button,
.tabs .download-button:hover {
  background: var(--panel-solid);
  color: var(--ink);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.08);
}

.tab-button.active {
  background: var(--panel-solid);
  color: var(--ink);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.08);
}

.tab-panel {
  display: none;
  min-height: min(58vh, 620px);
}

body.has-result .tab-panel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

body.has-result .tab-panel.active {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 6px 96px 0;
}

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

.summary-block,
.summary-grid article,
.paper-info-card,
.evidence-layout article,
[data-panel="references"] article {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  padding: 24px;
  background: rgba(252, 252, 253, 0.82);
  box-shadow: none;
}

body.has-result [data-panel="summary"].active {
  display: block;
  border: 1px solid rgba(0, 0, 0, 0.065);
  border-radius: 22px;
  padding: 22px 22px 26px;
  background: rgba(252, 252, 253, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.025);
}

body.has-result [data-panel="summary"] .summary-block,
body.has-result [data-panel="summary"] .summary-grid article,
body.has-result [data-panel="summary"] .paper-info-card {
  border: 0;
  border-radius: 0;
  padding: 0 0 20px;
  background: transparent;
  box-shadow: none;
}

body.has-result [data-panel="summary"] .summary-block,
body.has-result [data-panel="summary"] .summary-grid article:first-child,
body.has-result [data-panel="summary"] .summary-grid article:last-child {
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

body.has-result [data-panel="summary"] .paper-info-card {
  padding-bottom: 0;
}

.summary-block h3,
.summary-grid h3,
.paper-info-card h3,
.evidence-layout h3,
[data-panel="references"] h3,
.video-script-panel h3 {
  font-size: 1.1rem;
  font-weight: 760;
}

[data-panel="references"] ol {
  max-height: none;
  overflow: visible;
  display: grid;
  gap: 12px;
  list-style: none;
  padding-left: 0;
  padding-right: 0;
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

[data-panel="references"] li {
  padding-left: 0;
}

[data-panel="references"] ol::-webkit-scrollbar {
  width: 8px;
}

[data-panel="references"] ol::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

[data-panel="references"] ol::-webkit-scrollbar-track {
  background: transparent;
}

.summary-grid ul,
.summary-grid ol,
[data-field="evidence"],
[data-field="sources"],
[data-field="videoScript"] {
  max-height: min(46vh, 520px);
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

[data-field="videoStatus"] {
  min-height: 22px;
}

.summary-block p {
  padding-right: 10px;
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

.overview-copy {
  overflow: hidden;
  max-height: 14.4em;
}

.summary-block.is-expanded .overview-copy {
  max-height: none;
  overflow: visible;
}

.show-more-button,
.view-all-button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  margin-top: 10px;
  padding: 0 2px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.show-more-button:hover,
.view-all-button:hover {
  color: var(--accent);
}

.view-all-button {
  justify-self: start;
  margin-top: 8px;
}

body.has-result .summary-block p,
body.has-result .summary-grid ul,
body.has-result .summary-grid ol,
body.has-result [data-field="evidence"],
body.has-result [data-field="sources"],
body.has-result [data-panel="references"] ol,
body.has-result [data-field="videoScript"] {
  max-height: none;
  overflow: visible;
}

.summary-grid ul::-webkit-scrollbar,
.summary-grid ol::-webkit-scrollbar,
.summary-block p::-webkit-scrollbar,
[data-field="evidence"]::-webkit-scrollbar,
[data-field="sources"]::-webkit-scrollbar,
[data-field="videoScript"]::-webkit-scrollbar {
  width: 8px;
}

.summary-grid ul::-webkit-scrollbar-thumb,
.summary-grid ol::-webkit-scrollbar-thumb,
.summary-block p::-webkit-scrollbar-thumb,
[data-field="evidence"]::-webkit-scrollbar-thumb,
[data-field="sources"]::-webkit-scrollbar-thumb,
[data-field="videoScript"]::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

.summary-grid ul::-webkit-scrollbar-track,
.summary-grid ol::-webkit-scrollbar-track,
.summary-block p::-webkit-scrollbar-track,
[data-field="evidence"]::-webkit-scrollbar-track,
[data-field="sources"]::-webkit-scrollbar-track,
[data-field="videoScript"]::-webkit-scrollbar-track {
  background: transparent;
}

.summary-block p {
  color: #242426;
  line-height: 1.8;
  font-weight: 400;
}

.summary-block p + p {
  margin-top: 14px;
}

.summary-grid,
.evidence-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
}

.paper-info-card {
  margin-top: 18px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h3 {
  margin-bottom: 0;
}

.section-meta {
  margin: 4px 0 0;
  color: rgba(110, 110, 115, 0.86);
  font-size: 0.78rem;
  font-weight: 620;
}

.copy-button {
  flex: 0 0 auto;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 10px;
  background: transparent;
  color: rgba(110, 110, 115, 0.78);
  font-size: 0.76rem;
  font-weight: 700;
}

.section-heading .copy-button {
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, background 160ms ease, color 160ms ease;
}

.section-heading:hover .copy-button,
.section-heading:focus-within .copy-button {
  opacity: 1;
  pointer-events: auto;
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

ul,
ol {
  margin: 0;
  padding-left: 20px;
}

.summary-grid ol {
  display: grid;
  gap: 10px;
  list-style: none;
  padding-left: 0;
}

.summary-grid li {
  position: relative;
  margin: 0;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 12px;
  padding: 10px 12px 10px 44px;
  background: #fff;
  font-weight: 500;
  line-height: 1.5;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.summary-grid li:hover {
  border-color: rgba(210, 212, 218, 0.95);
  background: #fafafa;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.028);
  transform: translateY(-1px);
}

.summary-grid li::before {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.summary-grid li[data-variant="ideas"]::before {
  background: rgba(0, 113, 227, 0.1);
  color: var(--accent);
  content: attr(data-index);
}

.summary-grid li[data-variant="contributions"]::before {
  content: attr(data-index);
  background: rgba(255, 214, 10, 0.22);
  color: #8a6500;
}

.summary-grid li[data-variant="contributions"] {
  background: #fff;
  font-weight: 500;
}

.paper-info-card [data-field="paperInfo"] {
  display: grid;
  gap: 16px;
}

.paper-info-group {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 14px;
}

.paper-info-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.paper-info-group h4 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 820;
  text-transform: uppercase;
}

li {
  margin: 0 0 10px;
  line-height: 1.55;
}

.paper-info-card dl {
  display: grid;
  grid-template-columns: minmax(92px, 0.34fr) minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
}

.paper-info-card dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.paper-info-card dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.86rem;
}

.paper-info-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.paper-info-links a {
  color: var(--accent);
  font-weight: 760;
  text-decoration: none;
}

.reference-entry {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border-radius: 14px;
  padding: 13px 56px 13px 13px;
  background: rgba(247, 247, 249, 0.72);
  transition: background 150ms ease;
}

.reference-status {
  margin: -2px 0 12px;
  color: rgba(110, 110, 115, 0.82);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.4;
}

.reference-entry:hover {
  background: rgba(241, 246, 255, 0.76);
}

.reference-number {
  color: var(--muted);
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 800;
}

.reference-text {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #242426;
  font-size: 0.9rem;
  line-height: 1.55;
}

.reference-entry[data-collapsed="true"] .reference-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.reference-more {
  grid-column: 2;
  justify-self: start;
  min-height: 24px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 760;
}

.reference-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 26px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.reference-entry:hover .reference-copy,
.reference-copy:focus-visible {
  opacity: 1;
}

.evidence-viewer,
.history-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.68);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.history-item:hover,
.evidence-viewer:hover {
  border-color: rgba(0, 0, 0, 0.16);
  background: var(--panel-solid);
  box-shadow: var(--soft-shadow);
}

.evidence-viewer.active-evidence {
  border-color: rgba(0, 113, 227, 0.42);
  background: rgba(245, 250, 255, 0.92);
  box-shadow: 0 14px 32px rgba(0, 113, 227, 0.12);
}

.evidence-viewer + .evidence-viewer,
.missing-evidence + .evidence-viewer,
.evidence-viewer + .missing-evidence {
  margin-top: 14px;
}

.evidence-viewer summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.evidence-viewer[data-page] summary {
  cursor: pointer;
}

.evidence-viewer summary::-webkit-details-marker {
  display: none;
}

.evidence-viewer summary::after {
  justify-self: end;
  color: var(--muted);
  content: "›";
  font-size: 1.05rem;
  font-weight: 700;
  transition: transform 150ms ease, color 150ms ease;
}

.evidence-viewer[open] summary::after {
  content: "⌄";
  color: var(--accent);
}

.evidence-page,
.evidence-section {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 0.8rem;
  font-weight: 760;
  white-space: nowrap;
}

.evidence-page {
  background: rgba(0, 113, 227, 0.09);
  color: var(--accent);
  cursor: pointer;
}

.evidence-section {
  background: rgba(0, 0, 0, 0.05);
  color: var(--muted);
  text-transform: capitalize;
}

.evidence-label {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-body {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.evidence-body p {
  margin: 0;
  color: #242426;
  font-size: 0.92rem;
  line-height: 1.55;
}

.evidence-viewer.compact {
  margin-top: 10px;
  padding: 11px;
}

.evidence-viewer.compact summary {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.evidence-viewer-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 760;
}

.inline-evidence-list {
  margin-top: 8px;
}

.missing-evidence {
  margin-top: 10px;
  border: 1px dashed rgba(0, 0, 0, 0.16);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--muted);
  font-size: 0.86rem;
}

.card-meta {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.history-item p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.history-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 220;
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 28px));
  min-width: 0;
  height: 100vh;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0;
  padding: 28px 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: -18px 0 44px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transform: translateX(104%);
  transition: transform 220ms ease;
}

.is-history-open .history-panel {
  transform: translateX(0);
}

.history-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  border: 0;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(4px);
}

.history-overlay[hidden] {
  display: none;
}

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

.history-header .icon-button {
  width: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.history-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.history-search,
.history-filter,
.history-date {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.history-search {
  grid-column: 1 / -1;
}

.history-search span,
.history-filter span,
.history-date span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.history-search input,
.history-filter select,
.history-date input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.history-search input:focus,
.history-filter select:focus,
.history-date input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 122, 109, 0.14);
}

.history-list {
  display: grid;
  flex: 1;
  gap: 10px;
  min-height: 0;
  margin-top: 18px;
  overflow-y: auto;
  padding-right: 5px;
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

.history-list::-webkit-scrollbar {
  width: 8px;
}

.history-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

.history-list::-webkit-scrollbar-track {
  background: transparent;
}

.history-item {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.history-item:hover {
  transform: translateY(-1px);
}

.history-item strong {
  display: block;
  overflow-wrap: anywhere;
  margin-bottom: 6px;
  font-weight: 700;
  line-height: 1.25;
}

.history-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.history-actions a,
.history-actions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 6px 10px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease;
}

.history-actions a:hover,
.history-actions button:hover {
  border-color: rgba(0, 113, 227, 0.28);
  background: #f0f7ff;
  color: var(--accent);
}

.history-actions .danger-action {
  color: #b42318;
}

.history-actions .danger-action:hover {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff1ef;
  color: #b42318;
}

.error {
  border-color: rgba(191, 90, 31, 0.28);
  background: rgba(255, 246, 244, 0.9);
}

@media (max-width: 1060px) {
  body.has-result {
    overflow: auto;
  }

  body.has-result .app-shell,
  body.has-result .workspace {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body.has-result .workspace {
    display: block;
  }

  body.has-result .result-panel,
  body.has-result .reading-layout,
  body.has-result .analysis-column {
    overflow: visible;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .reading-layout {
    grid-template-columns: 1fr;
  }

  .pdf-panel {
    position: static;
    grid-template-rows: minmax(420px, 55vh);
  }

  body.has-result .pdf-panel {
    height: auto;
  }

  .pdf-panel iframe,
  .pdf-placeholder {
    min-height: 420px;
  }

  body.has-result .pdf-panel iframe,
  body.has-result .pdf-placeholder {
    min-height: 420px;
  }

  .upload-form,
  .arxiv-search-form,
  .arxiv-filter-row,
  .summary-grid,
  .evidence-layout {
    grid-template-columns: 1fr;
  }

  .tool-surface,
  .source-panel[data-source-panel="arxiv"].active {
    max-height: none;
    overflow: visible;
  }

  .upload-form .analyze-button {
    justify-self: stretch;
    width: 100%;
  }

  .project-header-row,
  .paper-nav-row {
    grid-template-columns: 1fr;
  }

  .project-title-block {
    align-items: stretch;
    flex-direction: column;
  }

  .project-name-button,
  .project-name-input {
    width: 100%;
  }

  .paper-stepper {
    border-left: 0;
    justify-content: space-between;
    padding-left: 0;
  }

  .paper-selector {
    align-items: stretch;
    flex-direction: column;
  }

  .project-actions,
  .project-actions .compact-action,
  .project-paper-item,
  .compare-tab {
    max-width: none;
    width: 100%;
  }

  .project-active-title {
    text-align: left;
  }

  .arxiv-search-button {
    min-width: 78px;
    padding-inline: 14px;
  }
}

@media (max-width: 640px) {
  .workspace,
  .history-panel {
    padding: 18px;
  }

  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .brand-lockup,
  .topbar-actions {
    grid-column: 1;
  }

  .topbar-actions {
    justify-self: center;
    flex-wrap: wrap;
  }

  .auth-box {
    justify-content: center;
  }

  .auth-modal-card {
    padding: 26px 22px;
  }

  .topbar-actions .icon-button {
    width: 36px;
    min-width: 36px;
    padding: 0;
    gap: 0;
    overflow: hidden;
    font-size: 0;
  }

  .topbar-actions .icon-button::before {
    font-size: 0.78rem;
  }

  .topbar,
  .history-header,
  .result-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .tabs {
    align-items: stretch;
    border-radius: 18px;
    flex-direction: column;
  }

  .workspace-tab-list {
    flex-wrap: wrap;
  }

  .tabs .result-actions {
    justify-content: flex-start;
    margin-left: 0;
  }

  .result-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .topbar {
    align-items: center;
  }

  .mode-group {
    grid-template-columns: 1fr;
  }

  .history-controls {
    grid-template-columns: 1fr;
  }

  .arxiv-card {
    grid-template-columns: 1fr;
  }

  .arxiv-card-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .arxiv-pagination {
    justify-content: stretch;
  }

  .arxiv-pagination .ghost-button {
    flex: 1;
  }

  .evidence-viewer summary,
  .evidence-viewer.compact summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .evidence-section {
    display: none;
  }
}

.video-script-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.58);
}

body.has-result .video-script-panel {
  min-height: 100%;
}

.video-script-header {
  display: block;
  margin-bottom: 14px;
}

.video-script-header > div:first-child {
  min-width: 0;
}

.video-script-header h3 {
  margin-bottom: 4px;
  font-size: 1.02rem;
}

.video-script-header .result-meta {
  margin: 0;
  line-height: 1.42;
}

.script-overview,
.scene-card {
  border: 1px solid rgba(0, 0, 0, 0.075);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 15px;
}

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

.script-overview span {
  color: var(--muted);
  font-size: 0.9rem;
}

.slide-preview-card + .slide-preview-card {
  margin-top: 10px;
}

.slide-preview-card summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.slide-preview-card summary::-webkit-details-marker {
  display: none;
}

.slide-number {
  color: var(--muted);
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 800;
}

.slide-title {
  overflow: hidden;
  font-size: 0.94rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slide-action {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 760;
}

.slide-preview-card[open] .slide-action {
  color: var(--muted);
}

.slide-preview-card[open] .slide-action::before {
  content: "Hide";
}

.slide-preview-card[open] .slide-action {
  font-size: 0;
}

.slide-preview-card[open] .slide-action::before {
  font-size: 0.78rem;
}

.slide-preview-body {
  margin-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 14px;
}

.scene-card p {
  line-height: 1.5;
}

.speaker-notes {
  margin-top: 12px;
}

.speaker-notes strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 640px) {
  .video-script-header,
  .video-control-bar,
  .script-overview {
    align-items: flex-start;
    flex-direction: column;
  }
}

.video-control-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0 0 10px;
  border: 0;
  padding: 0;
  background: transparent;
}

.slide-stage {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(0, 0, 0, 0.075);
  border-radius: 16px;
  padding: 14px;
  background: rgba(247, 247, 249, 0.72);
}

.stage-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.video-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.artifact-state-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 180px;
}

.artifact-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  white-space: nowrap;
}

.artifact-state[data-state="ready"] {
  border-color: rgba(52, 199, 89, 0.24);
  background: rgba(232, 247, 238, 0.9);
  color: #176b31;
}

.artifact-state[data-state="stale"] {
  border-color: rgba(255, 149, 0, 0.24);
  background: rgba(255, 246, 231, 0.92);
  color: #8a4b00;
}

.artifact-state[data-state="blocked"] {
  opacity: 0.72;
}

.video-actions .compact-action,
.video-downloads .download-button {
  min-height: 34px;
  padding-inline: 12px;
  font-size: 0.82rem;
}

.video-downloads {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 8px 0 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.video-downloads[hidden] {
  display: none;
}

.video-downloads > span {
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

.video-downloads .download-button {
  border-color: rgba(0, 113, 227, 0.18);
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent);
  box-shadow: none;
}

.video-downloads .download-button:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.slide-count-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px 0 14px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.slide-count-control select {
  min-height: 26px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  outline: 0;
}

.muted-download[hidden] {
  display: none;
}

button:disabled,
.primary-button:disabled,
.ghost-button:disabled,
.analyze-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}
