/* ConvertEbooks skin for the copied pdftools pages.
   The tools keep pdftools' proven layout, but take the main site's warm-paper
   palette, indigo accent, type scale, radii and shadows. Loaded last. */
:root {
  --page: #f8f7f4;
  --bg: #fffdf9;
  --bg-elevated: #ffffff;
  --bg-sunken: #f2f0ea;
  --heading: #18171c;
  --text: #45434a;
  --text-muted: #5f5d66;
  --text-faint: #85828c;
  --border: #e7e3da;
  --border-strong: #d6d1c5;
  --accent: #4f39f6;
  --accent-hover: #432dd7;
  --accent-soft: #eef0ff;
  --ok: #16803c;
  --ok-soft: #e8f7ec;
  --warn: #b45309;
  --warn-soft: #fff7e6;
  --err: #c02626;
  --err-soft: #fff0f0;
  --local: #16803c;
  --local-soft: #e8f7ec;
  --cdn: #b45309;
  --cdn-soft: #fff7e6;
  --network: #c02626;
  --network-soft: #fff0f0;
  --foot-bg: #f2efe8;
  --foot-fg: #5f5d66;
  --foot-strong: #18171c;
  --foot-line: #e7e3da;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-card: 20px;
  --shadow: 0 1px 2px rgba(30, 26, 20, .05), 0 6px 20px -14px rgba(30, 26, 20, .18);
  --shadow-lg: 0 18px 50px -26px rgba(30, 26, 20, .32), 0 3px 10px -5px rgba(30, 26, 20, .10);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0d0c0b; --bg: #181715; --bg-elevated: #1c1b18; --bg-sunken: #23211d;
    --heading: #f6f3ec; --text: #d7d3ca; --text-muted: #aaa69d; --text-faint: #817d75;
    --border: #2e2b26; --border-strong: #423e37;
    --accent: #9f96ff; --accent-hover: #b9b1ff; --accent-soft: #241f4a;
    --ok: #5ecb8b; --ok-soft: #12291d;
    --warn: #e0a44e; --warn-soft: #2b2216;
    --err: #ef8a7a; --err-soft: #2c1a18;
    --local: #5ecb8b; --local-soft: #12291d;
    --cdn: #e0a44e; --cdn-soft: #2b2216;
    --network: #ef8a7a; --network-soft: #2c1a18;
    --foot-bg: #151412;
    --foot-fg: #aaa69d;
    --foot-strong: #f6f3ec;
    --foot-line: #2e2b26;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px -14px rgba(0,0,0,.5);
    --shadow-lg: 0 18px 50px -26px rgba(0,0,0,.7), 0 3px 10px -5px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  --page: #0d0c0b; --bg: #181715; --bg-elevated: #1c1b18; --bg-sunken: #23211d;
  --heading: #f6f3ec; --text: #d7d3ca; --text-muted: #aaa69d; --text-faint: #817d75;
  --border: #2e2b26; --border-strong: #423e37;
  --accent: #9f96ff; --accent-hover: #b9b1ff; --accent-soft: #241f4a;
  --ok: #5ecb8b; --ok-soft: #12291d;
  --warn: #e0a44e; --warn-soft: #2b2216;
  --err: #ef8a7a; --err-soft: #2c1a18;
  --local: #5ecb8b; --local-soft: #12291d;
  --cdn: #e0a44e; --cdn-soft: #2b2216;
  --network: #ef8a7a; --network-soft: #2c1a18;
  --foot-bg: #151412;
  --foot-fg: #aaa69d;
  --foot-strong: #f6f3ec;
  --foot-line: #2e2b26;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px -14px rgba(0,0,0,.5);
  --shadow-lg: 0 18px 50px -26px rgba(0,0,0,.7), 0 3px 10px -5px rgba(0,0,0,.4);
}

html { background: var(--page); }
body { font: 15px/1.65 var(--sans); }
h1 { font-weight: 800; letter-spacing: -.03em; }
h2 { font-weight: 700; letter-spacing: -.02em; }
.lede { color: var(--text-muted); }
button { border-radius: 9px; font-weight: 600; }
button.primary { border-radius: 10px; font-weight: 700; box-shadow: var(--shadow); }
button.primary:hover:not(:disabled) { box-shadow: var(--shadow-lg); }
select, input[type="text"], input[type="number"], input[type="password"] { border-radius: 9px; }
.side { top: 64px; height: calc(100vh - 64px); }
@media (max-width: 900px) {
  /* The desktop side panel is a full-height sticky column. On phones it must
     collapse to its content, otherwise the primary action is pushed a full
     viewport below the file list. */
  .side { position: static; top: auto; height: auto; overflow: visible; }
  /* Once the settings panel is on screen, keep its primary action in reach
     while the user scrolls through long crop/split controls. */
  .side__foot {
    position: sticky; bottom: 0; z-index: 5;
    background: var(--bg-elevated); padding: 12px 0 8px;
    box-shadow: 0 -10px 24px -20px rgba(30, 26, 20, .45);
  }
}
.side__foot .primary { border-radius: 11px; font-weight: 700; }
.drop__btn { border-radius: 11px; font-weight: 700; box-shadow: var(--shadow); }
.addbtn { border-radius: 9px; }
.item { border-radius: var(--radius); box-shadow: var(--shadow); }
.page-foot { background: var(--foot-bg); color: var(--text-faint); }
.page-foot a { color: var(--text-muted); }

/* The pdftools stylesheet has a global `button { padding: 8px 15px }` which is
   later in the cascade than the shared header rules. Reset it inside the header
   so the standard 36px icon buttons and sign-in pill keep their geometry. */
.site-header .icon-btn { padding: 0; border: 0; background: none; }
.site-header .lang-btn { padding: 0 9px; border: 0; background: none; }
.site-header .pdf-menu-btn { padding: 0 13px; }
.site-header .sign-btn { padding: 7px 14px; border: 1px solid var(--accent); background: transparent; }
.site-header .sign-btn:hover { background: var(--accent); color: #fff; }


/* The original pdftools header injected the add-files SVG into .aic. The shared
   ConvertEbooks header does not, so draw the same plus with CSS. */
.addbtn .aic { display: grid !important; place-items: center; }
.addbtn .aic::before {
  content: "+";
  color: #fff;
  font: 700 22px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* iOS Safari zooms the page when a focused field is under 16px. */
@media (max-width: 900px) {
  select, input[type="text"], input[type="number"], input[type="password"], textarea { font-size: 16px; }
}
