// i18n.jsx — 런타임 KO/EN 텍스트 교체 (섹션 파일 무수정)
(function(){
  const MAP = {
    "사용법":"How it works",
    "베타 신청":"Join beta",
    "CLOSED BETA · 모집 중":"CLOSED BETA · Now accepting",
    "사기 전에,":"Before you buy,",
    "왜 사는지":"know why",
    "부터.":"first.",
    "Keitta는 투자 판단을 비춥니다.":"Keitta reflects your investment decisions.",
    "결과 말고, 판단 자체를요.":"Not the outcome — the judgment itself.",
    "베타 신청하기":"Apply for beta",
    "어떻게 쓰나요?":"How does it work?",
    "손실 났을 때 진짜 답답한 건,":"The real frustration after a loss —",
    "왜 샀는지 기억이 안 난다는 것.":"you can't remember why you bought.",
    "어제는 분명한 이유였는데,":"Yesterday it was a clear reason,",
    "떨어지고 나면 흐려진다.":"but once it drops, it blurs.",
    "그 이유가 뭐였는지,":"What that reason was,",
    "진짜 분석이었는지,":"whether it was real analysis,",
    "아니면 그냥 분위기였는지.":"or just the mood.",
    "“그때 왜 샀더라…”":"\u201cWhy did I buy that again…\u201d",
    "“이게 진짜 분석이었나?”":"\u201cWas this really analysis?\u201d",
    "“그냥 분위기에 휩쓸린 건가?”":"\u201cDid I just get swept up?\u201d",
    "가입 전에,":"Before signing up,",
    "직접":"try it",
    "해보세요":"yourself",
    "익명화된 과거 상황 하나. 30초면 됩니다.":"One anonymized past situation. Takes 30 seconds.",
    "상황 · 종목명 가림":"SITUATION · TICKER HIDDEN",
    "어느 성장주. 3일 연속 상한가로 12,800원 → 24,500원.\n커뮤니티는 \"지금 놓치면 바보\". 하지만 실적·계약 뉴스는 없습니다.":"A growth stock. Up the daily limit 3 days straight, 12,800 \u2192 24,500.\nThe community: \"Miss this and you're a fool.\" But no earnings or contract news.",
    "3일 수익률":"3-day return","거래량":"Volume","8.4배":"8.4\u00d7","관련 뉴스":"Related news","없음":"None",
    "당신이라면?":"What would you do?","산다":"Buy","관망":"Wait","더 알아본다":"Research more",
    "매매 직전, 판단을 적어두는 곳.":"Where you note your judgment, right before trading.",
    "적기":"Write",
    "매수든 매도든, 누르기 전에 한 줄.\n\"왜\" 사고 싶은지.":"Buy or sell — one line before you tap.\nWhy you want to.",
    "실적 발표 직전이라 단기 반등 기대.":"Earnings due soon, expecting a short-term rebound.",
    "2026.05.04 · 오후 2:14":"2026.05.04 · 2:14 PM",
    "보기":"Reflect",
    "AI가 그 한 줄을 분석합니다.\n점수 아니라 — 어떤 부분에서\n흔들리는지 보여줍니다.":"AI analyzes that line.\nNot a grade — it shows where\nyou wavered.",
    "근거의 구체성":"Reasoning specificity","반대 시나리오":"Counter-scenario","손절 기준":"Stop-loss rule",
    "다시 보기":"Review",
    "1주 후, 1개월 후 — 그때의 가설과 지금의\n현실을 나란히 봅니다. 판정은 없습니다.\n보는 건 당신이에요.":"A week later, a month later — your thesis then,\nnext to reality now. No verdict.\nYou're the one who looks.",
    "1주":"1wk","후":"later","1개월":"1mo","1년":"1yr",
    "흐름은 이렇습니다.":"Here's the flow.",
    "매수·매도 종목과 이유를 적습니다.":"Write the ticker you buy/sell and why.",
    "한 줄이면 충분합니다.":"One line is enough.",
    "AI가 그 판단을 살펴봅니다.":"AI examines that judgment.",
    "근거·감정·시점을 분리해서 봅니다.":"It separates reasoning, emotion, and timing.",
    "강점과 빈틈을 보고서로 정리합니다.":"It sums up strengths and gaps in a report.",
    "점수 아니라, 흔들린 부분을 짚어줍니다.":"Not a score — it points out where you wavered.",
    "시간이 지나면 다시 알려줍니다.":"After a while, it reminds you again.",
    "“그때 판단, 어땠다고 보세요?”":"\u201cThat judgment — how do you see it now?\u201d",
    "개인 투자자들의 이야기를":"We listened to",
    "들어봤습니다.":"individual investors.",
    "베타를 준비하며 만난 분들에게서 반복해서 나온 말들입니다.":"Phrases we heard again and again from people we met while preparing the beta.",
    "이 말들이 Keitta가 시작된 자리입니다.":"These words are where Keitta began.",
    "“샀을 땐 분명히 이유가 있었는데,\n며칠 지나면 그냥 흐려져요.”":"\u201cThere was a clear reason when I bought,\nbut a few days later it just blurs.\u201d",
    "판단의 근거가 시간이 지나면 휘발됨":"The basis of a judgment evaporates over time",
    "“커뮤니티 분위기였는지,\n진짜 분석이었는지 헷갈려요.”":"\u201cWas it community hype, or real\nanalysis? I can't tell.\u201d",
    "감정 신호와 분석의 분리가 어려움":"Hard to separate emotional signals from analysis",
    "“수익률은 보이는데,\n그때 내 판단은 안 보이거든요.”":"\u201cI can see the returns, but not\nmy judgment at that moment.\u201d",
    "결과 데이터는 있지만 판단 자체가 기록되지 않음":"Outcome data exists, but the judgment itself isn't recorded",
    "“나중에 다시 보면 좋겠다 싶은데,\n막상 어디 적어두진 않게 되더라고요.”":"\u201cI'd love to review it later, but\nI never actually end up writing it down.\u201d",
    "회고의 필요는 있지만 기록 도구가 없음":"The need to reflect exists, but no tool to record",
    "위 인용은 베타 준비 과정에서 만난 분들의 말을 정리한 것입니다. 통계가 아니라, 반복해서 들렸던 결의 이야기입니다.":"The quotes above are drawn from people we met while preparing the beta. Not statistics — recurring themes we kept hearing.",
    "베타에서, 그리고 그 이후에도":"In beta, and beyond —",
    "지키려는 것들.":"what we hold to.",
    "수익률로 판단을 평가하지 않습니다.":"We don't grade judgment by returns.",
    "점수가 재는 것은 과정입니다 — 근거·반대·위험을\n따졌는지. 맞고 틀림은 시장이 정합니다.":"The score measures the process — whether you weighed\nreasoning, counterpoints, and risk. Right or wrong is the market's call.",
    "광고처럼 말하지 않습니다.":"We don't talk like an ad.",
    "결과를 부풀리거나 손실을 위협으로 쓰지 않습니다.\n담담한 거울이 되는 것이 목표입니다.":"We won't inflate results or use loss as a threat.\nOur aim is to be a plain mirror.",
    "기록은 사용자의 것입니다.":"Your records are yours.",
    "입력한 판단은 암호화되어 저장되며,\n학습 목적의 외부 공유는 없습니다. 언제든 전체 삭제 가능합니다.":"Your entries are stored encrypted, never shared\nexternally for training. Deletable anytime, in full.",
    "자주 묻는 것들.":"Frequently asked.",
    "베타는 무료인가요?":"Is the beta free?",
    "네, 클로즈드 베타 기간 동안은 무료입니다. 정식 출시 이후 요금 정책은 별도로 안내드립니다.":"Yes, it's free during the closed beta. Pricing after the official launch will be announced separately.",
    "매매 데이터를 직접 가져가나요?":"Do you pull my trading data?",
    "제 기록은 안전한가요?":"Are my records safe?",
    "AI는 어떤 기준으로 판단을 분석하나요?":"On what basis does the AI analyze judgment?",
    "안드로이드/iOS 둘 다 되나요?":"Is it on both Android and iOS?",
    "지금은 클로즈드 베타입니다.":"We're in closed beta.",
    "먼저 써볼 분을 모집하고 있습니다.":"We're recruiting early users.",
    "신청해주시면 검토 후 안내드립니다. 무료입니다.":"Apply and we'll review and get back to you. It's free.",
    "이메일":"Email","이름 / 닉네임":"Name / nickname",
    "신청 이유 / 투자 경험 (선택)":"Why you're applying / investing experience (optional)",
    "개인정보 수집·이용에 동의합니다 (이메일·이름·신청 이유, 베타 운영 목적).":"I agree to the collection and use of my personal data (email, name, reason — for beta operation).",
    "신청하기 →":"Apply \u2192",
    "개인정보처리방침":"Privacy Policy","이용약관":"Terms","베타 약관":"Beta Terms","문의":"Contact",
    // 데모 화면 UI + 시나리오
    "TRY IT":"TRY IT",
    "가입 전에, 직접 해보세요":"Try it yourself before signing up",
    "이유 · 복수 선택":"REASONS · SELECT ALL",
    "왜 그렇게 하고 싶었나요? 해당되는 걸 다 골라주세요.":"Why did you want to? Pick all that apply.",
    "결과 보기":"See result",
    "당신 판단에서 보인 것":"WHAT SHOWED IN YOUR JUDGMENT",
    "이 종목은 뭐였을까?":"What was this stock?",
    "공개":"REVEAL",
    "내 진짜 판단으로 해보기 → 베타 신청":"Try it with your real judgment \u2192 Join beta",
    "↺ 다른 상황으로 다시 해보기":"\u21ba Try another situation",
    "과거 사례이며 특정 종목·시점의 매매를 권유하지 않습니다.":"A past example; not a recommendation to trade any specific stock or timing.",
    "더 오를 것 같아서":"It looked like it'd rise more",
    "다들 사니까":"Because everyone's buying",
    "오른 이유를 모르겠어서":"I don't know why it rose",
    "잃어도 되는 만큼만":"Only what I can afford to lose",
    "이 상황은":"This situation was","이었습니다.":".",
    "고른 이유만 비춰본 거예요. 산다·관망 중 뭘 골랐는지는 채점하지 않아요 — 그건 시장이 정하니까요.":"We only reflected the reasons you picked. Whether you chose Buy or Wait isn't graded — the market decides that.",
    "— 결과는 아무도 모릅니다.":"— nobody knows the outcome.",
    "Keitta가 보는 건 결과가 아니라, 방금 그 '과정'이에요.":"What Keitta looks at isn't the outcome — it's the 'process' you just went through.",
    "입력한 판단 기록은 암호화 저장되며, 학습 목적의 외부 공유는 없습니다. 언제든 전체 삭제 가능합니다.":"Your judgment records are stored encrypted, never shared externally for training. Deletable anytime, in full.",
    "보유 중인 종목이 하루 만에 −18%. 특별한 개별 악재는 없고,\n시장 전체가 약세. 커뮤니티엔 \"지금이라도 던져라\" 글이 쏟아집니다.":"A stock you hold drops −18% in a day. No specific bad news,\njust a weak market. The community floods with \"dump it now.\"",
    "구독자 많은 전문가가 \"이 종목은 무조건 2배\"라고 단언합니다.\n과거 추천도 몇 번 적중했다고. 영상 속 근거를 직접 확인하진 않았습니다.":"A popular expert insists \"this one's a sure 2x.\"\nSays past picks hit a few times. You haven't verified the video's basis yourself.",
    "어느 종목이 고점 대비 −60%. PER은 업종 평균의 절반.\n\"이 가격이면 무조건 싸다\"는 생각이 듭니다. 최근 공시는 안 봤습니다.":"A stock is −60% off its high. PER is half the sector average.\n\"At this price it must be cheap,\" you think. You haven't checked recent filings.",
    "어제 −15% 손절했습니다. 아직 속이 쓰린데, 오늘 다른 종목이 급등 중.\n\"어제 잃은 거 이걸로 만회하면?\" 평소보다 크게 넣고 싶어집니다.":"You cut a loss at −15% yesterday. Still stings, and today another stock is surging.\n\"What if I make it back with this?\" You want to bet bigger than usual.",
    "오늘 상장한 종목. 공모가 대비 벌써 +80%, 계속 오릅니다.\n\"올해 최고 IPO\"라는 말도. 다만 상장 직후 부정적 뉴스도 하나 보입니다.":"A stock that IPO'd today. Already +80% over the offering price, still rising.\nSome call it \"the year's best IPO.\" But there's one negative headline right after listing.",
    "당일":"Today","평가손":"Paper loss","−240만":"−2.4M","개별 악재":"Company news",
    "목표가":"Target","전문가 추천":"Expert pick","있음":"Yes","직접 검증":"Verified","안 함":"No",
    "고점 대비":"Off high","업종 1/2":"½ sector","최근 공시":"Recent filing","미확인":"Unchecked",
    "어제 손실":"Yest. loss","오늘 급등주":"Today's mover","투입 계획":"Plan to bet","평소 2배":"2× usual",
    "공모가 대비":"vs offer","상장":"Listing","오늘":"Today","부정 뉴스":"Neg. news","1건":"1",
    "더 빠질 것 같아서":"It'll probably drop more","지켜보기 힘들어서":"It's hard to just watch","다들 파니까":"Because everyone's selling","살 때 근거가 깨졌는지 보려고":"To check if my thesis broke",
    "전문가가 확신하니까":"Because the expert is certain","예전에 적중한 적 있어서":"They've hit before","말이 그럴듯해서":"It sounds convincing","근거를 직접 확인하려고":"To verify the basis myself",
    "싸 보여서":"It looks cheap","예전엔 더 비쌌으니까":"It used to be pricier","반등하면 크게 먹으니까":"A rebound would pay big","싼 이유를 먼저 보려고":"To first see why it's cheap",
    "어제 손실을 만회하려고":"To recover yesterday's loss","크게 넣어야 빨리 되니까":"Betting big to recover fast","지금 안 하면 늦을 것 같아서":"It'll be too late if I wait","하루 쉬고 판단하려고":"To pause a day first",
    "올해 최고라고 하니까":"They call it the year's best","계속 오르고 있어서":"It keeps rising","부정 뉴스는 사소해 보여서":"The bad news seems minor","며칠 안정되면 다시 보려고":"To revisit once it settles",
    "\"더 오를 것 같다\"는 느낌은 방향이지 근거가 아니에요.":"\"It'll rise more\" is a hunch about direction, not a reason.",
    "\"다들 사니까\" — 남의 확신은 나의 근거가 될 수 없어요.":"\"Everyone's buying\" — someone else's conviction can't be your reason.",
    "오른 이유를 모른다면, 내릴 이유도 모른다는 뜻이에요.":"If you don't know why it rose, you don't know why it'd fall either.",
    "잃어도 되는 크기를 먼저 정한 건, 리스크를 본 판단이에요.":"Setting a size you can afford to lose first is judgment that saw the risk.",
    "\"더 빠질 것 같다\"는 공포이지, 악재 분석이 아니에요.":"\"It'll drop more\" is fear, not analysis of the news.",
    "못 견디겠다는 감정은 진짜예요 — 다만 그게 매도 근거는 아니에요.":"The urge to escape is real — but it isn't a reason to sell.",
    "\"다들 파니까\" — 커뮤니티의 공포는 바닥 신호일 때도 많아요.":"\"Everyone's selling\" — community fear is often a bottom signal.",
    "매수 근거가 유효한지 먼저 확인하는 건, 과정을 지킨 판단이에요.":"Checking whether your buy thesis still holds is judgment that kept the process.",
    "전문가의 확신도 편향의 이유가 될 수 있어요 — 적중률은 대개 50~60%.":"An expert's certainty can itself be a bias — hit rates are usually 50–60%.",
    "몇 번의 적중은 실력을 가리기엔 표본이 너무 작아요.":"A few hits is too small a sample to tell skill from luck.",
    "설득력과 정확성은 다른 거예요. 스토리가 매력적일수록 데이터를 봐야 해요.":"Persuasiveness isn't accuracy. The better the story, the more you must check the data.",
    "남의 결론을 내 데이터로 검증하려는 건, 과정을 지킨 판단이에요.":"Verifying someone's conclusion with your own data is judgment that kept the process.",
    "\"싸 보이는 것\"과 \"실제로 싼 것\"은 달라요 — 왜 싼지가 먼저예요.":"\"Looks cheap\" and \"is cheap\" differ — why it's cheap comes first.",
    "과거 고점은 현재 가치와 무관해요. 그건 앵커일 뿐이에요.":"A past high is unrelated to present value. It's just an anchor.",
    "반등을 전제로 한 기대는, 하락 이유를 건너뛴 판단이에요.":"Expecting a rebound skips over the reason it fell.",
    "PER이 낮은 이유부터 확인하는 건, 과정을 지킨 판단이에요.":"Checking why the PER is low first is judgment that kept the process.",
    "\"만회\" 목적의 매매는 어제 손실과 오늘 종목을 뒤섞는 거예요.":"Trading to \"make it back\" mixes yesterday's loss with today's stock.",
    "손실 직후 크기를 키우는 건, 판단이 아니라 도박에 가까워요.":"Sizing up right after a loss is closer to gambling than judgment.",
    "\"지금 아니면 늦는다\"는 조급함 자체가 신호예요.":"\"Now or never\" — the impatience itself is a signal.",
    "손실 직후 냉각기를 두는 건, 감정과 판단을 분리하는 방법이에요.":"A cooling-off period after a loss separates emotion from judgment.",
    "\"최고\"라는 수식은 분위기예요 — 첫날 매수는 평균 이하 수익률로 알려져 있어요.":"\"The best\" is mood — first-day buys are known to underperform on average.",
    "오르는 중이라는 건 방향이지, 살 이유는 아니에요.":"Rising is a direction, not a reason to buy.",
    "부정적 정보를 작게 본 건, 보고 싶은 것만 본 판단일 수 있어요.":"Downplaying the negative may be seeing only what you want to see.",
    "변동성이 큰 첫날을 피해 재평가하려는 건, 과정을 지킨 판단이에요.":"Re-evaluating after the volatile first day is judgment that kept the process.",
    "2020년 어느 바이오주":"a 2020 biotech","2020년 3월, 어느 우량주":"a blue-chip, March 2020","2021년 어느 테마주":"a 2021 theme stock","2019년 어느 제조주":"a 2019 manufacturer","흔한 복수 매매 패턴":"a common revenge-trade pattern","2022년 어느 IPO":"a 2022 IPO",
    "그 후 60일: −41%":"Next 60 days: −41%","그 후 60일: +52%":"Next 60 days: +52%","그 후 60일: −29%":"Next 60 days: −29%","그 후 1년: −38%":"Next 1 year: −38%","연구 다수: 손실 직후 매매의 기대수익은 더 낮음":"Many studies: trades right after a loss have lower expected return","그 후 60일: −47%":"Next 60 days: −47%",
    "반대로 같은 패턴에서 +38% 더 간 사례도 있습니다":"Conversely, the same pattern rose +38% more in some cases",
    "물론 그대로 회복 못 한 종목도 있었습니다":"Of course, some names never recovered",
    "같은 해 전문가 추천이 크게 적중한 경우도 있었습니다":"That same year, some expert picks hit big too",
    "반대로 진짜 저평가였던 종목도 분명 있었습니다":"Conversely, some really were undervalued",
    "물론 그날 바로 회복한 사람도 있습니다 — 결과는 아무도 몰라요":"Of course, some recovered that very day — nobody knows the outcome",
    "반대로 첫날 사서 크게 번 IPO도 있었습니다":"Conversely, some IPOs paid big for first-day buyers",
    "PH::예: 비투자":"PH::e.g. Bee Tuja",
    "그거, 왜 사려는 거예요?":"So — why buy it?",
    "IS THIS FOR YOU":"IS THIS FOR YOU",
    "이런 분께 맞아요.":"This is for you.",
    "맞아요":"A fit","아니에요":"Not a fit",
    "개별 종목을 직접 판단해서 사는 분":"You pick individual stocks by your own call",
    "손실 뒤 \"내가 뭘 놓쳤지\" 생각해본 분":"After a loss, you've wondered \"what did I miss?\"",
    "판단 이유를 적어봤거나, 적어야지 하다 만 분":"You've written down your reasons — or meant to",
    "매수·매도 시그널이나 리딩을 원하는 분":"You want buy/sell signals or stock picks",
    "ETF·적립식만 하는 분":"You only do ETFs / recurring buys",
    "소액으로 재미로 하는 분 / 초단타 위주인 분":"You trade tiny for fun / mostly scalp",
    "Keitta는 리딩방·자동매매·수익 보장이 아닙니다.":"Keitta is not a stock-tip room, auto-trading, or a profit guarantee.",
    "ONE NOTE":"ONE NOTE",
    "판단 노트 한 장은 이렇게 남아요":"A judgment note looks like this",
    "한 줄을 적으면, 이런 되물음이 돌아와요.":"Write one line, and this reflection comes back.",
    "내가 적은 것":"WHAT I WROTE","돌아온 되물음":"WHAT CAME BACK",
    "어느 반도체주":"A chip stock","매수":"Buy",
    "\"실적 발표 직전이라 단기 반등을 기대. 최근 뉴스 흐름도 좋아 보임.\"":"\"Earnings are near, expecting a short rebound. Recent news flow looks good too.\"",
    "점수는 판정이 아니라, 무엇이 있었고 무엇이 비었는지를 표시할 뿐이에요.":"The score isn't a verdict — it just marks what was there and what was missing.",
    "나는 어떤 판단 성향일까?":"What's my judgment tendency?",
    "당신의 성향":"YOUR TENDENCY",
    "고정된 성격이 아니라, 훈련되는 판단 습관입니다.":"Not a fixed personality — a judgment habit you train.",
    "직감·속도형":"Instinct & Speed","신중·보존형":"Careful & Preserving","확신·독자형":"Conviction & Independent","분석·균형형":"Analysis & Balance",
    "판단 속 나를 확인하러 가기 → 베타 신청":"Meet the real me in my records → Join beta",
    "해당되는 항목을 골라주세요 (선택)":"Check what applies (optional)",
    "개별 종목을 직접 판단해서 삽니다":"I buy individual stocks by my own call",
    "손실 후 \"내가 뭘 놓쳤지\" 생각해본 적 있습니다":"After a loss, I've asked \"what did I miss?\"",
    "판단 이유를 적어본 적 있거나, 적고 싶었습니다":"I've written my reasons — or wanted to",
    "Keitta는 투자 판단 과정을 기록·반영하는 도구이며, 특정 종목·시점의 매매를 권유하지 않습니다.":"Keitta is a tool to record and reflect on your judgment process; it does not recommend buying or selling any specific security or timing.",
    "QUIZ":"QUIZ",
    "5개 질문 · 30초 · 가입 없이":"5 questions · 30 sec · no sign-up",
    "이런 분께":"This is for","맞아요":"you",
    "잘 맞아요":"A fit","잘 안 맞아요":"Not a fit",
    "판단 노트":"One judgment","한 장":"note","은 이렇게 남아요":"looks like this",
    "AI는 어떤 기준으로 판단을 분석하나요?":"How does the AI analyze my judgment?",
    "AI가 종목을 골라주지 않습니다. AI는 판단의 빈 곳만 비추며 — 근거의 구체성·감정 신호·시점 의존도 같은 축으로 한 줄을 분리해 보여줍니다. 옳다/틀리다가 아니라 흔들린 지점을 짚는 방식이며, 의견 제시는 설계로 금지돼 있습니다.":"The AI does not pick stocks. It only mirrors the gaps in your judgment — breaking your line down along axes like specificity of reasoning, emotional signals, and timing dependence. It points to where you wavered, not right/wrong — and by design it gives no opinions.",
    "과거 사례이며 특정 종목·시점의 매매를 권유하지 않습니다.":"A past case; not a recommendation to buy or sell any specific security or timing.",
    "이 기록은 이 기기에만 임시 저장돼요 · 서버 전송 없음":"This record is temporarily saved on this device only · never sent to a server",
    "시작하기":"Start",
    "매수든 매도든, 누르기 전에 한 줄.\n\"왜\" 사고 싶은지.":"Buy or sell, one line before you click.\nWhy you want to.",
    "AI가 그 한 줄을 분석합니다.\n점수 아니라 — 어떤 부분에서\n흔들리는지 보여줍니다.":"AI reads that one line.\nNot a score — it shows where\nyou wavered.",
    "1주 후, 1개월 후 — 그때의 가설과 지금의\n현실을 나란히 봅니다. 판정은 없습니다.\n보는 건 당신이에요.":"A week later, a month later — your hypothesis then,\nnext to reality now. No verdict.\nYou're the one who looks.",
    "1,000명":"1,000 people",
    "“샀을 땐 분명히 이유가 있었는데,\n며칠 지나면 그냥 흐려져요.”":"“There was a clear reason when I bought,\nbut days later it just fades.”",
    "“커뮤니티 분위기였는지,\n진짜 분석이었는지 헷갈려요.”":"“Was it the community mood,\nor real analysis? I can't tell.”",
    "“수익률은 보이는데,\n그때 내 판단은 안 보이거든요.”":"“I can see the returns,\nbut not the judgment I made then.”",
    "“나중에 다시 보면 좋겠다 싶은데,\n막상 어디 적어두진 않게 되더라고요.”":"“I wish I could look back later,\nbut I never actually write it down.”",
    "점수가 재는 것은 과정입니다 — 근거·반대·위험을\n따졌는지. 맞고 틀림은 시장이 정합니다.":"The score measures the process — whether you weighed\nreasoning, the counter-case, and risk. Right or wrong is the market's call.",
    "결과를 부풀리거나 손실을 위협으로 쓰지 않습니다.\n담담한 거울이 되는 것이 목표입니다.":"We don't inflate outcomes or use loss as a threat.\nThe goal is to be a calm mirror.",
    "입력한 판단은 암호화되어 저장되며,\n학습 목적의 외부 공유는 없습니다. 언제든 전체 삭제 가능합니다.":"Your entries are stored encrypted, never shared externally\nfor training. You can delete everything anytime.",
    "아니요. 사용자가 직접 입력한 매매 종목과 한 줄 이유만 다룹니다. 증권사 연동은 베타에서 다루지 않습니다.":"No. It only handles the ticker and one-line reason you enter yourself. Brokerage integration isn't part of the beta.",
    "근거의 구체성·감정 신호·시점 의존도 같은 축으로 한 줄을 분리해 보여줍니다. 옳다/틀리다가 아니라 흔들린 지점을 짚는 방식입니다.":"It breaks your line down along axes like specificity of reasoning, emotional signals, and timing dependence. Not right/wrong — it points to where you wavered.",
    "베타는 모바일 웹으로 시작합니다. 정식 앱은 베타 피드백을 반영해 준비 중입니다.":"The beta starts as a mobile web app. A full app is in the works, shaped by beta feedback.",
    "예: 비투자":"e.g. Warren B.",
    "어떤 점이 궁금하신가요? 200자 이내.":"What are you curious about? Within 200 characters.",
    "실적 발표 직전이라 단기 반등을 기대. 최근 뉴스 흐름도 좋아 보임.":"Earnings are near, so I expect a short rebound. Recent news flow looks good too.",
    "좋아 보임":"looks good",
    "투자를 결정할 때 가장 크게 작용하는 건?":"What weighs most when you decide to invest?",
    "괜찮아 보이는 기회가 왔어요. 나는?":"A decent-looking opportunity shows up. I…",
    "늦기 전에 지금 들어간다":"Get in now before it's too late",
    "며칠 지켜보고 판단한다":"Watch a few days, then decide",
    "비중을 작게 시험 삼아":"Take a small position to test",
    "한 종목에 얼마나 담을 수 있나요?":"How much can you put into one stock?",
    "확신 서면 크게 간다":"Go big when I'm convinced",
    "정해둔 비중 안에서만":"Only within a preset allocation",
    "상황 보며 조절한다":"Adjust as the situation unfolds",
    "설문 속 당신":"the survey you",
    "직접 해보세요":"Try it yourself",
    "과정":"process",
    "어느 성장주. 3일 연속 상한가로 12,800원 → 24,500원.\n커뮤니티는 \"지금 놓치면 바보\". 하지만 실적·계약 뉴스는 없습니다.":"A growth stock. Three straight limit-ups, 12,800 → 24,500 won.\nThe community says \"a fool misses this.\" But there's no earnings or contract news.",
    "보유 중인 종목이 하루 만에 −18%. 특별한 개별 악재는 없고,\n시장 전체가 약세. 커뮤니티엔 \"지금이라도 던져라\" 글이 쏟아집니다.":"A stock you hold is −18% in a day. No specific bad news,\nthe whole market is weak. The community floods with \"dump it now.\"",
    "어느 종목이 고점 대비 −60%. PER은 업종 평균의 절반.\n\"이 가격이면 무조건 싸다\"는 생각이 듭니다. 최근 공시는 안 봤습니다.":"A stock is −60% off its high, P/E at half the sector average.\n\"At this price it must be cheap,\" you think. You haven't checked recent filings.",
    "어제 −15% 손절했습니다. 아직 속이 쓰린데, 오늘 다른 종목이 급등 중.\n\"어제 잃은 거 이걸로 만회하면?\" 평소보다 크게 넣고 싶어집니다.":"You cut −15% yesterday. Still stings, and today another stock is spiking.\n\"Recover yesterday's loss with this?\" You want to size up more than usual.",
    "오늘 상장한 종목. 공모가 대비 벌써 +80%, 계속 오릅니다.\n\"올해 최고 IPO\"라는 말도. 다만 상장 직후 부정적 뉴스도 하나 보입니다.":"A stock listed today. Already +80% over the offer price, still climbing.\nCalled \"the best IPO of the year.\" But there's one negative headline right after listing.",
    "기회에 빠르게 반응하는 성향이 보여요. 속도는 강점이지만, \"왜\"를 한 줄 남기면 반응이 판단이 됩니다.":"You tend to react fast to opportunity. Speed is a strength — but one line of \"why\" turns a reaction into a judgment.",
    "잃지 않으려는 감각이 앞서는 성향이에요. 그 신중함이 때로 좋은 기회를 지나치게 하기도 해요.":"Your instinct to avoid loss leads. That caution is a strength — but it can also let good chances pass.",
    "자기 기준으로 밀어붙이는 힘이 보여요. 반대 시나리오를 함께 적으면 그 힘이 더 단단해집니다.":"You push forward on your own criteria. Writing the opposing scenario too makes that strength sturdier.",
    "근거와 감정을 분리하려는 성향이에요. 판단을 기록으로 남길수록 이 성향은 더 또렷해져요.":"You tend to separate reasoning from emotion. The more you record your judgments, the clearer this becomes.",
    "이건":"This is","'설문 속 당신'":"'the survey you'","입니다. Keitta의":". Keitta's","22가지 투자 유형":"22 investor types","은 설문으로 얻을 수 없어요 — 당신의":"can't be found by a survey — only your","실제 판단 기록":"actual judgment records","만이 증명합니다. 설문 속 나와 판단 속 나는, 자주 다릅니다.":"can prove it. The survey-you and the judgment-you are often different.",
    "개인 개발자가 만들고 운영합니다":"Built and run by one independent developer",
    "Keitta는 한 명의 개인 개발자가 만들고 직접 운영하는 서비스입니다.":"Keitta is built and run directly by one independent developer.",
    "만든 이유":"Why it was made",
    "(여기에 만든 이유가 들어갑니다 — 2~3문장.)":"(The reason it was made goes here — 2–3 sentences.)",
    "연락처":"Contact",
    "당신이 판단할 때":"When you decide,",
    "근거에":"The reasoning has","구체적 수치":"specific numbers",
    "는 없어요 — \"좋아 보임\"은 인상이에요.":" — none. \"Looks good\" is just an impression.",
    "가 비어 있어요 — 실적이 빗나가면?":" is empty — what if earnings miss?",
    "이 적혀 있지 않아요.":" isn't written down.",
    "근거 구체성":"Reasoning","낮음":"Low",
    "만드는 사람":"About",
    "암호화 저장":"Encrypted","종목 추천 없음":"No stock picks","내 기록은 언제든 삭제·내보내기":"Delete or export anytime",
    "나는 어떤":"What's my","판단 성향":"investing decision style","일까?":"?",
    "다음":"Next",
    "결과 보기":"See result",
    "다시 검사하기":"↺ Retake",
    "↺ 다시 검사하기":"↺ Retake",
    "당신의 유형":"YOUR TYPE",
    "관심 종목이 하루 +15% 급등. 관련 뉴스는 아직 없어요. 나는?":"A watchlist stock jumps +15% in a day. No news yet. I…",
    "일단 조금이라도 산다":"Buy at least a little",
    "이유를 찾을 때까지 관망":"Wait until I find a reason",
    "오른 건 언젠가 떨어진다, 관심 끈다":"What goes up comes down — I pass",
    "보유 종목이 −20%. 나는?":"A stock I hold is −20%. I…",
    "더 빠지기 전에 판다":"Sell before it drops more",
    "산 이유가 아직 유효한지 본다":"Check if my buy reason still holds",
    "평단 낮추러 더 산다":"Buy more to lower my average",
    "내 판단이 최근 몇 번 맞았어요. 다음엔?":"My calls have been right lately. Next time?",
    "비중을 더 키운다":"Size up",
    "평소대로 간다":"Keep it as usual",
    "오히려 더 조심한다":"Actually get more careful",
    "투자 결정을 내릴 때 가장 많이 보는 건?":"When deciding, what do I look at most?",
    "커뮤니티·분위기":"Community & mood",
    "내 원칙·체크리스트":"My rules & checklist",
    "전문가·뉴스":"Experts & news",
    "손실이 났을 때 나는?":"When I take a loss, I…",
    "빨리 만회할 종목을 찾는다":"Look for a stock to recover fast",
    "왜 틀렸는지 기록한다":"Write down why I was wrong",
    "한동안 거래를 쉰다":"Pause trading for a while",
    "점수를 매기는 검사가 아니에요.":"This isn't a test that scores you.",
    "어디에 기우는지":"which way you lean",
    "를 비춰봐요.":" — it reflects that.",
    "불꽃 추격형":"The Chaser","신중 방어형":"The Guardian","확신 주도형":"The Conviction","균형 관찰형":"The Observer",
    "기회를 놓치기 싫어 빠르게 움직여요. '왜'를 한 줄 남기는 것만으로, 추격이 판단으로 바뀝니다.":"You move fast, hating to miss out. Just one line of 'why' turns chasing into judgment.",
    "손실을 피하려는 감각이 강해요. 가끔은 그 신중함이 좋은 기회를 지나치게 하기도 해요.":"Your instinct to avoid loss is strong. Sometimes that caution lets good chances pass.",
    "자기 판단을 밀어붙이는 힘이 있어요. 반대 시나리오를 적어두면 그 힘이 더 단단해집니다.":"You have the drive to push your own calls. Noting a counter-scenario makes that drive sturdier.",
    "근거와 감정을 분리해서 봐요. Keitta가 비추려는 판단 습관에 가장 가까운 유형이에요.":"You separate reasoning from emotion — the habit Keitta aims to reflect, closest of all.",
    "내 판단 습관, 기록으로 확인하기 → 베타 신청":"See your judgment habits in records → Join beta",
    "PH::어떤 점이 궁금하신가요? 200자 이내.":"PH::What are you curious about? Within 200 chars.",
    // ── 12문항 지원서 (Wave 5D 영어판) — CTA·고지·스텝·문항·선택지·placeholder ──
    "베타 지원하기 · 100명 한정 · 3분":"Apply for beta · Limited to 100 · 3 min",
    "답변을 읽고 초대 순서를 정합니다. 3분 정도 걸립니다.":"We read every answer to decide invite order. Takes about 3 minutes.",
    "베타 1세대 혜택":"Beta founder perks",
    "영구 배지 — 베타 1세대 표시가 계정에 남습니다.":"Permanent badge — a beta-founder mark stays on your account.",
    "프리미엄 1개월 무료 — 베타 기간을 포함해 적용됩니다.":"One month of Premium, free — applied including the beta period.",
    "먼저 써볼 분을 모집하고 있습니다. 무료입니다.":"We're inviting a first group to try it. It's free.",
    "지원서가 접수되었습니다.":"Your application has been received.",
    "답변을 읽고 초대 순서를 정해 이메일로 안내드릴게요.":"We'll read your answers, set the invite order, and email you.",
    "이 단계 문항은 모두 선택입니다. 건너뛰어도 됩니다.":"Every question in this step is optional — feel free to skip.",
    "개인정보 수집·이용에 동의합니다 (이메일·이름·지원서 응답, 베타 운영 목적).":"I agree to the collection and use of my personal data (email, name, application answers) for beta operation.",
    "다음 →":"Next →",
    "← 이전":"← Back",
    "건너뛰기 →":"Skip →",
    "지원서 제출 →":"Submit application →",
    "전송 중…":"Sending…",
    "어떻게 알고 오셨나요?":"How did you hear about us?",
    "투자 경험은 어느 정도인가요?":"How much investing experience do you have?",
    "주로 어떤 자산에 투자하시나요?":"What do you mainly invest in?",
    "투자 결정은 얼마나 자주 하시나요?":"How often do you make investment decisions?",
    "판단 근거를 적어본 경험이 있나요?":"Have you ever written down your reasoning?",
    "안 한다면 / 관뒀다면 이유는?":"If you don't — or stopped — why?",
    "투자 후 돌아보는 편인가요?":"Do you tend to look back after investing?",
    "감정이 투자 결정에 미치는 영향은?":"How much does emotion affect your decisions?",
    "겪어본 적 있는 상황을 골라주세요":"Pick any situations you've been through",
    "투자 결정에서 가장 불편한 점은? (선택)":"What feels hardest about deciding? (optional)",
    "베타에서 기대하는 것 한 가지":"One thing you're hoping for from the beta",
    "15분 인터뷰에 응해주실 수 있나요?":"Could you join a 15-minute interview?",
    "기타":"Other",
    "6개월 미만":"Under 6 months","6개월~2년":"6 months–2 years","2~5년":"2–5 years","5년 이상":"5+ years",
    "국내주식":"Domestic stocks","해외주식":"Foreign stocks","코인":"Crypto","ETF·펀드":"ETFs · funds",
    "주 여러 번":"Several times a week","주 1회쯤":"About once a week","월 1~2회":"1–2 times a month","드묾":"Rarely",
    "자주 한다":"Often","가끔 한다":"Sometimes","거의 안 한다":"Almost never","해본 적 없다":"Never have",
    "귀찮아서":"Too much hassle","도구가 없어서":"No tool for it","필요성 못 느껴서":"Didn't feel the need","기록해도 달라질 게 없을 것 같아서":"Felt it wouldn't change anything","기록하는 편이다":"I do tend to record",
    "자주":"Often","수익 나면":"When I'm up","손실 나면":"When I'm down",
    "많이":"A lot","어느 정도":"Somewhat","별로":"Not really","전혀":"Not at all",
    "남들 따라 샀다 후회":"Bought following others, then regretted it","손실 무서워 매도 못 함":"Too afraid of loss to sell","충동 결정":"An impulsive decision","나중에 감정적이었음을 깨달음":"Realized later I'd been emotional","해당 없음":"None of these",
    "예":"Yes","아니오":"No",
    "PH::이름 / 닉네임 (선택)":"PH::Name / nickname (optional)",
    "PH::자유롭게 적어주세요. 200자 이내.":"PH::Write freely — up to 200 characters.",
    "PH::짧게 적어주세요. 120자 이내.":"PH::Keep it short — up to 120 characters."
  };

  const store = new WeakMap();
  // 초기 언어: 저장된 선택(localStorage) 우선 → 없으면 navigator.language 기반 ko/en → 기본 ko.
  let lang = (function(){
    try {
      const saved = localStorage.getItem('keitta-landing-lang');
      if (saved === 'ko' || saved === 'en') return saved;
      return String(navigator.language || '').toLowerCase().startsWith('en') ? 'en' : 'ko';
    } catch(e){ return 'ko'; }
  })();

  function swapText(root){
    const w = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);
    let n;
    while ((n = w.nextNode())){
      const raw = n.nodeValue;
      const key = raw.trim();
      if (!key) continue;
      if (lang === 'en'){
        if (MAP[key]){
          if (!store.has(n)) store.set(n, raw);
          const lead = raw.match(/^\s*/)[0], trail = raw.match(/\s*$/)[0];
          n.nodeValue = lead + MAP[key] + trail;
        }
      } else {
        if (store.has(n)){ n.nodeValue = store.get(n); }
      }
    }
    // placeholders
    root.querySelectorAll('input,textarea').forEach(el=>{
      const cur = el.getAttribute('placeholder'); if(cur==null) return;
      const key = 'PH::'+cur.trim();
      if (lang==='en'){
        if (MAP[key]){ if(!el.dataset.phKo) el.dataset.phKo = cur; el.placeholder = MAP[key].replace('PH::',''); }
      } else if (el.dataset.phKo){ el.placeholder = el.dataset.phKo; }
    });
  }

  let scheduled = false;
  function apply(){
    const root = document.getElementById('root'); if(!root) return;
    swapText(root);
    document.documentElement.lang = lang;
  }
  function schedule(){ if(scheduled) return; scheduled = true; requestAnimationFrame(()=>{ scheduled=false; apply(); }); }
  window.KEITTA_REAPPLY = function(){ apply(); };
  window.KEITTA_GETLANG = function(){ return lang; };

  window.KEITTA_SETLANG = function(l){
    lang = l; apply();
    try { localStorage.setItem('keitta-landing-lang', l); } catch(e){}  // 선택 기억(다음 방문 우선)
    try { window.dispatchEvent(new CustomEvent('keitta:lang', { detail: l })); } catch(e){}
    document.querySelectorAll('[data-langbtn]').forEach(b=>{
      const on = b.getAttribute('data-langbtn')===l;
      b.style.background = on ? '#7C5CFC' : 'transparent';
      b.style.color = on ? '#fff' : '#7C5CFC';
    });
  };

  function mountToggle(){
    if (document.getElementById('lang-toggle')) return;
    const box = document.createElement('div');
    box.id = 'lang-toggle';
    box.style.cssText = 'position:fixed;top:16px;right:16px;z-index:2000;display:inline-flex;border:1px solid rgba(124,92,252,.35);border-radius:999px;overflow:hidden;background:rgba(255,255,255,.92);backdrop-filter:blur(6px);box-shadow:0 4px 16px rgba(124,92,252,.18);font-family:Inter,system-ui,sans-serif';
    ['ko','en'].forEach((l,i)=>{
      const b = document.createElement('button');
      b.setAttribute('data-langbtn', l);
      b.textContent = l.toUpperCase();
      b.style.cssText = 'border:0;'+(i?'border-left:1px solid rgba(124,92,252,.25);':'')+'padding:7px 14px;font-size:12px;font-weight:800;letter-spacing:.04em;cursor:pointer;background:'+(l===lang?'#7C5CFC':'transparent')+';color:'+(l===lang?'#fff':'#7C5CFC')+';transition:all .15s';
      b.onclick = ()=>window.KEITTA_SETLANG(l);
      box.appendChild(b);
    });
    document.body.appendChild(box);
  }

  function init(){
    mountToggle();
    const root = document.getElementById('root');
    if (root){
      const mo = new MutationObserver(()=>{ if(lang==='en') schedule(); });
      mo.observe(root, { childList:true, subtree:true, characterData:true });
    }
    if (lang === 'en') apply();  // 초기값이 en(저장/브라우저 언어)이면 즉시 스왑
  }
  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init);
  else init();
  // 늦은 React 마운트 대비 재시도
  let tries=0; const iv=setInterval(()=>{ mountToggle(); if(++tries>15) clearInterval(iv); }, 500);
})();
