/* Shared reading roles for the iPad home, textbook and practice surfaces. */
body[data-device=ipad] {
  --ip-type-ui: -apple-system,BlinkMacSystemFont,'PingFang SC','Hiragino Sans','Yu Gothic',sans-serif;
  --ip-type-jp: 'Hiragino Sans','Yu Gothic','Meiryo',sans-serif;
  --ip-type-ink: #30323a;
  --ip-type-body: #555963;
  --ip-type-supporting: #666a74;
  --ip-type-meta: #6d7079;
  --ip-type-rule: #eaebee;
  --ip-type-course: 36px;
  --ip-type-title: 24px;
  --ip-type-example: 28px;
  --ip-type-copy: 16px;
  --ip-type-translation: 17px;
}
body[data-device=ipad] #app:is(.page-home,.ip-learning-workspace,.ipad-learning-tools) {
  font-family: var(--ip-type-ui);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  color: var(--ip-type-ink);
}

/* The lesson context supports the learning content; the existing artwork stays sharp. */
body[data-device=ipad] #app.ip-learning-workspace .ip-sidebar-heading h2 { font-size: 30px; font-weight: 850; letter-spacing: -1px; }
body[data-device=ipad] #app.ip-learning-workspace .ip-sidebar-heading { margin-bottom: 24px; }
body[data-device=ipad] #app.ip-learning-workspace .ip-book-field { margin-bottom: 20px; }
body[data-device=ipad] #app.ip-learning-workspace .ip-book-field select { height: 48px; font-size: 15px; font-weight: 500; }
body[data-device=ipad] #app.ip-learning-workspace .ip-chapter { font-family: var(--ip-type-jp); font-size: 14px; line-height: 1.75; font-weight: 400; color: var(--ip-type-supporting); }
body[data-device=ipad] #app.ip-learning-workspace .ip-chapter.selected { font-weight: 500; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ip-learning-workspace .ip-chapter-number { font-size: 12px; font-weight: 400; color: var(--ip-type-meta); font-variant-numeric: tabular-nums; }
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page>.focus-header { padding: 24px 36px!important; }
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page>.focus-header h1 { gap: 8px; }
body[data-device=ipad] #app.ip-learning-workspace .ip-course-context { font-size: 13px; line-height: 1.6; font-weight: 400; letter-spacing: .04em; color: var(--ip-type-supporting); }
body[data-device=ipad] #app.ip-learning-workspace .ip-course-name { font-family: var(--ip-type-jp); font-size: var(--ip-type-course); font-weight: 500; line-height: 1.4; letter-spacing: -.025em; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ip-learning-workspace .ip-course-title-part { white-space: nowrap; }
body[data-device=ipad] #app.ip-learning-workspace .lesson-tabs button { font-size: 15px; line-height: 1.6; font-weight: 400; color: var(--ip-type-supporting); }
body[data-device=ipad] #app.ip-learning-workspace .lesson-tabs button.selected { font-weight: 500; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page>#lesson-panel { padding: 24px 36px 36px!important; }
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page>#lesson-panel:has(.ip-grammar-library) { padding: 0 0 28px!important; }
body[data-device=ipad] #app.ip-learning-workspace .focus-progress { font-size: 13px; line-height: 1.6; margin-bottom: 16px; color: var(--ip-type-meta); }

/* Separate the grammar name, example, translation and explanation by weight and rhythm. */
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page .ip-grammar-study-card { padding: 32px 36px; gap: 32px; }
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page .ip-grammar-study-card h3,
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page .ip-grammar-study-card:is(.cg-title-medium,.cg-title-long) h3 {
  font-family: var(--ip-type-ui); font-size: var(--ip-type-title); font-weight: 500; line-height: 1.5; letter-spacing: -.02em; color: var(--ip-type-ink);
}
body[data-device=ipad] #app.ip-learning-workspace .cg-meaning-caption { margin-top: 8px; font-size: 14px; line-height: 1.7; font-weight: 400; color: var(--ip-type-supporting); }
body[data-device=ipad] #app.ip-learning-workspace .ip-grammar-example { margin-top: 28px; }
body[data-device=ipad] #app.ip-learning-workspace .cg-syntax { gap: 18px 8px; }
body[data-device=ipad] #app.ip-learning-workspace .cg-ink { font-family: var(--ip-type-jp); font-size: var(--ip-type-example); font-weight: 400; line-height: 1.55; letter-spacing: 0; padding: 2px 4px 10px; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ip-learning-workspace .cg-token { gap: 8px; }
body[data-device=ipad] #app.ip-learning-workspace .cg-token small { font-size: 12px; line-height: 1.7; font-weight: 400; color: var(--ip-type-meta); }
body[data-device=ipad] #app.ip-learning-workspace .cg-role { font-size: 12px; line-height: 1.7; padding-bottom: 6px; color: var(--ip-type-meta); }
body[data-device=ipad] #app.ip-learning-workspace .ip-grammar-translation { margin-top: 20px; font-size: var(--ip-type-translation); font-weight: 400; line-height: 1.8; color: var(--ip-type-supporting); }
body[data-device=ipad] #app.ip-learning-workspace .cg-teaching { padding-left: 32px; gap: 24px; border-color: var(--ip-type-rule); }
body[data-device=ipad] #app.ip-learning-workspace :is(.ip-grammar-usage p,.ip-grammar-forms,.cg-particles dd,.cg-contrast dl>div) { font-size: var(--ip-type-copy); line-height: 1.85; font-weight: 400; text-wrap: pretty; color: var(--ip-type-body); }
body[data-device=ipad] #app.ip-learning-workspace .ip-grammar-usage p+p { margin-top: 8px; }
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page .ip-grammar-study-card h4 { font-size: 13px; font-weight: 500; line-height: 1.7; margin-bottom: 8px; color: var(--ip-type-supporting); }
body[data-device=ipad] #app.ip-learning-workspace .cg-pattern-word { font-family: var(--ip-type-jp); font-size: 18px; font-weight: 400; line-height: 1.6; padding: 8px 12px; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ip-learning-workspace .cg-plus { font-size: 18px; font-weight: 400; }
body[data-device=ipad] #app.ip-learning-workspace .cg-connection-note { font-size: 15px; line-height: 1.85; color: var(--ip-type-body); }
body[data-device=ipad] #app.ip-learning-workspace .cg-particles dt { font-family: var(--ip-type-jp); font-size: 18px; line-height: 1.6; font-weight: 400; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ip-learning-workspace .ip-grammar-card-foot { align-items: flex-end; padding-top: 4px; }
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page .ip-grammar-practice { align-self: flex-end; width: auto; min-width: 128px; max-width: 100%; min-height: 48px; padding: 12px 20px; font-size: 15px; line-height: 1.6; font-weight: 500; gap: 12px; }
body[data-device=ipad] #app.ip-learning-workspace .ip-grammar-practice svg { width: 18px; height: 18px; }

/* Vocabulary uses the same reading scale and quieter metadata. */
body[data-device=ipad] #app.ip-learning-workspace .ip-vocabulary-grid { gap: 24px; align-items: stretch; }
body[data-device=ipad] #app.ip-learning-workspace .ip-vocabulary-card { padding: 24px; gap: 16px; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ip-learning-workspace .ip-vocabulary-card h3 { font-family: var(--ip-type-jp); font-size: 24px; line-height: 1.5; font-weight: 400; letter-spacing: 0; }
body[data-device=ipad] #app.ip-learning-workspace .ip-vocabulary-meta { gap: 4px 12px; margin-top: 4px; }
body[data-device=ipad] #app.ip-learning-workspace .ip-vocabulary-spelling { font-size: 13px; line-height: 1.7; color: var(--ip-type-meta); }
body[data-device=ipad] #app.ip-learning-workspace .ip-vocabulary-pos { font-size: 12px; line-height: 1.65; }
body[data-device=ipad] #app.ip-learning-workspace .ip-vocabulary-meaning { font-size: 17px; line-height: 1.75; font-weight: 400; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ip-learning-workspace .ip-vocabulary-usage p { font-family: var(--ip-type-ui); font-size: 16px; line-height: 1.85; font-weight: 400; }
body[data-device=ipad] #app.ip-learning-workspace .ip-vocabulary-card h4 { font-size: 12px; line-height: 1.7; font-weight: 500; color: var(--ip-type-supporting); }
body[data-device=ipad] #app.ip-learning-workspace .ip-vocabulary-example { padding-top: 16px; }
body[data-device=ipad] #app.ip-learning-workspace .ip-vocabulary-example p[lang=ja] { font-family: var(--ip-type-jp); font-size: 18px; line-height: 1.95; font-weight: 400; }
body[data-device=ipad] #app.ip-learning-workspace .ip-vocabulary-example p[lang=ja] { color: var(--ip-type-ink); }
body[data-device=ipad] #app.ip-learning-workspace .ip-vocabulary-example p[lang=zh-CN] { font-size: 15px; line-height: 1.85; margin-top: 8px; font-weight: 400; color: var(--ip-type-supporting); }
body[data-device=ipad] #app.ip-learning-workspace .ip-vocabulary-card .ip-vocabulary-practice { font-size: 14px; font-weight: 500; }

/* Keep enough vertical space for ruby while giving Chinese explanations a comfortable measure. */
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page #lesson-panel .textbook-section-title { font-size: 20px; font-weight: 500; line-height: 1.6; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page #lesson-panel :is(.published-article,.published-detail-passage,.follow-card) .n5-reading-text { font-family: var(--ip-type-jp); font-size: 22px!important; font-weight: 400; line-height: 2.4!important; letter-spacing: 0; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page #lesson-panel .reading-translation { font-size: 16px; line-height: 1.85; font-weight: 400; margin-top: 16px; color: var(--ip-type-supporting); }
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page #lesson-panel .published-detail-focus { padding: 28px; }
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page #lesson-panel .published-detail-focus h3 { font-size: 18px; font-weight: 500; line-height: 1.6; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page #lesson-panel .published-detail-point p { font-size: 16px; line-height: 1.85; font-weight: 400; color: var(--ip-type-body); }
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page #lesson-panel .detail-focus-label { font-size: 13px; line-height: 1.7; font-weight: 400; color: var(--ip-type-meta); }
body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page #lesson-panel .published-detail-point+.published-detail-point { margin-top: 24px; padding-top: 24px; }

/* Practice uses the same labels and explanation rhythm, while the writing scale stays intact. */
body[data-device=ipad] #app.ipad-learning-tools:not(.page-home) .ip-topbar h1 { font-size: 20px; line-height: 1.5; font-weight: 500; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ipad-learning-tools .ip-top-left small { font-size: 13px; line-height: 1.7; font-weight: 400; color: var(--ip-type-meta); margin-left: 12px; }
body[data-device=ipad] #app.ipad-learning-tools :is(#ip-direction,.ip-feedback-button,.ip-study-link,.ip-writing-modes button) { font-size: 14px; font-weight: 400; color: var(--ip-type-body); }
body[data-device=ipad] #app.ipad-learning-tools .ip-writing-modes button.selected { font-weight: 500; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ipad-learning-tools :is(.ip-word-meaning,.ip-text-meaning) { font-size: 18px; line-height: 1.8; color: var(--ip-type-supporting); }
body[data-device=ipad] #app.ipad-learning-tools :is(.ip-paging,.ip-review-position,.ip-explain-pos,.ip-explain-token>small) { font-size: 13px; line-height: 1.7; font-weight: 400; color: var(--ip-type-meta); font-variant-numeric: tabular-nums; }
body[data-device=ipad] #app.ipad-learning-tools .ip-review-title { font-size: 14px; line-height: 1.7; font-weight: 500; color: var(--ip-type-supporting); }
body[data-device=ipad] #app.ipad-learning-tools .ip-explain-token>strong { font-family: var(--ip-type-jp); font-size: 30px; font-weight: 400; line-height: 1.55; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ipad-learning-tools .ip-explain-gloss { font-size: 14px; line-height: 1.75; color: var(--ip-type-supporting); }
body[data-device=ipad] #app.ipad-learning-tools :is(.ip-review-translation>p,.ip-review-meaning>p) { font-size: 17px; line-height: 1.8; font-weight: 400; color: var(--ip-type-supporting); }
body[data-device=ipad] #app.ipad-learning-tools .ip-word-definition>h2 { font-family: var(--ip-type-jp); font-size: 32px; font-weight: 400; line-height: 1.5; color: var(--ip-type-ink); margin-block: 12px 8px; }
body[data-device=ipad] #app.ipad-learning-tools :is(.ip-word-usage,.ip-example)>h3 { font-size: 13px; line-height: 1.7; font-weight: 500; color: var(--ip-type-supporting); margin-bottom: 8px; }
body[data-device=ipad] #app.ipad-learning-tools :is(.ip-word-usage,.ip-example,.ip-explain-rule)>p { font-size: 16px; line-height: 1.85; font-weight: 400; color: var(--ip-type-body); }
body[data-device=ipad] #app.ipad-learning-tools .ip-example>p[lang=ja] { font-family: var(--ip-type-jp); font-size: 22px; line-height: 1.9; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ipad-learning-tools :is(.ip-grammar-head>h2,.ip-explain-grammar>h2,.ip-explain-rule>h3,.ip-brief-rule summary>h3) { font-size: 17px; line-height: 1.7; font-weight: 500; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ipad-learning-tools .ip-brief-rule summary>p { font-size: 16px; line-height: 1.85; color: var(--ip-type-body); }
body[data-device=ipad] #app.ipad-learning-tools .ip-brief-rule .ip-rule-detail { font-size: 15px; line-height: 1.85; color: var(--ip-type-body); }
body[data-device=ipad] #app.ipad-learning-tools .ip-notebook-word { font-family: var(--ip-type-jp); font-size: 24px; line-height: 1.6; font-weight: 400; color: var(--ip-type-ink); }
body[data-device=ipad] #app.ipad-learning-tools .ip-notebook-meaning { font-size: 16px; line-height: 1.85; color: var(--ip-type-body); }

@media(max-width:1179px) {
  body[data-device=ipad] #app.ip-learning-workspace { --ip-type-course: 32px; --ip-type-example: 26px; }
  body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page>.focus-header { padding-inline: 28px!important; }
  body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page>#lesson-panel { padding-inline: 28px!important; }
  body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page>#lesson-panel:has(.ip-grammar-library) { padding-inline: 0!important; }
  body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page .ip-grammar-study-card { padding: 28px; gap: 24px; }
  body[data-device=ipad] #app.ip-learning-workspace .cg-teaching { padding-left: 24px; }
  body[data-device=ipad] #app.ip-learning-workspace .cg-syntax { column-gap: 6px; }
  body[data-device=ipad] #app.ip-learning-workspace .cg-ink { padding-inline: 3px; }
}
@media(max-width:900px) {
  body[data-device=ipad] #app.ip-learning-workspace { --ip-type-course: 30px; }
  body[data-device=ipad] #app.ip-learning-workspace .cg-teaching { padding: 24px 0 0; }
}
@media(max-width:600px) {
  body[data-device=ipad] #app.ip-learning-workspace { --ip-type-course: 24px; --ip-type-title: 22px; --ip-type-example: 24px; }
  body[data-device=ipad] #app.ip-learning-workspace .ip-course-context { font-size: 12px; }
  body[data-device=ipad] #app.ip-learning-workspace .ip-course-title-part { white-space: normal; }
  body[data-device=ipad] #app.ip-learning-workspace.free-lesson-page .ip-grammar-study-card { padding: 24px 20px; }
}
