@font-face {
  font-family: Chillax; src: url("/assets/chillax.woff2") format("woff2"); font-weight: 200 700; font-display: swap;
}
:root {
  color-scheme: light; --ink: #17171b; --muted: #52515a; --iris: #5939d5; --lav: #ede8fc;
  --ivory: #f6f5f2; --line: #dedbd6; --paper: #fff; --dark-line: #807a89;
  font: 500 15px/1.48 Chillax, system-ui, sans-serif; color: var(--ink); background: var(--ivory);
}
* { box-sizing: border-box }
body { margin: 0; min-height: 100dvh }
[hidden] { display: none !important }
a { color: inherit; text-decoration: none }
a:hover { color: var(--iris) }
h1,h2,h3,p { margin: 0; overflow-wrap: anywhere }
h1 { font-size: clamp(1.82rem, 3.1vw, 2.45rem); line-height: 1.12; font-weight: 610; letter-spacing: -.035em }
h2 { font-size: 1.35rem; line-height: 1.23; font-weight: 620; letter-spacing: -.018em }
h3 { font-size: 1rem; line-height: 1.3; font-weight: 650 }
button,input,select,textarea { font: inherit }
button { cursor: pointer }
:focus-visible { outline: 2px solid var(--iris); outline-offset: 3px }
.topbar { min-height: 68px; display: flex; padding: 12px clamp(18px,4vw,60px); align-items: center; justify-content: space-between; gap: 16px; background: var(--paper); border-bottom: 1px solid var(--line) }
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ink); flex: 0 0 auto }
.brand img { width: 84px; height: auto; display: block }
.brand span { color: var(--muted); font-size: .92rem; padding-left: 12px; border-left: 1px solid var(--line) }
.account { display: flex; gap: 10px 18px; align-items: center; flex-wrap: wrap; justify-content: flex-end; color: var(--muted) }
.tenant { color: var(--ink); font-weight: 600 }
.page { width: min(1320px,100%); margin: 0 auto; padding: 45px clamp(18px,4vw,52px) 56px }
.opening,.login { width: min(100% - 36px, 430px); margin: clamp(40px,11vh,116px) auto }
.login { padding: clamp(22px,6vw,36px); border: 1px solid var(--line); border-radius: 20px; background: var(--paper) }
.login form { margin-top: 24px }
.login .btn { width: 100% }
.stack,.form-stack { display: grid; gap: 15px }
.stack.lg { gap: 24px }
.section-label { color: var(--iris); font-weight: 630; font-size: .9rem; margin-bottom: 6px }
.muted { color: var(--muted) }
.small { font-size: .88rem }
.btn { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--ink); border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 8px 14px; font-weight: 620; text-align: center; line-height: 1.25 }
.btn:hover,.btn[aria-pressed=true] { border-color: var(--iris); background: var(--lav); color: #382191 }
.btn.primary { background: var(--iris); color: #fff; border-color: var(--iris) }
.btn.primary:hover { color: #fff; background: #4729bb }
.btn.danger { color: #8d2935 }
.btn:disabled { cursor: wait; opacity: .73 }
.btn.subtle { background: transparent; border-color: transparent; color: var(--muted) }
.btn.subtle:hover { color: var(--iris) }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap }
.page-head p { margin-top: 8px }
.filters { margin-bottom: 18px }
.filters .search { margin-left: auto; width: min(100%, 286px) }
input:not([type=checkbox]):not(.sr),select,textarea { background: #fff; color: var(--ink); border: 1px solid var(--dark-line); border-radius: 9px; min-height: 43px; padding: 8px 11px; width: 100% }
select { appearance: none; padding-right: 32px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m3 6 5 5 5-5' stroke='%2352515a' stroke-width='1.5'/%3E%3C/svg%3E") right 10px center / 14px no-repeat }
input[type=checkbox] { accent-color: var(--iris); width: 18px; height: 18px }
label { display: grid; gap: 5px; font-weight: 600 }
.check { display: flex; gap: 7px; min-height: 35px; align-items: center; font-weight: 500 }
.table { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden }
.trow { display: grid; grid-template-columns: minmax(0,2fr) minmax(110px,.9fr) minmax(100px,.8fr) minmax(100px,.8fr) 22px; gap: 12px; align-items: center; padding: 15px 20px; min-height: 66px; color: var(--ink) }
a.trow:hover { background: var(--lav); color: var(--ink) }
.trow + .trow { border-top: 1px solid var(--line) }
.trow.labels { min-height: 42px; color: var(--muted); font-size: .88rem; font-weight: 600 }
.docname { display: flex; align-items: center; gap: 11px; overflow-wrap: anywhere }
.docicon { display: grid; place-items: center; width: 36px; height: 41px; border-radius: 8px; background: var(--lav); color: #4729a5; flex: 0 0 auto }
.docicon svg { width: 19px; height: 19px }
.pill { display: inline-flex; justify-self: start; width: max-content; max-width: 100%; padding: 4px 10px; border-radius: 20px; color: #443498; background: #eee9fb; font-weight: 630; font-size: .85rem }
.pill.good { background: #e2f1e8; color: #185840 }
.pill.closed { background: #f4e3e5; color: #792d38 }
.empty { padding: 28px; text-align: center }
.docbar { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 16px clamp(14px,4vw,55px); background: var(--paper); border-bottom: 1px solid var(--line) }
.docbar h1 { font-size: clamp(1.38rem,3vw,1.9rem) }
.docbar p { margin-top: 5px }
.editor { display: grid; grid-template-columns: 104px minmax(0,1fr) minmax(265px,335px); width: min(1600px,100%); margin: auto; align-items: start; min-height: calc(100dvh - 151px) }
.pages { padding: 18px 10px; display: grid; align-content: start; gap: 8px }
.pages .btn { padding: 6px }
.viewer-panel { padding: clamp(14px,2.4vw,36px); display: grid; gap: 14px; align-content: start; min-width: 0 }
.preview-host { width: min(100%,690px); margin: 0 auto; align-self: start }
label[for=upload]:has(+ input:focus-visible) { outline: 2px solid var(--iris); outline-offset: 3px }
.pdf-sheet { position: relative; background: #fff; box-shadow: 0 13px 36px #27223a12; width: 100%; isolation: isolate }
.pdf-sheet canvas { display: block; width: 100%; height: auto }
.pdf-overlay { position: absolute; inset: 0; pointer-events: none }
.pdf-overlay.placing { pointer-events: auto; cursor: crosshair }
.field-box { position: absolute; pointer-events: auto; z-index: 1; display: grid; place-content: center; padding: 0px 2px; min-width: 0; min-height: 0; overflow: hidden; overflow-wrap: anywhere; border: 1.5px solid #6950bb; border-radius: 3px; background: #eee8ffdc; color: #392481; font-size: clamp(8px,1vw,13px); line-height: 1.02; text-align: center }
.field-box.selected { z-index: 2; background: #dfd3fdf2; outline: 2px solid #5939d5 }
.inspector,.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: clamp(14px,2vw,24px); min-width: 0 }
.inspector { margin: 16px 14px 16px 0 }
.inspector > section + section,.panel > section + section { border-top: 1px solid var(--line); padding-top: 18px }
.person-row { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: flex-start }
.avatar { display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; color: #432d8c; background: var(--lav); font-size: .78rem; font-weight: 650 }
.inline-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 10px }
.span-all { grid-column: 1 / -1 }
.review-grid { width: min(1240px,100%); margin: 0 auto; padding: 26px clamp(16px,3vw,44px); display: grid; grid-template-columns: minmax(0,1fr) minmax(286px,410px); align-items: start; gap: clamp(18px,3vw,38px) }
.review-grid .viewer-panel { padding: 0 }
.review-grid .controls .btn { flex: 1 1 auto }
.metadata { display: grid; gap: 7px; overflow-wrap: anywhere }
.access-card { background: var(--lav); border-radius: 10px; padding: 12px; display: grid; gap: 8px }
.access-card code { font-size: 1.12rem; letter-spacing: .12em; font-weight: 650 }
.notice { position: sticky; z-index: 6; top: 0; padding: 11px clamp(18px,4vw,60px); color: #37215f; background: var(--lav); border-bottom: 1px solid #c9b9ee }
.notice.error { color: #762733; background: #f9e9eb; border-color: #e2aeb5 }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0 }
@media (max-width: 900px) { .editor { grid-template-columns: minmax(0,1fr) minmax(245px,305px) } .pages { grid-column: 1/-1; display: flex; overflow: auto; align-items: center; padding: 13px 16px 0 } .pages h3 { margin-right: 6px } .pages .btn { flex: 0 0 auto; padding: 5px 12px } }
@media (max-width: 650px) {
  .topbar { min-height: 58px; gap: 9px } .brand img { width: 66px } .brand span { padding-left: 8px }
  .account { font-size: .84rem; gap: 4px } .account .btn { min-height: 34px; padding: 5px }
  .page { padding-top: 28px } .page-head { margin-bottom: 18px }
  .docbar { grid-template-columns: 1fr; gap: 8px } .docbar .back { justify-self: start; padding-left: 0; min-height: 28px } .docbar .controls { gap: 6px }
  .editor,.review-grid { grid-template-columns: minmax(0,1fr); min-height: auto } .review-grid { padding-top: 18px } .inspector { margin: 0 14px 14px } .editor .viewer-panel { padding-bottom: 0 }
  .trow { grid-template-columns: minmax(0,1fr) 100px 12px; padding: 12px; gap: 7px }
  .trow .aux,.trow.labels { display: none } .docicon { width: 28px; height: 34px }
  .filters .search { order: 2; margin-left: 0; width: 100% }
  .editor .preview-host:has(.pdf-sheet),.review-grid .preview-host:has(.pdf-sheet) { max-height: 45dvh; overflow: auto; overscroll-behavior: contain }
  .mode-long { order: 3 }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important } }
