/* DeepShelf - "Azur", the look of DeepShelf Explorer: white, airy, ocean-blue
   touches, fine lines, Manrope. Previous "greige cloth" design:
   _sauvegarde_design_2026-10-27_textile_rd. */
:root {
  --bg: #ffffff;
  --field: #f4f8fc;         /* inputs, table head, soft panels */
  --panel: #ffffff;
  --ink: #14202e;
  --ink-soft: #536170;
  --muted: #93a0ae;
  --line: #e2eaf2;
  --line-soft: #edf2f7;
  --hover: #f5f9fd;
  --accent: #0b74c9;        /* ocean blue */
  --accent-deep: #085a9c;
  --accent-soft: #e7f2fb;
  --mark: #d6eafa;
  --good: #2f8a5b;
  --bad: #c2412d;
  --amber: #c98a12;
  --amber-soft: #fdf5e4;
  --radius: 14px;
  --shadow: 0 18px 50px -34px rgba(11,60,110,.35);
  --header-h: 74px;
  --f-ui: "Manrope", "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", Consolas, monospace;
  font-family: var(--f-ui);
  font-size: 14.5px;
  color: var(--ink);
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; background-color: var(--bg);
  /* a faint blue haze at the top, nothing more */
  background-image: linear-gradient(180deg, #f2f8fd 0, rgba(242,248,253,0) 260px);
  background-repeat: no-repeat;
}
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
h1, h2 { font-weight: 300; letter-spacing: -.015em; }
.muted { color: var(--muted); }
.error { color: var(--bad); }
.small { font-size: 12px; }
::selection { background: var(--mark); }

/* Header: light, logo on the left */
header.top {
  position: relative; height: var(--header-h); display: flex; align-items: center; gap: 24px;
  padding: 0 32px; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.75); backdrop-filter: blur(12px);
  animation: rise .5s cubic-bezier(.2,.7,.2,1) both;
}
header.top .brand {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  font-size: 23px; font-weight: 300; letter-spacing: -.01em; line-height: 1; color: var(--ink);
}
header.top .brand b { font-weight: 700; color: var(--accent); }
header.top .brand svg { width: 34px; height: 34px; color: var(--accent); flex: none; }
header.top a.brand:hover { text-decoration: none; }
header.top .title {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-soft);
  padding-left: 22px; border-left: 1px solid var(--line);
}
header.top .title:empty { border-left: 0; }
header.top > a:not(.brand):not(.btn) { color: var(--ink-soft); font-size: 13.5px; }
header.top > a:not(.brand):not(.btn):hover { color: var(--accent); text-decoration: none; }
header.top a.small { color: var(--muted); }

button, .btn {
  font: inherit; font-size: 13px; font-weight: 500;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
}
button:hover, .btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
button:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.badge {
  background: rgba(255,255,255,.22); border-radius: 999px; padding: 0 8px;
  font-family: var(--f-mono); font-size: 11.5px;
}

input[type=checkbox] { accent-color: var(--accent); }
textarea:focus, input:focus { outline: none; }

/* Page-load reveal: cards rise in one after another */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.home > *, .columns > .col, .page > *, .report, .reader, .pdf-pages {
  animation: rise .55s cubic-bezier(.2,.7,.2,1) both;
}
.home > :nth-child(2), .columns > .col:nth-child(2), .page > :nth-child(2) { animation-delay: .09s; }
.columns > .col:nth-child(3), .page > :nth-child(3) { animation-delay: .18s; }
.page > :nth-child(n+4) { animation-delay: .24s; }

/* Home */
.home { max-width: 1060px; margin: 48px auto; padding: 0 28px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 30px 32px;
  box-shadow: var(--shadow);
}
.home form.card h2 { font-size: 32px; line-height: 1.15; max-width: 24ch; margin-bottom: 10px; }
.home form.card h2 + .muted { max-width: 70ch; line-height: 1.6; margin: 0 0 20px; color: var(--ink-soft); }
.home textarea {
  width: 100%; min-height: 190px; font: inherit; font-size: 16px; line-height: 1.65;
  padding: 16px 20px; resize: vertical; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--field);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.home textarea::placeholder { color: var(--muted); }
.home textarea:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(11,116,201,.12); }
.home .row { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; gap: 16px; }
.home .row .btn-primary { padding: 10px 28px; font-size: 15px; }
.login-field {
  width: 100%; font: inherit; font-size: 16px; padding: 12px 18px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; background: var(--field);
}
.login-field:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(11,116,201,.12); }
.stats { display: flex; flex-wrap: wrap; gap: 6px; }
.stat {
  font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; background: var(--field);
}
table.history { width: 100%; border-collapse: collapse; }
table.history td, table.history th { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line-soft); }
table.history tr:hover td { background: var(--hover); }
table.history td:first-child a { font-size: 15px; font-weight: 600; color: var(--ink); }
table.history td:first-child a:hover { color: var(--accent); text-decoration: none; }
table.history th {
  font-family: var(--f-mono); font-weight: 500; color: var(--muted); font-size: 10.5px; background: var(--field);
  text-transform: uppercase; letter-spacing: .1em; border-bottom: 1px solid var(--line);
}
table.history td.muted { font-family: var(--f-mono); font-size: 12px; }

/* Session: three columns */
.session-bar {
  display: flex; align-items: center; gap: 14px; padding: 14px 32px 10px;
}
.session-bar details { flex: 1; min-width: 0; }
.session-bar summary { cursor: pointer; color: var(--ink-soft); font-family: var(--f-mono); font-size: 12px; }
.session-bar summary::marker { color: var(--accent); }
.session-bar .problem { white-space: pre-wrap; margin: 10px 0; font-size: 15px; line-height: 1.6; max-width: 90ch; }
.session-bar > a.small { font-family: var(--f-mono); }
.plan-queries { margin: 6px 0 0; padding-left: 18px; color: var(--ink-soft); line-height: 1.55; }
.plan-queries b { color: var(--accent); font-weight: 600; }
.columns {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.25fr) minmax(0, .8fr);
  gap: 18px; padding: 6px 32px 24px; height: calc(100vh - var(--header-h) - 54px);
}
.col {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; min-height: 0; box-shadow: var(--shadow);
}
.col > .col-head {
  padding: 13px 18px; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; gap: 8px;
}
.col > .col-body { padding: 12px 18px; overflow-y: auto; flex: 1; scrollbar-color: var(--line) transparent; }
.col h2 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.col h3 {
  font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent); margin: 20px 0 6px; display: flex; align-items: center; gap: 8px;
}
.col h3::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.col h3 .muted { color: var(--muted); }

.counts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.count { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12px; background: var(--field); }
.count b { color: var(--accent); font-family: var(--f-mono); }

.doc { padding: 12px 0; border-bottom: 1px solid var(--line-soft); transition: background .2s; }
.doc .picks { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 7px; font-size: 12px; color: var(--muted); }
.doc .picks label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.doc .picks label:hover { color: var(--ink); }
.doc .picks input { margin: 0; }
.doc:last-child { border-bottom: 0; }
.doc .t { font-weight: 600; font-size: 15px; line-height: 1.35; }
.doc .t a { color: var(--ink); }
.doc .t a:hover { color: var(--accent); text-decoration: none; }
.doc .meta { color: var(--muted); font-family: var(--f-mono); font-size: 11px; margin: 4px 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.doc .snippet { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.doc.selected {
  background: var(--accent-soft); margin: 0 -12px; padding: 12px 12px 12px 14px; border-radius: 10px;
  box-shadow: inset 2px 0 0 var(--accent);
}
.chip {
  font-family: var(--f-mono); font-size: 10.5px; border: 1px solid var(--line); border-radius: 999px;
  padding: 0 7px; color: var(--ink-soft); background: var(--field);
}

/* Technology matrix */
.fn { margin-bottom: 22px; }
.fn > h4 {
  font-size: 16px; font-weight: 600; padding: 4px 0 8px; margin-bottom: 10px;
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px;
}
.fn > h4::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.tech {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
  display: grid; grid-template-columns: 20px 1fr; gap: 8px; background: #fff;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.tech:hover { border-color: #c6d8ea; }
.tech.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(11,116,201,.10); }
.tech .name { font-weight: 700; font-size: 14.5px; }
.tech .principle { margin: 4px 0 8px; line-height: 1.5; color: var(--ink-soft); }
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 13px; }
.pros-cons > div { border-top: 1.5px solid; padding-top: 4px; }
.pros-cons > .pros { border-color: var(--good); } .pros-cons > .cons { border-color: var(--bad); }
.pros-cons b { font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
.pros-cons ul { margin: 4px 0; padding-left: 16px; line-height: 1.45; }
.pros b { color: var(--good); } .cons b { color: var(--bad); }
.users { margin-top: 8px; font-size: 13px; line-height: 1.5; padding-left: 16px; }
.users li { margin-bottom: 3px; }
.users li::marker { color: var(--accent); }
.best {
  margin-top: 8px; font-size: 13px; background: var(--amber-soft); padding: 7px 12px;
  border-radius: 8px; box-shadow: inset 2px 0 0 var(--amber);
}
.src {
  font-family: var(--f-mono); font-size: 10.5px; color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 0 6px; margin-left: 3px; vertical-align: 1px;
}
.src:hover { background: var(--accent); color: #fff; text-decoration: none; }
.gaps {
  background: linear-gradient(135deg, #0b74c9, #085a9c); color: #eaf4fc; border-radius: 12px;
  padding: 16px 20px; line-height: 1.55;
}
.gaps b { font-weight: 700; font-size: 15px; color: #fff; }
.gaps li::marker { color: #9fd0f5; }
.spinner { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 20px 0; line-height: 1.5; }
/* a book sliding along the shelf */
.spinner::before {
  content: ""; flex: none; width: 34px; height: 14px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 3px 11px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 100% / 100% 1.5px no-repeat;
  animation: slide 1.1s ease-in-out infinite alternate;
}
@keyframes slide { to { background-position: 100% 0, 0 100%; } }

/* Notes */
#notes {
  width: 100%; height: 100%; border: 0; resize: none; outline: none; color: var(--ink);
  font: inherit; font-size: 15px; line-height: 1.7; background: none;
}
#notes::placeholder { color: var(--muted); }

/* View all */
.page { max-width: 1300px; margin: 26px auto; padding: 0 32px; }
.tabs {
  display: inline-flex; gap: 2px; flex-wrap: wrap; margin: 14px 0; padding: 3px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--field);
}
.tabs a { padding: 5px 14px; color: var(--ink-soft); font-size: 13px; border-radius: 999px; }
.tabs a:hover { color: var(--accent); text-decoration: none; }
.tabs a.on { background: #fff; color: var(--accent); font-weight: 600; box-shadow: 0 1px 3px rgba(11,60,110,.15); }
details.folder {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px;
  box-shadow: var(--shadow); overflow: hidden;
}
details.folder > summary { padding: 13px 18px; cursor: pointer; font-size: 16px; font-weight: 600; }
details.folder > summary:hover { background: var(--hover); }
details.folder > summary::marker, details.sub > summary::marker { color: var(--accent); }
details.folder details.sub { margin: 0 18px 10px; border-left: 1px solid var(--line); }
details.sub > summary { padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 14px; }
details.sub .docs { padding: 0 12px 0 16px; }

/* Report: a typeset technical note */
.report {
  max-width: 860px; margin: 36px auto; padding: 56px 64px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px; line-height: 1.7; font-size: 15.5px;
  box-shadow: var(--shadow);
}
.report h1 { font-size: 36px; line-height: 1.12; margin-bottom: 10px; }
.report h1 + .muted { font-family: var(--f-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.report h2 {
  font-size: 21px; font-weight: 600; letter-spacing: -.01em; margin: 34px 0 8px; padding-top: 14px; border-top: 1px solid var(--line);
}
.report table { border-collapse: collapse; width: 100%; font-size: 13px; line-height: 1.5; }
.report td, .report th { border-bottom: 1px solid var(--line-soft); padding: 8px 8px; vertical-align: top; text-align: left; }
.report th { font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); background: var(--field); border-bottom: 1px solid var(--line); }
.report li::marker { color: var(--accent); }
.report ol li { font-size: 14px; margin-bottom: 4px; }

/* Busy overlay */
#overlay {
  position: fixed; inset: 0; background: rgba(20,32,46,.35); display: none; align-items: center;
  justify-content: center; z-index: 10; backdrop-filter: blur(6px);
}
#overlay .box {
  background: var(--panel); padding: 24px 30px; border-radius: 18px; max-width: 440px;
  border: 1px solid var(--line); box-shadow: 0 24px 60px -30px rgba(11,60,110,.55); animation: rise .3s both;
}
#overlay.on { display: flex; }

.tech input { align-self: start; margin-top: 4px; }

/* Select all / Download ZIP */
.sel-tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sel-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
header.top .back-btn { flex: none; }

/* PDF pages (images made by the server) */
.pdf-pages { max-width: 920px; margin: 20px auto; padding: 0 12px; text-align: center; }
.pdf-page {
  display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 6px; margin: 0 auto; box-shadow: var(--shadow);
}
.pdf-num { margin: 8px 0 20px; font-family: var(--f-mono); }

/* Document reader */
.reader {
  max-width: 860px; margin: 32px auto; padding: 48px 60px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px; line-height: 1.75; font-size: 16px;
  box-shadow: var(--shadow);
}
.reader h1 { font-size: 30px; line-height: 1.18; margin-bottom: 8px; }
.reader .orig-title { color: var(--muted); margin: 0 0 4px; font-style: italic; }
.reader > p.muted.small { font-family: var(--f-mono); font-size: 11.5px; }
.reader .page-mark {
  margin: 28px 0 8px; font-family: var(--f-mono); font-size: 10.5px; color: var(--accent); text-transform: uppercase;
  letter-spacing: .12em; display: flex; align-items: center; gap: 10px;
}
.reader .page-mark::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.reader h3.sec { font-size: 17px; font-weight: 700; margin: 18px 0 6px; color: var(--ink); }
.reader .passage { margin: 0 0 12px; white-space: pre-line; }
.reader .passage.translated { box-shadow: inset 2px 0 0 var(--accent); padding-left: 14px; }
.reader .passage.pending { opacity: .45; }

/* Narrow windows and phones */
@media (max-width: 900px) {
  header.top { padding: 0 16px; gap: 14px; }
  header.top .brand { font-size: 20px; }
  header.top .brand svg { width: 28px; height: 28px; }
  header.top .title { padding-left: 14px; }
  .home, .page { padding: 0 16px; margin-top: 28px; }
  .home form.card h2 { font-size: 25px; }
  .card { padding: 22px 18px; }
  .columns { grid-template-columns: 1fr; height: auto; padding: 8px 16px 16px; }
  .col > .col-body { max-height: 70vh; }
  .session-bar { padding: 12px 16px 8px; flex-wrap: wrap; }
  .report, .reader { margin: 20px 12px; padding: 28px 22px; }
  .report h1 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
