/* درخت کنکور — night orchard theme */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/vazirmatn.woff2") format("woff2-variations"), url("../fonts/vazirmatn.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}

:root {
  --sky-top: #0f0d2e;
  --sky-mid: #221a52;
  --sky-low: #3b2a6b;
  --horizon: #6b3f7a;
  --ink: #f4f0ff;
  --ink-2: rgba(244, 240, 255, .72);
  --ink-3: rgba(244, 240, 255, .5);
  --leaf: #74d17f;
  --leaf-deep: #2f8f57;
  --water: #7cc8ff;
  --water-deep: #3d8fe0;
  --apricot: #ffbd7a;
  --blossom: #f7a9c9;
  --danger: #ff8f8f;
  --panel: rgba(255, 255, 255, .065);
  --panel-2: rgba(255, 255, 255, .1);
  --line: rgba(255, 255, 255, .12);
  --sheet: #1d1847;
  --r-lg: 26px;
  --r-md: 16px;
  --r-sm: 10px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 66px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-feature-settings: "ss01";
  background: var(--sky-top);
  color: var(--ink);
  line-height: 1.75;
  font-size: 15px;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--water); text-decoration: none; }
:focus-visible { outline: 2px solid var(--water); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- sky ---------- */
.sky {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 60% at 50% 105%, rgba(255, 170, 120, .22), transparent 60%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 48%, var(--sky-low) 80%, var(--horizon) 100%);
}
.stars { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.stars i {
  position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff;
  opacity: .7; animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: .15; } }
.moon {
  position: absolute; width: 54px; height: 54px; border-radius: 50%;
  box-shadow: inset -12px 6px 0 0 #fff2cf; filter: drop-shadow(0 0 18px rgba(255, 240, 200, .35));
  transform: rotate(-20deg);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 13px 22px; font-weight: 700; font-size: 16px;
  transition: transform .15s ease, opacity .2s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-leaf { background: linear-gradient(180deg, #8de293, #4fb565); color: #0f2a17; box-shadow: 0 8px 26px -10px rgba(116, 209, 127, .8); }
.btn-water { background: linear-gradient(180deg, #a2dbff, #4aa3ef); color: #08233d; box-shadow: 0 10px 30px -10px rgba(124, 200, 255, .9); }
.btn-ghost { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.link-btn { background: none; border: 0; color: var(--water); padding: 6px; font-weight: 600; }

/* ---------- panels ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
h1, h2, h3 { line-height: 1.35; margin: 0; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.input, .select {
  width: 100%; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; font-size: 16px; outline: none; transition: border-color .2s, background .2s;
  -webkit-appearance: none; appearance: none;
}
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23c9c3e6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: 14px 50%; background-size: 12px 8px; background-repeat: no-repeat; padding-left: 34px; }
.select option { background: var(--sheet); }
.input:focus, .select:focus { border-color: var(--water); background: rgba(124, 200, 255, .07); }
.input.ltr { direction: ltr; text-align: right; letter-spacing: .5px; }
.field.err .input, .field.err .select { border-color: var(--danger); }
.field .hint { font-size: 12px; color: var(--danger); margin-top: 4px; display: none; }
.field.err .hint { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .05); border-radius: 999px; padding: 7px 14px;
  font-size: 14px; font-weight: 600; transition: background .15s, border-color .15s;
}
.chip[aria-pressed="true"] { background: rgba(116, 209, 127, .18); border-color: var(--leaf); color: #c9f5cd; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.check input { width: 20px; height: 20px; accent-color: var(--leaf); margin-top: 3px; flex: none; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

/* ---------- sheets & modals ---------- */
.scrim { position: fixed; inset: 0; background: rgba(5, 4, 20, .6); z-index: 50; opacity: 0; transition: opacity .25s; }
.scrim.open { opacity: 1; }
.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 51; max-height: 92dvh; overflow: auto;
  background: linear-gradient(180deg, #262058, var(--sheet)); border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(24px + var(--safe-b)); transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .6); border-top: 1px solid var(--line);
  max-width: 560px; margin-inline: auto;
}
.sheet.open { transform: none; }
.sheet .grip { width: 42px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .22); margin: 2px auto 14px; }
.sheet h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.sheet .sub { color: var(--ink-2); font-size: 14px; margin: 0 0 18px; }
.sheet-close { position: absolute; z-index: 20; top: 12px; left: 14px; cursor: pointer; touch-action: manipulation; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--panel-2); color: var(--ink); font-size: 20px; line-height: 1; }

.toast {
  position: fixed; top: calc(14px + var(--safe-t)); left: 50%; transform: translate(-50%, -150%); z-index: 90;
  background: #2b2463; border: 1px solid var(--line); padding: 11px 18px; border-radius: 14px; font-weight: 600; font-size: 14px;
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .6); transition: transform .3s cubic-bezier(.2, .8, .2, 1); max-width: calc(100% - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); }
.toast.err { border-color: rgba(255, 143, 143, .5); }

.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .3); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* tree sway (renderer adds class="ta-sway") */
.ta-sway { transform-origin: 0 0; animation: sway 7s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-.9deg); } 50% { transform: rotate(.9deg); } }

/* ---------- install guide ---------- */
.steps { list-style: none; padding: 0; margin: 0 0 18px; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.steps li::before {
  content: counter(s, persian); flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(124, 200, 255, .15); color: var(--water); font-weight: 800;
}
.steps .ico { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, .1); vertical-align: middle; margin-inline: 4px; }

/* ================= LANDING ================= */
.landing { min-height: 100dvh; overflow-x: hidden; }
.hero {
  position: relative; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  padding: calc(18px + var(--safe-t)) 20px 28px; text-align: center;
}
.hero .brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; color: var(--ink-2); align-self: stretch; justify-content: space-between; }
.hero .brand b { color: var(--ink); }
.hero .moon { top: calc(64px + var(--safe-t)); left: 13%; }
.hero-tree { width: min(92vw, 430px); aspect-ratio: 370 / 370; margin-top: 4vh; position: relative; }
.hero-tree svg { width: 100%; height: 100%; display: block; overflow: visible; }
.hero h1 { font-size: clamp(27px, 7.6vw, 40px); font-weight: 900; letter-spacing: -.5px; margin: 10px 0 10px; max-width: 15em; }
.hero p.lead { color: var(--ink-2); margin: 0 auto 22px; max-width: 26em; font-size: 15.5px; }
.hero .cta { display: flex; flex-direction: column; gap: 10px; width: min(100%, 360px); }
.counter-line { margin-top: 18px; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; max-width: 360px; text-align: start; }
.counter-line .dot { flex: none; }
.counter-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); box-shadow: 0 0 0 4px rgba(116, 209, 127, .2); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(116, 209, 127, 0); } }

.section { padding: 56px 20px; max-width: 620px; margin: 0 auto; }
.section h2 { font-size: 24px; font-weight: 900; margin-bottom: 8px; }
.section > p { color: var(--ink-2); margin: 0 0 24px; }
.how { display: grid; gap: 14px; }
.how-item { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; padding: 12px; }
.how-item .art { width: 92px; height: 92px; border-radius: 18px; background: rgba(0, 0, 0, .18); overflow: hidden; }
.how-item .art svg { width: 100%; height: 100%; }
.how-item h3 { font-size: 16px; font-weight: 800; }
.how-item p { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }
.how-item .step { color: var(--apricot); font-weight: 800; font-size: 13px; }
.mini-map { position: relative; border-radius: var(--r-lg); overflow: hidden; background: rgba(0, 0, 0, .2); border: 1px solid var(--line); }
.mini-map svg { width: 100%; height: auto; display: block; }
.foot { text-align: center; padding: 30px 20px calc(30px + var(--safe-b)); color: var(--ink-3); font-size: 12.5px; }
.stepper { display: flex; gap: 6px; margin-bottom: 14px; margin-inline-end: 48px; margin-top: 4px; }
.stepper i { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .14); }
.stepper i.on { background: var(--leaf); }

/* ================= APP ================= */
.app { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + var(--safe-b)); }
.view { display: none; }
.view.active { display: block; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; } }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(12px + var(--safe-t)) 18px 0; gap: 10px; }
.topbar .hi { font-size: 13px; color: var(--ink-2); }
.topbar .tname { font-size: 19px; font-weight: 900; line-height: 1.3; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: rgba(255, 189, 122, .14); color: var(--apricot); border: 1px solid rgba(255, 189, 122, .25); white-space: nowrap;
}
.pill.water { background: rgba(124, 200, 255, .12); color: var(--water); border-color: rgba(124, 200, 255, .25); }

.scene { position: relative; height: min(56dvh, 470px); min-height: 330px; overflow: hidden; }
.scene .moon { top: 22px; left: 24px; }
.scene .tree-wrap { position: absolute; inset: 0; display: flex; justify-content: center; align-items: flex-end; }
.scene .tree-wrap svg { height: 100%; width: auto; max-width: 112%; overflow: visible; }
.scene .tree-wrap .fadein { animation: treeIn .9s ease both; }
@keyframes treeIn { from { opacity: 0; filter: brightness(1.6) saturate(1.4); } }
.scene .badges { position: absolute; top: 12px; inset-inline-start: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; z-index: 2; }
.firefly { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff6a8; box-shadow: 0 0 10px 3px rgba(255, 240, 140, .7); animation: fly 9s ease-in-out infinite; opacity: 0; }
@keyframes fly { 10%, 90% { opacity: .9; } 50% { transform: translate(30px, -40px); } 100% { opacity: 0; transform: translate(-10px, -70px); } }
.drop { position: absolute; width: 8px; height: 13px; background: linear-gradient(180deg, #d3efff, var(--water)); border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; animation: fall .9s ease-in forwards; z-index: 3; }
@keyframes fall { from { transform: translateY(-40px); opacity: 0; } 15% { opacity: 1; } to { transform: translateY(var(--dy, 260px)); opacity: .2; } }
.ripple { position: absolute; bottom: 13%; left: 50%; width: 30px; height: 10px; margin-left: -15px; border: 2px solid rgba(124, 200, 255, .8); border-radius: 50%; animation: ripple 1s ease-out forwards; }
@keyframes ripple { to { transform: scale(8); opacity: 0; } }

.mood { text-align: center; margin: -6px 18px 0; }
.mood .stage { font-size: 13px; color: var(--ink-2); }
.mood .line { font-weight: 800; font-size: 17px; }
.health { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: 10px auto 0; max-width: 240px; }
.health i { display: block; height: 100%; border-radius: 8px; transition: width 1s ease, background 1s; }

.action { padding: 16px 18px 6px; }
.water-btn { width: 100%; padding: 17px 20px; font-size: 18px; border-radius: 22px; }
.watered {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px;
  background: rgba(116, 209, 127, .12); border: 1px solid rgba(116, 209, 127, .3);
}
.watered .ok { width: 38px; height: 38px; border-radius: 50%; background: var(--leaf); color: #0f2a17; display: grid; place-items: center; font-weight: 900; flex: none; }
.watered b { display: block; }
.watered span { font-size: 13px; color: var(--ink-2); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px 18px 0; }
.stat { text-align: center; padding: 12px 4px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); }
.stat b { display: block; font-size: 20px; font-weight: 900; line-height: 1.2; }
.stat span { font-size: 11.5px; color: var(--ink-2); }

.block { padding: 16px 18px 0; }
.block-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.block-title h3 { font-size: 15px; font-weight: 800; }
.cal { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; }
.cal i { aspect-ratio: 1; border-radius: 6px; background: rgba(255, 255, 255, .06); position: relative; }
.cal i.w { background: var(--leaf); }
.cal i.w1 { background: #2f6f45; } .cal i.w2 { background: #3f9a5a; } .cal i.w3 { background: #5cc06d; } .cal i.w4 { background: #9be7a0; }
.cal i.today { outline: 2px solid var(--water); outline-offset: 1px; }
.cal i.future { background: transparent; border: 1px dashed rgba(255, 255, 255, .1); }
.cal-legend { display: flex; gap: 6px; align-items: center; justify-content: flex-end; font-size: 11px; color: var(--ink-3); margin-top: 8px; }
.cal-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.card { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); margin-bottom: 10px; width: 100%; text-align: start; }
.card .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; font-size: 22px; }
.card .tx { flex: 1; min-width: 0; }
.card .tx b { display: block; font-size: 15px; }
.card .tx span { font-size: 13px; color: var(--ink-2); }
.card.bell .ic { background: rgba(255, 189, 122, .16); }
.card.inst .ic { background: rgba(124, 200, 255, .15); }
.card.share .ic { background: rgba(247, 169, 201, .16); }
.card.city .ic { background: rgba(116, 209, 127, .15); }

/* hours picker */
.hours-big { text-align: center; font-size: 56px; font-weight: 900; line-height: 1.1; margin: 8px 0 2px; }
.hours-big small { font-size: 18px; font-weight: 700; color: var(--ink-2); }
.range { width: 100%; -webkit-appearance: none; appearance: none; height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .12); outline: none; margin: 18px 0 8px; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: var(--water); border: 4px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--water); border: 4px solid #fff; }
.quick { display: flex; gap: 8px; justify-content: center; margin: 6px 0 20px; flex-wrap: wrap; }

/* bottom nav */
.nav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 40; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: rgba(20, 17, 52, .86); border-top: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.nav button { background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 11.5px; font-weight: 700; }
.nav button svg { width: 24px; height: 24px; }
.nav button.on { color: var(--leaf); }

/* ---------- map ---------- */
.map-head { padding: calc(14px + var(--safe-t)) 18px 8px; }
.map-head h2 { font-size: 21px; font-weight: 900; }
.map-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-2); }
.map-box { position: relative; margin: 6px 10px 0; border-radius: var(--r-lg); overflow: hidden; background: radial-gradient(90% 70% at 50% 40%, #241e5a, #151236); border: 1px solid var(--line); touch-action: none; aspect-ratio: 1000 / 940; max-height: 64dvh; width: auto; }
.map-box svg { width: 100%; height: 100%; display: block; }
.map-box .prov { stroke: rgba(255, 255, 255, .28); stroke-width: .9; vector-effect: non-scaling-stroke; transition: fill .4s; }
.map-box .prov.sel { stroke: #fff; stroke-width: 2; }
.map-box .city-dot { cursor: pointer; }
.map-tools { position: absolute; top: 10px; inset-inline-end: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.map-tools button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: rgba(20, 17, 52, .8); color: var(--ink); font-size: 20px; font-weight: 700; display: grid; place-items: center; }
.map-legend { position: absolute; bottom: 10px; inset-inline-start: 10px; right: auto; background: rgba(20, 17, 52, .78); border: 1px solid var(--line); border-radius: 12px; padding: 7px 10px; font-size: 11px; color: var(--ink-2); display: flex; gap: 10px; align-items: center; }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 4px; vertical-align: -1px; }
.map-attr { position: absolute; bottom: 4px; inset-inline-end: 10px; font-size: 9.5px; color: var(--ink-3); direction: ltr; }
.map-label { font-weight: 800; fill: #fff; paint-order: stroke; stroke: rgba(15, 13, 46, .85); pointer-events: none; }
.my-ring { fill: none; stroke: var(--apricot); stroke-width: 2; vector-effect: non-scaling-stroke; animation: myring 1.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes myring { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }

.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); width: 100%; text-align: start; }
.li .thumb { width: 46px; height: 46px; border-radius: 12px; background: rgba(0, 0, 0, .25); flex: none; overflow: hidden; }
.li .thumb svg { width: 100%; height: 100%; }
.li .tx { flex: 1; min-width: 0; }
.li .tx b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .tx span { font-size: 12.5px; color: var(--ink-2); }
.li .end { text-align: center; font-weight: 800; font-size: 14px; color: var(--apricot); white-space: nowrap; }
.li .end small { display: block; font-size: 10.5px; color: var(--ink-3); font-weight: 600; }
.li .rk { width: 26px; text-align: center; font-weight: 900; color: var(--ink-3); flex: none; }
.li.me { border-color: rgba(255, 189, 122, .5); background: rgba(255, 189, 122, .08); }
.li .bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); margin-top: 6px; overflow: hidden; }
.li .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--leaf-deep), var(--leaf)); border-radius: 6px; }
.dotw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-start: 4px; vertical-align: 1px; }
.empty { text-align: center; padding: 30px 10px; color: var(--ink-2); font-size: 14px; }

.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 14px; overflow-x: auto; }
.seg button { flex: 1; border: 0; background: none; padding: 8px 6px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: rgba(116, 209, 127, .16); color: #c9f5cd; }

.page { padding: calc(14px + var(--safe-t)) 18px 20px; max-width: 620px; margin: 0 auto; }
.page > h2 { font-size: 21px; font-weight: 900; margin-bottom: 4px; }
.page > p.sub { margin: 0 0 16px; font-size: 13.5px; color: var(--ink-2); }

.tree-modal .art { height: 300px; overflow: hidden; display: flex; justify-content: center; margin: -6px -20px 0; background: radial-gradient(80% 70% at 50% 30%, rgba(124, 200, 255, .08), transparent); }
.tree-modal .art svg { height: 100%; width: auto; overflow: visible; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 16px; }
.kv div { text-align: center; padding: 10px 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.kv b { display: block; font-size: 18px; font-weight: 900; }
.kv span { font-size: 11.5px; color: var(--ink-2); }

.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.profile-head .av { width: 64px; height: 64px; border-radius: 20px; background: rgba(0, 0, 0, .25); overflow: hidden; flex: none; }
.profile-head .av svg { width: 100%; height: 100%; }
.profile-head b { font-size: 18px; font-weight: 900; display: block; }
.group { margin-bottom: 18px; }
.group h3 { font-size: 13px; color: var(--ink-3); font-weight: 700; margin: 0 0 8px; }

.welcome { text-align: center; }
.welcome .art { height: 200px; }
.welcome .art svg { height: 100%; width: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media (min-width: 700px) {
  .app { max-width: 560px; margin: 0 auto; }
  .nav { max-width: 560px; margin: 0 auto; border-radius: 20px 20px 0 0; border-inline: 1px solid var(--line); }
}
#listSheet { max-height: 60dvh; }

/* =================== v1.1 — 3D scene, countdown, install, story =================== */
.pill-btn {
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(20, 17, 52, .45); color: var(--ink);
  border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13.5px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); white-space: nowrap;
}
.pill-btn.install-pill { background: linear-gradient(180deg, rgba(141, 226, 147, .95), rgba(79, 181, 101, .95)); color: #0f2a17; border-color: transparent; box-shadow: 0 6px 20px -8px rgba(116, 209, 127, .9); }
[data-install].busy { opacity: .6; pointer-events: none; }

/* landing hero with the 3D island */
.hero { padding-top: 0; }
.hero-stage { position: relative; width: calc(100% + 40px); margin: 0 -20px; height: min(60dvh, 560px); min-height: 360px; }
.hero-stage canvas { position: absolute; inset: 0; }
.hero-fallback { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.hero-fallback svg { height: 100%; width: auto; max-width: 100%; }
.hero .brand { position: absolute; top: calc(14px + var(--safe-t)); inset-inline: 18px; z-index: 3; }
.hero .brand b { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; }
.hero .brand b img { border-radius: 8px; }
.brand-actions { display: inline-flex; gap: 8px; }
.hero .moon { top: calc(70px + var(--safe-t)); left: 12%; z-index: 0; }
.hero-spacer { height: 6px; }
.hero h1 { margin-top: 0; }

/* app scene */
.scene { height: min(64dvh, 560px); min-height: 380px; }
.scene.is3d .tree-wrap { display: block; }
.scene .tree-wrap canvas { position: absolute; inset: 0; }
.scene .moon { top: auto; bottom: 62%; left: 22px; }
.scene-top {
  position: absolute; top: 0; inset-inline: 0; z-index: 3; display: flex; justify-content: space-between; align-items: flex-start;
  padding: calc(12px + var(--safe-t)) 16px 0; gap: 10px; pointer-events: none;
}
.scene-top > * { pointer-events: auto; }
.scene-top .hi { font-size: 13px; color: var(--ink-2); }
.scene-top .tname { font-size: 20px; font-weight: 900; line-height: 1.3; text-shadow: 0 2px 12px rgba(10, 8, 30, .6); }
.scene-top .install-pill { margin-top: 8px; font-size: 12.5px; padding: 6px 12px; }
.countdown {
  display: flex; flex-direction: column; align-items: center; min-width: 96px; padding: 9px 12px 8px; border-radius: 20px;
  background: rgba(20, 17, 52, .5); border: 1px solid rgba(255, 189, 122, .35); color: var(--ink);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .6);
}
.countdown b { font-size: 30px; font-weight: 900; line-height: 1.05; color: var(--apricot); }
.countdown span { font-size: 12px; font-weight: 700; }
.countdown small { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.countdown.urgent { border-color: rgba(255, 143, 143, .55); }
.countdown.urgent b { color: #ffa3a3; }
.scene .badges { top: auto; bottom: 46px; inset-inline-start: 16px; z-index: 3; }
.rotate-hint {
  position: absolute; bottom: 48px; inset-inline-end: 16px; z-index: 3; font-size: 11.5px; color: var(--ink-2);
  background: rgba(20, 17, 52, .45); padding: 4px 10px; border-radius: 999px; transition: opacity .8s; display: none;
}
.scene.is3d .rotate-hint { display: block; }
.rotate-hint.gone { opacity: 0; }

/* state card overlapping the scene */
.state-card {
  position: relative; z-index: 4; margin: -34px 14px 0; padding: 14px 16px 14px; border-radius: 24px;
  background: linear-gradient(180deg, rgba(43, 36, 99, .82), rgba(29, 24, 71, .9)); border: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 20px 50px -24px rgba(0, 0, 0, .7);
}
.sc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.state-card .stage { display: flex; align-items: center; gap: 8px; font-size: 12.5px; flex-wrap: wrap; }
.stage-chip { background: rgba(116, 209, 127, .16); color: #b8f0bd; border: 1px solid rgba(116, 209, 127, .3); padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: 12.5px; }
.state-card .line { font-weight: 800; font-size: 16.5px; margin-top: 4px; line-height: 1.5; }
.state-card .action { padding: 12px 0 0; }
.water-btn { position: relative; overflow: hidden; }
.water-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); transform: translateX(-120%); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 60%, 100% { transform: translateX(120%); } }
.wdrop { display: inline-block; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.mood, .health { display: none; }

/* konkur picker */
.kpick .kp-row { display: grid; grid-template-columns: 0.8fr 1.3fr 1fr; gap: 8px; }
.kpick .select { padding-inline-start: 12px; }
.kp-out { margin-top: 10px; text-align: center; font-weight: 800; color: var(--apricot); font-size: 15px; padding: 8px; border-radius: 12px; background: rgba(255, 189, 122, .1); }
.kp-out.bad { color: var(--danger); background: rgba(255, 143, 143, .1); }

/* install sheet */
.ins-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.ins-head img { border-radius: 14px; box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .6); }
.ins-head b { display: block; font-size: 16px; }
.ins-head span { font-size: 12px; color: var(--ink-3); direction: ltr; display: block; text-align: right; }
.steps .ico svg, .ig-bar svg, .ig-row svg { width: 20px; height: 20px; }
.steps .ico { color: var(--water); }
.ios-guide { margin-bottom: 16px; }
.ig-step { display: flex; gap: 12px; align-items: flex-start; margin: 12px 0 8px; }
.ig-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(124, 200, 255, .16); color: var(--water); font-weight: 900; flex: none; }
.ig-txt { font-size: 14.5px; line-height: 1.8; }
.ig-txt small { display: block; color: var(--ink-3); font-size: 12px; }
.ig-bar {
  direction: ltr; display: flex; justify-content: space-around; align-items: center; height: 54px; margin: 0 4px; border-radius: 18px;
  background: rgba(245, 245, 250, .1); border: 1px solid var(--line);
}
.ig-bar i { color: #8ec5ff; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; }
.ig-bar i.dim { opacity: .35; }
.ig-bar i.hot { background: rgba(124, 200, 255, .22); box-shadow: 0 0 0 0 rgba(124, 200, 255, .6); animation: hot 1.6s ease-out infinite; }
@keyframes hot { 0% { box-shadow: 0 0 0 0 rgba(124, 200, 255, .7); } 100% { box-shadow: 0 0 0 14px rgba(124, 200, 255, 0); } }
.ig-row { direction: ltr; display: flex; justify-content: space-between; align-items: center; margin: 0 4px; padding: 12px 16px; border-radius: 14px; background: rgba(245, 245, 250, .1); border: 1px solid rgba(124, 200, 255, .45); font-weight: 600; font-size: 15px; animation: hot 1.6s ease-out infinite; }
.sheet.tall { max-height: 94dvh; }

/* story */
.story-prev { display: grid; place-items: center; min-height: 240px; gap: 8px; margin: 10px 0 14px; }
.story-prev img { width: min(62%, 260px); border-radius: 18px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .8); border: 1px solid var(--line); -webkit-touch-callout: default; }
.hint-line { text-align: center; font-size: 13px; color: var(--ink-2); margin: 8px 0 0; }
.tree-modal .art.is3d { height: 320px; position: relative; margin: -6px -20px 0; }
.tree-modal .art.is3d canvas { position: absolute; inset: 0; }

/* v1.2 — SEO-friendly hero title + FAQ */
.hero .h1-brand { font-size: clamp(30px, 8.6vw, 44px); font-weight: 900; letter-spacing: -.5px; margin: 0 0 4px;
  background: linear-gradient(180deg, #ffffff, #c9f5cd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .h1-tag { font-size: clamp(18px, 5vw, 23px); font-weight: 800; margin: 0 0 10px; color: var(--ink); }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 800; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--leaf); font-size: 20px; font-weight: 700; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 14px; color: var(--ink-2); font-size: 14.5px; }
.foot b { color: var(--ink-2); }


/* ================= v1.3 ================= */
/* no blue highlight / no long-press save or copy of app text & images */
html, body { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
img, svg, canvas { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; }
input, textarea, select, .allow-select { user-select: text; -webkit-user-select: text; -webkit-touch-callout: default; }
.allow-save { -webkit-touch-callout: default; pointer-events: auto; }
::selection { background: transparent; }
input::selection, textarea::selection { background: rgba(116, 209, 127, .35); }

/* centre counselling button in nav */
.nav button, .nav-cta { min-width: 0; }
.nav-cta { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; padding-bottom: 8px; color: #ffd9a8; font-size: 11px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.nav-cta .cta-ic { width: 50px; height: 50px; margin-top: -24px; border-radius: 18px; display: grid; place-items: center; color: #2a1606;
  background: linear-gradient(145deg, #ffd59a, #ff9f5a); box-shadow: 0 10px 24px -8px rgba(255, 159, 90, .75), 0 0 0 5px rgba(20, 17, 52, .9); transform: rotate(-6deg); transition: transform .2s; }
.nav-cta .cta-ic svg { width: 24px; height: 24px; transform: rotate(6deg); }
.nav-cta:active .cta-ic { transform: rotate(0) scale(.94); }

/* smooth 3D start: loader, then fade/glide in (no flat-tree flash) */
.tree-loader { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-2); font-size: 13px; z-index: 1; transition: opacity .6s ease; pointer-events: none; }
.tree-loader i { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 50% 60%, #8de293 0 30%, transparent 32%), conic-gradient(from 0deg, rgba(116, 209, 127, 0), rgba(116, 209, 127, .9)); -webkit-mask: radial-gradient(circle, transparent 0 15px, #000 16px); mask: radial-gradient(circle, transparent 0 15px, #000 16px); animation: spin 1s linear infinite; }
.tree-wrap:not(.loading) .tree-loader, .hero-stage.ready .tree-loader { opacity: 0; }
.tree-wrap canvas, .hero-stage canvas { transition: opacity .9s ease; }

/* top-right actions: countdown + decorate */
.top-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.decor-btn { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 10px; border-radius: 14px; font-size: 12.5px; font-weight: 800; color: #ffe1f0;
  background: linear-gradient(135deg, rgba(247, 169, 201, .28), rgba(124, 200, 255, .22)); border: 1px solid rgba(247, 169, 201, .45); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 8px 22px -12px rgba(247, 169, 201, .8); }
.decor-btn span { font-size: 15px; animation: bob 2.4s ease-in-out infinite; display: inline-block; }
.decor-btn:active { transform: scale(.96); }

/* decor sheet: short so the island stays visible above it */
.decor-sheet { max-height: 58dvh; padding-bottom: 0; display: flex; flex-direction: column; background: #1d1847; }
.decor-sheet .sub { margin-bottom: 8px; font-size: 13px; }
#decorBody { overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px 10px; overscroll-behavior: contain; }
.d-h { font-size: 13.5px; font-weight: 900; color: var(--ink-2); margin: 10px 0 8px; }
.d-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.d-item { display: flex; flex-direction: column; gap: 5px; }
.d-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px 7px; border-radius: 16px; background: var(--panel-2); border: 1.5px solid var(--line); color: var(--ink); transition: transform .15s, background .2s, border-color .2s; }
.d-tile:active { transform: scale(.94); }
.d-e { font-size: 26px; line-height: 1.15; }
.d-n { font-size: 11px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.d-item.on .d-tile { background: rgba(116, 209, 127, .16); border-color: var(--leaf); box-shadow: 0 6px 18px -10px rgba(116, 209, 127, .9); }
.d-item.on .d-n { color: #c9f5cd; }
.d-colors { display: flex; justify-content: center; gap: 5px; flex-wrap: wrap; }
.d-dot { width: 17px; height: 17px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); padding: 0; }
.d-dot.on { border-color: #fff; transform: scale(1.18); }
.decor-save { position: sticky; bottom: 0; padding: 10px 0 calc(12px + var(--safe-b)); background: linear-gradient(180deg, rgba(29, 24, 71, 0), rgba(29, 24, 71, .98) 30%); }
.d-row { display: block; font-size: 13px; letter-spacing: 1px; margin-top: 2px; }
.d-row.big { font-size: 20px; text-align: center; margin: 4px 0 8px; }

/* one-tap reminder banner */
.push-banner { display: flex; align-items: center; gap: 12px; margin: 12px 14px 0; padding: 12px 14px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 189, 122, .2), rgba(247, 169, 201, .12)); border: 1px solid rgba(255, 189, 122, .4); }
.push-banner .pb-bell { font-size: 24px; animation: ring-bell 2.6s ease-in-out infinite; transform-origin: 50% 10%; }
.push-banner .pb-tx { flex: 1; min-width: 0; }
.push-banner .pb-tx b { display: block; font-size: 14.5px; }
.push-banner .pb-tx span { font-size: 12.5px; color: var(--ink-2); }
.push-banner .btn { flex: none; }
@keyframes ring-bell { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 82% { transform: rotate(-12deg); } 89% { transform: rotate(8deg); } 95% { transform: rotate(-4deg); } }

/* health ring */
.ring { position: relative; width: 72px; height: 72px; flex: none; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; overflow: visible; }
.ring .ring-arc { animation: ringIn 1.3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ringIn { from { stroke-dashoffset: var(--len); } }
.ring-val { position: relative; font-size: 17px; font-weight: 900; line-height: 1; margin-top: -7px; text-shadow: 0 0 14px currentColor; }
.ring-val i { font-style: normal; font-size: 11px; margin-inline-start: 1px; }
.ring small { position: absolute; bottom: 15px; font-size: 9px; color: var(--ink-3); font-weight: 700; }
.ring.full::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; box-shadow: 0 0 22px 2px rgba(110, 230, 150, .45); animation: glowPulse 2.6s ease-in-out infinite; }
.ring.full small { color: #a9efb2; }
@keyframes glowPulse { 50% { box-shadow: 0 0 34px 6px rgba(110, 230, 150, .2); } }

/* avatars */
.li .thumb.has-av { border-radius: 50%; background: linear-gradient(135deg, #8de293, #7cc8ff); padding: 2px; }
.li .thumb.has-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.tm-head { display: flex; align-items: center; gap: 10px; justify-content: center; }
.tm-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--leaf); flex: none; }
.av-btn { position: relative; padding: 0; border: 0; background: none; flex: none; }
.profile-head .av { display: block; width: 76px; height: 76px; border-radius: 24px; }
.profile-head .av.photo { border-radius: 50%; padding: 3px; background: linear-gradient(135deg, #8de293, #7cc8ff, #f7a9c9); }
.profile-head .av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.av-cam { position: absolute; bottom: -2px; inset-inline-end: -4px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--leaf); box-shadow: 0 0 0 3px var(--bg, #1b1745); }
.ph-tx { min-width: 0; }
.card.diman { background: linear-gradient(135deg, rgba(255, 189, 122, .16), rgba(43, 36, 99, .6)); border-color: rgba(255, 189, 122, .38); text-decoration: none; color: inherit; }
.card.diman .ic { background: rgba(255, 189, 122, .2); }
.card.tg { text-decoration: none; color: inherit; }
.card.tg .ic { background: rgba(95, 184, 255, .15); }
.ltr-inline { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* map weather */
.wx-cloud { animation: wxDrift 50s ease-in-out infinite alternate; opacity: .78; }
.wx-cloud.rain { opacity: .85; }
@keyframes wxDrift { from { transform: translateX(calc(var(--dx) * -1)); } to { transform: translateX(var(--dx)); } }
.wx-drop { stroke: #a9d4ff; stroke-width: 1.3; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: 0; animation: wxFall 1.1s linear infinite; }
@keyframes wxFall { 0% { opacity: 0; transform: translateY(0); } 20% { opacity: .9; } 100% { opacity: 0; transform: translateY(var(--dy, 30px)); } }
.wx-rain { --dy: 30px; }
.wx-rain .wx-drop { --dy: inherit; }
.wx-chip { position: absolute; top: 10px; inset-inline-start: 10px; z-index: 3; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.wx-chip span { font-size: 10.5px; font-weight: 700; padding: 2px 8px; opacity: .9; border-radius: 999px; background: rgba(20, 17, 52, .6); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--ink-2); width: fit-content; }
@media (prefers-reduced-motion: reduce) { .wx-cloud, .wx-drop, .decor-btn span, .push-banner .pb-bell { animation: none; } .wx-drop { opacity: .6; } }
.scrim.light { background: rgba(5, 4, 20, .14); }
.ring small { bottom: 16px; font-size: 8.5px; }
.ring-leaf { position: absolute; top: -6px; inset-inline-end: -4px; font-style: normal; font-size: 18px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); animation: bob 2.6s ease-in-out infinite; }

/* admin announcement card on home */
.ann-card { position: relative; margin: 12px 14px 0; padding: 14px 16px; border-radius: 20px; border: 1px solid rgba(116, 209, 127, .4);
  background: linear-gradient(135deg, rgba(116, 209, 127, .18), rgba(124, 200, 255, .1)); animation: fadein .5s ease both; }
.ann-card b { display: block; font-size: 15.5px; font-weight: 900; padding-inline-end: 28px; }
.ann-card p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.9; }
.ann-card .ann-btn { margin-top: 10px; background: var(--leaf); color: #0f2a17; text-decoration: none; }
.ann-card .ann-x { position: absolute; top: 8px; inset-inline-end: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); color: var(--ink-2); font-size: 18px; line-height: 1; }
.ann-card.ann-gold { border-color: rgba(255, 189, 122, .5); background: linear-gradient(135deg, rgba(255, 189, 122, .2), rgba(247, 169, 201, .1)); }
.ann-card.ann-gold .ann-btn { background: var(--apricot); color: #2a1606; }
.ann-card.ann-blue { border-color: rgba(124, 200, 255, .5); background: linear-gradient(135deg, rgba(124, 200, 255, .2), rgba(43, 36, 99, .4)); }
.ann-card.ann-blue .ann-btn { background: #7cc8ff; color: #08233d; }
.ann-card.ann-red { border-color: rgba(255, 143, 143, .5); background: linear-gradient(135deg, rgba(255, 143, 143, .18), rgba(43, 36, 99, .4)); }
.ann-card.ann-red .ann-btn { background: #ff9a9a; color: #3a0b0b; }
