/* Shared Web / Android navigation and learning library. */
:root { --paper: #f6f7f9; --muted: #56616b; --line: #dce1e6; --shadow-soft: 0 4px 14px #182b3610; }
body { background: var(--paper); }
body, button, input, select, textarea { letter-spacing: 0; }
.app { background: #fff; box-shadow: none; }
.site-header { background: #fff; box-shadow: 0 1px 0 var(--line); }
.brand { min-width: 0; border: 0; padding: 0; background: transparent; text-align: left; color: inherit; }
.brand strong { display: block; -webkit-line-clamp: unset; overflow: visible; text-overflow: clip; line-height: 1.3; overflow-wrap: anywhere; }
.brand small { display: none; }
.screen h1:focus { outline: none; }
.language-switch { min-width: 150px; grid-template-columns: 48px 12px 64px; gap: 2px; box-shadow: none; background: #f4f8f7; }
.language-switch span { text-overflow: clip; overflow: visible; font-size: 11px; }
.language-switch::before { width: 52px; box-shadow: none; background: #147b70; }
html[lang="vi"] .language-switch::before { width: 66px; transform: translateX(62px); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #2463cc; outline-offset: 3px; }
button:disabled { opacity: .4; cursor: default; }
.ui-icon { display: inline-block; flex: 0 0 24px; width: 24px; height: 24px; background: currentColor; mask: var(--icon) center / contain no-repeat; -webkit-mask: var(--icon) center / contain no-repeat; }
[data-icon="house"] { --icon: url('./assets/icons/house.svg'); }
[data-icon="clapperboard"] { --icon: url('./assets/icons/clapperboard.svg'); }
[data-icon="book-open"] { --icon: url('./assets/icons/book-open.svg'); }
[data-icon="gamepad-2"] { --icon: url('./assets/icons/gamepad-2.svg'); }
[data-icon="messages-square"] { --icon: url('./assets/icons/messages-square.svg'); }
[data-icon="briefcase-business"] { --icon: url('./assets/icons/briefcase-business.svg'); }
[data-icon="wallet"] { --icon: url('./assets/icons/wallet.svg'); }
[data-icon="file-check-2"] { --icon: url('./assets/icons/file-check-2.svg'); }
[data-icon="arrow-left"] { --icon: url('./assets/icons/arrow-left.svg'); }
[data-icon="arrow-right"] { --icon: url('./assets/icons/arrow-right.svg'); }
[data-icon="search"] { --icon: url('./assets/icons/search.svg'); }
[data-icon="zoom-in"] { --icon: url('./assets/icons/zoom-in.svg'); }
[data-icon="x"] { --icon: url('./assets/icons/x.svg'); }
.bottom-nav { grid-template-columns: 1fr 1fr .8fr 1.35fr; background: #fff; min-height: calc(78px + env(safe-area-inset-bottom)); overflow: visible; }
.bottom-nav button { min-height: 64px; gap: 5px; padding: 6px 3px; overflow: visible; position: relative; }
.bottom-nav b { white-space: normal; line-height: 1.3; font-size: 11px; overflow: visible; overflow-wrap: anywhere; text-align: center; }
.bottom-nav button.active { color: #086a61; background: #e8f5f1; border-radius: 8px; }
.bottom-nav button.active::after { display: none; }
.bottom-nav [data-nav="video"].active { color: #215cbb; background: #eaf1fd; }
.bottom-nav [data-nav="manga"].active { color: #ae393b; background: #fceff0; }
.screen { padding-bottom: 104px; }
.screen-title h1 { font-size: 26px; line-height: 1.3; letter-spacing: 0; overflow-wrap: anywhere; }
.screen-title p { font-size: 13px; letter-spacing: 0; }
.hero { min-height: 280px; border-radius: 0; box-shadow: none; }
.hero-copy { padding: 24px; }
.hero h1 { font-size: 30px; line-height: 1.16; max-width: 420px; }
.hero-copy > p { font-size: 14px; line-height: 1.55; max-width: 380px; }
.hero-actions { flex-wrap: wrap; }
.home-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.home-shortcuts button { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 14px 10px; text-align: left; background: #f1f6ff; color: #215cbb; }
.home-shortcuts button:nth-child(2) { color: #ac3739; background: #fff2f2; }
.home-shortcuts button:nth-child(3) { color: #176d59; background: #eef8f3; }
.home-shortcuts strong { font-size: 16px; }
.home-shortcuts small { font-size: 12px; line-height: 1.5; color: #425266; }
.screen[data-screen="home"] > .card, .screen[data-screen="home"] > details.card { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 20px 0; }
.feature-card summary { font-weight: 700; cursor: pointer; padding: 10px 0; }
.summary-grid article { box-shadow: none; }
.community-grid { display: grid; gap: 14px; margin: 22px 0; }
.community-item { display: grid; grid-template-columns: 88px minmax(0, 1fr) 24px; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; text-align: left; color: var(--ink); }
.community-item > img { width: 88px; height: 104px; object-fit: cover; border-radius: 4px; }
.community-item-copy { display: grid; gap: 8px; }
.community-item-copy > .ui-icon { color: #167667; }
.community-item:nth-child(2) .ui-icon { color: #ad6b10; }
.community-item:nth-child(3) .ui-icon { color: #245cbe; }
.community-item:nth-child(4) .ui-icon { color: #ad3e42; }
.community-item strong { font-size: 20px; line-height: 1.25; }
.community-item small { color: var(--muted); line-height: 1.5; font-size: 13px; }
.community-chat { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 24px 0; border-top: 1px solid var(--line); }
.community-chat div { flex: 1 1 230px; }
.community-chat h2 { font-size: 20px; margin: 0 0 8px; }
.community-chat p { font-size: 14px; line-height: 1.6; margin: 0; color: var(--muted); }
.community-back { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; border: 0; color: var(--teal); background: none; min-height: 44px; padding: 8px 0; margin-bottom: 12px; font-size: 13px; }
.video-learning, .textbook-library, .video-copy, .manga-learning { border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 0; color: var(--ink); backdrop-filter: none; }
.video-copy::before, .manga-learning::after { display: none; }
.video-copy { order: 5; }
.video-copy small { color: var(--muted); font-size: 12px; }
.textbook-library-head { align-items: center; margin: 18px 0 12px; }
.textbook-library-head h3 { font-size: 18px; margin: 0; }
.textbook-library-head small { color: var(--muted); }
.level-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 12px 0 16px; }
.level-switch button { min-height: 66px; border: 1px solid #cdd6e2; background: #fff; border-radius: 8px; padding: 8px 4px; color: #41516a; display: grid; align-content: center; justify-items: center; gap: 4px; }
.level-switch b { font-size: 15px; line-height: 1.3; }
.level-switch [data-level="A1"] b, .level-switch [data-level="A2"] b { font-size: 25px; line-height: 1; }
.level-switch small { font-size: 11px; }
.level-switch button.active { background: #eaf1fd; border: 2px solid #2864ba; color: #1f55a2; padding: 7px 3px; }
.textbook-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.textbook-card { display: flex; flex-direction: column; padding: 0; border-radius: 8px; border: 1px solid var(--line); box-shadow: none; background: #fff; text-align: left; overflow: hidden; }
.textbook-card.active { border-color: #2864ba; box-shadow: 0 0 0 1px #2864ba; background: #f4f8ff; }
.textbook-cover { height: auto; aspect-ratio: 16 / 9; width: 100%; }
.textbook-cover img { width: 100%; height: 100%; object-fit: cover; }
.textbook-cover::after { display: none; }
.textbook-card-copy { padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; flex: 1; }
.book-level { font-size: 13px; font-weight: 800; line-height: 1.3; color: #535d6d; background: #f0f2f6; padding: 4px 8px; border-radius: 4px; }
.book-level[data-level-name="A1"] { font-size: 24px; color: #126657; background: #e0f3e9; }
.book-level[data-level-name="A2"] { font-size: 24px; color: #2559ae; background: #e3edff; }
.textbook-card-copy strong { font-size: 16px; line-height: 1.35; }
.textbook-card-copy small { font-size: 12px; line-height: 1.5; display: block; -webkit-line-clamp: unset; }
.textbook-card-copy em { margin-top: auto; font-size: 12px; font-style: normal; line-height: 1.4; color: #245d9b; }
.video-player-shell { margin-top: 14px; scroll-margin-top: 110px; min-width: 0; }
.video-player { aspect-ratio: 16 / 9; min-height: 0; background: #15232b; border-radius: 8px; overflow: hidden; }
.video-player iframe { width: 100%; height: 100%; border: 0; }
.selected-video-meta { flex-wrap: wrap; gap: 12px; }
.selected-video-meta h3 { font-size: 18px; line-height: 1.45; }
.video-list { max-height: 560px; overflow: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); }
.video-card { box-shadow: none; border-radius: 4px; }
.video-card.active { background: #edf4ff; border-color: #6090d0; }
.learning-overview { margin-top: 26px; }
.lesson-list { margin-top: 18px; }
.manga-tools { margin: 20px 0; }
.search-field { display: flex; align-items: center; gap: 10px; border: 1px solid #bac6d0; background: #fff; border-radius: 8px; padding: 0 12px; }
.search-field input { width: 100%; border: 0; background: transparent; padding: 14px 0; font-size: 16px; outline-offset: 1px; }
.filter-switch { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.filter-switch button { min-height: 44px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; background: #fff; font-size: 13px; color: #4c5664; }
.filter-switch .active { background: #ae3a40; border-color: #ae3a40; color: #fff; }
#mangaResults { font-size: 13px; color: var(--muted); margin: 12px 0; }
.manga-learning-head { border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.manga-learning-head h2 { font-size: 20px; color: var(--ink); }
.manga-learning-head p { color: var(--muted) !important; font-size: 13px; }
.manga-learning-head strong { background: #f9e8e9; color: #ae3a40; border: 0; font-size: 22px; }
.manga-learning-head strong span { color: #8e4346; }
.manga-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.manga-card { border: 1px solid var(--line); border-radius: 8px; box-shadow: none; background: #fff; color: var(--ink); }
.manga-card.is-read { border-color: #8ebfb1; }
.manga-image { display: block; border: 0; padding: 0; width: 100%; height: auto; aspect-ratio: 4 / 3; background: #f3f4f5; cursor: zoom-in; }
.manga-image img { width: 100%; height: 100%; object-fit: contain; }
.manga-card-copy { padding: 16px; }
.manga-card-copy h3 { font-size: 19px; }
.manga-card-copy p, .manga-card-copy dd { font-size: 14px; line-height: 1.65; }
.manga-card-copy details summary { cursor: pointer; padding: 10px 0; font-size: 13px; font-weight: 700; color: #8e393b; }
.manga-series-section { padding: 20px 0 0; border: 0; border-top: 1px solid var(--line); background: none; border-radius: 0; }
.manga-series-head h3 { color: var(--ink); }
.manga-series-head p { color: var(--muted) !important; }
.empty-state { padding: 32px 0; color: var(--muted); }
.manga-reader { width: min(1080px, 100%); height: min(960px, 100dvh); max-width: 100%; max-height: 100dvh; border: 0; border-radius: 8px; padding: 0; background: #f3f4f5; color: var(--ink); }
.manga-reader[open] { display: flex; flex-direction: column; }
.manga-reader::backdrop { background: #14202bd9; }
.reader-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #fff; flex-shrink: 0; }
.reader-toolbar h2 { margin: 0; font-size: 16px; line-height: 1.4; flex: 1; }
.reader-toolbar .icon-btn { flex-shrink: 0; }
footer.reader-toolbar { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.reader-toolbar .primary { flex: 1; min-height: 44px; }
.reader-image { overflow: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.reader-image img { display: block; width: 100%; height: auto; }
.manga-reader.zoomed .reader-image img { width: 1600px; max-width: none; }
body.reader-open { overflow: hidden; }
@media (min-width: 760px) and (max-width: 959px) { .app, .bottom-nav { max-width: 760px; width: 100%; } }
@media (min-width: 960px) {
  .bottom-nav { top: 154px; width: 252px; grid-template-columns: 1fr; min-height: 0; padding: 0 12px; }
  .bottom-nav button { grid-template-columns: 24px minmax(0, 1fr); min-height: 54px; padding: 12px; }
  .bottom-nav b { font-size: 14px; text-align: left; }
  .site-header { width: 252px; }
  main { margin-left: 252px; padding: 32px; }
  .screen { padding-bottom: 32px; }
  .screen[data-screen="home"].active { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "shortcuts" "summary" "checklist" "service" "operator"; gap: 20px; }
  .hero { min-height: 340px; }
  .hero-copy { padding: 32px; }
  .hero h1 { font-size: 40px; }
  .home-shortcuts { grid-area: shortcuts; margin: 0; }
  .home-shortcuts button { padding: 20px; }
  .community-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .screen[data-screen="video"] .video-learning { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .9fr); grid-template-areas: "books books" "player list" "channel list" "copy copy"; gap: 18px; align-items: start; }
  .textbook-library { grid-area: books; }
  .textbook-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .level-switch { max-width: 560px; }
  .video-player-shell { grid-area: player; margin: 0; scroll-margin-top: 24px; }
  .video-list { grid-area: list; max-height: 520px; }
  .channel-link { grid-area: channel; }
  .video-copy { grid-area: copy; }
  .manga-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .community-back { grid-area: auto; }
  .screen[data-screen="jobs"].active, .screen[data-screen="money"].active, .screen[data-screen="contract"].active, .screen[data-screen="support"].active { display: block; }
  .screen-visual { max-height: 180px; }
}
@media (max-width: 420px) {
  .site-header { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .brand strong { font-size: 12px; }
  .brand small { display: none; }
  .language-switch { font-size: 11px; padding: 6px; flex: 0 0 150px; }
  .hero-copy { padding: 20px; }
  .hero h1 { font-size: 28px; }
  .screen-title h1 { font-size: 24px; }
  .community-item { grid-template-columns: 72px minmax(0, 1fr) 20px; gap: 10px; }
  .community-item > img { width: 72px; }
  .community-item strong { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
