/* edityourPDF — what the app and the landing page share: the colours and the top bar. Both pages load
   this file, so the bar is the same on both. Dark unless the visitor picks light (see js/theme.js). */
:root {
  --bg: #0f1218; --surface: #171b23; --surface-2: #1f2530; --line: #2a313d; --line-strong: #3a4352;
  --text: #e7eaf0; --muted: #9aa4b5; --accent: #5b9dff; --accent-ink: #08101f; --accent-soft: #17263f;
  --brand: #ff6a55; --wordmark: #dc4356; --danger: #ff7b80; --danger-fill: #c92a35; --danger-ink: #ffffff; --ok: #4ac26b; --warn: #d4a72c; --info-accent: #58a6ff; --field-ink: #cfe2ff; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35); --scroll-shadow: rgb(0 0 0 / .45);
  --c-organize: #fb923c; --c-optimize: #4ade80; --c-convert: #60a5fa; --c-edit: #c084fc; --c-security: #22d3ee; --c-intelligence: #f472b6; --c-workflows: #94a3b8;
  --radius: 12px; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f0f2f5; --line: #dfe3ea; --line-strong: #c5ccd8;
  --text: #171a21; --muted: #5d6676; --accent: #1f6feb; --accent-ink: #ffffff; --accent-soft: #e7f0ff;
  --brand: #c81e27; --wordmark: #a51c30; --danger: #c9202b; --danger-fill: #c9202b; --danger-ink: #ffffff; --ok: #1a7f37; --warn: #805500; --info-accent: #0969da; --field-ink: #0b3d91; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06); --scroll-shadow: rgb(0 0 0 / .15);
  --c-organize: #c2410c; --c-optimize: #15803d; --c-convert: #1d4ed8; --c-edit: #7e22ce; --c-security: #0e7490; --c-intelligence: #be185d; --c-workflows: #475569;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scrollbar-color: var(--line-strong) transparent; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--text); }
::placeholder { color: var(--muted); opacity: 1; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 100; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- the top bar. It sets its own type, so it does not take on the page's. */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; font: 0.9375rem/1.5 var(--font); }
/* only the bar's own row: the "All tools" menu opens inside .top and has a .wrap of its own */
.top > .wrap { display: flex; align-items: center; gap: 18px; min-height: 3.625rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.0625rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand img { width: 26px; height: 26px; }
/* ".wordmark" is the name "edityourPDF" as outlines (/img/wordmark.svg, drawn by ui.js and in the pages' own HTML), sized by
   the font size like the text it replaced: 1em of it is 1em of type. "edit" takes --wordmark, the rest the text colour.
   In the top bar it is the whole logo, and one size at each width of screen: Edit PDF's bar holds more, but the logo does not shrink for it. */
.wordmark { display: block; flex: none; height: 1.3em; width: auto; aspect-ratio: 6263 / 1300; }
.wordmark .wm-accent { fill: var(--wordmark); }
.wordmark .wm-ink { fill: currentColor; }
.nav { display: flex; gap: 2px; align-items: center; flex: 1; min-width: 0; }
.nav > a, .nav > button { background: none; border: 0; padding: 8px 11px; border-radius: 8px; font: inherit; font-weight: 550; color: var(--text); text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.nav > a:hover, .nav > button:hover, .nav > button[aria-expanded="true"] { background: var(--surface-2); }
.nav .spacer { flex: 1; }
.mega { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: 20px 0 26px; max-height: calc(100vh - 3.625rem); overflow: auto; }
.mega .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 22px; }
.mega h3 { margin: 0 0 8px; font-size: 0.75rem; font-weight: 700; line-height: 1.2; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mega a { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 7px; color: var(--text); text-decoration: none; margin-left: -6px; }
.mega a:hover { background: var(--surface-2); }
.mega a .icon { width: 17px; height: 17px; }
.iconbtn { background: none; border: 1px solid transparent; border-radius: 8px; padding: 7px; display: inline-flex; color: var(--muted); cursor: pointer; position: relative; }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.nav-auth { display: inline-flex; align-items: center; gap: 6px; position: relative; margin-left: 2px; }
.nav-auth[hidden] { display: none; }
.signin-nav-btn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.875rem; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; }
.signin-nav-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.signin-nav-btn .icon, .signin-nav-btn .g-mark, .signin-nav-btn .ms-mark { width: 16px; height: 16px; flex: none; }
.credit-pill { display: inline-flex; align-items: center; gap: 0.3em; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line)); color: var(--accent); font-size: 0.78125rem; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.credit-pill.low { background: color-mix(in srgb, var(--warn) 14%, transparent); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); color: var(--warn); }
.credit-pill.empty { background: color-mix(in srgb, var(--danger) 14%, transparent); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--danger); }
.acct-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.84375rem; font-weight: 550; cursor: pointer; white-space: nowrap; }
.acct-btn:hover, .acct-btn[aria-expanded="true"] { border-color: var(--line-strong); background: var(--surface); }
.acct-btn .icon { width: 15px; height: 15px; color: var(--muted); }
.acct-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font-size: 0.75rem; font-weight: 700; flex: none; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); width: min(336px, calc(100vw - 24px)); max-height: calc(100dvh - 72px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 12px; z-index: 45; display: flex; flex-direction: column; gap: 10px; }
.acct-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acct-name { font-weight: 650; font-size: 0.90625rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-email { font-size: 0.78125rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-credits { padding: 9px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.acct-credits-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--muted); }
.acct-credits-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.acct-credits-note { font-size: 0.71875rem; color: var(--muted); line-height: 1.35; }
.acct-history { margin-top: 4px; padding-top: 7px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.acct-history-title { font-size: 0.6875rem; font-weight: 650; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.acct-history-status { font-size: 0.71875rem; color: var(--muted); line-height: 1.35; }
.acct-history-list { display: block; margin: 2px 0 0; padding: 0 2px 0 16px; list-style: disc; font-size: 0.71875rem; line-height: 1.35; color: var(--text); font-variant-numeric: tabular-nums; }
.acct-history-list li { overflow-wrap: anywhere; }
.acct-history-list li + li { margin-top: 5px; }
.acct-history-list li::marker { color: var(--muted); }
.acct-history-list.expanded { max-height: 18rem; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; --scrollbar-thumb: var(--muted); --scrollbar-track: color-mix(in srgb, var(--line) 50%, var(--surface-2)); scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }
.acct-history-list.expanded.scrollable { overflow-y: scroll; container-type: scroll-state; }
.acct-history-list.expanded.scrollable::before,
.acct-history-list.expanded.scrollable::after { content: ""; display: block; position: sticky; block-size: 0.65rem; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .2s; margin-left: -16px; }
.acct-history-list.expanded.scrollable::before { inset-block-start: 0; margin-block-end: -0.65rem; background: radial-gradient(farthest-side at 50% 0, var(--scroll-shadow), transparent); }
.acct-history-list.expanded.scrollable::after { inset-block-end: 0; margin-block-start: -0.65rem; background: radial-gradient(farthest-side at 50% 100%, var(--scroll-shadow), transparent); }
@container scroll-state(scrollable: block-start) { .acct-history-list.expanded.scrollable::before { opacity: 1; } }
@container scroll-state(scrollable: block-end) { .acct-history-list.expanded.scrollable::after { opacity: 1; } }
@supports not (container-type: scroll-state) {
  .acct-history-list.expanded.scrollable::before,
  .acct-history-list.expanded.scrollable::after { animation: acct-scroll-shadow linear both; animation-timeline: scroll(); }
  .acct-history-list.expanded.scrollable::before { animation-range: 0 1.5rem; }
  .acct-history-list.expanded.scrollable::after { animation-direction: reverse; animation-range: calc(100% - 1.5rem) 100%; }
}
@keyframes acct-scroll-shadow { to { opacity: 1; } }
@supports not (scrollbar-color: auto) {
  .acct-history-list.expanded { scrollbar-width: auto; }
  .acct-history-list.expanded::-webkit-scrollbar { width: 6px; }
  .acct-history-list.expanded::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 999px; }
  .acct-history-list.expanded::-webkit-scrollbar-track { background: var(--scrollbar-track); border-radius: 999px; }
}
.acct-history-link { align-self: flex-start; margin-top: 2px; font-size: 0.71875rem; font-weight: 600; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.acct-history-link:hover { filter: brightness(1.12); }
.acct-history-link[aria-busy="true"] { opacity: .65; pointer-events: none; }
.acct-signout { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: none; color: var(--text); font: inherit; font-size: 0.84375rem; font-weight: 550; cursor: pointer; text-align: center; }
.acct-signout:hover { background: var(--surface-2); border-color: var(--line-strong); }
/* ---- language selector (top-right, ResourceCap-style) */
.lang-switch { position: relative; display: inline-flex; align-items: center; margin-left: 2px; flex: none; }
.lang-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.8125rem; font-weight: 600; line-height: 1.2; cursor: pointer; white-space: nowrap; transition: background-color .14s, border-color .14s, color .14s; }
.lang-btn:hover, .lang-btn[aria-expanded="true"] { background: var(--surface); border-color: var(--line-strong); }
.lang-btn[aria-expanded="true"] { border-color: var(--accent); }
.lang-btn .lang-globe { width: 16px; height: 16px; color: var(--muted); }
.lang-btn:hover .lang-globe, .lang-btn[aria-expanded="true"] .lang-globe { color: var(--accent); }
.lang-btn .lang-chev { width: 14px; height: 14px; color: var(--muted); transition: transform .15s; }
.lang-btn[aria-expanded="true"] .lang-chev { transform: rotate(180deg); color: var(--text); }
.lang-code { letter-spacing: .02em; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 204px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 46; display: flex; flex-direction: column; gap: 2px; }
.lang-opt { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 0.875rem; font-weight: 500; text-align: left; cursor: pointer; white-space: nowrap; transition: background-color .12s, color .12s; }
.lang-opt:hover { background: var(--surface-2); }
.lang-opt.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.lang-opt-code { display: inline-grid; place-items: center; min-width: 28px; padding: 2px 5px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 0.6875rem; font-weight: 700; letter-spacing: .03em; line-height: 1.2; flex: none; }
.lang-opt.active .lang-opt-code { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: color-mix(in srgb, var(--accent) 38%, transparent); color: var(--accent); }
.lang-opt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lang-opt-check { width: 16px; height: 16px; flex: none; color: var(--accent); }
@media (max-width: 860px) {
  .nav .hide-sm, .toolbar .hide-sm { display: none; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 14px; }
  .top > .wrap { gap: 6px; flex-wrap: nowrap; }
  .brand { font-size: 0.9375rem; gap: 6px; flex: none; }
  .brand img { width: 22px; height: 22px; }
  .nav > a, .nav > button { padding: 7px 7px; font-size: 0.84375rem; min-width: 0; }
  .nav > button[aria-controls="all-tools-menu"] { max-width: 118px; overflow: hidden; }
  .nav > button[aria-controls="all-tools-menu"] > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  /* Beside "Sign in" or an account, a phone has no room after the logo for everything in words. The menu keeps its
     arrow, the credits their number and the account its initial; the words stay for screen readers, and the
     account menu spells the credits out. */
  .nav:has(.nav-auth:not([hidden])) > button[aria-controls="all-tools-menu"] { flex: none; padding-inline: 4px; }
  .nav:has(.nav-auth:not([hidden])) > button[aria-controls="all-tools-menu"] > span, .credit-pill .credit-word { position: absolute; clip-path: inset(50%); overflow: hidden; width: 1px; height: 1px; margin: -1px; white-space: nowrap; }
  .signin-nav-btn { padding: 5px 8px; gap: 5px; font-size: 0.8125rem; }
  .acct-btn { padding: 3px; }
  .acct-btn > .icon { display: none; }
  .credit-pill { padding: 3px 8px; font-size: 0.75rem; }
  .lang-btn { padding: 5px 7px; gap: 4px; font-size: 0.78125rem; }
  .lang-btn .lang-chev { display: none; }
}
@media (max-width: 380px) {
  .wrap { padding: 0 10px; }
  .top > .wrap { gap: 4px; }
  .brand { font-size: 0.875rem; gap: 5px; }
  .brand img { width: 20px; height: 20px; }
  .nav > a, .nav > button { padding: 6px 5px; font-size: 0.8125rem; }
  .nav > button[aria-controls="all-tools-menu"] { max-width: 84px; }
  .lang-btn { padding: 5px 6px; gap: 3px; font-size: 0.75rem; }
  .lang-btn .lang-globe { width: 15px; height: 15px; }
  .iconbtn { padding: 5px; }
}
