/* Screen polish is separate from the shared document/PDF print rules. */
@media screen{
 :root{--ui-brand:#243e59;--ui-accent:#eb632f;--ui-ink:#263a4d;--ui-muted:#728091;--ui-border:#e3e9ef;--ui-radius:14px;background:#f5f7fa;letter-spacing:-.015em}
 body{background:#f5f7fa}
 button,input,select,textarea{transition:border-color .15s,background .15s,box-shadow .15s}
 button{font-weight:500;border-radius:9px}
 button.primary{box-shadow:0 3px 8px #d76a2415}
 button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #f0a68488;outline-offset:3px}
 input,select,textarea{border-color:#dce4eb}
 input:hover,select:hover,textarea:hover{border-color:#b7c6d3}
 .sidebar{width:224px;background:#243d56;padding:28px 17px 20px}
 .sidebar .brand{padding:0 8px 23px;border-bottom:1px solid #ffffff13}
 .sidebar .form-wordmark{font-size:24px;letter-spacing:-1px}
 .workspace{padding:22px 9px 17px;margin:0;font-size:13px;color:#d3deea}
 .workspace span{background:#ffffff0d;color:#a6b9cd;font-size:10px}
 .nav-caption{padding-left:12px;font-size:9px;letter-spacing:2px;color:#7f98b1}
 .sidebar nav{margin-top:9px}
 .nav{font-size:13px;border-radius:10px;padding:12px;min-height:47px;margin-bottom:5px;color:#b8c9d9}
 .nav.active{background:#ffffff10;color:white;box-shadow:inset 3px 0 var(--ui-accent)}
 .nav:hover{background:#ffffff0b;color:white}
 .nav>span{font-size:18px;color:#b1c3d5}
 .nav i{font-size:9px;color:#7390aa}
 .side-guide{border-color:#ffffff15;background:#ffffff03;padding:17px;margin-top:auto}
 .side-guide strong{font-size:17px;line-height:1.6;font-weight:600}
 .side-guide p{font-size:11px;line-height:1.8;color:#91a9c0}
 .side-bottom{padding:19px 9px 0;font-size:10px;color:#7993ad;line-height:1.8}
 .shell{margin-left:224px}
 .topbar{height:70px;padding:0 34px;background:#ffffffed;position:sticky;top:0;z-index:7;backdrop-filter:blur(10px);border-bottom:1px solid #e6ebf1}
 .crumb{font-size:10px;letter-spacing:.08em;color:#8b98a5}.crumb b{font-size:12px;letter-spacing:0;color:#475c70}
 .account{gap:8px}.account .actor-label{font-size:10px;background:#f0f4f8;color:#6c8195;border-radius:6px;padding:5px 8px}
 .account select{font-size:12px;border-color:transparent;background-color:transparent;min-height:36px}.account .quiet{font-size:12px;padding:8px 10px}
 .shell main{padding:32px 34px 38px;max-width:1600px}
 .intro{margin-bottom:22px}.intro h1{font-size:27px;letter-spacing:-1px;font-weight:700;margin-bottom:7px}.intro p{font-size:13px;color:#7a8794;line-height:1.7}
 .intro .edition{font-size:10px;color:#aeb9c4;letter-spacing:.08em}
 .panel{border-radius:13px;border-color:#e2e8ef;box-shadow:0 2px 5px #263e5403}
 .panel-head{padding:19px 21px;border-bottom-color:#edf0f5}.panel-head h2{font-size:16px;font-weight:600}.panel-head small{font-size:11px}
 .toolbar{padding:13px 16px;border-radius:11px;background:#fff;border:1px solid #e6ebf0}.toolbar-note{font-size:12px}
 .stats{gap:15px;margin-bottom:24px}.stat{border:1px solid #e4eaf0;border-radius:12px;padding:20px;box-shadow:0 2px 5px #263e5403;min-height:113px}
 .stat label{font-size:12px;font-weight:500;color:#78899a}.stat strong{font-size:32px;line-height:1.2;letter-spacing:-1px;color:#2c4358}.stat small{font-size:11px}
 .stat.emphasis{background:#fff8f3;border-color:#f3dacb}.stat.emphasis strong{color:#d55a28}
 .stat-icon{opacity:.65}
 .tab-search{gap:14px}.tabs .tab{font-size:12px;height:42px}.tabs .tab[aria-selected=true]{border-bottom-color:var(--ui-accent);color:var(--ui-brand)}
 .search{font-size:12px;background:#fff}.documents-table thead th,.company-library thead th{font-size:11px;letter-spacing:.01em;background:#f7f9fb;color:#758799;font-weight:500;padding-top:13px;padding-bottom:13px}
 .documents-table td,.company-library td{padding-top:16px;padding-bottom:16px;border-bottom-color:#edf1f5}.document-title{font-size:13px;font-weight:600}.doc-meta{font-size:10px;margin-top:5px;color:#9aa7b3}
 .badge{font-size:10px;border-radius:6px;padding:5px 9px}.row-button{font-size:11px;border-radius:7px;padding:5px 11px;min-height:31px}.table-foot{font-size:11px;color:#8d9aa8}
 .callout{border-radius:12px;background:#edf2f7;border-color:#e0e7ef;font-size:12px;color:#728396;padding:18px 21px}.callout strong{font-size:13px;color:#465f76}
 .app-footer{font-size:10px;color:#9aa6b2;padding:12px 34px 25px}.app-footer span{color:#a5afba}
 .modal-head{border-bottom-color:#e8edf2;padding:23px 26px}.modal-head h2{font-size:19px;letter-spacing:-.5px;margin-bottom:6px}.modal-head small{font-size:11px}
 .modal-body{padding:24px 26px}.modal-foot{background:#fafbfd;border-top-color:#e8edf2}.modal-foot button{font-size:13px}
 .form-grid{gap:20px}label{font-size:12px}.form-section{background:#f2f5f8;border-radius:8px;padding:12px 14px;font-size:12px}
 .attendance-header h2,.leave-calendar-head h2{font-size:17px}.check-controls{background:#fafbfd}.member-check{border-radius:11px}.member-check:has(input:checked){box-shadow:0 1px 4px #277f6408}
 .leave-calendar-day:hover{background:#f4f7fa}.leave-weekdays{background:#f8fafc}.leave-day-detail{background:#f8fafc}
 .sign-card,.sign-education{border-color:#e0e7ee;box-shadow:0 3px 12px #263f5d04}.sign-step{color:#90a0af}.sign-intro h1{letter-spacing:-.8px}
 .company-form-header{border-bottom-color:#e4eaf0}.company-form-main{max-width:1400px}
 /* Library navigation keeps built-in forms and uploaded company forms distinct. */
 .library-source-tabs{display:flex;gap:6px;align-items:center;padding:6px;background:#eaf0f5;border:1px solid #e2e8ee;border-radius:12px;margin-bottom:22px}
 .library-source{background:transparent;border:0;color:#77899a;font-size:13px;padding:11px 18px;min-height:44px}
 .library-source.active{background:white;color:#2c4258;box-shadow:0 2px 5px #263f5d0a}
 .library-source b{display:inline-block;font-size:10px;background:#e7edf3;color:#648099;border-radius:5px;padding:2px 6px;margin-left:7px}.library-source.active b{background:#fff1e8;color:#d76431}
 .library-upload{margin-left:auto;font-size:11px;background:transparent;border:0;color:#60778c}
 .library-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin:0 0 18px}
 .section-kicker{font-size:9px;letter-spacing:2px;color:#91a0ae;font-weight:600;display:none;margin-bottom:8px}
 .library-heading h2{font-size:21px;letter-spacing:-.7px;margin-bottom:7px}.library-heading p{font-size:12px;color:#8a98a5;margin:0}
 .template-search{margin:0;width:260px}.template-search input{width:100%;font-size:12px;min-height:41px;background:white;padding-left:14px}
 .template-filters{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:16px}
 .category-chip{min-height:36px;padding:8px 12px;border:1px solid #dfe6ed;border-radius:8px;background:#fff;color:#7a8b9a;font-size:11px}
 .category-chip span{font-size:10px;margin-left:6px;color:#9eabb7}.category-chip[aria-selected=true]{background:#2d465f;border-color:#2d465f;color:white}.category-chip[aria-selected=true] span{color:#bdcbd8}
 .library-result-count{display:flex;align-items:center;gap:12px;margin:0 0 18px;font-size:11px;color:#95a2ae;min-height:25px}.library-result-count strong{font-size:12px;font-weight:600;color:#5d7286}.library-result-count b{color:#d66536;font-weight:600}.library-result-count button{font-size:10px;border:0;background:transparent;padding:3px;min-height:24px;margin-left:auto;color:#6d8499}
 .template-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
 .template-card{border:1px solid #e1e7ee;border-radius:13px;background:white;overflow:hidden;min-width:0;box-shadow:0 2px 6px #20394f04;transition:border-color .15s,box-shadow .15s,transform .15s}
 .template-card:hover{border-color:#bbcbd9;box-shadow:0 7px 20px #20394f0a;transform:translateY(-2px)}
 .template-thumbnail{height:215px;border:0;border-bottom:1px solid #e8edf2;border-radius:0;width:100%;display:flex;align-items:flex-start;justify-content:center;position:relative;overflow:hidden;background:#edf1f5;padding:18px 30px 0;cursor:zoom-in}
 .template-thumbnail:hover{background:#e8eef3}
 .template-thumbnail canvas{display:block;width:135px;height:auto;box-shadow:0 3px 12px #293e521a;background:white;opacity:0;transition:opacity .2s;flex:none}
 .template-thumbnail.is-ready canvas{opacity:1}.thumb-status{position:absolute;top:46%;left:0;right:0;text-align:center;font-size:10px;font-weight:400;color:#9aa8b4}.is-ready .thumb-status{display:none}
 .thumb-pages{position:absolute;top:12px;right:12px;background:#ffffffde;border:1px solid #e0e7ee;border-radius:5px;padding:3px 6px;font-size:9px;font-weight:400;color:#8d9ba7}.thumb-pages:empty{display:none}
 .thumb-open{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);background:#ffffffed;color:#536c82;box-shadow:0 2px 8px #20394f0b;padding:6px 12px;border-radius:6px;font-size:10px;font-weight:500;opacity:0;transition:opacity .15s;white-space:nowrap}.template-thumbnail:hover .thumb-open,.template-thumbnail:focus-visible .thumb-open{opacity:1}
 .template-card-content{padding:20px}.template-category-label{font-size:9px;letter-spacing:.03em;color:#99a7b5;display:block;margin-bottom:8px}.template-card h3{font-size:16px;letter-spacing:-.4px;margin:0 0 9px;color:#344e65;font-weight:600}.template-card p{font-size:12px;line-height:1.8;color:#8b99a6;min-height:40px;margin:0 0 19px}
 .template-card-actions{display:flex;gap:8px}.template-card-actions button{font-size:12px;min-height:39px;padding:8px 12px;flex:1;border-radius:7px}.template-preview-button{border-color:#e0e7ee;color:#7f91a1}.template-write-button{border-color:#ecd4c4;background:#fff7f1;color:#c56231;font-weight:600}.template-write-button:hover{background:#ffefe4;border-color:#e2b89a}
 .template-empty{grid-column:1/-1;padding:65px 20px;text-align:center;border:1px dashed #cedae4;border-radius:12px;background:#fafcfd;color:#8797a6}.template-empty strong{font-size:15px;color:#5e7488}.template-empty p{font-size:12px}
 .preview-kicker{display:block;font-size:10px;color:#a3b0bc;margin-bottom:7px}.template-preview-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 26px;border-bottom:1px solid #e1e7ee;background:#fafcfd;font-size:11px;color:#8a9ba9}.template-preview-toolbar>div{display:flex;align-items:center;gap:6px}.template-preview-toolbar button{font-size:16px;min-height:31px;width:31px;padding:2px}.preview-pdf-link{font-size:11px;margin-left:10px;color:#667f95;text-decoration:none}
 .template-preview-stage{padding:25px;background:#e9eef3;min-height:200px}.template-preview-stage canvas{display:block;width:100%;height:auto;background:white;box-shadow:0 4px 18px #263f5d12}.template-preview-stage .error:empty{display:none}
}
@media screen and (max-width:1200px){.template-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.shell main{padding:27px 25px}.topbar{padding-left:25px;padding-right:25px}.template-thumbnail{height:210px}}
@media screen and (max-width:1000px) and (min-width:761px){.sidebar{width:190px;padding:25px 12px}.sidebar .form-wordmark{font-size:21px}.shell{margin-left:190px}.nav{font-size:12px}.account .actor-label{display:none}.stats{gap:10px}.stat{padding:16px}.library-heading{align-items:flex-start}.template-search{width:220px}.library-source{padding:10px 13px;font-size:12px}}
@media screen and (max-width:760px){
 .sidebar{position:static;width:auto;padding:17px 15px 0}.sidebar .brand{padding:0;border:0}.sidebar .form-wordmark{font-size:24px}.sidebar nav{margin-top:16px;gap:3px}.nav{font-size:11px;border-radius:8px 8px 0 0;padding:11px 8px;margin:0;min-height:44px}.nav.active{box-shadow:inset 0 -3px var(--ui-accent)}.nav>span{font-size:15px}
 .shell{margin-left:0}.topbar{height:auto;min-height:58px;padding:8px 15px}.account{gap:4px}.account .actor-label{padding:4px 6px;font-size:9px}.account select{font-size:11px}.account .quiet{font-size:10px;padding:7px 6px}
 .shell main{padding:24px 16px 30px}.intro{margin-bottom:22px}.intro h1{font-size:23px}.intro p{font-size:12px}.intro .edition{display:none}.stats{gap:10px}.stat{padding:16px;min-height:95px}.stat strong{font-size:28px}
 .panel-head{padding:17px}.app-footer{padding:10px 16px 22px}.modal-head,.modal-body{padding:19px}.modal-head h2{font-size:17px}.form-grid{gap:17px}.modal-foot{padding:14px 17px}.toolbar{padding:12px}.callout{padding:16px}
 .library-source-tabs{flex-wrap:wrap;gap:5px;margin-bottom:24px}.library-source{flex:1;font-size:11px;padding:10px 7px;white-space:nowrap}.library-source b{font-size:9px;margin-left:4px}.library-upload{width:100%;font-size:10px;padding:6px;min-height:28px}
 .library-heading{display:block;margin-bottom:18px}.library-heading h2{font-size:20px}.library-heading p{font-size:11px}.section-kicker{font-size:8px}.template-search{display:block;width:100%;margin-top:17px}.template-search input{font-size:12px;min-height:42px}
 .template-filters{gap:6px}.category-chip{font-size:10px;padding:7px 9px;min-height:35px}.category-chip span{font-size:9px;margin-left:4px}.library-result-count{font-size:10px;gap:8px;flex-wrap:wrap}.library-result-count strong{font-size:11px}
 .template-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.template-thumbnail{height:150px;padding:13px 10px 0}.template-thumbnail canvas{width:95px}.template-card-content{padding:13px}.template-card h3{font-size:13px;line-height:1.5;min-height:39px}.template-category-label{font-size:8px;margin-bottom:6px}.template-card p{font-size:10px;min-height:72px;margin-bottom:13px;line-height:1.7}.template-card-actions{gap:5px;flex-wrap:wrap}.template-card-actions button{font-size:10px;padding:7px 6px;min-height:37px;white-space:nowrap}.thumb-pages{top:7px;right:7px;font-size:8px;padding:2px 4px}.thumb-status{font-size:9px;padding:0 10px}.thumb-open{display:none}
 .template-preview-toolbar{padding:10px 16px}.template-preview-stage{padding:12px}.preview-pdf-link{font-size:10px;margin-left:5px}
}
@media screen and (max-width:360px){.template-grid{grid-template-columns:1fr}.template-thumbnail{height:180px}.template-thumbnail canvas{width:120px}.template-card h3,.template-card p{min-height:0}.template-card-content{padding:17px}.category-chip{font-size:9px}}

/* Responsive task lists; print layouts remain unchanged. */
@media screen {
 .document-stats .stat{text-align:left;position:relative;cursor:pointer;min-height:96px;padding:16px 20px}
 .stat-label{display:block;font-size:13px;color:#576b7e;margin-bottom:10px}
 .document-stats .stat:hover{border-color:#9eb1c3;background:#f0f5fa}
 .document-stats .stat[aria-pressed=true]{border-color:#e97644;box-shadow:0 0 0 1px #e97644}
 .document-filters{padding:12px 20px 18px;margin:0;display:block;border-bottom:1px solid #e6ebf1}
 .document-filters .tabs{overflow-x:auto;white-space:nowrap;margin-bottom:14px;max-width:100%}
 .document-filters .tab{flex-shrink:0;font-size:13px}
 .tab-count{font-size:11px;margin-left:4px;color:#64788b}
 .document-search-row{display:flex;gap:12px;align-items:center}
 .document-search-row .search{width:auto;flex:1;min-width:0;font-size:14px}
 .document-search-row select{font-size:13px;flex-shrink:0}
 .document-panel .panel-head{padding:12px 20px}.document-panel .panel-head .quiet{min-height:36px}
 .document-title{line-height:1.5;overflow-wrap:anywhere}.doc-meta{color:#687b8c}
 .intro p,.toolbar-note{color:#607285}.badge{font-size:12px}
 .empty strong{font-size:16px;color:#3a5067}.empty p{margin:8px 0 16px}
 @media(max-width:760px){
  .shell main{padding:20px 16px}.intro{margin-bottom:16px}.intro h1{font-size:24px}
  .stats{gap:8px;margin-bottom:16px}.stat,.document-stats .stat{padding:12px 14px;min-height:78px}
  .stat strong{font-size:26px}.stat label,.stat-label{font-size:12px;margin-bottom:6px}
  .toolbar{gap:10px;flex-wrap:wrap;margin-bottom:16px}.toolbar-note{display:none}
  .document-filters{padding:8px 12px 12px}.document-search-row{gap:8px}
  .document-search-row input,.document-search-row select{font-size:16px}
  .document-search-row select{max-width:138px;padding-left:8px;padding-right:8px}
  .document-list{overflow:visible}.documents-table{min-width:0;width:100%}
  .documents-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .documents-table tbody{display:block;padding:0 12px}
  .documents-table tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px 12px;padding:16px 0;border-bottom:1px solid #e3e9ef}
  .documents-table td{display:block;padding:0!important;border:0!important;font-size:13px;min-width:0}
  .documents-table .document-name{grid-column:1/-1}.documents-table .document-title{font-size:15px;text-align:left;white-space:normal}
  .documents-table .doc-symbol{display:none}.documents-table .doc-meta{margin:5px 0 0;font-size:12px}
  .documents-table td[data-label]:before{content:attr(data-label);color:#6b7c8d;margin-right:8px;font-size:12px}
  .documents-table .document-status{grid-column:1/-1}.documents-table .document-open{grid-column:1/-1}
  .documents-table .row-button{width:100%;min-height:42px;font-size:14px;background:#f2f6fa}
  .documents-table .empty{grid-column:1/-1;padding:20px 0!important}
  .callout{padding:14px;font-size:12px}.modal-body input,.modal-body textarea,.modal-body select{font-size:16px}
  .modal-foot{position:sticky;bottom:0;z-index:2;flex-wrap:wrap}.modal-foot button{min-height:44px}
 }
 @media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;scroll-behavior:auto!important}}
}
