:root {
  color-scheme: light;
  --navy: #142544;
  --ink: #182743;
  --muted: #52627b;
  --line: #e1e7f0;
  --canvas: #f4f7fb;
  --blue: #2458ce;
  --blue-dark: #1746b3;
  --white: #fff;
  --radius: 15px;
  font-family: 'Hiragino Sans', 'Yu Gothic UI', Meiryo, system-ui, sans-serif;
  font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); line-height: 1.6; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .63; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid #6191fc; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.4; }
h1 { font-size: clamp(1.65rem, 2.7vw, 2.15rem); letter-spacing: -.04em; }
h2 { font-size: 1.125rem; letter-spacing: -.015em; }
h3 { font-size: 1rem; }
[hidden] { display: none !important; }
.loading { margin: 4rem auto; text-align: center; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.brand-mark { display: inline-grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; background: #4979f1; border-radius: 9px; color: white; }
.brand-mark span { width: 14px; height: 17px; border: 2px solid currentColor; border-radius: 2px 6px 2px 2px; position: relative; }
.brand-mark span::after { content: ''; position: absolute; left: 3px; top: 4px; width: 9px; height: 5px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(-45deg); background: #4979f1; }
.sidebar-brand, .compact-brand, .sign-brand, .auth-brand, .mobile-brand { display: flex; align-items: center; gap: .65rem; font-size: 1.14rem; font-weight: 750; letter-spacing: -.025em; white-space: nowrap; }

.icon { display: inline-block; width: 18px; height: 18px; position: relative; flex: 0 0 18px; color: inherit; }
.icon::before, .icon::after { content: ''; position: absolute; display: block; }
.i-plus::before { width: 13px; height: 2px; background: currentColor; left: 2.5px; top: 8px; border-radius: 2px; }
.i-plus::after { width: 2px; height: 13px; background: currentColor; left: 8px; top: 2.5px; border-radius: 2px; }
.i-docs::before { inset: 1px 3px; border: 1.6px solid currentColor; border-radius: 2px 5px 2px 2px; }
.i-docs::after { width: 6px; height: 1.5px; background: currentColor; box-shadow: 0 3px 0 currentColor; left: 6px; top: 7px; }
.i-clock::before { inset: 1px; border: 1.7px solid currentColor; border-radius: 50%; }
.i-clock::after { width: 5px; height: 6px; left: 8px; top: 4px; border: solid currentColor; border-width: 0 0 1.7px 1.7px; border-radius: 0 0 0 1px; }
.i-check::before { width: 12px; height: 7px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(-45deg); left: 3px; top: 4px; }
.i-edit::before { inset: 4px 5px 2px 2px; border: 1.6px solid currentColor; border-radius: 2px; }
.i-edit::after { width: 3px; height: 11px; left: 10px; top: 1px; background: currentColor; border-radius: 1px; transform: rotate(40deg); }
.i-search::before { width: 11px; height: 11px; border-radius: 50%; border: 1.6px solid currentColor; left: 2px; top: 2px; }
.i-search::after { width: 6px; height: 1.6px; background: currentColor; transform: rotate(45deg); left: 11px; top: 12px; }
.i-exit::before { inset: 2px 7px 2px 2px; border: solid currentColor; border-width: 1.5px 0 1.5px 1.5px; border-radius: 2px 0 0 2px; }
.i-exit::after { width: 7px; height: 7px; left: 8px; top: 5.5px; border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.i-link::before, .i-link::after { width: 10px; height: 6px; border: 1.5px solid currentColor; border-radius: 6px; transform: rotate(-43deg); }
.i-link::before { left: 1px; top: 9px; }
.i-link::after { left: 7px; top: 3px; }
.i-upload::before { inset: 10px 2px 1px; border: solid currentColor; border-width: 0 1.6px 1.6px; border-radius: 0 0 3px 3px; }
.i-upload::after { width: 7px; height: 7px; left: 5.5px; top: 2px; border: solid currentColor; border-width: 1.7px 0 0 1.7px; transform: rotate(45deg); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 42px; padding: .56rem .95rem; border: 1px solid transparent; border-radius: 8px; font-size: .875rem; font-weight: 700; white-space: nowrap; transition: background .15s, border-color .15s; }
.button.primary { background: var(--blue); border-color: var(--blue); color: white; box-shadow: 0 2px 3px #233c6b18; }
.button.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button.secondary { background: white; color: var(--ink); border-color: #ccd6e6; }
.button.secondary:hover { background: #f1f5fc; border-color: #a7b6cf; }
.button.danger { background: #b12f3f; color: white; }
.button.danger:hover { background: #8e2230; }
.button.full { width: 100%; }
.button-row { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: .65rem; }

.workspace { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; color: white; background: var(--navy); padding: 1.5rem 1rem 1rem; }
.sidebar-brand { margin: 0 .25rem 2.65rem; }
.nav-label { font-size: .75rem; letter-spacing: .04em; color: #adbbd3; margin: 0 .65rem .6rem; }
.nav-item { display: flex; align-items: center; width: 100%; gap: .65rem; min-height: 43px; padding: .55rem .65rem; border: 0; border-radius: 7px; background: transparent; color: #dbe5f7; text-align: left; font-size: .875rem; font-weight: 600; }
.nav-item + .nav-item { margin-top: .25rem; }
.nav-item:hover { background: #22395f; }
.nav-item.selected { color: #fff; background: #304d7a; }
.nav-item .icon { color: #a8c2f2; }
.sidebar-bottom { margin-top: auto; }
.sidebar-account { display: flex; align-items: center; gap: .6rem; padding: .85rem .55rem .65rem; border-top: 1px solid #ffffff22; }
.avatar { display: inline-grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: #3a5482; color: white; font-size: .75rem; font-weight: 750; flex: 0 0 auto; }
.account-name { font-size: .875rem; overflow-wrap: anywhere; }
.logout { color: #bccae2; font-weight: 500; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 clamp(1rem, 3.5vw, 3.15rem); background: white; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: .6rem; font-weight: 650; font-size: .875rem; }
.breadcrumb span { font-weight: 500; color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }
.topbar-caption { font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; text-align: right; }
.compact-brand, .mobile-brand { display: none; }
.content { max-width: 1440px; margin: 0 auto; padding: 2rem clamp(1rem, 3.5vw, 3.15rem) 3.5rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.45rem; }
.page-head p { margin-top: .4rem; color: var(--muted); overflow-wrap: anywhere; }
.page-head h1 { overflow-wrap: anywhere; }

.hero { position: relative; isolation: isolate; min-height: 155px; overflow: hidden; display: flex; align-items: center; padding: 1.55rem 2rem; border-radius: var(--radius); background: linear-gradient(112deg, #163563, #214d96 82%, #2b59a9); color: white; }
.hero-copy { z-index: 1; }
.hero h2 { font-size: clamp(1.25rem, 2.55vw, 1.65rem); margin-bottom: .5rem; }
.hero p { color: #e1ebfe; font-size: .875rem; }
.hero-art { width: 30%; min-width: 200px; position: absolute; right: 4%; inset-block: 0; }
.orbit { position: absolute; border: 1px solid #b7d0ff47; border-radius: 50%; width: 305px; height: 116px; left: 50%; top: 48%; transform: translate(-50%, -50%) rotate(-22deg); }
.orbit-2 { transform: translate(-50%, -50%) rotate(17deg); opacity: .6; }
.art-sheet { position: absolute; width: 86px; height: 105px; left: 49%; top: 50%; transform: translate(-50%, -50%) rotate(-13deg); padding: 24px 13px 9px; border-radius: 7px 16px 7px 7px; background: #e8f0ff; box-shadow: 8px 8px 0 #93b4f950, 0 16px 36px #091b4166; }
.art-sheet i { display: block; width: 48px; height: 4px; margin-bottom: 7px; border-radius: 4px; background: #a4bce8; }
.art-sheet i:nth-child(2) { width: 58px; }
.art-sheet i:nth-child(3) { width: 39px; }
.art-sheet b { display: block; width: 30px; height: 9px; margin: 4px 0 0 18px; border: solid #4e77d9; border-width: 0 0 2px 2px; transform: skew(-20deg) rotate(-13deg); border-radius: 40%; }
.art-seal { position: absolute; display: grid; place-items: center; width: 40px; height: 40px; left: calc(49% + 23px); top: calc(50% + 15px); border-radius: 50%; background: #83e3c7; color: #123c4a; font-size: 1.35rem; font-weight: 800; box-shadow: 0 6px 16px #0f24415c; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin: 1.1rem 0 1.3rem; }
.stat { display: flex; gap: .75rem; align-items: center; min-height: 92px; padding: .9rem; border: 1px solid var(--line); border-radius: 12px; background: white; text-align: left; color: var(--ink); box-shadow: 0 1px 2px #18274307; }
.stat:hover { border-color: #a9bdeb; }
.stat-icon, .file-icon, .empty-icon, .success-mark { display: inline-grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; }
.stat-icon.clay { color: #475e86; background: #eef2f8; }
.stat-icon.amber { color: #935602; background: #fff3dc; }
.stat-icon.green, .success-mark { color: #12694d; background: #ddf5eb; }
.stat-icon.blue, .file-icon, .empty-icon { color: #2458bc; background: #eaf0fe; }
.stat-body { display: grid; gap: .15rem; }
.stat-body > span { color: var(--muted); font-size: .8125rem; font-weight: 650; }
.stat strong { display: flex; align-items: baseline; gap: .25rem; font-size: 1.5rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat small { font-size: .75rem; color: var(--muted); font-weight: 600; }

.panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 3px #18274306; min-width: 0; }
.list-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; padding: 1.15rem 1.2rem .75rem; }
.list-tools { display: flex; align-items: center; gap: .55rem; max-width: 100%; }
.list-tools .button { min-height: 36px; padding-block: .28rem; }
.list-tools .search { min-width: min(100%, 195px); flex-shrink: 1; }
.search { position: relative; min-width: min(100%, 235px); }
.search .icon { position: absolute; top: 50%; left: .67rem; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding: .45rem .6rem .45rem 2rem; border: 1px solid #d8e0ed; border-radius: 8px; background: white; color: var(--ink); font-size: .875rem; }
.tabs { display: flex; gap: .25rem; padding-inline: 1.15rem; border-bottom: 1px solid var(--line); overflow: auto; }
.tab { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: .57rem .65rem; color: var(--muted); font-size: .875rem; font-weight: 650; white-space: nowrap; }
.tab:hover { color: var(--blue); }
.tab[aria-pressed="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.table-wrap { overflow: auto; }
.directory-panel { margin-top: 1rem; }
.directory-panel > .hint { margin: 0 1.2rem .75rem; }
.directory-search { width: min(100%, 22rem); }
.directory-search .search { flex: 1; min-width: 0; }
.directory-search input, .directory-search .button { height: 38px; }
.directory-panel .list-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .55rem; }
.member-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.member-actions .button { min-height: 36px; }
.unassigned-users { overflow-wrap: anywhere; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
thead { background: #f7f9fd; }
th, td { padding: .72rem .75rem; border-bottom: 1px solid #edf1f6; }
th { color: var(--muted); font-weight: 650; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 1.2rem; }
th:last-child, td:last-child { padding-right: 1.2rem; }
td:first-child { width: 37%; }
.billing-panel td:first-child { width: auto; }
.billing-panel td:nth-child(3) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.billing-test { margin: -.5rem 0 1rem; color: var(--muted); font-size: .875rem; }
.billing-summary { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 1rem; padding: 1.35rem; border-color: #ccd9f0; }
.billing-summary h2 { font-size: 1rem; }
.billing-amount { margin: .15rem 0; color: var(--navy); font-size: clamp(1.8rem, 5vw, 2.45rem); font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.25; }
.billing-checkout { display: grid; gap: .5rem; width: min(100%, 17rem); }
.billing-checkout > .button { min-height: 48px; }
.billing-checkout > .hint { text-align: center; }
.autopay-summary p { margin-top: .35rem; }
.autopay-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.billing-empty { color: var(--muted); font-size: .9375rem; }
.billing-notice { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .55rem; margin-bottom: 1rem; padding: .75rem 1rem; border: 1px solid #ccd9f0; border-radius: 8px; background: #ecf2fc; color: var(--navy); }
.billing-paid { border-color: #bddbcc; background: #edf8f2; color: #116447; }
.billing-notice + .billing-test { margin-top: 0; }
td:nth-child(2) { overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f9fbff; }
.row-title { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; overflow-wrap: anywhere; }
.row-title:hover, .table-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.row-title small { display: block; margin-top: .06rem; color: var(--muted); font-size: .75rem; font-weight: 500; }
.file-icon { width: 34px; height: 37px; border-radius: 8px; }
.table-link { color: var(--blue-dark); font-weight: 700; white-space: nowrap; font-size: .875rem; }
.date-cell { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.list-footer { border-top: 1px solid var(--line); padding: .6rem 1.2rem; color: var(--muted); font-size: .8125rem; }
.empty { padding: 2.25rem 1rem; text-align: center; }
.empty-icon { width: 46px; height: 46px; margin-bottom: .6rem; }
.empty p { color: var(--muted); font-size: .875rem; margin: .35rem 0 .8rem; }
.badge { display: inline-flex; align-items: center; gap: .35rem; color: #48566e; background: #edf1f6; border-radius: 30px; padding: .16rem .57rem; font-size: .8125rem; line-height: 1.55; font-weight: 700; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending { color: #875006; background: #fff1d7; }
.badge-signed { color: #116447; background: #dcf4e6; }
.badge-expired, .badge-canceled { color: #a42b42; background: #fdebf0; }

.editor-grid, .detail-grid, .sign-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(242px, 1fr); gap: 1rem; align-items: start; }
.editor-form { min-width: 0; }
.form-section { display: grid; gap: .9rem; padding: 1.2rem; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.editor-actions { position: sticky; z-index: 2; bottom: 0; background: white; border-radius: 0 0 12px 12px; }
.form-stack { display: grid; gap: .95rem; }
.field { display: grid; gap: .35rem; min-width: 0; }
.field > span { font-size: .875rem; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; border: 1px solid #ccd6e6; border-radius: 8px; background: white; padding: .61rem .72rem; color: var(--ink); }
.field textarea { resize: vertical; min-height: 10rem; }
.field input[readonly] { background: #f4f7fc; }
.field input::placeholder, .field textarea::placeholder, .search input::placeholder { color: #677892; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.format-tabs { display: flex; gap: .55rem; flex-wrap: wrap; }
.format-tabs button { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid #d6dfed; border-radius: 8px; padding: .5rem .6rem; background: white; color: var(--muted); font-size: .875rem; font-weight: 650; }
.format-tabs button[aria-pressed="true"] { color: var(--blue-dark); border-color: #7f9fe7; background: #edf3ff; }
.drop-zone { min-height: 172px; display: grid; align-content: center; justify-items: center; gap: .25rem; padding: .8rem; position: relative; cursor: pointer; text-align: center; border: 1px dashed #8da6d7; border-radius: 12px; background: #f7faff; }
.drop-zone:hover, .drop-zone.dragging, .drop-zone:focus-within { background: #edf4ff; border-color: var(--blue); }
.drop-zone .empty-icon { margin-bottom: .22rem; }
.drop-zone strong { overflow-wrap: anywhere; max-width: 100%; }
.drop-zone span:not(.empty-icon, .icon) { font-size: .875rem; color: var(--muted); }
.drop-zone small { font-size: .75rem; color: var(--muted); }
.drop-zone input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.steps { padding: 1.2rem; }
.steps ol { display: grid; gap: .9rem; padding: 0 0 0 1.55rem; margin: .8rem 0 0; }
.steps li::marker { color: var(--blue); font-weight: 750; }
.steps li strong, .steps li span { display: block; }
.steps li span { font-size: .875rem; color: var(--muted); }
.form-error { color: #9e2539; background: #fff1f3; border-radius: 8px; padding: .65rem .75rem; font-size: .875rem; }

.title-badge { margin-bottom: .45rem; }
.middle-dot { margin: 0 .45rem; color: #8897ad; }
.detail-main { display: grid; gap: 1rem; min-width: 0; }
.detail-panel { display: grid; gap: .85rem; padding: 1.2rem; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.document-body { padding: .9rem; min-height: 120px; max-height: 480px; overflow: auto; border: 1px solid var(--line); background: #fafbff; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pdf-card { display: flex; align-items: center; gap: .65rem; background: #f7faff; padding: .75rem; border: 1px solid var(--line); border-radius: 9px; overflow-wrap: anywhere; }
.pdf-card span:not(.file-icon, .icon) { display: block; color: var(--muted); font-size: .8125rem; }
.pdf-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.pdf-frame { overflow: hidden; background: #eef2f8; border: 1px solid var(--line); border-radius: 8px; }
.pdf-page { position: relative; container-type: inline-size; }
.pdf-frame canvas { display: block; width: 100%; margin: auto; background: white; }
.pdf-overlay { position: absolute; inset: 0; pointer-events: none; }
.pdf-overlay.editable { pointer-events: auto; touch-action: pinch-zoom; cursor: crosshair; user-select: none; }
.pdf-region { position: absolute; min-width: 0; margin: 0; border: 1px solid #4b77d2; border-radius: 3px; padding: 0 .2rem; color: var(--blue-dark); background: #dbe9ffd9; font-size: clamp(.65rem, 2.1cqw, 1rem); line-height: 1; }
span.pdf-region { display: flex; align-items: center; overflow: hidden; white-space: nowrap; }
.pdf-edit-region { display: flex; align-items: center; cursor: move; text-align: left; }
.pdf-edit-region.selected, .pdf-edit-region:focus-visible { z-index: 1; outline: 1px solid var(--blue); background: #d5e6ff; }
.pdf-region-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-resize { position: absolute; z-index: 1; right: -9px; bottom: -9px; width: 22px; height: 22px; cursor: nwse-resize; }
.pdf-resize::before { position: absolute; content: ''; inset: 5px; background: white; border: 2px solid #3768cb; border-radius: 50%; }
.pdf-region-invalid, .pdf-edit-region.selected.pdf-region-invalid { border-color: #b7374d; background: #ffe4ea; outline-color: #b7374d; }
input.pdf-region { pointer-events: auto; background: #ecf4ffed; }
input.pdf-region:focus { z-index: 1; outline: 2px solid var(--blue); background: white; }
.pdf-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; padding: .55rem; }
.pdf-toolbar .button { min-height: 34px; padding: .2rem .5rem; font-size: .8125rem; }
.pdf-position, .pdf-status { color: var(--muted); font-size: .875rem; }
.pdf-status { padding: .7rem; }
#pdf-setup { display: grid; gap: .6rem; margin-top: 1rem; }
.pdf-field-tools { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .55rem; }
.pdf-field-tools .field { min-width: min(100%, 13rem); }
.pdf-field-tools > .hint { padding-bottom: .4rem; }
#pdf-mark-hint { color: #a02c41; }
.pdf-field-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: .55rem; align-items: end; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.pdf-field-row .button { padding-inline: .5rem; }
.pdf-field-row .checkbox { align-self: end; align-items: center; min-height: 40px; }
.pdf-signer-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .55rem; }
.pdf-page-link { justify-self: end; padding: .55rem .2rem; border: 0; background: none; color: var(--blue-dark); font-size: .8125rem; text-decoration: underline; }
.pdf-field-summary { padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 8px; }
.record-consent > span { color: var(--muted); font-size: .8125rem; }
.record-consent > p { margin-top: .25rem; font-size: .875rem; }
dl { margin: 0; }
dl > div { padding: .55rem 0; border-bottom: 1px solid #edf1f7; }
dl > div:first-child { padding-top: 0; }
dl > div:last-child { border-bottom: 0; }
dt { color: var(--muted); font-size: .8125rem; }
dd { margin: .12rem 0 0; overflow-wrap: anywhere; font-size: .875rem; font-weight: 650; }
.hash { font: .78rem/1.5 ui-monospace, Consolas, monospace; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; gap: .12rem; padding: 0 0 .8rem 1rem; border-left: 1px solid #d9e3f5; margin-left: .25rem; overflow-wrap: anywhere; }
.timeline li:last-child { border-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; top: .35rem; left: -.28rem; width: .5rem; height: .5rem; border-radius: 50%; background: #3662c3; }
.timeline strong, .timeline span { font-size: .875rem; }
.timeline span { color: var(--muted); }
.text-danger { color: #a6263a; background: none; border: 0; border-radius: 4px; padding: .3rem; font-size: .875rem; font-weight: 650; }
.text-danger:hover { text-decoration: underline; }

.auth-layout { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1.05fr; }
.auth-aside { min-height: 100%; display: flex; flex-direction: column; padding: clamp(1.5rem, 4.3vw, 4.5rem); overflow: hidden; color: white; background: radial-gradient(ellipse at 80% 45%, #244e94 0, transparent 55%), linear-gradient(155deg, #142544, #173566); }
.auth-intro { margin: auto 0; padding-block: 1.5rem; }
.auth-intro h2 { font-size: clamp(1.65rem, 3.3vw, 3rem); letter-spacing: -.04em; margin-bottom: .75rem; }
.auth-intro p { color: #d7e3f8; max-width: 35ch; }
.auth-art { position: relative; width: 190px; height: 160px; margin: 0 0 1.15rem -.8rem; }
.auth-art .art-sheet { width: 100px; height: 122px; padding-top: 31px; }
.auth-art .art-seal { top: calc(50% + 24px); }
.auth-foot { font-size: .8125rem; color: #b2c4e4; }
.auth-main { min-height: 100%; background: white; display: grid; place-items: center; padding: 2rem clamp(1rem, 5vw, 4.5rem); }
.auth-card { width: min(100%, 385px); }
.auth-card > p { margin: .5rem 0 1.45rem; color: var(--muted); }
.auth-card .button { margin-top: .15rem; }

.workspace-login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(125deg, var(--navy), #20447d) top / 100% clamp(13rem, 37dvh, 24rem) no-repeat, var(--canvas);
}
.workspace-login-header {
  width: min(100%, 76rem);
  margin-inline: auto;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1rem, 4vw, 3rem);
  color: white;
}
.workspace-login-main {
  width: min(100%, 32rem);
  margin: auto;
  padding: 1.5rem 1rem clamp(2.5rem, 7dvh, 5rem);
}
.workspace-login-panel {
  padding: clamp(1.5rem, 6vw, 2.75rem);
  border-radius: 20px;
  box-shadow: 0 15px 42px #1425441a;
}
.workspace-login-panel h1 { font-size: clamp(1.4rem, 5vw, 1.8rem); }
.workspace-login-instructions { margin-top: .65rem; color: var(--muted); }
.workspace-login-action { min-height: 48px; margin-top: 1.5rem; font-size: .9375rem; }
.workspace-login-alternate { margin-top: .8rem; font-size: .875rem; text-align: center; }
.workspace-login-help { margin-top: 1.5rem; padding-top: 1.15rem; border-top: 1px solid var(--line); }
.workspace-login-help h2 { font-size: .9rem; }
.workspace-login-help p { margin-top: .3rem; color: var(--muted); font-size: .875rem; }
.workspace-login-signer { margin: 1rem .35rem 0; color: var(--muted); font-size: .875rem; text-align: center; }

.sign-layout { min-height: 100vh; }
.sign-top { display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding: .65rem max(1rem, calc((100% - 1050px) / 2)); border-bottom: 1px solid var(--line); background: white; }
.sign-top > span { font-size: .875rem; color: var(--muted); }
.sign-main { max-width: 1082px; margin: auto; padding: 2.25rem 1rem 3.25rem; }
.sign-grid { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); }
.signing-panel p, .hint { color: var(--muted); }
.signing-panel > p, .hint { font-size: .875rem; }
.checkbox { display: flex; align-items: flex-start; gap: .55rem; font-size: .875rem; font-weight: 600; }
.checkbox input { flex: 0 0 auto; width: 1.15rem; height: 1.15rem; margin: .15rem 0 0; accent-color: var(--blue); }
.error-panel { text-align: center; max-width: 600px; margin: auto; padding: 2.3rem 1.2rem; }
.error-panel p { margin: .6rem 0; color: var(--muted); }

dialog { width: min(510px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); box-shadow: 0 20px 60px #1425444a; }
dialog::backdrop { background: #0e1d36a3; }
.dialog-content { display: grid; gap: .8rem; padding: 1.35rem; }
.dialog-content h2 { font-size: 1.25rem; }
.dialog-content > p { color: var(--muted); overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 5; right: 1rem; bottom: 1rem; max-width: min(430px, calc(100% - 2rem)); border-radius: 10px; background: #172b4c; color: white; padding: .65rem .95rem; box-shadow: 0 4px 16px #1425444a; font-size: .875rem; }

@media (max-width: 1030px) {
  .workspace { grid-template-columns: 184px minmax(0, 1fr); }
  .stats { gap: .55rem; }
  .stat { padding: .7rem; gap: .45rem; }
  .stat-icon { width: 34px; height: 34px; }
  .hero-art { right: 0; }
}

@media (max-width: 800px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: .55rem 1rem; flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .35rem; }
  .sidebar-brand, .nav-label, .sidebar-account { display: none; }
  .sidebar nav { display: flex; gap: .25rem; }
  .sidebar-bottom, .nav-item + .nav-item { margin: 0; }
  .nav-item { min-height: 38px; padding: .4rem .5rem; }
  .topbar { height: 56px; }
  .breadcrumb { display: none; }
  .compact-brand { display: flex; }
  .content { padding-top: 1.35rem; }
  .auth-aside { padding: 1.6rem; }
}

@media (max-width: 590px) {
  .wide-only, .hero-art { display: none; }
  .hero { min-height: 0; padding: 1.15rem; }
  .page-head { align-items: flex-start; }
  .page-head p { font-size: .875rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { min-height: 70px; }
  .editor-grid, .detail-grid, .sign-grid, .field-row { grid-template-columns: minmax(0, 1fr); }
  .list-head { padding-inline: .85rem; }
  .tabs { padding-inline: .65rem; }
  table { min-width: 590px; }
  .billing-panel table { min-width: 0; }
  .billing-panel :is(th, td) { padding-inline: .4rem; }
  .billing-summary { display: grid; gap: .85rem; padding: 1rem; }
  .billing-checkout { width: 100%; }
  .auth-layout { grid-template-columns: 1fr; background: white; }
  .auth-aside { display: none; }
  .auth-main { place-items: start center; padding: 2.25rem 1rem; }
  .mobile-brand { display: flex; margin-bottom: 1.3rem; }
  .sign-main { padding-top: 1.3rem; }
  .sign-top { min-height: 56px; }
  .pdf-field-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .pdf-field-row .field { grid-column: 1 / -1; grid-row: 1; }
  .share-actions { justify-content: flex-start; }
}

@media print {
  body { background: white; }
  .workspace, .detail-grid { display: block; }
  .sidebar, .topbar, .button, .pdf-actions, .pdf-frame, .toast { display: none !important; }
  .panel { box-shadow: none; margin-bottom: .8rem; }
  .content { padding: 0; }
  .document-body { max-height: none; overflow: visible; }
  .info-panel { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
