/* Altiora design v2 — site additions (hand-written).
   v2.css = the approved design CSS, generated (do not edit). This file only adds what the real site needs on top:
   1. older tokens mapped to the v2 palette (거래소·지표·경제 캘린더·도구·UID 창이 같은 톤을 쓰도록)
   2. shell glue (보조 메뉴, 마이페이지, 푸터의 법적 고지, 화면 전환)
   3. real-data adaptations per screen (분류 탭, 기간 그래프, 일정 칸 수, 운영자 매매 피드, 실제 책·용어 사전)
   4. older components restyled in v2 tone
   Section 5 contains the user-requested 2026-10-12 UX revision after the approved v2 deployment. */

/* ---------- 1. tokens ---------- */
:root{
  --petrol:#233e34; --on-petrol:#f4f2e9; --on-petrol-2:#c9d4be; --sage:#8c9f78; --title:#223e34;
  --hdr-bg:#f4f2e9; --hdr-line:#d4d8cc;
  --bg:#f4f2e9; --surface:#faf9f3; --raised:#e7eadc; --hover:#eceee3; --press:#e2e7d7;
  --text:#223e34; --text-2:#64746a; --text-3:#94a096; --line:#d4d8cc; --panel-line:#d4d8cc;
  --brand:#223e34; --brand-hover:#2f4f43; --on-brand:#f4f2e9; --brand-weak:#e6eadc; --brand-text:#4f6b4a; --brand-line:#c3cbb5;
  --up:#a3473a; --down:#3d6187; --up-fill:rgba(163,71,58,.08); --down-fill:rgba(61,97,135,.08); --live:#6f8a5c;
  --warn-text:#7a5a1c; --warn-bg:#f1ead6; --err-text:#9b3b30; --err-bg:#f3e3dd; --overlay:#14382c85;
  --font:Pretendard,-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Malgun Gothic",system-ui,sans-serif;
  --sel-bg:#223e34; --sel-fg:#f4f2e9; --card-on-brand:#faf9f3;
}

/* ---------- 2. shell ---------- */
.view.v2:not(.on){display:none}
.v2[hidden],.v2 [hidden]{display:none!important}
main{padding-bottom:0}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.v2 :is(.up,.down){color:inherit}

/* 보조 메뉴(지표·거래소): 승인안의 '가상 시장 살펴보기' 자리. 같은 글자 크기·색, 같은 폭으로 주 메뉴 위치를 그대로 둠 */
.header-links{display:flex;align-items:center;justify-content:flex-end;gap:18px;width:101px;font-size:10px;color:var(--v2-muted);white-space:nowrap}
.header-links a{transition:color .15s}
.header-links a:hover,.header-links a.active{color:var(--v2-ink)}
.header-links a.active{text-decoration:underline;text-underline-offset:5px;text-decoration-thickness:1px}
@media(min-width:601px){.header-links{font-size:12px}}
@media(min-width:601px) and (max-width:900px){.header-links{display:none}}
@media(max-width:600px){.header-links{width:86.17px;gap:14px}}
button.avatar{cursor:pointer;color:var(--v2-ink);border:0;padding:0;letter-spacing:inherit;text-align:start}
button.avatar.on{background:var(--v2-ink);color:#f4f2e9}
.site-header{transition:transform .25s ease}
html.hdr-hide .site-header:not(:focus-within){transform:translateY(-100%)}

/* 푸터: 승인안의 두 칸 아래에 기존 운영·데이터 출처·투자 유의사항을 그대로 둠 */
.site-footer.v2{flex-wrap:wrap}
.footer-links{display:inline-flex;flex-wrap:wrap;gap:2px 14px;margin-top:2px}
.footer-links a,.footer-links button{color:var(--v2-ink);font-size:inherit;padding:0}
.footer-links a:hover,.footer-links button:hover{text-decoration:underline;text-underline-offset:3px}
.footer-legal{flex:1 0 100%;display:grid;grid-template-columns:1fr 1.25fr;gap:40px;margin-top:24px;padding-top:22px;border-top:1px solid var(--v2-line);font-size:11px;line-height:1.85;color:var(--v2-muted)}
.footer-legal dl{margin:0;display:grid;gap:5px}
.footer-legal dl div{display:grid;grid-template-columns:42px 1fr;gap:10px}
.footer-legal dt{color:var(--v2-ink)}
.footer-legal dd{margin:0}
.footer-risk h2{font:500 12px/1.7 Pretendard,sans-serif;letter-spacing:-.01em;color:var(--v2-ink);margin:0 0 4px}
.footer-risk h2:focus{outline:2px solid #668e58;outline-offset:4px}
@media(max-width:600px){
  .site-footer .footer-links{display:flex;margin-top:6px}
  .footer-legal{grid-template-columns:1fr;gap:16px;margin-top:20px;padding-top:18px;font-size:10px}
}
.toast.err{background:#7b3b31}

/* 아이폰 안전 영역(viewport-fit=cover): 값이 0인 기기에서는 승인안 값 그대로, 노치·홈 막대가 있으면 그만큼만 더 띄움 */
@media(min-width:601px) and (max-width:1300px){
  .header-inner{padding-left:max(24px,env(safe-area-inset-left));padding-right:max(24px,env(safe-area-inset-right))}
  .wrap,.site-footer{margin-left:max(40px,env(safe-area-inset-left));margin-right:max(40px,env(safe-area-inset-right))}
}
@media(max-width:600px){
  .header-inner{padding-left:max(22px,env(safe-area-inset-left));padding-right:max(22px,env(safe-area-inset-right))}
  .wrap,.site-footer{margin-left:max(22px,env(safe-area-inset-left));margin-right:max(22px,env(safe-area-inset-right))}
  .mobile-nav.v2{height:calc(69px + env(safe-area-inset-bottom))}
  body{padding-bottom:calc(69px + env(safe-area-inset-bottom))}
  .toast.v2{bottom:calc(82px + env(safe-area-inset-bottom))}
}
/* 머리 높이(옛 화면의 고정 위치 계산용) */
:root{--hdr-h:82px}
@media(max-width:600px){:root{--hdr-h:70px}}
/* '이번 주' 버튼: 초점을 잃지 않게 disabled 대신 aria-disabled로 같은 모양 */
.date-navigation [aria-disabled="true"]{opacity:.45;cursor:default}

/* 기존 화면(거래소·지표·경제 캘린더)의 본문 폭을 v2와 같은 선(1248 / 40 / 22)에 맞춤 */
.container{max-width:1248px;margin-left:auto;margin-right:auto;padding-left:0;padding-right:0}
@media(min-width:601px) and (max-width:1300px){.container{margin-left:max(40px,env(safe-area-inset-left));margin-right:max(40px,env(safe-area-inset-right))}}
@media(max-width:600px){.container{margin-left:max(22px,env(safe-area-inset-left));margin-right:max(22px,env(safe-area-inset-right))}}
.view.lgbase .page-intro{border-bottom:0}
.view.lgbase .page-intro .text-link{align-self:flex-end;white-space:nowrap}

/* ---------- 3a. 시세·경제 일정 ---------- */
.cat-tabs{margin:4px 0 2px;border-bottom:1px solid var(--v2-line);overflow-x:auto;scrollbar-width:none;flex-wrap:nowrap}
.cat-tabs::-webkit-scrollbar{display:none}
.cat-tabs button{flex:none}
#idxMeta .sess{white-space:nowrap}
#idxMeta .sess.on{color:var(--v2-ink)}
.idx-foot{margin:14px 0 0;font-size:11px;line-height:1.75;color:var(--v2-muted)}
.idx-foot .state.err,.v2 .state.err{color:#9b3b30}
.indices .empty{padding:44px 0;text-align:center;color:var(--v2-muted);font-size:13px;line-height:1.8;border-bottom:1px solid var(--v2-line)}
/* 토·일 일정이 있어 칸이 6~7개가 되면, 자리가 모자랄 때만 칸을 줄임 (자리가 있으면 승인안 폭 그대로) */
.week-dots.wd-6 .week-day,.week-dots.wd-7 .week-day{flex:0 1 auto;min-width:0}
.week-perspective .week-dots.wd-6,.week-perspective .week-dots.wd-7{min-width:0}
@media(min-width:951px){.week-perspective .week-dots.wd-6,.week-perspective .week-dots.wd-7{min-width:428px}}
/* 승인안에서 이 두 링크는 button 요소였음: 같은 여백·자간으로 */
.reading-bridge a.text-link,.journal-prompt a.text-link{padding:1px 6px;letter-spacing:normal;text-align:center}
/* 기록 행: 승인안은 button 요소라 글자 자간이 normal */
.entry-card{letter-spacing:normal}
.event-card.past{opacity:.55}
.ev-imp{letter-spacing:.08em;color:#85936d}
.calendar-foot a{color:var(--v2-ink);text-decoration:underline;text-underline-offset:3px}
.calendar-foot a:hover{text-decoration-thickness:2px}
.asset-src{font-size:11px;color:var(--v2-muted);margin:-8px 0 22px;line-height:1.7}
.market-more{margin-top:58px;padding-top:25px;border-top:1px solid #6d8170}
.market-more .section-heading{align-items:flex-end}
.market-more .section-heading .text-link{white-space:nowrap}
#tabState{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
#mtabs{border-bottom:1px solid var(--v2-line);margin:6px 0 22px}
@media(max-width:600px){.market-more{margin-top:40px;padding-top:22px}#mtabs{margin-bottom:16px}}

/* '뉴스와 차트' 안의 기존 목록·차트(.lg)를 v2 톤으로: 둥근 면 대신 얇은 선과 종이 면 */
.lg{font-size:15px}
.lg .panel{border-radius:2px;border:1px solid var(--v2-line);background:#faf9f3;box-shadow:none}
.lg .seg{border-radius:2px;background:#e7eadc;padding:3px}
.lg .seg button{border-radius:1px;min-height:30px;font-weight:400;font-size:13px}
.lg .seg .ind{border-radius:1px;box-shadow:none;background:#faf9f3}
.lg .seg button[aria-pressed="true"]{font-weight:500}
.lg .search{border-radius:2px;background:transparent;border:1px solid var(--v2-line)}
.lg .input{border-radius:2px}
.lg .lrow[aria-pressed="true"]{background:#eceee3}
.lg .chip{border-radius:2px}
.lg .detail{border-radius:2px}
/* 방금 들어온 뉴스 표시: 빨간 강조 대신 v2의 세이지 선 (뜻은 그대로) */
.lg .nitem.fresh::before{background:#85936d;border-radius:0}
.lg .nitem.fresh .nh{color:var(--v2-ink)}

/* ---------- 3b. 매매 기록 (운영자 매매 피드를 v2 기록 행으로) ---------- */
.entry-card{text-align:left}
.entry-utc{font-size:11px;color:var(--v2-muted);margin-top:3px;letter-spacing:.01em}
.entry-more-btn{font-size:12px;color:var(--v2-ink);padding:0;text-align:left;white-space:nowrap}
.entry-more-btn:hover{text-decoration:underline;text-underline-offset:3px}
.entry-card .emotion:empty{display:none}
.entry-card.is-locked .entry-review{color:#8f9a91}
.lock-note{display:flex;align-items:center;gap:6px;margin-top:6px;font-size:11px;color:var(--v2-muted)}
.lock-note svg{display:inline-block;flex:none}
.entry-more{grid-column:3;grid-row:4;margin-top:14px;min-width:0}
.entry-more .pimg{margin:0}
.entry-more .pimg svg{display:block;width:100%;height:auto;max-height:260px}
.entry-more figcaption{font-size:12px;color:var(--v2-muted);margin-top:6px}
.entry-more .tcard{margin-top:12px;border-radius:2px;background:#eef0e6}
/* 좁은 폭에서는 거래 표를 두 칸으로 (숫자·종목명이 중간에서 끊기지 않게) */
@media(max-width:950px){.entry-more .tcard{grid-template-columns:repeat(2,minmax(0,1fr))}}
.entry-more .tcard b{overflow-wrap:normal;word-break:keep-all}
.entry-top .tag{white-space:nowrap}
@media(max-width:600px){.entry-more{grid-column:2;grid-row:5}.entry-utc{font-size:9px}.entry-more-btn{font-size:10px}.pin-l{display:none}}
.journal-summary{display:grid;grid-template-columns:1fr 1fr;gap:46px;margin-top:44px;padding-top:25px;border-top:1px solid #6d8170}
.journal-summary h3{font:500 20px/1.4 Pretendard,sans-serif;letter-spacing:-.035em;margin:8px 0 12px}
.journal-summary dl{margin:0}
.journal-summary dl div{display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding:12px 0;border-bottom:1px solid var(--v2-line);font-size:14px}
.journal-summary dt{color:var(--v2-muted)}
.journal-summary dt span{margin-left:6px;font-size:12px;color:var(--v2-ink)}
.journal-summary dd{margin:0;font-family:'Source Serif 4',serif;font-size:19px;letter-spacing:-.02em;white-space:nowrap}
.journal-summary.is-locked dd,.journal-summary.is-locked dt span{color:#9aa59c}
@media(max-width:950px){.journal-summary{grid-template-columns:1fr;gap:34px}}
@media(max-width:600px){.journal-summary{margin-top:34px;padding-top:22px}.journal-summary h3{font-size:18px}.journal-summary dl div{font-size:13px;padding:10px 0}.journal-summary dd{font-size:17px}}
/* 분류가 다섯 개라 좁은 태블릿 폭에서는 검색칸이 다음 줄로 내려가게 (자리가 있으면 승인안처럼 한 줄) */
@media(min-width:601px){.journal-toolbar{flex-wrap:wrap;row-gap:12px}.journal-toolbar .search-field{margin-left:auto}}
.prompt-acts{display:flex;gap:10px 24px;flex-wrap:wrap;align-items:center}
@media(max-width:600px){.prompt-acts{margin-top:13px}.prompt-acts .text-link{margin-top:0}}

/* ---------- 3c. 전자책 자료실 ---------- */
.cover-brand{display:block;height:19px;line-height:19px}
.cover-brand i{display:block;position:relative;top:3px;width:45.398125px;height:16px;background:currentColor;
  -webkit-mask:url(assets/v2/book-wordmark-outlined.svg) no-repeat 0 0/100% 100%;mask:url(assets/v2/book-wordmark-outlined.svg) no-repeat 0 0/100% 100%}
@media(max-width:600px){.cover-brand{height:14px;line-height:14px}.cover-brand i{top:2px;width:34.048594px;height:12px}}
/* 실제 책 제목은 승인안의 예시보다 길어 어절 단위로만 줄바꿈 (글자 크기는 그대로) */
.cover h3,.featured-copy h2,.book-title{word-break:keep-all;overflow-wrap:break-word}
.book-art>.book-open{display:flex;align-items:center;justify-content:center;width:100%;height:100%}
a.book-title,span.book-title{display:block}
.book-status{margin-top:8px;font-size:12px;color:var(--v2-muted)}
.book-status .tag{font-size:11px}
.feature-actions .btn:disabled{opacity:.62}
.lib-lock{margin:0 0 26px;align-items:center}
.lib-lock .text-link{margin-left:auto;white-space:nowrap;flex:none}
@media(max-width:600px){.book-status{font-size:10px}.lib-lock{flex-wrap:wrap;margin-bottom:21px}.lib-lock .text-link{margin-left:29px}}
/* 학습 경로 (기존 기능): 홈의 세 가지 읽기와 같은 번호 + 얇은 선 구성 */
.learning-path{margin-top:56px;padding-top:25px;border-top:1px solid #6d8170}
.learning-path ol{list-style:none;margin:20px 0 0;padding:0;display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid #8b9a88}
.learning-path li{display:grid;grid-template-columns:auto 1fr;gap:14px;padding:22px 22px 26px 0;min-width:0}
.learning-path li+li{padding-left:22px;border-left:1px solid var(--v2-line)}
.lp-no{font-size:39px;line-height:1;color:#849474}
.learning-path b{display:block;font:500 17px/1.5 Pretendard,sans-serif;letter-spacing:-.035em;word-break:keep-all}
.learning-path p{font-size:13px;line-height:1.75;color:var(--v2-muted);margin:6px 0 8px;word-break:keep-all}
.learning-path small{font-size:11px;color:#78866f;line-height:1.6}
@media(max-width:1300px){.learning-path ol{grid-template-columns:1fr 1fr}.learning-path li:nth-child(3){padding-left:0;border-left:0}.learning-path li:nth-child(n+3){border-top:1px solid var(--v2-line)}}
@media(max-width:600px){.learning-path{margin-top:40px;padding-top:22px}.learning-path ol{grid-template-columns:1fr}.learning-path li,.learning-path li+li{padding:18px 0 20px;border-left:0}.learning-path li+li{border-top:1px solid var(--v2-line)}.lp-no{font-size:32px;width:40px}}
/* 용어 사전 (기존 기능) */
.gl-tools{display:flex;justify-content:space-between;align-items:center;gap:10px 18px;flex-wrap:wrap;margin:0 0 6px;border-bottom:1px solid var(--v2-line)}
.gl-cats{overflow-x:auto;scrollbar-width:none;max-width:100%;flex-wrap:nowrap}
.gl-cats::-webkit-scrollbar{display:none}
.gl-cats button{flex:none}
.gl-count{font-size:12px;color:var(--v2-muted)}
.gl-grp{margin-top:34px}
.gl-gh{display:grid;grid-template-columns:auto 1fr auto;gap:16px;align-items:end;padding-bottom:14px;border-bottom:1px solid #6d8170}
.gl-n{font-size:34px;line-height:1;color:#849474}
.gl-gh h2{font:500 21px/1.45 Pretendard,sans-serif;letter-spacing:-.045em;margin:0}
.gl-gh p{font-size:12px;line-height:1.7;color:var(--v2-muted);margin-top:2px}
.gl-cnt{font-size:12px;color:var(--v2-muted)}
.gl-grid{display:grid;grid-template-columns:repeat(3,1fr);column-gap:30px}
.term{border-bottom:1px solid var(--v2-line);min-width:0}
.term>button{display:block;width:100%;text-align:left;padding:18px 30px 18px 0;position:relative}
.term .tn{display:flex;align-items:baseline;gap:4px 8px;flex-wrap:wrap}
.term .tn b{font-weight:500;font-size:16px;line-height:1.5;letter-spacing:-.03em}
.term .tn span{font-size:11px;color:#78866f;letter-spacing:.01em}
.term .ts{font-size:13px;line-height:1.75;color:var(--v2-muted);margin-top:4px}
.term.locked .ts{color:#a5aea3;filter:blur(2.5px);user-select:none}
.term .tlk{position:absolute;right:0;top:21px;color:#9aa59c}
.term .tlk svg{display:block}
.term>button[aria-expanded]::after{content:'+';position:absolute;right:2px;top:15px;font-size:19px;font-weight:300;color:#78866f}
.term>button[aria-expanded="true"]::after{content:'−'}
.term>button:hover .tn b{text-decoration:underline;text-underline-offset:4px;text-decoration-thickness:1px}
.tbody{padding:0 0 20px;font-size:14px;line-height:1.85;word-break:keep-all}
.tbody p{white-space:pre-line}
.tpt{margin-top:12px;padding:12px 14px;background:#e7eadc;font-size:13px;line-height:1.8}
.tpt b{display:block;font-weight:500;margin-bottom:3px}
.term.hl{animation:termflash 1.8s ease}
@keyframes termflash{from{background:#dfe5cf}to{background:transparent}}
.gl mark{background:#dce5ad;color:inherit}
.gl .empty{padding:40px 0;text-align:center;font-size:13px;line-height:1.8;color:var(--v2-muted)}
@media(max-width:950px){.gl-grid{grid-template-columns:1fr 1fr}}
@media(max-width:600px){.gl-grid{grid-template-columns:1fr}.gl-grp{margin-top:28px}.gl-n{font-size:28px}.gl-gh h2{font-size:18px}.term .tn b{font-size:15px}.gl-tools{border-bottom:0}}

/* ---------- 4. 기존 화면·구성 요소를 v2 톤으로 ---------- */
.lgbase .panel{border-radius:2px;box-shadow:none}
.lgbase .btn{border-radius:2px;min-height:46px;padding:0 22px;font-weight:500;font-size:14px}
.lgbase .btn-sm{min-height:36px;padding:0 14px;font-size:13px}
.lgbase .seg{border-radius:2px;background:#e7eadc}
.lgbase .seg button{border-radius:1px}
.lgbase .seg .ind{border-radius:1px;box-shadow:none;background:#faf9f3}
.lgbase .chip{border-radius:2px}
.lgbase .input,.lgbase .select{border-radius:2px}
.lgbase .t-sec{font-weight:500;letter-spacing:-.045em}
.lgbase .eyebrow:where(:not(.v2 *)){font:500 11px/1.6 Pretendard,sans-serif;letter-spacing:.14em;text-transform:uppercase}
/* 예전 A 마크 장식은 새 워드마크와 겹쳐 숨김 */
.xh-mark,.ih-mark{display:none}
.xhero .xh-title{font-family:'Noto Serif KR',serif;font-weight:450;letter-spacing:-.06em}
.ind-hero h2{font-family:'Source Serif 4',serif;font-weight:400;letter-spacing:-.035em}
.ind-hero,.ind-hero .ih-facts>div,.ih-chip{border-radius:1px}
.xhero .xcard,.calc.xcard,.calc-out,.xc-big,.lgbase .unit{border-radius:2px}
/* 도구 패널: 오른쪽 고정 아이콘 바 없이 패널만 */
.rail .rail-bar,.rail .rail-fab{display:none!important}
/* 열 때는 바로 보이게(visibility 전환 지연 없음) → 연 버튼에서 패널의 닫기 버튼으로 초점이 바로 들어감 */
.rail.open .rail-panel{transition:transform .28s cubic-bezier(.2,.8,.2,1),opacity .2s,visibility 0s}
@media(min-width:1101px){.rail .rail-panel{right:0;width:380px}}
.rail-panel{border-radius:0}
.rail .rp-out,.rail .rp-sym .btn,.rail .kp{border-radius:2px}
@media(min-width:641px) and (max-width:1100px){.rail .rail-panel{border-radius:3px}}
@media(max-width:640px){.rail .rail-panel{border-radius:3px 3px 0 0}}
/* UID·신청 창 */
dialog.lgbase{border:1px solid var(--line);border-radius:3px;background:#f4f2e9;box-shadow:0 30px 100px #173d3326}
dialog.lgbase::backdrop{background:#14382c85;backdrop-filter:blur(5px)}
@media(max-width:600px){dialog.lgbase{border-radius:2px}}
.ewk .panel,.mcal{border-radius:2px}

/* ---------- 5. 2026-10-12 UX revision: content before repeated introductions ---------- */
#v-home .mini-landscape img{object-position:50% 25%}
#v-market .page-intro,#v-journal .page-intro,#v-library .page-intro{padding:26px 0 22px;gap:24px;align-items:center;text-align:left}
#v-market .page-intro .eyebrow,#v-journal .page-intro .eyebrow,#v-library .page-intro .eyebrow{font-size:10px;margin-bottom:7px;letter-spacing:.1em}
#v-market .page-intro .eyebrow,#v-journal .page-intro .eyebrow,#v-library .page-intro .eyebrow{display:none}
#v-market .page-intro h1,#v-journal .page-intro h1,#v-library .page-intro h1{font-size:34px;line-height:1.4;letter-spacing:-.05em}
#v-market .page-intro p,#v-journal .page-intro p,#v-library .page-intro p{font-size:14px;line-height:1.65;margin-top:7px}
#v-market .date-navigation{font-size:13px;margin:0;gap:9px}
#v-market .week-perspective{grid-template-columns:1fr 1.3fr;gap:30px;padding:22px 28px;margin-bottom:22px;align-items:center;overflow:visible}
#v-market .week-perspective h2{display:flex;align-items:baseline;gap:7px;font-family:Pretendard,sans-serif;font-size:20px;line-height:1.3;margin:7px 0;letter-spacing:-.025em}
#v-market .week-perspective h2 strong{font-size:32px;font-weight:400;line-height:1}
#v-market .week-perspective h2 small{font-size:14px}
#v-market .week-perspective p{font-size:12px;line-height:1.7;max-width:none;margin:0}
#v-market .week-perspective .eyebrow{font-size:11px;letter-spacing:.05em}
.week-next{position:relative;display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:6px;padding:2px 110px 2px 24px;border-left:1px solid #688271;min-width:0;color:#f4f2e9}
.week-next-label{font:12px/1.6 Pretendard,sans-serif;color:#c6d0bd}
.week-next b{font:500 17px/1.5 Pretendard,sans-serif;word-break:keep-all;overflow-wrap:anywhere}
.week-next #weekCd{font:12px/1.6 Pretendard,sans-serif;color:#c6d0bd}
.week-next-go{display:inline-flex;align-items:center;gap:8px;position:absolute;right:0;top:50%;transform:translateY(-50%);font:12px/1.6 Pretendard,sans-serif;color:#f4f2e9}
.week-next-go .icon{width:17px;height:17px}
button.week-next:hover b,.week-next-go:hover{text-decoration:underline;text-underline-offset:4px}
.market-view-switch{display:none}
#v-market .market-layout{grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);gap:32px;align-items:start}
#v-market .market-layout>.panel{padding-top:18px;min-width:0}
#v-market .section-heading,#v-market .calendar-head{margin-bottom:14px}
#v-market .section-heading p{font-size:12px;line-height:1.6}
#v-market .index-row{padding:14px 0;gap:16px;grid-template-columns:minmax(0,1.35fr) 84px minmax(0,1fr)}
#v-market .asset-name{font-size:16px;margin-bottom:4px}
#v-market .asset-desc{font-size:11px;line-height:1.5}
#v-market .index-value{font-size:24px;line-height:1.2}
#v-market .sparkline{height:34px}
#v-market .index-change{font-size:12px;margin-top:3px}
#v-market .event-card{padding:16px 0}
#v-market .event-card h3{font-size:16px;margin:5px 0}
#v-market .date-tab{padding:8px 4px 10px;gap:5px}
#v-market .date-tab b{font-size:23px}
#v-market .context-note{background:transparent;border-left:2px solid #a2b383;padding:4px 0 4px 13px}
#v-journal .reflection-banner{background:#233e34;color:#f4f2e9;grid-template-columns:1fr 1.6fr;gap:30px;padding:22px 28px;margin-bottom:20px;align-items:center}
#v-journal .reflection-label .eyebrow{font-size:12px;color:#f4f2e9;letter-spacing:.05em}
#v-journal .reflection-label p{font-size:12px;color:#c6d0bd;line-height:1.6;margin-top:6px}
#v-journal .reflection-stats{gap:20px;margin:0;padding:0;border:0}
#v-journal .stat{padding-left:20px;border-color:#688271}
#v-journal .stat span{font-size:12px;color:#c6d0bd}
#v-journal .stat strong{font-size:32px;line-height:1.2;margin:6px 0 0;color:#f4f2e9}
#v-journal .stat strong small{font:12px Pretendard,sans-serif}
#v-journal .stat .small-value{font:500 17px/1.6 Pretendard,sans-serif;margin-top:9px}
#v-journal .page-intro>.btn{font-size:13px;padding:12px 17px;min-height:44px}
#v-library .library-controls{margin:0 0 18px;gap:20px}
#v-library .featured-book{grid-template-columns:112px 1fr;gap:24px;min-height:0;padding:20px 28px;margin:0 0 18px;align-items:center}
#v-library .featured-book .book-stage{height:138px;background:none}
#v-library .featured-book .cover{width:94px;height:130px;padding:8px 9px;transform:rotate(-4deg);box-shadow:5px 6px 9px #10241c44}
#v-library .featured-book .cover .cover-no{font-size:4px}
#v-library .featured-book .cover h3{font-size:14px;line-height:1.6;margin:23px 0 3px}
#v-library .featured-book .cover-index{font-size:26px;top:18px;right:9px}
#v-library .featured-book .cover svg{height:24px}
#v-library .featured-book .cover-brand{height:10px}
#v-library .featured-book .cover-brand i{width:27px;height:9.5px;top:0}
#v-library .featured-copy{display:grid;grid-template-columns:1fr auto;column-gap:28px;align-items:center;min-width:0}
#v-library .featured-copy .eyebrow{grid-column:1;font-size:10px;line-height:1.5;max-width:none;letter-spacing:.08em}
#v-library .featured-copy h2{grid-column:1;font-size:27px;line-height:1.4;margin:6px 0;max-width:none}
#v-library .featured-copy p{grid-column:1;font-size:13px;line-height:1.6;margin:0;max-width:550px}
#v-library .feature-actions{grid-column:2;grid-row:1/4;flex-direction:column;align-items:flex-start;gap:8px;font-size:11px}
#v-library .featured-copy .btn{font-size:13px;padding:11px 16px;min-height:44px}
#v-library .lib-lock{margin-bottom:20px;padding:10px 14px;background:transparent;border:1px solid var(--v2-line)}
#v-library .lib-lock p{font-size:12px;line-height:1.6}
#v-library .lib-lock .text-link{font-size:12px;min-height:32px}
#v-library .book-art{height:218px;margin-bottom:12px}
#v-library .library-grid{gap:26px}
@media(min-width:601px) and (max-width:950px){
  #v-market .page-intro{gap:12px;align-items:flex-start;padding:20px 0}
  #v-market .page-intro>div:first-child{align-self:stretch}
  #v-market .page-intro p{display:none}
  #v-market .date-navigation{margin:0;align-self:flex-start}
  #v-market .week-perspective{gap:20px;padding:20px 24px}
  #v-market .week-next{padding-right:0;padding-left:16px}
  #v-market .week-next-go{position:static;transform:none;margin-top:2px}
  #v-market .market-layout{grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);gap:24px}
  #v-market .index-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
  #v-market .index-row .sparkline{display:none}
  #v-market .section-heading{align-items:flex-start;flex-wrap:wrap}
  #v-market .calendar-head{gap:12px;flex-wrap:wrap}
  #v-market .index-value{font-size:24px}
  #v-journal .reflection-banner{grid-template-columns:1fr 1.8fr;gap:20px}
  #v-journal .reflection-stats{gap:12px}
  #v-journal .stat{padding-left:12px}
  #v-journal .stat span{font-size:11px;white-space:normal}
  #v-library .featured-copy{grid-template-columns:1fr;gap:0}
  #v-library .feature-actions{grid-column:1;grid-row:auto;flex-direction:row;align-items:center;margin-top:12px;flex-wrap:wrap}
}
@media(max-width:600px){
  #v-market .page-intro,#v-journal .page-intro,#v-library .page-intro{padding:20px 0 18px}
  #v-market .page-intro{padding:16px 0 14px}
  #v-market .page-intro h1,#v-journal .page-intro h1,#v-library .page-intro h1{font-size:27px;line-height:1.45}
  #v-market .page-intro p,#v-journal .page-intro p,#v-library .page-intro p{font-size:13px;line-height:1.65;margin-top:5px}
  #v-market .page-intro p,#v-journal .page-intro p{display:none}
  #v-market .date-navigation{font-size:12px;gap:8px;margin-top:10px}
  #v-market .date-navigation button{min-height:38px;min-width:38px}
  #v-market .week-perspective{display:grid;grid-template-columns:1fr;gap:10px;padding:14px 22px;margin:0 -22px 14px}
  #v-market .week-perspective h2{font-size:18px;margin:6px 0}
  #v-market .week-perspective h2 strong{font-size:28px}
  #v-market .week-perspective .eyebrow{font-size:11px}
  #v-market .week-perspective p{font-size:12px}
  #v-market .week-overview-copy{display:flex;align-items:center;gap:8px 14px;flex-wrap:wrap;justify-content:space-between}
  #v-market .week-overview-copy h2{margin:0}
  #v-market .week-overview-copy .week-source-note{display:none}
  #v-market .week-overview-copy .week-source-state{flex-basis:100%}
  .week-next{padding:12px 0 0;border-left:0;border-top:1px solid #688271;gap:4px;min-height:44px}
  .week-next-label{font-size:11px}
  .week-next b{font-size:15px;padding-right:0}
  .week-next-go{top:auto;bottom:0;transform:none;font-size:11px}
  .week-next #weekCd{font-size:11px;padding-right:75px}
  .week-next-empty{padding-right:75px}
  #v-market .market-view-switch{display:flex;gap:6px;padding:3px;background:#e6eadc;margin-bottom:12px}
  .market-view-switch button{min-height:40px;flex:1;font-size:14px;color:var(--v2-muted)}
  .market-view-switch button[aria-pressed="true"]{background:#fffef9;color:var(--v2-ink);font-weight:500;box-shadow:0 1px 3px #223e3412}
  #v-market .market-layout{display:block}
  #v-market .market-layout>.panel{margin-top:0;padding-top:16px}
  #v-market .market-layout:not(.show-calendar)>#marketCalendar,#v-market .market-layout.show-calendar>#marketQuotes{display:none}
  #v-market .market-layout>.panel+.panel{margin-top:0}
  #v-market .section-heading h2,#v-market .calendar-head h2{font-size:20px}
  #v-market .section-heading p{font-size:11px;line-height:1.6}
  #v-market .section-heading{display:block;position:relative}
  #v-market .section-heading .segmented{position:absolute;right:0;top:0}
  #v-market .section-heading p{padding-top:3px}
  #v-market .segmented button{min-height:32px;font-size:11px;padding:5px 7px}
  #v-market .cat-tabs{gap:20px}
  #v-market .cat-tabs button{font-size:13px;min-height:42px}
  #v-market .index-row{grid-template-columns:minmax(0,1.3fr) 54px minmax(0,1fr);gap:9px;padding:16px 0}
  #v-market .asset-name{font-size:15px}
  #v-market .asset-desc{font-size:11px}
  #v-market .index-value{font-size:24px}
  #v-market .index-change{font-size:11px;line-height:1.5}
  #v-market .event-card{padding:16px 0}
  #v-market .event-card h3{font-size:16px}
  #v-market .date-tab{padding:8px 2px 10px;min-height:54px}
  #v-market .calendar-head select{font-size:13px;min-height:36px;max-width:none}
  #v-journal .page-intro>.btn{margin-top:13px;padding:10px 14px;font-size:12px;min-height:40px}
  #v-journal .page-intro{display:grid;grid-template-columns:1fr auto;gap:10px}
  #v-journal .page-intro>.btn{margin:0}
  #v-journal .reflection-banner{display:block;padding:18px 22px;margin:0 -22px 20px}
  #v-journal .reflection-label p{font-size:11px;margin-top:4px}
  #v-journal .reflection-stats{display:flex;justify-content:space-between;gap:0;margin-top:16px;padding:0;border:0}
  #v-journal .stat{padding-left:12px}
  #v-journal .stat:first-child{padding-left:0}
  #v-journal .stat span{font-size:11px;white-space:normal}
  #v-journal .stat strong{font-size:28px;margin-top:6px}
  #v-journal .stat .small-value{font-size:14px;line-height:1.5;margin-top:10px}
  #v-journal .journal-toolbar{gap:12px;padding-bottom:14px}
  #v-journal .journal-toolbar .tabs{gap:20px;overflow:auto;scrollbar-width:none;flex-wrap:nowrap}
  #v-journal .journal-toolbar .tabs button{white-space:nowrap;min-height:42px}
  #v-journal .search-field input,#v-library .search-field input{font-size:16px}
  #v-library .library-controls{display:flex;flex-direction:column;align-items:stretch;gap:10px;margin:0 0 16px}
  #v-library .library-controls .search-field{margin:0}
  #v-library .library-controls .tabs{gap:24px}
  #v-library .library-controls .tabs button{font-size:14px;min-height:42px}
  #v-library .featured-book{grid-template-columns:70px 1fr;gap:16px;padding:17px 22px;margin:0 -22px 16px}
  #v-library .featured-book .book-stage{height:102px}
  #v-library .featured-book .cover{width:66px;height:94px;padding:6px;transform:rotate(-4deg)}
  #v-library .featured-book .cover .cover-no{font-size:3px}
  #v-library .featured-book .cover h3{font-size:10px;margin:15px 0 2px}
  #v-library .featured-book .cover-index{font-size:17px;top:14px;right:5px}
  #v-library .featured-book .cover svg{height:17px}
  #v-library .featured-book .cover-brand i{width:19px;height:6.7px;top:0}
  #v-library .featured-copy{display:block}
  #v-library .featured-copy .eyebrow{font-size:9px;letter-spacing:.02em}
  #v-library .featured-copy h2{font-size:22px;margin:4px 0;line-height:1.45}
  #v-library .featured-copy p{font-size:12px;line-height:1.6}
  #v-library .featured-copy p{display:none}
  #v-library .feature-actions{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:8px;margin-top:10px;font-size:10px}
  #v-library .feature-actions>span{display:none}
  #v-library .featured-copy .btn{font-size:12px;padding:8px 11px;min-height:36px}
  #v-library .lib-lock{gap:9px;margin-bottom:16px;padding:9px 11px}
  #v-library .lib-lock>.icon{display:none}
  #v-library .lib-lock .text-link{margin-left:0;min-height:34px}
  #v-library .book-art{height:160px;margin-bottom:10px}
  #v-library .book-art .cover{width:105px;height:146px;padding:9px}
  #v-library .book-art .cover h3{font-size:15px;margin-top:24px}
  #v-library .book-art .cover .cover-no{font-size:4px}
  #v-library .book-art .cover-index{font-size:25px;top:20px;right:8px}
  #v-library .book-art .cover svg{height:27px}
  #v-library .book-title{font-size:16px}
  #v-library .library-grid{gap:22px 15px}
}

/* ---------- 6. Restored selection glides and quick page/content transitions ---------- */
:is(.desktop-nav,.header-links,.tabs,.segmented,.date-tabs,.market-view-switch){position:relative}
:is(.desktop-nav,.mobile-nav,.header-links,.tabs,.segmented,.date-tabs,.market-view-switch)>:is(button,a){position:relative;z-index:1}
:is(.desktop-nav,.mobile-nav,.header-links,.tabs,.segmented,.date-tabs,.market-view-switch)>:is(button,a){transition:color .18s ease}
:is(.desktop-nav,.mobile-nav,.header-links,.tabs,.segmented,.date-tabs,.market-view-switch)>.ind{
  display:block;position:absolute;left:0;top:0;z-index:0;pointer-events:none;
  opacity:0;transform-origin:0 0;transition:opacity .12s;will-change:transform;border-radius:1px;
}
:is(.desktop-nav,.mobile-nav,.header-links,.tabs,.segmented,.date-tabs,.market-view-switch)>.ind.on{opacity:1}
:is(.desktop-nav,.header-links,.tabs)>.ind{top:auto;bottom:0;height:2px;background:var(--v2-ink)}
.desktop-nav>.ind{height:1px}
.header-links>.ind{bottom:-5px;height:1px}
.mobile-nav>.ind{top:0;height:2px;background:var(--v2-ink)}
.segmented>.ind,.market-view-switch>.ind{background:var(--v2-white);box-shadow:0 1px 3px #223e3412}
.date-tabs>.ind{background:#e2e7d7;box-shadow:inset 0 -2px #7d9168}
.desktop-nav .nav-link.active::after,.tabs button.active::after{display:none}
.header-links a.active{text-decoration:none}
.segmented button.active{background:transparent;box-shadow:none}
#v-market .market-view-switch button[aria-pressed="true"]{background:transparent;box-shadow:none}
.date-tabs .date-tab.active{background:transparent;box-shadow:none}
/* Clip only the short animated excursion; the resting layout is never masked. */
[data-motion-clip]{overflow-x:clip}
/* A desktop-sized canvas must not set the mobile grid minimum track width. */
#v-market #p-chart .md>*{min-width:0}
@media(prefers-reduced-motion:reduce){
  :is(.desktop-nav,.mobile-nav,.header-links,.tabs,.segmented,.date-tabs,.market-view-switch)>.ind{transition:none}
  :is(.desktop-nav,.mobile-nav,.header-links,.tabs,.segmented,.date-tabs,.market-view-switch)>:is(button,a){transition:none}
}

/* ---------- 7. Restored theme choice (v2 light layout stays the baseline) ---------- */
:root[data-theme="light"]{color-scheme:light}
.theme-toggle{display:grid;place-items:center;flex:none;width:34px;height:34px;padding:0;border:1px solid var(--v2-line);border-radius:50%;background:transparent;color:var(--v2-ink);cursor:pointer}
.theme-toggle:hover{background:var(--v2-sage)}
.theme-toggle svg{grid-area:1/1;width:17px;height:17px;stroke:currentColor;stroke-width:1.5;fill:none;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .theme-moon,:root[data-theme="dark"] .theme-toggle .theme-sun{display:none}
:root[data-theme="dark"] .theme-toggle .theme-moon{display:block}
@media(max-width:600px){
  .header-inner{gap:12px}
  .header-actions{gap:10px}
  .header-links{width:auto;gap:12px}
  .theme-toggle{width:32px;height:32px}
}
@media(max-width:360px){.header-links{gap:9px}}
/* ---------- 7. Restored dark theme: v2 and legacy components share one palette ----------
   Append after section 6. The approved v2.css stays untouched.
   Images, flag artwork, and the printed book covers retain their original colors. */
:root[data-theme="dark"]{
  color-scheme:dark;
  --v2-ink:#edf1e8; --v2-muted:#b2bfb1; --v2-paper:#101716; --v2-white:#18211e;
  --v2-line:#3c4b43; --v2-sage:#28392e; --v2-lime:#c8d9bb; --v2-dark:#1b332a;
  --petrol:#1b332a; --on-petrol:#edf1e8; --on-petrol-2:#c1cebb; --sage:#c8d9bb; --title:#edf1e8;
  --hdr-bg:#101716; --hdr-line:#3c4b43;
  --bg:#101716; --surface:#18211e; --raised:#222e29; --hover:#233129; --press:#2e4032;
  --text:#edf1e8; --text-2:#b2bfb1; --text-3:#9cae9a;
  --line:#3c4b43; --panel-line:#3c4b43; --line-strong:#859981;
  --brand:#c8d9bb; --brand-hover:#d9e6cd; --on-brand:#18241d;
  --brand-weak:#263a2e; --brand-text:#c8d9bb; --brand-line:#657d63;
  --up:#f29383; --down:#8bb9ee; --up-fill:rgba(242,147,131,.12); --down-fill:rgba(139,185,238,.12);
  --live:#c8d9bb; --warn-text:#f1cc8c; --warn-bg:#352a1b; --err-text:#f6a49b; --err-bg:#392320;
  --overlay:rgba(4,10,7,.76); --sel-bg:#c8d9bb; --sel-fg:#18241d; --card-on-brand:#18211e;
  --dm-rule:#617764; --dm-selected:#344839;
}

/* Shell and controls. v2-ink is now a foreground token; buttons have a separate pair. */
:root[data-theme="dark"] body{background:var(--bg);color:var(--text)}
:root[data-theme="dark"] .site-header{background:rgba(16,23,22,.96);border-color:var(--hdr-line)}
:root[data-theme="dark"] .mobile-nav{background:rgba(16,23,22,.98);border-color:var(--line)}
:root[data-theme="dark"] :is(.nav-link,.mobile-nav a){color:var(--text-2)}
:root[data-theme="dark"] :is(.nav-link.active,.mobile-nav a.active,.mobile-nav a[aria-current="page"]){color:var(--text)}
:root[data-theme="dark"] .avatar{background:var(--raised);color:var(--text)}
:root[data-theme="dark"] button.avatar.on{background:var(--brand);color:var(--on-brand)}
:root[data-theme="dark"] .demo-pill::before{background:var(--live)}
:root[data-theme="dark"] .v2 .btn{background:var(--brand);color:var(--on-brand)}
:root[data-theme="dark"] .v2 .btn:hover{background:var(--brand-hover)}
:root[data-theme="dark"] .v2 .btn.light{background:var(--v2-lime);color:var(--on-brand)}
:root[data-theme="dark"] .v2 .btn.secondary{background:transparent;color:var(--text);border-color:var(--line-strong)}
:root[data-theme="dark"] .v2 .btn.secondary:hover{background:var(--hover)}
:root[data-theme="dark"] .skip-link{background:var(--brand);color:var(--on-brand)}
:root[data-theme="dark"] :is(button,a,input,textarea,select):focus-visible{outline-color:var(--brand)}
:root[data-theme="dark"] .footer-risk h2:focus{outline-color:var(--brand)}
:root[data-theme="dark"] :is(input,textarea)::placeholder{color:var(--text-3);opacity:1}
:root[data-theme="dark"] :is(input,select,textarea){accent-color:var(--brand)}
:root[data-theme="dark"] :is(.field input,.field select,.field textarea,.input,.select){
  background:var(--surface);color:var(--text);border-color:var(--line-strong);
}
:root[data-theme="dark"] :is(.input,.select):focus{border-color:var(--brand)}
:root[data-theme="dark"] .input[aria-invalid="true"]{border-color:var(--err-text)}
:root[data-theme="dark"] .search-field{background:var(--surface);border-color:var(--line-strong)}
:root[data-theme="dark"] .search-field .icon{color:var(--text-2)}
:root[data-theme="dark"] .search-field input{color:var(--text)}
:root[data-theme="dark"] .search-field:focus-within{outline:2px solid var(--brand);outline-offset:2px}
:root[data-theme="dark"] :is(.calendar-head select,.date-navigation button){border-color:var(--line-strong)}
:root[data-theme="dark"] .calendar-head select{background:var(--surface)}
:root[data-theme="dark"] select option{background:var(--surface);color:var(--text)}
:root[data-theme="dark"] .tag{background:var(--raised);color:var(--text-2)}
:root[data-theme="dark"] .tag.outline{background:transparent;border-color:var(--line-strong)}
:root[data-theme="dark"] .v2 :is(.up,.down){color:inherit}
:root[data-theme="dark"] .v2 .up{color:var(--up)}
:root[data-theme="dark"] .v2 .down{color:var(--down)}
:root[data-theme="dark"] :is(.idx-foot .state.err,.v2 .state.err){color:var(--err-text)}

/* Moving selection markers retain their geometry and their original glide. */
:root[data-theme="dark"] :is(.segmented,.lg .seg,.lgbase .seg,#v-market .market-view-switch){background:var(--raised)}
:root[data-theme="dark"] :is(.segmented,.market-view-switch,.lg .seg,.lgbase .seg)>.ind{
  background:var(--dm-selected);box-shadow:inset 0 0 0 1px var(--line-strong);
}
:root[data-theme="dark"] .date-tabs>.ind{
  background:var(--brand-weak);box-shadow:inset 0 -2px var(--brand);
}
:root[data-theme="dark"] :is(.desktop-nav,.header-links,.mobile-nav,.tabs)>.ind{background:var(--brand)}
:root[data-theme="dark"] .tabs button{color:var(--text-2)}
:root[data-theme="dark"] .tabs :is(button.active,button[aria-selected="true"],button[aria-pressed="true"]){color:var(--text)}
:root[data-theme="dark"] .segmented button.active{color:var(--text);background:transparent;box-shadow:none}
:root[data-theme="dark"] #v-market .market-view-switch button[aria-pressed="true"]{color:var(--text);background:transparent;box-shadow:none}
:root[data-theme="dark"] .date-tabs .date-tab.active{color:var(--text);background:transparent;box-shadow:none}

/* Home: keep the photography and paper landscape, with quiet dark surrounding surfaces. */
:root[data-theme="dark"] :is(.hero-description,.page-intro p,.path-card p){color:var(--text-2)}
:root[data-theme="dark"] :is(.hero-english,.hero h1 .serif,.path-top .path-number){color:var(--brand)}
:root[data-theme="dark"] .view-caption{border-color:var(--dm-rule)}
:root[data-theme="dark"] .path-grid{border-color:var(--dm-rule)}
:root[data-theme="dark"] .home-manifesto{background:var(--raised)}
:root[data-theme="dark"] .mini-landscape{background:var(--surface)}
:root[data-theme="dark"] .float-note{background:var(--surface);border-color:var(--line);box-shadow:0 14px 40px #0005}
:root[data-theme="dark"] :is(.float-note .icon,.float-note .number){color:var(--brand)}
:root[data-theme="dark"] .orbit-label{color:var(--text-2)}
:root[data-theme="dark"] .path-art [stroke="#668061"]{stroke:var(--brand)}

/* Market: data and calendar remain easy to read on both columns/mobile modes. */
:root[data-theme="dark"] .v2 .panel{border-color:var(--dm-rule)}
:root[data-theme="dark"] :is(.market-more,.journal-summary,.learning-path,.gl-gh){border-color:var(--dm-rule)}
:root[data-theme="dark"] .week-perspective{background:var(--v2-dark);color:var(--on-petrol)}
:root[data-theme="dark"] .week-perspective :is(p,.eyebrow){color:var(--on-petrol-2)}
:root[data-theme="dark"] .week-next{color:var(--on-petrol);border-color:var(--brand-line)}
:root[data-theme="dark"] :is(.week-next-label,.week-next #weekCd){color:var(--on-petrol-2)}
:root[data-theme="dark"] .week-next-go{color:var(--on-petrol)}
:root[data-theme="dark"] .week-day{color:var(--on-petrol-2)}
:root[data-theme="dark"] .week-day.selected{color:var(--on-petrol)}
:root[data-theme="dark"] .week-dots::before{background:var(--brand-line)}
:root[data-theme="dark"] .day-dot{background:var(--v2-dark);border-color:var(--brand)}
:root[data-theme="dark"] .week-day.selected .day-dot{background:var(--brand);border-color:var(--brand)}
:root[data-theme="dark"] .index-row:hover .asset-name{color:var(--brand)}
:root[data-theme="dark"] .index-change{color:var(--text-2)}
:root[data-theme="dark"] .context-note{background:var(--raised)}
:root[data-theme="dark"] .context-note p{color:var(--text-2)}
:root[data-theme="dark"] #v-market .context-note{border-left-color:var(--brand)}
:root[data-theme="dark"] .event-card time{color:var(--text-2)}
:root[data-theme="dark"] .event-card .tag{background:var(--raised)}
:root[data-theme="dark"] .ev-imp{color:var(--brand)}
/* Past events keep their status but are not dimmed below readable contrast. */
:root[data-theme="dark"] :is(.event-card.past,.ev-row.past,.erow.past){opacity:1}
:root[data-theme="dark"] .event-card.past h3{color:var(--text-2)}
:root[data-theme="dark"] .event-card.past .ev-imp{color:var(--text-3)}
:root[data-theme="dark"] .sparkline polyline{stroke:var(--brand)}
:root[data-theme="dark"] .sparkline>path[stroke="#dce4d4"]{stroke:var(--line)}
:root[data-theme="dark"] .lg .panel{background:var(--surface);border-color:var(--line)}
:root[data-theme="dark"] .lg .search{border-color:var(--line-strong)}
:root[data-theme="dark"] .lg .lrow[aria-pressed="true"]{background:var(--press)}
:root[data-theme="dark"] .lg .nitem.fresh::before{background:var(--brand)}
:root[data-theme="dark"] .nmeta .fav{background:var(--raised);color:var(--text)}

/* Journal: dark summary band, readable dated entries, no light trade cards. */
:root[data-theme="dark"] #v-journal .reflection-banner{background:var(--v2-dark);color:var(--on-petrol)}
:root[data-theme="dark"] #v-journal :is(.reflection-label .eyebrow,.stat strong){color:var(--on-petrol)}
:root[data-theme="dark"] #v-journal :is(.reflection-label p,.stat span){color:var(--on-petrol-2)}
:root[data-theme="dark"] #v-journal :is(.stat,.reflection-stats){border-color:var(--brand-line)}
:root[data-theme="dark"] .journal-toolbar{border-color:var(--dm-rule)}
:root[data-theme="dark"] .entry-card:hover{background:var(--hover);border-color:var(--line)}
:root[data-theme="dark"] .entry-card .entry-review{border-color:var(--line)}
:root[data-theme="dark"] :is(.entry-top time,.emotion){color:var(--text-2)}
:root[data-theme="dark"] .entry-day{color:var(--brand)}
:root[data-theme="dark"] .emotion::before{background:var(--brand)}
:root[data-theme="dark"] .journal-prompt{border-color:var(--brand)}
:root[data-theme="dark"] .entry-card.is-locked .entry-review{color:var(--text-2)}
:root[data-theme="dark"] .entry-more .tcard{background:var(--raised)}
:root[data-theme="dark"] .journal-summary.is-locked :is(dd,dt span){color:var(--text-2)}

/* Library: cover artwork stays printed; shelves, saved state, and terminology adapt. */
:root[data-theme="dark"] .featured-book{background:var(--v2-dark);color:var(--on-petrol)}
:root[data-theme="dark"] .featured-copy :is(p,.eyebrow){color:var(--on-petrol-2)}
:root[data-theme="dark"] .feature-actions{color:var(--on-petrol-2)}
:root[data-theme="dark"] #v-library .featured-copy .btn{background:var(--brand);color:var(--on-brand)}
:root[data-theme="dark"] #v-library .featured-copy .btn:hover{background:var(--brand-hover)}
:root[data-theme="dark"] .book-art{background:#243029}
:root[data-theme="dark"] .book-card:nth-child(3n+2) .book-art{background:#27352d}
:root[data-theme="dark"] .book-card:nth-child(3n+3) .book-art{background:#302f25}
:root[data-theme="dark"] .save-book{background:var(--surface);color:var(--text);box-shadow:inset 0 0 0 1px var(--line-strong)}
:root[data-theme="dark"] .save-book[aria-pressed="true"]{background:var(--brand);color:var(--on-brand)}
:root[data-theme="dark"] .save-book[aria-pressed="true"] svg{fill:rgba(24,36,29,.16)}
:root[data-theme="dark"] .progress-line{background:var(--line-strong)}
:root[data-theme="dark"] .progress-line span{background:var(--brand)}
:root[data-theme="dark"] .progress-label{color:var(--text-2)}
:root[data-theme="dark"] .learning-path ol{border-color:var(--dm-rule)}
:root[data-theme="dark"] :is(.lp-no,.gl-n){color:var(--brand)}
:root[data-theme="dark"] :is(.learning-path small,.term .tn span,.term .tlk,.term>button[aria-expanded]::after){color:var(--text-2)}
:root[data-theme="dark"] .term.locked .ts{color:var(--text-2)}
:root[data-theme="dark"] .tpt{background:var(--raised)}
:root[data-theme="dark"] .gl mark{background:var(--brand);color:var(--on-brand)}
:root[data-theme="dark"] .term.hl{animation-name:termflash-dark}
@keyframes termflash-dark{from{background:#2e4032}to{background:transparent}}

/* Calendar, exchange, indicator, tool drawer, and UID dialogs use the same legacy tokens. */
:root[data-theme="dark"] .lgbase .panel{border-color:var(--line)}
:root[data-theme="dark"] :is(.opt,.code-btn){border-color:var(--line-strong)}
:root[data-theme="dark"] .opt:has(input:checked){border-color:var(--brand)}
:root[data-theme="dark"] .mcal .d[aria-pressed="true"]{color:var(--on-brand)}
:root[data-theme="dark"] .erow.past{color:var(--text-2)}
:root[data-theme="dark"] .erow.past :is(.en,.et,.ef,.ep){color:var(--text-2)}
:root[data-theme="dark"] :is(.rp-out .warn,.demo-flag){color:var(--warn-text)}
:root[data-theme="dark"] :is(.xh-flag,.ih-note,.calc-def){color:var(--on-petrol-2)}
:root[data-theme="dark"] .ind-check .ck{border-color:var(--line-strong)}
:root[data-theme="dark"] .ind-check input:checked+.ck{border-color:var(--brand)}
:root[data-theme="dark"] .ind-check input:checked+.ck svg path{stroke:var(--on-brand)}
:root[data-theme="dark"] .rail-panel{box-shadow:-12px 0 32px #0005}
:root[data-theme="dark"] .rail.open::before{background:var(--overlay)}
:root[data-theme="dark"] :is(dialog,dialog.lgbase){background:var(--surface);color:var(--text);border-color:var(--line-strong);box-shadow:0 30px 100px #0008}
:root[data-theme="dark"] :is(dialog,dialog.lgbase)::backdrop{background:var(--overlay)}
:root[data-theme="dark"] .dialog-top{background:var(--surface)}
:root[data-theme="dark"] .reading-body p{color:var(--text-2)}
:root[data-theme="dark"] .chapter-nav button.active{background:var(--brand-weak);color:var(--text)}
:root[data-theme="dark"] .delete-btn{color:var(--err-text)}
:root[data-theme="dark"] .toast{background:var(--brand);color:var(--on-brand);box-shadow:0 8px 25px #0006}
:root[data-theme="dark"] .toast.err{background:var(--err-bg);color:var(--err-text);border:1px solid var(--err-text)}

@media(max-width:640px){:root[data-theme="dark"] .rail-panel{box-shadow:0 -12px 40px #0006}}
