/* Kanjimo — new design (Penpot "Kanjimo — UI Design", decided
   2026-11-15). Tokens are the design's own: violet #6C4BD8, deep
   violet #4E35A8, lavender #B7A6F5, lime #CFE83C, ink #262230 on
   #F8F6FD. Type is Nunito with Noto Sans JP for Japanese. Build
   item 1: the shell and the Today screen; every later screen
   inherits these tokens and components unchanged. */
/* The hidden attribute must always win: component rules set
   display on elements that also carry hidden (the sidebar user
   menu is display:flex; the AI key remove button is a .btn), and
   without this they render permanently visible. */
[hidden]{display:none!important}
:root{
  /* The design is light-only; this (with the color-scheme meta)
     stops phone browsers from repainting it with forced dark.
     "light only" is the strongest form of the opt-out: it also
     keeps the browser's own widgets (scrollbars, form controls)
     from being darkened under the page. */
  color-scheme: light only;
  --violet:#6c4bd8;
  --violet-deep:#4e35a8;
  --lav:#b7a6f5;
  --lav-2:#e4def3;
  --lav-1:#efeafb;
  --paper:#f8f6fd;
  --lime:#cfe83c;
  --ink:#262230;
  --muted:#6f6a7a;
  --white:#fff;
  --r-lg:24px;
  --r-md:14px;
  /* Type scale (2026-11-19, San's responsive pass): one ladder —
     11/12/13/14/15/16/17/18/20/24/26/30/36px, body 16, small body
     14, captions 12-13, labels 11. Half-pixel sizes (13.5/14.5/
     15.5/12.5/11.5) were normalized onto the ladder. Line height
     1.5 for body text, 1.6 for Japanese example lines, 1.25 for
     headings. Spacing rides the 8pt grid with 4px half-steps:
     4/8/12/16/24/32/48/64. Standalone tappables are >=44px. */
  --fs-11:.6875rem; --fs-12:.75rem; --fs-13:.8125rem; --fs-14:.875rem;
  --fs-15:.9375rem; --fs-16:1rem; --fs-17:1.0625rem; --fs-18:1.125rem;
  --fs-20:1.25rem; --fs-24:1.5rem; --fs-30:1.875rem; --fs-36:2.25rem;
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:24px;
  --sp-6:32px; --sp-7:48px; --sp-8:64px;
  --jp:"Noto Sans JP","Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif;
  --sans:"Nunito","Noto Sans JP","Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif;
}
*{box-sizing:border-box}
html{scroll-padding-bottom:96px}
body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--sans);
  font-size:1rem;line-height:1.55;-webkit-font-smoothing:antialiased}
a,button,input,select,textarea,summary,[tabindex]{touch-action:manipulation}
:focus-visible{outline:2px solid var(--violet);outline-offset:2px}
::lang(ja){line-height:1.75;letter-spacing:.02em}

/* ---------- shell: sidebar on web, tab bar on phone ---------- */
.shell{display:flex;min-height:100vh}
.side{display:none}
.main{flex:1;min-width:0;padding:20px 16px 110px;max-width:1180px;margin:0 auto;width:100%}
.mobile-top{display:none}
.greet-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.greet-pill{margin:0}
@media (min-width:900px){ .greet-pill{display:none} }
/* The brand link's hit box is 44px tall (UI audit tap-target
   batch): padding grows it, equal negative margins hand the
   growth back so the sidebar and top bar do not move. */
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink);
  min-height:44px;padding:2px 0;margin:-2px 0}
.brand-name{font-weight:800;font-size:1.375rem;letter-spacing:-.01em}
.logo{flex:none;display:block}
.streak-pill{background:var(--lime);color:var(--ink);font-weight:800;font-size:.875rem;
  border-radius:999px;padding:8px 14px;white-space:nowrap}
.tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:60;background:var(--white);
  border-top:1px solid var(--lav-2);padding-bottom:env(safe-area-inset-bottom)}
.tabbar a{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;min-height:62px;
  justify-content:center;text-decoration:none;color:var(--muted);font-size:.8125rem;font-weight:700}
.tabbar a .tab-ic{width:24px;height:24px;display:block;flex:none}
.tabbar a[aria-current="page"]{color:var(--violet)}
/* Standalone login (decision 2, 2026-11-29): until the first
   sync probe resolves the account state — and for as long as
   the visitor is signed out — the shell shows no app navigation
   and no identity block, so the sign-in surface stands alone.
   The markup starts locked; app.js re-decides the class on
   every boot from the probe's mode. The lock hides the chrome
   containers themselves — the sidebar, the phone top bar and
   the tab bar — never their contents one by one: a contents
   list (the nav, the user block) left the sidebar column and
   its brand standing on the sign-in page at desktop widths. */
body.shell-locked .side,body.shell-locked .mobile-top,body.shell-locked .tabbar{display:none}
@media (min-width:900px){
  .mobile-top{display:none}
  .tabbar{display:none}
  .main{padding:40px 40px 64px;max-width:1200px}
  /* Study and session cards cap their own width at 720px in
     their component stylesheets (2026-11-19 responsive pass);
     Today/Library grids keep the full main width. */
  .side{display:flex;flex-direction:column;width:240px;flex:none;background:var(--white);
    border-right:1px solid var(--lav-2);padding:24px 16px;position:sticky;top:0;height:100vh}
  .side nav{display:flex;flex-direction:column;gap:8px;margin-top:38px}
  .side nav a{padding:0 20px;border-radius:var(--r-md);text-decoration:none;color:var(--muted);
    font-weight:600;font-size:.9375rem;min-height:44px;display:flex;align-items:center;gap:10px}
  .side-ic{width:19px;height:19px;flex:none}
  .side nav a:hover{color:var(--ink)}
  .side nav a[aria-current="page"]{background:var(--lav-1);color:var(--violet);font-weight:800}
  .side .streak-pill{margin-top:26px;text-align:center;padding:12px 14px}
  .side .user-wrap{margin-top:auto;position:relative}
  .side .user{display:flex;align-items:center;gap:12px;padding:8px 6px;min-width:0;width:100%;font:inherit;text-align:left;background:none;border:0;cursor:pointer;border-radius:var(--r-md)}
  .side .user:hover{background:var(--lav-1)}
  .side .user-caret{margin-left:auto;color:var(--muted);width:16px;height:16px;display:block;flex:none}
  .side .user-menu{position:absolute;left:0;right:0;bottom:calc(100% + 8px);background:var(--white);border:1px solid var(--lav-2);border-radius:var(--r-md);box-shadow:0 12px 32px rgba(38,34,48,.14);padding:6px;display:flex;flex-direction:column;gap:2px;z-index:30}
  .side .user-menu a{padding:10px 12px;border-radius:10px;text-decoration:none;color:var(--ink);font-weight:700;font-size:.9375rem}
  .side .user-menu a:hover{background:var(--lav-1)}
  .side .user-menu a[aria-current="page"]{background:var(--lav-1);color:var(--violet)}
  .side .user>span{min-width:0}
  .side .user .avatar{width:42px;height:42px;border-radius:50%;background:var(--violet);color:var(--white);
    display:grid;place-items:center;font-weight:800;font-size:1.0625rem;flex:none}
  .side .user b{display:block;font-size:.9375rem;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .side .user span{color:var(--muted);font-size:.8125rem}
}

/* ---------- Today ---------- */
.greet{font-size:1.875rem;font-weight:800;letter-spacing:-.02em;margin:4px 0 4px;line-height:1.15}
.date-line{color:var(--muted);font-size:.875rem;margin:0 0 26px}
.td-head{margin:0 0 26px}
.td-head .greet{margin:0}
.date-line.td-eyebrow{font-size:.75rem;font-weight:700;letter-spacing:.14em;
  text-transform:uppercase;color:var(--violet-deep);margin:0 0 8px}
.greet-sub{color:var(--muted);font-size:.875rem;margin:10px 0 0}
.grid{display:grid;gap:24px;grid-template-columns:minmax(0,1fr)}
.card{background:var(--white);border:1px solid var(--lav-2);border-radius:var(--r-lg);padding:24px 32px}
.lesson-card{display:flex;gap:36px}
.lesson-main{flex:0 1 420px;min-width:0}
.lesson-main .blurb{font-size:.875rem;line-height:1.45}
.lesson-cta{align-self:flex-end;width:180px;height:56px;flex:none}
.btn.lesson-cta{border-radius:16px}
.lesson-ctas{display:flex;flex-direction:column;gap:8px;align-self:flex-end;flex:none}
.lesson-ctas .lesson-cta{align-self:stretch}
@media (max-width:899px){
  .lesson-card{flex-direction:column}
  .lesson-main{flex:none}
  .lesson-cta{align-self:stretch;width:auto}
  .lesson-ctas{align-self:stretch}
}
.chip{display:inline-block;background:var(--lav-1);color:var(--violet);font-size:.6875rem;font-weight:800;
  letter-spacing:.09em;text-transform:uppercase;border-radius:999px;padding:6px 12px}
.card h2{font-size:1.5rem;font-weight:800;letter-spacing:-.01em;margin:14px 0 6px;line-height:1.25}
.card .blurb{color:var(--muted);margin:0 0 18px}
.bar{height:10px;border-radius:999px;background:var(--lav-2);overflow:hidden}
.bar i{display:block;height:100%;background:var(--violet);border-radius:999px}
.studied{color:var(--muted);font-size:.8125rem;font-weight:600;margin:10px 0 0}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;cursor:pointer;
  font-family:var(--sans);font-weight:800;font-size:1rem;border-radius:var(--r-md);
  padding:14px 24px;min-height:52px;text-decoration:none}
.btn-violet{background:var(--violet);color:var(--white);box-shadow:0 4px 0 var(--violet-deep)}
.btn-violet:active{transform:translateY(2px);box-shadow:0 2px 0 var(--violet-deep)}
.btn-lime{background:var(--lime);color:var(--violet-deep)}
.btn-block{width:100%}
.due-card{background:var(--violet-deep);color:var(--white);border:0}
.due-card .chip{background:transparent;color:var(--lav);padding:0}
.due-big{display:flex;align-items:baseline;gap:16px;margin:8px 0 6px}
.due-num{font-size:3.25rem;font-weight:800;line-height:1}
.due-big p{margin:0;font-weight:600;font-size:.9375rem;color:var(--lav-1)}
.due-card .from{color:var(--lav);font-size:.875rem;margin:0 0 22px}
.sec-label{color:var(--violet);font-size:.6875rem;font-weight:800;letter-spacing:.09em;
  text-transform:uppercase;margin:0 0 16px}
.week{display:flex;gap:10px;flex-wrap:wrap}
.day{display:flex;flex-direction:column;align-items:center;gap:7px}
.day .ring{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;
  background:var(--lav-1);color:var(--muted);font-weight:800}
.day.done .ring{background:var(--violet);color:var(--white)}
.day.today .ring{background:#c9ccd4;color:var(--violet)}
.day .ring .cdot{width:7px;height:7px;border-radius:50%;background:currentColor}
.day .ring .lucide{width:20px;height:20px}
.day small{color:var(--muted);font-size:.75rem;font-weight:700}
.day.today small{color:var(--ink)}
.week-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.streak-flame{display:flex;align-items:center;gap:8px;margin-bottom:16px}
.streak-count{font-weight:800;font-size:1.25rem;line-height:1;color:var(--ink)}
.flame-svg{display:block;flex:none}
.week-note{margin:12px 0 0;font-weight:600;font-size:.8125rem;color:var(--muted)}
/* Coming Up rows are a plain preview, not doors: no list-row
   divider between them and no heading-weight title, so nothing
   reads as tappable (UI flow audit cluster 2, flow question 4;
   San decided display-only, remove the tappable look). */
.up-row{padding:2px 0;line-height:1.25}
.up-row + .up-row{margin-top:10px}
.up-row b{display:block;font-size:.9375rem;font-weight:600}
.up-row span{color:var(--muted);font-size:.75rem}
.band-done-top{display:flex;gap:20px;align-items:flex-start;margin-top:16px}
.band-done-disc{flex:none;width:56px;height:56px;border-radius:50%;background:var(--lime);
  color:var(--violet-deep);display:flex;align-items:center;justify-content:center}
.band-done-disc .lucide{width:30px;height:30px}
.band-done-head{flex:1;min-width:0}
.band-done-head h2{margin:2px 0 6px}
.band-done-stats{font-weight:700;color:var(--ink);margin:0 0 4px}
.band-done-card .band-done-line{margin:0}
.band-done-start{flex:none;align-self:center}
.band-ladder{margin-top:22px}
.band-ladder .sec-label{margin:0 0 10px}
.band-ladder-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.band-rung{display:inline-flex;align-items:center;gap:5px;border-radius:999px;padding:6px 12px;
  font-weight:800;font-size:.8125rem;background:var(--lav-1);color:var(--muted)}
.band-rung .lucide{width:14px;height:14px}
.band-rung-done{background:#e2f3e8;color:#1e7a46}
.band-rung-current{background:var(--violet);color:var(--white)}
.band-ladder-line{color:var(--muted);font-size:.875rem;font-weight:600;margin-left:8px}
.band-done-doors{margin-top:20px}
@media (max-width:899px){
  .band-done-top{flex-wrap:wrap}
  .band-done-start{flex:1 1 100%}
}
.chart{display:flex;gap:8px;align-items:flex-end}
.col{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0}
.col b{font-size:.875rem}
.col .track{height:72px;width:100%;max-width:64px;display:flex;align-items:flex-end}
.col .fill{width:100%;border-radius:8px;background:var(--lav)}
.fc-note{color:var(--muted);font-size:.875rem;font-weight:600;line-height:1.65;margin:10px 0 0}
.col.today .fill{background:var(--lime)}
.col small{color:var(--muted);font-size:.8125rem;font-weight:700}
.col.today small{color:var(--ink)}
.how{background:var(--lav-1);border:0;display:grid;gap:8px}
.how .sec-label{margin:0}
.how p{margin:0;line-height:1.65}
.foot-note{color:var(--muted);font-size:.875rem;text-align:center;margin:22px 0 0}
@media (min-width:900px){ .foot-note{display:none} }
.sec-label-case{text-transform:none;letter-spacing:.02em}
.due-words-short{display:none}
.dl-1{display:none}
.empty-note{color:var(--muted);margin:0}
@media (min-width:900px){
  /* Fluid at every desktop width: the fixed 700px column plus
     the sidebar and page padding overflowed a 1280px window. */
  .grid{grid-template-columns:minmax(0,1.62fr) minmax(0,1fr)}
  @media (max-width:1240px){ .lesson-main{flex:1 1 auto} }
  .span-2{grid-column:span 2}
  .how{grid-template-columns:180px 1fr;gap:24px;align-items:start}
}
@media (min-width:900px) and (max-width:1150px){
  /* Narrow sidebar band (Surface Pro portrait, 11-inch iPad
     landscape): the 240px sidebar leaves ~600px, where two
     columns crush the lesson card to a word per line and clip
     the listening teaser's title past the card edge. Stack the
     grid until there is room for both columns again. */
  .grid{grid-template-columns:minmax(0,1fr)}
  .span-2{grid-column:span 1}
}
@media (prefers-reduced-motion:reduce){
  *{transition:none!important;animation-duration:.01ms!important}
}

/* State cards (States Sheet): caught-up, offline, error, update. */
.state-card{background:var(--white);border:1px solid var(--lav-2);border-radius:24px;
  padding:40px 32px;text-align:center;max-width:480px;margin:24px auto}
.state-mark{width:100px;height:100px;border-radius:50%;margin:0 auto 20px;
  display:flex;align-items:center;justify-content:center;font-size:2.5rem;font-weight:800}
.state-mark-ok{background:#e2f3e8;color:#1e7a46}
.state-mark-wash{background:var(--lav-1);color:var(--violet)}
.state-mark-bad{background:#fbeae4;color:#c2432b}
.state-title{font-size:1.25rem;font-weight:800;margin:0 0 10px}
.state-line{color:var(--muted);font-size:.875rem;line-height:1.5;margin:0 auto 22px;max-width:325px}
.state-card .btn{min-width:min(271px,100%);min-height:48px}
.state-card .btn + .btn{margin-top:12px}
.state-load{max-width:480px;margin:24px auto;text-align:center}
.state-bar{height:22px;border-radius:11px;background:var(--lav-2);margin:0 auto 22px}
.state-load p{color:var(--muted);font-size:.875rem;font-weight:600}

/* Phone Today follows the mobile board: one-line due headline,
   seven single-letter week circles in a row, one-line Coming Up
   rows, and no forecast / how-it-works cards (the board ends at
   Coming Up, then the footer line). */
@media (max-width:640px){
  .due-num{font-size:1.375rem}
  .due-words-full{display:none}
  .due-words-short{display:block;font-weight:800;font-size:1.375rem;color:var(--white)}
  .week{flex-wrap:nowrap;justify-content:space-between;width:100%}
  .week{gap:6px}
  .day .ring{width:32px;height:32px}
  .dl-full{display:none}
  .dl-1{display:block}
  .up-row span{display:none}
  .fc-card,.how:not(.rv-tomorrow){display:none}
}

/* Speaker sign on every play-aloud control (2026-11-18). */
.spk-ic{width:15px;height:15px;flex:none}
.spk-btn{display:inline-flex;align-items:center;gap:6px}

/* Lucide icons (2026-11-19): a zero-specificity default size so
   context classes always win; icon-only chrome buttons centre
   the glyph in their existing tap-target box. */
:where(.lucide){width:20px;height:20px}
.kj-nav-btn svg,.gr-session-btn svg,.ls-nav-btn svg,.ss-exit svg,.vc-nav-btn svg,.dt-back svg{display:block;width:20px;height:20px}

/* Item detail head (flow Q11, 2026-11-24): the standalone
   Library lookup view's only chrome — a back button in the
   study pages' own nav-button shape, and where it leads. */
.dt-head{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.dt-back{flex:none;width:44px;height:44px;display:grid;place-items:center;
  text-decoration:none;color:var(--muted);font-size:1.125rem;font-weight:700;border-radius:var(--r-md)}
.dt-back:hover{color:var(--ink);background:var(--lav-1)}
.dt-title{font-weight:700;color:var(--ink)}
.ls-play svg{width:26px;height:26px}
.kj-stroke-all svg{width:16px;height:16px}
.streak-pill svg{width:14px;height:14px;vertical-align:-2px}
.au-check-mark svg{width:14px;height:14px;vertical-align:-2px}
