/* ============================================================================
   LINEA (리네어) ORIGINAL LIVE INTERACTIVE SHOWCASE ENGINE
   100% Original Linea UI Chrome, Real CC-BY Paper Renders, & Motion Loops
   Audited against Appllama Native Fidelity, Typography, & Anti-Slop Laws
   ============================================================================ */

.ln-win {
  position: absolute;
  left: 4.5%;
  right: 4.5%;
  top: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  background: #fbfbf8;
  border-radius: 11px;
  box-shadow:
    0 22px 52px -18px rgba(10, 18, 36, 0.34),
    0 0 0 1px rgba(30, 50, 92, 0.14);
  overflow: hidden;
  user-select: none;
}

.ln-win.is-floating {
  bottom: 24px;
  border-radius: 11px;
}

/* Browser Address Bar */
.ln-browser {
  height: 34px;
  flex: none;
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: center;
  padding: 0 14px;
  background: #f3f2ec;
  border-bottom: 1px solid rgba(39, 38, 30, 0.09);
  font-size: 12px;
  color: #6e6d66;
  white-space: nowrap;
}

.ln-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.ln-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(39, 38, 30, 0.16);
}
.ln-dots i:nth-child(1) { background: #ef4444cc; }
.ln-dots i:nth-child(2) { background: #f59e0bcc; }
.ln-dots i:nth-child(3) { background: #10b981cc; }

.ln-url {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 22px;
  padding: 1.5px 12px 0;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(39, 38, 30, 0.09);
  font-size: 11.5px;
  line-height: 1;
  color: #4b5563;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ln-url svg {
  width: 11px;
  height: 11px;
  margin-top: -1.5px;
  flex: none;
  color: #64748b;
}

.ln-browser-end {
  width: 54px;
  height: 1px;
}

/* Linea Reader Top Toolbar (Matches actual #pdfViewer) */
.ln-rbar {
  height: 40px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  background: #fbfbf8;
  border-bottom: 1px solid rgba(39, 38, 30, 0.1);
  font-size: 12.5px;
  color: #5c5b54;
  white-space: nowrap;
  overflow: hidden;
}

.ln-rbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #1f2430;
  flex: none;
}
.ln-rbar-brand img {
  width: 18px;
  height: 18px;
}

.ln-rbar-doc {
  font-weight: 600;
  color: #1f2430;
  min-width: 0;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ln-rbar-pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 1.5px 7px 0;
  border-radius: 5px;
  background: #f1f0ea;
  font-size: 11.5px;
  line-height: 1;
  color: #57564f;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: none;
}

.ln-rbar-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  height: 100%;
  flex: none;
}

.ln-rtab {
  position: relative;
  height: 100%;
  padding: 1.5px 9px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  line-height: 1;
  color: #6e6d66;
  cursor: pointer;
  background: none;
  border: 0;
  white-space: nowrap;
  flex: none;
}
.ln-rtab.is-on {
  color: #1e325c;
  font-weight: 700;
}
.ln-rtab.is-on::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  background: #26437e;
  border-radius: 2px;
}
.ln-rtab-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  font-size: 10.5px;
  line-height: 1;
  padding: 1.5px 6px 0;
  border-radius: 999px;
  background: #e6ecf8;
  color: #1e3a8a;
  font-weight: 600;
  white-space: nowrap;
}

.ln-rbar-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.ln-rbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 2px 10px 0;
  border-radius: 6px;
  border: 1px solid rgba(39, 38, 30, 0.15);
  background: #ffffff;
  color: #27261e;
  font-size: 11.5px;
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
  flex: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ln-rbtn:hover,
.ln-rbtn.is-on {
  border-color: #26437e;
  background: #eef3fc;
  color: #1e325c;
}

/* 3-Pane Reader Body */
.ln-rbody {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1.05fr) minmax(0, 0.95fr);
  background: #efeee8;
  overflow: hidden;
}

.ln-rail {
  background: #f7f6f1;
  border-right: 1px solid rgba(39, 38, 30, 0.09);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 10px;
  color: #7c7b74;
}
.ln-rail span {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
}
.ln-rail span svg {
  width: 14px;
  height: 14px;
}
.ln-rail span.is-on {
  background: #e6ecf8;
  color: #1e325c;
}

/* Center PDF Stage */
.ln-pdf-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 12px 14px 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: #ecebe4;
}

.ln-pdf-sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 3px 14px rgba(15, 23, 42, 0.09), 0 0 0 1px rgba(15, 23, 42, 0.05);
  transition: transform 0.55s cubic-bezier(0.25, 0.9, 0.3, 1);
}

.ln-pdf-sheet img {
  display: block;
  width: 100%;
  height: auto;
}

/* Interactive Sentence Highlight Boxes on Real PDF */
.ln-pbox {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--w) * 1%);
  height: calc(var(--h) * 1%);
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.16s ease, box-shadow 0.16s ease;
}
.ln-pbox:hover,
.ln-pbox.is-hot {
  background: rgba(37, 99, 235, 0.19);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.42);
}
.ln-pbox.is-ask {
  background: rgba(30, 58, 138, 0.22);
  box-shadow: 0 0 0 1.5px #2563eb;
}

/* Role-based AI highlights */
.ln-pbox.hl-prob { background: rgba(250, 204, 21, 0.34); }
.ln-pbox.hl-meth { background: rgba(56, 189, 248, 0.30); }
.ln-pbox.hl-res  { background: rgba(244, 114, 182, 0.28); }

/* Floating [질문하기] Action Pill on PDF */
.ln-ask-pill {
  position: absolute;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 24px;
  padding: 0 11px;
  border-radius: 999px;
  background: #1e325c;
  color: #ffffff;
  font-size: 11.5px;
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.28);
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.ln-ask-pill.is-vis {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 4x Figure / Citation Instant Popup Card */
.ln-popcard {
  position: absolute;
  z-index: 8;
  right: 14px;
  top: 14px;
  width: min(296px, calc(100% - 28px));
  padding: 10px 12px;
  border-radius: 9px;
  background: #ffffff;
  box-shadow:
    0 16px 38px rgba(15, 23, 42, 0.2),
    0 0 0 1px rgba(38, 67, 126, 0.22);
  font-size: 12px;
  line-height: 1.48;
  color: #27261e;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.ln-popcard.is-vis {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.ln-popcard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #1e3a8a;
  white-space: nowrap;
}
.ln-popcard-pin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #475569;
  font-weight: 600;
}
.ln-popcard-pin svg {
  width: 11px;
  height: 11px;
}
.ln-popcard-fig {
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 5px;
  margin-bottom: 5px;
}
.ln-popcard-fig img {
  width: 100%;
  max-height: 120px;
  object-fit: contain;
  display: block;
}
.ln-popcard-cap {
  font-size: 11.5px;
  line-height: 1.45;
  color: #4b5563;
}

/* Right Side Panel (Side Translation / AI Q&A / 4-Part Summary) */
.ln-side {
  background: #fbfbf8;
  border-left: 1px solid rgba(39, 38, 30, 0.1);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.ln-side-head {
  height: 36px;
  flex: none;
  padding: 0 12px;
  border-bottom: 1px solid rgba(39, 38, 30, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

.ln-side-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 7px;
  background: #efeee8;
  flex: none;
}
.ln-side-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 1.5px 8px 0;
  border-radius: 5px;
  font-size: 11.5px;
  line-height: 1;
  color: #5c5b54;
  border: 0;
  background: transparent;
  white-space: nowrap;
  flex: none;
  cursor: pointer;
}
.ln-side-switch button.is-on {
  background: #ffffff;
  color: #1e325c;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.ln-side-sync-tag {
  margin-left: auto;
  font-size: 11px;
  color: #2563eb;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ln-side-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 10px 14px 10px;
  font-size: 12.4px;
  line-height: 1.56;
  color: #26251e;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.ln-side-body[hidden] {
  display: none !important;
}

.ln-ko-sec {
  font-size: 11px;
  font-weight: 700;
  color: #7c7b74;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ln-ko-h {
  font-size: 13px;
  font-weight: 700;
  color: #18181b;
  margin: 4px 0 5px;
  line-height: 1.4;
}

.ln-ko-p {
  margin: 0 0 7px;
}
.ln-ko-p:last-child {
  margin-bottom: 0;
}

.ln-ko-sent {
  padding: 1px 3px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.ln-ko-sent:hover,
.ln-ko-sent.is-hot {
  background: #dfe9fb;
  color: #172554;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.28);
}

.ln-ref-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 1.5px 5px 0;
  margin: 0 2px;
  border-radius: 4px;
  background: #eef3fc;
  color: #1d4ed8;
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px dotted #3b82f6;
}

.ln-math-block {
  margin: 5px 0 7px;
  padding: 7px 10px 8px;
  border-radius: 7px;
  background: #f4f5f8;
  border: 1px solid rgba(38, 67, 126, 0.14);
  font-family: "Times New Roman", Georgia, serif;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  color: #111827;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.16s ease;
}
.ln-math-block.is-hot,
.ln-math-block:hover {
  background: #e5edfc;
  border-color: #2563eb;
}

/* AI Grounded Q&A Drawer Mode */
.ln-qa-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ln-qa-quote {
  padding: 8px 10px;
  border-left: 3px solid #26437e;
  background: #f1f4fa;
  border-radius: 0 6px 6px 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #374151;
}
.ln-qa-quote small {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 2px;
}
.ln-qa-q {
  align-self: flex-end;
  max-width: 92%;
  padding: 7px 11px;
  border-radius: 12px 12px 2px 12px;
  background: #1e325c;
  color: #ffffff;
  font-size: 12px;
  line-height: 1.45;
}
.ln-qa-a {
  padding: 9px 11px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(39, 38, 30, 0.1);
  font-size: 12px;
  line-height: 1.58;
  color: #1f2937;
}
.ln-qa-a p + p {
  margin-top: 6px;
}
.ln-pg-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 1.5px 6px 0;
  border-radius: 4px;
  background: #e6ecf8;
  color: #1e3a8a;
  font-size: 10.5px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
  flex: none;
}

/* 4-Part Summary Mode */
.ln-sum-list {
  display: grid;
  gap: 7px;
}
.ln-sum-card {
  padding: 8px 10px;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid rgba(39, 38, 30, 0.09);
  font-size: 11.8px;
  line-height: 1.48;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ln-sum-card.is-hot,
.ln-sum-card:hover {
  border-color: #2563eb;
  background: #f5f8ff;
}
.ln-sum-card b {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #1e325c;
  margin-bottom: 2px;
}

/* Animated Pointer Cursor */
.ln-pointer {
  position: absolute;
  z-index: 15;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  pointer-events: none;
  transition: left 0.65s cubic-bezier(0.22, 1, 0.36, 1), top 0.65s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.32));
}
.ln-pointer.is-hidden {
  opacity: 0;
}
.ln-pointer.is-click::after {
  content: "";
  position: absolute;
  left: -6px;
  top: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #2563eb;
  animation: lnRipple 0.5s ease-out forwards;
}
@keyframes lnRipple {
  from { opacity: 0.9; transform: scale(0.4); }
  to { opacity: 0; transform: scale(1.7); }
}

/* Feature catalog bullet points (/features) */
.fp-text .f-points {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.fp-text .f-points li {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.fp-text .f-points li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
  flex: none;
}

/* Workspace Scene Mockups (Search, Library, Notes, Home) */
.ln-ws-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 14px 18px;
  background: #f7f6f1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ln-col2-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  gap: 5px;
  padding: 1.5px 8px 0;
  border-radius: 999px;
  background: #e6ecf8;
  color: #1e3a8a;
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 1140px) {
  .ln-rbar-right {
    display: none;
  }
  .ln-side-sync-tag {
    display: none;
  }
}

@media (max-width: 920px) {
  .ln-win {
    left: 16px;
    right: 16px;
    top: 16px;
    bottom: 16px;
  }
  .ln-rail {
    display: none;
  }
  .ln-rbody {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .ln-rbody {
    grid-template-columns: 1fr;
  }
  .ln-pdf-stage {
    max-height: 210px;
  }
}
