:root{--blue:#0872be;--blue-deep:#075a99;--light-blue:#edf6fd;--teal:#05af9c;--ink:#1e3244;--muted:#64798d;--line:#dce6ee;--line2:#edf1f5;--bg:#f4f7fa;--danger:#b83c45;--dangerbg:#fff0f1;--green:#24735c;--greenbg:#eaf8f1;font-family:-apple-system,BlinkMacSystemFont,"Yu Gothic UI","Hiragino Kaku Gothic ProN",Meiryo,"Segoe UI",sans-serif;color:var(--ink);background:var(--bg);font-size:14px}
*{box-sizing:border-box}body{margin:0;min-width:320px}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid #52b4ef;outline-offset:2px}a{color:var(--blue)}.btn{border:1px solid var(--line);border-radius:8px;background:white;color:var(--ink);font-size:13px;font-weight:650;min-height:38px;padding:8px 13px;display:inline-flex;align-items:center;gap:7px;justify-content:center;text-decoration:none;white-space:nowrap}.btn:hover{background:#f0f6fa}.btn.primary{background:var(--blue);border-color:var(--blue);color:white}.btn.primary:hover{background:var(--blue-deep)}.btn.danger{border-color:#d89ca0;color:var(--danger)}.btn.fill-danger{background:var(--danger);color:white;border-color:var(--danger)}.btn.small{min-height:33px;padding:5px 9px;font-size:12px}.btn.ghost{border-color:transparent;background:transparent;color:var(--blue-deep)}.btn.icon{padding:7px}.actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.sub{color:var(--muted)}.small{font-size:12px}.tiny{font-size:11px}.brand{display:flex;align-items:center;gap:10px}.brand img{width:42px;height:42px}.brand-name{font-size:22px;letter-spacing:.025em;font-weight:800;color:#26343c;line-height:1}.brand-desc{color:#788899;font-size:10px;margin-top:5px}.layout{height:100dvh;display:grid;grid-template-columns:232px minmax(0,1fr)}.sidebar{background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0}.sidebar-head{padding:18px 20px;border-bottom:1px solid var(--line2)}.nav{padding:18px 10px}.nav-label{color:#95a3ae;font-size:11px;font-weight:700;margin:5px 13px 10px}.nav button{width:100%;display:flex;align-items:center;gap:12px;border:0;background:transparent;border-radius:8px;padding:12px 13px;text-align:left;color:#506477;font-weight:700;margin:2px 0}.nav button:hover{background:#f2f6fa}.nav button.current{background:var(--light-blue);color:var(--blue-deep)}.nav .count{margin-left:auto;background:#ecf1f6;border-radius:5px;padding:2px 6px;font-weight:600;font-size:11px}.sidebar-bottom{margin-top:auto;padding:15px;border-top:1px solid var(--line2);display:grid;gap:10px}.sidebar-bottom .user{font-weight:700;font-size:13px}.main{min-width:0;display:flex;flex-direction:column}.topbar{background:#fff;height:68px;min-height:68px;border-bottom:1px solid var(--line);padding:0 30px;display:flex;align-items:center;justify-content:space-between;gap:12px}.topbar .mobile-toggle{display:none}.topbar-right{display:flex;align-items:center;gap:11px}.content{padding:30px 32px 50px;overflow:auto;min-height:0;flex:1}.head{display:flex;align-items:start;justify-content:space-between;gap:16px;margin-bottom:22px}.head h1{margin:0 0 5px;font-size:24px;font-weight:800}.head p{margin:0;color:var(--muted);font-size:13px}.panel{background:white;border:1px solid var(--line);border-radius:10px;overflow:hidden}.panel-pad{padding:18px}.toolbar{padding:13px 16px;border-bottom:1px solid var(--line2);display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.search{width:min(350px,100%);height:38px;border:1px solid var(--line);border-radius:7px;padding:0 12px;background:white}.table-wrap{overflow-x:auto}.mobile-files{display:none}.file-card{border:1px solid var(--line);background:white;border-radius:8px;padding:13px;display:grid;gap:11px}.file-card .actions .btn{flex:1}.table{border-collapse:collapse;width:100%;min-width:680px}.table th{background:#fafcfe;color:#738596;border-bottom:1px solid var(--line);font-size:12px;text-align:left;font-weight:650}.table td,.table th{padding:13px 15px}.table td{border-bottom:1px solid var(--line2);vertical-align:middle}.table tr:last-child td{border-bottom:0}.name-cell{display:flex;align-items:center;gap:11px;min-width:180px}.file-icon{width:38px;height:43px;border-radius:8px;background:#eaf5fd;color:var(--blue);border:1px solid #d9e7f1;display:grid;place-items:center;font-weight:800;font-size:12px;flex:none}.name-cell strong{display:block;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.name-cell span{display:block;color:var(--muted);font-size:11px;margin-top:5px}.table-footer{padding:12px 16px;border-top:1px solid var(--line2);color:var(--muted);font-size:12px}.badge{background:#eef4f8;color:#627688;padding:4px 8px;border-radius:5px;font-size:11px;font-weight:700;white-space:nowrap}.badge.green{background:var(--greenbg);color:var(--green)}.badge.blue{background:var(--light-blue);color:var(--blue-deep)}.badge.red{background:var(--dangerbg);color:var(--danger)}.notice{border:1px solid #d8e8f4;background:#f4fafd;border-radius:9px;padding:13px 15px;color:#58758d;font-size:13px;line-height:1.65;margin-bottom:17px}.warn{border-color:#f0d1a4;background:#fff8eb;color:#855b22}.empty{padding:58px 20px;text-align:center;color:var(--muted)}.empty strong{display:block;color:var(--ink);font-size:16px;margin-bottom:6px}.history-row{padding:18px;display:grid;grid-template-columns:32px minmax(0,1fr) auto;gap:12px;align-items:start;border-bottom:1px solid var(--line2)}.history-row:last-child{border:0}.timeline{border:2px solid #d1e1ec;color:var(--blue);width:25px;height:25px;border-radius:50%;display:grid;place-items:center;font-weight:700;font-size:11px}.history-row:first-child .timeline{border-color:var(--teal)}.history-row h3{margin:2px 0 6px;font-size:14px}.history-row p{margin:0;color:var(--muted);font-size:12px;line-height:1.5}.history-row .actions{justify-content:flex-end}.countdown{font-weight:750;font-variant-numeric:tabular-nums;color:#345e83}.countdown.urgent{color:var(--danger)}.auth-bg{min-height:100dvh;display:grid;place-items:center;padding:24px;background:linear-gradient(140deg,#edf6fd,#f7fafc 50%,#eaf8f5)}.auth-card{width:min(445px,100%);background:white;border:1px solid #dbe6ef;border-radius:15px;box-shadow:0 18px 50px #26456017;padding:28px}.auth-card .brand{margin-bottom:30px}.auth-card h1{font-size:22px;margin:0 0 7px}.auth-card p{color:var(--muted);font-size:13px;line-height:1.65;margin:0 0 18px}.tabs{display:flex;background:#edf3f7;padding:4px;border-radius:8px;gap:3px;margin:18px 0}.tabs button{flex:1;border:0;background:transparent;border-radius:6px;padding:10px;font-weight:700;color:#647688}.tabs button.active{background:white;color:var(--blue-deep);box-shadow:0 1px 4px #d3dce8}.field{display:grid;gap:7px;margin-bottom:15px}.field label{font-weight:700;font-size:12px;color:#415668}.field input,.field select,.field textarea{min-height:40px;width:100%;border:1px solid #ccdbe6;border-radius:7px;padding:9px 11px;background:white;color:var(--ink)}.field textarea{min-height:92px;resize:vertical}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.form-hint{color:var(--muted);font-size:12px;line-height:1.6}.toast{position:fixed;right:18px;bottom:20px;z-index:100;background:#193448;color:white;border-radius:8px;padding:14px 17px;box-shadow:0 12px 35px #0002;max-width:min(480px,90vw)}.toast.error{background:#9d2e3a}.modal-backdrop{position:fixed;inset:0;z-index:80;background:#13283c8c;display:grid;place-items:center;padding:18px}.modal-backdrop[hidden]{display:none}.modal{width:min(550px,100%);background:white;border-radius:12px;box-shadow:0 16px 55px #12233745;max-height:90dvh;display:flex;flex-direction:column;overflow:hidden}.modal.wide{width:min(860px,100%)}.modal-header,.modal-footer{padding:16px 20px;display:flex;align-items:center;justify-content:space-between;gap:12px}.modal-header{border-bottom:1px solid var(--line2)}.modal-header h2{margin:0;font-size:17px}.modal-body{padding:20px;overflow:auto;line-height:1.65}.modal-footer{border-top:1px solid var(--line2);justify-content:flex-end}.editor-layout{flex:1;display:grid;grid-template-columns:minmax(0,1fr) 290px;min-height:0}.editor-toolbar{background:#fff;display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 15px;border-bottom:1px solid var(--line)}.editor-stage{background:#dfe6ed;min-width:0;min-height:0;overflow:auto;display:flex;align-items:flex-start;justify-content:center;padding:25px}.pdf-page{position:relative;background:white;box-shadow:0 12px 35px #233f5550;flex-shrink:0}.pdf-page>img{display:block;width:100%;height:auto;user-select:none}.span{position:absolute;padding:0;margin:0;border:0;color:transparent;background:transparent;cursor:text;overflow:hidden;white-space:nowrap}.span:hover{background:#158aca16}.span.selected{background:#168ac124;outline:none}.span.selected:hover{background:#168ac133}.span:focus-visible{outline:2px solid #0872be;outline-offset:1px}.editor-side{min-width:0;border-left:1px solid var(--line);background:white;padding:20px;overflow-y:auto}.editor-side h3{margin:0 0 17px;font-size:15px}.editor-side .btn{width:100%}.editor-footer{padding:10px 15px;background:#fff;border-top:1px solid var(--line);color:var(--muted);font-size:12px}.editor-main{display:flex;flex-direction:column;min-height:0;min-width:0}.back-link{color:var(--blue);font-weight:700;text-decoration:none}.side-overlay{display:none}.visually-hidden{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:980px){.layout{grid-template-columns:205px minmax(0,1fr)}.content{padding:22px}.topbar{padding:0 22px}.editor-layout{grid-template-columns:minmax(0,1fr) 240px}.table td,.table th{padding:12px}}
@media(max-width:720px){.desktop-files{display:none}.mobile-files{display:grid;gap:10px;padding:12px}.layout{grid-template-columns:minmax(0,1fr)}.sidebar{position:fixed;z-index:60;inset:0 auto 0 0;width:260px;transform:translateX(-100%);transition:transform .2s}.sidebar.open{transform:translateX(0)}.side-overlay.open{display:block;position:fixed;inset:0;background:#20374b80;z-index:50}.topbar{height:58px;min-height:58px;padding:0 14px}.topbar .mobile-toggle{display:inline-flex}.topbar .brand img{width:30px;height:30px}.topbar .brand-name{font-size:17px}.content{padding:16px 14px 32px}.head h1{font-size:21px}.head{flex-wrap:wrap;gap:12px}.history-row{grid-template-columns:30px 1fr}.history-row .actions{grid-column:2;justify-content:flex-start}.editor-layout{display:flex;flex-direction:column}.editor-stage{min-height:320px;flex:1;padding:13px}.editor-side{border-left:0;border-top:1px solid var(--line);max-height:37dvh;min-height:190px}.editor-toolbar{gap:5px;padding:9px}.form-row{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* v0.0.1 passkey-first sign-in. Enrollment is secondary and separate. */
.auth-bg{background:#f4f7fa;min-height:100dvh;padding:20px}
.auth-card{width:min(420px,100%);padding:32px;border-radius:12px;box-shadow:0 12px 36px #1d34450b}
.auth-card .brand{margin-bottom:26px;justify-content:center}
.auth-content h1{font-size:21px;font-weight:750;margin-bottom:10px}
.auth-card .auth-content p{font-size:13px;line-height:1.7;margin-bottom:22px}
.btn.auth-primary{width:100%;min-height:48px;font-size:15px;font-weight:700;white-space:normal}
.btn.auth-secondary{width:100%;min-height:44px;font-weight:650;white-space:normal}
.auth-separator{border-top:1px solid var(--line);margin:25px 0 16px;padding-top:18px;color:var(--muted);font-size:12px;text-align:center}
.auth-footer,.auth-legacy{text-align:center;margin-top:14px}
.auth-footer .btn,.auth-legacy .btn{white-space:normal;min-height:42px;line-height:1.5}
.auth-card .auth-note{font-size:12px;color:var(--muted);margin-top:14px}
.auth-card .auth-help{font-size:12px;color:var(--muted);line-height:1.6;margin:25px 0 0;text-align:center}
@media(max-width:480px){.auth-bg{padding:16px}.auth-card{padding:23px 19px}.auth-card .brand{margin-bottom:23px}}

/* v0.0.2 PDF editor: multi-line text block, selected search results and preview. */
.editor-wrapper{height:100%;display:flex;flex-direction:column;min-height:0}
.editor-fill{flex:1}.editor-filename{font-size:13px;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.editor-modes{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:17px}
.editor-modes .btn{flex:1;min-width:96px;white-space:normal;line-height:1.4;min-height:42px}
.editor-fields{display:grid;gap:7px}.editor-side{padding:16px;min-width:280px}
.editor-side .field textarea{min-height:86px;line-height:1.5}
.editor-side .form-row{gap:10px}
.editor-primary-actions{display:grid;gap:9px;margin-top:16px}
.editor-primary-actions .btn{min-height:42px;white-space:normal}
.pdf-page.add-cursor:not(.is-preview){cursor:crosshair}
.pdf-page.add-cursor .span{cursor:crosshair}
.pdf-page.is-exact-preview #span-layer{display:none}
.pdf-page #draft-layer{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:1}
.pdf-page #draft-layer[hidden]{display:none}
.pdf-page #span-layer{position:absolute;inset:0;z-index:2}
.pdf-page.is-exact-preview #draft-layer{display:none}
.pdf-search-results{display:grid;gap:12px;max-height:220px;overflow:auto;border:1px solid var(--line);background:#fbfcfe;border-radius:7px;padding:10px;margin-bottom:13px}
.pdf-search-results .search-summary{font-weight:700;font-size:12px}
.search-page-group{border-top:1px solid var(--line2);padding-top:7px;display:grid;gap:6px}
.search-page-all,.search-result{display:flex;gap:8px;align-items:flex-start;line-height:1.4;font-size:12px;cursor:pointer}
.search-page-all{font-weight:700}
.search-result span{overflow-wrap:anywhere;color:var(--muted)}
.search-page-all input,.search-result input{width:16px;height:16px;flex:none;accent-color:var(--blue)}
.preview-warnings{font-size:12px;line-height:1.6;color:#855b22}
.preview-warnings p{margin:5px 0}
.editor-footer{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.editor-footer .btn{min-height:32px}
@media(min-width:980px){.editor-layout{grid-template-columns:minmax(0,1fr) 345px}}
@media(max-width:720px){.editor-side{min-width:0;max-height:48dvh}.editor-modes .btn{min-width:0}.editor-filename{max-width:130px}}

/* v0.0.6: temporary text field anchored to an existing blank on the PDF. */
.pdf-page #add-box{position:absolute;z-index:4;border:1px dashed #0872be;box-shadow:0 0 0 2px #fff9;min-height:0;background:transparent;display:flex;align-items:stretch}
.pdf-page #add-box[hidden],.pdf-page.is-exact-preview #add-box{display:none}
.add-box #add-box-input{display:block;width:100%;min-height:0;padding:0;margin:0;border:0;resize:none;outline:0;background:transparent;color:#111;font-family:'Noto Sans CJK JP','Yu Gothic',sans-serif;line-height:1.22;white-space:pre-wrap;overflow-wrap:anywhere;overflow:auto}
.add-box #add-box-input::placeholder{color:#537a91;opacity:.75}
.add-box .add-box-move{position:absolute;bottom:100%;left:-1px;min-width:44px;height:22px;background:#0872be;color:#fff;font-size:11px;line-height:22px;text-align:center;cursor:grab;touch-action:none;user-select:none}
.add-box .add-box-move:active{cursor:grabbing}
.add-box .add-box-resize{position:absolute;right:-7px;bottom:-7px;width:16px;height:16px;background:#0872be;border:2px solid white;border-radius:3px;cursor:ew-resize;touch-action:none}
.add-box #add-box-input:focus-visible{outline:2px solid #52b4ef;outline-offset:2px}
.add-box-move:focus-visible,.add-box-resize:focus-visible{outline:2px solid #52b4ef;outline-offset:2px}
.add-bold-setting{display:flex;align-items:center;gap:9px;font-weight:650;font-size:13px;margin:1px 0 12px;min-height:36px}
.add-bold-setting input{accent-color:#0872be;width:18px;height:18px}
/* v0.0.7: PDF-first floating tools. No permanent width reservation. */
.editor-layout{display:flex;min-height:0;position:relative}
.editor-main{flex:1;min-width:0}
.editor-side{position:fixed;z-index:30;width:min(325px,calc(100vw - 24px));max-height:min(78dvh,750px);overflow:hidden;display:flex;flex-direction:column;padding:0;min-width:0;border:1px solid #b9cbd9;border-radius:10px;box-shadow:0 8px 30px #162c3a40;background:white}
.editor-window-title{height:42px;flex:none;background:#edf4f8;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;padding:5px 9px;cursor:move;touch-action:none;user-select:none}
.editor-window-title .btn{width:auto}
.editor-window-body{overflow:auto;padding:12px 14px}
.editor-side.collapsed{height:42px;min-height:42px}
.editor-side.collapsed .editor-window-body{display:none}
.editor-side .field textarea{min-height:64px}
.editor-modes{gap:4px;margin-bottom:10px}
.editor-modes .btn{min-width:45%;min-height:35px}
.pdf-page .stamp-overlay{position:absolute;z-index:5;pointer-events:none;display:grid;place-items:center;font-family:'Noto Sans CJK JP',sans-serif;line-height:1;white-space:nowrap}
.pdf-page .stamp-overlay[hidden]{display:none}
.editor-content{min-width:0}
@media(max-width:720px){.editor-layout{display:flex;flex-direction:row}.editor-side{max-height:65dvh;min-width:0;width:min(300px,calc(100vw - 16px))}.editor-stage{min-height:calc(100dvh - 225px)}.editor-modes .btn{min-width:45%}}

/* v0.0.8: compact, resizable editing window and stamp controls */
.editor-side{resize:both;width:360px;height:min(65dvh,610px);min-width:260px;min-height:120px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}
.editor-side.collapsed{resize:none}.editor-window-body{min-height:0;padding:9px 11px;overflow:auto}.editor-side .field{margin-bottom:8px;gap:4px}.editor-side .form-hint{margin:4px 0 8px}.editor-side .form-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.stamp-choices,.stamp-palette{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.stamp-choice{position:relative;cursor:pointer}.stamp-choice input{position:absolute;opacity:0;width:1px;height:1px}.stamp-choice span{display:flex;align-items:center;justify-content:center;gap:5px;min-height:33px;padding:4px;border:1px solid #b9cbd9;border-radius:6px;font-size:12px;font-weight:600;background:#fff}.stamp-choice input:checked+span{border:2px solid #1871a8;background:#e6f3fb}.stamp-choice input:focus-visible+span{outline:2px solid #1871a8;outline-offset:2px}.stamp-choice i{width:14px;height:14px;border:1px solid #b9cbd9;border-radius:3px;flex:none}.stamp-palette{grid-template-columns:repeat(3,minmax(0,1fr))}.stamp-actions{display:flex;align-items:center;flex-wrap:wrap;gap:6px}.stamp-actions .btn{width:auto}.stamp-actions span{font-size:12px;color:#647688}.stamp-overlay{pointer-events:auto!important;cursor:move;touch-action:none;outline:1px dashed #1871a8;outline-offset:3px}.stamp-fixed{position:absolute;z-index:4;pointer-events:none;display:grid;place-items:center;line-height:1;font-family:'Noto Sans CJK JP',sans-serif}.stamp-list{position:absolute;inset:0;pointer-events:none}.editor-side input[type=range]{width:100%;accent-color:#1871a8}.editor-side input[hidden]{display:none}
@media(max-width:720px){.editor-side{width:min(340px,calc(100vw - 16px));height:min(60dvh,500px);max-height:calc(100dvh - 16px)}.editor-side .form-row{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* v0.0.9: document pan, wheel zoom and draggable editing objects */
.editor-stage{overscroll-behavior:contain;cursor:grab}
.editor-stage:active{cursor:grabbing}
.pdf-page .stamp-overlay{cursor:grab}
.pdf-page .stamp-overlay:active{cursor:grabbing}

/* v0.0.10: no global top strip; primary PDF actions remain in the editor toolbar. */
.sidebar-version{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.mobile-page-menu{display:none}
.editor-toolbar{position:relative;flex-wrap:wrap;gap:7px}
.editor-toolbar-actions{display:flex;align-items:center;gap:7px;margin-left:8px;flex-shrink:0}
.editor-toolbar-actions .btn{white-space:nowrap}
.editor-toolbar-actions .btn:disabled{opacity:.5;cursor:not-allowed}
@media(max-width:1050px){.editor-toolbar-actions{margin-left:auto}}
@media(max-width:720px){
  .mobile-page-menu{display:flex;margin-bottom:10px}
  .mobile-toggle{display:inline-flex!important;align-items:center;justify-content:center}
  .editor-toolbar{gap:5px;padding:7px}
  .editor-toolbar-actions{width:100%;margin-left:0;justify-content:flex-end;gap:6px}
  .editor-toolbar-actions .btn{flex:1;min-width:0}
}
@media(min-width:721px){.mobile-toggle{display:none!important}}
/* Keep the two critical actions above floating tools on narrow viewports. */
@media(max-width:720px){.editor-toolbar-actions{order:-1}}

/* v0.0.11: keep the replacement field prominent without adding tool height. */
.replacement-field-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.replacement-field-head label{min-width:0}
.replacement-field-head .btn{flex-shrink:0}
.editor-side .replacement-field #new-text{min-height:156px;resize:vertical;line-height:1.5}

/* v0.0.12: replacement field row and narrower document navigation. */
@media(min-width:721px){
  .layout{grid-template-columns:184px minmax(0,1fr)}
  .sidebar-head{padding:14px 12px}
  .sidebar-head .brand{gap:7px}
  .sidebar-head .brand img{width:34px;height:34px}
  .sidebar-head .brand-name{font-size:17px}
  .nav{padding:12px 6px}
  .nav-label{margin:5px 8px 7px}
  .nav button{gap:8px;padding:10px 8px;min-width:0}
  .sidebar-bottom{padding:11px 9px;overflow-wrap:anywhere}
}
.editor-side .replacement-field-head{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:8px;min-width:0;width:100%}
.editor-side .replacement-field-head label{display:block;flex:1 1 auto;min-width:0;white-space:nowrap;overflow-wrap:normal;word-break:keep-all}
.editor-side .replacement-field-head .btn{width:auto;max-width:45%;flex:0 0 auto;margin:0;padding:5px 10px;white-space:nowrap}
.editor-side .replacement-field #new-text{display:block;width:100%;min-width:0;box-sizing:border-box}

/* Editable stamp controls: near the selected stamp, without changing PDF content. */
.stamp-list{pointer-events:none}.stamp-fixed{pointer-events:auto;border:0;padding:0;background:transparent;cursor:pointer}.stamp-fixed:focus-visible{outline:2px solid #1871a8;outline-offset:3px}.stamp-geometry{display:block;width:100%;height:100%;border:2px solid currentColor;box-sizing:border-box}.stamp-geometry.ellipse{border-radius:50%}.stamp-context{position:absolute;z-index:10;display:flex;gap:4px;white-space:nowrap;padding:3px;border:1px solid #a5b7c6;border-radius:7px;background:#fff;box-shadow:0 2px 8px #0002}.stamp-context[hidden]{display:none}.stamp-context .btn{width:auto;min-height:29px}.stamp-overlay .stamp-geometry{pointer-events:none}

/* Confirmed edit list: compact, navigable, and keyboard accessible. */
.confirmed-edit-list{display:grid;gap:5px;margin-top:8px;max-height:180px;overflow:auto}
.confirmed-edit-row{display:flex;align-items:center;gap:6px;min-width:0}
.confirmed-edit-row .btn:first-child{flex:1;min-width:0;text-align:left;white-space:normal;overflow-wrap:anywhere}
.confirmed-edit-row .btn:last-child{flex:0 0 auto;width:auto}

.stamp-fixed.stamp-multi-selected{outline:2px solid #1565c0;outline-offset:2px}
/* Explicit text-edit confirmation, independent of PDF preview. */
.text-confirm-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.text-confirm-actions .btn{min-height:36px}

/* Confirmed added text: directly visible and selectable on the PDF page. */
.confirmed-text-layer{position:absolute;inset:0;z-index:5;pointer-events:none}
.confirmed-text{position:absolute;display:block;pointer-events:auto;box-sizing:border-box;min-height:1.22em;margin:0;padding:0;border:1px solid transparent;border-radius:0;background:transparent;text-align:left;line-height:1.22;white-space:pre-wrap;overflow-wrap:anywhere;cursor:text;appearance:none}
.confirmed-text:hover,.confirmed-text:focus-visible{border-color:#0872be;outline:1px dashed #0872be;outline-offset:1px}
.pdf-page.is-exact-preview .confirmed-text-layer{display:none}

/* UI Hotfix 2: compact editing controls, reliable collapse and single placement outline. */
.editor-side{gap:0}.editor-window-title{height:36px;min-height:36px;padding:3px 8px}.editor-window-title .btn{min-height:28px;padding:2px 8px}.editor-side.collapsed{height:36px!important;min-height:36px!important;max-height:36px!important;overflow:hidden;resize:none}.editor-side.collapsed .editor-window-body{display:none!important}.editor-window-body{padding:6px 9px;overflow:auto}.editor-side .field{margin-bottom:5px;gap:3px}.editor-side .field label,.editor-side .field-label{font-size:12px}.editor-side .form-hint{margin:2px 0 4px;line-height:1.35}.editor-modes{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:6px}.editor-modes .btn{width:auto!important;min-width:0!important;flex:1 1 auto;min-height:29px;padding:4px 7px}.editor-side .btn{width:auto}.editor-side .field input:not([type=radio]):not([type=checkbox]):not([type=color]):not([type=range]),.editor-side .field select{min-height:31px;padding:4px 6px}.editor-side .field textarea{min-height:56px;padding:5px 7px}.editor-side .form-row{gap:6px}.editor-side input[type=number]{width:8ch;max-width:100%;font-variant-numeric:tabular-nums}.editor-side .compact-number{display:flex;align-items:center;gap:7px}.editor-side .compact-number input{width:8ch!important}.editor-side .compact-choice{display:flex;align-items:center;gap:9px}.editor-side .compact-choice>.field-label{flex:none;min-width:32px}.text-font-options{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.text-font-options label{display:inline-flex;align-items:center;gap:3px;white-space:nowrap}.text-font-options input{accent-color:#0872be}.text-color-options{display:flex;align-items:center;flex-wrap:wrap;gap:5px}.text-color-option{display:inline-flex;position:relative;cursor:pointer}.text-color-option input{position:absolute;opacity:0;width:1px;height:1px}.text-color-option span{width:19px;height:19px;border-radius:50%;background:var(--swatch);border:1px solid #b5c3cf;display:grid;place-items:center}.text-color-option input:checked+span{outline:2px solid #0872be;outline-offset:2px}.text-color-option input:focus-visible+span{outline:2px solid #0872be;outline-offset:3px}.text-color-option .custom-swatch{background:conic-gradient(#283593 0 25%,#e53935 0 50%,#fbc02d 0 75%,#2e7d32 0);color:white;font-size:13px}.text-color-options input[type=color]{width:29px;height:25px;padding:0;border:0;background:transparent}.text-color-options input[type=color][hidden]{display:none}.text-confirm-actions{display:flex;flex-wrap:wrap;gap:5px;justify-content:flex-end}.text-confirm-actions .btn{flex:0 1 auto}.editor-side .stamp-actions{gap:4px}.editor-side .stamp-actions .btn{min-height:28px;padding:3px 7px}.editor-side .replacement-field{margin-bottom:6px}.editor-side .add-bold-setting{display:inline-flex;align-items:center;gap:4px;margin:2px 0 5px}.editor-side .staged-edits{margin-top:7px}
.pdf-page #add-box{border:1px solid #0872be;box-shadow:none;outline:none}.add-box #add-box-input:focus-visible{outline:none;box-shadow:none}.add-box-toolbar{position:absolute;bottom:100%;left:-1px;display:flex;align-items:stretch;height:23px;gap:1px;white-space:nowrap}.add-box .add-box-move{position:static;min-width:43px;height:23px;line-height:23px}.add-box-cancel{height:23px;padding:0 7px;border:0;background:#e9f1f7;color:#174e76;font-size:11px;font-weight:650;cursor:pointer}.add-box-cancel:focus-visible{outline:2px solid #0872be;outline-offset:2px}
.editor-side .field input[type=number]{width:8ch!important;max-width:100%}.editor-side .form-row .field input[type=number]{width:9ch!important}.editor-side .field input[type=radio],.editor-side .field input[type=checkbox]{width:auto;min-height:0;padding:0}.editor-side .field input[type=color]{width:29px;min-height:25px;padding:0}

/* Momentary original comparison: suppress all editing overlays without altering state. */
.pdf-page.holding-original #draft-layer,
.pdf-page.holding-original #span-layer,
.pdf-page.holding-original #add-box,
.pdf-page.holding-original #confirmed-text-layer,
.pdf-page.holding-original #stamp-list,
.pdf-page.holding-original #stamp-overlay,
.pdf-page.holding-original #stamp-context{display:none!important}
#hold-original[aria-pressed="true"]{background:#e0effa;border-color:#0872be;color:#075c99}
