:root {
  --green: #176c45;
  --green-dark: #0b432f;
  --green-soft: #e7f1e8;
  --green-mist: #f0f6ef;
  --orange: #e8783d;
  --orange-soft: #fff1e7;
  --cream: #f8f5ed;
  --paper: #fffefb;
  --ink: #17231f;
  --muted: #748078;
  --line: #e8e7df;
  --danger: #aa4b3d;
  --shadow: 0 16px 42px rgba(25, 66, 49, .09);
}

* { box-sizing: border-box; }
html { background: #e7e9e3; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
textarea { resize: none; }
.mobile-shell { position: relative; width: 100%; min-height: 100dvh; margin: 0 auto; background: var(--cream); overflow-x: hidden; }
.screen { display: none; min-height: 100dvh; }
.screen.active { display: block; animation: screen-in .2s ease; }
@keyframes screen-in { from { opacity: .35; transform: translateY(5px); } }

.login-screen { position: relative; padding: max(64px, env(safe-area-inset-top)) 24px 28px; background: radial-gradient(circle at 90% 22%, #e3efe4 0 20%, transparent 42%), linear-gradient(180deg, #fffefa, #f5f5ec); }
.login-screen::after { content: ""; position: absolute; inset: auto -55px 0 -55px; height: 34%; pointer-events: none; opacity: .35; background: radial-gradient(ellipse at 20% 100%, #8eb592 0 18%, transparent 20%), radial-gradient(ellipse at 72% 100%, #bdd3b7 0 25%, transparent 27%); }
.login-brand { position: relative; z-index: 1; text-align: center; }
.coconut-mark { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 48% 52% 44% 56%; color: #fff; background: linear-gradient(145deg, #23835a, #0d5137); font-size: 26px; font-weight: 850; box-shadow: 0 10px 24px rgba(23,108,69,.2); transform: rotate(-4deg); }
.coconut-mark.small { width: 58px; height: 58px; margin: 0; font-size: 22px; }
.brand-word { margin: 0; color: var(--green); font-size: 28px; font-weight: 900; letter-spacing: .12em; }
.login-brand h1 { margin: 16px 0 7px; font-size: 26px; }
.login-brand > p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.login-card { position: relative; z-index: 1; display: grid; gap: 14px; margin-top: 52px; padding: 20px; border: 1px solid rgba(23,108,69,.08); border-radius: 22px; background: rgba(255,255,252,.92); box-shadow: var(--shadow); }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
input, textarea { width: 100%; color: var(--ink); border: 1px solid var(--line); background: #fff; outline: none; }
input { min-height: 49px; padding: 0 14px; border-radius: 13px; }
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,108,69,.08); }
.login-foot { position: relative; z-index: 1; margin: 20px 0 0; text-align: center; color: #a0a49d; font-size: 12px; }
.form-error { min-height: 18px; margin: 0; color: var(--danger); text-align: center; font-size: 12px; }

.app-screen { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.app-header, .simple-header { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding: max(12px, env(safe-area-inset-top)) 18px 10px; background: rgba(248,245,237,.93); backdrop-filter: blur(14px); }
.store-label { display: block; color: var(--green); font-size: 21px; font-weight: 900; letter-spacing: .08em; }
.app-header small { color: var(--muted); }
.avatar { width: 39px; height: 39px; border: 0; border-radius: 50%; color: white; background: var(--green-dark); font-weight: 800; }
.simple-header { min-height: 58px; padding-left: 12px; padding-right: 12px; }
.simple-header > button:first-child { width: 38px; height: 38px; border: 0; background: transparent; font-size: 31px; line-height: 1; }
.simple-header > span { width: 38px; }
.center-title { display: grid; text-align: center; }
.center-title small { margin-top: 2px; color: var(--green); }
.history-button { width: auto !important; height: 34px !important; padding: 0 11px; border: 1px solid var(--line) !important; border-radius: 10px; background: white !important; font-size: 12px !important; }
main { padding: 0 18px; }
.home-intro { padding: 28px 0 17px; }
.home-intro .hello { margin: 0 0 4px; color: var(--green); font-size: 14px; font-weight: 720; }
.home-intro h2 { margin: 0 0 5px; font-size: 29px; letter-spacing: -.02em; }
.home-intro > p:last-child { margin: 0; color: var(--muted); }
.request-card { padding: 12px; border-radius: 21px; background: var(--paper); box-shadow: var(--shadow); }
.request-card textarea { min-height: 142px; padding: 14px; border: 0; border-radius: 14px; background: #fbfcf8; font-size: 16px; line-height: 1.65; }
.request-meta { display: flex; justify-content: space-between; padding: 8px 5px 12px; color: var(--muted); font-size: 11px; }
.request-meta span:first-child { color: var(--green); }
.button { min-height: 51px; padding: 0 17px; border-radius: 14px; border: 0; font-weight: 750; }
.button.primary { color: white; background: linear-gradient(135deg, #1d8051, #0f613f); box-shadow: 0 9px 22px rgba(23,108,69,.18); }
.button.primary:disabled { opacity: .5; }
.button.outline { color: var(--green); border: 1px solid var(--green); background: white; }
.button.subtle { color: #59655f; background: #f1f1eb; }
.send-button { width: 100%; font-size: 16px; }
.send-button span { margin-left: 6px; }
.quick-section { margin-top: 28px; }
.section-title { display: flex; align-items: end; justify-content: space-between; margin-bottom: 13px; }
.section-title h3 { margin: 0; font-size: 17px; }
.section-title small { color: #a2a69e; font-size: 10px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-card { min-height: 105px; padding: 11px 6px; border: 1px solid transparent; border-radius: 17px; color: var(--ink); background: var(--paper); box-shadow: 0 5px 16px rgba(25,66,49,.05); }
.quick-card i { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 auto 7px; border-radius: 12px; background: var(--orange-soft); font-style: normal; }
.quick-card strong, .quick-card small { display: block; }
.quick-card strong { font-size: 14px; }
.quick-card small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.quick-card.active { border-color: rgba(23,108,69,.4); background: var(--green-mist); }
.quick-card:nth-child(2) i, .quick-card:nth-child(5) i { background: #fff3d9; }
.quick-card:nth-child(3) i, .quick-card:nth-child(6) i { background: #e9efff; }
.known-strip, .process-note { display: flex; gap: 12px; align-items: center; margin: 22px 0 8px; padding: 14px; border-radius: 16px; background: var(--green-soft); }
.known-strip > span { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; color: white; background: var(--green); }
.known-strip p, .process-note p { margin: 0; line-height: 1.4; }
.known-strip small { color: #617269; }

.processing-main { padding-top: 62px; text-align: center; }
.orbit { display: grid; place-items: center; width: 100px; height: 100px; margin: 0 auto 28px; border: 1px solid #cfe0d1; border-radius: 50%; background: white; box-shadow: 0 0 0 14px rgba(231,241,232,.7); animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04); box-shadow: 0 0 0 22px rgba(231,241,232,.35); } }
.processing-main h2 { margin: 0 0 8px; font-size: 25px; }
.processing-main > p { max-width: 330px; margin: 0 auto; color: var(--muted); line-height: 1.6; font-size: 14px; }
.process-list { margin: 36px 0 22px; padding: 5px 17px; border-radius: 20px; text-align: left; background: var(--paper); box-shadow: var(--shadow); }
.process-row { display: flex; gap: 11px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.process-row:last-child { border-bottom: 0; }
.process-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #a9afa9; background: #eceeea; font-size: 12px; }
.process-row.done .process-icon { color: white; background: var(--green); }
.process-row.active .process-icon { color: var(--green); background: var(--green-soft); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.process-row strong { flex: 1; font-size: 14px; }
.process-row small { color: var(--muted); }
.process-row.done small { color: var(--green); }
.process-note { text-align: left; }
.process-note > span { font-size: 32px; }

.page-main { padding-top: 16px; }
.page-lead { margin-bottom: 20px; }
.page-lead h2 { margin: 9px 0 6px; font-size: 25px; }
.page-lead p { margin: 0; color: var(--muted); line-height: 1.55; }
.step-badge { display: inline-block; padding: 5px 9px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 700; }
.question-card { margin-bottom: 13px; padding: 17px; border-radius: 18px; background: var(--paper); box-shadow: 0 6px 22px rgba(25,66,49,.05); }
.question-card h3 { margin: 0 0 6px; font-size: 16px; }
.question-card p { margin: 0 0 13px; color: var(--muted); font-size: 12px; }
.question-card input { margin-top: 9px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; color: #506057; background: white; font-size: 12px; }
.choice.selected { color: white; border-color: var(--green); background: var(--green); }
.sticky-action { width: 100%; margin-top: 18px; }
.text-button { display: block; margin: 13px auto 0; padding: 9px 15px; border: 0; color: var(--muted); background: transparent; }

.version-switcher { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.version-pill { flex: 0 0 auto; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; }
.version-pill.active { color: white; border-color: var(--green); background: var(--green); }
.plan-hero { overflow: hidden; position: relative; padding: 24px 20px; border-radius: 22px; color: white; background: radial-gradient(circle at 90% 5%, rgba(255,226,150,.3), transparent 30%), linear-gradient(135deg, #0d4d36, #1c7650); box-shadow: var(--shadow); }
.plan-hero::after { content: "椰"; position: absolute; right: 12px; bottom: -35px; color: rgba(255,255,255,.08); font-size: 120px; font-weight: 900; }
.plan-hero small { color: rgba(255,255,255,.7); }
.plan-hero h1 { position: relative; z-index: 1; margin: 9px 0 8px; font-size: 28px; }
.plan-hero p { position: relative; z-index: 1; margin: 0; color: rgba(255,255,255,.82); line-height: 1.55; }
.plan-card { margin-top: 14px; padding: 18px; border: 1px solid rgba(23,108,69,.08); border-radius: 19px; background: var(--paper); box-shadow: 0 6px 22px rgba(25,66,49,.05); }
.plan-card > h2 { display: flex; gap: 9px; align-items: center; margin: 0 0 13px; font-size: 18px; }
.card-number { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; color: white; background: var(--green); font-size: 12px; }
.plan-card p, .plan-card li { color: #46564e; font-size: 14px; line-height: 1.7; }
.plan-card ul, .plan-card ol { margin: 0; padding-left: 21px; }
.plan-card li + li { margin-top: 7px; }
.advice-box { padding: 14px; border-radius: 14px; background: var(--green-mist); }
.advice-box strong { display: block; margin-bottom: 5px; color: var(--green); }
.confirm-badge { display: inline-block; margin-top: 8px; padding: 5px 8px; border-radius: 8px; color: #a8572d; background: var(--orange-soft); font-size: 11px; font-weight: 700; }
.channel-block { padding: 13px 0; border-bottom: 1px solid var(--line); }
.channel-block:last-child { border-bottom: 0; }
.channel-block h3 { margin: 0 0 7px; color: var(--green); font-size: 14px; }
.channel-block p { margin: 0; white-space: pre-wrap; }
.brief-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.brief-item { padding: 11px; border-radius: 12px; background: #f5f6f2; }
.brief-item strong { display: block; font-size: 13px; }
.brief-item small { color: var(--muted); }
.risk-box { border-color: #f4dec9; background: #fffaf3; }
.plan-actions { position: sticky; bottom: 0; z-index: 6; display: grid; grid-template-columns: .9fr 1.1fr 1.1fr; gap: 8px; margin: 18px -18px -18px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: rgba(248,245,237,.95); backdrop-filter: blur(12px); }
.plan-actions .button { min-height: 47px; padding: 0 8px; font-size: 13px; }

.revision-main textarea { min-height: 150px; margin-top: 14px; padding: 15px; border-radius: 16px; line-height: 1.65; font-size: 16px; }
.chat-bubble { max-width: 88%; padding: 14px; border-radius: 18px 18px 18px 5px; line-height: 1.6; font-size: 14px; }
.chat-bubble.assistant { background: var(--green-soft); }
.history-list { display: grid; gap: 11px; }
.history-item { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; padding: 13px; border: 0; border-radius: 17px; text-align: left; background: var(--paper); box-shadow: 0 5px 18px rgba(25,66,49,.05); }
.history-thumb { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 14px; color: white; background: linear-gradient(145deg, #1c7550, #0b432f); font-size: 23px; }
.history-copy strong, .history-copy small { display: block; }
.history-copy strong { margin-bottom: 5px; }
.history-copy small { color: var(--muted); }
.status-tag { padding: 5px 7px; border-radius: 8px; color: var(--green); background: var(--green-soft); font-size: 10px; }
.status-tag.rejected { color: var(--danger); background: #faeae6; }
.empty-state { padding: 60px 20px; color: var(--muted); text-align: center; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 30; display: none; align-items: end; background: rgba(14,31,24,.4); }
.sheet-backdrop.open { display: flex; }
.bottom-sheet { width: 100%; max-width: 520px; margin: 0 auto; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); border-radius: 25px 25px 0 0; background: var(--paper); animation: sheet-up .22s ease; }
@keyframes sheet-up { from { transform: translateY(30%); opacity: .5; } }
.sheet-handle { width: 42px; height: 5px; margin: 0 auto 21px; border-radius: 99px; background: #d8d9d3; }
.bottom-sheet h2 { margin: 0 0 7px; font-size: 22px; }
.bottom-sheet > p { margin: 0 0 15px; color: var(--muted); }
.feedback-options { display: grid; gap: 8px; }
.feedback-option { min-height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; text-align: left; background: white; }
.feedback-option.selected { color: var(--green); border-color: var(--green); background: var(--green-mist); font-weight: 700; }
.bottom-sheet textarea { min-height: 78px; margin-top: 12px; padding: 12px; border-radius: 13px; }
.bottom-sheet .button { width: 100%; margin-top: 13px; }

.bottom-nav { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; display: flex; max-width: 520px; margin: 0 auto; padding: 8px 20px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(23,108,69,.08); background: rgba(255,254,251,.96); backdrop-filter: blur(14px); }
.bottom-nav.hidden { display: none; }
.bottom-nav button { flex: 1; border: 0; color: #8a918c; background: transparent; font-size: 11px; }
.bottom-nav span { display: block; margin-bottom: 2px; font-size: 22px; }
.bottom-nav button.active { color: var(--green); font-weight: 700; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); max-width: calc(100% - 40px); padding: 11px 15px; border-radius: 12px; color: white; background: rgba(14,46,35,.94); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .2s; text-align: center; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 600px) {
  body { padding: 24px 0; }
  .mobile-shell { max-width: 430px; min-height: calc(100dvh - 48px); border-radius: 30px; box-shadow: 0 24px 80px rgba(31,53,44,.18); overflow: hidden; }
  .screen { min-height: calc(100dvh - 48px); }
  .bottom-nav { bottom: 24px; max-width: 430px; border-radius: 0 0 30px 30px; }
}
