/* AIdoc.one editorial library theme
   Visual layer only: existing IDs, handlers, API calls and auth flow remain unchanged. */

:root {
  --paper: #f4f0e6;
  --paper-strong: #fffdf7;
  --paper-deep: #e9e1d2;
  --ink: #18201b;
  --ink-soft: #536057;
  --forest: #173f35;
  --forest-2: #24584a;
  --oxblood: #6f3036;
  --brass: #b4874d;
  --brass-soft: #d6bd91;
  --rule: rgba(24, 32, 27, 0.17);
  --rule-strong: rgba(24, 32, 27, 0.30);
  --shadow-soft: 0 18px 48px rgba(39, 32, 22, 0.10);
  --shadow-card: 0 8px 24px rgba(39, 32, 22, 0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
}

html { scroll-behavior: smooth; }

body.landing-page,
body.workspace-page {
  color: var(--ink);
  background:
    linear-gradient(rgba(82, 66, 43, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(82, 66, 43, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "ss01", "cv11";
}

body.landing-page::before,
body.workspace-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 3%, rgba(180, 135, 77, 0.11), transparent 28%),
    radial-gradient(circle at 92% 20%, rgba(23, 63, 53, 0.07), transparent 26%);
}

body.landing-page .soft-grid,
body.workspace-page .soft-grid { display: none; }

body.landing-page h1,
body.landing-page h2,
body.landing-page h3,
body.workspace-page h1,
body.workspace-page h2,
body.workspace-page h3,
body.landing-page .brand,
body.workspace-page .brand {
  font-family: "Playfair Display", Georgia, serif !important;
  letter-spacing: -0.028em;
}

/* Shared header */
body.landing-page .topbar,
body.workspace-page .topbar {
  width: min(1460px, calc(100% - 40px));
  margin: 18px auto 0;
  min-height: 72px;
  padding: 10px 14px 10px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 247, 0.92);
  box-shadow: 0 8px 28px rgba(39, 32, 22, 0.07);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 50;
}

body.landing-page .brand,
body.workspace-page .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: clamp(23px, 2.1vw, 31px);
  line-height: 1;
}

body.landing-page .brand em,
body.workspace-page .brand em {
  color: var(--brass);
  font-style: normal;
}

body.landing-page .brand-logo-wrap,
body.workspace-page .brand-logo-wrap {
  width: 45px;
  height: 45px;
  border-radius: 11px;
  overflow: hidden;
  background: var(--paper-strong);
  border: 1px solid rgba(180, 135, 77, 0.35);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.7);
}

body.landing-page .brand-logo,
body.workspace-page .brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 27%;
  transform: scale(1.62);
}

body.landing-page .right-actions,
body.workspace-page .top-actions {
  gap: 8px;
}

body.landing-page .language-select,
body.landing-page .nav-btn,
body.landing-page .hamburger,
body.workspace-page .menu-toggle {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: #fffdf8;
  color: var(--ink);
  box-shadow: none;
  font-weight: 700;
}

body.landing-page .language-select,
body.landing-page .nav-btn { padding: 0 15px; }

body.landing-page .nav-btn:hover,
body.landing-page .hamburger:hover,
body.workspace-page .menu-toggle:hover {
  border-color: var(--brass);
  transform: translateY(-1px);
}

body.landing-page .nav-btn.primary {
  color: #fff;
  border-color: var(--forest);
  background: var(--forest);
}

body.landing-page .nav-btn.primary:hover { background: var(--forest-2); }

body.landing-page .menu,
body.workspace-page .account-menu {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: var(--shadow-card);
}

/* Landing page */
body.landing-page .page {
  min-height: auto;
  overflow: visible;
  padding-bottom: 0;
}

.library-main {
  width: min(1460px, calc(100% - 40px));
  margin: 0 auto;
}

.library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  min-height: 690px;
  margin-top: 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper-strong);
  box-shadow: var(--shadow-soft);
}

.library-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(48px, 7vw, 104px);
  border-right: 1px solid var(--rule);
  position: relative;
}

.library-hero-copy::before {
  content: "AIDOC / DOCUMENT INTELLIGENCE";
  position: absolute;
  top: 30px;
  left: clamp(48px, 7vw, 104px);
  color: var(--forest);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.library-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--oxblood);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.library-eyebrow::before {
  content: "";
  width: 42px;
  height: 1px;
  background: var(--oxblood);
}

.library-hero h1 {
  max-width: 820px;
  font-size: clamp(48px, 6.6vw, 94px);
  line-height: 0.98;
  font-weight: 700;
  color: var(--ink);
}

.library-hero h1 span { color: var(--forest); }

.library-lede {
  max-width: 710px;
  margin-top: 28px;
  color: var(--ink-soft);
  font-size: clamp(17px, 1.55vw, 22px);
  line-height: 1.65;
}

.library-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.editorial-button {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 9px;
  border: 1px solid var(--forest);
  background: var(--forest);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.editorial-button.secondary {
  color: var(--ink);
  border-color: var(--rule-strong);
  background: transparent;
}

.editorial-button:hover { transform: translateY(-2px); }

.library-trust-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 46px;
  border: 1px solid var(--rule);
  background: var(--rule);
}

.library-trust-item {
  padding: 16px 18px;
  background: var(--paper-strong);
}

.library-trust-item strong {
  display: block;
  margin-bottom: 5px;
  color: var(--forest);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 18px;
}

.library-trust-item span {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.library-hero-visual {
  display: grid;
  place-items: center;
  padding: 44px;
  background:
    linear-gradient(150deg, rgba(23, 63, 53, 0.98), rgba(20, 42, 36, 0.99)),
    var(--forest);
  color: #fff;
  position: relative;
}

.library-hero-visual::after {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(214, 189, 145, 0.37);
  pointer-events: none;
}

.library-ledger {
  width: min(100%, 480px);
  padding: 34px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
}

.library-ledger-kicker {
  color: var(--brass-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.library-ledger h2 {
  margin: 15px 0 26px;
  color: #fff;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.05;
}

.ledger-list { list-style: none; }
.ledger-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid rgba(255,255,255,0.18);
}
.ledger-list li:last-child { border-bottom: 1px solid rgba(255,255,255,0.18); }
.ledger-list b { color: var(--brass-soft); font-family: "Playfair Display", Georgia, serif; }
.ledger-list strong { display: block; font-size: 15px; margin-bottom: 4px; }
.ledger-list span { color: rgba(255,255,255,0.72); font-size: 13px; line-height: 1.5; }

.editorial-section {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 70px;
  padding: 110px 0;
  border-bottom: 1px solid var(--rule);
}

.editorial-section-head .section-index {
  color: var(--oxblood);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.editorial-section-head h2 {
  margin-top: 15px;
  font-size: clamp(38px, 4.8vw, 68px);
  line-height: 1.02;
}

.editorial-section-head p {
  max-width: 420px;
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.75;
}

.editorial-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule-strong);
}

.editorial-card {
  min-height: 330px;
  padding: 32px 26px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: rgba(255,253,247,0.54);
}
.editorial-card:first-child { border-left: 1px solid var(--rule); }
.editorial-card .card-number { color: var(--brass); font: 700 30px/1 "Playfair Display", Georgia, serif; }
.editorial-card h3 { margin-top: 58px; font-size: 27px; line-height: 1.12; }
.editorial-card p { margin-top: 16px; color: var(--ink-soft); line-height: 1.7; font-size: 14px; }

.library-quote {
  padding: 96px clamp(30px, 8vw, 130px);
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.library-quote blockquote {
  max-width: 1100px;
  margin: 0 auto;
  color: var(--forest);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(36px, 5.2vw, 74px);
  line-height: 1.12;
}
.library-quote p { margin-top: 24px; color: var(--ink-soft); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }

.library-footer {
  width: min(1460px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  color: var(--ink-soft);
  font-size: 13px;
}
.library-footer strong { color: var(--ink); }
.library-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.library-footer button { background: none; color: var(--ink-soft); font-weight: 700; }
.library-footer button:hover { color: var(--forest); }

body.landing-page .sam-launcher {
  right: 26px;
  bottom: 24px;
  width: auto;
  min-width: 168px;
  height: 56px;
  padding: 0 58px 0 18px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 12px;
  background: var(--forest);
  color: #fff;
  box-shadow: 0 12px 34px rgba(18, 48, 40, 0.27);
  text-align: left;
}
body.landing-page .sam-launcher .qr-img { display: none; }
body.landing-page .sam-launcher strong { color: #fff; font-size: 15px; }
body.landing-page .sam-launcher small { color: rgba(255,255,255,0.7); font-size: 11px; }
body.landing-page .sam-face { right: 8px; bottom: 7px; width: 42px; height: 42px; }
body.landing-page .chat {
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: var(--paper-strong);
  box-shadow: var(--shadow-soft);
}
body.landing-page .chat-head { background: var(--forest); color: #fff; }
body.landing-page .chat-input button { background: var(--forest); }

/* Workspace page */
body.workspace-page .shell { width: 100%; max-width: none; padding: 0 0 50px; }
body.workspace-page .layout {
  width: min(1460px, calc(100% - 40px));
  margin: 18px auto 0;
  grid-template-columns: 254px minmax(0, 1fr);
  gap: 18px;
  padding: 0;
}

body.workspace-page .sidebar {
  position: sticky;
  top: 18px;
  height: fit-content;
  padding: 22px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: rgba(255,253,247,0.88);
  box-shadow: var(--shadow-card);
}

body.workspace-page .side-title {
  padding: 0 10px 14px;
  color: var(--oxblood);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

body.workspace-page .side-nav { display: grid; gap: 4px; }
body.workspace-page .tab-btn {
  min-height: 52px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  justify-content: flex-start;
  font-weight: 750;
}
body.workspace-page .tab-btn:hover { background: rgba(23,63,53,0.055); }
body.workspace-page .tab-btn.active {
  color: #fff;
  border-color: var(--forest);
  background: var(--forest);
}

body.workspace-page .storage-card {
  margin-top: 24px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper-strong);
  box-shadow: none;
}
body.workspace-page .bar { background: var(--paper-deep); }
body.workspace-page .bar-fill { background: var(--brass); }

body.workspace-page .main { min-width: 0; }
body.workspace-page .panel { gap: 18px; }
body.workspace-page .card {
  padding: clamp(24px, 3.2vw, 44px);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: rgba(255,253,247,0.92);
  box-shadow: var(--shadow-card);
}

body.workspace-page .section-head { align-items: flex-start; }
body.workspace-page .section-head h1,
body.workspace-page .document-list-head h2 {
  color: var(--ink);
  font-size: clamp(34px, 4vw, 57px);
  line-height: 1.04;
}
body.workspace-page .section-head p,
body.workspace-page .document-list-head p { color: var(--ink-soft); line-height: 1.65; }
body.workspace-page .badge,
body.workspace-page .status-pill,
body.workspace-page .part-label {
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--forest);
  box-shadow: none;
}

body.workspace-page .dropzone {
  min-height: 320px;
  border: 1px dashed var(--rule-strong);
  border-radius: 12px;
  background:
    linear-gradient(rgba(255,253,247,0.88), rgba(255,253,247,0.88)),
    repeating-linear-gradient(135deg, transparent 0 18px, rgba(180,135,77,0.06) 18px 19px);
}
body.workspace-page .dropzone.dragover { border-color: var(--brass); background: #fffaf0; }
body.workspace-page .dropzone h3 { font-family: "Playfair Display", Georgia, serif; font-size: clamp(28px, 3vw, 43px); }
body.workspace-page .dropzone p { color: var(--ink-soft); }

body.workspace-page .primary-btn,
body.workspace-page .step-btn,
body.workspace-page .askbar button {
  border: 1px solid var(--forest);
  border-radius: 9px;
  background: var(--forest);
  color: #fff;
  box-shadow: none;
}
body.workspace-page .step-btn {
  background: var(--forest);
  text-align: left;
}
body.workspace-page .step-number {
  color: var(--forest);
  background: var(--brass-soft);
}
body.workspace-page .step-desc { color: rgba(255,255,255,0.74); }

body.workspace-page .workflow-status-card {
  border: 1px solid var(--rule);
  border-radius: 11px;
  background: #f7f3e9;
  box-shadow: none;
}
body.workspace-page .status-feed,
body.workspace-page .folder-browser,
body.workspace-page .answers,
body.workspace-page .askbar {
  border-color: var(--rule);
  background: var(--paper-strong);
}
body.workspace-page .status-dot { background: var(--brass); }

body.workspace-page .legend {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #f7f3e9;
}
body.workspace-page .ref-dot.upload { background: var(--oxblood); }
body.workspace-page .ref-dot.clinic { background: var(--brass); }
body.workspace-page .ref-dot.brain { background: var(--forest); }

body.workspace-page .bubble.ai {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #f7f3e9;
  color: var(--ink);
}
body.workspace-page .askbar textarea {
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--paper-strong);
}

body.workspace-page .account-menu { top: 58px; right: 0; }
body.workspace-page .signout { background: var(--oxblood); }

@media (max-width: 1100px) {
  .library-hero { grid-template-columns: 1fr; }
  .library-hero-copy { border-right: 0; border-bottom: 1px solid var(--rule); }
  .library-hero-visual { min-height: 500px; }
  .editorial-section { grid-template-columns: 1fr; gap: 46px; }
  body.workspace-page .layout { grid-template-columns: 210px minmax(0, 1fr); }
}

@media (max-width: 820px) {
  body.landing-page .topbar,
  body.workspace-page .topbar,
  .library-main,
  .library-footer,
  body.workspace-page .layout { width: min(100% - 22px, 1460px); }

  body.landing-page .topbar { align-items: flex-start; }
  body.landing-page .right-actions { justify-content: flex-end; flex-wrap: wrap; }
  body.landing-page .language-select { max-width: 116px; }
  .library-hero { min-height: 0; }
  .library-hero-copy { padding: 76px 28px 46px; }
  .library-hero-copy::before { left: 28px; }
  .library-trust-row { grid-template-columns: 1fr; }
  .editorial-section { padding: 74px 0; }
  .editorial-cards { grid-template-columns: 1fr; }
  .editorial-card { min-height: auto; }
  .editorial-card:first-child { border-left: 1px solid var(--rule); }
  .library-footer { align-items: flex-start; flex-direction: column; }

  body.workspace-page .layout { display: block; }
  body.workspace-page .sidebar { position: static; margin-bottom: 14px; }
  body.workspace-page .side-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.workspace-page .tab-btn { justify-content: center; text-align: center; }
  body.workspace-page .storage-card { margin-top: 14px; }
}

@media (max-width: 560px) {
  body.landing-page .topbar,
  body.workspace-page .topbar { min-height: 62px; padding: 8px 10px; }
  body.landing-page .brand,
  body.workspace-page .brand { font-size: 22px; }
  body.landing-page .brand-logo-wrap,
  body.workspace-page .brand-logo-wrap { width: 40px; height: 40px; }
  body.landing-page .nav-btn { display: none; }
  body.landing-page .hamburger { display: inline-grid; }
  .library-hero h1 { font-size: 45px; }
  .library-hero-visual { padding: 28px 18px; min-height: 430px; }
  .library-hero-visual::after { inset: 12px; }
  .library-ledger { padding: 25px; }
  .library-quote { padding: 70px 16px; }
  body.workspace-page .side-nav { grid-template-columns: 1fr; }
  body.workspace-page .tab-btn { justify-content: flex-start; }
  body.workspace-page .card { padding: 22px 16px; }
  body.landing-page .sam-launcher { right: 12px; bottom: 12px; }
}
