@layer reset, base, layout, components, views, utilities, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  button, input, textarea, select { font: inherit; }
  button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
  button { cursor: pointer; }
  img, svg { display: block; max-width: 100%; }
  img { height: auto; }
  h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
  a { color: inherit; text-decoration: none; }
  button { color: inherit; }
  [hidden] { display: none !important; }
}

@layer base {
  :root {
    color-scheme: light;
    --paper: #faf8f4;
    --surface: #fffefa;
    --surface-raised: #ffffff;
    --surface-soft: #f1ede7;
    --plum: #452438;
    --plum-soft: #eee5eb;
    --terracotta: #bf6f54;
    --terracotta-dark: #94462f;
    --terracotta-soft: #f4e6dc;
    --text: #352c31;
    --muted: #756b6e;
    --line: #e7e0d8;
    --line-strong: #d3c8c2;
    --sage: #53654f;
    --sage-soft: #eaf0e5;
    --danger: #a13b3b;
    --danger-soft: #faece9;
    --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    --serif: Georgia, "Times New Roman", serif;
    --radius: 20px;
    --radius-small: 12px;
    --shadow: 0 14px 40px -30px rgb(69 36 56 / 28%);
    --sidebar-width: 232px;
    --context-width: 320px;
  }
  html { min-width: 320px; scroll-behavior: smooth; scrollbar-gutter: stable; }
  body { background: var(--paper); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
  ::selection { background: #e9cbbc; color: var(--plum); }
  :focus-visible { outline: 3px solid #9b624a; outline-offset: 4px; }
  :disabled { cursor: not-allowed; }
  button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .52; }
  button, a, input, textarea, select { touch-action: manipulation; }
  h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.18; letter-spacing: -1.4px; font-weight: 600; color: var(--plum); text-wrap: balance; }
  h2 { font-size: 21px; line-height: 1.3; letter-spacing: -.55px; font-weight: 600; color: var(--plum); }
  h3 { font-size: 16px; line-height: 1.4; letter-spacing: -.25px; font-weight: 600; }
  h4 { font-size: 14px; font-weight: 600; }
  p { overflow-wrap: anywhere; }
  small { font-size: 12px; }
  hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
  ul, ol { padding-left: 22px; }
  label { color: var(--plum); font-size: 13px; font-weight: 550; }
  input, textarea, select { min-width: 0; color: var(--text); }
  input::placeholder, textarea::placeholder { color: #8f8285; opacity: 1; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select {
    border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); width: 100%; padding: 12px 14px; line-height: 1.5; transition: border-color .18s, box-shadow .18s;
  }
  input:focus, textarea:focus, select:focus { border-color: #9c7a8b; box-shadow: 0 0 0 3px rgb(69 36 56 / 7%); }
  textarea { display: block; resize: vertical; min-height: 110px; }
  input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; accent-color: var(--plum); flex: 0 0 auto; }
  input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
  ::-webkit-scrollbar { width: 7px; height: 6px; }
  ::-webkit-scrollbar-thumb { background: #d8cfc9; border: 1px solid var(--paper); border-radius: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
}

@layer layout {
  #app { min-height: 100dvh; outline: none; }
  .app-shell, .app-layout { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100dvh; }
  .sidebar { position: sticky; top: 0; height: 100dvh; min-width: 0; display: flex; flex-direction: column; padding: 34px 22px 22px; border-right: 1px solid var(--line); background: #f5f1eb; overflow-y: auto; z-index: 20; }
  .sidebar-brand, .brand { display: flex; align-items: center; gap: 10px; margin: 0 10px 37px; color: var(--plum); }
  .brand-name, .wordmark, .brand-title { font-size: 27px; letter-spacing: -1.6px; font-weight: 650; line-height: 1; }
  .brand-name span, .wordmark span, .brand-title span { color: var(--terracotta); }
  .brand-subtitle { color: var(--muted); font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; margin-top: 9px; }
  .brand-icon { width: 30px; height: 30px; border-radius: 10px; background: var(--plum); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 22px; }
  .nav-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 26px; }
  .nav-label { color: #8a7a7e; font-size: 10px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; padding: 0 13px; margin-bottom: 9px; }
  .nav-item { width: 100%; display: flex; align-items: center; gap: 12px; background: transparent; border: 0; border-radius: 11px; color: #75666d; padding: 11px 13px; text-align: left; font-weight: 500; line-height: 1.5; transition: background .16s, color .16s; }
  .nav-item:hover { background: #eee6e1; color: var(--plum); }
  .nav-item.active, .nav-item[aria-current="page"] { background: var(--plum); color: var(--surface); }
  .nav-item svg, .nav-icon { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.65; }
  .nav-count { margin-left: auto; font-size: 11px; padding: 1px 7px; min-width: 23px; border-radius: 6px; background: rgb(69 36 56 / 8%); color: var(--plum); }
  .nav-item.active .nav-count { color: #fff; background: rgb(255 255 255 / 17%); }
  .sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding: 20px 8px 0; display: grid; gap: 15px; }
  .sidebar-note { font-size: 11px; line-height: 1.6; color: var(--muted); }
  .profile-mini, .user-mini { display: flex; align-items: center; gap: 10px; }
  .profile-avatar, .user-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: #e9ded5; color: var(--plum); font-weight: 600; }
  .workspace, .main-area { min-width: 0; padding: 38px clamp(24px, 3vw, 52px) 44px; }
  .page-header { max-width: 1440px; margin: 0 auto 30px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
  .page-header h1 { margin: 6px 0 10px; }
  .page-header p { max-width: 590px; color: var(--muted); font-size: 14px; line-height: 1.7; }
  .header-actions { display: flex; align-items: center; gap: 10px; padding-top: 4px; flex-shrink: 0; }
  .content-grid, .dashboard-grid, .two-column-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--context-width); align-items: start; gap: 28px; max-width: 1440px; margin: 0 auto; }
  .main-column { min-width: 0; display: grid; gap: 26px; }
  .context-panel, .context-column { min-width: 0; display: grid; gap: 20px; }
  .page-content { max-width: 1440px; margin: 0 auto; min-width: 0; }
  .narrow-content { max-width: 850px; margin: 0 auto; }
  .section-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
  .section-header p { color: var(--muted); font-size: 12px; margin-top: 5px; }
  .section-title { display: flex; align-items: center; gap: 10px; }
  .grid-2, .two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .split-view { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 24px; align-items: start; }
  .stack { display: grid; gap: 16px; }
  .stack-small { display: grid; gap: 9px; }
  .row, .inline { display: flex; align-items: center; gap: 10px; }
}

@layer components {
  .skip-link { position: fixed; left: 16px; top: -100px; padding: 12px 18px; background: var(--plum); color: white; border-radius: 10px; z-index: 100; }
  .skip-link:focus-visible { top: 16px; }
  .button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; border: 1px solid transparent; border-radius: 11px; background: var(--plum); color: #fffdfa; padding: 11px 17px; font-size: 13px; line-height: 1.4; font-weight: 550; letter-spacing: -.05px; text-align: center; white-space: normal; transition: background .16s, border-color .16s, transform .16s; }
  .button:hover:not(:disabled), .btn:hover:not(:disabled) { background: #5a314a; }
  .button:active:not(:disabled), .btn:active:not(:disabled) { transform: translateY(1px); }
  .button svg, .btn svg { width: 17px; height: 17px; flex-shrink: 0; }
  .button.primary, .btn-primary { background: var(--plum); color: #fffdfa; }
  .button.secondary, .btn-secondary { color: var(--plum); border-color: var(--line-strong); background: transparent; }
  .button.secondary:hover:not(:disabled), .btn-secondary:hover:not(:disabled) { background: #f0e9e3; border-color: #c5b8bc; }
  .button.ghost, .btn-ghost { color: var(--plum); background: transparent; border-color: transparent; }
  .button.ghost:hover:not(:disabled), .btn-ghost:hover:not(:disabled) { background: var(--surface-soft); }
  .button.terracotta, .btn-terracotta { background: #a6573d; color: #fff; }
  .button.danger, .btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #ebcfca; }
  .button.small, .btn-small { min-height: 33px; padding: 7px 11px; font-size: 12px; border-radius: 9px; }
  .button.large, .btn-large { padding: 14px 22px; min-height: 49px; }
  .button.full, .btn-full { width: 100%; }
  .icon-button, .icon-btn { display: inline-grid; place-items: center; background: transparent; border: 1px solid var(--line); color: var(--muted); width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; padding: 8px; transition: background .16s, color .16s; }
  .icon-button:hover, .icon-btn:hover { background: var(--surface-soft); color: var(--plum); }
  .icon-button svg, .icon-btn svg { width: 17px; height: 17px; }
  .text-button, .text-link { border: 0; background: transparent; padding: 3px 0; font-size: 12px; font-weight: 550; color: var(--terracotta-dark); display: inline-flex; align-items: center; gap: 7px; }
  .text-button:hover, .text-link:hover { color: var(--plum); text-decoration: underline; text-underline-offset: 4px; }
  .text-button svg, .text-link svg { width: 14px; height: 14px; }
  .card, .panel { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 24px; min-width: 0; box-shadow: var(--shadow); }
  .card.flush, .panel.flush { padding: 0; overflow: hidden; }
  .card.soft { background: var(--surface-soft); box-shadow: none; }
  .card-header, .panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
  .card-header p, .panel-header p { color: var(--muted); margin-top: 5px; font-size: 12px; }
  .card-footer, .panel-footer { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 22px; }
  .eyebrow, .kicker { display: block; font-size: 10px; font-weight: 650; letter-spacing: 1.6px; text-transform: uppercase; line-height: 1.5; color: var(--terracotta-dark); }
  .badge, .pill, .tag { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 4px 8px; background: var(--surface-soft); border: 1px solid transparent; border-radius: 6px; color: var(--muted); font-size: 10px; line-height: 1.4; font-weight: 550; white-space: nowrap; }
  .badge.plum, .tag.plum { color: var(--plum); background: var(--plum-soft); }
  .badge.sage, .badge.success, .tag.success { background: var(--sage-soft); color: var(--sage); }
  .badge.terracotta { color: var(--terracotta-dark); background: var(--terracotta-soft); }
  .badge.outline { background: transparent; border-color: var(--line-strong); }
  .status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--sage); margin-right: 6px; }
  .status-dot.offline { background: #a58b70; }
  .status-line { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
  .status-line svg { width: 13px; height: 13px; }
  .field, .form-field { display: grid; gap: 7px; min-width: 0; }
  .field-hint, .help-text { font-size: 11px; color: var(--muted); line-height: 1.6; }
  .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
  .checkbox-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.7; font-weight: 400; }
  .checkbox-row input { margin-top: 3px; }
  .search-field { position: relative; min-width: 180px; }
  .search-field svg { width: 16px; height: 16px; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
  .search-field input { padding-left: 37px !important; }
  .tabs, .segmented-control, .filter-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; border-bottom: 1px solid var(--line); margin: 20px 0 24px; padding-bottom: 10px; }
  .tab, .filter-tab { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 8px 13px; border-radius: 8px; font-weight: 500; }
  .tab:hover, .filter-tab:hover { color: var(--plum); background: #f1ebe6; }
  .tab.active, .tab[aria-selected="true"], .filter-tab.active { color: var(--plum); background: var(--plum-soft); }
  .toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
  .list { display: grid; gap: 0; }
  .list-row { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 17px 0; border-bottom: 1px solid var(--line); }
  .list-row:first-child { padding-top: 0; }
  .list-row:last-child { border-bottom: 0; padding-bottom: 0; }
  .list-row-content { flex: 1; min-width: 0; }
  .list-row-title { color: var(--plum); font-weight: 550; }
  .list-row-description { font-size: 12px; color: var(--muted); margin-top: 4px; }
  .row-icon, .lesson-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--plum); background: var(--plum-soft); flex-shrink: 0; }
  .row-icon svg, .lesson-icon svg { width: 20px; height: 20px; }
  .notice, .alert, .error-message, .success-message { border: 1px solid #e4d2be; border-radius: 12px; background: #f8f0e3; padding: 13px 16px; color: #79603c; font-size: 12px; line-height: 1.7; }
  .notice.error, .alert.error, .error-message { border-color: #e9c7c3; background: var(--danger-soft); color: var(--danger); }
  .notice.success, .alert.success, .success-message { border-color: #cddac7; background: var(--sage-soft); color: var(--sage); }
  .notice.info, .alert.info { background: var(--plum-soft); border-color: #dfcfd9; color: var(--plum); }
  .notice strong, .alert strong { font-weight: 600; }
  .empty-state { text-align: center; padding: 52px 28px; color: var(--muted); display: grid; justify-items: center; gap: 14px; }
  .empty-state h2, .empty-state h3 { color: var(--plum); }
  .empty-state p { max-width: 390px; font-size: 13px; line-height: 1.8; }
  .empty-icon { background: var(--plum-soft); color: var(--plum); border-radius: 18px; width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 4px; }
  .empty-icon svg { width: 25px; height: 25px; }
  .loading-state { display: grid; justify-items: center; gap: 16px; padding: 60px 20px; color: var(--muted); }
  .loading-indicator, .spinner { width: 22px; height: 22px; border: 2px solid #e1d5ce; border-top-color: var(--terracotta); border-radius: 50%; animation: spin .8s linear infinite; }
  .boot-screen { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 30px; color: var(--muted); text-align: center; }
  .boot-wordmark { color: var(--plum); font-size: 39px; letter-spacing: -2.5px; font-weight: 650; }
  .boot-wordmark span { color: var(--terracotta); }
  .boot-screen p { font-size: 13px; }
  .noscript-message { margin: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; }
  .progress-track { height: 5px; background: #e9e2da; border-radius: 3px; overflow: hidden; }
  .progress-fill { height: 100%; border-radius: inherit; background: var(--terracotta); transition: width .3s ease; }
  .divider { height: 1px; background: var(--line); margin: 20px 0; }
  .toast { position: fixed; bottom: 24px; left: calc(50% + 100px); transform: translateX(-50%); max-width: min(450px, calc(100vw - 40px)); border-radius: 13px; color: #fffdfa; background: var(--plum); padding: 13px 20px; font-size: 13px; box-shadow: 0 8px 30px rgb(69 36 56 / 22%); z-index: 70; }
  .toast.error { background: #863d3d; }
  .modal-backdrop { position: fixed; inset: 0; background: rgb(38 22 32 / 35%); display: grid; place-items: center; z-index: 90; padding: 24px; backdrop-filter: blur(4px); }
  .modal { max-width: 560px; width: 100%; max-height: calc(100dvh - 48px); overflow-y: auto; border-radius: 22px; padding: 28px; background: var(--surface); box-shadow: 0 20px 100px rgb(38 22 32 / 20%); }
  .modal-header { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; margin-bottom: 20px; }
  @keyframes spin { to { transform: rotate(360deg); } }
}

@layer views {
  .welcome-hero, .hero-card { position: relative; background: var(--plum); color: #f9f1ee; border: 0; padding: 30px 32px; border-radius: 21px; overflow: hidden; min-width: 0; }
  .welcome-hero h2, .hero-card h2 { color: #fff8f2; font-family: var(--serif); font-size: clamp(28px, 3.2vw, 40px); line-height: 1.2; font-weight: 400; letter-spacing: -.6px; max-width: 460px; margin: 12px 0 15px; }
  .welcome-hero p, .hero-card p { max-width: 400px; color: #dfcfd8; font-size: 13px; line-height: 1.8; }
  .welcome-hero .eyebrow, .hero-card .eyebrow { color: #e4b9a1; }
  .welcome-hero .button, .hero-card .button { background: #faf0e5; color: var(--plum); margin-top: 24px; }
  .welcome-hero .button:hover, .hero-card .button:hover { background: #fffaf1; }
  .hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; color: #ddcbd5; font-size: 11px; margin-top: 18px; }
  .stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 21px 0; }
  .stat-card, .stat { padding: 0 23px; border-right: 1px solid var(--line); min-width: 0; }
  .stat-card:last-child, .stat:last-child { border-right: 0; }
  .stat-value { font-size: 27px; line-height: 1.2; color: var(--plum); letter-spacing: -1px; font-weight: 550; }
  .stat-label { color: var(--muted); font-size: 11px; margin-top: 5px; }
  .lesson-list { display: grid; gap: 0; }
  .lesson-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 20px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
  .lesson-row:last-child { border-bottom: 0; }
  .lesson-row:hover .lesson-title { color: var(--terracotta-dark); }
  .lesson-row .lesson-meta { margin-top: 5px; }
  .lesson-title { font-size: 15px; color: var(--plum); font-weight: 550; transition: color .15s; }
  .lesson-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--muted); }
  .lesson-arrow { margin-left: auto; color: #9a898c; width: 19px; height: 19px; flex-shrink: 0; }
  .lesson-card { padding: 22px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; transition: border-color .18s, box-shadow .18s; }
  .lesson-card:hover { border-color: #cdb6b7; box-shadow: 0 10px 30px -24px rgb(69 36 56 / 34%); }
  .lesson-card p { font-size: 12px; color: var(--muted); }
  .lesson-card .button { margin-top: auto; }
  .lesson-card h3 { font-family: var(--serif); font-size: 22px; font-weight: 400; color: var(--plum); line-height: 1.3; }
  .lesson-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .tutor-card { overflow: hidden; padding: 0; }
  .tutor-portrait { display: block; width: 100%; height: 220px; object-fit: cover; object-position: center 24%; background: #e7d9cf; }
  .tutor-card-content { padding: 22px; }
  .tutor-identity { display: flex; align-items: center; gap: 13px; }
  .tutor-avatar { width: 46px; height: 46px; object-fit: cover; border-radius: 50%; background: #e6d5cc; flex-shrink: 0; }
  .tutor-initial { width: 46px; height: 46px; border-radius: 50%; background: var(--terracotta-soft); color: var(--terracotta-dark); display: grid; place-items: center; font-family: var(--serif); font-size: 26px; }
  .tutor-switch { display: grid; gap: 4px; min-width: 128px; max-width: 180px; font-size: 11px; color: var(--muted); }
  .tutor-switch-select { padding: 7px 10px; min-height: 36px; font-size: 12px; }
  .tutor-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 15px 0 24px; }
  .tutor-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
  .tutor-fieldset legend { color: var(--plum); font-size: 13px; font-weight: 550; margin-bottom: 2px; padding: 0; }
  .tutor-option { position: relative; min-width: 0; display: flex; align-items: center; gap: 13px; padding: 13px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); cursor: pointer; text-align: left; }
  .tutor-option:hover { border-color: #98798a; background: #f5efed; }
  .tutor-option.active, .tutor-option:has(input:checked) { border-color: var(--plum); background: var(--plum-soft); box-shadow: inset 0 0 0 1px var(--plum); }
  .tutor-option-image { width: 64px; height: 76px; object-fit: cover; object-position: center 27%; border-radius: 9px; flex-shrink: 0; }
  .tutor-option-text { display: grid; gap: 3px; color: var(--plum); }
  .tutor-option-text strong { font-family: var(--serif); font-size: 21px; font-weight: 400; }
  .tutor-option-text small { color: var(--muted); font-size: 10px; }
  .tutor-name { font-size: 20px; font-family: var(--serif); color: var(--plum); font-weight: 400; }
  .tutor-card p { font-size: 12px; line-height: 1.8; color: var(--muted); margin-top: 13px; }
  .quote-card { background: #f1e9df; border: 0; box-shadow: none; }
  .quote-card blockquote, .daily-phrase { font-family: var(--serif); font-size: 24px; line-height: 1.5; color: var(--plum); margin: 18px 0 10px; letter-spacing: -.3px; }
  .quote-card p { font-size: 12px; color: var(--muted); }
  .goal-card .progress-track { margin-top: 17px; }
  .goal-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 15px; font-size: 12px; }
  .week-days { display: flex; justify-content: space-between; gap: 5px; margin-top: 20px; }
  .week-day { display: grid; justify-items: center; gap: 8px; font-size: 10px; color: var(--muted); }
  .day-dot { width: 25px; height: 25px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; }
  .week-day.done .day-dot { background: var(--plum); color: white; border-color: var(--plum); }
  .conversation-list { display: grid; gap: 6px; }
  .conversation-item { width: 100%; border: 1px solid transparent; border-radius: 10px; background: transparent; padding: 12px; text-align: left; color: var(--muted); min-width: 0; }
  .conversation-item:hover { background: var(--surface-soft); }
  .conversation-item.active { background: var(--surface); border-color: var(--line); color: var(--plum); }
  .conversation-item strong { display: block; font-size: 12px; line-height: 1.5; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .conversation-item small { display: block; font-size: 10px; color: var(--muted); margin-top: 5px; }
  .chat-panel { display: flex; flex-direction: column; min-width: 0; min-height: 610px; overflow: hidden; padding: 0; }
  .chat-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
  .chat-header p { font-size: 11px; color: var(--muted); }
  .chat-messages, .messages { display: flex; flex-direction: column; gap: 23px; padding: 26px; max-height: min(62dvh, 750px); min-height: 360px; overflow-y: auto; overscroll-behavior: contain; }
  .message { max-width: 94%; min-width: 0; align-self: flex-start; }
  .message.user { align-self: flex-end; max-width: 84%; }
  .message-author { font-size: 10px; letter-spacing: .5px; font-weight: 600; color: var(--muted); margin: 0 0 7px 2px; }
  .message-bubble { background: #f4f0eb; border-radius: 3px 15px 15px 15px; padding: 17px 19px; font-size: 15px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
  .message.user .message-bubble { background: var(--plum); color: #fff8f4; border-radius: 15px 3px 15px 15px; }
  .message.assistant .message-bubble { font-family: var(--serif); font-size: 18px; line-height: 1.7; }
  .message-image { max-width: min(300px, 100%); max-height: 280px; object-fit: contain; border-radius: 12px; margin-bottom: 12px; }
  .message-translation, .translation { color: var(--muted); font-family: var(--sans); font-size: 12px; line-height: 1.7; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
  .message-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 9px; }
  .correction { margin-top: 12px; background: #f4eade; border-left: 2px solid var(--terracotta); border-radius: 0 10px 10px 0; padding: 12px 14px; font-size: 12px; line-height: 1.7; }
  .correction del { color: #a36c69; text-decoration-thickness: 1px; }
  .correction ins { color: var(--sage); text-decoration: none; font-weight: 550; }
  .correction p { margin-top: 5px; color: #79645a; }
  .chat-composer, .composer { margin-top: auto; padding: 18px 22px; border-top: 1px solid var(--line); background: var(--surface); }
  .composer-input-row { display: flex; align-items: flex-end; gap: 10px; }
  .composer textarea, .chat-composer textarea { min-height: 48px; max-height: 170px; padding: 12px 14px; border-radius: 12px; resize: vertical; font-size: 14px; }
  .composer-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
  .composer-hint { color: var(--muted); font-size: 10px; }
  .attachment-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
  .attachment-preview img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; }
  .voice-panel { border-radius: 14px; background: #f2ecef; padding: 18px; display: grid; gap: 14px; }
  .voice-status { display: flex; align-items: center; gap: 9px; color: var(--plum); font-size: 12px; }
  .voice-controls { display: flex; flex-wrap: wrap; gap: 8px; }
  .voice-note { color: var(--muted); font-size: 10px; line-height: 1.7; }
  .voice-error { margin: 0; font-size: 11px; }
  .voice-play { min-height: 42px; }
  .chat-request-progress { display: grid; gap: 11px; align-self: flex-start; max-width: 100%; padding: 14px 0 2px; }
  .chat-request-progress .button { justify-self: start; }
  .chat-request-progress p { max-width: 420px; line-height: 1.6; }
  .pending-message .message-bubble { opacity: .78; }
  .memory-item { padding: 13px 0; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.7; }
  .memory-item p { flex: 1; }
  .memory-item:last-child { border-bottom: 0; }
  .vocabulary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 17px; }
  .vocab-card { min-width: 0; padding: 22px; }
  .vocab-term { font-family: var(--serif); color: var(--plum); font-size: 25px; line-height: 1.3; letter-spacing: -.5px; }
  .vocab-translation { font-size: 13px; color: var(--muted); margin-top: 6px; }
  .vocab-example { font-family: var(--serif); font-size: 16px; line-height: 1.75; color: #6e5a63; margin-top: 17px; }
  .vocab-card .card-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
  .vocabulary-table { width: 100%; border-collapse: collapse; }
  .vocabulary-table th { font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); font-weight: 550; text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); }
  .vocabulary-table td { padding: 18px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
  .vocabulary-table tr:last-child td { border-bottom: 0; }
  .flashcard-wrap { max-width: 700px; margin: 0 auto; }
  .flashcard { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 48px 36px; min-height: 370px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; box-shadow: var(--shadow); }
  .flashcard .vocab-term, .flashcard-term { font-family: var(--serif); color: var(--plum); font-size: clamp(34px, 5vw, 48px); font-weight: 400; line-height: 1.3; letter-spacing: -1px; margin: 22px 0 15px; }
  .flashcard-translation { color: var(--muted); font-size: 18px; }
  .flashcard-example { font-family: var(--serif); max-width: 430px; font-size: 21px; line-height: 1.6; margin-top: 25px; }
  .review-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
  .review-progress { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; color: var(--muted); font-size: 12px; }
  .review-progress .progress-track { flex: 1; margin: 0 18px; }
  .reading-paper, .lesson-body { white-space: pre-wrap; font-family: var(--serif); font-size: clamp(19px, 1.8vw, 22px); line-height: 1.9; color: #4b3943; letter-spacing: -.15px; max-width: 68ch; }
  .reading-paper p + p { margin-top: 22px; }
  .reading-title, .lesson-heading { font-family: var(--serif); font-size: clamp(29px, 3.5vw, 42px); line-height: 1.24; font-weight: 400; color: var(--plum); letter-spacing: -.8px; margin-bottom: 20px; }
  .lesson-detail { padding: 32px; }
  .lesson-detail .lesson-meta { margin-bottom: 20px; }
  .reading-controls, .audio-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
  .audio-player { display: flex; align-items: center; gap: 18px; background: var(--plum); color: #fff8f2; border-radius: 16px; padding: 24px; margin-bottom: 26px; }
  .audio-player .button { background: #fff2e5; color: var(--plum); }
  .audio-player h3 { color: #fff8f2; }
  .audio-player p { color: #d8c3cf; font-size: 11px; margin-top: 4px; }
  .question-list { display: grid; gap: 25px; margin-top: 24px; }
  .question { border: 0; padding: 0; margin: 0; min-width: 0; }
  .question legend { display: block; width: 100%; font-family: var(--serif); font-size: 19px; line-height: 1.5; margin-bottom: 14px; color: var(--plum); padding: 0; }
  .question-options { display: grid; gap: 9px; }
  .question-option, .option { display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; background: var(--surface); font-size: 13px; font-weight: 400; line-height: 1.7; cursor: pointer; }
  .question-option input, .option input { margin-top: 3px; }
  .question-option:has(input:checked), .option:has(input:checked) { border-color: #98798a; background: #f1e9ee; color: var(--plum); }
  .question-option.correct, .option.correct { background: var(--sage-soft); border-color: #bccdb5; }
  .question-option.incorrect, .option.incorrect { background: var(--danger-soft); border-color: #ddb0aa; }
  .answer-explanation { color: var(--muted); padding: 10px 0 0; font-size: 12px; line-height: 1.8; }
  .score-banner { background: var(--sage-soft); color: var(--sage); border: 1px solid #cfdbc9; border-radius: 12px; padding: 17px; margin-bottom: 20px; }
  .writing-editor { min-height: 275px; font-family: var(--serif); font-size: 21px; line-height: 1.8; padding: 20px !important; }
  .writing-feedback { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 24px; display: grid; gap: 17px; }
  .corrected-text { white-space: pre-wrap; font-family: var(--serif); font-size: 20px; line-height: 1.8; background: var(--sage-soft); border-radius: 12px; padding: 21px; }
  .suggestions-list { margin: 0; display: grid; gap: 9px; font-size: 13px; color: var(--muted); }
  .settings-section + .settings-section { margin-top: 24px; }
  .settings-section h2 { margin-bottom: 7px; }
  .settings-section > p { margin-bottom: 22px; font-size: 12px; color: var(--muted); }
  .consent-box { border: 1px solid #dccabc; background: #f8eee4; border-radius: 14px; padding: 20px; margin-top: 22px; }
  .consent-box p { margin-top: 9px; font-size: 12px; line-height: 1.8; color: #7a655a; }
  .service-info { display: grid; gap: 12px; font-size: 12px; color: var(--muted); }
  .service-info > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
  .service-info strong { color: var(--plum); font-size: 12px; font-weight: 500; overflow-wrap: anywhere; text-align: right; }
}

@layer utilities {
  .muted, .text-muted { color: var(--muted); }
  .text-small { font-size: 12px; }
  .text-tiny { font-size: 10px; }
  .text-center { text-align: center; }
  .text-right { text-align: right; }
  .text-plum { color: var(--plum); }
  .text-success { color: var(--sage); }
  .text-danger { color: var(--danger); }
  .serif, .english { font-family: var(--serif); }
  .nowrap { white-space: nowrap; }
  .wrap { flex-wrap: wrap; }
  .grow { flex: 1; min-width: 0; }
  .justify-between { justify-content: space-between; }
  .items-start { align-items: flex-start; }
  .full-width { width: 100%; }
  .span-2 { grid-column: 1 / -1; }
  .mt-0 { margin-top: 0; }
  .mt-1 { margin-top: 8px; }
  .mt-2 { margin-top: 16px; }
  .mt-3 { margin-top: 24px; }
  .mb-1 { margin-bottom: 8px; }
  .mb-2 { margin-bottom: 16px; }
  .mb-3 { margin-bottom: 24px; }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
}

@layer responsive {
  @media (min-width: 1700px) {
    .workspace, .main-area { padding-left: 64px; padding-right: 64px; }
    .content-grid, .dashboard-grid, .two-column-layout { gap: 36px; }
  }
  @media (max-width: 1240px) {
    .content-grid, .dashboard-grid, .two-column-layout { grid-template-columns: minmax(0, 1fr); }
    .context-panel, .context-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split-view { grid-template-columns: 210px minmax(0, 1fr); gap: 18px; }
    .page-header h1 { max-width: 600px; }
    .hero-card h2 { max-width: 550px; }
  }
  @media (max-width: 1020px) {
    :root { --sidebar-width: 202px; }
    .sidebar { padding-left: 15px; padding-right: 15px; }
    .workspace, .main-area { padding: 28px 25px 36px; }
    .page-header { gap: 16px; margin-bottom: 25px; }
    .header-actions { flex-shrink: 1; }
    .split-view { grid-template-columns: minmax(0, 1fr); }
    .conversation-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lesson-detail { padding: 26px; }
    .stats-grid .stat, .stats-grid .stat-card { padding: 0 18px; }
  }
  @media (max-width: 760px) {
    html { scrollbar-gutter: auto; }
    .app-shell, .app-layout { grid-template-columns: minmax(0, 1fr); }
    .sidebar { width: 100%; height: auto; position: sticky; padding: 17px 20px 0; border-right: 0; border-bottom: 1px solid var(--line); background: rgb(250 248 244 / 96%); overflow: visible; backdrop-filter: blur(15px); }
    .sidebar-brand, .brand { margin: 0 0 16px; }
    .brand-name, .wordmark, .brand-title { font-size: 25px; }
    .brand-subtitle { display: none; }
    .sidebar nav { display: flex; flex-direction: row; gap: 5px; overflow-x: auto; margin: 0 -20px; padding: 0 20px 11px; scrollbar-width: none; }
    .sidebar nav::-webkit-scrollbar { display: none; }
    .nav-group { display: contents; margin: 0; }
    .nav-label, .sidebar-footer { display: none; }
    .nav-item { width: auto; flex: 0 0 auto; padding: 9px 12px; gap: 7px; font-size: 12px; border-radius: 9px; white-space: nowrap; }
    .nav-item svg, .nav-icon { width: 15px; height: 15px; }
    .nav-count { display: none; }
    .workspace, .main-area { padding: 25px 20px 36px; }
    .page-header { flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
    .page-header h1 { font-size: 30px; letter-spacing: -1px; }
    .page-header p { font-size: 13px; }
    .header-actions { padding: 0; flex-wrap: wrap; }
    .content-grid, .dashboard-grid, .two-column-layout { gap: 22px; }
    .main-column { gap: 22px; }
    .card, .panel { padding: 21px; border-radius: 17px; }
    .card.flush, .panel.flush { padding: 0; }
    .welcome-hero, .hero-card { padding: 27px 25px; border-radius: 18px; }
    .welcome-hero h2, .hero-card h2 { font-size: 34px; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lesson-detail { padding: 23px; }
    .toast { left: 50%; bottom: 18px; }
    .chat-messages, .messages { padding: 21px; min-height: 310px; max-height: 58dvh; }
    .chat-panel { min-height: 540px; }
    .chat-header { padding: 18px 21px; }
    .chat-composer, .composer { padding: 16px; }
    .flashcard { padding: 38px 27px; min-height: 340px; }
    .vocabulary-table { display: block; overflow-x: auto; }
  }
  @media (max-width: 520px) {
    .tutor-options { gap: 10px; }
    .tutor-option { gap: 9px; padding: 10px; flex-wrap: wrap; }
    .tutor-option-image { width: 48px; height: 60px; }
    .tutor-switch { min-width: 102px; max-width: 125px; }
    h2 { font-size: 20px; }
    .sidebar { padding-left: 17px; padding-right: 17px; }
    .sidebar nav { margin-left: -17px; margin-right: -17px; padding-left: 17px; padding-right: 17px; }
    .workspace, .main-area { padding: 23px 17px 30px; }
    .page-header h1 { font-size: 29px; }
    .page-header p { line-height: 1.7; }
    .eyebrow, .kicker { font-size: 9px; }
    .header-actions { width: 100%; }
    .header-actions .badge { margin-right: auto; }
    .context-panel, .context-column, .grid-2, .grid-3, .two-columns, .lesson-grid, .vocabulary-grid, .form-grid { grid-template-columns: minmax(0, 1fr); }
    .stats-grid { padding: 19px 0; }
    .stat-card, .stat, .stats-grid .stat, .stats-grid .stat-card { padding: 0 14px; }
    .stat-value { font-size: 25px; }
    .stat-label { font-size: 10px; line-height: 1.4; }
    .welcome-hero, .hero-card { padding: 25px 23px; }
    .welcome-hero h2, .hero-card h2 { font-size: 32px; }
    .section-header { gap: 10px; }
    .section-header .text-button { flex-shrink: 0; font-size: 11px; }
    .card-header, .panel-header { gap: 10px; }
    .toolbar { align-items: stretch; }
    .toolbar .search-field { width: 100%; }
    .conversation-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chat-header { align-items: flex-start; }
    .chat-header .row { flex-wrap: wrap; }
    .chat-header .tutor-avatar, .chat-header .tutor-initial { width: 36px; height: 36px; }
    .chat-messages, .messages { padding: 18px 15px; gap: 20px; }
    .message, .message.user { max-width: 96%; }
    .message-bubble { padding: 14px 15px; }
    .message.assistant .message-bubble { font-size: 17px; }
    .message.user .message-bubble { font-size: 14px; }
    .composer-input-row { gap: 7px; }
    .composer-input-row > .button { padding: 12px; }
    .composer-input-row > .button .button-label { display: none; }
    .composer-hint { font-size: 9px; }
    .flashcard { min-height: 340px; padding: 32px 23px; }
    .flashcard-term, .flashcard .vocab-term { font-size: 38px; }
    .review-actions { gap: 8px; }
    .review-actions .button { flex: 1; padding-left: 11px; padding-right: 11px; font-size: 12px; }
    .reading-paper, .lesson-body { font-size: 20px; line-height: 1.8; }
    .lesson-detail { padding: 22px; }
    .lesson-heading, .reading-title { font-size: 31px; }
    .audio-player { padding: 20px; gap: 13px; align-items: flex-start; }
    .audio-player .button { flex-shrink: 0; }
    .question legend { font-size: 18px; }
    .form-grid .span-2 { grid-column: auto; }
    .writing-editor { font-size: 19px; padding: 17px !important; }
    .modal { padding: 23px; }
  }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  }
}

/* Mobile learning shell. The same views remain usable on the local desktop. */
@layer mobile {
  :root { --paper: #fbfafc; --surface: #fff; --surface-soft: #f4f2f7; --plum: #7130e8; --plum-soft: #f0e8ff; --text: #211c29; --muted: #817c88; --line: #ede9f2; --line-strong: #ddd4e9; --terracotta: #7130e8; --terracotta-soft: #f0e8ff; --sage: #16874e; --sage-soft: #e8f7ee; }
  h1,h2 { color: var(--text); font-weight: 700; }
  .button:hover:not(:disabled),.btn:hover:not(:disabled) { background: #6023ca; }
  .button.secondary:hover:not(:disabled),.button.ghost:hover:not(:disabled) { background: #eee5fd; }
  .sidebar { background: #fff; }
  .brand-name { color: #292130; }
  .brand-name span { color: var(--plum); }
  .nav-item { color: #71677e; }
  .nav-item:hover { background: #f3eefe; }
  .nav-item.active { background: var(--plum-soft); color: var(--plum); font-weight: 650; }
  .nav-item.active .nav-count { color: var(--plum); background: #e3d4fd; }
  .mobile-nav { display: none; }
  .course-banner { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border: 1px solid var(--line-strong); background: #fff; border-radius: 25px; padding: 24px; }
  .course-banner h2 { margin-top: 8px; font-size: 23px; }
  .course-banner p { color: var(--muted); font-size: 12px; margin-top: 10px; }
  .course-banner .badge { flex-shrink: 0; }
  .learning-path { max-width: 620px; margin: 0 auto; width: 100%; padding: 12px 30px; }
  .path-title { margin: 0 auto 25px; width: fit-content; max-width: 100%; border-radius: 30px; background: #f0edf4; color: #82798e; font-weight: 650; padding: 9px 18px; }
  .path-step { display: flex; align-items: center; gap: 20px; min-height: 126px; position: relative; }
  .path-step:nth-of-type(2n) { padding-left: 58px; }
  .path-step:nth-of-type(2n + 1) { padding-left: 0; }
  .path-step:not(:last-child)::after { content: ''; position: absolute; top: 101px; left: 46px; height: 25px; width: 2px; background: #e5dcf4; }
  .path-step:nth-of-type(2n)::after { left: 104px; }
  .path-node { flex: 0 0 92px; width: 92px; height: 92px; border-radius: 50%; border: 0; background: #eee6fc; color: var(--plum); display: grid; place-items: center; position: relative; box-shadow: 0 5px 0 #e0d5f0; }
  .path-node svg { width: 30px; height: 30px; stroke-width: 2.4; }
  .path-node:hover { background: #e4d5fc; }
  .path-number { position: absolute; right: 0; bottom: 0; border: 3px solid var(--paper); background: #cfc0e8; color: #fff; font-size: 11px; font-weight: 700; border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; }
  .path-step.current .path-node { background: var(--plum); color: white; box-shadow: 0 5px 0 #4c1aa4, 0 0 0 7px #ebe1fc; }
  .path-step.current .path-number { background: #9b66f5; }
  .path-step.completed .path-node { color: #1c9a58; background: #e2f5eb; box-shadow: 0 5px 0 #c5e7d7; }
  .path-step.completed .path-number { background: #1aaf62; }
  .path-copy { display: grid; gap: 4px; min-width: 0; }
  .path-copy small { font-size: 11px; color: #9a8eaa; }
  .path-copy strong { font-size: 17px; line-height: 1.35; }
  .path-copy > span { font-size: 11px; color: var(--muted); }
  .continue-card { border-radius: 30px; background: var(--plum); padding: 28px; color: #fff; }
  .continue-card > span { color: #dfcefa; font-size: 12px; }
  .continue-card h2 { color: #fff; margin: 5px 0 10px; font-size: 25px; }
  .continue-card p { color: #e4d5fc; margin-bottom: 21px; font-size: 12px; }
  .continue-card .button { background: #fff; color: var(--plum); border-radius: 24px; font-weight: 700; }
  .continue-card .button:hover:not(:disabled) { background: #eee4fd; }
  .skill-shortcuts { display: flex; gap: 8px; flex-wrap: wrap; }
  .skill-shortcuts .button { border-radius: 24px; }
  .practice-mode-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; max-width: 850px; margin-bottom: 34px; }
  .practice-mode { border: 0; background: transparent; text-align: center; font-weight: 600; font-size: 13px; padding: 3px; }
  .practice-mode > span { display: grid; place-items: center; border: 1px solid #e8e0f1; border-radius: 25px; background: #f5eefe; aspect-ratio: 1.3; margin-bottom: 9px; color: #9250e0; }
  .practice-mode > span svg { width: 35px; height: 35px; stroke-width: 2.1; }
  .practice-mode:nth-child(2) > span { background: #fff5e7; color: #ce8a22; }
  .practice-mode:nth-child(3) > span { background: #fff0f0; color: #d45b6b; }
  .practice-mode:nth-child(4) > span { background: #eaf7ff; color: #4a9dc1; }
  .practice-mode.active > span { border-color: var(--plum); box-shadow: 0 0 0 2px #e9dbff; }
  .quick-scenarios { margin-bottom: 34px; }
  .quick-scenarios .button { border-radius: 25px; font-size: 13px; }
  .practice-section { margin: 0 0 32px; }
  .scenario-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 17px; }
  .scenario-card { background: #fff; color: var(--text); padding: 23px; border: 1px solid var(--line); border-radius: 25px; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 11px; min-height: 192px; transition: border-color .15s,transform .15s; }
  .scenario-card:hover { border-color: #b48ce9; transform: translateY(-2px); }
  .scenario-card > strong,.scenario-card > span:not(.badge):not(.scenario-icon),.scenario-card > small { grid-column: 1 / -1; }
  .scenario-card strong { font-size: 20px; line-height: 1.3; }
  .scenario-card > span:not(.badge):not(.scenario-icon) { color: var(--muted); font-size: 12px; }
  .scenario-card > small { display: flex; justify-content: space-between; align-items: center; color: var(--plum); font-size: 11px; margin-top: 3px; }
  .scenario-icon { color: #8c4ada; }
  .scenario-icon svg { width: 29px; height: 29px; }
  .scenario-work .scenario-icon { color: #ab7b2b; }
  .scenario-culture .scenario-icon { color: #b96574; }
  .scenario-active .scenario-icon { color: #37967e; }
  .scenario-phrases { display: grid; gap: 12px; margin-top: 12px; }
  .scenario-phrases > div { display: grid; gap: 3px; border-radius: 14px; padding: 14px; background: var(--plum-soft); }
  .scenario-phrases span { color: var(--muted); font-size: 12px; }
  .free-talk { position: sticky; bottom: 20px; margin-top: 25px; z-index: 8; max-width: 700px; margin-inline: auto; }
  .free-talk > .button { border-radius: 32px; padding: 17px 24px; box-shadow: 0 5px 25px #7130e82b; font-size: 17px; }
  .vocab-dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
  .word-of-day { border-radius: 30px; padding: 30px; background: var(--plum); color: #fff; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
  .word-of-day > span { color: #e0cffa; }
  .word-of-day h2 { color: #fff; font-size: 40px; margin-top: 8px; }
  .word-of-day p { color: #ece2fc; margin: 4px 0 19px; }
  .word-of-day .button { background: #fff; color: var(--plum); }
  .review-summary { text-align: center; display: grid; align-content: center; gap: 9px; }
  .review-total { font-size: 58px; font-weight: 750; line-height: 1; letter-spacing: -2px; }
  .review-counts { display: grid; grid-template-columns: repeat(3,1fr); margin: 14px 0; }
  .review-counts > span { display: grid; gap: 3px; color: var(--muted); font-size: 10px; padding: 0 4px; }
  .review-counts > span + span { border-left: 1px solid var(--line); }
  .review-counts strong { color: var(--text); font-size: 22px; }
  .profile-overview { margin-bottom: 28px; }
  .profile-heading { display: flex; align-items: center; gap: 16px; }
  .profile-heading .profile-avatar { width: 64px; height: 64px; font-size: 25px; background: var(--plum-soft); color: var(--plum); }
  .profile-heading p { color: var(--muted); font-size: 13px; }
  .profile-goal { padding: 22px 0; margin: 20px 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .profile-goal h3 { margin: 5px 0; font-size: 20px; }
  .profile-overview .tutor-options { max-width: 650px; }
  .voice-stage { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 20px; padding: 20px 24px; border-bottom: 1px solid var(--line); background: #fbf9ff; }
  .voice-portrait-wrap { position: relative; border-radius: 20px; overflow: hidden; height: 225px; }
  .voice-portrait { width: 100%; height: 100%; object-fit: cover; object-position: center 24%; }
  .voice-engine { position: absolute; bottom: 10px; left: 10px; right: 10px; border-radius: 20px; background: #ffffffed; color: var(--plum); text-align: center; font-size: 10px; font-weight: 650; padding: 5px; }
  .voice-stage .voice-panel { background: transparent; padding: 0; align-content: center; gap: 13px; }
  .voice-stage.is-active .voice-portrait-wrap { box-shadow: 0 0 0 3px #d3b7ff; }
  .voice-stage.is-speaking .voice-portrait-wrap { box-shadow: 0 0 0 3px #7130e8; }
  .chat-messages { min-height: 220px; }
  .large-text .message-bubble { font-size: 21px; }
  .large-text .reading-paper { font-size: 25px; }
  .large-text .vocab-example,.large-text .flashcard-example { font-size: 20px; }
  @media (max-width: 1240px) {
    .scenario-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  }
  @media (max-width: 760px) {
    body { background: #fff; }
    .sidebar { display: none; }
    .workspace { padding: max(22px,env(safe-area-inset-top)) 18px calc(115px + env(safe-area-inset-bottom)); }
    .mobile-nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); position: fixed; left: 12px; right: 12px; bottom: max(12px,env(safe-area-inset-bottom)); border: 1px solid #e7e4ea; border-radius: 42px; padding: 5px; background: #ffffffed; z-index: 65; box-shadow: 0 6px 30px #35284912; backdrop-filter: blur(16px); }
    .mobile-nav-item { min-height: 63px; display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center; color: #27212c; font-size: 11px; font-weight: 650; border-radius: 35px; background: transparent; border: 0; padding: 7px 3px; }
    .mobile-nav-item svg { width: 23px; height: 23px; stroke-width: 2.3; }
    .mobile-nav-item.active { background: #f0eaf9; color: var(--plum); }
    .page-header { margin-bottom: 23px; gap: 12px; }
    .page-header .eyebrow { display: none; }
    .page-header h1 { font-size: 33px; font-weight: 750; color: #211c29; }
    .page-header p { font-size: 12px; line-height: 1.6; margin-top: 7px; }
    .page-header .header-actions { width: auto; }
    .page-header:has(.header-actions .button) { align-items: center; justify-content: space-between; }
    .header-actions .button { min-height: 36px; padding: 8px 10px; font-size: 11px; }
    .course-banner { padding: 20px; border-radius: 25px; flex-direction: column; gap: 10px; }
    .course-banner h2 { font-size: 20px; }
    .course-banner p { font-size: 11px; }
    .learning-layout { gap: 25px; }
    .learning-path { padding: 10px 6px; }
    .path-step { gap: 18px; min-height: 138px; }
    .path-step:nth-of-type(2n) { padding-left: 38px; }
    .path-node { flex-basis: 82px; width: 82px; height: 82px; }
    .path-node svg { width: 29px; height: 29px; }
    .path-copy strong { font-size: 15px; }
    .path-copy > span { font-size: 10px; }
    .path-step:not(:last-child)::after { top: 113px; left: 41px; height: 25px; }
    .path-step:nth-of-type(2n)::after { left: 79px; }
    .continue-card { padding: 25px; border-radius: 30px; }
    .learning-layout > .context-panel { display: grid; grid-template-columns: 1fr; }
    .skill-shortcuts { gap: 7px; }
    .skill-shortcuts .button { font-size: 12px; min-height: 40px; }
    .practice-mode-grid { gap: 6px; margin-bottom: 29px; }
    .practice-mode { font-size: 10px; line-height: 1.3; }
    .practice-mode > span { aspect-ratio: 1; border-radius: 22px; margin-bottom: 9px; }
    .practice-mode > span svg { width: 29px; height: 29px; }
    .scenario-grid { gap: 12px; }
    .scenario-card { min-height: 190px; padding: 18px 15px; border-radius: 23px; gap: 10px; }
    .scenario-card strong { font-size: 17px; }
    .scenario-card > span:not(.badge):not(.scenario-icon) { font-size: 11px; }
    .scenario-card .badge { padding-inline: 5px; font-size: 9px; }
    .scenario-card small { font-size: 10px; }
    .scenario-icon svg { width: 25px; height: 25px; }
    .quick-scenarios .button { min-height: 40px; font-size: 12px; padding: 9px 13px; }
    .practice-section h2,.quick-scenarios h2 { font-size: 24px; letter-spacing: -.7px; }
    .practice-section .section-header > span { font-size: 10px; }
    .free-talk { bottom: 100px; }
    .free-talk > .button { font-size: 15px; padding: 15px 18px; min-height: 54px; }
    .vocab-dashboard { grid-template-columns: 1fr; gap: 23px; margin-bottom: 30px; }
    .word-of-day { padding: 24px; min-height: 185px; border-radius: 30px; }
    .word-of-day h2 { font-size: 39px; }
    .word-of-day .button { margin-top: 5px; }
    .review-summary { border-radius: 30px; padding: 25px; box-shadow: 0 12px 38px #4c366d0c; }
    .review-total { font-size: 62px; }
    .review-summary > .button { border-radius: 25px; min-height: 49px; font-size: 17px; }
    .review-counts { margin: 18px 0; }
    .review-counts > span { font-size: 10px; }
    .profile-overview { border: 0; padding: 4px 0 24px; }
    .profile-heading p { font-size: 11px; }
    .profile-overview .tutor-option { background: var(--surface-soft); padding: 12px; border-radius: 24px; }
    .profile-overview .tutor-option-image { width: 100%; height: 160px; border-radius: 17px; object-fit: cover; object-position: center 20%; }
    .profile-overview .tutor-option { display: grid; grid-template-columns: auto 1fr; }
    .profile-overview .tutor-option-image { grid-column: 1 / -1; grid-row: 1; }
    .profile-overview .tutor-option input { grid-row: 2; }
    .profile-overview .tutor-option-text { grid-row: 2; }
    .route-chat .split-view > aside { order: 2; }
    .route-chat .chat-panel { order: 1; border-radius: 26px; }
    .route-chat .page-header { margin-bottom: 17px; }
    .route-chat .page-header h1 { font-size: 27px; }
    .route-chat .page-header p { display: none; }
    .chat-header { gap: 8px; padding: 14px; flex-wrap: wrap; }
    .chat-header .tutor-identity { flex: 1; }
    .chat-header h3 { font-size: 14px; }
    .chat-header .tutor-switch { min-width: 83px; max-width: 100px; }
    .chat-header .tutor-switch-select { min-height: 34px; font-size: 11px; }
    .chat-header .badge { font-size: 8px; }
    .voice-stage { display: block; padding: 13px; background: #fff; }
    .voice-portrait-wrap { height: 220px; border-radius: 22px; }
    .voice-portrait { object-position: center 27%; }
    .voice-engine { left: auto; right: 10px; bottom: 10px; padding: 5px 10px; }
    .voice-stage .voice-panel { padding: 13px 2px 2px; gap: 9px; }
    .voice-status { font-size: 12px; }
    .voice-note { font-size: 10px; }
    .voice-controls .button { min-height: 41px; border-radius: 23px; }
    .chat-messages { min-height: 220px; max-height: 50dvh; padding: 17px 14px; }
    .chat-messages .empty-state { padding: 16px 4px; }
    .chat-messages .empty-icon { display: none; }
    .chat-messages .empty-state h3 { font-size: 17px; }
    .chat-messages .empty-state p { font-size: 12px; }
    .chat-messages .empty-state .button { font-size: 12px; }
    .chat-history .conversation-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .toast { bottom: 102px; }
    .modal-backdrop { padding: 18px; }
    .modal { max-height: calc(100dvh - 38px); overflow-y: auto; border-radius: 28px; }
    .scenario-detail h2 { font-size: 24px; }
    .scenario-detail .form-actions { display: grid; grid-template-columns: 1fr; }
    .large-text .message-bubble { font-size: 21px; }
    .large-text .reading-paper { font-size: 24px; }
  }
}

@layer mobile {
  .auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: 34px 20px; background: var(--paper); }
  .auth-card { width: min(100%,460px); background: #fff; border: 1px solid var(--line); border-radius: 30px; padding: 34px; box-shadow: 0 14px 60px #5231740a; }
  .auth-card .boot-wordmark { margin-bottom: 28px; font-size: 31px; }
  .auth-card h1 { font-size: 29px; letter-spacing: -.8px; margin-top: 11px; }
  .auth-description { font-size: 13px; color: var(--muted); margin: 14px 0 25px; line-height: 1.7; }
  .auth-card .notice { margin-bottom: 20px; }
  .auth-submit { margin-top: 26px; min-height: 47px; border-radius: 24px; }
  .auth-local-note { margin-top: 22px; font-size: 11px; color: var(--muted); line-height: 1.7; }
  .auth-card .field-hint { margin-top: 5px; font-size: 10px; }
  .account-settings .section-header { align-items: flex-start; }
  .account-settings summary { cursor: pointer; color: var(--plum); font-size: 13px; }
  .scenario-with-cover { grid-column: 1 / -1; position: relative; overflow: hidden; min-height: 265px; padding: 23px; align-content: end; color: white; background: #5d4233; }
  .scenario-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 38%; z-index: 0; }
  .scenario-with-cover::before { content: ''; position: absolute; inset: 57% 0 0; background: #26160ed6; z-index: 1; }
  .scenario-with-cover > :not(.scenario-cover) { position: relative; z-index: 2; }
  .scenario-with-cover .scenario-icon { display: none; }
  .scenario-with-cover > .badge { justify-self: start; background: #fffffff0; color: #4a2c24; grid-column: 1; position: absolute; left: 18px; top: 18px; }
  .scenario-with-cover > strong { font-size: 26px; }
  .scenario-with-cover > span:not(.badge):not(.scenario-icon),.scenario-with-cover > small { color: #fff5ed; }
  @media(max-width:760px) {
    .auth-screen { padding: max(24px,env(safe-area-inset-top)) 17px max(24px,env(safe-area-inset-bottom)); }
    .auth-card { border: 0; box-shadow: none; padding: 22px 7px; }
    .auth-card h1 { font-size: 30px; }
    .auth-card .field input { min-height: 48px; font-size: 16px; }
    .auth-card .auth-description { font-size: 14px; }
    .scenario-with-cover { min-height: 260px; padding: 20px; }
    .scenario-with-cover > strong { font-size: 25px; }
    .account-settings .section-header { flex-wrap: wrap; }
  }
}

@layer mobile {
  .speech-widget { position: fixed; right: 26px; bottom: 23px; z-index: 55; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: #fff; border: 1px solid #d9c8f3; border-radius: 23px; padding: 15px 18px; box-shadow: 0 8px 40px #3b1b7020; max-width: min(620px,calc(100vw - 36px)); }
  .speech-widget > div:first-child { display: grid; gap: 3px; min-width: 0; }
  .speech-widget strong { font-size: 12px; color: var(--plum); }
  .speech-widget [role="status"] { font-size: 11px; color: var(--muted); }
  .speech-widget .row { flex-shrink: 0; gap: 7px; }
  .speech-widget .button { min-height: 35px; border-radius: 20px; padding: 8px 11px; }
  @media(max-width:760px) { .speech-widget { left: 14px; right: 14px; bottom: 99px; max-width: none; gap: 10px; padding: 12px 14px; } .speech-widget .button { font-size: 10px; } }
}

@layer mobile {
  .dictionary-search { margin: 25px 0 30px; }
  .dictionary-results { display: grid; max-height: 370px; overflow-y: auto; }
  .dictionary-result { display: grid; grid-template-columns: minmax(110px,1fr) minmax(0,2fr) auto; align-items: center; gap: 15px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 15px 3px; }
  .dictionary-result:hover { background: var(--plum-soft); }
  .dictionary-result > span:first-child { display: grid; gap: 3px; }
  .dictionary-result small,.dictionary-result > span:nth-child(2) { font-size: 12px; color: var(--muted); }
  .dictionary-context { padding: 15px; border-radius: 15px; background: var(--surface-soft); margin-bottom: 20px; font-family: var(--serif); font-size: 18px; }
  .dictionary-entry + .dictionary-entry { margin-top: 23px; padding-top: 23px; border-top: 1px solid var(--line); }
  .dictionary-senses { display: grid; gap: 7px; margin-top: 12px; }
  .dictionary-senses > button { display: flex; gap: 14px; align-items: center; justify-content: space-between; border: 1px solid var(--line); background: #fff; border-radius: 13px; padding: 13px 14px; text-align: left; }
  .dictionary-senses > button:hover { background: var(--plum-soft); border-color: #b48ee9; }
  .dictionary-senses svg { flex-shrink: 0; color: var(--plum); }
  .dictionary-source { margin-top: 25px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 10px; color: var(--muted); }
  .dictionary-source a { text-decoration: underline; }
  .reading-word { display: inline; font: inherit; line-height: inherit; color: inherit; background: transparent; border: 0; border-radius: 4px; padding: 0; margin: 0; vertical-align: baseline; }
  .reading-word:hover,.reading-word:focus-visible { color: var(--plum); background: var(--plum-soft); text-decoration: underline; text-underline-offset: 4px; }
  .reading-word.in-reading-fragment { background: #f1eaff; }
  .reading-word.reading-current-word { background: #d6b9ff; color: #38116b; }
  .reading-help { font-size: 11px; color: var(--muted); line-height: 1.6; margin: 14px 0; }
  .word-picture { width: 100%; aspect-ratio: 4 / 3; border-radius: 18px; background: #f5f2f8; display: grid; place-items: center; overflow: hidden; margin-bottom: 9px; text-align: center; }
  .word-picture img { width: 100%; height: 100%; min-height: 0; object-fit: contain; object-position: center; padding: 10px; }
  .word-picture > span { max-width: 220px; font-size: 11px; color: var(--muted); padding: 15px; }
  .word-picture.large { width: min(100%,360px); flex-shrink: 0; margin: 0 auto 10px; }
  .image-credit { font-size: 9px; line-height: 1.5; color: var(--muted); margin-bottom: 7px; }
  .image-credit summary { cursor: pointer; }
  .image-credit a,.image-credit span { display: block; }
  .image-credit a { text-decoration: underline; }
  .image-library { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 20px; }
  .image-library > button { min-width: 0; border-radius: 15px; border: 1px solid var(--line); padding: 8px; background: #fff; text-align: left; }
  .image-library img { width: 100%; height: 100px; object-fit: contain; }
  .image-library span { display: block; font-size: 9px; color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }
  .self-reading-reference { font-family: var(--serif); font-size: 20px; line-height: 1.8; padding: 20px; background: #f7f3fc; border-radius: 19px; }
  .self-read-turn { margin-top: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; }
  .self-read-turn strong { color: var(--plum); font-size: 11px; }
  .self-read-turn p { font-size: 13px; margin-top: 4px; }
  @media(max-width:760px) {
    .dictionary-search { padding: 20px; border-radius: 24px; }
    .dictionary-search h2 { font-size: 21px; }
    .dictionary-result { gap: 8px; grid-template-columns: minmax(90px,1fr) minmax(0,1.3fr) auto; }
    .dictionary-result > span:nth-child(2) { font-size: 11px; }
    .dictionary-modal { padding: 22px; }
    .flashcard:has(.word-picture) { padding: 25px; }
    .image-library { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .self-reading { padding: 21px; }
    .self-reading-reference { font-size: 19px; padding: 17px; }
  }
}

@layer mobile {
  .auth-mode-switch { display: grid; justify-items: center; gap: 4px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
  .auth-mode-switch .button { font-size: 13px; }
  .family-section { scroll-margin-top: 24px; }
  .family-section > .section-header { align-items: flex-start; flex-wrap: wrap; }
  .family-section > .section-header h2 { color: var(--text); }
  .family-invite { display: grid; gap: 10px; margin-top: 22px; padding: 18px; border: 1px solid #dfd0f6; border-radius: 19px; background: #f8f4ff; }
  .family-invite input { font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 13px; color: var(--plum); }
  .family-invite .button { justify-self: start; }
  .family-users { display: grid; margin-top: 20px; }
  .family-user { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
  .family-user strong { font-size: 13px; overflow-wrap: anywhere; }
  .family-user .badge { flex-shrink: 0; }
  @media(max-width:760px) { .family-section .form-actions { display: grid; grid-template-columns: 1fr; } .family-invite { padding: 15px; } }
}

@layer mobile {
  .management-note { color: #655276; background: #f6f0ff; border: 1px solid #e6d8fa; }
  .management-accounts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 23px; }
  .management-account { min-width: 0; }
  .management-account .section-header { align-items: flex-start; margin-bottom: 10px; }
  .management-account .section-header h2 { font-size: 20px; overflow-wrap: anywhere; }
  .management-goal { font-size: 12px; color: var(--muted); min-height: 38px; margin-top: 15px; }
  .management-progress { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; padding: 20px 0; }
  .management-progress > div { display: grid; gap: 3px; }
  .management-progress strong { font-size: 20px; letter-spacing: -.5px; color: var(--plum); }
  .management-progress span { color: var(--muted); font-size: 10px; }
  .management-form { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 20px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px 14px; align-items: end; }
  .management-form .field { font-size: 12px; }
  .management-form input[type="date"] { min-width: 0; }
  .management-enabled { align-self: center; font-size: 11px; }
  .management-form .button { font-size: 12px; min-height: 40px; }
  @media(max-width:1120px) { .management-accounts { grid-template-columns: 1fr; } }
  @media(max-width:760px) { .management-account { padding: 21px; border-radius: 25px; } .management-progress { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px 12px; } .management-form { grid-template-columns: 1fr; } .management-form .button { width: 100%; } }
}

@layer mobile {
  .library-promo { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 25px 28px; border: 1px solid #d8c3fa; border-radius: 27px; background: #f6f0ff; margin-bottom: 29px; }
  .library-promo h2 { font-size: 24px; margin-top: 6px; }
  .library-promo p { font-size: 12px; line-height: 1.7; color: #7f6a93; margin-top: 6px; max-width: 550px; }
  .library-promo > .button { flex-shrink: 0; border-radius: 25px; }
  .library-intro { margin-bottom: 24px; }
  .library-counts { display: flex; flex-wrap: wrap; gap: 14px 33px; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
  .library-counts strong { color: var(--plum); font-size: 25px; margin-right: 4px; letter-spacing: -.6px; }
  .library-license { font-size: 10px; color: var(--muted); line-height: 1.7; margin-top: 11px; }
  .library-license summary { cursor: pointer; color: var(--plum); }
  .library-license a { text-decoration: underline; }
  .library-toolbar { display: flex; gap: 20px; justify-content: space-between; align-items: center; margin-bottom: 21px; }
  .library-toolbar .filter-tabs { margin: 0; flex-shrink: 0; }
  .library-toolbar .search-field { max-width: 400px; flex: 1; }
  .library-toolbar small { font-size: 9px; opacity: .7; }
  .catalog-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,280px),1fr)); gap: 20px; }
  .catalog-word { display: flex; flex-direction: column; min-width: 0; padding: 20px; border-radius: 25px; }
  .catalog-picture { width: 100%; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: #f9f8fb; margin-bottom: 17px; }
  .catalog-picture img { width: 100%; height: 100%; object-fit: contain; object-position: center; padding: 14px; }
  .catalog-no-image { display: grid; align-content: center; justify-items: center; height: 100%; padding: 20px; gap: 10px; font-size: 11px; color: var(--muted); text-align: center; }
  .catalog-no-image svg { width: 30px; height: 30px; color: #b09aca; }
  .catalog-word h2 { font-size: 25px; margin-top: 15px; letter-spacing: -.6px; overflow-wrap: anywhere; }
  .catalog-translation { margin-top: 8px; color: #5c4b6d; font-size: 13px; }
  .catalog-example { margin-top: 11px; font-size: 13px; line-height: 1.7; color: var(--muted); font-family: var(--serif); }
  .catalog-caption { margin-top: 9px; color: #9983ae; font-size: 10px; }
  .catalog-association-label { font-size: 9px; text-align: right; color: #a27f34; max-width: 120px; }
  .catalog-actions { margin-top: auto; padding-top: 20px; display: grid; gap: 4px; }
  .catalog-actions .button { font-size: 12px; border-radius: 22px; }
  .catalog-pagination { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 29px 0 4px; font-size: 12px; color: var(--muted); }
  .catalog-pagination .button { border-radius: 24px; }
  .catalog-image-library { margin-top: 0; }
  .catalog-image-library > button:hover { border-color: var(--plum); background: #f5eeff; }
  @media(max-width:1180px) { .library-toolbar { flex-wrap: wrap; } }
  @media(max-width:760px) {
    .library-promo { flex-direction: column; align-items: stretch; padding: 23px; gap: 19px; }
    .library-promo h2 { font-size: 24px; }
    .library-promo p { font-size: 12px; }
    .library-intro { padding: 21px; }
    .library-counts { gap: 14px 23px; font-size: 11px; }
    .library-counts strong { font-size: 23px; }
    .library-toolbar { display: grid; grid-template-columns: 1fr; gap: 13px; }
    .library-toolbar .filter-tabs { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 3px; width: 100%; }
    .library-toolbar .filter-tab { padding: 8px 3px; min-width: 0; font-size: 12px; }
    .library-toolbar .filter-tab small { display: none; }
    .library-toolbar .search-field { max-width: none; width: 100%; }
    .catalog-grid { gap: 12px; }
    .catalog-word { padding: 14px; border-radius: 22px; }
    .catalog-picture { border-radius: 15px; margin-bottom: 12px; }
    .catalog-picture img { padding: 11px; }
    .catalog-word h2 { font-size: 21px; }
    .catalog-translation { font-size: 12px; }
    .catalog-example { font-size: 12px; }
    .catalog-word .badge { font-size: 9px; padding: 3px 7px; }
    .catalog-association-label { font-size: 8px; max-width: 73px; }
    .catalog-actions { padding-top: 16px; }
    .catalog-actions .button { font-size: 10px; padding: 9px 8px; min-height: 38px; }
    .catalog-no-image { font-size: 10px; padding: 12px; }
  }
}
