/* Note cards below the photo hero on the new homepage. */
.ed-tutorial-section { padding: 64px 0 16px; background: #faf8f5; }
.ed-tutorial-card {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.2fr);
  align-items: center;
  gap: 42px;
  padding: 38px;
  border: 1px solid #e1dbcf;
  border-radius: 12px;
  background: #f5f0e6;
  box-shadow: 0 14px 32px rgba(54, 49, 39, .07);
}
.ed-tutorial-copy h2 { margin: 0 0 14px; color: #1c1e21; font-size: clamp(26px, 3vw, 38px); line-height: 1.18; letter-spacing: -.7px; }
.ed-tutorial-copy p { margin: 0 0 24px; max-width: 440px; color: #5c665f; font-size: 15px; line-height: 1.7; }
.ed-tutorial-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ed-tutorial-video { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 8px; background: #17263b; box-shadow: 0 12px 24px rgba(23, 38, 59, .18); }
.ed-tutorial-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ed-nav-language-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid #d8d2c6; border-radius: 7px; background: #f1ede4; }
.ed-nav-language-switch button { min-height: 29px; padding: 5px 9px; border: 0; border-radius: 4px; background: transparent; color: #68716c; font: 700 10px 'JetBrains Mono', monospace; cursor: pointer; transition: background .18s ease, color .18s ease; }
.ed-nav-language-switch button.is-active { background: #1b3b6f; color: #fff; }
.ed-nav-language-switch button:focus-visible { outline: 2px solid #c65b32; outline-offset: 2px; }
.ed-import-pdf-btn { display: inline-flex; align-items: center; gap: 6px; }
.ed-ai-report-flow {
  display: grid; grid-template-columns: minmax(0, 1fr) 92px minmax(300px, .78fr);
  align-items: center; gap: 26px; padding: 34px; overflow: hidden;
  border: 1px solid #cfcfcf; border-radius: 12px; background: #f3f3f1;
}
.ed-ai-draft {
  position: relative; box-sizing: border-box; width: min(100%, 720px); padding: 30px; color: #ededed;
  border: 1px solid #292929;
  border-radius: 8px;
  background: #101010;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .2);
}
.ed-flow-label { display: flex; align-items: center; gap: 7px; margin-bottom: 24px; font: 700 11px 'JetBrains Mono', monospace; letter-spacing: .08em; color: #aaa; }
.ed-flow-dot { width: 7px; height: 7px; border-radius: 50%; background: #ededed; }
.ed-provider-badges { display: inline-flex; align-items: center; gap: 5px; }
.ed-flow-label-divider { width: 1px; height: 17px; margin: 0 3px; background: #3a3a3a; }
.ed-provider-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px;
  border: 1px solid #343434; border-radius: 999px; background: #191919;
  color: #ededed; font-size: 8px; letter-spacing: .02em;
}
.ed-provider-badge svg { width: 12px; height: 12px; fill: currentColor; flex-shrink: 0; }
.ed-ai-draft h3 { margin: 0 0 18px; font-size: 21px; color: #ededed; }
.ed-ai-draft p { margin: 0; font-size: 14px; line-height: 1.72; color: #dedede; }
.ed-llm-output-copy h3 { font-size: 19px; line-height: 1.3; }
.ed-llm-output-copy h4 {
  margin: 24px 0 12px; color: #ededed; font-family: 'Outfit', sans-serif;
  font-size: 15px; line-height: 1.35;
}
.ed-llm-output-copy h5 {
  margin: 22px 0 10px; color: #ededed; font-family: 'Outfit', sans-serif;
  font-size: 13px; line-height: 1.45;
}
.ed-llm-output-copy p + p { margin-top: 8px; }
.ed-llm-table-wrap {
  width: 100%; margin: 12px 0 14px; overflow-x: auto;
  border: 0; border-radius: 0;
}
.ed-llm-table {
  width: 100%; min-width: 420px; border-collapse: collapse;
  color: #e5e5e5; font: 13px 'Outfit', sans-serif;
}
.ed-llm-table th,
.ed-llm-table td {
  padding: 12px 10px; border-right: 0;
  border-bottom: 1px solid #333; text-align: left;
}
.ed-llm-table th:last-child,
.ed-llm-table td:last-child { border-right: 0; }
.ed-llm-table tbody tr:last-child td { border-bottom: 0; }
.ed-llm-table th { background: transparent; color: #ededed; font-weight: 700; }
.ed-llm-table tbody tr:nth-child(even) { background: transparent; }
.ed-llm-output-copy ul {
  margin: 12px 0 0; padding-left: 19px; color: #dedede;
  font-size: 13px; line-height: 1.65;
}
.ed-llm-output-copy li + li { margin-top: 7px; }
.ed-formula { display: flex; align-items: center; justify-content: center; gap: 13px; margin: 25px 0; padding: 18px; border: 1px solid #d8cda6; border-radius: 6px; background: #fffdf1b8; font: 27px Georgia, 'Times New Roman', serif; }
.ed-fraction { display: inline-flex; flex-direction: column; align-items: stretch; text-align: center; line-height: 1.15; }
.ed-fraction > span:first-child { padding: 0 8px 4px; border-bottom: 1.5px solid currentColor; }
.ed-fraction > span:last-child { padding-top: 4px; }
.ed-draft-note { padding-left: 12px; border-left: 3px solid #c65b32; font-size: 12px; line-height: 1.55; color: #6a6655; }
.ed-flow-arrow { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #111; }
.ed-flow-arrow span { font: 700 9px 'JetBrains Mono', monospace; letter-spacing: .1em; text-align: center; }
.ed-flow-arrow svg { width: 92px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ed-report-photo { position: relative; width: min(100%, 445px); margin: 0; padding: 9px; background: #fff; border: 1px solid #aaa; box-shadow: 5px 5px 0 #171717; }
.ed-report-photo img { display: block; width: 100%; height: auto; }
.ed-report-photo figcaption { position: absolute; right: 9px; bottom: 9px; padding: 5px 8px; background: #111; color: #fff; font: 700 8px 'JetBrains Mono', monospace; letter-spacing: .04em; }
.ed-flow-hint { margin: 13px 0 0; color: #6a716c; font: 600 11px 'JetBrains Mono', monospace; }
.ed-report-preview { position: relative; box-sizing: border-box; aspect-ratio: 210 / 297; padding: 34px 31px 25px; color: #20262a; background: #fff; border: 1px solid #ddd9cf; box-shadow: 0 14px 28px #39352c24; font-family: Georgia, 'Times New Roman', serif; }
.ed-report-kicker { font: 700 8px 'JetBrains Mono', monospace; letter-spacing: .12em; color: #315d65; }
.ed-report-preview h3 { margin: 11px 0 6px; font-size: 20px; line-height: 1.15; }
.ed-report-meta { font-size: 8px; color: #6c7270; }
.ed-report-rule { height: 2px; margin: 12px 0 14px; background: #315d65; }
.ed-report-preview h4 { margin: 8px 0 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.ed-report-preview p { margin: 0; font-size: 8px; line-height: 1.5; text-align: justify; }
.ed-report-body { display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; margin: 9px 0; }
.ed-report-formula { margin-top: 10px; padding: 7px; background: #f5f1e9; text-align: center; font-size: 11px; }
.ed-mini-figure { position: relative; padding: 4px 4px 2px 10px; border: 1px solid #dedbd3; }
.ed-mini-figure > span { position: absolute; top: 1px; left: 2px; font-size: 6px; }
.ed-mini-figure svg { display: block; width: 100%; height: auto; }
.ed-mini-figure .axis { fill: none; stroke: #6c7270; stroke-width: 1; }
.ed-mini-figure .trend { fill: none; stroke: #c65b32; stroke-width: 2; }
.ed-mini-figure .points { fill: #315d65; }
.ed-mini-figure small { display: block; text-align: center; font-size: 6px; color: #6c7270; }
.ed-report-page { position: absolute; bottom: 12px; left: 0; width: 100%; text-align: center; font-size: 7px; color: #888; }
.ed-drop-card.ed-process-step,
.ed-drop-card.ed-import-entry {
  cursor: default;
  border: 1px solid #e5e0d8;
}
.ed-drop-card.ed-process-step:hover,
.ed-drop-card.ed-import-entry:hover { background: #fff; border-color: #e5e0d8; }
.ed-drop-card.ed-import-entry { border-style: dashed; }
#props-panel .props-tabs-row {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  flex-shrink: 0;
}
#props-panel .props-tab {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  justify-content: center;
}
#props-panel .props-tab.tab-active { background: #1b3b6f; color: #fff; }
#props-panel .props-tab:focus-visible { outline: 2px solid #719bdf; outline-offset: 2px; }
#props-panel[data-active-panel="props"] #bib-panel,
#props-panel[data-active-panel="bib"] #props-empty,
#props-panel[data-active-panel="bib"] #props-content { display: none !important; }
#props-panel #bib-panel { min-height: 0; overflow-y: auto; flex: 1; padding: 0 12px 16px; }

/* Editor top bar: reserve real space for credentials and avoid collisions. */
#editor-view #topbar {
  justify-content: flex-start;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
#editor-view #topbar::-webkit-scrollbar { display: none; }
#editor-view .editor-brand,
#editor-view .editor-nav-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
#editor-view .editor-brand { gap: 12px; }
#editor-view .editor-nav-actions { gap: 6px; margin-left: auto; }
#editor-view #mode-toggle,
#editor-view #api-pill,
#editor-view .editor-nav-actions {
  zoom: .8;
}
#editor-view #api-pill {
  display: grid;
  grid-template-columns: 14px minmax(150px, 1fr) minmax(90px, 128px) 10px auto;
  flex: 1 1 390px;
  width: clamp(300px, 31vw, 470px);
  min-width: 300px;
  max-width: 470px;
  cursor: text;
}
#editor-view #api-key-input,
#editor-view #api-url-input {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}
#editor-view #api-key-input:focus,
#editor-view #api-url-input:focus { width: 100% !important; }

/* A compact dock feels connected to the preview instead of two loose buttons. */
#editor-view #preview-pane { position: relative; }
#editor-view .floating-download-actions {
  position: absolute;
  top: 50px;
  right: 18px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 12px;
  background: rgba(15, 18, 23, .82);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  backdrop-filter: blur(12px);
}
#editor-view .export-dock-label {
  padding: 0 8px;
  color: #7f8b9d;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
#editor-view .float-btn-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  font: 600 11px 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
#editor-view .float-btn-export:hover {
  color: #fff;
  border-color: rgba(96, 165, 250, .35);
  background: rgba(59, 130, 246, .18);
  transform: translateY(-1px);
}
#editor-view .float-btn-export.is-pdf { color: #75ddb7; }
#editor-view .float-btn-export.is-pdf:hover {
  color: #baf5df;
  border-color: rgba(16, 185, 129, .35);
  background: rgba(16, 185, 129, .16);
}
#editor-view .float-btn-export:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* References belongs to the same dark workspace as Properties. */
#props-panel #bib-panel { background: var(--surface); color: var(--text); }
#props-panel #bib-panel-inner { padding: 14px 2px 20px; }
#props-panel .bib-section-hdr {
  margin: 0 0 8px;
  color: #d8e0eb;
  font: 700 11px 'JetBrains Mono', monospace;
  letter-spacing: .02em;
}
#props-panel .bib-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #303844;
  border-radius: 7px;
  background: #171b21;
  color: #cbd5e1;
  font: 600 10.5px 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
#props-panel .bib-btn:hover {
  background: #202631;
  border-color: #465266;
  color: #fff;
}
#props-panel #zotero-fetch-btn {
  width: 100%;
  background: rgba(59, 130, 246, .12) !important;
  border-color: rgba(96, 165, 250, .3) !important;
  color: #a9c9ff !important;
}
#props-panel .bib-input {
  display: block;
  width: 100%;
  height: 34px;
  box-sizing: border-box;
  padding: 7px 9px;
  border: 1px solid #303844;
  border-radius: 7px;
  outline: none;
  background: #0d1015;
  color: #e2e8f0;
  font: 11px 'JetBrains Mono', monospace;
}
#props-panel .bib-input::placeholder { color: #5f6b7d; }
#props-panel .bib-input:focus {
  border-color: #5477ad;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .1);
}

/* Homepage type motion: short editorial reveals, played once. */
#landing-view .ed-eyebrow-pill,
#landing-view .ed-hero-title > span,
#landing-view .ed-hero-sub,
#landing-view .ed-hero-cta-group,
#landing-view .ed-hero-note {
  opacity: 0;
  animation: ed-text-rise .62s cubic-bezier(.22, .75, .24, 1) forwards;
}
#landing-view .ed-hero-title > span { display: inline-block; }
#landing-view .ed-eyebrow-pill { animation-delay: .08s; }
#landing-view .ed-hero-title > span:first-child { animation-delay: .17s; }
#landing-view .ed-hero-title > span:last-child { animation-delay: .27s; }
#landing-view .ed-hero-sub { animation-delay: .38s; }
#landing-view .ed-hero-cta-group { animation-delay: .48s; }
#landing-view .ed-hero-note { animation-delay: .58s; }

#landing-view .ed-text-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .58s ease, transform .7s cubic-bezier(.22, .75, .24, 1);
}
#landing-view .ed-text-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes ed-text-rise {
  from { opacity: 0; transform: translateY(18px); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@media (prefers-reduced-motion: reduce) {
  #landing-view .ed-eyebrow-pill,
  #landing-view .ed-hero-title > span,
  #landing-view .ed-hero-sub,
  #landing-view .ed-hero-cta-group,
  #landing-view .ed-hero-note {
    opacity: 1;
    animation: none;
  }
  #landing-view .ed-text-reveal,
  #landing-view .ed-text-reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 1450px) {
  #editor-view #topbar { padding-inline: 10px; gap: 7px; }
  #editor-view #toolbar {
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
    align-content: center;
    padding-block: 6px;
  }
  #editor-view #api-pill {
    flex-basis: 330px;
    width: 330px;
    min-width: 270px;
    grid-template-columns: 14px minmax(120px, 1fr) minmax(72px, 100px) 10px auto;
    padding-inline: 9px;
  }
  #editor-view .editor-nav-actions .btn-txt { display: none; }
  #editor-view .editor-nav-actions .btn { min-width: 38px; padding-inline: 10px; }
}

@media (max-width: 980px) {
  #editor-view #topbar { min-height: 60px; height: auto; }
  #editor-view .pill { display: none; }
  #editor-view #api-pill { min-width: 250px; }
  #editor-view .export-dock-label { display: none; }
}
@media (max-width: 820px) {
  .ed-tutorial-card { grid-template-columns: 1fr; gap: 26px; padding: 28px; }
  .ed-ai-report-flow { grid-template-columns: 1fr; gap: 22px; padding: 22px; }
  .ed-flow-arrow { transform: rotate(90deg); width: 92px; justify-self: center; }
  .ed-flow-arrow span { transform: rotate(-90deg); position: absolute; left: 25px; top: -17px; white-space: nowrap; }
  .ed-report-preview, .ed-report-photo { width: min(100%, 390px); justify-self: center; }
}
@media (max-width: 700px) {
  .ed-nav-inner { flex-wrap: wrap; gap: 9px; }
  .ed-nav-actions { width: 100%; justify-content: space-between; }
}
@media (max-width: 520px) {
  .ed-tutorial-section { padding: 42px 0 8px; }
  .ed-tutorial-card { padding: 22px; border-radius: 8px; }
  .ed-tutorial-actions > * { width: 100%; justify-content: center; }
  .ed-nav-actions { gap: 6px; }
  .ed-nav-language-switch button { padding: 5px 7px; }
  .ed-import-pdf-btn { font-size: 0; padding: 8px 10px; }
  .ed-import-pdf-btn svg { width: 16px; height: 16px; }
  .ed-ai-report-flow { padding: 16px; }
  .ed-ai-draft { padding: 22px; }
}
.ed-card-tape {
  content: '';
  position: absolute;
  top: -25px;
  left: 50%;
  width: 180px;
  height: 53px;
  transform: translateX(-50%) rotate(-3deg);
  background: #ddd9c39e;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  clip-path: polygon(0 0, 100% 0, 97% 10%, 100% 20%, 97% 30%, 100% 40%, 97% 50%, 100% 60%, 97% 70%, 100% 80%, 97% 90%, 100% 100%, 0 100%, 3% 90%, 0 80%, 3% 70%, 0 60%, 3% 50%, 0 40%, 3% 30%, 0 20%, 3% 10%);
  pointer-events: none;
}
.ed-card { border-radius: 1px; padding-top: 70px; background: repeating-linear-gradient(to bottom, transparent 0, transparent 34px, #b6aa7226 35px, transparent 36px), #fff5cc; box-shadow: 5px 6px 0 #e5dcba, 9px 12px 14px -7px #34352645; }
.ed-card:hover { transform: none; box-shadow: 5px 6px 0 #e5dcba, 9px 12px 14px -7px #34352645; }
.ed-card-tape { width: 125px; height: 42px; top: -20px; }
.ed-card-stamp { top: 19px; background: none; border: 0; box-shadow: none; font-size: 12px; }
.ed-card-num { background: #194d62; box-shadow: none; }
.ed-code-chip { background: #fff9e380; }
