/* Kinnect document viewer (doc-viewer.js) — a full-window Kinnect frame
   around the browser's PDF viewer / an image. Sits above the plan room
   (99999) and its preview (100000), below Kinnect dialogs (100050+). */
html.kdv-lock,html.kdv-lock body{overflow:hidden}
/* A slim 6 px of the app around the window (was 16) and a 48 px bar (was 56):
   the sheet gets the rest of the screen (2026-10-26). */
.kdv-overlay{position:fixed;inset:0;z-index:100020;display:none;align-items:stretch;justify-content:center;padding:6px;background:var(--k-overlay);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);opacity:0;transition:opacity .14s ease;font-family:var(--k-font)}
.kdv-overlay.show{opacity:1}
.kdv{position:relative;display:flex;flex-direction:column;width:100%;max-width:2200px;min-width:0;border-radius:var(--k-r-lg);overflow:hidden;background:var(--k-surface);box-shadow:var(--k-shadow-lg);transform:translateY(8px) scale(.99);transition:transform .18s var(--k-ease)}
.kdv-overlay.show .kdv{transform:none}
/* Brand accent: the red fade line Kinnect modals carry along the top edge. */
.kdv::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:var(--kinnect-grad-line);z-index:1}
.kdv [hidden]{display:none!important}

.kdv-bar{flex:0 0 auto;display:flex;align-items:center;gap:8px;min-height:48px;padding:5px 8px 4px 12px;border-bottom:1px solid var(--k-line)}
/* View | Takeoff (2026-10-26): the same sheet, measured. Right after the
   name; the spacer pushes the rest of the bar right. */
.kdv-bar .kdv-title{flex:0 1 auto}
.kdv-sp{flex:1 1 auto;min-width:4px}
.kdv-mode{flex:0 0 auto;display:inline-flex;gap:2px;margin-left:6px;padding:2px;border-radius:999px;background:var(--k-fill-2)}
.kdv-mode button{display:inline-flex;align-items:center;gap:7px;height:30px;padding:0 14px;border:0;border-radius:999px;background:none;font:600 12.5px var(--k-font);color:var(--k-text-2);cursor:pointer;transition:background .12s,color .12s}
.kdv-mode button:hover{color:var(--k-ink)}
.kdv-mode button i{font-size:12px}
.kdv-mode button[aria-pressed="true"]{background:var(--k-surface);color:var(--k-ink);box-shadow:var(--k-shadow-xs)}
.kdv-mode button[data-v="takeoff"][aria-pressed="true"] i{color:var(--k-accent)}
.kdv-mode button:focus-visible{outline:none;box-shadow:var(--k-focus-ring)}
/* In Takeoff the markup palette steps aside (one set of tools at a time), the
   sheet's notes drop below the scale pill, and Takeoff's own hint replaces
   the first-open one. */
.kdv.is-takeoff .kpv-mk,.kdv.is-takeoff .kpm-pal,.kdv.is-takeoff .kpm-chip,.kdv.is-takeoff .kpv-hint{display:none!important}
.kdv.is-takeoff .kpv-note{top:62px;z-index:5}
/* The PDF view's zoom, Markup and Compare, when they sit in the bar (pdf-view.js toolsHost). */
.kdv-tools{display:flex;align-items:center;min-width:0;margin-right:6px;padding-right:8px;border-right:1px solid var(--k-line)}
.kdv-tools:empty{display:none}
.kdv-ico{flex:0 0 auto}
/* Back (2026-10-27): to the sheet a callout (or the sheet list) left — its number on the button. */
.kdv-back{flex:0 0 auto;display:inline-flex;align-items:center;gap:7px;max-width:170px;height:30px;padding:0 12px 0 10px;border:0;border-radius:999px;background:var(--k-fill-2);font:600 12px var(--k-font);color:var(--k-ink);white-space:nowrap;cursor:pointer;transition:background .12s;animation:kinnect-fade-up .16s var(--k-ease)}
.kdv-back:hover{background:var(--k-hover)}
.kdv-back:focus-visible{outline:none;box-shadow:var(--k-focus-ring)}
.kdv-back i{font-size:11px;color:var(--k-accent)}
.kdv-back-t{min-width:0;overflow:hidden;text-overflow:ellipsis;font-family:var(--k-mono)}
.kdv-title{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:1px;line-height:1.3}
/* The name: with more than one sheet (file), the button that lists them all. */
.kdv-name{-webkit-appearance:none;appearance:none;display:inline-flex;align-items:center;gap:7px;max-width:calc(100% + 14px);min-width:0;margin:-2px -7px;padding:2px 7px;border:0;border-radius:var(--k-r-sm);background:none;font:inherit;color:var(--k-ink);text-align:left;cursor:pointer;transition:background .12s}
.kdv-name-t{min-width:0;font-size:13.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kdv-caret{flex:0 0 auto;font-size:10px;color:var(--k-text-3);transition:transform .15s var(--k-ease)}
.kdv-name:hover{background:var(--k-hover)}
.kdv-name:focus-visible{outline:none;box-shadow:var(--k-focus-ring)}
.kdv-name[aria-expanded="true"]{background:var(--k-fill-2)}
.kdv-name[aria-expanded="true"] .kdv-caret{transform:rotate(180deg)}
.kdv-name:disabled{cursor:default;background:none;color:var(--k-ink)}
.kdv-name:disabled .kdv-caret{display:none}

/* The sheet list: a search box over every sheet, grouped by discipline. */
.kdv-pk{position:absolute;z-index:40;display:flex;flex-direction:column;width:min(460px,calc(100% - 16px));background:var(--k-surface);border:1px solid var(--k-line);border-radius:var(--k-r-lg);box-shadow:var(--k-shadow-lg);overflow:hidden;animation:kinnect-fade-up .16s var(--k-ease)}
.kdv-pk-search{flex:0 0 auto;display:flex;align-items:center;gap:8px;padding:6px 12px;border-bottom:1px solid var(--k-line)}
.kdv-pk-search .fa{font-size:12px;color:var(--k-text-3)}
.kdv-pk-q{flex:1;min-width:0;height:34px;border:0;outline:none;background:none;font:13px var(--k-font);color:var(--k-ink)}
.kdv-pk-q::placeholder{color:var(--k-text-3)}
.kdv-pk-list{position:relative;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 0 4px}
.kdv-pk-grp{position:sticky;top:0;z-index:1;display:flex;align-items:baseline;gap:6px;padding:9px 14px 5px;background:var(--k-surface);font-size:10.5px;font-weight:700;letter-spacing:var(--k-ls-micro);text-transform:uppercase;color:var(--k-text-3)}
.kdv-pk-grp small{font-size:10.5px;font-weight:600;letter-spacing:0;color:var(--k-text-3)}
.kdv-pk-row{display:flex;align-items:center;gap:12px;min-height:32px;padding:0 14px;font-size:12.5px;color:var(--k-text);cursor:pointer}
.kdv-pk-row.is-act{background:var(--k-hover)}
.kdv-pk-row.is-cur{background:var(--k-accent-wash);color:var(--k-accent-ink);font-weight:600}
.kdv-pk-num{flex:0 0 auto;min-width:62px;font-family:var(--k-mono);font-size:12px;font-weight:600;color:var(--k-ink);font-variant-numeric:tabular-nums}
.kdv-pk-row.is-cur .kdv-pk-num{color:var(--k-accent-ink)}
.kdv-pk-ttl{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kdv-pk-row .fa-check{flex:0 0 auto;font-size:11px;color:var(--k-accent)}
.kdv-pk-none{padding:22px 14px;font-size:12.5px;color:var(--k-text-3);text-align:center}
.kdv-pk-foot{flex:0 0 auto;display:flex;justify-content:space-between;gap:10px;padding:6px 14px;border-top:1px solid var(--k-line);font-size:11px;color:var(--k-text-3);white-space:nowrap}
.kdv-sub{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--k-text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kdv-sub:empty{display:none}
.kdv-tag{flex:0 0 auto;padding:0 6px;border-radius:999px;background:var(--k-fill-2);color:var(--k-text-2);font-size:10.5px;font-weight:600;line-height:17px}
.kdv-nav{display:flex;align-items:center;gap:2px;margin-right:4px}
.kdv-pos{min-width:52px;text-align:center;font-size:12px;color:var(--k-text-2);font-variant-numeric:tabular-nums;white-space:nowrap}
.kdv-nav .k-icon-btn:disabled{opacity:.35;cursor:default;background:transparent}
.kdv-note{max-width:280px;font-size:11.5px;line-height:1.35;color:var(--k-crit)}
.kdv-x{margin-left:2px}
/* Print (#u453mx): the section's pages print from a frame nobody sees. */
.kdv-print-frame{position:fixed;right:0;bottom:0;width:0;height:0;border:0;visibility:hidden}

/* The stage is dark so a sheet reads like paper on a light table — the same
   gray the browser's PDF viewer uses behind its pages. */
.kdv-stage{position:relative;flex:1;min-height:0;display:flex;background:var(--k-gray-700)}
.kdv-frame{flex:1;width:100%;height:100%;border:0;background:var(--k-gray-700)}
.kdv-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:8px;color:var(--k-on-dark-2);font-size:12.5px;pointer-events:none}
.kdv-msg{margin:auto;display:flex;flex-direction:column;align-items:center;gap:6px;max-width:360px;padding:28px 24px;border-radius:var(--k-r-lg);background:var(--k-surface);text-align:center;font-size:12.5px;line-height:1.5;color:var(--k-text-2)}
.kdv-msg .btn{margin-top:8px}
.kdv-msg-acts{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}

.kdv-imgwrap{flex:1;min-width:0;display:flex;align-items:center;justify-content:center;padding:16px;overflow:auto}
.kdv-img{display:block;max-width:100%;max-height:100%;object-fit:contain;cursor:zoom-in;background:#FFFFFF;box-shadow:var(--k-shadow-md)}
.kdv-imgwrap.is-zoom{align-items:flex-start;justify-content:flex-start}
.kdv-imgwrap.is-zoom .kdv-img{max-width:none;max-height:none;cursor:zoom-out;margin:auto}

@media (max-width:1180px){
  .kdv-dl span{display:none}
  .kdv-dl{padding:0 9px}
}
@media (max-width:720px){
  .kdv-mode,.kdv-print,.kdv-move{display:none}
  .kdv-overlay{padding:0}
  .kdv{border-radius:0}
  .kdv-bar{gap:4px;padding:8px 6px 8px 10px}
  .kdv-ico,.kdv-sub{display:none}
  .kdv-dl span{display:none}
  .kdv-dl{padding:0 9px}
  .kdv-pos{min-width:40px}
  .kdv-back{max-width:96px;padding:0 10px 0 9px}
  .kdv-note{position:absolute;top:56px;left:8px;right:8px;max-width:none;padding:6px 10px;border-radius:var(--k-r-md);background:var(--k-surface);box-shadow:var(--k-shadow-md);z-index:2}
  .kdv-pk{left:8px!important;right:8px;width:auto}
  .kdv-pk-q{font-size:16px}
  .kdv-pk-row{min-height:42px}
  .kdv-pk-keys{display:none}
}
@media (max-width:480px){
  /* A phone: the arrow alone, so the sheet's own name keeps the room (the number is in its tip). */
  .kdv-back{width:32px;padding:0;justify-content:center}
  .kdv-back-t{display:none}
}
@media (prefers-reduced-motion:reduce){
  .kdv-overlay,.kdv{transition:none}
  .kdv-pk,.kdv-back{animation:none}
}
