/* Export to PDF. Pages are exported copies of cards; the board itself is never styled here. */

/* A page: the same rules serve the previews, the print window and the pictures. */
.hn-pdf-page {position:relative;overflow:hidden;contain:strict;box-sizing:border-box;font:14px "Segoe UI", Tahoma, Arial, sans-serif;line-height:normal;color:var(--theme-ink,var(--ink,#262722));text-align:start;letter-spacing:normal}
.hn-pdf-clip {position:absolute;overflow:hidden}
.hn-pdf-world {position:absolute;left:0;top:0;width:0;height:0;transform-origin:0 0}
.hn-pdf-world > .card {position:absolute!important;outline:0!important;animation:none!important;transition:none!important}
.hn-pdf-world > svg {overflow:visible;pointer-events:none}
.hn-pdf-page :is(input,textarea,select) {caret-color:transparent}
/* Editing controls mean nothing on paper. They keep their space so every card keeps its layout. */
.hn-pdf-page :is(.drag-handle,.resize-handle,.connection-handle,.task-reorder-grip,.scene-compact-toggle,.scene-calculation-hint,.scene-read-more,.scene-lock-marker,.add-check-item,.hn-task-due:not(.has-date),.calendar-nav,.calendar-lock,.calendar-task-add,.timeline-line-hit,.schedule-zoom,.schedule-add-row,.schedule-task-add,.schedule-phase-add,.schedule-footer,.simple-table-handle,.simple-table-expand,.simple-table-add-title,[data-export-exclude="true"]) {visibility:hidden!important}
/* A file card keeps its picture, name and size; its Download and Preview links need the app. */
.hn-pdf-page .hn-file-actions > :is(a,button) {display:none!important}
.hn-pdf-page input[type=date]::-webkit-calendar-picker-indicator {display:none}
.hn-pdf-attachment {position:absolute;display:flex;flex-direction:column;align-items:center;gap:8px}
.hn-pdf-attachment img {display:block;width:100%;min-height:0;flex:1 1 auto;object-fit:contain}
.hn-pdf-attachment p {margin:0;font:600 13px/1.4 var(--ui-font,Arial),sans-serif;color:var(--theme-ink,#323b4a);text-align:center;overflow-wrap:anywhere}

/* The hidden frame the browser prints from. */
.hn-pdf-print-frame {position:fixed;right:0;bottom:0;width:1px;height:1px;border:0;opacity:0;pointer-events:none}

/* The export window. */
.hn-pdf-overlay {position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;background:#1e332d75;backdrop-filter:blur(4px)}
.hn-pdf-dialog {box-sizing:border-box;display:flex;flex-direction:column;width:min(1180px,calc(100vw - 40px));max-width:none;max-height:calc(100dvh - 40px);margin:auto;padding:0;outline:0;border:1px solid var(--ui-border,#e1e5df);border-radius:20px;background:var(--ui-surface,#fffefa);color:var(--ui-ink,#253d35);box-shadow:0 28px 90px #1c332f30,0 4px 18px #1c332f12;font:14px/1.6 var(--ui-font,Arial),sans-serif;overflow:hidden}
.hn-pdf-header {display:flex;justify-content:space-between;align-items:flex-start;gap:20px;padding:22px 24px 12px}
.hn-pdf-header h2 {margin:0;font-size:22px;font-weight:650;line-height:1.35}
.hn-pdf-subtitle {margin:4px 0 0;color:var(--ui-muted,#677870);font-size:13px;overflow-wrap:anywhere}
.hn-pdf-close {width:44px;height:44px;flex:0 0 44px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--ui-muted,#677870);font:400 27px/1 Arial,sans-serif;cursor:pointer}
.hn-pdf-close:hover {background:var(--ui-accent-soft,#edf3ec)}
.hn-pdf-body {display:grid;grid-template-columns:minmax(250px,300px) minmax(0,1fr);gap:20px;min-height:0;flex:1 1 auto;padding:4px 24px 16px;overflow:hidden}
.hn-pdf-options {display:flex;flex-direction:column;gap:14px;min-height:0;overflow:auto;padding:2px}
.hn-pdf-choice {margin:0;padding:0;border:0;min-width:0}
.hn-pdf-choice[hidden] {display:none}
.hn-pdf-choice legend {margin:0 0 6px;padding:0;font-size:12px;font-weight:650;color:var(--ui-muted,#677870)}
.hn-pdf-segments {display:flex;flex-wrap:wrap;gap:6px}
.hn-pdf-layouts .hn-pdf-segments {flex-direction:column;flex-wrap:nowrap}
.hn-pdf-segment {position:relative;display:flex;align-items:center;gap:6px;min-height:38px;padding:6px 12px;border:1px solid var(--ui-border,#d6ddd7);border-radius:10px;cursor:pointer;font-size:13px;font-weight:550;box-sizing:border-box}
.hn-pdf-segment input {position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.hn-pdf-segment small {color:var(--ui-muted,#677870);font-weight:500}
.hn-pdf-segment:has(input:checked) {border-color:var(--ui-accent,#285d4b);background:var(--ui-accent-soft,#edf3ec);box-shadow:inset 0 0 0 1px var(--ui-accent,#285d4b)}
.hn-pdf-segment:has(input:disabled) {opacity:.45;cursor:default}
.hn-pdf-segment:has(input:focus-visible) {outline:3px solid var(--ui-accent,#285d4b);outline-offset:2px}
.hn-pdf-hint {margin:6px 2px 0;color:var(--ui-muted,#677870);font-size:12px;line-height:1.6}
.hn-pdf-check {display:flex;align-items:flex-start;gap:8px;font-size:13px;font-weight:550;cursor:pointer}
.hn-pdf-check input {width:18px;height:18px;margin:2px 0 0;flex:0 0 18px;accent-color:var(--ui-accent,#285d4b)}
.hn-pdf-check small {color:var(--ui-muted,#677870);font-weight:500}
.hn-pdf-check:has(input:disabled) {opacity:.5;cursor:default}
.hn-pdf-stage {display:flex;flex-direction:column;gap:10px;min-width:0;min-height:0;overflow:auto;padding:12px;border:1px solid var(--ui-border,#e1e5df);border-radius:14px;background:var(--ui-stage,#f0f2eb)}
.hn-pdf-status {margin:0;min-height:22px;font-size:13px}
.hn-pdf-status:empty {display:none}
.hn-pdf-dialog[aria-busy="true"] .hn-pdf-status::before {content:"";display:inline-block;width:14px;height:14px;margin-inline-end:8px;vertical-align:-2px;border:2px solid #c9d9ce;border-top-color:var(--ui-accent,#285d4b);border-radius:50%;animation:hn-pdf-spin .8s linear infinite}
@keyframes hn-pdf-spin {to {transform:rotate(360deg)}}
.hn-pdf-problem {margin:0;padding:10px 14px;border:1px solid #e3b5a9;border-inline-start:4px solid #a84432;border-radius:10px;background:#fff1eb;color:#873e2e;font-size:13px;line-height:1.7;white-space:pre-line}
.hn-pdf-problem[hidden] {display:none}
.hn-pdf-areas {display:flex;flex-direction:column;gap:8px}
.hn-pdf-areas[hidden] {display:none}
.hn-pdf-areas-tools {display:flex;align-items:center;justify-content:space-between;gap:12px}
.hn-pdf-areas-tools .hn-pdf-hint {margin:0}
.hn-pdf-clear {min-height:34px;padding:4px 12px;border:1px solid var(--ui-border,#c9d3cb);border-radius:9px;background:var(--ui-surface,#fff);color:inherit;font:inherit;font-size:12px;cursor:pointer}
.hn-pdf-surface {position:relative;flex:0 0 auto;max-width:100%;border-radius:8px;overflow:hidden;cursor:crosshair;touch-action:none;user-select:none;box-shadow:0 0 0 1px var(--ui-border,#d6ddd7)}
.hn-pdf-surface > .hn-pdf-overview {position:absolute;left:0;top:0}
.hn-pdf-area {position:absolute;box-sizing:border-box;border:2px solid #2f6fd0;background:#2f6fd01f;border-radius:3px}
.hn-pdf-area-drawing {border-style:dashed;pointer-events:none}
.hn-pdf-area-number {position:absolute;top:4px;inset-inline-start:4px;min-width:22px;height:22px;padding:0 5px;box-sizing:border-box;border-radius:11px;background:#2f6fd0;color:#fff;font:700 12px/22px Arial,sans-serif;text-align:center}
.hn-pdf-area-remove {position:absolute;top:2px;inset-inline-end:2px;width:26px;height:26px;padding:0;border:0;border-radius:50%;background:#ffffffe0;color:#7a2d22;font:600 18px/26px Arial,sans-serif;cursor:pointer}
.hn-pdf-pages {display:flex;flex-wrap:wrap;align-content:flex-start;gap:14px}
.hn-pdf-thumb {margin:0;display:flex;flex-direction:column;align-items:center;gap:4px}
.hn-pdf-thumb-frame {position:relative;overflow:hidden;border-radius:3px;box-shadow:0 1px 4px #1b2b2433,0 0 0 1px #1b2b241f;background:#fff}
.hn-pdf-thumb-frame > .hn-pdf-page {position:absolute;left:0;top:0;transform-origin:0 0}
.hn-pdf-thumb figcaption {color:var(--ui-muted,#677870);font-size:12px}
.hn-pdf-footer {display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px;padding:14px 24px 18px;border-top:1px solid var(--ui-border,#e1e5df)}
.hn-pdf-summary {margin-inline-end:auto;color:var(--ui-muted,#677870);font-size:13px}
.hn-pdf-footer button {min-height:44px;padding:9px 16px;border:1px solid var(--ui-border,#acbbb0);border-radius:11px;background:var(--ui-surface,#fff);color:var(--ui-ink,#253d35);font:inherit;font-weight:600;cursor:pointer}
.hn-pdf-footer button:hover:not(:disabled) {background:var(--ui-accent-soft,#edf3ec)}
.hn-pdf-footer button:disabled {opacity:.5;cursor:default}
.hn-pdf-footer .hn-pdf-text {background:var(--theme-action,#384457);border-color:var(--theme-action,#384457);color:var(--theme-action-ink,#fff)}
.hn-pdf-footer .hn-pdf-text:hover:not(:disabled) {background:var(--theme-action,#384457);filter:brightness(1.08)}
.hn-pdf-dialog :is(button,input):focus-visible {outline:3px solid var(--ui-accent,#285d4b);outline-offset:2px}

@media (max-width: 760px) {
  .hn-pdf-dialog {width:100vw;max-height:100dvh;height:100dvh;border-radius:0;border:0}
  .hn-pdf-header {padding:14px 16px 8px}
  /* One column that scrolls as a whole: the choices, then the pages. */
  .hn-pdf-body {display:block;padding:4px 16px 10px;overflow:auto;overscroll-behavior:contain}
  .hn-pdf-options {overflow:visible;margin-bottom:14px}
  .hn-pdf-stage {overflow:visible;min-height:240px}
  .hn-pdf-layouts .hn-pdf-segments {flex-direction:row;flex-wrap:wrap}
  .hn-pdf-footer {gap:8px;padding:10px 16px calc(12px + env(safe-area-inset-bottom))}
  .hn-pdf-summary {flex:1 0 100%}
  .hn-pdf-footer button {flex:1 1 auto;padding:9px 12px}
}
