body { background: var(--peach); color: var(--navy); min-height: 100vh; }
.wrap { max-width: 520px; margin: 0 auto; padding: 22px 18px calc(28px + env(safe-area-inset-bottom)); }
.head { text-align: center; }
.logo { width: 150px; height: auto; display: inline-block; }
.title { font-family: 'Ruslan', serif; font-weight: 400; color: var(--red); font-size: clamp(34px, 10.5vw, 48px); line-height: 1; margin: 18px 0 6px; letter-spacing: .02em; text-transform: uppercase; }
.title span { display: block; font-family: 'Mont', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: .14em; color: var(--navy); margin-top: 8px; text-transform: uppercase; }
.lead { font-size: 15.5px; line-height: 1.45; margin: 14px 4px 20px; }
.card { position: relative; background: var(--cream); border-radius: 22px; padding: 20px 18px 18px; box-shadow: 0 1px 0 rgba(31, 38, 80, .08), 0 12px 30px -18px rgba(31, 38, 80, .45); }
.lbl { display: block; font-weight: 600; font-size: 14px; margin: 4px 2px 8px; }
.lbl small { font-weight: 400; opacity: .7; }
textarea, input { width: 100%; font: inherit; font-size: 16px; color: var(--navy); background: #fff; border: 2px solid rgba(31, 38, 80, .14); border-radius: 14px; padding: 12px 14px; outline: none; transition: border-color .15s; }
textarea { resize: vertical; min-height: 120px; line-height: 1.4; }
textarea:focus, input:focus { border-color: var(--red); }
.hint { text-align: right; font-size: 12px; opacity: .6; margin: 4px 2px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { border: 2px solid var(--navy); background: transparent; color: var(--navy); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--navy); color: var(--peach); }
.btn { display: block; width: 100%; border: 0; border-radius: 16px; background: var(--red); color: #fff7ea; font: inherit; font-weight: 800; font-size: 19px; padding: 17px 16px; cursor: pointer; text-align: center; text-decoration: none; box-shadow: 0 6px 0 var(--red-d); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--red-d); }
.btn[disabled] { opacity: .55; }
.remain { text-align: center; font-size: 12.5px; opacity: .65; margin-top: 14px; min-height: 1em; }
.err { background: #fff0ea; border: 2px solid var(--red); color: var(--red-d); border-radius: 14px; padding: 12px 14px; font-size: 14.5px; line-height: 1.4; margin-bottom: 14px; font-weight: 600; }
.loading { position: absolute; inset: 0; background: var(--cream); border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; }
.loading .tree { width: 110px; animation: sway 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
.loading .phrase { font-weight: 600; font-size: 16px; min-height: 2.6em; }
@keyframes sway { 0%, 100% { transform: rotate(-3deg) scale(1); } 50% { transform: rotate(3deg) scale(1.04); } }
.result { margin-top: 4px; animation: rise .5s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.paper { background: var(--cream); border-radius: 22px; padding: 22px 20px 20px; border: 2px solid var(--red); outline: 6px solid var(--cream); outline-offset: -12px; box-shadow: 0 12px 30px -18px rgba(31, 38, 80, .45); }
.orn { text-align: center; color: var(--red); letter-spacing: .6em; font-size: 13px; margin-bottom: 12px; }
.toast { font-size: 17px; line-height: 1.55; white-space: pre-line; color: var(--ink); }
.sign { text-align: right; font-weight: 600; margin-top: 14px; color: var(--red-d); }
.sign:empty { display: none; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 6px; }
.btn2 { border: 2px solid var(--navy); background: transparent; color: var(--navy); border-radius: 14px; padding: 12px 6px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn2:active { background: var(--navy); color: var(--peach); }
.link { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--red-d); font: inherit; font-weight: 600; font-size: 15px; padding: 10px; cursor: pointer; }
.cta { margin-top: 22px; background: var(--navy); color: var(--peach); border-radius: 22px; padding: 22px 20px; display: flex; gap: 16px; align-items: flex-start; animation: rise .6s ease-out .25s both; }
.cta-tree { width: 62px; flex: none; margin-top: 4px; }
.cta h2 { font-family: 'Ruslan', serif; font-weight: 400; font-size: 25px; line-height: 1.1; margin: 0 0 8px; color: #ffe2b8; }
.cta p { margin: 0 0 16px; font-size: 14.5px; line-height: 1.45; opacity: .9; }
.cta-btn { font-size: 16px; padding: 14px 12px; }
.foot { text-align: center; font-size: 12.5px; line-height: 1.7; opacity: .7; margin-top: 26px; }
.foot a { color: inherit; }
.toastmsg { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--navy); color: var(--peach); padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; z-index: 10; }
