@font-face { font-family: EdArimo; src: url(fonts/Arimo-Regular.ttf); }
@font-face { font-family: EdArimo; src: url(fonts/Arimo-Bold.ttf); font-weight: 700; }
@font-face { font-family: EdArimo; src: url(fonts/Arimo-Italic.ttf); font-style: italic; }
@font-face { font-family: EdArimo; src: url(fonts/Arimo-BoldItalic.ttf); font-weight: 700; font-style: italic; }
@font-face { font-family: EdTinos; src: url(fonts/Tinos-Regular.ttf); }
@font-face { font-family: EdTinos; src: url(fonts/Tinos-Bold.ttf); font-weight: 700; }
@font-face { font-family: EdTinos; src: url(fonts/Tinos-Italic.ttf); font-style: italic; }
@font-face { font-family: EdTinos; src: url(fonts/Tinos-BoldItalic.ttf); font-weight: 700; font-style: italic; }
@font-face { font-family: EdCousine; src: url(fonts/Cousine-Regular.ttf); }
@font-face { font-family: EdCousine; src: url(fonts/Cousine-Bold.ttf); font-weight: 700; }
@font-face { font-family: EdCousine; src: url(fonts/Cousine-Italic.ttf); font-style: italic; }
@font-face { font-family: EdCousine; src: url(fonts/Cousine-BoldItalic.ttf); font-weight: 700; font-style: italic; }
@font-face { font-family: EdCarlito; src: url(fonts/Carlito-Regular.ttf); }
@font-face { font-family: EdCarlito; src: url(fonts/Carlito-Bold.ttf); font-weight: 700; }
@font-face { font-family: EdCarlito; src: url(fonts/Carlito-Italic.ttf); font-style: italic; }
@font-face { font-family: EdCarlito; src: url(fonts/Carlito-BoldItalic.ttf); font-weight: 700; font-style: italic; }

:root {
  --ink: #1d2b3a; --muted: #566576; --desk: #d9dfe4; --panel: #f7f9fa; --line: #c3ccd3;
  --mark: #d63a17; --focus: #0b6bcb; color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { display: flex; flex-direction: column; background: var(--desk); color: var(--ink); font: 15px/1.4 system-ui, "Segoe UI", Roboto, sans-serif; }
button, select, input { font: inherit; color: inherit; }
button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 12px; min-height: 36px; cursor: pointer; white-space: nowrap; }
button:hover:not(:disabled) { border-color: var(--ink); }
button:disabled { opacity: .4; cursor: default; }
button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
button.primary { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }
button.primary:hover:not(:disabled) { background: #31475d; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
select, input:not([type=color]):not([type=checkbox]) { border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; background: #fff; min-height: 36px; }

.bar, .context { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.context { background: #fff; gap: 12px; }
.context label { display: inline-flex; align-items: center; gap: 6px; }
.brand { font-size: 17px; margin-right: 8px; letter-spacing: -.01em; }
.spacer { flex: 1; }
.group { display: inline-flex; gap: 4px; }
.pages { color: var(--muted); font-variant-numeric: tabular-nums; }
.pages input { width: 52px; text-align: center; }
#c-size { width: 78px; }
#c-color, #c-bg { width: 40px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
body:not(.has-doc) .doc-only { display: none; }
body.has-doc .start { display: none; }

main { flex: 1; overflow: auto; position: relative; }
.start { max-width: 560px; margin: 0 auto; padding: 10vh 24px 48px; text-align: center; }
.start h1 { font-size: clamp(34px, 7vw, 54px); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 16px; text-wrap: balance; }
.start p { font-size: 18px; margin: 0 0 24px; color: var(--muted); }
.start .small { font-size: 15px; margin: 12px 0 40px; }
.start .note { font-size: 15px; border-top: 1px solid var(--line); padding-top: 16px; }
.big { font-size: 18px; padding: 14px 28px; }
body.drag::after { content: "Upuść plik PDF tutaj"; position: fixed; inset: 12px; display: grid; place-items: center; border: 3px dashed var(--ink); border-radius: 12px; background: rgba(247, 249, 250, .92); font-size: 28px; font-weight: 600; z-index: 50; pointer-events: none; }

#pages { padding: 24px; display: flex; flex-direction: column; gap: 24px; align-items: center; min-width: max-content; }
#pages:empty { display: none; }
.page { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(29, 43, 58, .25), 0 6px 20px rgba(29, 43, 58, .12); overflow: hidden; }
.page canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.page .msg { position: absolute; top: 0; left: 0; right: 0; padding: 8px 12px; background: #fff4d6; font-size: 14px; z-index: 2; }
.layer { position: absolute; inset: 0; }
.run { position: absolute; transform-origin: 0 0; padding: 0; min-height: 0; border: 0; border-radius: 2px; background: transparent; cursor: text; }
.run:hover, .run:focus-visible { background: rgba(11, 107, 203, .13); box-shadow: 0 0 0 1px var(--focus); }
.run.edited { box-shadow: inset 0 -2px 0 -0.5px var(--mark); }
.run.added { cursor: move; touch-action: none; }
.run.added:hover { box-shadow: 0 0 0 1px var(--mark); background: rgba(214, 58, 23, .08); }
.adding .layer { cursor: crosshair; }
.adding .page .msg { display: none; }
.covering .layer { touch-action: none; }
.cover-box { position: absolute; outline: 2px solid var(--focus); cursor: move; touch-action: none; z-index: 5; }
.cover-box i { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--focus); border-radius: 50%; }
.cover-box [data-c=nw] { left: -8px; top: -8px; cursor: nwse-resize; }
.cover-box [data-c=ne] { right: -8px; top: -8px; cursor: nesw-resize; }
.cover-box [data-c=sw] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.cover-box [data-c=se] { right: -8px; bottom: -8px; cursor: nwse-resize; }
.cover-box.drawing { pointer-events: none; }
.adding .run { pointer-events: none; }
.editor { position: absolute; transform-origin: 0 0; margin: 0; padding: 0 !important; border: 0 !important; border-radius: 0 !important; min-height: 0 !important; outline: 2px solid var(--focus) !important; outline-offset: 2px; resize: none; overflow: hidden; white-space: pre; z-index: 5; }

#busy { position: fixed; inset: 0; background: rgba(29, 43, 58, .35); display: grid; place-items: center; z-index: 60; }
#busy span { background: #fff; padding: 16px 24px; border-radius: 8px; font-weight: 600; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); width: max-content; max-width: min(560px, calc(100vw - 32px)); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 8px; z-index: 70; }

dialog { border: 0; border-radius: 12px; padding: 24px; width: min(560px, calc(100vw - 32px)); color: var(--ink); box-shadow: 0 20px 60px rgba(29, 43, 58, .35); }
dialog::backdrop { background: rgba(29, 43, 58, .45); }
dialog h2 { margin: 0 0 16px; font-size: 22px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.grid label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.grid select, .grid input { color: var(--ink); width: 100%; }
.check { display: flex; gap: 8px; align-items: center; margin: 16px 0 8px; }
dialog .small { color: var(--muted); margin: 8px 0 16px; min-height: 1.4em; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

#print-root { display: none; }
@media (max-width: 640px) {
  .bar, .context { padding: 8px; gap: 6px; }
  .brand { display: none; }
  button { padding: 6px 9px; }
  #pages { padding: 12px 8px; }
}
@media print {
  html, body { height: auto; background: #fff; display: block; }
  body:not(.sub) > *:not(#print-root) { display: none !important; }
  #print-root { display: block; }
  .sheet { position: relative; overflow: hidden; break-after: page; break-inside: avoid; }
  .sheet:last-child { break-after: auto; }
  .sheet img { position: absolute; display: block; }
}

/* Stopka i podstrony */
.foot { flex: none; background: var(--panel); border-top: 1px solid var(--line); padding: 6px 16px; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 20px; }
.foot a { color: var(--muted); font-size: 14px; padding: 4px 0; }
.foot a:hover { color: var(--ink); }
.sub .bar a { color: var(--ink); }
.sub a.brand { font-weight: 700; text-decoration: none; display: inline; }
.content { max-width: 760px; margin: 24px auto; padding: 32px clamp(20px, 5vw, 48px); background: #fff; border-radius: 8px; overflow-wrap: anywhere; }
.content.narrow { max-width: 620px; }
.content h1 { font-size: clamp(28px, 5vw, 38px); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 8px; }
.content h2 { font-size: 20px; margin: 28px 0 6px; }
.content p, .content li { line-height: 1.6; }
.form { display: grid; gap: 16px; margin-top: 20px; }
.form label { display: grid; gap: 5px; font-weight: 600; }
.form input, .form select, .form textarea { font-weight: 400; width: 100%; min-height: 42px; }
.form textarea { font: inherit; font-weight: 400; color: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 8px; resize: vertical; }
.form .small { font-size: 14px; color: var(--muted); margin: 0; }
.form .big { justify-self: start; }
#status { margin: 0; min-height: 1.6em; font-weight: 600; }
#status.good { color: #17692f; }
#status.bad { color: #b3261e; }
.hp { position: absolute; left: -9999px; }
.seo { margin-bottom: 40px; text-align: left; }
.seo h2:first-child { margin-top: 0; font-size: 26px; line-height: 1.2; }
.seo details { border-top: 1px solid var(--line); padding: 10px 0; }
.seo summary { cursor: pointer; font-weight: 600; }
.seo details p { margin: 8px 0 0; }
body.has-doc .seo { display: none; }
