/* The desktop side panel (docs/54 sections 4 and 12): the words in the line, the scene so far, today's words, grammar, kana and
   kanji, the notebook. Drawn by js/ui/side/. Every rule hangs off html.wide or html.two, so a phone sees none of it. The column's
   own place (grid area, width, the drawer on two columns) is the shell's, in desktop.css; this file only dresses what is inside. */

/* nothing to show: the side is not there at all (on two columns the drawer's button then opens nothing) */
html:is(.wide, .two) #app[data-layout="stage"] #side.empty { display: none; }
html:is(.wide, .two) #side { container-type: inline-size; scrollbar-width: thin; scrollbar-color: #ffffff26 transparent; overscroll-behavior: contain; }

html:is(.wide, .two) #side .sd-panel { background: #171a20e6; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 16px; margin: 0 0 14px; }
html:is(.wide, .two) #side .sd-panel:last-child { margin-bottom: 0; }
html:is(.wide, .two) #side .sd-title { margin: 0 0 10px; font: 700 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent2); }
html:is(.wide, .two) #side [lang="ja"] { font-family: var(--jp); }

/* ------------------------------------------------------------------ words: in this line, and today's words */
html:is(.wide, .two) #side .sd-words { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
html:is(.wide, .two) #side .sd-word { display: grid; grid-template-columns: minmax(84px, max-content) minmax(0, 1fr) auto; grid-template-areas: "w m t"; gap: 2px 12px; align-items: baseline; padding: 6px 8px; border-radius: 10px; }
html:is(.wide, .two) #side .sd-word:hover, html:is(.wide, .two) #side .sd-word.on { background: #ffffff0a; }
html:is(.wide, .two) #side .sd-ja { grid-area: w; display: block; max-width: 11em; font-size: 19px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
html:is(.wide, .two) #side .sd-ro { display: block; font-family: var(--mono), "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", "Meiryo"; font-size: 11px; font-weight: 600; line-height: 1.35; letter-spacing: .02em; color: var(--muted); }
html:is(.wide, .two) #side .sd-mean { grid-area: m; font-size: 14.5px; line-height: 1.4; color: #d6d1c9; min-height: 1.4em; }
html:is(.wide, .two) #side .sd-tag { grid-area: t; justify-self: end; font: 600 10.5px var(--mono); letter-spacing: .06em; font-style: normal; padding: 2px 7px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
html:is(.wide, .two) #side .sd-tag.met { color: var(--accent2); border-color: #c8a27a66; }
html:is(.wide, .two) #side .sd-tag.today { color: #9fd8b4; border-color: #4ad17f66; }
html:is(.wide, .two) #side .sd-tag.new { color: #aac3ec; border-color: #86a4d680; }
html:is(.wide, .two) #side .sd-tag.now { color: #9fd8b4; border-color: #4ad17f66; background: #4ad17f22; }
html:is(.wide, .two) #side .sd-tag.next { color: var(--dim); border-color: var(--line); }
html:is(.wide, .two) #side .sd-list .sd-word { padding: 5px 8px; }
html:is(.wide, .two) #side .sd-panel[data-compact] .sd-words { max-height: min(38vh, 340px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #ffffff26 transparent; }
@container (max-width: 340px) {
  html:is(.wide, .two) #side .sd-word { grid-template-columns: minmax(66px, 38%) minmax(0, 1fr) auto; gap: 2px 8px; padding: 5px 6px; }
  html:is(.wide, .two) #side .sd-ja { max-width: none; font-size: 17px; }
  html:is(.wide, .two) #side .sd-mean { font-size: 13.5px; }
}
@container (max-width: 250px) {
  html:is(.wide, .two) #side .sd-word { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "w t" "m m"; }
}

/* ------------------------------------------------------------------ the scene so far */
html:is(.wide, .two) #side .sd-log { display: grid; gap: 9px; max-height: min(34vh, 300px); overflow-y: auto; padding-right: 4px; font-size: 14px; line-height: 1.5; color: #bdb8b0; scrollbar-width: thin; scrollbar-color: #ffffff26 transparent; }
html:is(.wide, .two) #side .sd-who { margin-right: 6px; font-weight: 650; color: var(--text); }
html:is(.wide, .two) #side .sd-line.narr .sd-who { color: var(--muted); font-weight: 600; }
html:is(.wide, .two) #side .sd-line.narr .sd-text { font-style: italic; }
html:is(.wide, .two) #side .sd-jabox { margin-top: 1px; }
html:is(.wide, .two) #side .sd-jabox .gline { margin: 0; font-size: 17px; line-height: 2.2; color: var(--text); }
html:is(.wide, .two) #side .sd-jabox .gline rt { font-size: max(9.5px, .46em); }
html:is(.wide, .two) #side .sd-en { display: block; margin-top: 1px; font-size: 13.5px; color: var(--muted); }
html:is(.wide, .two) #side .sd-empty { margin: 0; font-size: 13.5px; font-style: italic; color: var(--dim); }

/* ------------------------------------------------------------------ the sets: today's kana and kanji, and the line's lesson */
html:is(.wide, .two) #side .sd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
html:is(.wide, .two) #side .sd-chips + .sd-chips { margin-top: 8px; }
html:is(.wide, .two) #side .sd-chip { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px;
  font-size: 20px; line-height: 1; background: #ffffff0a; border: 1px solid var(--line); }
html:is(.wide, .two) #side .sd-chip small { font: 600 11px/1 system-ui, sans-serif; color: var(--muted); }
html:is(.wide, .two) #side .sd-chip.done { border-color: #4ad17f66; background: #4ad17f14; }
html:is(.wide, .two) #side .sd-chip.now { border-color: var(--crema); background: var(--crema-soft); }
html:is(.wide, .two) #side .sd-chip.todo { color: #cfcac2; }
html:is(.wide, .two) #side .sd-tick { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--ok); color: #0d0f12; }
html:is(.wide, .two) #side .sd-tick svg { width: 10px; height: 10px; }
html:is(.wide, .two) #side .sd-count { margin: 10px 0 0; font: 12px var(--mono); color: var(--dim); }

/* ------------------------------------------------------------------ grammar, parts, the notebook */
html:is(.wide, .two) #side .sd-gram, html:is(.wide, .two) #side .sd-parts, html:is(.wide, .two) #side .sd-clues { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
html:is(.wide, .two) #side .sd-point { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
html:is(.wide, .two) #side .sd-head { font-size: 19px; font-weight: 700; line-height: 1.3; color: var(--accent2); overflow-wrap: anywhere; }
html:is(.wide, .two) #side .sd-gist { font-size: 14.5px; line-height: 1.4; color: #d6d1c9; }
html:is(.wide, .two) #side .sd-part { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
html:is(.wide, .two) #side .sd-glyph { font-size: 26px; line-height: 1.2; text-align: center; }
html:is(.wide, .two) #side .sd-pname { font-size: 14.5px; color: #d6d1c9; }
html:is(.wide, .two) #side .sd-role { font: 600 10.5px var(--mono); letter-spacing: .06em; font-style: normal; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
html:is(.wide, .two) #side .sd-clue { position: relative; padding-left: 24px; font-size: 15px; line-height: 1.5; color: #d6d1c9; }
html:is(.wide, .two) #side .sd-clue::before { content: ""; position: absolute; left: 0; top: .42em; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); box-sizing: border-box; }
html:is(.wide, .two) #side .sd-clue.solved::before { background: var(--ok); border-color: var(--ok); }
html:is(.wide, .two) #side .sd-clue.mystery { font-style: italic; }
html:is(.wide, .two) #side .sd-cen { display: block; margin-top: 1px; font-size: 13.5px; color: var(--muted); }

/* ------------------------------------------------------------------ why a meaning is missing */
html:is(.wide, .two) #side .sd-note { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
html:is(.wide, .two) #side .sd-lock { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--accent2); }
html:is(.wide, .two) #side .sd-lock svg { display: block; width: 100%; height: 100%; }

/* ------------------------------------------------------------------ a short window */
@media (max-height: 699px) {
  html:is(.wide, .two) #side .sd-panel { padding: 10px 12px 12px; margin-bottom: 10px; border-radius: 14px; }
  html:is(.wide, .two) #side .sd-title { margin-bottom: 7px; }
  html:is(.wide, .two) #side .sd-ja, html:is(.wide, .two) #side .sd-head { font-size: 17px; }
  html:is(.wide, .two) #side .sd-word { padding: 4px 6px; }
  html:is(.wide, .two) #side .sd-log { max-height: min(24vh, 200px); }
  html:is(.wide, .two) #side .sd-jabox .gline { font-size: 15px; line-height: 2.1; }
}

/* ------------------------------------------------------------------ a column that scrolls: its last edge fades (not the drawer, whose shadow a mask would cut), and the end has room */
html.wide #app[data-layout="stage"] #side:not(.empty) { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 26px), transparent); }
html:is(.wide, .two) #side:not(.empty)::after { content: ""; display: block; height: 30px; }
