
    :root{color-scheme:light;--ink:#1e3133;--muted:#778384;--paper:#f6f5ef;--white:#fff;--teal:#1e706f;--teal-dark:#155553;--teal-light:#e8f4f1;--border:#e5e9e4;--pink:#f7e5de;--orange:#b36c46;--radius:23px;--shadow:0 8px 30px #283e3a0d}
    *{box-sizing:border-box} html{font-size:16px}body{margin:0;background:#e5e9e4;font-family:-apple-system,BlinkMacSystemFont,"Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif;color:var(--ink)}button,input,textarea{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #a3d6cf;outline-offset:2px}
    .phone{max-width:520px;min-height:100dvh;margin:auto;background:var(--paper);position:relative;box-shadow:0 0 60px #1f3c3a1d;padding-bottom:calc(108px + env(safe-area-inset-bottom))}
    .top{display:flex;align-items:center;justify-content:space-between;padding:calc(17px + env(safe-area-inset-top)) 23px 14px;background:var(--paper)}.logo{display:flex;align-items:center;gap:12px}.mark{width:42px;height:42px;display:grid;place-items:center;border-radius:14px;background:var(--teal);color:white;font-family:serif;font-weight:800;font-size:23px}.overline{font-size:10px;letter-spacing:1.2px;color:#81928d;font-weight:800}.brand{font-size:19px;font-weight:850;letter-spacing:1px;margin-top:1px}.icon-btn{width:40px;height:40px;border:1px solid var(--border);border-radius:13px;background:white;font-size:19px;color:var(--ink)}
    .status{margin:0 23px 15px;border:1px solid #e3eae5;border-radius:13px;display:flex;align-items:center;gap:7px;padding:9px 12px;background:#fafbf8;font-size:12px;color:#688077}.status b{font-weight:750}.dot{height:7px;width:7px;background:#e1ad62;border-radius:50%;flex-shrink:0}.status.connected .dot{background:#4eac7f}
    .content{padding:0 23px 24px}.eyebrow{font-size:12px;font-weight:850;letter-spacing:.7px;color:var(--teal);margin:15px 0 6px}.heading{font-size:29px;line-height:1.2;letter-spacing:-.9px;margin:0;font-weight:850}.sub{font-size:13px;color:var(--muted);line-height:1.65;margin:9px 0 22px}
    .card{background:white;border-radius:var(--radius);border:1px solid var(--border);padding:20px;box-shadow:var(--shadow);margin-bottom:16px}.card-title{display:flex;align-items:center;justify-content:space-between;margin:0 0 12px;font-size:13px;font-weight:850;color:#405857}.pill{display:inline-flex;align-items:center;padding:4px 9px;font-size:11px;background:var(--teal-light);color:var(--teal-dark);font-weight:750;border-radius:100px}.pill.neutral{background:#f4f1ec;color:#8a7767}.field{border:1px solid var(--border);border-radius:16px;background:#fcfcf8;width:100%;min-height:113px;padding:14px;resize:vertical;line-height:1.5;color:var(--ink);font-size:16px}.field.japanese-field{min-height:86px}.helper{font-size:12px;line-height:1.6;color:var(--muted)}.row{display:flex;gap:9px}.row>*{flex:1}.small-btn{border:1px solid var(--border);background:white;border-radius:14px;padding:11px 8px;font-size:13px;font-weight:750;color:var(--ink)}.small-btn:disabled{opacity:.5;cursor:not-allowed}.primary{background:var(--teal);color:white;border:0;border-radius:15px;padding:15px 18px;font-weight:820;width:100%;font-size:15px;box-shadow:0 5px 14px #14746620}.primary:active{transform:translateY(1px)}.primary:disabled{opacity:.5}.outline{background:white;border:1px solid #bad7d0;color:var(--teal);border-radius:15px;padding:14px 17px;font-weight:800}.two{display:flex;gap:9px;align-items:center;margin-top:10px}.two .primary{flex:1}.mic{display:flex;align-items:center;justify-content:center;gap:8px;background:#f1f6f2;color:var(--teal);border:1px solid #cfe3d8;border-radius:15px;padding:13px 16px;font-weight:820;font-size:14px}.mic.recording{background:#f8e6df;color:#a94d43;border-color:#e2bab0;animation:pulse 1.2s infinite}@keyframes pulse{50%{box-shadow:0 0 0 7px #efc1b130}}
    .result{border:1px solid #d9e5db;background:linear-gradient(160deg,#fdfefd,#f2f8f4);border-radius:21px;padding:20px;margin-top:16px}.tag-row{display:flex;justify-content:space-between;gap:8px;align-items:center}.jp{font-family:"Hiragino Kaku Gothic ProN","Yu Gothic","Noto Sans JP",sans-serif;font-size:27px;line-height:2.15;font-weight:800;letter-spacing:-.4px;margin:13px 0 8px;word-break:break-word}ruby{ruby-position:over}rt{color:var(--teal);font-size:10px;letter-spacing:.3px;font-weight:650}ruby.no-reading rt{display:none}.cn{font-size:14px;line-height:1.65;color:#6c7b7b;padding-top:11px;border-top:1px solid #e0e9e4}.result-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:17px}.result-actions button{background:white;border:1px solid #dce5df;border-radius:12px;padding:11px 13px;font-weight:750;color:var(--teal-dark);font-size:13px}.result-actions .emph{background:var(--teal);border-color:var(--teal);color:white}.notice{border-left:3px solid #d6a367;background:#fff9eb;padding:11px 13px;border-radius:0 9px 9px 0;font-size:12px;color:#7b6852;margin-top:13px;line-height:1.55}
    .chiprow{display:flex;gap:7px;overflow:auto;padding-bottom:4px;scrollbar-width:none}.chiprow::-webkit-scrollbar{display:none}.chip{border:1px solid var(--border);border-radius:50px;background:white;white-space:nowrap;padding:9px 13px;font-size:13px;color:#5c6b6c;font-weight:750}.chip.active{background:var(--teal);border-color:var(--teal);color:white}.qtitle{display:flex;justify-content:space-between;align-items:center;margin:18px 0 10px}.qtitle h3{margin:0;font-size:14px}.qtitle span{font-size:12px;color:#95a09a}
    .phrase{display:flex;align-items:center;justify-content:space-between;text-align:left;width:100%;border:1px solid var(--border);border-radius:17px;background:#fff;padding:15px;margin-bottom:9px;gap:10px;box-shadow:0 3px 9px #243a3208}.phrase-main{font-size:15px;font-weight:800;line-height:1.4}.phrase-sub{font-size:12px;color:var(--muted);margin-top:4px;line-height:1.45;font-weight:500}.arrow{font-size:18px;color:#8da59f}.reply{width:100%;text-align:left;padding:14px 15px;border-radius:14px;background:white;border:1px solid var(--border);margin-bottom:8px}.reply .rja{font-weight:760;font-size:17px;line-height:1.5}.reply .rcn{font-size:12px;color:var(--muted);margin-top:4px}.reply .rja rt{font-size:9px}.empty{text-align:center;border:1px dashed #cfded5;padding:24px 16px;border-radius:19px;background:#fafdF8;color:var(--muted);font-size:13px;line-height:1.7}.empty .emoji{font-size:28px;margin-bottom:7px}.empty b{color:var(--ink)}
    .bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);max-width:520px;width:100%;display:flex;background:#ffffffed;border-top:1px solid var(--border);padding:12px 14px calc(11px + env(safe-area-inset-bottom));box-shadow:0 -8px 25px #1a363611;backdrop-filter:blur(15px);z-index:20}.nav-btn{flex:1;border:0;background:transparent;display:flex;flex-direction:column;align-items:center;gap:4px;color:#84928e;font-size:11px;font-weight:800;padding:8px 5px;border-radius:14px}.nav-btn .nicon{font-size:22px;line-height:1}.nav-btn.active{background:var(--teal-light);color:var(--teal)}
    .tab{display:none}.tab.active{display:block}.switcher{display:flex;gap:10px;align-items:center;font-size:12px;color:var(--muted)}.switcher input{accent-color:var(--teal);width:17px;height:17px}.hr{height:1px;background:var(--border);margin:17px 0}.alert{font-size:12px;color:#91684c;background:#fff4e9;padding:12px;border-radius:12px;line-height:1.65;margin-top:9px}
    .modal-bg{position:fixed;inset:0;background:#142d2c75;display:none;z-index:40;align-items:end;justify-content:center}.modal-bg.open{display:flex}.modal{width:min(100%,520px);max-height:91dvh;overflow:auto;background:var(--paper);border-radius:24px 24px 0 0;padding:20px 23px calc(23px + env(safe-area-inset-bottom));box-shadow:0 -15px 50px #152b2850}.modal-top{display:flex;justify-content:space-between;align-items:center}.modal-top h2{font-size:21px;margin:0}.modal p{font-size:13px;color:#6c7c7b;line-height:1.65}.form-label{font-size:12px;font-weight:800;margin:16px 0 7px;display:block}.form-input{width:100%;border:1px solid var(--border);border-radius:12px;padding:12px;background:#fff}.big-jp{font-size:clamp(35px,8.5vw,50px);line-height:2.3;font-weight:900;text-align:center;margin:12px 0 14px}.big-jp rt{font-size:12px}.center{text-align:center}.showcase{background:white;padding:24px 18px;border-radius:20px;margin-top:18px}.toast{position:fixed;z-index:80;bottom:116px;left:50%;transform:translateX(-50%);max-width:min(90vw,440px);background:#243e3c;color:#fff;padding:12px 16px;border-radius:13px;box-shadow:0 7px 25px #243e3c30;font-size:13px;line-height:1.5;opacity:0;pointer-events:none;transition:opacity .2s}.toast.visible{opacity:1}.loader{display:inline-block;width:13px;height:13px;border:2px solid #ffffff60;border-top-color:white;border-radius:50%;animation:spin .6s linear infinite;margin-right:8px;vertical-align:-2px}@keyframes spin{to{transform:rotate(360deg)}}
    @media(min-width:580px){body{padding:20px 0}.phone{min-height:calc(100dvh - 40px);border-radius:26px;overflow:hidden}.bottom-nav{bottom:0}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
  

    /* v2 — Furigana-first, memory-first UI */
    .head-flag{margin:0 23px 16px;display:flex;align-items:center;gap:8px;font-size:12px;color:#39736a;font-weight:760}
    .head-flag i{width:7px;height:7px;border-radius:100%;background:#5bb58e;display:inline-block}
    .hint-strip{display:flex;align-items:center;gap:8px;justify-content:space-between;padding:11px 12px;border:1px solid #d6e7d8;border-radius:13px;background:#f0f7f1;font-size:12px;color:#326657;line-height:1.45;margin:9px 0 14px}
    .hint-strip strong{font-weight:820}.tiny-link{border:none;background:transparent;color:var(--teal);font-size:12px;font-weight:840;white-space:nowrap;text-decoration:underline;text-underline-offset:3px}
    .memory-panel{border:1px solid #cfdfd6;background:#eff7f2;border-radius:17px;padding:11px 12px;margin-top:13px}
    .memory-top{display:flex;justify-content:space-between;gap:8px;align-items:center;font-size:13px;font-weight:820;color:#326957}
    .mini-row{display:flex;align-items:center;gap:7px;margin-top:9px;flex-wrap:wrap}
    .category-button,.favorite-button{border:1px solid #cfe0d4;border-radius:12px;padding:9px 11px;background:#fff;font-size:12px;font-weight:820;color:#25605c;min-height:36px}
    .favorite-button.on,.star-button.on{color:#a86a2e;background:#fff6e7;border-color:#eed5aa}
    .tiny-muted{font-size:11px;line-height:1.5;font-weight:500;color:#758b83}
    .q-jp{font-family:'Hiragino Kaku Gothic ProN','Yu Gothic','Noto Sans JP',sans-serif;font-size:18px;line-height:2.45;font-weight:780;color:#254746;word-break:break-word;margin:0 0 1px}
    .q-jp rt{font-size:11px;color:#287b71;font-weight:720}
    .phrase-item{border:1px solid var(--border);border-radius:18px;background:#fff;padding:13px 14px;margin-bottom:10px;box-shadow:0 3px 9px #243a3207}
    .phrase-header{display:flex;align-items:center;justify-content:space-between;gap:10px}
    .phrase-header .phrase-cn{font-size:14px;font-weight:800;color:#536768;line-height:1.45}
    .phrase-tag{background:#f1f6f1;color:#398072;border-radius:99px;padding:3px 7px;font-size:10px;font-weight:800;white-space:nowrap}
    .phrase-row{display:block;margin-top:5px}
    .phrase-text{width:100%;min-width:0}.phrase-controls{display:flex;gap:6px;align-items:center;justify-content:flex-end;margin-top:2px}
    .icon-action{border:1px solid #e0e9e2;background:#f8fcf9;color:var(--teal);font-size:16px;border-radius:13px;width:42px;height:42px;display:grid;place-items:center;flex:none;cursor:pointer}
    .icon-action.star-button{font-size:19px}.icon-action:active{transform:scale(.98)}
    .phrase-foot{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-top:5px}
    .tag-small{background:#f5f5ef;color:#78908a;font-size:10px;border-radius:100px;padding:3px 7px;font-weight:650}
    .phrase-open{border:0;background:transparent;color:var(--teal);font-weight:780;font-size:12px;padding:4px 0}
    .recent{border:1px solid #d7e9dc;background:#ecf6ee;border-radius:16px;padding:14px;margin:0 0 16px}
    .recent-line{font-size:12px;color:#628172;font-weight:800;margin-bottom:7px;display:flex;justify-content:space-between}
    .recent-jp{font-size:18px;line-height:2.4;color:#285c50;font-weight:820;cursor:pointer;border:0;background:transparent;text-align:left;width:100%}.recent-jp rt{font-size:10px}
    .recent-footer{font-size:11px;color:#82968a;margin-top:4px}
    .favorite-badge{display:inline-flex;align-items:center;gap:5px;color:#876d4c;background:#fff8e9;border:1px solid #f0e4ca;border-radius:99px;padding:5px 9px;font-size:11px;font-weight:790}
    .filter-wrap{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:6px}
    .filter-wrap .chip{padding:10px 14px}.chip-count{margin-left:4px;opacity:.7;font-size:10px}
    .search-box{width:100%;border:1px solid var(--border);border-radius:14px;padding:12px 14px;margin:9px 0 3px;background:#fff;color:var(--ink);font-size:14px}
    .reply-item{padding:14px 14px 11px;background:#fff;border:1px solid var(--border);border-radius:16px;margin:8px 0}
    .reply-header{display:flex;justify-content:space-between;align-items:center;gap:9px}
    .reply-jp{font-size:19px;line-height:2.3;color:var(--ink);font-weight:770;margin:2px 0}.reply-jp rt{font-size:10px}
    .reply-cn{color:#73817e;font-size:12px;line-height:1.5}
    .reply-buttons{display:flex;gap:8px;margin-top:8px}.reply-buttons button{border:1px solid #dbe6df;border-radius:11px;background:#f8fcf9;color:var(--teal);padding:9px 11px;font-weight:800;font-size:12px}
    .try-item{display:flex;gap:7px;align-items:center;background:#fff;border:1px solid var(--border);border-radius:14px;margin:8px 0;padding:10px}
    .try-main{border:0;background:transparent;flex:1;min-width:0;text-align:left;padding:3px}.try-main .q-jp{font-size:16px;margin:0;line-height:2.3}
    .try-main .meaning{font-size:11px;color:var(--muted);padding-top:0}.try-item .icon-action{width:40px;height:40px}
    .toggle-info{font-size:12px;color:#8c8d78;line-height:1.55}
    .sheet-note{font-size:12px;color:var(--muted);line-height:1.6}
    .pick-list{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:13px}
    .pick-btn{border:1px solid #dfe6df;background:white;border-radius:14px;padding:15px 8px;font-weight:820;color:#3a5e56}
    .pick-btn.active{border-color:#2c8578;background:#e8f5ee;box-shadow:inset 0 0 0 1px #2c8578;color:var(--teal-dark)}
    .large-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
    .large-actions button{padding:11px 13px;border-radius:13px;border:1px solid #e3e9e1;background:#fff;color:var(--teal);font-size:13px;font-weight:800}
    #displayModal .modal{min-height:70dvh}.small-helper{font-size:12px;color:#81928a;line-height:1.65;margin:10px 0}
    .warn-reading{background:#fff7ed;color:#916642;padding:15px;border-radius:13px;font-size:13px;line-height:1.6;margin:12px 0}
    .jp rt{font-size:12px}.big-jp rt{font-size:13px}
    .large-type .jp{font-size:32px}.large-type .jp rt{font-size:15px}
    .large-type .q-jp{font-size:22px}.large-type .q-jp rt{font-size:13px}
    .large-type .reply-jp{font-size:23px}.large-type .reply-jp rt{font-size:13px}
    .large-type .big-jp{font-size:54px}.large-type .big-jp rt{font-size:16px}
    #fontControls .outline.active{background:var(--teal-light);border-color:#7fc0ae;color:var(--teal)}
    @media(max-width:365px){.content{padding-left:15px;padding-right:15px}.top{padding-left:16px;padding-right:16px}.status,.head-flag{margin-left:16px;margin-right:16px}.card{padding:15px}.jp{font-size:23px}.q-jp{font-size:16px}.result-actions button{padding:10px 9px}}



    .audio-bar{margin:0 23px 14px;padding:11px 12px;border:1px solid #b7d5cb;border-radius:13px;background:#edf8f3;color:#265e51;font-size:12px;display:flex;align-items:center;justify-content:space-between;gap:9px;line-height:1.55;font-weight:700}
    .audio-bar[hidden]{display:none}.audio-bar button{border:1px solid #9dc5b5;color:#23584d;border-radius:10px;background:white;padding:7px 9px;white-space:nowrap;font-size:12px;font-weight:800}.audio-bar button[hidden]{display:none}
    .diagnostics{border:1px solid #d7e8dd;background:#fff;border-radius:15px;padding:14px;margin:14px 0}.diag-title{font-size:13px;font-weight:850;color:#2f6558;margin:0 0 8px}.diag-line{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid #edf0ed;font-size:12px}.diag-line b{color:#356d5f;font-size:12px;text-align:right}.mic-state{margin:9px 0 0}
    @media(max-width:365px){.audio-bar{margin-left:16px;margin-right:16px}}


/* v5 additions — status, reading warnings, mic hints (v3 styles above are unchanged) */
.status.offline .dot{background:#a3aba8}
.back-cn{font-size:12px;line-height:1.6;color:#5f7471;margin-top:6px}
ruby.reading-warn rt{color:var(--orange)}
ruby.reading-warn{text-decoration:underline dotted #d6a367;text-underline-offset:6px;text-decoration-thickness:2px}
.field.needs-check{border-color:#e0b27c;background:#fffaf2;box-shadow:0 0 0 3px #f4dcbc66}
.mic-state.mic-warn{color:#91684c}
.reply-buttons{flex-wrap:wrap}
.recent .reply-buttons{margin-top:8px}
.verify-out{white-space:pre-line;margin:8px 0 0}
.verify-out:empty{display:none}
.switcher.form-label{display:flex;font-weight:700;color:var(--ink);line-height:1.5}
.row[hidden],button[hidden]{display:none}
.result .notice+.notice{margin-top:6px}
.status b{white-space:nowrap}
.status #statusDetail{min-width:0}
