:root {
  --bg: #F3EDE1;
  --paper: #FBF8F1;
  --text: #2B2A26;
  --text-2: #4F483C;
  --green: #2F4A3A;
  --green-2: #3B5A48;
  --terra: #A04A26;
  --mustard: #C9922E;
  --light: #E9B949;
  --line: #D6CBB5;
  --line-2: #BFB197;
  --serif: "Cormorant Garamond", Georgia, serif;
  --body: "Lora", Georgia, serif;
  --hand: "Caveat", cursive;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
  /* бумажная фактура */
  background-image:
    radial-gradient(rgba(79,72,60,.035) 1px, transparent 1px),
    radial-gradient(rgba(79,72,60,.025) 1px, transparent 1px);
  background-size: 7px 7px, 11px 11px;
  background-position: 0 0, 3px 5px;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }

/* ---------- типографика ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; line-height: 1.1; }
h1 { font-size: 34px; letter-spacing: -.01em; }
h2 { font-size: 26px; }
h3 { font-size: 21px; }
.hand { font-family: var(--hand); color: var(--terra); font-size: 22px; line-height: 1; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.caps { font-family: var(--serif); text-transform: uppercase; letter-spacing: .12em; font-size: 13px; font-weight: 600; }

.screen { padding: 20px 20px calc(110px + var(--safe-b)); animation: fadein .35s ease; }
.screen.ob { padding-bottom: calc(40px + var(--safe-b)); min-height: 100vh; display: flex; flex-direction: column; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.logo { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 26px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--paper); }

/* ---------- скотч ---------- */
.taped { position: relative; display: inline-block; }
.tape {
  position: absolute; height: 18px; width: 110px; background: rgba(201,146,46,.75);
  transform: rotate(-2deg); border-radius: 1px; box-shadow: 0 1px 0 rgba(0,0,0,.05);
}
.tape::before, .tape::after { content: ""; position: absolute; top: 0; bottom: 0; width: 6px; background: inherit;
  clip-path: polygon(0 0, 100% 15%, 0 30%, 100% 45%, 0 60%, 100% 75%, 0 90%, 100% 100%); }
.tape::before { left: -5px; transform: scaleX(-1); }
.tape::after { right: -5px; }

/* ---------- карточки ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 18px; }
.card.green { background: var(--green); color: #F3EDE1; border: 0; position: relative; }
.card.green .muted { color: rgba(243,237,225,.8); }
.dashed { border: 1.5px dashed var(--line-2); border-radius: 6px; padding: 14px 16px; }
hr.dots { border: 0; border-top: 1.5px dashed var(--line-2); margin: 0; }

/* ---------- кнопки ---------- */
.btn {
  display: block; width: 100%; padding: 15px 18px; border-radius: 999px; background: var(--green); color: #F7F1E5;
  font-family: var(--body); font-weight: 500; font-size: 16px; text-align: center; transition: transform .1s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn.terra { background: var(--terra); }
.link { color: var(--terra); font-family: var(--hand); font-size: 22px; }

.chip {
  display: block; width: 100%; text-align: center; padding: 13px 14px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; transition: all .15s;
}
.chip.sel { border-color: var(--green); background: #EEF1EA; color: var(--green); font-weight: 600; }
.chip.sel::after { content: " ✓"; }
.chips { display: grid; gap: 8px; }
.chips.row { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }

/* ---------- поля ---------- */
label.f { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
.input, textarea.input {
  width: 100%; padding: 13px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  font-size: 16px; outline: none;
}
.input:focus { border-color: var(--green); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.45; }
.hint { font-size: 12.5px; color: var(--text-2); margin-top: 5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin-top: 12px; }
.check input { width: 18px; height: 18px; accent-color: var(--green); margin-top: 2px; flex: none; }
.error { color: var(--terra); font-size: 14px; margin-top: 10px; }

/* ---------- онбординг ---------- */
.ob-step { margin-bottom: 6px; }
.ob-body { flex: 1; }
.ob-actions { margin-top: 22px; display: grid; gap: 10px; }
.lum-say { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0 18px; }
.lum-say .bubble { background: var(--paper); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 12px 14px; font-size: 16px; }
.bubble + .bubble { margin-top: 8px; }
.q-label { font-family: var(--serif); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--green); font-weight: 700; }

.lum-wrap { display: grid; place-items: center; }
.lum { width: 64px; height: 64px; flex: none; filter: drop-shadow(0 0 10px rgba(233,185,73,.55)); }
.lum.big { width: 120px; height: 120px; }
.lum.float { animation: float 4s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.lum.dim { filter: grayscale(.6) brightness(.85); opacity: .75; }
.boot { min-height: 100vh; display: grid; place-items: center; }

.rule { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 10px; opacity: 0; animation: fadein .5s ease forwards; }
.rule .ico { width: 40px; height: 40px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 20px; }

/* портрет проявляется */
.develop { text-align: center; padding-top: 18vh; }
.develop .lum { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { filter: drop-shadow(0 0 6px rgba(233,185,73,.4)); } 50% { filter: drop-shadow(0 0 28px rgba(233,185,73,.95)); } }
.develop-lines { margin: 26px auto 0; max-width: 260px; display: grid; gap: 10px; }
.develop-lines span { height: 10px; border-radius: 4px; background: linear-gradient(90deg, var(--line) 0%, var(--paper) 50%, var(--line) 100%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- портрет ---------- */
.portrait-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.portrait-head .lum { width: 40px; height: 40px; }
.arche { padding: 20px 18px; margin-top: 8px; }
.arche .tape { top: -9px; right: 22px; }
.arche h2 { font-size: 34px; margin: 4px 0 8px; color: #F7F1E5; }
.num-row { display: flex; gap: 14px; align-items: baseline; padding: 8px 0; }
.num-row .n { font-family: var(--serif); font-size: 30px; color: var(--terra); width: 24px; text-align: center; font-weight: 700; }
.num-row b { display: block; font-size: 15px; }
.num-row span { font-size: 14px; color: var(--text-2); }
.trait { margin: 8px 0; }
.trait .q { font-family: var(--hand); color: var(--terra); font-size: 19px; display: block; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { border: 1px solid var(--text-2); border-radius: 999px; padding: 4px 12px; font-size: 13.5px; }
.layer { margin-top: 10px; }
.layer.locked { position: relative; overflow: hidden; color: transparent; }
.layer.locked .fog { position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(214,203,181,.35) 0 6px, rgba(251,248,241,.5) 6px 12px);
  backdrop-filter: blur(3px); display: grid; place-items: center; color: var(--text-2); font-family: var(--hand); font-size: 20px; }
.layer.locked h3 { color: var(--text-2); }

/* ---------- путь ---------- */
.greet { margin: 2px 0 16px; }
.greet .tape { left: 45%; bottom: -8px; width: 120px; opacity: .85; z-index: -1; }
.stage-card { padding: 18px 18px 16px; overflow: hidden; }
.stage-card .caps { color: rgba(243,237,225,.75); }
.stage-card h2 { color: #F7F1E5; margin-top: 6px; font-size: 28px; }
.trail { width: 100%; height: auto; display: block; margin: 8px 0 4px; }
.stage-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; font-size: 14px; color: rgba(243,237,225,.85); }
.stage-foot .hand { color: var(--light); font-size: 24px; white-space: nowrap; }
.overgrown-note { background: rgba(243,237,225,.12); border-radius: 8px; padding: 10px 12px; margin-top: 10px; font-size: 14px; }

.section-title { margin: 24px 0 8px; }
.task { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1.5px dashed var(--line-2); text-align: left; width: 100%; }
.task:last-child { border-bottom: 0; }
.task .circle { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--green); flex: none; display: grid; place-items: center; color: #fff; }
.task.done .circle { background: var(--green); }
.task.done .t { text-decoration: line-through; text-decoration-color: var(--line-2); color: var(--text-2); }
.task .t { font-family: var(--serif); font-weight: 700; font-size: 18px; display: block; line-height: 1.2; }
.task .s { font-size: 14px; color: var(--text-2); }
.task .pts { margin-left: auto; font-family: var(--hand); color: var(--terra); font-size: 26px; }
.daynum { display: flex; gap: 14px; align-items: center; margin-top: 16px; }
.daynum .big { font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--green); font-weight: 700; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.stat { text-align: center; padding: 10px 6px; }
.stat b { font-family: var(--serif); font-size: 26px; display: block; color: var(--green); line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--text-2); }

.row-link { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; width: 100%; text-align: left; margin-top: 10px; }

/* ---------- нижняя навигация ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #EFE7D6; border-top: 1px solid var(--line);
  padding: 8px 0 calc(8px + var(--safe-b)); display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 480px; margin: 0 auto;
}
.tab { display: grid; justify-items: center; gap: 2px; font-size: 13px; color: var(--text-2); }
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--green); font-weight: 600; }

/* ---------- листы ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(43,42,38,.35); z-index: 30; animation: fadein .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: var(--bg); border-radius: 18px 18px 0 0;
  max-height: 92vh; overflow-y: auto; padding: 18px 20px calc(24px + var(--safe-b)); max-width: 480px; margin: 0 auto;
  animation: up .3s ease; box-shadow: 0 -8px 30px rgba(0,0,0,.12);
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto 14px; }
.energy { display: flex; gap: 8px; }
.energy button { flex: 1; height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font-family: var(--serif); font-size: 22px; font-weight: 700; }
.energy button.sel { background: var(--light); border-color: var(--mustard); }
.moods { display: flex; flex-wrap: wrap; gap: 8px; }
.moods .chip { width: auto; padding: 10px 14px; }
.reply-card { margin-top: 14px; }
.gain { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; }
.gain .hand { font-size: 28px; }

/* ---------- профессии / практики ---------- */
.list-item { display: block; width: 100%; text-align: left; margin-bottom: 10px; }
.list-item h3 { font-size: 20px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: #EEF1EA; color: var(--green); margin-bottom: 6px; }
.steps { padding-left: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 10px 0 10px 40px; border-bottom: 1.5px dashed var(--line-2); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 8px; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--terra); color: var(--terra); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; }

/* ---------- разговор ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; padding-bottom: 80px; }
.msg { max-width: 84%; padding: 10px 14px; border-radius: 16px; font-size: 15.5px; white-space: pre-wrap; }
.msg.a { background: var(--paper); border: 1px solid var(--line); border-top-left-radius: 4px; align-self: flex-start; }
.msg.u { background: #DFE8D6; align-self: flex-end; border-top-right-radius: 4px; }
.msg.typing { color: var(--text-2); font-style: italic; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(62px + var(--safe-b)); z-index: 19; padding: 8px 16px; background: var(--bg);
  display: flex; gap: 8px; max-width: 480px; margin: 0 auto; }
.composer input { flex: 1; border-radius: 999px; }
.composer .btn { width: auto; padding: 0 18px; }

.toast { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); background: var(--green); color: #F7F1E5; padding: 10px 16px;
  border-radius: 999px; z-index: 50; font-size: 14px; animation: fadein .25s; max-width: 90%; text-align: center; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 15px; margin-bottom: 12px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
