/* Company workspace: restrained typography, compact controls and clear boundaries. */
:root{--blue:#3159e7;--blue-dark:#2448c7;--ink:#23272f;--muted:#69717e;--line:#e3e6ec;--bg:#f6f7f9;--radius:10px;--shadow:0 2px 8px #18203204;font-family:"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
.brand{gap:6px;font-size:20px;letter-spacing:0}.brand-logo{width:68px;height:68px;object-fit:contain;flex-shrink:0}.brand small{letter-spacing:1px;font-size:10px;color:#747c88;font-weight:400}.brand.light{color:var(--ink)}.brand.light small{color:var(--muted)}
.sidebar{width:224px;padding:18px 18px 20px}.sidebar .brand{padding:0}.workspace{margin:22px 0 25px;border-radius:7px;background:#f8f9fb}.sidebar-help{background:#fafbfc;border-color:var(--line);border-radius:7px}.sidebar-help p{color:var(--muted);font-size:11px}.mini-lock{display:none}.sidebar-help strong{font-size:12px}.nav-item{font-size:13px;border-radius:6px}.nav-item.active{background:#edf1ff}.main-shell{margin-left:224px}.topbar{height:64px;padding:0 32px;font-size:12px}.topbar-right{gap:22px}.text-button{font-size:13px;color:#606976}.dashboard{padding:30px 32px 0}.page-heading{margin-bottom:24px}.page-heading h1{font-size:26px;margin:0 0 8px;letter-spacing:0}.page-heading p{color:var(--muted);font-size:13px}
.button{border-radius:6px;min-height:40px;padding:10px 16px;font-weight:500}.button:hover{transform:none}.primary{box-shadow:none}.secondary{border-color:#d9dde5;color:#424c5c}input,select{border-radius:6px;padding:11px 12px;border-color:#d9dde5}.helper{color:#687382}.stats-grid{gap:14px;margin-bottom:24px}.stat-card{border-radius:8px;padding:18px 20px;box-shadow:none;border:1px solid var(--line)}.stat-card.active{border-color:var(--blue);background:#fcfdff}.stat-top{color:#616977;font-size:13px}.stat-icon{background:none!important;border-radius:0!important;font-size:20px}.stat-bottom strong{font-size:30px;font-variant-numeric:tabular-nums}.stat-bottom span{font-size:11px}.contract-panel{border-radius:8px;box-shadow:none;border:1px solid var(--line)}.panel-heading{padding:22px 24px}.panel-heading p{color:var(--muted)}.panel-heading h2{font-size:17px}.filter-bar{padding:0 24px}.tabs{gap:24px}.tab{font-size:13px}.search-box{border-radius:6px;background:white;border:1px solid var(--line)}table th{background:#fafbfc;font-size:12px;color:#6e7684}table td{font-size:13px;padding-top:18px;padding-bottom:18px}.contract-name{font-weight:500}.contract-name small{font-size:10px;color:#8a929e;letter-spacing:.3px}.file-icon{border-radius:5px;background:#f1f4fa;color:#657b9f}.row-action{font-size:12px}.panel-footer{background:#fafbfc;color:#737c89}.count-pill{background:#f0f2f5;color:#6d7580;border-radius:4px}.page-footer{color:#7c8490;font-size:11px}.badge{border-radius:4px;font-weight:400}.modal{border-radius:10px;box-shadow:0 20px 80px #15213630;padding:26px}.modal::backdrop{background:#17203055;backdrop-filter:blur(2px)}.modal-head h2{font-size:20px}.steps{border-radius:6px}.party-form-card{border-radius:7px;box-shadow:none}.party-form-card.own{background:#f8faff}.party-form-head{border-bottom:1px solid var(--line);padding-bottom:10px}.party-detail{border-radius:6px}.hash-card{border-radius:6px;background:#f7f8fa}.hash-card code{word-break:break-all}.form-error{color:#b32c3e}.signature-security{border-radius:6px}.signature-security p{color:#6b7584}.signed-success{border-radius:8px;box-shadow:none}.sign-card{border-radius:8px;box-shadow:none}.sign-card-icon{display:none}.sign-card h2{font-size:19px}.sign-intro h1{font-size:27px;letter-spacing:0}.sign-intro{padding-top:22px}.sign-header{min-height:80px;padding-top:4px;padding-bottom:4px}.sign-company{font-size:12px}.sign-info strong{overflow-wrap:anywhere}.sign-document,.pdf-area{border-radius:8px}.pdf-toolbar{font-size:12px}.pdf-scroll{background:#e9ecf1}.pdf-page-caption{color:#646f80;font-size:12px}.continuous-stage{box-shadow:0 2px 8px #18203214}.editor-header{height:80px}.editor-settings{background:white}.editor-settings h2{font-size:19px}.editor-settings .eyebrow{display:none}.region-item{border-radius:5px}.region-box{border-radius:2px}.save-state{font-size:12px}.signer-card{border-radius:6px}.eyebrow{letter-spacing:.5px;font-size:12px}.auth-story{background:#eef1f7;color:var(--ink)}.auth-story:before,.auth-story:after{display:none}.auth-story .eyebrow{color:#687589}.auth-story h1{font-size:44px;letter-spacing:0;line-height:1.5}.auth-story p,.auth-company,.story-lines span{color:#657082}.story-lines b{color:#3d4757;font-weight:400}.auth-form h2{font-size:26px}.auth-form-wrap{background:white}#local-seal-preview{width:120px;height:120px;object-fit:contain;padding:8px;border:1px solid var(--line);background:#fafbfc;border-radius:6px}.signature-modal{max-height:90dvh}.empty-state{padding:50px 20px}.empty-state h3{font-weight:500}.empty-icon{background:#f4f6fa;color:#7b89a2}.toast,#toast{border-radius:6px}
@media(max-width:1100px){.dashboard{padding:24px 22px 0}.topbar{padding:0 22px}.stats-grid{gap:10px}.stat-card{padding:16px}.sign-header .brand-logo,.editor-header .brand-logo{width:56px;height:56px}}
@media(max-width:800px){.sidebar{width:auto;padding:10px 16px}.main-shell{margin-left:0}.sidebar .brand-logo{width:56px;height:56px}.sidebar .brand{font-size:19px}.sidebar nav{gap:4px}.nav-item{padding:10px 12px}.topbar{padding:0 16px}.dashboard{padding:22px 16px 0}.page-heading h1{font-size:24px}.page-heading p{font-size:12px}.panel-heading{padding:18px 16px}.filter-bar{padding:0 16px}.stats-grid{gap:10px}.sign-header{padding:4px 16px}.sign-main{padding:0 14px}.sign-intro h1{font-size:23px}.modal{padding:22px 18px}.auth-story h1{font-size:34px}.brand-logo{width:56px;height:56px}.auth-story{padding:24px}.sign-layout{gap:16px}.editor-header{height:auto;min-height:70px}.editor-title{overflow-wrap:anywhere}.editor-settings{padding:22px 18px}.sign-company{display:none}}
@media(max-width:480px){.page-heading{align-items:flex-start;gap:12px}.page-heading>.button{padding:10px 12px;font-size:12px}.page-heading p{max-width:200px}.stat-top{font-size:12px}.stat-bottom strong{font-size:27px}.panel-heading{flex-direction:column;align-items:stretch;gap:14px}.search-box{width:100%}.tabs{gap:16px}.tab{font-size:12px}.topbar-right{gap:8px}.topbar .breadcrumb,.topbar .separator{display:none}.sign-header>.badge{font-size:11px}.brand{font-size:18px}.editor-header .brand small{display:none}.editor-header .brand-logo{width:46px;height:46px}.editor-header .text-button{font-size:12px}.auth-story{display:none}.auth-shell{grid-template-columns:1fr}.auth-form-wrap{min-height:100dvh}.auth-form:before{content:"";display:block;width:100px;height:100px;background:url('./brand-logo.png') center/contain no-repeat;margin:0 0 20px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
@media(min-width:601px) and (max-width:800px){.sidebar{width:76px;padding:14px 10px}.sidebar .brand-logo{width:54px;height:54px}.main-shell{margin-left:76px}.sidebar nav{gap:6px}.nav-item{padding:12px;justify-content:center}}
@media(max-width:600px){.page-heading .button{margin-top:0;font-size:12px}.sign-header{height:72px}.sign-header .brand small{font-size:9px}.topbar .text-button{font-size:12px}.page-footer{font-size:10px}.sign-document .pdf-toolbar .text-button{font-size:12px}}
.mobile-brand,#logout-mobile{display:none}
.wallet-summary{display:flex;align-items:center;gap:26px;padding:18px 22px;margin-bottom:20px;border:1px solid var(--line);border-radius:8px;background:white}.wallet-summary-label{display:block;font-size:12px;color:#6a7483;margin-bottom:7px}.wallet-summary strong{display:block;font-size:24px;line-height:1.3;font-weight:600;font-variant-numeric:tabular-nums}.wallet-summary strong small{font-size:12px;font-weight:400;color:#7b8593}.wallet-summary-meta{display:grid;gap:8px;font-size:12px;color:#677486}.wallet-summary-meta small{font-size:11px;color:#8a939f}.wallet-summary>.button{margin-left:auto}.wallet-summary-meta .balance-warning{color:#ac792d}.wallet-dialog-balance{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;margin:20px 0;padding:16px;border:1px solid var(--line);border-radius:7px;background:#f8f9fc}.wallet-dialog-balance>span{font-size:12px;color:#758093}.wallet-dialog-balance strong{font-size:21px;font-variant-numeric:tabular-nums}.wallet-dialog-balance small{font-size:11px;color:#798596}.wallet-dialog-balance button{font-size:12px}
@media(max-width:600px){.wallet-summary{gap:14px;padding:16px;flex-wrap:wrap}.wallet-summary-meta{flex:1;min-width:150px}.wallet-summary>.button{width:100%;margin-left:0}.wallet-summary strong{font-size:22px}}
.chain-proof{padding:16px;border:1px solid #e3e7f0;border-radius:7px;background:#fafbfe;text-align:left}.chain-proof-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.chain-proof-heading strong{font-size:13px}.chain-proof p{font-size:12px;color:#6e7786;margin:9px 0;line-height:1.7}.chain-proof label{font-size:10px;color:#788293;margin:12px 0 5px}.chain-proof code{display:block;font:11px/1.8 Consolas,monospace;overflow-wrap:anywhere;word-break:break-all;color:#576783;user-select:all}.chain-proof small{display:block;font-size:11px;color:#8490a3;margin-top:9px}.chain-proof a{display:inline-block;font-size:12px;margin:12px 14px 0 0}.chain-proof .button{margin-top:12px;font-size:12px}.chain-proof .form-error{color:#b32c3e}.signed-success>#chain-proof{grid-column:1/-1;min-width:0}.solana-wallet-address{display:block;font:13px/1.8 Consolas,monospace;overflow-wrap:anywhere;user-select:all;padding:14px;border:1px solid var(--line);background:#f8f9fc;border-radius:6px;margin:18px 0}.solana-setup-note{margin-top:16px}.topbar-right{flex-wrap:wrap}.topbar #chain-open{white-space:nowrap}
@media(max-width:600px){.signed-success:has(.hash-card[hidden]) .completion-download{grid-row:2}}
/* Completion summary sits above the document; long hashes get their own row. */
.sign-main .signed-success{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:20px 24px;max-width:none;margin:0 0 24px;padding:22px 24px;text-align:left;border:1px solid #d9e8e1;border-radius:10px;background:#fff}
.completion-heading{display:flex;align-items:center;gap:16px;min-width:0}.signed-success .success-icon{flex-shrink:0;width:46px;height:46px;margin:0;background:#eaf6ef;color:#23815b;font-size:24px}.completion-copy{min-width:0}.signed-success h2{margin:0 0 5px;font-size:20px;font-weight:600;line-height:1.4}.signed-success p{color:#68776e;font-size:13px;line-height:1.7;overflow-wrap:anywhere}.completion-download{gap:12px;min-height:42px}.signed-success .hash-card{grid-column:1/-1;max-width:none;margin:0;padding:14px 16px;background:#f7f9f8;border-color:#e6ebe8;text-align:left}.signed-success .hash-card>span{font-size:11px;color:#6c7771;margin-bottom:7px}.signed-success .hash-card code{font-family:Consolas,"SFMono-Regular",monospace;font-size:12px;line-height:1.8;color:#46564d;letter-spacing:.2px;user-select:all;overflow-wrap:anywhere}
@media(max-width:600px){.sign-main .signed-success{grid-template-columns:minmax(0,1fr);gap:16px;margin-bottom:18px;padding:18px}.completion-heading{gap:12px}.signed-success .success-icon{width:40px;height:40px;font-size:21px}.signed-success h2{font-size:18px}.signed-success p{font-size:12px}.completion-download{grid-row:3;width:100%;min-height:44px}.signed-success .hash-card{padding:12px}.signed-success .hash-card code{font-size:11px}.signed-success .hash-card[hidden]+*{grid-row:auto}}
#upload-dialog{width:min(760px,calc(100vw - 24px))}.party-form-card{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:16px}.party-form-head,.party-form-card>p{grid-column:1/-1}
@media(max-width:480px){.party-form-card{grid-template-columns:1fr}.party-form-head,.party-form-card>p{grid-column:auto}}
@media(max-width:600px){.mobile-brand{display:flex;align-items:center;gap:2px;color:var(--ink);font-size:16px;font-weight:650}.mobile-brand img{width:44px;height:44px;object-fit:contain}.topbar-location{display:none}.topbar-right{gap:12px}#logout-mobile{display:block}.table-wrap{overflow:visible}table{min-width:0;width:100%}table thead{display:none}#contract-list{display:block}#contract-list tr{display:grid;grid-template-columns:minmax(0,1fr) auto;padding:18px 16px;gap:14px 12px;border-bottom:1px solid var(--line)}#contract-list td{padding:0;border:0;font-size:12px;overflow-wrap:anywhere}#contract-list td:first-child{grid-column:1/-1}#contract-list td:nth-child(2):before{content:'签署方';display:block;color:#8a929e;font-size:10px;margin-bottom:5px}#contract-list td:nth-child(3){text-align:right}#contract-list td:nth-child(4){color:#77818e;font-size:11px;align-self:center}#contract-list td:nth-child(5){text-align:right}.contract-name{font-size:14px}.contract-name small{font-size:10px}.row-action{padding:8px 0}.panel-footer{padding:12px 16px}.topbar{padding:0 12px}}

.accounts-page{max-width:1200px;margin:0 auto}.accounts-page #users-error{padding:0 24px}.accounts-page td{white-space:normal}
.sidebar-toggle{display:none}.sidebar-drawer{padding:0;border:0;max-width:none;max-height:none;margin:0;width:min(300px,85vw);height:100dvh;background:#fff;color:var(--ink);box-shadow:12px 0 40px #14223826;overflow:hidden}.sidebar-drawer::backdrop{background:#18223666}.sidebar-drawer[open]{display:flex;flex-direction:column}.sidebar-close{position:absolute;top:18px;right:12px;z-index:2;font-size:25px}.sidebar-drawer .sidebar{display:flex!important;position:static!important;width:100%!important;height:100%;min-height:0;padding:18px 20px 20px;overflow-y:auto;border:0;flex-direction:column}.sidebar-drawer .sidebar .brand{display:flex;padding-right:28px}.sidebar-drawer .brand small,.sidebar-drawer .workspace,.sidebar-drawer .sidebar-help,.sidebar-drawer .sidebar-user,.sidebar-drawer .nav-caption{display:revert}.sidebar-drawer .sidebar-user{display:flex;margin-top:auto}.sidebar-drawer .sidebar nav{display:flex;flex-direction:column}.sidebar-drawer .nav-item{justify-content:flex-start;padding:13px 12px}.sidebar-drawer .nav-item span,.sidebar-drawer .nav-item b{display:inline}.sidebar-drawer .nav-item b{margin-left:auto}body.sidebar-open{overflow:hidden}
.sidebar-drawer .sidebar .brand>span:last-child,.sidebar-drawer .sidebar-user>div,.sidebar-drawer .sidebar-user .icon-button{display:block}.sidebar-drawer .sidebar nav{margin-top:0}
.sidebar-drawer .sidebar{z-index:0}
.sidebar-drawer .brand small{display:block}
@media(max-width:600px){.sidebar-toggle{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;font-size:22px;flex-shrink:0}.topbar .mobile-brand{margin-right:auto}.topbar .topbar-right{width:100%;justify-content:flex-start;padding:0 4px 4px;gap:8px 16px}.sidebar-drawer .brand-logo{width:56px;height:56px}.sidebar-drawer .sidebar .brand{font-size:19px}.sidebar-drawer .sidebar-help{margin-top:24px;margin-bottom:20px}.sidebar-drawer .workspace{display:flex}.sidebar-drawer .sidebar-user small{display:block}}
@media(max-width:600px){.accounts-page{padding:20px 12px}.accounts-page th,.accounts-page td{padding:12px 8px}.accounts-page .text-button{padding:5px}}

@media(max-width:600px){.topbar{height:auto;min-height:64px;flex-wrap:wrap;gap:4px;padding-bottom:8px}.topbar-right{flex-wrap:wrap;justify-content:flex-end;gap:8px 12px}#users-list{display:block}#users-list tr{display:grid;grid-template-columns:1fr 1fr;padding:16px;border-bottom:1px solid var(--line);gap:10px}#users-list td{border:0;padding:0;overflow-wrap:anywhere}#users-list td:first-child{grid-column:1/-1;font-weight:600;font-size:15px}#users-list td:nth-child(4):before{content:"发起合同 · ";color:var(--muted)}#users-list td:last-child{grid-column:1/-1;text-align:right}}

@media(max-width:600px){
  body[data-mode="admin"] .topbar{display:grid;grid-template-columns:44px minmax(0,1fr);height:auto;min-height:0;gap:8px;padding:10px 16px 0;align-items:center}
  .topbar .sidebar-toggle{width:44px;height:44px;padding:0;border:1px solid #e8ebef;border-radius:9px;background:#f7f8fa;color:#475365;line-height:1}
  .topbar .sidebar-toggle svg{display:block;flex-shrink:0}
  .topbar .mobile-brand{height:44px;width:fit-content;margin:0;gap:5px;justify-self:start;font-size:17px;line-height:1}
  .topbar .mobile-brand img{width:40px;height:40px}
  .topbar .topbar-right{grid-column:1/-1;display:grid;grid-template-columns:repeat(auto-fit,minmax(52px,1fr));width:100%;gap:0;padding:0;margin-top:2px;border-top:1px solid #edf0f3}
  .topbar .topbar-right .text-button{display:flex;align-items:center;justify-content:center;min-width:0;min-height:42px;margin:0;padding:0 3px;white-space:nowrap;font-size:11px;line-height:1.4}
}

.seal-library{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0 24px}.seal-library-card{border:1px solid var(--line);border-radius:8px;padding:14px;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;min-width:0}.seal-library-card img{width:110px;height:110px;object-fit:contain}.seal-library-card strong{font-size:13px;overflow-wrap:anywhere}.seal-library-card small{font-size:11px;color:var(--muted)}.seal-disabled{opacity:.55}.seal-library-card .text-button{min-height:36px}#preset-seal-wrap{margin-bottom:16px}#preset-seal-wrap select{font-size:12px}

/* Expanded handwriting keeps the same canvas and signature. */
.pad-actions{display:flex;align-items:center;gap:12px}.pad-actions #expand-signature{min-height:40px;padding:8px 14px;font-size:13px}
#signature-dialog.signature-expanded{width:calc(100vw - 32px);max-width:1100px;height:calc(100dvh - 32px);max-height:calc(100dvh - 32px);margin:auto;display:flex;flex-direction:column;overflow:hidden}
#signature-dialog.signature-expanded > :not(.modal-head):not(#handwriting-fields){display:none!important}
#signature-dialog.signature-expanded #handwriting-fields{display:flex;flex-direction:column;flex:1;min-height:0;margin-top:16px}
#signature-dialog.signature-expanded .signature-pad-wrap{flex:1;min-height:0;height:auto}
#signature-dialog.signature-expanded #signature-pad{width:100%;height:100%;display:block}
#signature-dialog.signature-expanded .pad-toolbar{flex-shrink:0;gap:12px;flex-wrap:wrap;padding-top:12px}
@media(max-width:600px){.pad-toolbar{flex-wrap:wrap;gap:10px}.pad-actions{gap:10px}#signature-dialog.signature-expanded{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom))}#signature-dialog.signature-expanded .modal-head{margin-bottom:0}#signature-dialog.signature-expanded .pad-toolbar>span{display:none}#signature-dialog.signature-expanded .pad-actions{width:100%;justify-content:space-between}}

.contract-pagination{display:flex;align-items:center;gap:12px}.contract-pagination .button{min-height:38px;padding:8px 12px}.contract-pagination #list-page{white-space:nowrap;font-variant-numeric:tabular-nums}@media(max-width:600px){.panel-footer{gap:12px;flex-wrap:wrap}.contract-pagination{width:100%;justify-content:space-between;gap:8px}}
