/* DigiStep365 global pages — same tokens and senior sizes as the Korean app */
:root {
  --bg: #f7f9fd; --surface: #fff; --surface-2: #eaf1fd; --ink: #1e2a5a; --ink-2: #4a5578; --line: #e2e7f2;
  --primary: #2563e2; --primary-ink: #fff; --warn-bg: #fff6e0; --warn-line: #e9c46a; --warn-text: #5b4300;
  --ok: #007a4b; --radius: 14px; --gutter: 16px; --shadow: 0 1px 2px rgba(30,42,90,.06), 0 4px 14px rgba(30,42,90,.06);
  font-size: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0e1430; --surface: #161f46; --surface-2: #1d2b5c; --ink: #e7ebf7; --ink-2: #aab3d1; --line: #2b376a; --primary: #6c9bff; --primary-ink: #0e1430; --warn-bg: #3a2f12; --warn-line: #8a6d1e; --warn-text: #f3dc9c; --ok: #5fd6a6; }
}
:root[data-size="large"] { font-size: 21px; }
:root[data-size="xlarge"] { font-size: 24px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.6; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px var(--gutter); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #102BB7; }
.brand b { display: block; font-size: 1.2rem; font-weight: 900; letter-spacing: -0.02em; }
.brand i { font-style: normal; color: #29982F; }
.brand small { display: block; color: var(--ink-2); font-size: .8rem; line-height: 1.2; }
@media (prefers-color-scheme: dark) { .brand { color: #9fb2ff; } }
.size { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.size button { min-height: 44px; padding: 0 8px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.size button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.page { max-width: 40rem; margin: 0 auto; padding: 16px var(--gutter) 120px; }
h1 { font-size: clamp(1.6rem, 6vw, 2.1rem); line-height: 1.3; margin: 8px 0; letter-spacing: -0.02em; }
.lead { color: var(--ink-2); margin: 0 0 12px; }
.eyebrow { color: var(--primary); font-weight: 800; margin: 16px 0 0; }
.based { font-size: .9rem; color: var(--ink-2); background: var(--surface-2); padding: 8px 12px; border-radius: 10px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0; font-size: .85rem; color: var(--ink-2); }
.crumbs li + li::before { content: "›"; margin-inline-end: 4px; }
[dir="rtl"] .crumbs li + li::before { content: "‹"; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 18px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn--block { display: flex; width: 100%; margin: 16px 0; }
.btn[aria-pressed="true"] { background: var(--surface-2); border-color: var(--primary); }
.tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.steps { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 12px; }
.step { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.js-one .step:not(.is-on) { display: none; }
.step__no { margin: 0; font-weight: 800; color: var(--primary); }
.step__text { font-size: 1.6rem; line-height: 1.4; margin: 6px 0; letter-spacing: -0.01em; }
.step__hint { margin: 0; color: var(--ink-2); }
.step__note { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); border: 1.5px solid var(--warn-line); color: var(--warn-text); }
.finish { font-weight: 800; color: var(--ok); }
.bar { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.bar .btn { min-height: 60px; }
.bar [disabled] { opacity: .45; cursor: default; }
.meta { margin: 20px 0; }
.meta summary { cursor: pointer; font-weight: 700; min-height: 44px; }
.group h2 { font-size: 1.3rem; margin: 28px 0 8px; }
.cat { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 12px; }
.cat h3 { margin: 0; font-size: 1.2rem; }
.num { display: inline-grid; place-items: center; min-width: 2.2rem; height: 2.2rem; border-radius: 10px; background: var(--surface-2); color: var(--primary); font-weight: 900; margin-inline-end: 6px; }
.cat__desc { color: var(--ink-2); margin: 4px 0 8px; font-size: .95rem; }
.lessons { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.lessons a, .lessons .soon { display: flex; justify-content: space-between; gap: 8px; align-items: center; min-height: 52px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700; }
.lessons span { font-size: .85rem; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.lessons .soon { color: var(--ink-2); border-style: dashed; font-weight: 600; }
.points { padding-inline-start: 1.2rem; display: grid; gap: 8px; }
.foot { max-width: 40rem; margin: 0 auto; padding: 16px var(--gutter) 140px; color: var(--ink-2); font-size: .85rem; border-top: 1px solid var(--line); }
.draft { padding: 8px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-text); font-weight: 700; }
.pic { margin: 12px 0 0; padding: 10px; border-radius: var(--radius); background: #e9edf5; display: flex; justify-content: center; }
.pic__svg { width: 100%; max-width: 300px; height: auto; display: block; direction: ltr; }
.pic--practice .hit { cursor: pointer; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pic { background: #0b1026; } }
.device { margin: 16px 0 8px; padding: 16px; background: var(--surface); border: 1.5px solid var(--primary); border-radius: var(--radius); display: grid; gap: 10px; }
.device h2 { margin: 0; font-size: 1.3rem; }
.device__now { margin: 0; font-weight: 800; color: var(--primary); }
.device__how { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.device__how summary { font-weight: 800; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.device__how ol { margin: 6px 0; padding-inline-start: 1.4em; display: grid; gap: 4px; }
.device__how p { margin: 6px 0; font-size: .9rem; color: var(--ink-2); }
.device__form { display: grid; gap: 10px; }
.device__form label { display: grid; gap: 4px; font-weight: 700; }
.device__form select { min-height: 52px; font: inherit; font-weight: 600; padding: 0 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); max-width: 100%; }
.device__form select:disabled { opacity: .6; }
.device__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.device__saved { margin: 0; color: var(--ok); font-weight: 700; min-height: 1.2em; }
.device__note { margin: 0; font-size: .85rem; color: var(--ink-2); }
.support { padding: 10px 12px; border-radius: 10px; font-size: .95rem; background: var(--warn-bg); color: var(--warn-text); border: 1.5px solid var(--warn-line); }
.support--ok { background: #e1f9ef; color: #00603b; border-color: #8fd9b6; }
.support--no { background: #fdecea; color: #a3241a; border-color: #f0a39b; }
.sup { font-style: normal; font-size: .75rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-text); margin-inline-start: auto; white-space: nowrap; }
.sup--ok { background: #e1f9ef; color: #00603b; }
.sup--no { background: #fdecea; color: #a3241a; }
.device, .device__form, .device__form label { min-width: 0; }
.device__form select { width: 100%; }
.admin table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: .85rem; background: var(--surface); }
.admin th, .admin td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
[dir="rtl"] .admin th, [dir="rtl"] .admin td { text-align: right; }
.admin .rows { display: block; overflow-x: auto; }
.admin small { color: var(--ink-2); }
.lessons li { min-width: 0; }
.lessons a { flex-wrap: wrap; row-gap: 2px; }
.lessons a > span, .lessons a > .sup { white-space: nowrap; }
.lessons a { overflow-wrap: anywhere; }
.consent { position: fixed; left: 8px; right: 8px; bottom: 90px; z-index: 20; background: var(--surface); border: 1.5px solid var(--primary); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.consent p { margin: 0 0 8px; }
.consent div { display: flex; gap: 8px; flex-wrap: wrap; }
.bar .btn { min-width: 0; padding: 0 10px; white-space: normal; line-height: 1.2; text-align: center; }
.bar .btn { font-size: clamp(15px, 4.6vw, 1rem); overflow-wrap: anywhere; }
/* long words (German compound nouns etc.) must never cause sideways scrolling */
.page, .foot { overflow-wrap: anywhere; }
h1, h2, h3, .step__text { hyphens: auto; -webkit-hyphens: auto; }
.step, .cat, .device { min-width: 0; }

/* 관리자 편집 화면 */
.admin.edit { max-width: 1200px; }
.edit__help { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin: 8px 0 16px; }
.edit__help ol { padding-inline-start: 1.3em; display: grid; gap: 4px; }
.edit__bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: end; margin-bottom: 12px; }
.edit__bar label, .edit__gh label, .edit__field { display: grid; gap: 4px; font-weight: 700; font-size: .9rem; }
.admin.edit input, .admin.edit select, .admin.edit textarea { font: inherit; font-weight: 400; font-size: 1rem; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); min-height: 44px; width: 100%; box-sizing: border-box; }
.admin.edit textarea { resize: vertical; line-height: 1.5; }
.admin.edit input:disabled { opacity: .55; }
.admin.edit :focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.edit__grid { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 16px; align-items: start; }
.edit__list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; max-height: 75vh; overflow-y: auto; position: sticky; top: 8px; }
.edit__list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.edit__cat { font-size: .8rem; font-weight: 800; color: var(--ink-2); padding: 10px 6px 2px; }
.edit__item { width: 100%; text-align: start; display: grid; gap: 2px; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; min-height: 44px; }
.edit__item:hover { background: var(--surface-2); }
.edit__item.is-on { background: var(--surface-2); outline: 2px solid var(--primary); }
.edit__item small { color: var(--ink-2); }
.edit__badges { display: flex; flex-wrap: wrap; gap: 4px; }
.edit .b { font-style: normal; font-size: .72rem; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.edit .b--ok { background: #dff3e1; color: #1b6b25; }
.edit .b--ed { background: #e3e9ff; color: #1f3b9b; }
.edit .b--pend { background: var(--warn-bg); color: var(--warn-text); }
.edit__form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: grid; gap: 12px; min-width: 0; }
.edit__form h2 { margin: 0; }
.edit__meta { color: var(--ink-2); font-size: .85rem; overflow-wrap: anywhere; margin: 0; }
.edit__steps { padding-inline-start: 1.4em; display: grid; gap: 16px; margin: 0; }
.edit__step { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.edit__ref { margin: 0; font-size: .85rem; color: var(--ink-2); background: var(--surface-2); padding: 4px 8px; border-radius: 8px; }
.edit__warn { color: var(--warn-text); font-weight: 700; }
.edit__review, .edit__gh { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; }
.edit__check { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.admin.edit .edit__check input { width: 22px; min-height: 22px; height: 22px; }
.edit__save { margin-top: 20px; display: grid; gap: 10px; }
.edit__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.edit__msg { font-weight: 700; color: #1b6b25; min-height: 1.5em; }
.edit__msg.is-bad { color: #b3261e; }
@media (max-width: 760px) { .edit__grid { grid-template-columns: 1fr; } .edit__list { position: static; max-height: 40vh; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .edit .b--ok { background: #12391a; color: #9be3a6; } :root:not([data-theme="light"]) .edit .b--ed { background: #1c2a5c; color: #b9c8ff; } }
.admin__brand { margin: 4px 0 12px; }
.admin .sum { display: block; overflow-x: auto; }
.admin table { overflow-wrap: normal; }
.admin .sum th, .admin .sum td { white-space: nowrap; }

/* 화면 개선 2026-11-26 */
/* 머리글: 글씨 크기는 모든 언어에서 같은 ‘A’ 세 개라 로고 옆 한 줄에 들어간다 */
.top { flex-wrap: nowrap; }
.brand { min-width: 0; }
.size { flex-wrap: nowrap; flex: none; }
.size button { width: 44px; padding: 0; display: inline-grid; place-items: center; font-weight: 900; line-height: 1; }
.size--normal span { font-size: .85rem; }
.size--large span { font-size: 1.05rem; }
.size--xlarge span { font-size: 1.3rem; }
/* 데스크톱: 아래 버튼 막대를 본문 폭에 맞춘다 */
.bar { padding-inline: max(var(--gutter), calc((100% - 40rem) / 2 + var(--gutter))); }
/* 수업: 그림이 첫 화면에 보이도록 위쪽을 가볍게 */
.page > .lead { margin-bottom: 8px; }
.tools { margin-top: 4px; }
.based { margin: 12px 0 0; font-size: .85rem; }
/* 줄바꿈: 일본어는 낱말 단위, 모든 언어에서 마지막 한 글자만 남는 줄을 줄인다 */
:lang(ja) .page, :lang(ja) .foot { word-break: auto-phrase; line-break: strict; }
:lang(zh) .page, :lang(zh) .foot { line-break: strict; }
.page p, .page li, .foot p { text-wrap: pretty; }
.page h1, .page h2, .step__text { text-wrap: balance; }
/* 휴대폰: 위치 표시는 바로 위 단계 하나만 */
@media (max-width: 640px) {
  .crumbs li { display: none; }
  .crumbs li:nth-last-child(2) { display: block; }
  .crumbs li:nth-last-child(2)::before { content: "‹ "; margin: 0; }
  [dir="rtl"] .crumbs li:nth-last-child(2)::before { content: "› "; }
}
/* 수업 목록: ‘내 휴대폰’은 한 줄 요약, 눌러서 펼침 */
.device { gap: 8px; padding: 12px 14px; }
.device__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.device__head h2 { font-size: 1.1rem; }
.device__now { font-size: .95rem; }
.device__pick { display: grid; gap: 10px; }
.device__pick > summary { list-style: none; min-height: 48px; width: fit-content; }
.device__pick > summary::-webkit-details-marker { display: none; }
.device__pick[open] > summary { background: var(--surface-2); border-color: var(--primary); margin-bottom: 10px; }
/* 홈: 연습 그림 한 장과 자주 보는 수업 */
.demo { margin: 8px 0 20px; display: grid; gap: 8px; }
.demo__pic { display: flex; justify-content: center; padding: 10px; border-radius: var(--radius); background: #e9edf5; }
.demo__pic .pic__svg { max-width: 190px; }
.demo figcaption { color: var(--ink-2); font-size: .95rem; }
.demo figcaption b { color: var(--ink); display: block; font-size: 1.05rem; }
.popular h2 { font-size: 1.2rem; margin: 8px 0; }
.popular { margin-bottom: 16px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .demo__pic { background: #0b1026; } }
/* 국내 정적 수업 페이지(/learn/) */
.ko-words { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; font-size: .9rem; color: var(--ink-2); }
.ko-words b { color: var(--ink); margin-inline-end: 4px; }
.ko-words span { background: var(--surface-2); border-radius: 999px; padding: 2px 10px; }
.ko-steps .step { display: block !important; }
.cat h3 a { color: var(--ink); }
