.documents-page {
   min-height: 100vh;
   margin: 0;
   overflow-x: clip;
   color: rgb(253, 239, 213);
   background: #000;
}

.documents-app {
   width: 100%;
   max-width: 100%;
   overflow-x: clip;
   padding: 0 18px 48px;
   font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.documents-shell {
   width: min(1540px, 100%);
   min-width: 0;
   margin: 0 auto;
   padding: 18px;
   border: 1px solid rgba(0, 255, 255, 0.68);
   border-radius: 18px;
   background: linear-gradient(145deg, rgba(16, 20, 21, 0.99), rgba(3, 5, 6, 0.99));
   box-shadow: 0 18px 54px rgba(0, 0, 0, 0.62), 0 0 18px rgba(255, 255, 255, 0.1);
}

.documents-heading,
.documents-notes-heading {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 14px;
}

.documents-heading {
   position: static;
   z-index: auto;
   width: 100%;
   padding-top: 0;
   justify-content: flex-start;
}

.documents-heading > .documents-import-button { margin-left: auto; }

body.documents-page .documents-heading > .pajaro-stats-menu {
   flex: 0 0 44px;
   width: 44px;
   margin: 0 !important;
}

body.documents-page .documents-heading > .pajaro-stats-menu > summary {
   width: 44px;
   min-height: 44px;
   padding: 6px;
   justify-content: center;
   border-radius: 0;
   background: transparent;
}

body.documents-page .documents-heading > .pajaro-stats-menu > summary svg {
   display: block;
   width: 26px;
   height: 28px;
}

body.documents-page .documents-heading > .pajaro-stats-menu > summary span,
body.documents-page .documents-heading > .pajaro-stats-menu > summary::after { display: none; }

body.documents-page .documents-heading > .pajaro-stats-menu #stats_container.pajaro-stats-card {
   top: calc(100% + 4px);
   right: auto;
   left: 0;
}

.documents-eyebrow {
   margin: 0 0 3px;
   color: rgba(253, 239, 213, 0.55);
   font-size: 0.7rem;
   font-weight: 750;
   letter-spacing: 0.11em;
   text-transform: uppercase;
}

.documents-heading h2,
.documents-notes-heading h3,
.documents-cad-panel h3 {
   margin: 0;
}

.documents-heading h2 {
   color: #ff6a2a;
   font-size: clamp(1.65rem, 4vw, 2.4rem);
   white-space: nowrap;
}

.documents-sync {
   margin-top: 14px;
   border: 1px solid rgba(0, 255, 255, 0.28);
   border-radius: 12px;
   background: rgba(0, 255, 255, 0.035);
}

.documents-sync > summary { display: flex; min-height: 46px; padding: 12px; align-items: center; justify-content: space-between; color: rgb(253,239,213); font-size: .86rem; font-weight: 750; cursor: pointer; list-style: none; }
.documents-sync > summary::-webkit-details-marker { display: none; }
.documents-sync-arrow { color: aqua; font-size: 1rem; transition: transform .16s ease; }
.documents-sync[open] .documents-sync-arrow { transform: rotate(180deg); }
.documents-sync-content { display: flex; padding: 0 12px 12px; align-items: end; justify-content: space-between; gap: 18px; }
.documents-sync-intro { min-width: 0; }
.documents-sync-help { max-width: 620px; margin: 5px 0 0; color: rgba(253, 239, 213, 0.68); font-size: 0.78rem; line-height: 1.45; }
.documents-sync-status { margin: 4px 0 0; color: rgba(253, 239, 213, 0.55); font-size: 0.72rem; }
.documents-sync-status[data-state="synced"] { color: #5de1a1; }
.documents-sync-status[data-state="offline"] { color: #ffbd72; }
.documents-sync-status[data-state="error"] { color: #ff7a7a; }
.documents-sync-actions { display: flex; min-width: 0; align-items: center; gap: 7px; }
.documents-sync-actions label { display: grid; gap: 5px; }
.documents-sync-actions label span { color: rgba(253, 239, 213, 0.55); font-size: 0.67rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
.documents-sync-actions input { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid rgba(0, 255, 255, 0.4); border-radius: 9px; color: rgb(253, 239, 213); background: #050708; font: inherit; }
.documents-sync-join { position: relative; }
.documents-sync-join summary { min-height: 42px; padding: 12px 10px; color: rgba(253, 239, 213, 0.72); font-size: 0.76rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.documents-sync-join-fields { position: absolute; z-index: 4; right: 0; width: min(340px, calc(100vw - 32px)); margin-top: 8px; padding: 12px; border: 1px solid rgba(0, 255, 255, 0.42); border-radius: 10px; background: #0a0d0e; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.7); }
.documents-sync-join:not([open]) .documents-sync-join-fields { display: none; }
.documents-sync-join-fields label { margin-bottom: 8px; }

.documents-import-button {
   display: inline-flex;
   min-height: 44px;
   padding: 0 15px;
   align-items: center;
   justify-content: center;
   border: 1px solid #ff6a2a;
   border-radius: 10px;
   color: rgb(253, 239, 213);
   background: rgba(255, 106, 42, 0.13);
   font-weight: 750;
   cursor: pointer;
}

.documents-import-button:hover,
.documents-import-button:focus-within {
   background: rgba(255, 106, 42, 0.28);
}

.documents-import-button input {
   position: absolute;
   width: 1px;
   height: 1px;
   opacity: 0;
   pointer-events: none;
}

.documents-picker,
.documents-page-controls label {
   display: grid;
   gap: 5px;
}

.documents-heading-picker {
   width: auto;
   max-width: none;
   min-width: 0;
   padding: 0;
}

.documents-heading-picker select {
   width: auto;
   max-width: none;
   font-family: "Amatic SC", cursive;
   font-size: 1.05rem;
   font-weight: 700;
   white-space: nowrap;
}

.documents-picker > span,
.documents-page-controls label > span,
.documents-note-form label > span {
   color: rgba(253, 239, 213, 0.55);
   font-size: 0.67rem;
   font-weight: 750;
   letter-spacing: 0.06em;
   text-transform: uppercase;
}

.documents-picker select,
.documents-page-controls input,
.documents-note-form input,
.documents-note-form select,
.documents-note-form textarea {
   width: 100%;
   min-height: 42px;
   padding: 8px 10px;
   border: 1px solid rgba(0, 255, 255, 0.4);
   border-radius: 9px;
   color: rgb(253, 239, 213);
   background: #050708;
   font: inherit;
}

.documents-page-controls,
.documents-view-controls,
.documents-toolstrip,
.documents-note-actions {
   display: flex;
   align-items: end;
   gap: 6px;
}

.documents-page-controls input {
   width: 52px;
}

.documents-page-spinner {
   display: flex;
   width: 73px;
   height: 42px;
   gap: 3px;
}

.documents-page-spinner input {
   width: 100%;
   height: 42px;
   padding: 6px 5px;
   text-align: center;
   appearance: textfield;
   -moz-appearance: textfield;
}

.documents-page-spinner input::-webkit-inner-spin-button,
.documents-page-spinner input::-webkit-outer-spin-button {
   margin: 0;
   appearance: none;
   -webkit-appearance: none;
}

.documents-page-stepper {
   display: grid;
   width: 18px;
   height: 42px;
   grid-template-rows: 1fr 1fr;
   gap: 1px;
}

.documents-shell .documents-page-stepper button {
   width: 18px;
   min-height: 0;
   height: auto;
   padding: 0;
   border: 0;
   border-radius: 2px;
   color: aqua;
   background: transparent;
   font-size: .48rem;
   line-height: 1;
}

.documents-shell button {
   min-height: 42px;
   margin: 0;
   padding: 0 12px;
   border: 1px solid #ff6a2a;
   border-radius: 9px;
   color: rgb(253, 239, 213);
   background: rgba(255, 106, 42, 0.12);
   font: 700 0.78rem/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
   cursor: pointer;
}

.documents-shell button:hover,
.documents-shell button:focus-visible,
.documents-shell button.is-active {
   color: #fff;
   background: rgba(255, 106, 42, 0.3);
}

#documents-zoom-out,
#documents-zoom-in {
   width: 42px;
   padding: 0;
   font-size: 1.2rem;
}

.documents-layout {
   display: grid;
   grid-template-columns: minmax(0, 1.8fr) minmax(310px, 0.62fr);
   gap: 16px;
   margin-top: 16px;
}

.documents-viewer,
.documents-notes {
   min-width: 0;
   padding: 12px;
   border: 1px solid rgba(253, 239, 213, 0.15);
   border-radius: 14px;
   background: rgba(0, 0, 0, 0.34);
}

.documents-toolstrip {
   display: grid;
   grid-template-columns: minmax(0, 1fr) auto;
   align-items: end;
   margin-bottom: 10px;
}

.documents-markup-controls {
   display: flex;
   justify-self: start;
   gap: 6px;
}

.documents-toolstrip .documents-view-controls {
   grid-column: 2;
   align-items: center;
   justify-self: end;
}

.documents-viewport {
   box-sizing: border-box;
   width: 100%;
   max-width: 100%;
   height: clamp(420px, 64vh, 760px);
   margin-inline: auto;
   padding: 15px;
   border: 1px solid rgba(0, 255, 255, 0.32);
   border-radius: 10px;
   background: #17191a;
   overflow: auto;
   overscroll-behavior: contain;
   touch-action: pan-x pan-y;
}

.documents-viewport.is-pinching {
   cursor: zoom-in;
}

.documents-viewport.is-page-swiping {
   cursor: grabbing;
   user-select: none;
}

.documents-viewport:not(.is-modal) {
   cursor: zoom-in;
}

.documents-preview-dialog {
   width: calc(100vw - 20px);
   max-width: none;
   height: calc(100dvh - 20px);
   max-height: calc(100dvh - 20px);
   margin: auto;
   padding: 0;
   border: 1px solid rgba(0, 255, 255, 0.62);
   border-radius: 14px;
   color: rgb(253, 239, 213);
   background: #050708;
   overflow: hidden;
}

.documents-preview-dialog::backdrop {
   background: rgba(0, 0, 0, 0.88);
   backdrop-filter: blur(4px);
}

.documents-preview-dialog-card,
.documents-preview-mount {
   box-sizing: border-box;
   width: 100%;
   height: 100%;
   min-height: 0;
}

.documents-preview-dialog-card {
   position: relative;
   padding: 10px;
}

.documents-preview-mount {
   display: grid;
}

.documents-preview-mount > .documents-viewport {
   width: 100%;
   height: 100%;
   min-height: 0;
   border-radius: 9px;
   cursor: default;
}

#documents-preview-close {
   position: absolute;
   top: 16px;
   right: 16px;
   z-index: 20;
   display: grid;
   width: 44px;
   min-width: 44px;
   height: 44px;
   min-height: 44px;
   margin: 0;
   padding: 0;
   place-items: center;
   border: 1px solid rgba(0, 255, 255, 0.68);
   border-radius: 50%;
   color: #fff;
   background: rgba(5, 12, 14, 0.94);
   font: 400 1.65rem/1 system-ui, sans-serif;
   cursor: pointer;
}

#documents-preview-close:hover,
#documents-preview-close:focus-visible {
   color: aqua;
   background: #050c0e;
}

.documents-visually-hidden {
   position: absolute;
   width: 1px;
   height: 1px;
   margin: -1px;
   padding: 0;
   border: 0;
   clip: rect(0 0 0 0);
   clip-path: inset(50%);
   overflow: hidden;
   white-space: nowrap;
}

.documents-file-actions {
   display: flex;
   justify-content: flex-end;
   gap: 8px;
   margin-top: 10px;
}

.documents-file-actions a {
   display: inline-flex;
   min-height: 42px;
   padding: 8px 14px;
   align-items: center;
   justify-content: center;
   border: 1px solid rgba(0, 255, 255, 0.55);
   border-radius: 9px;
   color: rgb(253, 239, 213);
   background: rgba(0, 255, 255, 0.08);
   font-weight: 750;
   text-decoration: none;
}

.documents-file-actions a:hover,
.documents-file-actions a:focus-visible {
   background: rgba(0, 255, 255, 0.16);
}

.documents-file-actions a[aria-disabled="true"] {
   opacity: 0.45;
   pointer-events: none;
}

.documents-loading {
   box-sizing: border-box;
   width: 100%;
   height: 100%;
   min-height: 100%;
   display: grid;
   padding: 24px;
   place-content: center;
   justify-items: center;
   gap: 12px;
   color: rgba(253, 239, 213, 0.55);
   background: #080a0b;
   text-align: center;
}

.documents-loading[data-state="loading"]::before {
   content: "";
   width: 38px;
   height: 38px;
   box-sizing: border-box;
   border: 3px solid rgba(0, 255, 255, 0.16);
   border-top-color: aqua;
   border-right-color: #ff6a2a;
   border-radius: 50%;
   animation: documents-loading-spin 0.85s linear infinite;
}

.documents-loading[hidden] {
   display: none;
}

@keyframes documents-loading-spin {
   to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
   .documents-loading[data-state="loading"]::before { animation: none; }
}

.documents-stage {
   position: relative;
   box-sizing: content-box;
   width: max-content;
   margin: 0 auto;
   padding: 0;
   border: 2px solid rgba(0, 255, 255, 0.76);
   border-radius: 6px;
   background: var(--documents-paper, #fff);
   box-shadow: 0 10px 34px rgba(0, 0, 0, 0.62);
   overflow: hidden;
}

#documents-canvas {
   display: block;
   max-width: none;
}

.documents-privacy-mask {
   position: absolute;
   z-index: 1;
   inset: 0;
   pointer-events: none;
}

.documents-privacy-mask i {
   position: absolute;
   display: block;
   border-radius: 2px;
   background: rgba(255, 255, 255, 0.08);
   backdrop-filter: blur(2.4px);
   -webkit-backdrop-filter: blur(2.4px);
}

.documents-privacy-mask[data-rotation="0"] [data-privacy-zone="identity"] { left: 92%; top: 8%; width: 6.5%; height: 24%; }
.documents-privacy-mask[data-rotation="0"] [data-privacy-zone="address"] { left: 92%; top: 39%; width: 6.5%; height: 44%; }
.documents-privacy-mask[data-rotation="90"] [data-privacy-zone="identity"] { left: 68%; top: 92%; width: 24%; height: 6.5%; }
.documents-privacy-mask[data-rotation="90"] [data-privacy-zone="address"] { left: 17%; top: 92%; width: 44%; height: 6.5%; }
.documents-privacy-mask[data-rotation="180"] [data-privacy-zone="identity"] { left: 1.5%; top: 68%; width: 6.5%; height: 24%; }
.documents-privacy-mask[data-rotation="180"] [data-privacy-zone="address"] { left: 1.5%; top: 17%; width: 6.5%; height: 44%; }
.documents-privacy-mask[data-rotation="270"] [data-privacy-zone="identity"] { left: 8%; top: 1.5%; width: 24%; height: 6.5%; }
.documents-privacy-mask[data-rotation="270"] [data-privacy-zone="address"] { left: 39%; top: 1.5%; width: 44%; height: 6.5%; }

.documents-pin-layer {
   position: absolute;
   z-index: 2;
   inset: 0;
   overflow: hidden;
}

.documents-pin-layer.is-placing {
   cursor: crosshair;
}

.documents-pin-layer.is-hidden {
   display: none;
}

.document-pin {
   position: absolute;
   width: 30px;
   height: 30px;
   min-height: 30px !important;
   padding: 0 !important;
   border: 2px solid #fff !important;
   border-radius: 50% 50% 50% 8px !important;
   color: #fff !important;
   background: #ff5b2e !important;
   box-shadow: 0 4px 12px rgba(0, 0, 0, 0.62);
   font-size: 0.72rem !important;
   transform: translate(-18%, -82%) rotate(-45deg);
}

.document-pin span {
   display: block;
   transform: rotate(45deg);
}

.document-pin[data-type="question"] { background: #8f65ff !important; }
.document-pin[data-type="inspection"] { background: #008fb3 !important; }
.document-pin[data-type="detail"] { background: #228c54 !important; }
.document-pin[data-type="change"] { background: #c17d00 !important; }
.document-pin.is-resolved { opacity: 0.5; }

.documents-render-status {
   display: none;
}

.documents-notes-actions {
   display: flex;
   align-items: center;
   gap: 8px;
}

#documents-notes-toggle {
   width: 34px;
   min-width: 34px;
   min-height: 34px;
   padding: 0;
   border-color: rgba(0, 255, 255, 0.42);
   border-radius: 50%;
   color: aqua;
   background: rgba(0, 255, 255, 0.06);
   font-size: 1rem;
   line-height: 1;
}

#documents-notes-toggle span {
   display: block;
   transform: translateY(-1px);
}

.documents-notes-content[hidden] {
   display: none;
}

@media (min-width: 1051px) {
   .documents-layout.is-notes-collapsed {
      grid-template-columns: minmax(0, 1fr) 64px;
   }

   .documents-notes.is-collapsed {
      padding-inline: 8px;
   }

   .documents-notes.is-collapsed .documents-notes-heading {
      flex-direction: column;
      justify-content: flex-start;
   }

   .documents-notes.is-collapsed .documents-notes-heading > div:first-child {
      display: none;
   }

   .documents-notes.is-collapsed .documents-notes-actions {
      flex-direction: column-reverse;
   }
}

.documents-note-list {
   display: grid;
   gap: 8px;
   max-height: 330px;
   overflow: auto;
}

.documents-note-empty {
   padding: 22px 12px;
   border: 1px dashed rgba(253, 239, 213, 0.2);
   border-radius: 10px;
   color: rgba(253, 239, 213, 0.44);
   text-align: center;
}

.documents-note-card {
   display: grid;
   grid-template-columns: auto minmax(0, 1fr) auto;
   gap: 9px;
   align-items: center;
   padding: 9px;
   border: 1px solid rgba(253, 239, 213, 0.14);
   border-radius: 10px;
   background: rgba(255, 255, 255, 0.035);
}

.documents-note-card.is-resolved { opacity: 0.58; }
.documents-note-index { color: #ff7a47; font-size: 0.72rem; font-weight: 800; }
.documents-note-title { font-weight: 720; overflow-wrap: anywhere; }
.documents-note-meta { margin-top: 2px; color: rgba(253, 239, 213, 0.45); font-size: 0.66rem; text-transform: capitalize; }
.documents-note-edit { min-height: 34px !important; padding: 0 9px !important; }

.documents-note-form {
   display: grid;
   gap: 11px;
   margin-top: 14px;
   padding-top: 14px;
   border-top: 1px solid rgba(253, 239, 213, 0.15);
}

.documents-note-form[hidden] { display: none; }
.documents-note-form label { display: grid; gap: 5px; min-width: 0; }
.documents-note-form textarea { resize: vertical; }
.documents-note-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.documents-note-actions { flex-wrap: wrap; }
.documents-note-actions .documents-danger { border-color: #ff6868; background: rgba(255, 80, 80, 0.12); }
.documents-note-actions .documents-secondary { border-color: rgba(253, 239, 213, 0.28); background: transparent; }

.documents-cad-panel {
   width: min(560px, 100%);
   margin: 70px auto;
   padding: 24px;
   border: 1px solid rgba(0, 255, 255, 0.52);
   border-radius: 14px;
   background: rgba(4, 7, 8, 0.96);
}

.documents-cad-panel h3 { color: #ff6a2a; overflow-wrap: anywhere; }
.documents-cad-panel dl { display: grid; gap: 8px; margin: 18px 0; }
.documents-cad-panel dl div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 7px; border-bottom: 1px solid rgba(253, 239, 213, 0.12); }
.documents-cad-panel dt { color: rgba(253, 239, 213, 0.48); }
.documents-cad-panel dd { margin: 0; text-align: right; }
.documents-cad-next { color: rgba(253, 239, 213, 0.54); font-size: 0.78rem; line-height: 1.5; }
.documents-cad-progress { margin: 14px 0; padding: 10px; border-left: 3px solid aqua; color: rgba(253, 239, 213, 0.75); background: rgba(0, 255, 255, 0.07); font-size: 0.78rem; }
.documents-cad-progress[hidden] { display: none; }
.documents-autodesk-viewer { width: 100%; min-height: 640px; border-radius: 10px; overflow: hidden; }
.documents-autodesk-viewer[hidden] { display: none; }

@media (max-width: 1050px) {
   .documents-layout { grid-template-columns: minmax(0, 1fr); }
   .documents-note-list { max-height: none; }
}

@media (max-width: 900px) {
   .documents-app { padding: 0 0 36px; }
   .documents-shell { padding: 14px; }
   .documents-sync-content { align-items: stretch; flex-direction: column; }
   .documents-sync-actions { justify-content: space-between; }
}

@media (max-width: 560px) {
   .documents-shell { padding: 12px 8px; border-radius: 14px; }
   .documents-viewport { padding: 0; }
   .documents-heading { align-items: center; gap: 8px; }
   .documents-heading h2 { font-size: clamp(20px, 6vw, 24px); }
   .documents-heading > div { min-width: 0; }
   .documents-sync-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
   .documents-sync-actions > button { width: 100%; padding-inline: 8px; }
   .documents-sync-join { min-width: 0; }
   .documents-sync-join summary { overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
   .documents-sync-join-fields { right: 0; }
   .documents-import-button { min-height: 40px; padding-inline: 11px; }
   .documents-heading-picker { flex: 1 1 auto; width: auto; max-width: none; padding: 0; }
   .documents-heading-picker select { width: 100% !important; max-width: 100%; }
   .documents-page-controls, .documents-view-controls { flex: 0 0 auto; align-items: center; justify-content: center; gap: 3px; }
   .documents-view-controls { justify-content: flex-end; }
   .documents-page-spinner { display: flex; width: 56px; height: 36px; gap: 2px; }
   .documents-page-spinner input { width: 36px; min-height: 36px; height: 36px; padding: 4px 3px; }
   .documents-page-stepper { position: static; width: 18px; height: 36px; }
   .documents-shell .documents-page-stepper button { width: 18px; }
   #documents-zoom-out, #documents-zoom-in { width: 34px; }
   #documents-fit { width: 38px; padding: 0; }
   .documents-viewer, .documents-notes { padding: 8px; }
   .documents-toolstrip { display: flex; flex-wrap: wrap; }
   .documents-markup-controls { display: flex; width: 100%; gap: 6px; }
   .documents-markup-controls button { flex: 1; }
   .documents-toolstrip > .documents-view-controls { flex: 1 0 100%; min-width: 0; justify-content: stretch; overflow-x: auto; scrollbar-width: none; }
   .documents-toolstrip > .documents-view-controls::-webkit-scrollbar { display: none; }
   .documents-view-controls button { flex: 0 0 auto; }
   .documents-file-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
   .documents-note-row { grid-template-columns: minmax(0, 1fr); }
   .documents-note-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
   .documents-note-actions button:first-child { grid-column: 1 / -1; }
   .documents-autodesk-viewer { min-height: 520px; }
   .documents-preview-dialog {
      width: calc(100vw - 20px);
      height: calc(100dvh - 20px);
      max-height: calc(100dvh - 20px);
      border-radius: 11px;
   }
   .documents-preview-dialog-card { padding: 6px; }
   #documents-preview-close { top: 12px; right: 12px; }
}
