:root {
  color-scheme: light;
  --bg: #f2f5f4;
  --panel: #ffffff;
  --ink: #17221f;
  --muted: #60716d;
  --line: #d9e2df;
  --accent: #0f766e;
  --accent-dark: #0b625b;
  --warn: #93410b;
  --warn-bg: #fff7ed;
  --red: #b93335;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1,
h2,
p {
  margin: 0;
}

button,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

button {
  min-height: 44px;
  cursor: pointer;
  font-weight: 800;
}

input {
  min-height: 44px;
  padding: 0 12px;
}

input[readonly],
input.is-readonly {
  color: #6e7774;
  background: #f2f5f4;
  cursor: not-allowed;
}

textarea {
  min-height: 118px;
  padding: 12px;
  line-height: 1.5;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: #3e4e4a;
  font-size: 14px;
  font-weight: 800;
}

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding-bottom: 28px;
}

.home-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.home-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.home-head h1 {
  margin-top: 6px;
  max-width: 620px;
}

.status-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #f0c38a;
  border-radius: 8px;
  background: #fff8ec;
  color: #8a4108;
  font-size: 13px;
  font-weight: 800;
}

.home-head-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  position: relative;
}

.global-profile {
  position: fixed;
  top: 18px;
  right: max(18px, calc((100vw - 980px) / 2 + 18px));
  z-index: 60;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quick-card {
  display: grid;
  align-content: center;
  justify-items: start;
  min-height: 112px;
  padding: 16px;
  color: #ffffff;
  background: #b93335;
  border: 0;
  text-align: left;
}

.quick-card-alt {
  background: #0f766e;
}

.quick-card strong {
  font-size: 22px;
}

.quick-card span {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  opacity: 0.9;
}

.profile-menu-wrap {
  position: relative;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 900;
}

.profile-avatar.is-unverified {
  border: 1px solid #f0c38a;
  background: #fff8ec;
  color: #8a4108;
}

.profile-avatar.is-verified {
  border: 1px solid #9dcfc1;
  background: #effbf7;
  color: #0f766e;
}

.profile-menu {
  position: absolute;
  top: 50px;
  right: 0;
  width: 190px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(13, 25, 49, 0.14);
  z-index: 20;
}

.profile-menu-head {
  display: grid;
  gap: 4px;
  padding: 8px 8px 10px;
  border-bottom: 1px solid var(--line);
}

.profile-menu-head strong {
  color: #1f2e36;
  font-size: 14px;
}

.profile-menu-head span {
  color: #6a7773;
  font-size: 13px;
  font-weight: 800;
}

.profile-menu button {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1f2e36;
  text-align: left;
  font-weight: 900;
}

.profile-menu button:hover {
  background: #f4f7f6;
}

.profile-modal-card {
  max-width: 420px;
}

.profile-modal-card .qr-modal-head {
  display: grid;
  grid-template-columns: auto 1fr 38px;
  align-items: center;
}

.profile-detail-avatar {
  justify-self: center;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #effbf7;
  border: 1px solid #9dcfc1;
  color: #0f766e;
  font-size: 14px;
  font-weight: 900;
}

.profile-detail-avatar.is-unverified {
  background: #fff8ec;
  border-color: #f0c38a;
  color: #8a4108;
}

.profile-modal-close {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: #1f2e36;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.profile-detail-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.profile-detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border-radius: 8px;
  background: #f7faf9;
}

.profile-detail-list span {
  color: #6a7773;
  font-weight: 800;
}

.profile-detail-list strong {
  color: #1f2e36;
  text-align: right;
}

.profile-logout-button {
  width: 100%;
  margin-top: 14px;
}

.borrow-tip {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid #efd0a3;
  border-radius: 8px;
  background: #fffaf2;
}

.borrow-tip div {
  display: grid;
  gap: 4px;
}

.borrow-tip span {
  color: #7a5a2b;
  font-size: 14px;
}

.mini-button {
  width: auto;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #b93335;
  color: #b93335;
  background: #ffffff;
}

.top-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 18px;
  align-items: stretch;
  padding: 24px 18px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.top-copy {
  display: grid;
  align-content: center;
  gap: 8px;
}

.eyebrow {
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

h1 {
  font-size: 28px;
  line-height: 1.25;
}

h2 {
  font-size: 19px;
}

.status-text,
.section-head p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.process-photo {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  background: #e8eeec;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stats-row span,
.tag-box span {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 8px;
  border: 1px solid #e1e6e4;
  border-radius: 8px;
  background: #fbfcfc;
  color: #60716d;
  font-size: 13px;
  text-align: center;
}

.stats-row strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
}

.tag-box {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.select-identity-page {
  min-height: 430px;
  padding: 22px 18px 90px;
  background: #f2f5f4;
  border-bottom: 1px solid var(--line);
}

.select-signer-page {
  min-height: 100vh;
  padding: 12px 14px 40px;
  background: #f4f5f7;
}

.select-identity-page h2 {
  margin: 8px 0 22px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.identity-card-list {
  display: grid;
  gap: 18px;
}

.identity-option {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-areas:
    "mark title"
    "mark note";
  align-items: center;
  justify-items: start;
  min-height: 92px;
  padding: 18px;
  background: #ffffff;
  text-align: left;
}

.identity-mark {
  grid-area: mark;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #ffffff;
  background: #0f766e;
  font-size: 14px;
  font-weight: 900;
}

.identity-option strong {
  grid-area: title;
  color: #17221f;
  font-size: 17px;
}

.identity-option span:last-child {
  grid-area: note;
  margin-top: 5px;
  color: #81908c;
  font-size: 14px;
}

.identity-back {
  margin-top: 28px;
  color: #1667fe;
  background: #ffffff;
}

.ledger-page {
  min-height: 100vh;
  padding-bottom: 42px;
  background: #f4f6fb;
}

.ledger-titlebar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 12px 10px 10px;
  background: #ffffff;
  text-align: center;
}

.ledger-titlebar strong {
  display: block;
  color: #1f2e36;
  font-size: 16px;
}

.ledger-titlebar span {
  color: #8a96a3;
  font-size: 11px;
}

.ledger-icon-button,
.ledger-delete {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #25323a;
  font-size: 23px;
  line-height: 1;
}

.ledger-bluebar {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px 12px;
  background: #1767ff;
}

.ledger-mode-tabs {
  justify-self: center;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(230px, 70vw);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 4px;
}

.ledger-mode {
  min-height: 30px;
  border: 0;
  border-radius: 0;
  color: #ffffff;
  background: transparent;
  font-size: 14px;
}

.ledger-mode.active {
  color: #1767ff;
  background: #ffffff;
}

.ledger-delete {
  color: #ffffff;
  font-size: 18px;
}

.ledger-delete.active {
  background: rgba(255, 255, 255, 0.18);
}

.ledger-status-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: #1767ff;
}

.ledger-status {
  min-height: 42px;
  border: 0;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  font-size: 13px;
}

.ledger-status.active {
  color: #ffffff;
}

.ledger-status.active::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto 0;
  border-radius: 999px;
  background: #ffffff;
}

.ledger-sort-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #ffffff;
  border-bottom: 1px solid #edf1f6;
}

.ledger-sort-row button {
  min-height: 38px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #7b8794;
  font-size: 12px;
  font-weight: 700;
}

.ledger-sort-row button.active {
  color: #1767ff;
}

.ledger-search {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 0;
  align-items: center;
  margin: 0;
  padding: 10px 14px;
  background: #ffffff;
}

.ledger-search input {
  border: 0;
  border-radius: 0;
  background: #fafbfe;
  color: #1f2e36;
}

.ledger-search span {
  display: grid;
  place-items: center;
  min-height: 44px;
  background: #fafbfe;
  color: #8a96a3;
  font-size: 22px;
}

.ledger-summary {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 18px;
  align-items: center;
  margin: 12px 14px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #eaf2ff;
  color: #506074;
  font-size: 13px;
}

.ledger-summary strong {
  margin: 0 4px;
  color: #1d5fbf;
  font-size: 16px;
}

.ledger-summary i {
  width: 1px;
  height: 18px;
  background: #c5d6ef;
}

.ledger-list {
  display: grid;
  gap: 10px;
  padding: 0 14px;
}

.ledger-card {
  display: grid;
  gap: 12px;
  padding: 16px 14px;
  border: 1px solid transparent;
  border-radius: 0;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(23, 34, 31, 0.04);
  text-align: left;
}

.ledger-card.selectable {
  border-color: #d8e4f7;
}

.ledger-card.selected {
  border-color: #1767ff;
  background: #f7fbff;
}

.ledger-card-head,
.ledger-card-money,
.ledger-card-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.ledger-card-head strong {
  color: #263642;
  font-size: 15px;
}

.ledger-card-head strong::before {
  content: "▸";
  margin-right: 4px;
  color: #1767ff;
}

.ledger-card-status {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #6378a0;
  font-size: 13px;
  font-weight: 800;
}

.ledger-card-status i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #9eb5d8;
  border-radius: 4px;
  color: #1767ff;
  font-style: normal;
  font-size: 12px;
  line-height: 1;
}

.ledger-card-money strong {
  color: #202d35;
  font-size: 19px;
}

.ledger-card-money span,
.ledger-card-grid span {
  color: #5f6d78;
  font-size: 13px;
}

.ledger-card-grid {
  align-items: start;
}

.ledger-card-grid div {
  display: grid;
  gap: 8px;
}

.ledger-empty {
  padding: 22px 0 40px;
  color: #9aa4af;
  text-align: center;
  font-size: 14px;
}

.ledger-detail-page {
  padding-bottom: 52px;
}

.ledger-detail-no {
  padding: 12px 14px;
  color: #45515d;
  background: #ffffff;
  font-size: 13px;
}

.ledger-party-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 92px;
  gap: 10px;
  padding: 14px;
}

.ledger-party-card {
  display: grid;
  gap: 6px;
  min-height: 94px;
  padding: 12px;
  border-radius: 8px;
  background: #ffffff;
  color: #2a3640;
}

.ledger-party-card strong {
  font-size: 14px;
}

.ledger-party-card small {
  margin-top: 4px;
  color: #8a96a3;
  font-size: 11px;
}

.ledger-party-card span:last-child {
  color: #65727f;
  font-size: 12px;
  word-break: break-all;
}

.ledger-party-badge {
  justify-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
}

.ledger-party-badge.borrower {
  background: #16b889;
}

.ledger-party-badge.lender {
  background: #f0a12b;
}

.ledger-status-card {
  place-items: center;
  color: #3567b7;
  font-weight: 900;
}

.ledger-detail-panel {
  margin: 0 14px;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
}

.ledger-detail-panel h3 {
  margin: 0;
  padding: 16px 14px 8px;
  color: #25313a;
  font-size: 20px;
}

.ledger-detail-panel dl {
  margin: 0;
}

.ledger-detail-row {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  align-items: center;
  border-top: 1px solid #eef1f5;
}

.ledger-detail-row dt {
  color: #5b6874;
  font-size: 14px;
}

.ledger-detail-row dd {
  margin: 0;
  color: #9aa2ab;
  text-align: right;
  font-size: 14px;
}

.ledger-detail-link {
  width: auto;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2272d8;
  font-size: 14px;
}

.ledger-dispute-link {
  padding: 18px 0 36px;
  color: #2272d8;
  text-align: center;
  font-size: 14px;
}

.ledger-summary-page {
  min-height: 100vh;
  padding-bottom: 52px;
  background: #f4f6fb;
}

.ledger-summary-titlebar {
  border-bottom: 1px solid #eef1f5;
}

.ledger-summary-list {
  background: #ffffff;
}

.ledger-summary-entry {
  display: grid;
  gap: 28px;
  padding: 28px 14px 24px;
  border-bottom: 1px solid #eef1f5;
  background: #ffffff;
}

.ledger-summary-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.ledger-summary-entry-head strong {
  color: #2d3034;
  font-size: clamp(28px, 8vw, 40px);
  font-weight: 500;
  line-height: 1.15;
}

.ledger-summary-entry-head span {
  color: #2d3034;
  font-size: clamp(30px, 8vw, 42px);
  font-weight: 400;
  line-height: 1;
  text-align: right;
}

.ledger-summary-entry-head .ledger-summary-entry-meta {
  max-width: 58%;
  font-size: clamp(20px, 5vw, 30px);
  line-height: 1.2;
}

.ledger-summary-entry time {
  color: #96999d;
  font-size: clamp(24px, 6.5vw, 34px);
  line-height: 1.2;
}

.status-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.local-auth-page {
  min-height: 100vh;
  padding: 42px 18px;
  background: #f4f6fb;
}

.local-auth-card {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 18px 20px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 34px rgba(33, 47, 64, 0.08);
}

.local-auth-head h1 {
  margin: 4px 0 8px;
  color: #1f2e36;
  font-size: 30px;
  line-height: 1.15;
}

.local-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 22px 0 18px;
  padding: 4px;
  border-radius: 8px;
  background: #eef3fb;
}

.local-auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #617086;
  font-weight: 900;
}

.local-auth-tabs button.active {
  background: #ffffff;
  color: #1767ff;
}

.local-auth-form {
  display: grid;
  gap: 14px;
}

.local-auth-form label {
  display: grid;
  gap: 7px;
  color: #536171;
  font-size: 13px;
  font-weight: 800;
}

.local-auth-form input {
  min-height: 46px;
  border: 1px solid #dce5f1;
  border-radius: 8px;
  background: #fbfcff;
  color: #1f2e36;
  font-size: 15px;
}

.status-item {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #cfd9d6;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  background: var(--panel);
}

.status-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 8px;
  background: #95a6a1;
}

.status-item.done {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: #e5f4f1;
}

.status-item.done::before {
  background: var(--accent);
}

.section {
  padding: 18px;
  margin-top: 10px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.auth-page {
  min-height: calc(100vh - 58px);
  margin-top: 0;
  padding-top: 24px;
}

.loan-form-page {
  min-height: 100vh;
  margin-top: 0;
  padding: 12px 14px 40px;
  background: #f4f5f7;
  border: 0;
}

.note-confirm-page {
  min-height: 100vh;
  margin-top: 0;
  padding: 12px 14px 40px;
  background: #f4f5f7;
  border: 0;
}

.loan-page-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  min-height: 52px;
  margin-bottom: 12px;
}

.loan-head-button,
.loan-head-more {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #20242b;
  background: transparent;
  border: 0;
  font-size: 24px;
}

.loan-head-button {
  padding: 0;
}

.loan-head-more {
  justify-self: end;
  font-size: 20px;
  letter-spacing: 0;
}

.loan-page-title {
  text-align: center;
}

.loan-page-title h2 {
  font-size: 19px;
}

.loan-page-title p {
  margin-top: 4px;
  color: #8a919d;
  font-size: 12px;
}

.loan-sheet {
  margin-top: 12px;
  padding: 0 14px;
  border-radius: 8px;
  background: #ffffff;
}

.loan-sheet-sub {
  margin-top: 10px;
}

.loan-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 18px;
  align-items: center;
  min-height: 54px;
  gap: 8px;
  border-bottom: 1px solid #edf0f4;
}

.loan-row:last-child {
  border-bottom: 0;
}

.loan-row-flat {
  grid-template-columns: 80px minmax(0, 1fr);
}

.loan-label {
  color: #333945;
  font-size: 15px;
}

.loan-input,
.loan-date-input {
  width: 100%;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1f2430;
  font-size: 15px;
  text-align: right;
}

.loan-input::placeholder,
.loan-date-input::placeholder,
.loan-reason-detail textarea::placeholder {
  color: #b3b8c2;
}

.loan-input:focus,
.loan-date-input:focus,
.loan-reason-detail textarea:focus {
  outline: none;
}

.loan-input-right {
  text-align: right;
}

.loan-arrow {
  color: #b6bcc8;
  font-size: 20px;
  text-align: right;
}

.loan-unit-field {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.loan-unit,
.loan-static-value {
  color: #1f2430;
  font-size: 15px;
}

.loan-static-value {
  justify-self: end;
}

.loan-date-input {
  color: #606776;
}

.loan-reason-head {
  padding: 16px 0 10px;
  color: #2e3440;
  font-size: 15px;
  font-weight: 700;
}

.loan-reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
}

.loan-reason-chip {
  width: auto;
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #687180;
  background: #f1f3f7;
  font-size: 14px;
  font-weight: 700;
}

.loan-reason-chip.active {
  color: #ffffff;
  background: #1f6fff;
}

.loan-reason-detail {
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
  color: #2e3440;
  font-size: 15px;
  font-weight: 700;
}

.loan-reason-detail textarea {
  min-height: 110px;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: #f4f5f7;
  color: #1f2430;
  resize: none;
}

.loan-next-button {
  margin-top: 18px;
  color: #ffffff;
  background: #1f6fff;
  border: 0;
}

.note-confirm-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  background: #ffffff;
}

.note-confirm-summary {
  color: #252b35;
  font-size: 15px;
  line-height: 1.7;
}

.note-confirm-summary strong {
  color: #1e2430;
}

.note-party-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
}

.note-party-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border: 0;
  border-top: 1px solid #edf0f4;
  background: transparent;
  text-align: left;
}

.note-party-item strong,
.note-party-item span {
  display: block;
}

.note-party-item strong {
  color: #313744;
  font-size: 15px;
}

.note-party-item div > span {
  margin-top: 6px;
  color: #8c95a3;
  font-size: 13px;
}

.note-agreement {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  color: #5d6574;
  font-size: 14px;
  font-weight: 600;
}

.note-agreement input {
  width: 18px;
  min-height: 18px;
  accent-color: #1f6fff;
}

.note-agreement a {
  color: #2e70ff;
  text-decoration: none;
}

.agreement-name-button,
.agreement-open-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2e70ff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.note-platform-tip {
  margin: 12px 0 0;
  color: #e25d54;
  font-size: 13px;
  text-align: center;
}

.scan-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.scan-primary-button,
.scan-secondary-button {
  min-height: 44px;
  border-radius: 999px;
  font-weight: 800;
}

.scan-primary-button {
  color: #ffffff;
  background: #1f6fff;
  border: 0;
}

.scan-secondary-button {
  color: #2e70ff;
  background: #ffffff;
  border: 1px solid #7ab0ff;
}

.signer-tip {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7f8;
  color: #d24859;
  font-size: 13px;
  line-height: 1.5;
}

.signer-tip-icon {
  display: grid;
  place-items: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 999px;
  color: #ffffff;
  background: #ff707f;
  font-size: 11px;
  font-weight: 700;
}

.signer-hint {
  margin: 12px 2px 0;
  color: #9ca3af;
  font-size: 12px;
}

.recent-section {
  margin-top: 18px;
}

.recent-section h3 {
  margin: 0 0 12px;
  color: #1f2430;
  font-size: 17px;
}

.recent-table-head,
.recent-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.recent-table-head {
  padding: 0 2px 10px;
  color: #2e70ff;
  font-size: 14px;
  font-weight: 700;
}

.recent-list {
  display: grid;
  gap: 10px;
}

.recent-item {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  color: #303646;
  background: #ffffff;
  text-align: left;
}

.recent-item span:last-child {
  color: #6e7684;
  font-size: 14px;
}

.recent-empty {
  padding: 20px 0;
  color: #a3a9b5;
  font-size: 14px;
}

.section-head {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.id-grid,
.form-grid,
.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.button-row {
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
}

.upload-tile {
  position: relative;
  min-height: 112px;
  place-items: center;
  border: 1px dashed #9eb2ad;
  border-radius: 8px;
  background: #f7faf9;
  color: var(--muted);
  text-align: center;
  overflow: hidden;
}

.upload-tile input {
  display: none;
}

.upload-tile.has-file {
  border-style: solid;
}

.upload-tile.has-file span {
  display: none;
}

.upload-preview,
.video-preview {
  width: 100%;
  height: 132px;
  object-fit: cover;
  border-radius: 8px;
}

.video-tile {
  min-height: 150px;
}

.video-tile .video-preview {
  height: 170px;
}

.primary-button {
  margin-top: 12px;
  color: #ffffff;
  background: var(--accent);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.secondary-button {
  margin-top: 12px;
  color: var(--ink);
  background: #edf2f0;
}

.success-line {
  margin-top: 10px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
}

#signatureCanvas,
#inviteSignatureCanvas {
  display: block;
  width: 100%;
  height: 220px;
  border: 1px solid #cfd9d6;
  border-radius: 8px;
  background: #ffffff;
  touch-action: none;
}

.signature-modal-card {
  width: min(100%, 520px);
}

.signature-modal-copy {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.signature-modal-actions {
  margin-top: 12px;
}

.evidence-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: #f7faf9;
  color: #263632;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-all;
}

.agreement-downloads {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #dbe8e1;
}

.agreement-downloads strong {
  color: #1e312b;
  font-size: 14px;
}

.agreement-download-button {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #bcd5ca;
  border-radius: 10px;
  background: #ffffff;
  color: #1d5a48;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.note-preview {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e2d4bf;
  border-radius: 8px;
  background: #fffaf2;
  color: #263632;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.65;
}

.note-preview strong {
  color: #b93335;
}

.check-row {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.agreement-files {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.agreement-modal-card {
  width: min(100%, 720px);
  max-height: min(84vh, 760px);
  align-content: start;
  justify-items: stretch;
  text-align: left;
  overflow: hidden;
}

.agreement-doc-list {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
}

.agreement-doc-button {
  width: 100%;
  padding: 16px;
  border: 1px solid #dfe7f2;
  border-radius: 14px;
  background: #f8fbff;
  color: #263245;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.agreement-doc-button span {
  display: block;
  margin-top: 5px;
  color: #7a8594;
  font-size: 12px;
  font-weight: 600;
}

.agreement-detail {
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

.agreement-detail h4 {
  margin: 10px 0;
  color: #222b38;
  font-size: 17px;
}

.agreement-detail pre {
  max-height: min(64vh, 560px);
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid #e2e9f2;
  border-radius: 14px;
  background: #fbfcf8;
  color: #2f3b45;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.agreement-back-button {
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid #dce6f0;
  border-radius: 999px;
  background: #ffffff;
  color: #425269;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.qr-panel {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #d7e4ff;
  border-radius: 8px;
  background: #f5f8ff;
  text-align: center;
}

.qr-panel h3 {
  margin: 0;
  font-size: 16px;
}

.qr-image {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  background: #ffffff;
}

.qr-link {
  max-width: 100%;
  color: #50615d;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}

.qr-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 24, 32, 0.54);
  z-index: 40;
}

.qr-modal-card {
  width: min(100%, 360px);
  margin-top: 0;
  padding: 18px;
  border: 0;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(13, 25, 49, 0.18);
}

.qr-modal-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.qr-modal-head h3 {
  margin: 0;
  font-size: 16px;
}

.message {
  position: sticky;
  bottom: 0;
  padding: 12px 18px;
  background: var(--warn-bg);
  border-top: 1px solid #f2c28b;
  color: var(--warn);
  font-size: 14px;
  line-height: 1.4;
}

@media (max-width: 700px) {
  .home-head,
  .quick-grid,
  .stats-row,
  .tag-box,
  .top-band,
  .id-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .home-head {
    display: grid;
  }

  .status-pill {
    width: fit-content;
  }

  .home-head-actions {
    justify-content: flex-end;
  }
}
