.topic-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin-top: 25px; }
.topic-card { display: block; padding: 0; text-align: left; font: inherit; color: var(--ink); background: #fff; border: 1px solid #e0d7ee; border-radius: 14px; overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s; min-width: 0; }
.topic-card:hover,.topic-card.selected { box-shadow: 0 7px 20px #4c378b15; border-color: #8a71b5; transform: translateY(-2px); }
.topic-art { height: 110px; background: #eee8f7; display: flex; align-items: center; justify-content: center; color: var(--purple); font-size: 46px; font-weight: 800; letter-spacing: -2px; position: relative; }
.topic-card:nth-child(3n+2) .topic-art { background: #faf1b6; }
.topic-card:nth-child(3n+3) .topic-art { background: #e5eef8; }
.topic-copy { padding: 19px; }
.topic-copy h3 { font-size: 17px; margin: 0 0 8px; }
.topic-copy p { font-size: 11px; margin: 0 0 12px; line-height: 1.7; }
.topic-label { color: var(--purple); font-size: 9px; font-weight: 600; }
.catalog-intro { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.catalog-back { margin-bottom: 22px; }
.sample-note { font-size: 11px; background: #fff6cf; padding: 14px 16px; border-radius: 10px; margin: 18px 0; color: #655119; }
.sample-text { line-height: 1.9; font-size: 15px; background: #f6f3fa; border-left: 3px solid var(--purple); padding: 20px; border-radius: 0 10px 10px 0; margin: 24px 0; }
.sample-answer { display: block; width: 100%; min-height: 180px; resize: vertical; margin: 12px 0; }
.sample-tasks { margin: 20px 0; padding-left: 21px; font-size: 13px; }
.practice-landing { max-width: 1220px; margin: auto; padding: 70px 40px; }
.practice-hero { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 65px; }
.practice-hero h1 { font-size: clamp(30px,4vw,48px); }
.practice-hero > div > p { max-width: 560px; }
.entry-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 28px 0 18px; }
.entry-actions .soft-button { padding: 13px 18px; }
.practice-art { min-height: 340px; border-radius: 32px; background: #eee8f7; padding: 50px 35px; display: flex; flex-wrap: wrap; gap: 13px; position: relative; }
.practice-art > span { width: 100%; font-size: 34px; line-height: 1.3; color: var(--purple); }
.practice-tile { width: 70px; height: 70px; display: grid; place-items: center; background: #fff; border-radius: 14px; font-size: 28px; font-weight: 800; transform: rotate(-7deg); }
.practice-tile:nth-of-type(2) { background: var(--yellow); transform: rotate(7deg); }
.practice-art i { position: absolute; right: 20px; top: -18px; color: var(--purple); font-size: 70px; font-style: normal; }
.entry-topics { margin-top: 70px; }
.entry-topics .topic-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.study-layout > aside { position: sticky; top: 116px; }
.study-layout #tool-nav { max-height: calc(100dvh - 240px); overflow-y: auto; }
.study-workspace[hidden] { display: none !important; }
#learn-loading { max-width: 1180px; margin: 50px auto; padding: 24px; }
.study-panel { min-height: 560px; }
@media(max-width:760px) {
 .topic-grid { grid-template-columns: 1fr; }
 .topic-art { height: 95px; }
 .practice-landing { padding: 40px 24px 80px; }
 .practice-hero { grid-template-columns: 1fr; gap: 35px; }
 .practice-art { min-height: 240px; padding: 35px; }
 .entry-topics .topic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
 .entry-topics .topic-copy { padding: 13px; }
 .entry-topics .topic-copy h3 { font-size: 14px; }
 .study-layout > aside { position: static; }
 .study-layout #tool-nav { max-height: none; }
 .sample-text { font-size: 13px; padding: 15px; }
}
@media(max-width:760px) {
 .study-layout #tool-nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; gap: 6px; }
 .study-layout .tool-tab { padding: 10px 8px; font-size: 10px; min-width: 0; white-space: normal; }
 .study-layout .tool-tab > span { font-size: 17px; min-width: 18px; }
 .study-layout .rail-note { display: none; }
 .study-layout > aside { padding: 18px 12px; }
}
body:has(#study-sidebar) .workspace { max-width: none; padding: 28px 70px 55px 292px; }
body:has(#study-sidebar) .workspace-heading h1 { font-size: clamp(27px,3vw,38px); margin-block: 10px; }
body:has(#study-sidebar) .workspace-heading { margin-bottom: 20px; }
body:has(#study-sidebar) .study-layout { display: block; }
body:has(#study-sidebar) .study-layout > aside { position: fixed; left: 0; top: var(--app-header-height,92px); bottom: 0; width: 255px; border-radius: 0; border-left: 0; border-bottom: 0; border-top: 0; padding: 22px 16px; z-index: 45; overflow-y: auto; background: #fff; transition: width .2s; }
body:has(#study-sidebar) #tool-nav { max-height: none; overflow: visible; }
.tool-tab > .tool-label { font-size: 12px; min-width: 0; }
#sidebar-toggle { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: #f0ebf7; color: var(--purple); font: inherit; font-size: 13px; padding: 11px 13px; border-radius: 9px; margin-bottom: 25px; }
#sidebar-toggle span { font-size: 11px; }
.sidebar-open { display: none; }
body:has(#study-sidebar).sidebar-collapsed .workspace { padding-left: 116px; }
body:has(#study-sidebar).sidebar-collapsed .study-layout > aside { width: 80px; padding-inline: 12px; }
body:has(#study-sidebar).sidebar-collapsed #study-sidebar > .eyebrow, body:has(#study-sidebar).sidebar-collapsed .tool-label, body:has(#study-sidebar).sidebar-collapsed .rail-note, body:has(#study-sidebar).sidebar-collapsed #sidebar-toggle span { display: none; }
body:has(#study-sidebar).sidebar-collapsed .tool-tab { justify-content: center; padding-inline: 5px; }
body:has(#study-sidebar) .app-footer { padding-left: 292px; }
body:has(#study-sidebar).sidebar-collapsed .app-footer { padding-left: 116px; }
.attendance-zone { margin: 15px 0; position: relative; z-index: 5; }
.attendance-bar { padding: 16px 20px; border: 1px solid #dfd6ea; border-radius: 12px; background: #fff; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.attendance-bar > div { flex: 1; }
.attendance-bar strong { font-size: 13px; }
.attendance-bar p { margin: 4px 0 0; font-size: 10px; }
.attendance-bar .button { padding: 11px 15px; font-size: 11px; }
#activity-calendar { border: 0; }
#activity-calendar > summary { list-style: none; cursor: pointer; font-size: 11px; padding: 10px; color: var(--purple); font-weight: 600; }
#activity-calendar > summary::-webkit-details-marker { display: none; }
#active-day-count { display: block; color: var(--muted); font-size: 9px; margin-top: 4px; }
#calendar-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 310px; padding: 19px; border: 1px solid #ded4e8; border-radius: 13px; background: white; box-shadow: 0 12px 30px #4c378b25; }
.calendar-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.calendar-heading strong { font-size: 12px; text-transform: capitalize; }
.calendar-heading button { border: 0; background: #f1ecf7; color: var(--purple); border-radius: 7px; width: 28px; height: 28px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; }
.calendar-weekday { color: var(--muted); text-align: center; font-size: 9px; padding-bottom: 6px; }
.calendar-day { height: 31px; display: grid; place-items: center; background: #f7f5fa; border-radius: 7px; font-size: 11px; position: relative; }
.calendar-day.active-day { background: var(--purple); color: white; }
.calendar-day.today { outline: 2px solid #b9a6d5; outline-offset: 1px; }
.calendar-day i { position: absolute; bottom: -5px; color: var(--yellow); font-size: 16px; font-style: normal; }
.calendar-legend { font-size: 9px !important; line-height: 1.7; margin-top: 12px !important; }
.catalog-search { max-width: 400px; width: 100%; margin-top: 15px; }
.catalog-counts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin-top: 16px; font-size: 9px; line-height: 1.5; }
.catalog-counts span { background: #f6f3f9; padding: 6px 8px; border-radius: 6px; }
.catalog-counts b { color: var(--purple); }
.catalog-levels { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 10px; font-size: 8px; color: var(--muted); }
.flash-face { display: block; width: 100%; min-height: 310px; padding: 30px; margin: 20px 0 15px; border: 2px solid #e3d9f0; border-radius: 20px; background: #f4effa; color: var(--ink); font: inherit; cursor: pointer; text-align: left; transition: background .2s,color .2s; }
.flash-front { display: flex; flex-direction: column; justify-content: space-between; min-height: 245px; }
.flash-face h3 { font-size: clamp(25px,3.2vw,40px); line-height: 1.4; margin: 20px 0; overflow-wrap: anywhere; }
.flash-tags { display: flex; justify-content: space-between; gap: 12px; color: var(--purple); font-size: 11px; font-weight: 600; }
.flash-face.flipped { background: var(--purple); color: white; border-color: var(--purple); }
.flash-face.flipped h3 { color: var(--yellow); font-size: 25px; }
.flash-meaning { color: white; font-size: 19px; font-weight: 600; }
.flash-example-en { font-size: 15px; color: white; line-height: 1.8; margin-top: 23px; }
.flash-example-vi { font-size: 12px; color: #e4daf5; line-height: 1.8; }
.flash-register { font-size: 9px; color: #ddd0ef; margin-bottom: 0; }
.flash-level { font-size: 10px; color: #eee7f6; }
@media(prefers-reduced-motion:reduce) { .flash-face,body:has(#study-sidebar) .study-layout > aside { transition: none; } }
@media(max-width:760px) {
 body:has(#study-sidebar) .workspace, body:has(#study-sidebar).sidebar-collapsed .workspace { padding: 52px 65px 40px 20px; }
 body:has(#study-sidebar) .workspace-heading h1 { font-size: 28px; }
 body:has(#study-sidebar) .study-layout > aside { width: 260px; box-shadow: 8px 0 30px #29224225; z-index: 80; }
 body:has(#study-sidebar).sidebar-collapsed .study-layout > aside { display: none; }
 body:has(#study-sidebar) #tool-nav { display: flex; flex-direction: column; }
 .tool-tab > .tool-label { font-size: 12px; }
 .sidebar-open { display: grid; place-items: center; position: fixed; left: 12px; top: calc(var(--app-header-height,76px) + 10px); width: 32px; height: 32px; border: 1px solid #d4c9e4; border-radius: 8px; background: var(--purple); color: white; z-index: 65; }
 body:has(#study-sidebar) .app-footer,body:has(#study-sidebar).sidebar-collapsed .app-footer { padding-left: 20px; }
 .attendance-bar { padding: 15px; display: grid; gap: 10px; }
 .attendance-bar > div { width: 100%; }
 #calendar-panel { right: 0; width: min(310px,calc(100vw - 70px)); }
 .study-panel { padding: 18px; }
 .flash-face { padding: 20px; min-height: 280px; }
 .flash-face h3 { font-size: 27px; }
 .flash-meaning { font-size: 17px; }
 .flash-example-en { font-size: 13px; }
 .catalog-counts { grid-template-columns: 1fr; }
}
