:root {
  color-scheme: light;
  --bg: #f4f6f4;
  --surface: #fff;
  --ink: #202d27;
  --muted: #78857d;
  --green: #288563;
  --green-dark: #1e7254;
  --green-pale: #e9f5ed;
  --border: #e7ece7;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #7ec9a3; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, p { margin-top: 0; }
.app-shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }

.sidebar { display: flex; flex-direction: column; min-height: 100vh; padding: 30px 18px 23px; border-right: 1px solid #e8ece8; background: #f9faf8; }
.brand { display: flex; align-items: center; gap: 10px; width: fit-content; margin: 0 0 56px 10px; color: var(--ink); text-decoration: none; }
.brand-name { font-size: 15px; font-weight: 760; letter-spacing: .015em; white-space: nowrap; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; width: 28px; height: 28px; padding: 6px; border-radius: 8px; background: var(--green); transform: rotate(-8deg); }
.brand-mark span { border-radius: 50%; background: #fff; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { opacity: .55; }
.nav-caption { display: block; margin: 0 0 10px 16px; color: #a4aca5; font-size: 11px; font-weight: 670; letter-spacing: .12em; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 43px; margin: 2px 0; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: #64746a; font-size: 13px; font-weight: 730; text-align: left; }
.nav-item:hover { background: #f0f5f0; }
.nav-item[aria-current="page"] { background: #e7f2e9; color: var(--green-dark); }
.nav-symbol { display: inline-flex; justify-content: center; align-items: center; width: 21px; height: 21px; border-radius: 5px; background: #d4ebda; font-size: 17px; font-weight: 750; line-height: 1; }
.sidebar-note { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 14px 9px 0; border-top: 1px solid #e8ede8; color: #829187; font-size: 11px; white-space: nowrap; }
.sidebar-note-dot { width: 7px; height: 7px; border-radius: 50%; background: #66b67f; box-shadow: 0 0 0 3px #e5f3e8; }

.content-shell { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 72px; padding: 0 clamp(26px, 5vw, 72px); border-bottom: 1px solid #e9ede9; background: rgba(255,255,255,.43); }
.breadcrumb { color: #8b998e; font-size: 12px; }
.breadcrumb span { margin: 0 8px; color: #bec8be; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid #dcebdc; border-radius: 99px; background: #f2faf3; color: #43835c; font-size: 11px; font-weight: 650; white-space: nowrap; }
.status-pill span { width: 6px; height: 6px; border-radius: 50%; background: #64b877; }
.main-content { width: min(100% - 56px, 900px); margin: 54px auto 40px; }
.page-heading { margin: 0 0 30px; }
.eyebrow { margin-bottom: 9px; color: var(--green); font-size: 11px; font-weight: 760; letter-spacing: .16em; }
.page-heading h1 { margin-bottom: 8px; font-size: clamp(30px, 3vw, 39px); font-weight: 760; letter-spacing: -.045em; line-height: 1.3; }
.page-heading p { margin-bottom: 0; color: var(--muted); font-size: 13px; }

.tool-card { padding: clamp(27px, 4vw, 44px); border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 13px 40px rgba(34,64,42,.035); }
.card-heading, .result-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.step-label { display: block; margin-bottom: 7px; color: var(--green); font-size: 10px; font-weight: 760; letter-spacing: .12em; }
.card-heading h2, .result-heading h2 { margin-bottom: 6px; font-size: 21px; font-weight: 750; letter-spacing: -.025em; }
.card-heading p { margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.card-icon { display: flex; justify-content: center; align-items: center; flex: none; width: 39px; height: 39px; border-radius: 10px; background: var(--green-pale); color: var(--green); font-size: 29px; font-weight: 700; line-height: 1; }
.input-section { margin-top: 30px; }
.input-section label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 710; }
.input-section input { display: block; width: 100%; height: 52px; padding: 0 15px; border: 1px solid #d9e1d9; border-radius: 9px; outline: none; background: #fff; color: var(--ink); font-size: 14px; transition: border-color .18s, box-shadow .18s; }
.input-section input::placeholder { color: #abb5ac; }
.input-section input:focus { border-color: #75b892; box-shadow: 0 0 0 4px #eaf6ed; }
.field-help { margin: 8px 0 0; color: #94a097; font-size: 11px; }
.field-error { margin: 10px 0 0; color: #ac4d4d; font-size: 12px; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; margin-top: 23px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 30px; min-height: 43px; padding: 10px 17px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 740; transition: background .18s, border-color .18s, transform .18s; }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(40,133,99,.14); }
.button-primary:hover { background: var(--green-dark); }
.button-primary span { font-size: 18px; font-weight: 400; line-height: .7; }
.button-secondary { border-color: #e1e8e1; background: #fff; color: #68766b; }
.button-secondary:hover { background: #f5f8f5; }
.section-divider { height: 1px; margin: 36px 0 30px; background: #edf0ed; }
.result-heading { align-items: end; margin-bottom: 16px; }
.result-heading h2 { margin-bottom: 0; }
.result-hint { margin-bottom: 3px; color: #94a197; font-size: 11px; white-space: nowrap; }
.result-box { padding: 25px 27px 20px; border: 1px solid #e4ebe5; border-radius: 10px; background: #fafcf9; }
.result-main { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.result-label { display: block; color: #8c9b8e; font-size: 11px; font-weight: 650; }
.code-output { min-height: 66px; padding-top: 9px; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: clamp(32px, 4vw, 48px); font-weight: 720; letter-spacing: .08em; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.countdown-block { display: flex; flex-direction: column; align-items: flex-end; flex: none; padding-bottom: 6px; color: #8b988c; font-size: 11px; white-space: nowrap; }
.countdown-block strong { color: var(--green); font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.countdown-block small { margin-left: 2px; font-size: 11px; font-weight: 500; }
.progress-track { overflow: hidden; height: 5px; margin-top: 19px; border-radius: 99px; background: #e6eee6; }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .4s linear; }
.privacy-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 21px; padding: 13px 15px; border-radius: 8px; background: #f4f8f3; }
.privacy-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px; margin-top: 1px; border: 1px solid #8db499; border-radius: 50%; color: #539169; font-family: Georgia, serif; font-size: 11px; font-style: italic; font-weight: 700; }
.privacy-note p { margin-bottom: 0; color: #6b8370; font-size: 11px; line-height: 1.7; }
.page-footer { margin-top: 19px; color: #a0aaa1; font-size: 11px; text-align: center; }

.transfer-start { margin-top: 30px; }
.pair-layout { display: grid; grid-template-columns: minmax(180px, 270px) 1fr; align-items: center; gap: 28px; margin-top: 27px; }
.qr-frame { display: flex; justify-content: center; align-items: center; padding: 14px; border: 1px solid #e3ebe4; border-radius: 11px; background: #fff; }
.qr-frame canvas { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }
.pair-instructions strong { display: block; margin-bottom: 9px; font-size: 17px; }
.pair-instructions p { margin-bottom: 17px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.pair-instructions .expiry-line { margin-bottom: 15px; }
.transfer-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 31px 0 14px; padding-top: 27px; border-top: 1px solid var(--border); }
.transfer-toolbar h3 { margin: 0 0 4px; font-size: 17px; }
.transfer-toolbar p { margin: 0; color: var(--muted); font-size: 11px; }
.entry-count { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 99px; background: var(--green-pale); color: var(--green-dark); font-size: 11px; text-align: center; vertical-align: 1px; }
.entries-list { display: grid; gap: 13px; }
.empty-state { margin: 0; padding: 25px; border: 1px dashed #dbe7dd; border-radius: 10px; color: var(--muted); text-align: center; font-size: 12px; }
.entry-card { overflow: hidden; padding: 19px; border: 1px solid #e1e9e2; border-radius: 10px; background: #fcfdfb; }
.entry-header { display: flex; justify-content: space-between; align-items: start; gap: 15px; margin-bottom: 15px; }
.entry-header strong { overflow-wrap: anywhere; font-size: 15px; }
.entry-header time { flex: none; color: var(--muted); font-size: 11px; }
.entry-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 16px; margin: 0; }
.entry-fields div { min-width: 0; }
.entry-fields dt { color: var(--muted); font-size: 11px; }
.entry-fields dd { margin: 3px 0 0; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.entry-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.entry-actions .button { min-height: 36px; padding: 8px 12px; }
.button-danger { border-color: #f0d4d2; background: #fff; color: #a34948; }
.button-danger:hover { background: #fff4f3; }
.end-session-row { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.transfer-form { display: grid; gap: 17px; margin-top: 28px; }
.form-field label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 710; }
.form-field input { display: block; width: 100%; height: 49px; padding: 0 14px; border: 1px solid #d9e1d9; border-radius: 9px; outline: none; background: #fff; color: var(--ink); font-size: 14px; }
.form-field input::placeholder { color: #abb5ac; }
.form-field input:focus { border-color: #75b892; box-shadow: 0 0 0 4px #eaf6ed; }
.transfer-form .action-row { margin-top: 6px; }
.transfer-message { margin: 17px 0 0; color: var(--green-dark); font-size: 12px; font-weight: 650; }
.transfer-message.error { color: #ac4d4d; }
button:disabled { opacity: .58; cursor: wait; }

@media (max-width: 850px) {
  .app-shell { grid-template-columns: 182px minmax(0, 1fr); }
  .sidebar { padding-right: 12px; padding-left: 12px; }
  .brand { margin-left: 5px; }
  .main-content { width: min(100% - 36px, 740px); margin-top: 36px; }
  .topbar { padding: 0 25px; }
}

@media (max-width: 650px) {
  .app-shell { display: block; }
  .sidebar { flex-direction: row; align-items: center; justify-content: space-between; min-height: 0; padding: 15px 18px; border-right: 0; border-bottom: 1px solid #e8ece8; }
  .brand { margin: 0; }
  .side-nav { display: none; }
  .sidebar-note { margin: 0; padding: 0; border: 0; font-size: 10px; }
  .side-nav { display: flex; gap: 5px; margin-left: auto; }
  .side-nav .nav-caption, .side-nav .nav-symbol { display: none; }
  .side-nav .nav-item { width: auto; min-height: 32px; padding: 0 8px; font-size: 11px; white-space: nowrap; }
  .sidebar-note { display: none; }
  .topbar { display: none; }
  .main-content { width: min(100% - 28px, 560px); margin: 31px auto 30px; }
  .page-heading { margin-bottom: 23px; padding: 0 3px; }
  .page-heading h1 { font-size: 29px; }
  .tool-card { padding: 25px 20px; }
  .result-box { padding: 20px; }
  .code-output { font-size: clamp(29px, 7.5vw, 42px); }
  .pair-layout { grid-template-columns: 1fr; gap: 20px; }
  .qr-frame { width: min(100%, 300px); margin: 0 auto; }
  .entry-header { display: block; }
  .entry-header time { display: block; margin-top: 3px; }
  .entry-fields { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .brand-name { font-size: 14px; }
  .sidebar-note { max-width: 85px; white-space: normal; line-height: 1.3; }
  .card-icon { width: 34px; height: 34px; font-size: 25px; }
  .result-main { align-items: start; flex-direction: column; gap: 8px; }
  .countdown-block { flex-direction: row; align-items: baseline; gap: 8px; padding-bottom: 0; }
  .countdown-block strong { font-size: 21px; }
  .progress-track { margin-top: 15px; }
}

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