/*
  Palitext web — design tokens cloned from the Apple app (not a generic template).
  Purpose: bilingual Pāli / Chinese reader matching Palitext.
  Palette: home blue #1E69FF, agama yellow #FFF491, reader green #EDFFE1, PTS #E8F1FF.
  Type: Heiti (sans) for Simplified home cards; Songti for CJK and Heiti for Latin
        in English / Traditional; PingFang / Songti for UI; Times New Roman /
        Noto Serif for Pāli. system-ui is avoided.
  Layout: full-viewport app under the site header; iPhone-style tab bar;
          reader auto side-by-side over 700px, stacked below.
*/

@font-face {
  font-family: "PT Home HeiSong";
  font-style: normal;
  font-weight: 100 900;
  src: local("PingFang TC"), local("PingFang SC"), local("Heiti TC"), local("Heiti SC"),
    local("STHeiti"), local("Hiragino Sans GB"), local("Microsoft JhengHei"),
    local("Microsoft YaHei"), local("SimHei"), local("Noto Sans TC"), local("Noto Sans SC"),
    local("Helvetica Neue"), local("Helvetica"), local("Arial");
  unicode-range: U+0000-024F, U+1E00-1EFF, U+02B0-036F, U+2010-2027;
}

@font-face {
  font-family: "PT Home HeiSong";
  font-style: normal;
  font-weight: 100 900;
  src: local("Songti TC"), local("STSongti-TC-Regular"), local("Songti SC"), local("STSong"),
    local("PMingLiU"), local("MingLiU"), local("SimSun"), local("Noto Serif TC"), local("Noto Serif SC");
  unicode-range: U+2E80-2FFF, U+3000-303F, U+31C0-31EF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF;
}

:root {
  --pt-blue: #1e69ff;
  --pt-yellow: #fff491;
  --pt-green: #edffe1;
  --pt-pts: #e8f1ff;
  --pt-ink: #111318;
  --pt-muted: #5c6370;
  --pt-line: rgba(0, 0, 0, 0.08);
  --pt-tab-h: calc(76px + env(safe-area-inset-bottom));
  --pt-ui: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Songti SC", "Source Han Sans SC", sans-serif;
  --pt-pali: "Times New Roman", "Noto Serif", "New York", "Songti SC", serif;
  --pt-home: "PingFang SC", "Heiti SC", "STHeiti", "Hiragino Sans GB", "Microsoft YaHei", "SimHei", "Noto Sans SC", sans-serif;
}

html[lang="zh-Hans"] {
  --pt-home: "PingFang SC", "Heiti SC", "STHeiti", "Hiragino Sans GB", "Microsoft YaHei", "SimHei", "Noto Sans SC", sans-serif;
}

html[lang="en"],
html[lang="zh-Hant"] {
  --pt-home: "PT Home HeiSong", "PingFang SC", "Heiti SC", "Songti SC", sans-serif;
}

body.app-scene {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  font-family: var(--pt-ui);
}
body.app-scene header {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.92);
}
.app-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  position: relative;
}
.app-root {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.app-scene.is-reading .app-tabbar {
  display: none;
}

.app-tabbar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  padding: 6px 8px;
  z-index: 30;
}
.app-tabbar button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--pt-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  font: 600 10px/1.2 var(--pt-ui);
  cursor: pointer;
  touch-action: manipulation;
}
.app-tabbar button svg {
  width: 24px;
  height: 24px;
}
.app-tabbar button.active {
  color: var(--pt-blue);
}

.app-scroll {
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}
.app-scene.is-reading .app-scroll {
  padding-bottom: 0;
}
.app-pad {
  padding: 16px 20px 28px;
}
.app-title {
  font-family: var(--pt-home);
  font-size: 30px;
  margin: 8px 0 12px;
  color: #111;
}
.app-subhead {
  font-family: var(--pt-home);
  font-size: 30px;
  margin: 18px 0 8px;
  color: #111;
}
.app-subhead .zhuang,
.zhuang-hl {
  position: relative;
  display: inline-block;
}
.zhuang-hl::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 0.48em;
  background: rgb(158, 237, 140);
  transform: skewX(-12deg);
  border-radius: 4px;
  z-index: 0;
}
.zhuang-hl > span {
  position: relative;
  z-index: 1;
}
.app-subhead .zhuang {
  background: rgb(158, 237, 140);
  padding: 0 2px;
}

.home-col {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px;
  container-type: inline-size;
}
.app-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-family: var(--pt-home);
  margin: 28px 0 12px;
  color: #111;
  line-height: 1.15;
}
.app-section-head.is-tight {
  margin-top: 12px;
  margin-bottom: 6px;
}
.app-section-head.is-extra {
  margin-top: 16px;
  margin-bottom: 6px;
}
.app-section-title {
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  font-size: clamp(12px, 7.2cqi, 30px);
}
.app-section-sub {
  margin-left: auto;
  font-size: 14px;
  white-space: nowrap;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.app-skeleton {
  padding-top: 18px;
}
.app-skeleton .sk-line,
.app-skeleton .sk-row,
.app-skeleton .sk-card {
  background-color: rgba(17, 19, 24, 0.06);
  background-image: linear-gradient(
    90deg,
    rgba(17, 19, 24, 0) 0%,
    rgba(17, 19, 24, 0.05) 50%,
    rgba(17, 19, 24, 0) 100%
  );
  background-size: 220% 100%;
  background-repeat: no-repeat;
  border-radius: 12px;
  animation: sk-shimmer 1.5s ease-in-out infinite;
}
.app-skeleton .sk-title {
  height: 28px;
  width: 46%;
  margin: 10px 0 16px;
  border-radius: 8px;
}
.app-skeleton .sk-row {
  height: 54px;
  margin-bottom: 10px;
}
.app-skeleton .sk-card {
  aspect-ratio: 1;
  border-radius: 18px;
}
@keyframes sk-shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .app-skeleton .sk-line,
  .app-skeleton .sk-row,
  .app-skeleton .sk-card {
    animation: none;
  }
}
.nikaya-card {
  aspect-ratio: 1;
  container-type: inline-size;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 12px;
  text-decoration: none;
  color: #fff;
  background: var(--pt-blue);
  cursor: pointer;
}
.nikaya-card.agama {
  background: var(--pt-yellow);
  color: #111;
}
.nikaya-card > div {
  max-width: 100%;
}
.nikaya-card .zh {
  font-family: var(--pt-home);
  font-size: calc(100cqw / 6);
  line-height: 1.15;
  text-align: right;
  white-space: nowrap;
}
.nikaya-card .id {
  font-family: var(--pt-home);
  font-size: calc(100cqw * 22 / 29 / 6);
  line-height: 1.15;
  text-align: right;
  white-space: nowrap;
}

.home-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 6px;
  text-decoration: none;
  color: #111;
  font-family: var(--pt-home);
  border: 0;
  background: var(--pt-green);
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
}
.home-row.zhuang { background: var(--pt-green); }
.home-row.pts { background: var(--pt-pts); }
.home-row .zh { font-size: 22px; }
.home-row .id { font-size: 16px; opacity: 0.75; }

.app-status {
  padding: 24px 8px;
  color: var(--pt-muted);
  text-align: center;
}

.catalog-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 6px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.catalog-head button,
.reader-bar button,
.dock button,
.me-row,
.ghost-btn {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: inherit;
}
.back-btn {
  color: var(--pt-blue);
  font-weight: 600;
  padding: 6px 4px;
}
.reader-bar .back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
}
.reader-bar .pt-chev {
  width: 22px;
  height: 22px;
}
.catalog-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.ios-catalog {
  background: #f2f2f7;
}
.ios-nav {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  min-height: 44px;
  padding: 4px 4px 6px;
  background: rgba(242, 242, 247, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.18);
}
.ios-nav h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  text-align: center;
  letter-spacing: -0.02em;
  color: #000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ios-back {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--pt-blue);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 44px;
  padding: 0 6px;
  cursor: pointer;
}
.ios-back svg,
.ios-chev svg,
.ios-twist svg {
  width: 22px;
  height: 22px;
  display: block;
}
.ios-stack {
  padding: 14px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ios-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}
.ios-row {
  appearance: none;
  border: 0;
  background: #fff;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.18);
  color: inherit;
  font: inherit;
}
.ios-card > .ios-row:last-child,
.ios-disc-body > .ios-row:last-child {
  border-bottom: 0;
}
.ios-row:active {
  background: #d1d1d6;
}
.ios-main {
  flex: 1;
  min-width: 0;
}
.ios-title {
  font-size: 17px;
  line-height: 1.28;
  color: #000;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ios-title.is-dim {
  color: rgba(60, 60, 67, 0.55);
}
.ios-sub {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.25;
  color: rgba(60, 60, 67, 0.6);
}
.ios-sub.pali {
  font-family: var(--pt-pali);
}
.ios-continue {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 650;
  color: var(--pt-blue);
  background: rgba(30, 105, 255, 0.15);
  border-radius: 99px;
  padding: 2px 7px;
}
.ios-chev {
  flex: 0 0 auto;
  color: #c7c7cc;
}
.ios-kind {
  flex: 0 0 auto;
  width: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ios-kind.folder { color: var(--pt-blue); }
.ios-kind.doc { color: #8e8e93; }
.ios-glyph {
  width: 22px;
  height: 22px;
  display: block;
}
.ios-disc-head {
  font-weight: 650;
}
.ios-disc-title {
  font-size: 17px;
  font-weight: 650;
  color: #000;
}
.ios-twist {
  color: var(--pt-blue);
  transition: transform 0.18s ease;
}
.ios-disc.is-open > .ios-disc-head .ios-twist {
  transform: rotate(90deg);
}
.ios-disc-body .ios-row {
  padding-left: 42px;
}
.ios-disc:last-child > .ios-disc-head,
.ios-disc:last-child > .ios-disc-body:not([hidden]) > .ios-row:last-child {
  border-bottom: 0;
}

.reader {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--pt-green);
  position: relative;
}
.reader.is-dark {
  background: #111;
  color: #f4f4f4;
}
.reader.is-white { background: #fff; }
.reader-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--pt-line);
}
.reader.is-dark .reader-bar {
  background: rgba(20, 20, 20, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
}
.reader-bar h2 {
  flex: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader-split {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.reader.is-paging .reader-split {
  opacity: 0.55;
  transition: opacity 0.12s ease;
}
@media (min-width: 701px) {
  .reader-split:not(.pali-only) {
    flex-direction: row;
  }
}
.reader-pane {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  padding: 16px 18px calc(88px + env(safe-area-inset-bottom));
}
.reader-pane.zh { flex: 0 0 var(--split, 55%); }
@media (min-width: 701px) {
  .reader-pane.zh { flex-basis: var(--split-w, 50%); }
}
.reader-gutter {
  flex: 0 0 10px;
  background: rgba(0, 0, 0, 0.06);
  cursor: row-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.reader.is-resizing,
.reader.is-resizing * {
  user-select: none !important;
  -webkit-user-select: none !important;
}
@media (min-width: 701px) {
  .reader-split:not(.pali-only) .reader-gutter { cursor: col-resize; }
}
.pane-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--pt-muted);
  margin: 0 0 10px;
}
.pane-body {
  font-size: var(--reader-size, 18px);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.pane-body.pali {
  font-family: var(--pt-pali);
}
.fn {
  color: #3366ff;
  text-decoration: underline;
  text-decoration-color: #3366ff;
  text-underline-offset: 2px;
  cursor: pointer;
}
.reader.is-dark .fn {
  color: #7ab4ff;
  text-decoration-color: #7ab4ff;
}
.cite {
  color: #3366ff;
  text-decoration: underline;
  text-decoration-color: #3366ff;
  text-underline-offset: 2px;
  cursor: pointer;
}
.reader.is-dark .cite {
  color: #7ab4ff;
  text-decoration-color: #7ab4ff;
}
.hl {
  background: #ffe566;
}
.reader.is-dark .hl { background: #6b5a00; color: #fff; }

.reader-dock {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}
.reader-dock button {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 48px;
  height: 48px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--pt-ink);
  font: 650 14px/1.2 var(--pt-ui);
  cursor: pointer;
}
.reader-dock button:disabled { opacity: 0.35; }
.pt-chev {
  width: 22px;
  height: 22px;
  display: block;
}
.jump-label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-weight: 650;
  font-size: 14px;
}

.float-card {
  position: absolute;
  z-index: 40;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
  padding: 8px;
  max-width: min(360px, calc(100% - 24px));
  user-select: none;
}
.float-card button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  font: 600 14px var(--pt-ui);
  cursor: pointer;
  color: var(--pt-blue);
}
.float-card {
  padding: 12px 14px;
  max-height: 50vh;
  overflow: auto;
}
.float-card h3 { margin: 0 0 8px; font-size: 15px; }
.float-card .dict-book { font-size: 12px; color: var(--pt-muted); margin: 10px 0 4px; }
.float-card .dict-html { font-size: 14px; line-height: 1.55; }
.float-card textarea {
  width: 100%;
  min-height: 64px;
  margin: 8px 0;
  font: 14px var(--pt-ui);
}

.note-popup {
  position: absolute;
  z-index: 42;
  box-sizing: border-box;
  background: #edffe1;
  color: #333;
  border: 2px solid #005b00;
  border-radius: 0;
  padding: 12px;
  max-width: min(700px, calc(100% - 16px));
  overflow: auto;
  box-shadow: none;
  user-select: text;
  font: 17px/1.5 var(--pt-ui);
}
.note-popup-body {
  white-space: pre-wrap;
  word-break: break-word;
}
.reader.is-dark .note-popup {
  background: #edffe1;
  color: #333;
  border-color: #005b00;
}

.search-wrap { padding: 12px 16px 20px; }
.search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}
.search-bar input {
  flex: 1;
  height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  font: 16px var(--pt-ui);
}
.search-scopes {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
}
.search-scopes button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--pt-line);
  background: #fff;
  font: 600 13px var(--pt-ui);
}
.search-scopes button.on {
  background: var(--pt-blue);
  color: #fff;
  border-color: var(--pt-blue);
}
.search-hit {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 4px;
  border-bottom: 1px solid var(--pt-line);
  background: transparent;
}
.search-hit .meta { font-size: 12px; color: var(--pt-muted); }
.search-hit .cite { color: #db9e14; font-weight: 650; }
.search-hit .hit-title { font-size: 15px; font-weight: 650; margin-top: 2px; }
.search-hit .snip { margin-top: 4px; font-size: 14px; color: var(--pt-muted); }
.search-hl {
  background: rgba(255, 214, 10, 0.55);
  color: inherit;
  padding: 0;
  border-radius: 2px;
}

.pali-w {
  cursor: pointer;
  border-radius: 3px;
}
.pali-w:active,
.pane-body.pali .pali-w:hover {
  background: rgba(30, 105, 255, 0.14);
}

.dict-panel {
  position: fixed;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-radius: 24px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
}
.reader.is-dark .dict-panel {
  background: rgba(28, 28, 30, 0.9);
  color: #f4f4f4;
  border-color: rgba(255, 255, 255, 0.14);
}
.dict-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  cursor: grab;
  touch-action: none;
  flex: 0 0 auto;
}
.dict-grip {
  color: rgba(60, 60, 67, 0.45);
  font-size: 13px;
  letter-spacing: -0.08em;
}
.dict-head h3 {
  margin: 0;
  flex: 1;
  font-size: 17px;
  font-weight: 650;
}
.dict-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #8e8e93;
  font-size: 28px;
  line-height: 1;
  width: 36px;
  height: 36px;
  cursor: pointer;
}
.dict-query {
  display: flex;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 0.5px solid rgba(60, 60, 67, 0.18);
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.18);
}
.dict-query input {
  flex: 1;
  min-width: 0;
  height: 36px;
  border: 0.5px solid rgba(60, 60, 67, 0.22);
  border-radius: 8px;
  padding: 0 10px;
  font: 16px var(--pt-pali);
  background: rgba(255, 255, 255, 0.7);
}
.dict-go {
  appearance: none;
  border: 0;
  background: var(--pt-blue);
  color: #fff;
  border-radius: 8px;
  padding: 0 12px;
  font: 650 14px var(--pt-ui);
  cursor: pointer;
}
.dict-go:disabled { opacity: 0.4; }
.dict-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}
.dict-word {
  font-family: var(--pt-pali);
  font-size: 20px;
  font-weight: 650;
  margin-bottom: 6px;
}
.dict-count,
.dict-status,
.dict-author,
.dict-cand-detail,
.dict-none {
  font-size: 13px;
  color: var(--pt-muted);
  margin: 0 0 10px;
}
.dict-error { color: #c0392b; font-size: 13px; }
.dict-empty { text-align: center; padding: 28px 12px; color: var(--pt-muted); }
.dict-empty strong { display: block; color: var(--pt-ink); margin-bottom: 8px; font-size: 17px; }
.dict-book-card {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
.dict-book-card h4 {
  margin: 0 0 4px;
  font-size: 15px;
}
.dict-html {
  font-size: 15px;
  line-height: 1.55;
  margin-top: 8px;
}
.dict-cand { margin: 12px 0; }
.dict-cand-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--pt-muted);
}
.dict-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.dict-chip {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 99px;
  padding: 6px 10px;
  font: 650 12px var(--pt-pali);
  cursor: pointer;
}

.notes-list button.folder,
.notes-list button.note-item {
  display: flex;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--pt-line);
  gap: 12px;
  align-items: center;
  background: #fff;
}
.note-editor {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.note-editor input.title {
  border: 0;
  border-bottom: 1px solid var(--pt-line);
  padding: 10px 14px;
  font: 700 18px var(--pt-ui);
}
.note-editor #quill-host {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.note-editor .ql-container { height: calc(100% - 42px); }

.me-list {
  padding: 20px 16px 24px;
  background: #f2f2f7;
  min-height: 100%;
  box-sizing: border-box;
}
.me-capsule {
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.me-section {
  font-size: 13px;
  color: var(--pt-muted);
  padding: 16px 20px 6px;
}
.me-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  border-bottom: 0;
  background: transparent;
  text-align: left;
  text-decoration: none;
  color: inherit;
}
a.me-row:hover,
a.me-row:visited,
a.me-row:active {
  text-decoration: none;
  color: inherit;
}
.me-row-label {
  text-decoration: none;
}
.me-row .me-chev {
  display: flex;
  align-items: center;
  color: #c7c7cc;
}
.me-row .me-chev .pt-chev {
  width: 18px;
  height: 18px;
}
.me-row .chev { color: var(--pt-muted); }
.me-row .chev-down {
  display: inline-block;
  transition: transform 0.25s ease;
  font-size: 14px;
}
.me-row.is-open .chev-down { transform: rotate(180deg); }
.poster-swipe {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 8px 16px 12px;
}
.poster-swipe::-webkit-scrollbar { display: none; }
.poster-track {
  display: flex;
}
.poster-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  aspect-ratio: 1242 / 1656;
}
.poster-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.04);
}
.me-footer {
  padding: 20px;
  font-size: 12px;
  color: var(--pt-muted);
  white-space: pre-wrap;
}
.license-body {
  max-width: 720px;
  padding: 8px 20px 36px;
}
.license-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 8px 0 16px;
  line-height: 1.15;
}
.license-body h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 22px 0 8px;
}
.license-body p {
  font-size: 17px;
  line-height: 1.55;
  margin: 0 0 12px;
}
.license-body hr {
  border: 0;
  border-top: 1px solid var(--pt-line);
  margin: 20px 0;
}
.license-dict {
  font-size: 22px;
  font-weight: 700;
  margin: 8px 0;
}
.license-muted {
  font-size: 15px;
  color: var(--pt-muted);
}
.license-cite {
  font-size: 15px;
  margin: 0 0 8px !important;
  line-height: 1.45;
}
.license-myanmar {
  font-size: 17px;
  font-weight: 650;
  margin-top: 16px;
}
.license-body a { color: var(--pt-blue); }
.toggle {
  width: 48px;
  height: 30px;
  border-radius: 99px;
  background: #e5e5ea;
  position: relative;
  border: 0;
}
.toggle.on { background: var(--pt-blue); }
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.toggle.on::after { transform: translateX(18px); }
.heat {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  gap: 2px;
  padding: 8px 20px 16px;
}
.heat i {
  aspect-ratio: 1;
  background: #ebedf0;
  display: block;
}
.heat i.l1 { background: #c6e48b; }
.heat i.l2 { background: #7bc96f; }
.heat i.l3 { background: #239a3b; }
.heat i.l4 { background: #196127; }

.dl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--pt-line);
}
.dl-item button {
  background: var(--pt-blue);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 6px 12px;
  font: 600 13px var(--pt-ui);
  cursor: pointer;
}
.dl-item button:disabled { opacity: 0.5; }

.field {
  display: block;
  width: calc(100% - 40px);
  margin: 8px 20px;
  padding: 10px 12px;
  border: 1px solid var(--pt-line);
  border-radius: 10px;
  font: 15px var(--pt-ui);
}

.pts-node {
  padding: 8px 16px;
  border-bottom: 1px solid var(--pt-line);
  background: #fff;
  width: 100%;
  text-align: left;
}
.pts-node.branch { font-weight: 700; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--pt-tab-h) + 16px);
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 50;
}

.progress-line {
  height: 3px;
  background: var(--pt-blue);
  width: 0;
  transition: width 0.2s;
}

/* 2026-09 web edition */
.route-view { height:100%; min-height:0; }
.web-notice { font:400 14px/1.65 var(--pt-ui); color:var(--pt-muted); padding:12px 14px; background:rgba(255,255,255,.65); border:1px solid var(--pt-line); border-radius:12px; }
.edition-head { display:flex; align-items:baseline; flex-wrap:wrap; gap:3px 6px; }
.edition-head .app-section-title { white-space:normal; }
.edition-head sub { font:400 12px/1.4 var(--pt-ui); position:relative; bottom:-.3em; }
.reader-split:not(.pali-only) { flex-direction:column; }
.reader-pane.zh { flex-basis:var(--split,55%); }
.reader-split:not(.pali-only) .reader-gutter { cursor:row-resize; }
.reader.is-side-by-side .reader-split:not(.pali-only) { flex-direction:row; }
.reader.is-side-by-side .reader-pane.zh { flex-basis:var(--split-w,50%); }
.reader.is-side-by-side .reader-gutter { cursor:col-resize; }
.reader { padding-left:env(safe-area-inset-left); padding-right:env(safe-area-inset-right); }
.reader-dock [data-act=size] { color:#000; }
.reader-settings { position:absolute; right:max(16px,env(safe-area-inset-right)); bottom:calc(84px + env(safe-area-inset-bottom)); z-index:40; width:min(320px,calc(100% - 32px)); max-height:calc(100% - 140px); overflow:auto; background:#fff; color:#111; border:1px solid #ddd; border-radius:14px; padding:16px; box-shadow:none; font:400 15px/1.5 var(--pt-ui); }
.reader-settings[hidden] { display:none; }
.reader-settings fieldset { margin:0 0 12px; padding:0; border:0; }
.reader-settings legend { margin-bottom:6px; }
.reader-settings button { background:#f3f4f5; color:#111; border:1px solid transparent; border-radius:8px; padding:8px 12px; margin-right:6px; cursor:pointer; }
.reader-settings button[aria-pressed=true] { border-color:#3366ff; background:#eef2ff; }
.reader-settings label { display:block; margin:0 0 14px; }
.reader-settings input { width:100%; accent-color:#3366ff; }
.reader-bar button[aria-pressed=true] { font-weight:700; }
.search-pages { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:14px; padding:20px 0 30px; }
.search-pages button { border:1px solid var(--pt-line); background:#fff; border-radius:10px; padding:10px; cursor:pointer; }
.search-pages button:disabled { opacity:.4; cursor:default; }
.search-pages input { width:65px; margin-left:8px; padding:8px; }
.search-count { color:var(--pt-muted); }
.reader-dock .jump-label { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.app-scroll.search-wrap { padding-bottom:calc(108px + env(safe-area-inset-bottom)); scroll-padding-bottom:100px; }

.pali-block { display:block; content-visibility:auto; contain-intrinsic-size:auto 900px; }
.pali-block:first-child { content-visibility:visible; }
