:root {
  --ink: #172a28; --deep: #173e38; --moss: #44665b; --paper: #f5eedf;
  --paper-light: #fffaf0; --coral: #df7f5f; --gold: #d7b86e; --sky: #cddfd9;
  --line: rgba(23, 42, 40, .18); --app-height: 100dvh;
  --safe-top: max(env(safe-area-inset-top), 0px); --safe-right: max(env(safe-area-inset-right), 0px);
  --safe-bottom: max(env(safe-area-inset-bottom), 0px); --safe-left: max(env(safe-area-inset-left), 0px);
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { margin: 0; color: var(--ink); background: #d9d5ca; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.45; overscroll-behavior: none; }
button, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Georgia, Charter, serif; line-height: 1.03; letter-spacing: -.035em; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 10px 14px; background: white; color: var(--ink); }
.skip-link:focus { top: 10px; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }

.manual { position: relative; display: grid; grid-template-rows: 54px minmax(0, 1fr) 62px; width: min(100%, 940px); height: var(--app-height); margin: 0 auto; background: var(--paper); box-shadow: 0 0 60px rgba(23,42,40,.18); overflow: hidden; }
.manual-bar { z-index: 20; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 10px; padding: calc(5px + var(--safe-top)) calc(10px + var(--safe-right)) 5px calc(10px + var(--safe-left)); border-bottom: 1px solid var(--line); background: rgba(245,238,223,.94); backdrop-filter: blur(12px); }
.manual-title { min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.manual-title strong { letter-spacing: .18em; font-size: .78rem; }
.manual-title strong::after { content: " · "; color: var(--coral); }
.manual-title span { color: var(--moss); font-family: Georgia, serif; font-size: .86rem; }
.round-button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; font-size: 1.15rem; }
.round-button[aria-pressed="true"] { color: var(--coral); }

.book { min-height: 0; overflow: hidden; outline: none; }
.page-track { display: flex; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x pinch-zoom; }
.page-track::-webkit-scrollbar { display: none; }
.book-page { position: relative; flex: 0 0 100%; width: 100%; min-width: 100%; max-width: 100%; height: 100%; min-height: 0; padding: clamp(22px, 5vw, 54px) clamp(22px, 7vw, 76px); overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; isolation: isolate; }
.book-page::before { content: ""; position: absolute; inset: 0; z-index: -3; opacity: .18; background-image: radial-gradient(rgba(23,42,40,.16) .55px, transparent .55px); background-size: 5px 5px; }
.book-page::after { content: attr(data-folio); position: absolute; right: 20px; bottom: 14px; color: rgba(23,42,40,.48); font-family: Georgia, serif; font-size: .75rem; }
.page-inner { width: 100%; height: 100%; display: flex; flex-direction: column; min-height: 0; }
.page-inner.center { justify-content: center; text-align: center; align-items: center; }
.page-inner.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(180px, .8fr); gap: clamp(22px, 6vw, 70px); align-items: center; }
.kicker { margin-bottom: 10px; color: var(--moss); font-size: .68rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.page-title { max-width: 720px; margin-bottom: clamp(12px, 2.8vh, 25px); font-size: clamp(2.1rem, 7.5vw, 5rem); }
.page-copy { max-width: 660px; margin-bottom: 0; color: #3c504d; font-size: clamp(.95rem, 2.4vw, 1.22rem); }
.page-copy strong { color: var(--ink); }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(17px, 3.6vh, 32px); }
.page-inner.center .page-actions { justify-content: center; }
.primary-action, .secondary-action, .text-action { min-height: 46px; border-radius: 999px; padding: 10px 18px; cursor: pointer; font-weight: 800; }
.primary-action { border: 1px solid var(--ink); background: var(--coral); box-shadow: 3px 3px 0 var(--ink); }
.secondary-action { border: 1px solid var(--ink); background: rgba(255,255,255,.34); }
.text-action { border: 0; background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.wide { width: 100%; justify-content: center; }

.cover-page { color: var(--paper-light); background: var(--deep); }
.cover-page::before { opacity: .14; background-image: radial-gradient(rgba(255,255,255,.45) .6px, transparent .6px); }
.cover-page::after { color: rgba(255,255,255,.5); }
.cover-page .kicker, .cover-page .page-copy { color: #dbe8e2; }
.cover-page .page-title { margin: 0; font-size: clamp(3.2rem, 16vw, 9rem); letter-spacing: -.07em; }
.cover-page .edition { margin-top: 10px; color: var(--gold); font-family: Georgia, serif; font-size: clamp(1rem, 3.5vw, 1.5rem); }
.cover-owl { width: clamp(86px, 20vw, 150px); margin-bottom: clamp(18px, 5vh, 46px); }
.cover-owl svg { width: 100%; fill: none; stroke: var(--paper-light); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cover-owl .fill { fill: var(--gold); stroke: none; }
.swipe-hint { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.72); font-size: .75rem; white-space: nowrap; }

.warm-page { background: #f5dfcf; }
.sage-page { background: #d7e5df; }
.gold-page { background: #efe1b8; }
.lavender-page { background: #dfdaeb; }
.night-page { color: var(--paper-light); background: #263b4b; }
.night-page .kicker, .night-page .page-copy { color: #d6e1e8; }
.night-page::after { color: rgba(255,255,255,.5); }
.chapter-number { color: var(--coral); font-family: Georgia, serif; font-size: clamp(4rem, 18vw, 10rem); line-height: .78; letter-spacing: -.08em; }
.chapter-rule { width: 48px; height: 3px; margin: 24px 0; background: currentColor; opacity: .55; }
.pull-quote { max-width: 710px; margin: auto 0; font-family: Georgia, serif; font-size: clamp(1.8rem, 6vw, 4.2rem); line-height: 1.07; letter-spacing: -.04em; }
.margin-note { align-self: flex-end; max-width: 270px; margin-top: auto; padding-top: 14px; border-top: 1px solid currentColor; font-size: .78rem; opacity: .76; }

.journey-line { display: grid; gap: clamp(8px, 1.8vh, 16px); width: min(100%, 650px); margin-top: clamp(14px, 3vh, 30px); }
.journey-stop { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 12px; text-align: left; }
.journey-stop i { position: relative; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-family: Georgia, serif; font-size: .72rem; font-style: normal; }
.journey-stop:not(:last-child) i::after { content: ""; position: absolute; top: 28px; left: 13px; height: clamp(8px, 1.8vh, 16px); border-left: 1px solid currentColor; }
.journey-stop strong { display: block; font-family: Georgia, serif; font-size: clamp(1rem, 2.5vw, 1.3rem); }
.journey-stop span { display: block; color: #52635f; font-size: clamp(.72rem, 1.8vw, .9rem); }

.page-illustration { position: relative; width: min(100%, 310px); aspect-ratio: 1; margin: auto; }
.orbit { position: absolute; inset: 8%; border: 1px solid currentColor; border-radius: 50%; opacity: .35; }
.orbit.two { inset: 24%; border-style: dashed; }
.signal { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--ink); border-radius: 50%; background: var(--paper-light); font-family: Georgia, serif; }
.signal.one { top: 0; left: 40%; }.signal.two { right: 4%; top: 44%; }.signal.three { bottom: 4%; left: 12%; }
.center-word { position: absolute; inset: 36%; display: grid; place-items: center; border-radius: 50%; background: var(--deep); color: white; font-family: Georgia, serif; }
.mini-list { display: grid; gap: 10px; max-width: 620px; margin-top: clamp(14px, 3vh, 28px); }
.mini-list div { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.mini-list b { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: .7rem; }
.mini-list span { font-size: clamp(.84rem, 2vw, 1rem); }
.status-ribbon { display: inline-flex; align-items: center; gap: 7px; width: fit-content; margin-bottom: clamp(12px, 3vh, 24px); padding: 6px 10px; border: 1px dashed currentColor; border-radius: 999px; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.status-ribbon::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.pending-ribbon::before { background: var(--coral); }

.page-controls { z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 4px calc(12px + var(--safe-right)) calc(5px + var(--safe-bottom)) calc(12px + var(--safe-left)); border-top: 1px solid var(--line); background: rgba(255,250,240,.94); backdrop-filter: blur(12px); }
.turn-button { display: flex; align-items: center; gap: 7px; min-height: 44px; width: fit-content; border: 0; background: transparent; cursor: pointer; font-weight: 800; }
.turn-button.next { justify-self: end; }
.turn-button:disabled { opacity: .28; }
.page-position { display: flex; align-items: center; gap: 7px; min-height: 44px; border: 0; background: transparent; cursor: pointer; font-family: Georgia, serif; font-size: .76rem; }
.page-rule { width: clamp(54px, 14vw, 100px); height: 2px; background: var(--line); }
.page-rule i { display: block; width: 0; height: 100%; background: var(--coral); transition: width .2s ease; }

.assistant-dock { position: absolute; z-index: 40; right: calc(14px + var(--safe-right)); bottom: calc(76px + var(--safe-bottom)); }
.assistant-bubble { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid var(--paper-light); border-radius: 50%; background: var(--deep); box-shadow: 0 5px 18px rgba(23,42,40,.28); cursor: pointer; }
.assistant-bubble svg { width: 34px; fill: none; stroke: var(--paper-light); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.assistant-bubble .fill { fill: var(--gold); stroke: none; }
.assistant-menu { position: absolute; right: 0; bottom: 64px; display: grid; gap: 6px; width: 190px; padding: 8px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper-light); box-shadow: 0 10px 30px rgba(23,42,40,.25); }
.assistant-menu[hidden] { display: none; }
.assistant-menu button { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 8px; min-height: 48px; padding: 7px 9px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; }
.assistant-menu button:hover { background: var(--paper); }
.assistant-menu span { font-size: 1.1rem; text-align: center; }
.assistant-menu strong { font-size: .82rem; }

.sheet { width: min(100% - 18px, 760px); max-height: min(86dvh, 840px); padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: 28px 28px 18px 18px; background: var(--paper-light); box-shadow: 0 20px 70px rgba(23,42,40,.34); }
.sheet::backdrop { background: rgba(18,37,34,.64); backdrop-filter: blur(5px); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 25px 24px 16px; border-bottom: 1px solid var(--line); background: var(--paper-light); }
.sheet-head.sticky { position: sticky; top: 0; z-index: 2; }
.sheet-head h2 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.8rem); }
.sheet-head .kicker { margin-bottom: 5px; }
.sheet-close { flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--paper); cursor: pointer; font-size: 1.6rem; }
.contents-list { padding: 8px 16px 22px; overflow-y: auto; }
.contents-link { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 7px 8px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; }
.contents-link .folio { color: var(--coral); font-family: Georgia, serif; font-size: .78rem; }
.contents-link strong { font-family: Georgia, serif; font-size: 1rem; }
.contents-link .mark { color: var(--coral); }
.sheet-foot { padding: 14px 20px 22px; border-top: 1px solid var(--line); text-align: center; }
.reader-content, .support-content, .feedback-sheet form > p, .feedback-sheet .field-label, .feedback-sheet .primary-action, .feedback-sheet .save-message { margin-left: 24px; margin-right: 24px; }
.reader-content { padding: 24px 0 34px; font-size: 1rem; line-height: 1.65; }
.reader-content h3 { margin-top: 30px; font-size: 1.45rem; }
.reader-content li { margin: 10px 0; }
.practice-step { margin: 12px 0; padding: 18px; border-left: 4px solid var(--coral); background: var(--paper); }
.practice-step b { display: block; margin-bottom: 5px; font-family: Georgia, serif; }
.boundary-note { margin: 22px 0; padding: 18px; border: 1px dashed var(--moss); border-radius: 16px; background: #e9f1ed; }
.placeholder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.placeholder-grid > div { min-height: 78px; padding: 13px 14px; border: 1px dashed var(--moss); border-radius: 14px; background: rgba(233,241,237,.72); }
.placeholder-grid strong, .placeholder-grid span { display: block; }
.placeholder-grid strong { margin-bottom: 4px; font-family: Georgia, serif; }
.placeholder-grid span { color: var(--moss); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.support-content { padding: 24px 0 34px; }
.support-choice { display: block; width: 100%; min-height: 58px; margin: 8px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); cursor: pointer; text-align: left; font-weight: 800; }
.support-answer { margin-top: 18px; padding: 18px; border-radius: 16px; background: #e9f1ed; }
.field-label { display: block; font-weight: 800; }
textarea { width: 100%; margin-top: 8px; padding: 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; background: white; resize: vertical; font-weight: 400; }
.feedback-sheet .primary-action { margin-top: 18px; }
.save-message { min-height: 24px; color: var(--moss); font-size: .84rem; }

body.telegram .manual { width: 100%; box-shadow: none; }
body.telegram .manual-bar { background: var(--tg-theme-secondary-bg-color, rgba(245,238,223,.94)); }
body.telegram .page-controls { background: var(--tg-theme-bottom-bar-bg-color, rgba(255,250,240,.94)); }

@media (max-height: 670px) {
  .book-page { padding-top: 18px; padding-bottom: 18px; }
  .page-title { font-size: clamp(1.85rem, 7vw, 3.2rem); margin-bottom: 10px; }
  .page-copy { font-size: .88rem; }
  .page-actions { margin-top: 12px; }
  .journey-line { gap: 5px; margin-top: 9px; }
  .journey-stop:not(:last-child) i::after { height: 5px; }
  .cover-owl { width: 72px; margin-bottom: 12px; }
  .mini-list { gap: 6px; margin-top: 10px; }
}
@media (max-width: 640px) {
  .manual { width: 100%; }
  .page-inner.split { display: flex; justify-content: center; }
  .page-inner.split .page-illustration { display: none; }
  .turn-label { display: none; }
  .assistant-bubble { width: 50px; height: 50px; }
  .placeholder-grid { grid-template-columns: 1fr; }
}
@media (min-width: 900px) {
  body { padding: 18px; background: radial-gradient(circle at 50% 0, #eee9dc, #cac8c0); }
  .manual { height: calc(100dvh - 36px); border-radius: 22px; }
  .book-page { border-left: 1px solid rgba(255,255,255,.45); border-right: 1px solid rgba(23,42,40,.08); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media print {
  @page { size: A5 portrait; margin: 0; }
  html, body { height: auto; overflow: visible; background: white; }
  body { padding: 0; }
  .manual { display: block; width: auto; height: auto; box-shadow: none; overflow: visible; }
  .manual-bar, .page-controls, .assistant-dock, dialog { display: none !important; }
  .book, .page-track { display: block; height: auto; overflow: visible; }
  .book-page { width: 148mm; height: 210mm; page-break-after: always; padding: 18mm; overflow: hidden; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
