:root { --ink: #1c2330; --muted: #5d6675; --line: #d9dee6; --bg: #f3f5f8; --accent: #1f5fd1; --warn: #9a5b00; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
[hidden] { display: none !important; }

#bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
#brand { margin-right: 8px; }
.editing { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
button, .button { font: inherit; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; }
button:hover:not(:disabled), .button:hover { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#landing { max-width: 1040px; margin: 0 auto; padding: 48px 20px 24px; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
#landing h1 { font-size: 40px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 14px; }
#landing h2 { font-size: 24px; text-align: center; margin: 64px 0 20px; }
.sub { color: var(--muted); font-size: 18px; margin: 0 0 28px; }
#drop { display: block; padding: 30px 20px; border: 2px dashed var(--accent); border-radius: 12px; background: #fff; color: var(--accent); cursor: pointer; text-align: center; font-size: 18px; font-weight: 600; }
#drop small { display: block; margin-top: 6px; font-size: 13px; font-weight: 400; color: var(--muted); }
#drop:hover, #drop.over, #drop:focus-within { background: #eef4ff; }
.try { margin: 12px 0 0; text-align: center; }
.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; }
.demo { text-align: center; color: var(--muted); font-size: 13px; }
.sheet { display: grid; gap: 10px; text-align: left; padding: 28px 26px; margin-bottom: 18px; background: #fff; border-radius: 6px; box-shadow: 0 8px 30px rgba(20, 26, 36, .18); font: 15px/1.5 Georgia, serif; color: #222; transform: rotate(-1.5deg); }
.sheet b { font: bold 22px Arial, sans-serif; color: var(--accent); }
.sheet i { height: 8px; border-radius: 4px; background: #e6e9ee; }
.sheet i:last-child { width: 60%; }
.swap { display: inline-grid; justify-self: start; padding: 1px 4px; margin-left: -4px; border-radius: 3px; outline: 1.5px solid transparent; animation: ring 7s infinite; }
.swap span { grid-area: 1 / 1; white-space: nowrap; animation: old 7s infinite; }
.swap span + span { animation-name: new; }
@keyframes old { 0%, 40% { opacity: 1; } 48%, 92% { opacity: 0; } 100% { opacity: 1; } }
@keyframes new { 0%, 40% { opacity: 0; } 48%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ring { 0%, 25%, 62%, 100% { outline-color: transparent; background: transparent; } 30%, 55% { outline-color: var(--accent); background: rgba(31, 95, 209, .08); } }
@media (prefers-reduced-motion: reduce) { .swap, .swap span { animation: none; } .swap span + span { display: none; } }
.points { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.points b { display: block; margin-bottom: 4px; }
.points span { color: var(--muted); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; max-width: 680px; margin: 0 auto; }
.plan { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.plan.best { border: 2px solid var(--accent); }
.plan h3 { margin: 0; font-size: 18px; }
.amount { margin: 4px 0 12px; color: var(--muted); }
.best .amount { color: var(--ink); font-size: 17px; font-weight: 600; }
.ticks { list-style: none; padding: 0; margin: 0 0 16px; }
.ticks li { position: relative; padding-left: 24px; margin: 6px 0; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: #1a8a4a; font-weight: 700; }
#buy, #buy2 { display: block; padding: 10px; text-align: center; font-size: 16px; font-weight: 600; }
.fine { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.faq { max-width: 680px; margin: 0 auto; }
.faq details { padding: 12px 16px; margin-bottom: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; color: var(--muted); }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; gap: 32px; } #landing h1 { font-size: 30px; } .sheet { transform: none; } }

#editor { padding: 16px; overflow-x: auto; }
#hint { text-align: center; color: var(--muted); margin: 0 0 12px; }
.pageno { white-space: nowrap; }
#pageno { width: 3.2em; font: inherit; text-align: center; padding: 5px 4px; border: 1px solid var(--line); border-radius: 6px; }
.page { position: relative; scroll-margin-top: 110px; margin: 0 auto 16px; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .25); }
.page img { display: block; width: 100%; height: 100%; }
.page .note { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); padding: 4px 10px; border-radius: 6px; background: rgba(28, 35, 48, .85); color: #fff; font-size: 13px; white-space: nowrap; }
.span { position: absolute; cursor: text; border-radius: 2px; }
.span:hover, .span:focus-visible { outline: 1.5px solid var(--accent); background: rgba(31, 95, 209, .08); }
#edit { position: absolute; z-index: 2; padding: 0 3px; border: 1.5px solid var(--accent); border-radius: 2px; background: #fff; color: var(--ink); font-family: inherit; min-width: 40px; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(680px, 92vw); padding: 10px 14px; border-radius: 8px; background: var(--ink); color: #fff; display: flex; gap: 12px; align-items: center; z-index: 10; }
#toast.warn { background: var(--warn); }
#toast button { white-space: nowrap; }

dialog { border: 1px solid var(--line); border-radius: 12px; padding: 24px; max-width: 420px; width: calc(100vw - 32px); }
dialog::backdrop { background: rgba(20, 26, 36, .5); }
dialog h2 { margin: 0 0 8px; }
#keyform { display: flex; gap: 8px; align-items: end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
#keyform label { flex: 1; font-size: 13px; color: var(--muted); }
#key { display: block; width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
#keymsg, #pwmsg { min-height: 1.5em; font-size: 13px; color: var(--warn); margin: 8px 0; }
#pwinput { display: block; width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }

footer { padding: 16px; text-align: center; color: var(--muted); font-size: 13px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
footer a { color: inherit; }
.doc { max-width: 720px; margin: 0 auto; padding: 40px 20px; }
.doc h2 { margin-top: 28px; font-size: 18px; }
