:root {
  --ink: #0E1512;
  --ink-2: #16201B;
  --ink-line: #2C3A33;
  --lime: #C6F432;
  --paper: #F3F4F0;
  --card: #FFFFFF;
  --muted: #5A635D;
  --muted-dark: #9FAAA3;
  --text-2: #2C342F;
  --line: #EDEFEA;
  --green: #146B47;
  --green-bg: #E3F4EA;
  --amber: #9A5B00;
  --amber-bg: #FBF1E2;
  --red: #B3261E;
  --red-bg: #FCEBE9;
  --display: 'Bricolage Grotesque', Inter, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font-family: Inter, system-ui, sans-serif; font-feature-settings: 'tnum' 1, 'cv11' 1; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.press { transition: transform .16s cubic-bezier(.2,.8,.2,1), background-color .16s ease; cursor: pointer; }
.press:active { transform: scale(.975); }
.press:focus-visible, input:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.rise { animation: rise .42s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ring { from { stroke-dashoffset: 126; } }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } .press { transition: none; } .ring circle.val { animation: none !important; } }

.app { max-width: 520px; margin: 0 auto; min-height: 100vh; padding-bottom: 96px; }

/* Hero */
.hero { background: var(--ink); color: #fff; padding: 20px 22px 28px; border-radius: 0 0 28px 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.03em; }
.loc-chip { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--ink-line); background: transparent; color: #E4E9E5; font-size: 13px; font-weight: 600; max-width: 60%; }
.loc-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(198,244,50,.18); }
.hero-body { display: flex; flex-direction: column; gap: 12px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-dark); }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 36px; line-height: 1; letter-spacing: -0.035em; }
.lime { color: var(--lime); }
.lede { margin: 0; font-size: 15px; line-height: 1.5; color: #B7C0BA; }
.where { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.btn-lime { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border: 0; border-radius: 999px; background: var(--lime); color: var(--ink); font-size: 16px; font-weight: 700; }
.place-form { display: flex; gap: 8px; }
.place-form input { flex: 1 1 auto; min-width: 0; height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--ink-line); background: var(--ink-2); color: #fff; font-size: 15px; }
.place-form input::placeholder { color: #8C978F; }
.btn-ghost { height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--ink-line); background: transparent; color: #E4E9E5; font-weight: 600; }
.area-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.area-chips:empty { display: none; }
.area-chip { flex: 0 0 auto; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--ink-line); background: transparent; color: #E4E9E5; font-size: 13px; font-weight: 600; }
.radius { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; margin-top: 6px; padding: 14px 16px; border-radius: 18px; background: var(--ink-2); }
.radius label { font-size: 13px; font-weight: 600; color: #E4E9E5; }
.radius output { font-family: var(--display); font-size: 20px; font-weight: 800; color: var(--lime); }
.radius input { grid-column: 1 / -1; width: 100%; accent-color: var(--lime); height: 28px; }
.ticks { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-dark); }
.back { align-self: flex-start; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 10px; border-radius: 999px; border: 1px solid var(--ink-line); background: transparent; color: #E4E9E5; font-size: 14px; font-weight: 600; }
.detail-head { display: flex; align-items: flex-start; gap: 16px; }
.detail-head > div:first-child { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-width: 0; }
.detail-name { font-size: 30px !important; }

/* Main */
main { padding: 20px 18px 8px; display: flex; flex-direction: column; gap: 14px; }
.status:empty { display: none; }
.status { padding: 12px 14px; border-radius: 14px; background: var(--card); font-size: 14px; color: var(--text-2); line-height: 1.5; }
.status.warn { background: var(--amber-bg); color: #6B4000; }
.status.error { background: var(--red-bg); color: var(--red); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.note { margin: 4px 4px 0; font-size: 12px; color: var(--muted); line-height: 1.55; }
.note a { color: #1F5A3D; }

.card { display: flex; flex-direction: column; gap: 12px; width: 100%; padding: 16px; border: 0; border-radius: 22px; background: var(--card); text-align: left; box-shadow: 0 1px 2px rgba(14,21,18,.05), 0 10px 30px rgba(14,21,18,.06); }
.pair { display: flex; align-items: stretch; gap: 14px; }
.rail { display: flex; flex-direction: column; align-items: center; padding-top: 5px; flex: 0 0 12px; }
.rail .from { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--ink); }
.rail .line { flex: 1 1 auto; width: 0; border-left: 2px dotted #B9C0B8; margin: 4px 0; }
.rail .to { width: 12px; height: 12px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 1.5px var(--ink); }
.names { display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; min-width: 0; }
.small-cap { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.from-name { font-size: 14px; font-weight: 500; color: #3E4741; }
.to-name { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.meta { font-size: 13px; color: var(--muted); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.tier { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tier.strong { background: var(--green-bg); color: var(--green); }
.tier.good { background: #EEF6D4; color: #3D5200; }
.tier.partial { background: var(--amber-bg); color: var(--amber); }
.tier.none { background: var(--line); color: var(--muted); }
.tier.dark { align-self: flex-start; background: #1B2621; color: var(--lime); }
.conf { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1.5px solid currentColor; }
.conf.high { color: var(--green); }
.conf.medium { color: var(--amber); }
.conf.low { color: var(--red); }
.scorecard { gap: 10px; }
.dim { display: grid; grid-template-columns: minmax(0, 1fr) 72px 30px; gap: 10px; align-items: center; font-size: 13px; }
.dim small { color: var(--muted); }
.dim .bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.dim .bar i { display: block; height: 100%; border-radius: 3px; }
.dim .bar i.ok { background: #7FA100; }
.dim .bar i.low { background: #C77A00; }
.dim .v { color: var(--muted); text-align: right; }
.closest { font-size: 13px; color: #3E4741; }
.closest b { font-weight: 600; }

.ring { position: relative; width: 58px; height: 58px; flex: 0 0 58px; align-self: center; }
.ring.big { width: 88px; height: 88px; flex-basis: 88px; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring circle.val { animation: ring 1s cubic-bezier(.2,.8,.2,1) both; }
.ring .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--display); font-size: 19px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.ring.big .num { font-size: 28px; }
.ring.big .num small { font-family: Inter, sans-serif; font-size: 10px; font-weight: 600; letter-spacing: .1em; color: var(--muted-dark); margin-top: 3px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 22px; border-radius: 22px; background: var(--card); text-align: center; }
.empty h2 { margin: 0; font-family: var(--display); font-size: 20px; letter-spacing: -0.02em; }
.empty p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.btn-dark { height: 46px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }

.facts { display: grid; gap: 1px; border-radius: 22px; overflow: hidden; background: #E3E6DF; }
.fact { background: var(--card); padding: 16px 18px; display: flex; gap: 14px; }
.fact .ico { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.fact h3 { margin: 0 0 3px; font-size: 13px; font-weight: 700; }
.fact p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.flag { display: flex; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--amber-bg); color: #6B4000; font-size: 14px; line-height: 1.45; }
.actions { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 10px; }
.btn-save { height: 54px; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-save.on { background: var(--lime); border-color: var(--lime); }
.actions .btn-dark { height: 54px; font-size: 15px; }

.fav { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--card); }
.fav .ico { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; background: #EEF1EA; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 18px; }
.fav .body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fav .title { font-size: 16px; font-weight: 600; }
.fav .why { font-size: 13px; color: var(--muted); line-height: 1.45; }
.icon-btn { width: 44px; height: 44px; flex: 0 0 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.add-form { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 22px; background: var(--card); }
.add-form h2 { margin: 0 0 4px; font-family: var(--display); font-size: 20px; letter-spacing: -0.02em; }
.add-form label { font-size: 13px; font-weight: 600; color: #3E4741; display: flex; flex-direction: column; gap: 6px; }
.add-form input, .add-form select { height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid #D5DAD3; background: #FBFCFA; font-size: 15px; }
.add-form .hint { font-weight: 400; color: var(--muted); }

.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; width: min(492px, calc(100% - 28px)); display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px; border-radius: 999px; background: var(--ink); box-shadow: 0 12px 30px rgba(14,21,18,.25); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center; border: 0; border-radius: 999px; background: transparent; color: #9FAAA3; font-size: 11px; font-weight: 600; }
.tab.active { background: #1B2621; color: var(--lime); }

.skeleton { height: 150px; border-radius: 22px; background: linear-gradient(90deg, #ECEEE9 0%, #F6F7F4 50%, #ECEEE9 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
