/* Sunbeatus · 电子签名 — 设计系统 */
:root {
  --ink: #17212b;
  --ink-2: #3d4c5a;
  --muted: #76818c;
  --muted-2: #9aa2aa;
  --paper: #f6f2e9;
  --paper-deep: #efe9dc;
  --card: #ffffff;
  --line: #e7e0d4;
  --line-2: #d8cfc0;
  --blue: #1f3a5f;
  --blue-2: #2c4f7c;
  --blue-soft: #edf2f8;
  --gold: #b88746;
  --gold-soft: #fbf4e6;
  --green: #1f7a5c;
  --green-soft: #eaf6ef;
  --red: #b23a3a;
  --red-soft: #fbeeee;
  --amber: #9a641c;
  --amber-soft: #fcf2df;
  --shadow-sm: 0 1px 2px rgba(23, 33, 43, .04), 0 4px 14px rgba(23, 33, 43, .04);
  --shadow-md: 0 12px 34px rgba(23, 33, 43, .08);
  --shadow-lg: 0 30px 80px rgba(23, 33, 43, .16);
  --radius: 14px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.admin {
  background:
    radial-gradient(900px 480px at 8% -6%, rgba(184, 135, 70, .10), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(31, 58, 95, .08), transparent 60%),
    var(--paper);
  min-height: 100vh;
}

body.signer {
  background:
    radial-gradient(1000px 600px at 10% 0%, rgba(184, 135, 70, .12), transparent 60%),
    radial-gradient(1000px 700px at 100% 10%, rgba(31, 58, 95, .10), transparent 55%),
    linear-gradient(180deg, #f7f3ea 0%, #f3eee3 100%);
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img { max-width: 100%; }

.ico {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  display: inline-block;
  vertical-align: -0.16em;
}

::selection { background: rgba(31, 58, 95, .16); }

:focus-visible {
  outline: 2px solid rgba(31, 58, 95, .55);
  outline-offset: 3px;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 17px; height: 17px; }
.btn.primary {
  background: linear-gradient(180deg, #27496f, var(--blue));
  color: #fff;
  border-color: rgba(0, 0, 0, .06);
  box-shadow: 0 6px 16px rgba(31, 58, 95, .22), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn.primary:hover { background: linear-gradient(180deg, #2d537e, #234269); box-shadow: 0 8px 20px rgba(31, 58, 95, .28); }
.btn.ghost {
  background: #fff;
  border-color: var(--line-2);
  color: var(--ink-2);
}
.btn.ghost:hover { border-color: #bfb3a0; background: #fdfbf6; }
.btn.soft {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: #dbe5f1;
}
.btn.soft:hover { background: #e5edf7; }
.btn.danger {
  background: #fff;
  border-color: #eccaca;
  color: var(--red);
}
.btn.danger:hover { background: var(--red-soft); }
.btn.gold {
  background: var(--gold-soft);
  color: #8c6426;
  border-color: #eddfc4;
}
.btn.block { width: 100%; height: 54px; font-size: 16px; border-radius: 12px; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.sm .ico { width: 15px; height: 15px; }
.btn[disabled] { opacity: .48; box-shadow: none; transform: none; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: #f4f0e7; color: var(--ink); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.icon-btn .ico { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ */
/* Forms                                                               */
/* ------------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .field-label {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.field .req { color: var(--red); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted-2); line-height: 1.5; }
.input, .textarea, .select {
  width: 100%;
  border: 1.5px solid var(--line-2);
  background: #fff;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 15px;
  line-height: 1.5;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.input::placeholder, .textarea::placeholder { color: #b3ada2; }
.input:hover, .textarea:hover, .select:hover { border-color: #c8bdab; }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(31, 58, 95, .09);
}
.textarea { resize: vertical; min-height: 84px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2376818c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.input-wrap { position: relative; }
.input-wrap .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); width: 18px; height: 18px; pointer-events: none; }
.input-wrap .input { padding-left: 38px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ------------------------------------------------------------------ */
/* Topbar                                                              */
/* ------------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 249, 244, .86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(216, 207, 192, .7);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(145deg, #31567f, #172d49);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 700;
  box-shadow: 0 5px 12px rgba(31, 58, 95, .25), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 16px; font-weight: 750; letter-spacing: .01em; }
.brand-sub { font-size: 10.5px; letter-spacing: .13em; color: var(--muted); text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12.5px;
  color: var(--ink-2);
}
.admin-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(31, 122, 92, .12); }

/* ------------------------------------------------------------------ */
/* Admin layout                                                        */
/* ------------------------------------------------------------------ */
.admin-main { max-width: 1180px; margin: 0 auto; padding: 42px 28px 90px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; margin-bottom: 28px; }
.eyebrow {
  margin: 0 0 8px;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .18em;
  color: var(--gold);
  text-transform: uppercase;
}
.page-head h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: .01em;
  font-weight: 700;
}
.page-head .lead { margin: 9px 0 0; color: var(--muted); font-size: 13.5px; max-width: 560px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 26px 0 8px; }
.stat-card {
  position: relative;
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 16px 17px 15px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -26px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--tint, rgba(31, 58, 95, .06));
}
.stat-top { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-top .ico { width: 15px; height: 15px; color: var(--accent, var(--blue)); }
.stat-num { margin-top: 7px; font-size: 29px; font-weight: 750; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-foot { margin-top: 6px; font-size: 11.5px; color: var(--muted-2); }

.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 25px 0 14px; }
.tabs { display: inline-flex; gap: 3px; padding: 4px; border-radius: 11px; background: #ebe5d8; }
.tab {
  border: 0;
  background: transparent;
  height: 32px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 650;
  color: #6f6a5f;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.tab:hover { color: var(--ink); }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(23, 33, 43, .10); }
.tab-count { font-size: 10.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.tab.active .tab-count { color: var(--blue); }
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.search { position: relative; width: 240px; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted-2); }
.search input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(255, 255, 255, .8);
  padding: 0 12px 0 36px;
  font-size: 13px;
}
.search input:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(31, 58, 95, .08); }

.request-list { display: flex; flex-direction: column; gap: 9px; }
.req-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(23, 33, 43, .02);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
.req-card:hover { border-color: #cfc4b1; background: #fff; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.req-card.is-signed { border-left: 3px solid rgba(31, 122, 92, .55); }
.req-card.is-pending { border-left: 3px solid rgba(184, 135, 70, .62); }
.req-avatar {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 750;
  color: #fff;
  background: linear-gradient(145deg, #4f729a, #294867);
  letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.req-avatar.warm { background: linear-gradient(145deg, #c29c68, #8f6a39); }
.req-avatar.sage { background: linear-gradient(145deg, #5e8f7b, #376553); }
.req-avatar.rose { background: linear-gradient(145deg, #ad7a76, #7e4e4a); }
.req-main { min-width: 0; }
.req-title-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.req-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.req-meta { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--muted); }
.req-meta .sep { width: 2px; height: 2px; border-radius: 50%; background: #c9c1b3; }
.req-meta .ico { width: 13px; height: 13px; color: var(--muted-2); }
.req-side { display: flex; align-items: center; gap: 12px; }
.req-actions { display: flex; align-items: center; gap: 2px; }
.req-expiry { font-size: 11.5px; color: var(--muted-2); white-space: nowrap; text-align: right; line-height: 1.4; }
.req-expiry strong { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.pending { color: var(--amber); background: var(--amber-soft); border-color: #f0dfbb; }
.status.signed { color: var(--green); background: var(--green-soft); border-color: #cfe9da; }
.status.expired { color: #7c7770; background: #f1eeea; border-color: #e2ddd4; }
.status.revoked { color: var(--red); background: var(--red-soft); border-color: #efd0d0; }

.empty {
  text-align: center;
  padding: 64px 24px 68px;
  border: 1px dashed var(--line-2);
  border-radius: 18px;
  background: rgba(255, 255, 255, .48);
}
.empty-art { width: 74px; height: 74px; margin: 0 auto 16px; border-radius: 22px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--gold); box-shadow: var(--shadow-sm); }
.empty-art .ico { width: 34px; height: 34px; }
.empty h3 { margin: 0 0 6px; font-size: 17px; }
.empty p { margin: 0 auto 18px; max-width: 400px; color: var(--muted); font-size: 13px; line-height: 1.7; }

.skeleton-list { display: flex; flex-direction: column; gap: 9px; }
.skeleton {
  height: 76px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, #f6f2ea 25%, #fbf9f4 37%, #f6f2ea 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ------------------------------------------------------------------ */
/* Overlay / drawer / modal                                            */
/* ------------------------------------------------------------------ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(23, 33, 43, .42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.overlay.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  height: 100%;
  width: min(640px, 100%);
  display: flex;
  flex-direction: column;
  background: #fbf9f4;
  box-shadow: -24px 0 70px rgba(23, 33, 43, .2);
  transform: translateX(102%);
  transition: transform .28s cubic-bezier(.22, .7, .3, 1);
}
.drawer.show { transform: none; }
.drawer-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 255, 255, .55);
}
.drawer-head h2 { margin: 0; font-size: 19px; line-height: 1.35; }
.drawer-head .sub { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); }
.drawer-body { flex: 1; overflow: auto; padding: 22px 24px 26px; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .72); display: flex; gap: 8px; flex-wrap: wrap; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(23, 33, 43, .46);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(.99);
  transition: transform .22s ease;
}
.modal-overlay.show .modal { transform: none; }
.modal.small { width: min(440px, 100%); }
.modal-head { padding: 22px 24px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.modal-head h2 { margin: 0; font-size: 22px; font-family: var(--font-serif); }
.modal-head .sub { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.modal-body { padding: 20px 24px 24px; }

/* ------------------------------------------------------------------ */
/* Login                                                               */
/* ------------------------------------------------------------------ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  position: relative;
  overflow: hidden;
}
.login-blob { position: absolute; border-radius: 50%; filter: blur(10px); pointer-events: none; }
.login-blob.one { width: 480px; height: 480px; left: -160px; top: -180px; background: radial-gradient(circle, rgba(184, 135, 70, .20), transparent 66%); }
.login-blob.two { width: 560px; height: 560px; right: -220px; bottom: -240px; background: radial-gradient(circle, rgba(31, 58, 95, .16), transparent 66%); }
.login-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 38px 36px 30px;
  border-radius: 24px;
  border: 1px solid rgba(216, 207, 192, .9);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 32px 80px rgba(23, 33, 43, .13);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-brand .brand-mark { width: 46px; height: 46px; border-radius: 13px; font-size: 27px; }
.login-brand .name { font-size: 17px; font-weight: 750; }
.login-brand .sub { font-size: 11px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.login-card h1 { margin: 0 0 7px; font-family: var(--font-serif); font-size: 28px; }
.login-card .lead { margin: 0 0 24px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.login-card .btn { width: 100%; height: 46px; margin-top: 4px; }
.login-error { display: none; align-items: flex-start; gap: 8px; margin: 12px 0 0; padding: 10px 12px; border-radius: 9px; background: var(--red-soft); color: var(--red); font-size: 12.5px; line-height: 1.5; }
.login-error.show { display: flex; }
.login-error .ico { width: 16px; height: 16px; margin-top: 1px; }
.login-foot { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted-2); text-align: center; line-height: 1.7; }
.login-shake { animation: shake .38s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }

/* ------------------------------------------------------------------ */
/* Create / detail                                                     */
/* ------------------------------------------------------------------ */
.choice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 64px;
  height: 36px;
  padding: 0 13px;
  border: 1.5px solid var(--line-2);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: #bfb3a0; }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 58, 95, .07); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.switch-row:first-of-type { border-top: 0; }
.switch-copy strong { display: block; font-size: 13px; }
.switch-copy span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #d8d2c6; transition: background .18s ease; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); transition: transform .18s ease; }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid rgba(31, 58, 95, .55); outline-offset: 2px; }

.link-box { display: flex; align-items: center; gap: 6px; padding: 5px 5px 5px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #faf8f2; }
.link-box input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 12px; color: var(--ink-2); padding: 7px 0; font-family: var(--font-mono); }
.link-box input:focus { outline: none; }
.link-box .btn { flex: none; }
.qr-panel { display: flex; align-items: center; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #faf8f2; }
.qr-panel img { width: 124px; height: 124px; border-radius: 9px; border: 1px solid var(--line); background: #fff; padding: 5px; }
.qr-panel .qr-copy { min-width: 0; }
.qr-panel h4 { margin: 0 0 4px; font-size: 14px; }
.qr-panel p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.result-banner { display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border-radius: 12px; background: var(--green-soft); border: 1px solid #cfe9da; margin-bottom: 18px; }
.result-banner .ico { color: var(--green); width: 22px; height: 22px; margin-top: 1px; }
.result-banner strong { display: block; font-size: 13.5px; color: #176047; }
.result-banner span { display: block; margin-top: 2px; font-size: 12px; color: #3c7a64; line-height: 1.5; }
.result-banner.warn { background: var(--amber-soft); border-color: #f0dfbb; }
.result-banner.warn .ico { color: var(--amber); }
.result-banner.warn strong { color: #7d5414; }
.result-banner.warn span { color: #916a30; }

.detail-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.detail-title { margin: 0; font-family: var(--font-serif); font-size: 23px; line-height: 1.3; }
.detail-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.detail-section { margin-top: 22px; }
.detail-section h3 { margin: 0 0 10px; font-size: 12px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; font-weight: 750; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; padding: 15px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.meta-item .k { font-size: 11px; color: var(--muted-2); }
.meta-item .v { margin-top: 3px; font-size: 13px; font-weight: 600; word-break: break-all; }
.record-frame { padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: repeating-conic-gradient(#f0ece3 0 25%, #faf8f3 0 50%) 0 0 / 18px 18px; }
.record-frame img { display: block; width: 100%; border-radius: 8px; box-shadow: 0 8px 26px rgba(23, 33, 43, .13); background: #fff; }
.record-frame.pending { min-height: 190px; display: grid; place-items: center; background: #faf8f3; }
.pending-art { text-align: center; color: var(--muted); }
.pending-art .ico { width: 38px; height: 38px; color: var(--gold); margin-bottom: 8px; }
.pending-art p { margin: 0; font-size: 12px; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { position: relative; padding: 0 0 16px 22px; font-size: 12px; color: var(--muted); }
.timeline-item::before { content: ""; position: absolute; left: 4px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: #c9c1b3; box-shadow: 0 0 0 3px #fbf9f4; }
.timeline-item::after { content: ""; position: absolute; left: 7px; top: 15px; bottom: -1px; width: 1px; background: var(--line); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:last-child::after { display: none; }
.timeline-item strong { color: var(--ink-2); font-weight: 650; }
.timeline-item .t { float: right; color: var(--muted-2); font-size: 11px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ */
/* Signer                                                              */
/* ------------------------------------------------------------------ */
.signer-top { position: relative; z-index: 2; max-width: 1080px; margin: 0 auto; padding: 20px 28px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.signer-top .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 20px; }
.signer-top .brand-name { font-size: 15px; }
.signer-top .brand-sub { font-size: 9.5px; }
.secure-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: #4d6b5f; background: rgba(255, 255, 255, .66); border: 1px solid rgba(207, 233, 218, .9); border-radius: 999px; padding: 6px 11px; }
.secure-badge .ico { width: 14px; height: 14px; color: var(--green); }

.signer-main { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; padding: 8px 26px 70px; display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: 24px; align-items: start; }
.signer-main.solo { grid-template-columns: minmax(0, 760px); justify-content: center; }
.signer-main.solo.centered { grid-template-columns: minmax(0, 620px); align-content: center; min-height: calc(100vh - 150px); }
.sign-card {
  position: relative;
  min-width: 0;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(216, 207, 192, .8);
  border-radius: 22px;
  padding: 34px 36px 30px;
  box-shadow: 0 26px 70px rgba(31, 42, 55, .11), 0 2px 0 rgba(255, 255, 255, .8) inset;
}
.sign-card .eyebrow { color: var(--gold); }
.sign-card h1 { margin: 0 0 10px; font-family: var(--font-serif); font-size: 33px; line-height: 1.3; letter-spacing: .01em; }
.sign-note { margin: 14px 0 0; padding: 13px 15px; border-left: 3px solid #dcc9a5; border-radius: 0 9px 9px 0; background: #faf6ec; color: #58636e; font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.req-meta-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 18px 0 0; font-size: 12.5px; color: var(--muted); }
.req-meta-row .item { display: inline-flex; align-items: center; gap: 6px; }
.req-meta-row .ico { width: 15px; height: 15px; color: var(--muted-2); }
.req-meta-row strong { color: var(--ink-2); font-weight: 650; }
.sign-divider { height: 1px; background: linear-gradient(90deg, var(--line), transparent); margin: 22px 0 4px; }

.sign-field { margin-top: 18px; }
.sign-field > label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.sign-field .input { height: 48px; font-size: 17px; padding: 0 14px; border-radius: 11px; }
.sign-field .hint { margin-top: 6px; font-size: 11.5px; color: var(--muted-2); }

.pad-section { margin-top: 18px; }
.pad-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pad-title { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.pad-title .ico { width: 15px; height: 15px; color: var(--gold); }
.pad-title .req { color: var(--red); font-weight: 500; }
.pad-tools { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: #f2ede3; border: 1px solid #e8e1d4; }
.tool-btn { width: 31px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: #5f6a75; display: grid; place-items: center; transition: background .14s ease, color .14s ease; }
.tool-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .85); color: var(--ink); }
.tool-btn:disabled { opacity: .3; }
.tool-btn .ico { width: 17px; height: 17px; }
.tool-btn.active { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(23, 33, 43, .1); }
.tool-sep { width: 1px; height: 17px; background: #ddd4c3; margin: 0 3px; }
.size-btn { width: 27px; height: 27px; border: 0; border-radius: 7px; background: transparent; display: grid; place-items: center; color: #56616c; }
.size-btn:hover { background: #fff; }
.size-btn.active { background: #fff; box-shadow: 0 1px 3px rgba(23, 33, 43, .1); color: var(--blue); }
.size-dot { display: block; border-radius: 50%; background: currentColor; }
.color-btn { width: 25px; height: 27px; border: 0; border-radius: 7px; background: transparent; display: grid; place-items: center; }
.color-btn.active { background: #fff; box-shadow: 0 1px 3px rgba(23, 33, 43, .1); }
.color-dot { width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .12); }

.pad-wrap {
  position: relative;
  aspect-ratio: 2.55 / 1;
  min-height: 230px;
  border-radius: 15px;
  border: 1px solid #dfd4c1;
  background:
    radial-gradient(120% 120% at 50% 0%, #fffdf8 0%, #fbf6ec 58%, #f5eddd 100%);
  box-shadow: inset 0 2px 12px rgba(120, 100, 60, .06), 0 8px 22px rgba(23, 33, 43, .06);
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.pad-wrap::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 75%;
  border-top: 1px dashed rgba(160, 145, 120, .38);
  pointer-events: none;
}
.pad-wrap::after {
  content: "";
  position: absolute;
  left: 7%;
  bottom: 12%;
  width: 22px;
  border-top: 1px solid rgba(160, 145, 120, .45);
  pointer-events: none;
}
.pad-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
  z-index: 2;
}
.pad-placeholder {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #a79d8d;
  pointer-events: none;
  transition: opacity .24s ease, transform .24s ease;
}
.pad-placeholder.hide { opacity: 0; transform: translateY(-4px); }
.pad-placeholder .pen { width: 34px; height: 34px; color: #b9ad99; margin-bottom: 2px; }
.pad-placeholder .big { font-family: var(--font-serif); font-size: 20px; color: #8f8577; letter-spacing: .06em; }
.pad-placeholder .small { font-size: 11.5px; color: #aba190; letter-spacing: .02em; }


.consent { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 18px; font-size: 12.5px; line-height: 1.65; color: #5d6873; cursor: pointer; }
.consent input { appearance: none; -webkit-appearance: none; width: 19px; height: 19px; flex: none; margin: 1px 0 0; border: 1.5px solid #c9bfae; border-radius: 6px; background: #fff; position: relative; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.consent input:checked { background: var(--blue); border-color: var(--blue); }
.consent input:checked::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(42deg); }
.consent input:focus-visible { outline: 2px solid rgba(31, 58, 95, .55); outline-offset: 2px; }
.consent b { color: var(--ink-2); font-weight: 650; }

.fineprint { margin: 12px 0 0; text-align: center; font-size: 11px; color: var(--muted-2); line-height: 1.6; display: flex; align-items: center; justify-content: center; gap: 5px; }
.fineprint .ico { width: 12px; height: 12px; }

.trust-card {
  position: sticky;
  top: 22px;
  padding: 20px 19px;
  border-radius: 18px;
  border: 1px solid rgba(216, 207, 192, .8);
  background: rgba(255, 255, 255, .68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 34px rgba(23, 33, 43, .05);
}
.trust-card h3 { margin: 0 0 14px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.trust-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.trust-steps li { display: flex; gap: 10px; }
.step-ico { width: 27px; height: 27px; border-radius: 8px; flex: none; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); color: var(--blue); }
.step-ico .ico { width: 14px; height: 14px; }
.trust-steps strong { display: block; font-size: 12.5px; color: var(--ink-2); }
.trust-steps span { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.trust-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted-2); line-height: 1.65; display: flex; gap: 7px; align-items: flex-start; }
.trust-foot .ico { width: 14px; height: 14px; color: var(--green); margin-top: 1px; flex: none; }

/* Signer states / success */
.state-card { padding: 48px 34px 42px; text-align: center; }
.state-icon { width: 74px; height: 74px; margin: 0 auto 18px; border-radius: 22px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); border: 1px solid #f0dfbb; }
.state-icon .ico { width: 32px; height: 32px; }
.state-icon.red { background: var(--red-soft); color: var(--red); border-color: #efd0d0; }
.state-card h1 { margin: 0 0 8px; font-family: var(--font-serif); font-size: 28px; }
.state-card p { margin: 0 auto; max-width: 420px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.state-card .btn { margin-top: 22px; }

.success-head { text-align: center; padding: 6px 0 4px; }
.check-ring { width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 50%; background: var(--green-soft); border: 1px solid #cfe9da; display: grid; place-items: center; color: var(--green); position: relative; }
.check-ring::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 1px solid rgba(31, 122, 92, .14); }
.check-ring .ico { width: 36px; height: 36px; stroke-width: 2.2; }
.success-head h1 { margin: 0 0 7px; font-family: var(--font-serif); font-size: 31px; }
.success-head p { margin: 0 auto; max-width: 470px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.result-preview { margin: 22px 0 6px; }
.result-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; }
.result-actions .btn { flex: 1; min-width: 180px; }
.result-meta { margin: 16px 0 0; padding: 12px 14px; border-radius: 10px; background: #faf7ef; border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.result-meta code { font-family: var(--font-mono); color: var(--ink-2); }
.mail-note { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); text-align: center; display: flex; align-items: center; justify-content: center; gap: 5px; }
.mail-note .ico { width: 14px; height: 14px; }

.loading-screen { min-height: 52vh; display: grid; place-items: center; text-align: center; color: var(--muted); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #e4dccd; border-top-color: var(--blue); animation: spin .8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

.submitting-mask {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(251, 249, 244, .86);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  text-align: center;
}
.submitting-mask.show { display: grid; }
.submitting-mask .box { padding: 28px 34px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.submitting-mask h3 { margin: 0 0 6px; font-size: 17px; }
.submitting-mask p { margin: 0; font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Toast                                                               */
/* ------------------------------------------------------------------ */
.toast-host { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: 11px;
  background: rgba(23, 33, 43, .94);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.45;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: auto;
  max-width: 100%;
}
.toast.show { opacity: 1; transform: none; }
.toast-dot { width: 6px; height: 6px; border-radius: 50%; background: #9ab; flex: none; }
.toast-success .toast-dot { background: #6fd0a8; }
.toast-error .toast-dot { background: #ff8d8d; }
.toast-text { min-width: 0; }
.toast-action { border: 0; background: rgba(255, 255, 255, .16); color: #fff; border-radius: 6px; padding: 3px 8px; font-size: 11.5px; font-weight: 650; margin-left: 3px; }
.toast-action:hover { background: rgba(255, 255, 255, .26); }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 980px) {
  .signer-main { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
  .trust-card { position: static; display: grid; grid-template-columns: 1fr; }
  .trust-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .trust-foot { margin-top: 12px; }
  .sign-card { padding: 30px 30px 28px; }
}

@media (max-width: 820px) {
  .topbar-inner { padding: 0 18px; height: 62px; }
  .admin-main { padding: 30px 18px 70px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 16px; }
  .page-head h1 { font-size: 32px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .req-card { grid-template-columns: 42px minmax(0, 1fr); }
  .req-side { grid-column: 1 / -1; justify-content: space-between; padding-left: 57px; margin-top: -2px; }
  .req-expiry { text-align: left; }
  .req-avatar { width: 42px; height: 42px; }
  .drawer { width: 100%; }
}

@media (max-width: 640px) {
  .topbar .brand-sub { display: none; }
  .topbar .brand-name { font-size: 15px; }
  .signer-top { padding: 15px 16px; }
  .signer-top .brand-sub { display: none; }
  .secure-badge { font-size: 10.5px; padding: 5px 9px; }
  .signer-main { padding: 4px 12px 52px; gap: 14px; }
  .sign-card { padding: 24px 19px 22px; border-radius: 18px; }
  .sign-card h1 { font-size: 26px; }
  .sign-note { font-size: 12.5px; padding: 11px 12px; }
  .req-meta-row { gap: 9px 13px; font-size: 11.5px; }
  .sign-field .input { font-size: 16px; height: 47px; }
  .pad-wrap { aspect-ratio: 1.85 / 1; min-height: 255px; max-width: 100%; }
  .pad-head { align-items: stretch; flex-direction: column; gap: 7px; }
  .pad-tools { flex-wrap: wrap; justify-content: flex-start; width: 100%; max-width: 100%; }
  .pad-title { width: 100%; }
  .tool-btn { width: 29px; height: 28px; }
  .btn.block { height: 52px; }
  .trust-card { padding: 16px; border-radius: 15px; }
  .trust-steps { grid-template-columns: 1fr; gap: 11px; }
  .success-head h1 { font-size: 26px; }
  .result-actions .btn { min-width: 0; flex-basis: 100%; }
  .state-card { padding: 38px 20px 34px; }
  .state-card h1 { font-size: 24px; }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal { width: 100%; max-height: calc(100vh - 24px); border-radius: 18px 18px 0 0; }
  .modal-head { padding: 20px 18px 0; }
  .modal-body { padding: 16px 18px 20px; }
  .drawer-head { padding: 16px 17px; }
  .drawer-body { padding: 18px 17px 22px; }
  .drawer-foot { padding: 12px 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
  .qr-panel { flex-direction: column; align-items: flex-start; }
  .qr-panel img { width: 132px; height: 132px; }
  .login-card { padding: 30px 24px 24px; border-radius: 20px; }
  .login-card h1 { font-size: 25px; }
  .request-list .req-actions .btn span { display: none; }
  .search { width: 100%; }
  .list-toolbar { align-items: stretch; }
  .toolbar-right { width: 100%; }
  .toolbar-right .search { flex: 1; }
  .tabs { overflow-x: auto; max-width: 100%; }
  .tab { padding: 0 10px; }
}

@media (max-width: 400px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 13px; }
  .stat-num { font-size: 25px; }
  .page-head h1 { font-size: 28px; }
  .signer-main { padding-left: 9px; padding-right: 9px; }
  .sign-card { padding: 21px 15px 20px; }
  .pad-wrap { aspect-ratio: 1.65 / 1; min-height: 230px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

[hidden] { display: none !important; }

body.is-locked { overflow: hidden; }
