:root {
  color-scheme: light;
  --ink: #202921;
  --muted: #68716a;
  --paper: #f6f7f4;
  --green: #c3f268;
  --line: #dce0d9;
  font-family: "Segoe UI", "Yu Gothic UI", Meiryo, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; background: var(--paper); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }
.skip-link { position: absolute; z-index: 10; top: 8px; left: 8px; padding: 12px 16px; transform: translateY(-150%); background: var(--green); }
.skip-link:focus { transform: translateY(0); }
.topbar { position: sticky; z-index: 4; top: 0; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(30px, calc((100vw - 1160px) / 2)); border-bottom: 1px solid rgb(32 41 33 / 9%); background: rgb(246 247 244 / 94%); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.brand-icon { width: 28px; height: 28px; display: inline-flex; color: #47703a; }
.brand-icon svg { width: 100%; height: 100%; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -.08em; }
.brand-name span { color: #76aa41; }
.brand-product { margin-left: 11px; padding-left: 12px; border-left: 1px solid #d6dcd3; color: #768076; font: 8px "Cascadia Mono", Consolas, monospace; letter-spacing: .1em; }
.header-actions { display: flex; align-items: center; gap: 17px; }
.vault-state { display: inline-flex; align-items: center; gap: 7px; color: #69766a; font-size: 10px; }
.state-dot { width: 7px; height: 7px; border-radius: 50%; background: #b6bcb4; }
.vault-state.is-unlocked .state-dot { background: #6caa50; box-shadow: 0 0 0 3px rgb(108 170 80 / 13%); }
.vault-state.is-locked .state-dot { background: #c39350; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 17px; padding: 0 19px; border: 1px solid transparent; border-radius: 3px; cursor: pointer; font-size: 11px; font-weight: 700; transition: background .16s ease, transform .16s ease, border-color .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .icon-button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #8dbd60; outline-offset: 3px; }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button-primary { background: var(--green); color: #23301d; }
.button-primary:hover { background: #d3fb8f; }
.button-small { min-height: 34px; padding: 0 12px; font-size: 10px; }
.button-quiet { border-color: #d6dcd3; background: transparent; color: #3b453c; }
.button-quiet:hover { background: #ebeee8; }
.button-add { min-height: 39px; border-color: #cfddc4; background: #edf4e8; color: #3e6334; }
.button-add:hover { background: #e2efd9; }
.panel-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }

main { width: min(1120px, calc(100% - 60px)); margin: auto; }
.intro { min-height: 320px; position: relative; display: flex; align-items: center; justify-content: space-between; overflow: hidden; padding: 50px 9.3%; background: #19251e; color: #f6f7f4; }
.intro::after { content: ""; position: absolute; width: 480px; height: 480px; top: -190px; right: -45px; border: 1px solid rgb(195 242 104 / 10%); border-radius: 50%; box-shadow: 0 0 0 37px rgb(195 242 104 / 2%), 0 0 0 75px rgb(195 242 104 / 2%); }
.intro-copy { position: relative; z-index: 1; }
.eyebrow, .section-label, .step-num { font: 9px "Cascadia Mono", Consolas, monospace; letter-spacing: .11em; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: #bac9ba; }
.eyebrow span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgb(195 242 104 / 60%); }
.intro h1 { margin: 22px 0 12px; font-size: clamp(35px, 4.5vw, 51px); line-height: 1.42; letter-spacing: -.06em; font-weight: 600; }
.intro h1 span { color: var(--green); }
.intro-copy > p { margin: 0; color: #c0cbc1; font-size: 11px; line-height: 2; }
.intro-badge { position: relative; z-index: 1; width: 174px; height: 174px; flex: 0 0 174px; display: grid; place-items: center; margin-right: 4%; border: 1px solid rgb(201 225 188 / 19%); border-radius: 50%; }
.badge-orbit { position: absolute; inset: 14px; border: 1px dashed rgb(201 225 188 / 26%); border-radius: 50%; }
.badge-shield { width: 65px; height: 65px; display: grid; place-items: center; border: 1px solid rgb(195 242 104 / 23%); border-radius: 21px; background: rgb(195 242 104 / 8%); color: var(--green); transform: rotate(-5deg); }
.badge-shield svg { width: 43px; }
.badge-caption { position: absolute; bottom: 16px; color: #9aab9a; font: 7px "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; }

.vault-panel { min-height: 265px; margin-top: 28px; padding: 29px 35px 22px; border: 1px solid #e1e5df; border-radius: 4px; background: #fff; box-shadow: 0 8px 26px rgb(38 53 39 / 3%); }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding-bottom: 19px; border-bottom: 1px solid #eaede8; }
.section-label { color: #778279; }
.section-label > span { padding-right: 8px; color: #70964f; }
.panel-heading h2 { margin: 8px 0 0; font-size: 21px; letter-spacing: -.045em; }
.notice { margin: 17px 0 0; padding: 11px 13px; border: 1px solid #e7d4b0; border-radius: 3px; background: #fff9ec; color: #70552b; font-size: 11px; line-height: 1.7; }
.notice.is-error, .dialog-error { border-color: #e7bdb7; background: #fff3f1; color: #863e35; }
.gate-card { width: min(100%, 420px); margin: 32px auto 22px; }
.gate-icon { width: 37px; height: 37px; display: grid; place-items: center; margin-bottom: 18px; border: 1px solid #dce7d5; border-radius: 50%; color: #779c5c; font-size: 19px; }
.gate-card .section-label { color: #779569; }
.gate-card h3, .empty-state h3 { margin: 8px 0; font-size: 18px; letter-spacing: -.04em; }
.gate-card > p, .empty-state > p { margin: 0; color: #758076; font-size: 11px; line-height: 1.8; }
.form-stack { display: flex; flex-direction: column; align-items: stretch; margin-top: 20px; }
label { margin: 11px 0 7px; color: #3a443b; font-size: 10px; font-weight: 700; }
label > span { padding-left: 5px; color: #8b938b; font-size: 9px; font-weight: 400; }
input, textarea, select { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #d9dfd7; border-radius: 3px; background: #fff; color: var(--ink); font-size: 12px; }
input::placeholder, textarea::placeholder { color: #a0a8a0; }
.form-stack > .button { align-self: flex-start; margin-top: 20px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 16px; color: #667167; font-size: 10px; line-height: 1.7; font-weight: 400; }
.check-row input { width: 15px; min-height: 15px; flex: 0 0 15px; margin: 1px 0 0; accent-color: #739a55; }
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 37px 10px 30px; text-align: center; }
.empty-symbol { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #dce7d5; border-radius: 50%; color: #709650; font-size: 20px; }
.empty-state h3 { margin-top: 14px; }
.empty-state > .button { margin-top: 19px; }
.account-list { display: grid; gap: 9px; padding-top: 16px; }
.account-card { min-height: 90px; position: relative; display: grid; grid-template-columns: 41px minmax(120px, 1fr) auto 78px; align-items: center; gap: 15px; padding: 13px 16px; border: 1px solid #e6eae4; border-radius: 3px; background: #fcfdfa; }
.account-avatar { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 50%; background: #eaf2e4; color: #4d753d; font-size: 14px; font-weight: 700; text-transform: uppercase; }
.account-details { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.account-issuer { overflow: hidden; color: #313c33; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.account-name { overflow: hidden; color: #818a82; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.code-display { display: flex; align-items: center; gap: 4px; font: 700 25px "Cascadia Mono", Consolas, monospace; letter-spacing: .07em; font-variant-numeric: tabular-nums; }
.code-display .code-gap { margin-left: 4px; }
.code-display.is-loading { color: #a3ada1; }
.copy-button { min-height: 34px; border: 1px solid #dce5d6; border-radius: 3px; background: #f1f6ed; color: #49683b; cursor: pointer; font-size: 9px; font-weight: 700; }
.copy-button:hover { background: #e7f1df; }
.code-meta { grid-column: 3; align-self: start; margin-top: -12px; color: #899289; font: 7px "Cascadia Mono", Consolas, monospace; text-align: center; }
.code-timer { width: 25px; height: 25px; position: relative; display: grid; place-items: center; }
.code-timer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.code-timer circle { fill: none; stroke: #e4e9e1; stroke-width: 2.5; }
.code-timer circle.progress { stroke: #83aa60; stroke-dasharray: 57; stroke-dashoffset: 0; stroke-linecap: round; transition: stroke-dashoffset .2s linear; }
.code-timer span { color: #6c786c; font: 8px "Cascadia Mono", Consolas, monospace; }
.account-actions { display: flex; align-items: center; gap: 9px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #e2e6e0; border-radius: 3px; background: white; color: #7b857b; cursor: pointer; font-size: 17px; }
.icon-button:hover { border-color: #d7b9b5; color: #934a40; }
.icon-button:disabled { cursor: default; opacity: .35; }
.move-button:hover { border-color: #cbdcc0; color: #4b7138; }
.account-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 0 0; }
.search-box { min-width: min(100%, 360px); display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 10px; border: 1px solid #dfe5dc; border-radius: 3px; color: #788578; }
.search-box > span { font-size: 20px; }
.search-box input { min-height: 37px; padding: 7px 0; border: 0; outline: none; font-size: 10px; }
.search-box:focus-within { outline: 3px solid #8dbd60; outline-offset: 2px; }
.search-box input:focus-visible { outline: none; }
.sort-label, .no-results { color: #818a81; font-size: 9px; }
.no-results { padding: 20px 0; text-align: center; }
.empty-state > #empty-import-button { margin-top: 10px; }
.list-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 15px; color: #838d83; font-size: 9px; }
.secure-mini { padding-right: 5px; color: #709952; }

.how-it-works { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding: 49px 18px 31px; }
.how-it-works article { display: flex; flex-direction: column; }
.step-num { color: #7d9075; font-size: 8px; }
.how-it-works strong { margin-top: 12px; font-size: 13px; }
.how-it-works p { max-width: 270px; margin: 7px 0 0; color: #798279; font-size: 10px; line-height: 1.8; }
.scope-note { margin: 0 0 35px; padding: 12px 15px; border-left: 2px solid #a6c58c; background: #edf1e9; color: #6d796b; font-size: 9px; line-height: 1.8; }
.footer { min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 0 max(30px, calc((100vw - 1160px) / 2)); background: #19251e; color: #a3b0a4; font: 7px "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; }

.modal { width: min(540px, calc(100% - 28px)); max-height: min(90vh, 760px); padding: 0; overflow: auto; border: 1px solid #dfe5dc; border-radius: 5px; background: #fff; color: var(--ink); box-shadow: 0 25px 90px rgb(16 30 19 / 26%); }
.modal::backdrop { background: rgb(17 29 20 / 54%); backdrop-filter: blur(3px); }
.modal-form { padding: 25px 28px 24px; }
.modal-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.modal-heading h2 { margin: 8px 0 0; font-size: 21px; letter-spacing: -.04em; }
.modal-intro { margin: 13px 0 16px; color: #707b71; font-size: 10px; line-height: 1.8; }
.modal .icon-button { flex: 0 0 34px; font-size: 21px; }
.modal textarea { resize: vertical; min-height: 68px; font-family: "Cascadia Mono", Consolas, monospace; font-size: 10px; }
.field-divider { display: flex; align-items: center; gap: 12px; margin: 15px 0 4px; color: #909990; font-size: 9px; }
.field-divider::before, .field-divider::after { content: ""; height: 1px; flex: 1; background: #e9ede7; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.advanced-options { margin-top: 17px; padding-top: 13px; border-top: 1px solid #eaede8; }
.advanced-options summary { color: #59675a; cursor: pointer; font-size: 10px; font-weight: 700; }
.advanced-row { margin-top: 7px; }
.advanced-options > p { color: #808981; font-size: 9px; line-height: 1.7; }
.dialog-error { margin-top: 14px; padding: 10px; border: 1px solid; border-radius: 3px; font-size: 10px; line-height: 1.7; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.modal-actions .button { min-height: 41px; padding: 0 14px; font-size: 10px; }
.qr-controls { display: flex; flex-wrap: wrap; gap: 7px; }
.upload-qr { cursor: pointer; }
.qr-video { width: min(100%, 340px); max-height: 250px; display: block; margin: 12px auto 0; border-radius: 3px; background: #17211a; object-fit: cover; }
.qr-status { min-height: 0; margin: 5px 0 0; color: #6f7c70; font-size: 9px; line-height: 1.7; }
.qr-status:empty { display: none; }
.transfer-tabs { display: flex; gap: 4px; margin: 17px 0 4px; padding: 4px; border-radius: 3px; background: #eff2ed; }
.transfer-tab { flex: 1; min-height: 37px; padding: 7px; border: 0; border-radius: 2px; background: transparent; color: #69756a; cursor: pointer; font-size: 9px; }
.transfer-tab.is-active { background: #fff; color: #31442e; box-shadow: 0 1px 4px rgb(24 41 26 / 10%); font-weight: 700; }
.backup-panel { padding-top: 13px; }
.backup-warning { padding: 9px 11px; border-left: 2px solid #d1aa65; background: #fff9ec; color: #765b31; font-size: 9px; line-height: 1.7; }
.password-generator { display: flex; align-items: center; gap: 8px; }
.password-generator input { min-width: 0; }
.password-generator .button { flex: 0 0 auto; }
.password-strength { min-height: 16px; margin: 6px 0 12px; color: #778279; font-size: 9px; line-height: 1.6; }
.password-strength[data-strength="weak"] { color: #9b493e; }
.password-strength[data-strength="good"] { color: #587c3e; }
.password-strength[data-strength="strong"] { color: #426c31; font-weight: 700; }
.toast { position: fixed; z-index: 8; right: 22px; bottom: 22px; max-width: calc(100% - 44px); padding: 11px 15px; border: 1px solid #465b48; border-radius: 3px; background: #233128; color: #eff5eb; box-shadow: 0 8px 24px rgb(17 29 20 / 20%); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 680px) {
  .topbar { height: 62px; padding: 0 17px; }
  .brand-product { margin-left: 3px; padding-left: 8px; font-size: 7px; }
  .header-actions { gap: 9px; }
  .vault-state { font-size: 9px; }
  main { width: calc(100% - 28px); }
  .intro { min-height: 360px; align-items: flex-start; padding: 36px 23px 29px; }
  .intro::after { width: 340px; height: 340px; top: 143px; right: -216px; }
  .intro h1 { font-size: clamp(32px, 8.8vw, 43px); }
  .intro-copy > p { max-width: 290px; font-size: 10px; }
  .desktop-break { display: none; }
  .intro-badge { position: absolute; right: 13px; bottom: 20px; width: 95px; height: 95px; flex-basis: 95px; margin: 0; opacity: .78; }
  .badge-orbit { inset: 8px; }
  .badge-shield { width: 44px; height: 44px; border-radius: 14px; }
  .badge-shield svg { width: 30px; }
  .badge-caption { bottom: 7px; font-size: 5px; }
  .vault-panel { margin-top: 15px; padding: 20px 15px 16px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .panel-heading h2 { font-size: 17px; }
  .panel-actions { width: 100%; justify-content: flex-start; }
  .panel-actions .button { min-height: 35px; gap: 5px; padding: 0 9px; font-size: 9px; }
  .gate-card { margin-top: 24px; }
  .account-card { min-height: 85px; grid-template-columns: 31px minmax(45px, 1fr) auto 21px; grid-template-rows: auto auto; gap: 7px; padding: 10px 8px; }
  .account-avatar { width: 31px; height: 31px; font-size: 12px; }
  .account-issuer { font-size: 10px; }
  .account-name { font-size: 8px; }
  .code-display { gap: 2px; font-size: clamp(17px, 5.2vw, 23px); letter-spacing: .025em; }
  .code-display .code-gap { margin-left: 2px; }
  .code-timer { width: 21px; height: 21px; }
  .code-timer svg { width: 21px; height: 21px; }
  .code-meta { display: none; }
  .copy-button { grid-column: 1; grid-row: 2; width: 31px; min-height: 29px; overflow: hidden; color: transparent; font-size: 0; }
  .copy-button::after { content: "⧉"; color: #49683b; font-size: 15px; }
  .account-actions { grid-column: 2 / 5; grid-row: 2; justify-content: flex-end; gap: 4px; }
  .account-actions .icon-button { width: 27px; height: 29px; font-size: 13px; }
  .account-toolbar { align-items: stretch; flex-direction: column; gap: 7px; }
  .search-box { min-width: 0; }
  .sort-label { font-size: 8px; }
  .how-it-works { grid-template-columns: 1fr; gap: 0; padding: 32px 7px 20px; }
  .how-it-works article { padding: 14px 0; border-bottom: 1px solid #e2e7df; }
  .how-it-works strong { margin-top: 7px; font-size: 12px; }
  .how-it-works p { margin-top: 4px; }
  .scope-note { margin-bottom: 20px; font-size: 8px; }
  .footer { min-height: 72px; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 13px 15px; font-size: 6px; }
  .footer span:last-child { width: 100%; }
  .modal-form { padding: 21px 17px 18px; }
  .modal-heading h2 { font-size: 18px; }
  .form-row { gap: 8px; }
  .qr-controls .button { flex: 1; padding: 0 8px; font-size: 9px; }
  .transfer-tab { font-size: 8px; }
  .password-generator { align-items: stretch; flex-direction: column; }
  .password-generator .button { align-self: flex-start; }
  .modal-actions { justify-content: stretch; }
  .modal-actions .button { flex: 1; gap: 7px; padding: 0 8px; font-size: 9px; }
  .toast { right: 14px; bottom: 14px; }
}

@media (min-width: 681px) {
  .account-card { grid-template-columns: 38px minmax(90px, 1fr) auto 25px 52px 54px auto; gap: 11px; }
  .code-meta { grid-column: 5; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
