:root {
  color-scheme: dark;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  --background: #101316;
  --surface: #171c20;
  --field: #111619;
  --line: #323c42;
  --soft-line: #273137;
  --text: #f3f6f4;
  --muted: #b2bec3;
  --accent: #a4f1cf;
  --accent-hover: #c5ffe6;
  --accent-text: #10241b;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 260px; min-height: 100vh; background: var(--background); color: var(--text); }
button, input, textarea { font: inherit; }
button, input, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .58; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
p { margin: 0; }
.shell { width: min(100% - 48px, 1080px); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--soft-line); }
.header-inner { display: flex; align-items: center; min-height: 69px; }
.brand-wordmark { display: block; width: clamp(180px, 35vw, 238px); max-width: 100%; height: auto; }
.main { min-height: calc(100dvh - 70px); }
.gate { max-width: 520px; margin-inline: auto; padding-block: clamp(42px, 10vh, 118px) 34px; }
.auth-card { border: 1px solid var(--line); background: var(--surface); padding: clamp(23px, 6vw, 40px); border-radius: 22px; box-shadow: 0 24px 70px #0004; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 23px; }
.gate-mark { display: block; width: 62px; height: 62px; object-fit: contain; }
.lock-icon { position: relative; display: inline-block; width: 16px; height: 12px; margin-top: 5px; border: 1.6px solid currentColor; border-radius: 3px; }
.lock-icon::before { content: ""; position: absolute; width: 10px; height: 8px; top: -8px; left: 1.4px; border: 1.6px solid currentColor; border-bottom: 0; border-radius: 8px 8px 0 0; }
.lock-icon::after { content: ""; position: absolute; width: 2px; height: 4px; top: 2px; left: 5.4px; background: currentColor; border-radius: 2px; }
.mode { color: var(--accent); font-size: .875rem; }
h1 { margin: 0 0 12px; font-size: clamp(1.78rem, 5vw, 2.25rem); line-height: 1.13; letter-spacing: -.045em; font-weight: 730; }
.lead { color: var(--muted); line-height: 1.56; }
.wallet-action { margin-top: 24px; }
.help { color: var(--muted); font-size: .875rem; line-height: 1.5; margin-top: 14px; }
.help:empty { display: none; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 13px; border: 1px solid transparent; border-radius: 9px; font-size: .875rem; line-height: 1.25; font-weight: 650; text-align: center; }
.button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.wallet-action > .primary, .auth-form > .primary { width: 100%; min-height: 45px; }
.button.secondary { color: var(--text); background: var(--field); border-color: var(--line); }
.button.secondary:hover:not(:disabled), .password-toggle:hover:not(:disabled), .wallet-option:hover:not(:disabled) { border-color: #6b827e; }
.button.quiet { color: var(--accent); background: transparent; }
.button.quiet:hover:not(:disabled) { background: #283a33; }
.wallet-picker { margin-top: 12px; }
.wallet-options { display: grid; gap: 8px; }
.wallet-option, .password-toggle { min-height: 44px; padding: 8px 12px; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 8px; font-weight: 550; }
.wallet-option { display: flex; align-items: center; gap: 10px; min-height: 50px; text-align: left; text-decoration: none; }
.wallet-option img { flex: 0 0 26px; width: 26px; height: 26px; object-fit: contain; border-radius: 6px; }
.wallet-option > span:first-of-type { min-width: 0; }
.wallet-action-label { margin-inline-start: auto; color: var(--muted); font-size: .8125rem; font-weight: 550; text-align: end; }
.auth-form { margin-top: 22px; }
.auth-form > .primary { margin-top: 18px; }
.field + .field { margin-top: 14px; }
.field label { display: block; margin-bottom: 7px; font-weight: 650; font-size: .875rem; }
.field input { width: 100%; min-width: 0; min-height: 45px; border-radius: 8px; padding: 8px 11px; background: var(--field); color: var(--text); border: 1px solid var(--line); }
.password-row { display: flex; align-items: stretch; gap: 8px; }
.password-toggle { min-width: 58px; }
.gate-actions { display: flex; flex-wrap: wrap; gap: 5px 9px; }
.gate-actions:has(button:not([hidden])) { margin-top: 13px; }
.status { color: var(--accent); margin-top: 12px; font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
.status:empty { display: none; }
.status[data-state="error"], .status[data-kind="error"], .status[data-error="true"], .status.error { color: #ffb8b0; }
.gate-caption { display: flex; justify-content: center; align-items: flex-start; gap: 10px; padding-inline: 14px; margin-top: 21px; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.small-lock { flex: 0 0 16px; margin-top: 6px; color: var(--accent); transform: scale(.8); }
.editor { padding-block: clamp(24px, 5vh, 49px) 32px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.editor-heading { min-width: 100px; }
.editor-title { font-size: 1.25rem; letter-spacing: -.025em; font-weight: 700; }
.save-status { font-size: .875rem; color: var(--muted); margin-top: 4px; min-height: 1.25em; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.sign-out { padding-inline: 8px; }
.writing-pane { display: flex; flex-direction: column; min-height: clamp(460px, 70dvh, 800px); border: 1px solid var(--line); border-radius: 17px; background: var(--surface); overflow: hidden; }
#note-title, #note-body { width: calc(100% - 2 * clamp(14px, 4vw, 34px)); margin-inline: auto; display: block; border: 0; background: transparent; color: var(--text); }
#note-title { padding: 22px 4px 15px; font-size: clamp(1.65rem, 4vw, 2.2rem); font-weight: 700; letter-spacing: -.04em; border-bottom: 1px solid var(--soft-line); }
#note-body { padding: 15px 4px; flex: 1; min-height: 300px; resize: none; font-size: 1rem; line-height: 1.65; }
#note-title:focus-visible, #note-body:focus-visible { outline-offset: -2px; }
#note-title::placeholder, #note-body::placeholder { color: #86959c; opacity: 1; }
.writing-footer { border-top: 1px solid var(--soft-line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px clamp(16px, 4vw, 38px); color: var(--muted); font-size: .875rem; }
.editor-caption { color: var(--muted); font-size: .875rem; margin-top: 13px; line-height: 1.5; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 600px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { min-height: 57px; }
  .main { min-height: calc(100dvh - 58px); }
  .gate { padding-top: 36px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .writing-pane { min-height: 62dvh; }
}
@media (max-width: 330px) {
  .shell { width: calc(100% - 20px); }
  .auth-card { padding-inline: 17px; }
  .tools { gap: 4px; }
  .tools .button { padding-inline: 8px; }
}
