:root {
  color-scheme: dark;
  background: #081522;
  color: #ddecfa;
  font:
    15px/1.6 system-ui,
    sans-serif;
  --line: #2c4b63;
  --muted: #abc5d9;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #3d6482;
  background: #12324d;
  color: #dff3ff;
  border-radius: 9px;
  cursor: pointer;
  touch-action: manipulation;
}
button:hover {
  background: #1c486c;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
a {
  color: #94d8ff;
}
button:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid #78dcff;
  outline-offset: 3px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 20px 12px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  letter-spacing: 1px;
  font-size: 13px;
}
.brand img {
  width: 36px;
  height: 36px;
}
.brand small {
  display: block;
  font-size: 9px;
  color: var(--muted);
}
main {
  max-width: 1480px;
  margin: auto;
  padding: 24px 20px calc(120px + env(safe-area-inset-bottom));
}
.intro {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: start;
}
.intro h1 {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -1px;
  margin: 0;
}
.intro p {
  margin: 4px 0;
  color: var(--muted);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
}
.import {
  position: relative;
  background: #1b72b5;
  border: 1px solid #519bd2;
  min-width: 116px;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  text-align: center;
  min-height: 48px;
}
.import input {
  opacity: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.import:focus-within {
  outline: 2px solid #78dcff;
  outline-offset: 3px;
}
#pdf-status {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10283b;
  overflow-wrap: anywhere;
}
#pdf-status.error {
  color: #ffbec8;
  border-color: #a66179;
}
.job {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
}
.job progress {
  width: 180px;
  max-width: 50%;
}
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 16px 0;
}
#pdf-count {
  font-size: 12px;
  color: var(--muted);
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}
section,
aside {
  min-width: 0;
}
aside {
  position: sticky;
  top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0e2234;
  padding: 16px;
}
aside h2 {
  font-size: 18px;
  margin: 0 0 10px;
}
#pdf-preview {
  display: block;
  max-width: 100%;
  height: auto;
  margin: auto;
  background: white;
}
#pdf-preview[hidden] {
  display: none;
}
#pdf-preview-status,
.note {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
#pdf-pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.pdf-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0e2538;
  padding: 12px;
  overflow-wrap: anywhere;
}
.pdf-card[aria-current="true"] {
  border-color: #71c6fd;
}
.pdf-card h2 {
  font-size: 14px;
  margin: 0;
}
.pdf-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.pdf-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  height: 200px;
  overflow: hidden;
  margin: 10px 0;
  background: #081623;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}
.pdf-thumb canvas {
  max-width: 100%;
  height: auto;
  max-height: 190px;
}
.pdf-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.pdf-card-actions button {
  font-size: 12px;
  padding: 8px 4px;
  min-width: 0;
}
#pdf-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
}
#pdf-empty h2 {
  font-size: 21px;
  color: #ddecfa;
}
#pdf-downloads a {
  display: block;
  padding: 12px;
  border: 1px solid #4b88b7;
  border-radius: 9px;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.pdf-actions {
  position: fixed;
  inset: auto 0 0;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: #0a2034f5;
  border-top: 1px solid var(--line);
  z-index: 20;
}
.pdf-actions button {
  min-width: 120px;
}
.pdf-actions button[aria-pressed="true"] {
  background: #235f8d;
}
.pdf-actions #pdf-export {
  background: #176eae;
}
dialog {
  background: #10283d;
  color: #ddecfa;
  border: 1px solid #4d7b9b;
  border-radius: 12px;
  padding: 24px;
  max-width: min(560px, calc(100vw - 24px));
}
dialog::backdrop {
  background: #000a;
}
dialog li {
  margin: 12px 0;
}
.skip {
  position: absolute;
  top: -100px;
}
.skip:focus {
  top: 0;
  z-index: 30;
  background: #10283d;
  padding: 12px;
}
@media (max-width: 760px) {
  header {
    padding-inline: 12px;
  }
  .brand {
    font-size: 11px;
  }
  header > a:last-child {
    font-size: 12px;
  }
  main {
    padding: 16px 12px calc(110px + env(safe-area-inset-bottom));
  }
  .intro p {
    font-size: 12px;
  }
  .layout {
    display: block;
  }
  #pdf-preview-pane {
    display: none;
    position: static;
  }
  body[data-pdf-pane="preview"] #pdf-pages-pane {
    display: none;
  }
  body[data-pdf-pane="preview"] #pdf-preview-pane {
    display: block;
  }
  #pdf-pages {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  .pdf-actions {
    gap: 6px;
    padding-inline: 10px;
  }
  .pdf-actions button {
    min-width: 0;
    flex: 1;
    font-size: 12px;
    padding: 8px 4px;
    min-height: 48px;
  }
  .toolbar button {
    font-size: 12px;
  }
  #pdf-status {
    font-size: 12px;
  }
  .job {
    position: sticky;
    top: 0;
    background: #081522f5;
    z-index: 10;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
  }
}
