:root {
  --ink: #22332A; --moss: #3E5C46; --leaf: #5E8C61; --bud: #A9C5A0;
  --mist: #EDF2EC; --paper: #F7FAF6;
  --alert: #B4553B; --alert-soft: #F6E8E3;
  --ok: #3E7C4F; --ok-soft: #E4F0E6; --line: #D5E0D4;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Zen Kaku Gothic New', sans-serif; background: var(--paper); color: var(--ink); min-height: 100vh; line-height: 1.7; }
.wrap { max-width: 560px; margin: 0 auto; padding: 28px 20px 60px; }
header { text-align: center; margin-bottom: 24px; }
.mark { font-family: 'Shippori Mincho', serif; font-size: 34px; font-weight: 700; letter-spacing: 0.18em; color: var(--moss); }
.mark .dot { color: var(--leaf); }
.tagline { font-size: 13px; color: var(--leaf); letter-spacing: 0.12em; margin-top: 4px; }
.free-badge { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 700; color: var(--moss); background: var(--mist); border: 1px solid var(--bud); border-radius: 999px; padding: 3px 14px; letter-spacing: 0.08em; }

.field-label { font-size: 13px; font-weight: 700; color: var(--moss); margin: 18px 0 6px; letter-spacing: 0.08em; }
select {
  width: 100%; font-family: inherit; font-size: 15px; padding: 12px 14px;
  border: 1.5px solid var(--bud); border-radius: 12px; background: #fff; color: var(--ink);
}
.capture { background: var(--mist); border: 1.5px dashed var(--bud); border-radius: 16px; padding: 36px 24px; text-align: center; margin-top: 6px; }
.capture.has-img { padding: 16px; border-style: solid; }
.leaf-icon { font-size: 44px; margin-bottom: 10px; }
.capture p { font-size: 14px; color: var(--moss); margin-bottom: 18px; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
button { font-family: inherit; font-size: 15px; font-weight: 700; border: none; border-radius: 999px; padding: 13px 26px; cursor: pointer; transition: transform .1s, opacity .2s; }
button:active { transform: scale(0.97); }
button:focus-visible { outline: 3px solid var(--bud); outline-offset: 2px; }
.btn-primary { background: var(--moss); color: #fff; }
.btn-ghost { background: #fff; color: var(--moss); border: 1.5px solid var(--bud); }
.btn-analyze { background: var(--leaf); color: #fff; width: 100%; margin-top: 18px; font-size: 16px; padding: 15px; }
button:disabled { opacity: 0.5; cursor: default; }
#preview { max-width: 100%; max-height: 340px; border-radius: 12px; display: block; margin: 0 auto; }
.re-shoot { margin-top: 12px; font-size: 13px; padding: 9px 20px; }

.loading { display: none; text-align: center; padding: 40px 0; }
.loading.show { display: block; }
.sprout { font-size: 40px; display: inline-block; animation: sway 1.4s ease-in-out infinite; }
@keyframes sway { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
.loading p { font-size: 14px; color: var(--moss); margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .sprout { animation: none; } }

.result { display: none; margin-top: 24px; }
.result.show { display: block; }
.specimen { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.specimen-head { padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 11px; letter-spacing: 0.2em; color: var(--leaf); font-weight: 700; }
.plant-name { font-family: 'Shippori Mincho', serif; font-size: 25px; font-weight: 700; margin-top: 2px; }
.sub-note { font-size: 12px; color: #6B7F70; margin-top: 4px; }

.health-badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 6px 16px; border-radius: 999px; margin-top: 12px; }
.health-badge.ok { background: var(--ok-soft); color: var(--ok); }
.health-badge.ng { background: var(--alert-soft); color: var(--alert); }
.health-badge.unknown { background: var(--mist); color: var(--moss); }

.vitality { margin-top: 14px; padding: 12px 14px; background: var(--mist); border-radius: 10px; }
.vitality-label { font-size: 12px; font-weight: 700; color: var(--moss); letter-spacing: 0.1em; display: flex; justify-content: space-between; }
.vitality-bar { height: 8px; background: #fff; border-radius: 4px; margin-top: 6px; overflow: hidden; }
.vitality-fill { height: 100%; border-radius: 4px; width: 0; transition: width .8s ease; }
.vitality-note { font-size: 12px; color: #55685E; margin-top: 8px; }

.color-rows { margin-top: 10px; }
.color-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #55685E; margin-top: 5px; }
.color-row .cname { width: 92px; flex-shrink: 0; }
.color-row .cbar { flex: 1; height: 7px; background: var(--mist); border-radius: 4px; overflow: hidden; }
.color-row .cfill { height: 100%; border-radius: 4px; }
.color-row .cpct { width: 40px; text-align: right; }

.section { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: none; }
.section h3 { font-size: 13px; letter-spacing: 0.15em; color: var(--moss); font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.section h3::before { content: ""; width: 14px; height: 1.5px; background: var(--leaf); }
.section.alert h3 { color: var(--alert); }
.section.alert h3::before { background: var(--alert); }
.disease-name { font-family: 'Shippori Mincho', serif; font-size: 19px; font-weight: 600; color: var(--alert); margin-bottom: 6px; }
.section p { font-size: 14px; color: #40514A; }
.step-list { list-style: none; }
.step-list li { font-size: 14px; color: #40514A; padding: 9px 0 9px 30px; position: relative; border-bottom: 1px dotted var(--line); }
.step-list li:last-child { border-bottom: none; }
.step-list li::before { content: "✿"; position: absolute; left: 4px; color: var(--bud); font-size: 13px; }
.section.alert .step-list li::before { content: "→"; color: var(--alert); font-weight: 700; }
.phase { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: #fff; background: var(--leaf); border-radius: 999px; padding: 3px 14px; display: inline-block; margin: 12px 0 2px; }
.phase.now { background: var(--moss); }
.phase.long { background: var(--bud); color: var(--ink); }

.error-box { display: none; margin-top: 18px; padding: 16px 20px; background: var(--alert-soft); color: var(--alert); border-radius: 12px; font-size: 14px; }
.error-box.show { display: block; }
.disclaimer { font-size: 11px; color: #8FA396; text-align: center; margin-top: 22px; line-height: 1.8; }
input[type="file"] { display: none; }
