/* iPhone 15 Pro Max and other full-screen iOS WebKit surfaces. */

.ios-tabbar {
  display: none;
}

/* Keep the native iPhone surface on the mobile layout in landscape too.
   Without these overrides a wide landscape viewport falls back to the desktop
   sidebar and the "多语 → 中" pill, even though the app is iPhone-only. */
html.ios-app .sidebar,
html.ios-app .sidebar-scrim {
  display: none;
}

html.ios-app .workspace {
  margin-left: 0;
}

html.ios-app .lang-pair {
  display: none;
}

html.ios-app {
  --ios-safe-top: max(var(--safe-top, 0px), env(safe-area-inset-top, 0px));
  --ios-safe-right: max(var(--safe-right, 0px), env(safe-area-inset-right, 0px));
  --ios-safe-bottom: max(var(--safe-bottom, 0px), env(safe-area-inset-bottom, 0px));
  --ios-safe-left: max(var(--safe-left, 0px), env(safe-area-inset-left, 0px));
  min-height: 100%;
  overflow-x: clip;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.ios-app body {
  min-height: var(--visual-vh, 100dvh);
  overflow-x: clip;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

html.ios-app button,
html.ios-app a,
html.ios-app label {
  touch-action: manipulation;
}

html.ios-app .app-shell,
html.ios-app .workspace,
html.ios-app .main-scroll {
  min-height: var(--visual-vh, 100dvh);
}

html.ios-app .topbar {
  height: calc(54px + var(--ios-safe-top));
  padding:
    var(--ios-safe-top)
    max(14px, var(--ios-safe-right))
    0
    max(14px, var(--ios-safe-left));
  background: rgba(243, 239, 230, 0.94);
}

html.ios-app .menu-button {
  display: none;
}

html.ios-app .crumb span,
html.ios-app .crumb svg {
  display: none;
}

html.ios-app .crumb strong {
  font-size: 12px;
  letter-spacing: 0.04em;
}

html.ios-app .topbar-actions {
  gap: 2px;
}

html.ios-app .icon-button {
  width: 42px;
  height: 42px;
}

html.ios-app .main-scroll {
  min-height: calc(var(--visual-vh, 100dvh) - 54px - var(--ios-safe-top));
  padding-bottom: calc(68px + var(--ios-safe-bottom));
}

html.ios-app .view {
  min-height: calc(var(--visual-vh, 100dvh) - 54px - var(--ios-safe-top));
}

html.ios-app .home-view {
  width: 100%;
  max-width: 520px;
  padding: 28px 16px 24px;
}

html.ios-app .hero {
  max-width: none;
}

html.ios-app .eyebrow {
  gap: 9px;
  font-size: 8px;
  letter-spacing: 0.16em;
}

html.ios-app .hero h1 {
  margin: 13px 0 13px;
  font-size: clamp(34px, 9.2vw, 42px);
  letter-spacing: -0.045em;
  line-height: 1.16;
}

html.ios-app .hero-intro {
  max-width: none;
  margin-bottom: 20px;
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1.72;
}

html.ios-app .search-panel {
  border-radius: 18px;
  box-shadow: 0 16px 38px rgba(38, 45, 37, 0.1);
}

html.ios-app .search-topline {
  min-height: 0;
  flex-wrap: wrap;
  gap: 9px;
  padding: 10px 11px 9px;
}

html.ios-app .mode-switch {
  width: 100%;
}

html.ios-app .mode-option {
  min-height: 38px;
  flex: 1;
  padding: 8px 5px;
  font-size: 13px;
}

html.ios-app .search-options {
  display: none;
}

html.ios-app .source-toggle {
  display: none;
}

html.ios-app .language-picker select {
  min-height: 38px;
  max-width: 138px;
  padding: 7px 24px 7px 10px;
  font-size: 16px;
}

html.ios-app .source-toggle {
  min-height: 38px;
  font-size: 12px;
}

html.ios-app .source-toggle > span:last-child {
  display: inline;
}

html.ios-app .toggle-track {
  width: 34px;
  height: 20px;
}

html.ios-app .toggle-track i {
  width: 16px;
  height: 16px;
}

html.ios-app .source-toggle input:checked + .toggle-track i {
  transform: translateX(14px);
}

html.ios-app .search-row {
  min-height: 70px;
  padding: 9px 10px 9px 15px;
}

html.ios-app .search-row textarea,
html.ios-app .compact-search input,
html.ios-app .lexicon-search input,
html.ios-app .key-input-row input {
  font-size: 16px;
}

html.ios-app .search-row textarea {
  overflow-y: hidden;
  overscroll-behavior: contain;
  touch-action: manipulation;
}

html.ios-app .search-row textarea.is-scrollable {
  overflow-y: auto;
  touch-action: pan-y;
}

html.ios-app .search-row textarea::placeholder {
  font-size: 14px;
}

html.ios-app .search-submit {
  width: 48px;
  height: 48px;
  justify-content: center;
  padding: 0;
  border-radius: 14px;
}

html.ios-app .search-submit span {
  display: none;
}

html.ios-app .search-submit svg {
  width: 20px;
}

html.ios-app .inline-suggestions {
  max-height: min(43dvh, 350px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

html.ios-app .inline-suggestion {
  gap: 9px;
  padding: 12px 10px;
}

html.ios-app .suggestion-heading strong {
  font-size: 19px;
}

html.ios-app .suggestion-heading em {
  font-size: 11px;
}

html.ios-app .suggestion-copy b {
  margin-top: 4px;
  font-size: 13px;
}

html.ios-app .suggestion-copy small {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.6;
}

html.ios-app .suggestion-score {
  padding-top: 3px;
  font-size: 10px;
}

html.ios-app .examples {
  overflow-x: auto;
  flex-wrap: nowrap;
  padding: 10px 11px 12px;
  scrollbar-width: none;
}

html.ios-app .examples::-webkit-scrollbar {
  display: none;
}

html.ios-app .examples button {
  min-height: 34px;
  flex: 0 0 auto;
  font-size: 11px;
}

html.ios-app .home-lower {
  margin-top: 20px;
}

html.ios-app .feature-panel,
html.ios-app .recent-panel {
  padding-right: 17px;
  padding-left: 17px;
}

html.ios-app .home-footer {
  padding-bottom: calc(8px + var(--ios-safe-bottom));
}

html.ios-app .result-view {
  padding: 14px 12px 26px;
}

html.ios-app .result-toolbar {
  gap: 7px;
}

html.ios-app .back-button {
  min-height: 40px;
  font-size: 12px;
}

html.ios-app .compact-search {
  min-height: 44px;
  flex-basis: 100%;
  order: 3;
  max-width: none;
}

html.ios-app .compact-search button {
  min-width: 56px;
  height: 36px;
  font-size: 12px;
}

html.ios-app .tool-button {
  width: 42px;
  height: 42px;
  justify-content: center;
  padding: 0;
  font-size: 0;
}

html.ios-app .tool-button svg {
  width: 18px;
  height: 18px;
}

html.ios-app .query-context {
  margin: 18px 4px 12px;
  gap: 9px;
}

html.ios-app .query-context h2 {
  min-width: 0;
  font-size: 18px;
}

html.ios-app .entry-sheet {
  min-height: 380px;
  padding: 24px 17px 26px;
  border-radius: 16px;
}

html.ios-app .headword-row h1 {
  font-size: clamp(34px, 10vw, 44px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

html.ios-app .word-meta {
  gap: 14px;
  font-size: 12px;
}

html.ios-app .entry-summary {
  margin-top: 17px;
  font-size: 16px;
  line-height: 1.78;
}

html.ios-app .entry-section {
  margin-top: 27px;
}

html.ios-app .section-heading h2 {
  font-size: 17px;
}

html.ios-app .sense-item {
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 11px;
  padding: 17px 0 19px;
}

html.ios-app .sense-number {
  width: 25px;
  height: 25px;
  font-size: 9px;
}

html.ios-app .sense-head h3 {
  font-size: 17px;
  line-height: 1.45;
}

html.ios-app .sense-domain {
  padding: 4px 6px;
  font-size: 10px;
}

html.ios-app .sense-definition {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

html.ios-app .sense-note {
  font-size: 13px;
  line-height: 1.7;
}

html.ios-app .sense-example .de {
  font-size: 15px;
}

html.ios-app .sense-example .zh {
  font-size: 13px;
}

html.ios-app .notes-list,
html.ios-app .confusion-item p,
html.ios-app .term-note p {
  font-size: 14px;
  line-height: 1.78;
}

html.ios-app .chip-list span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
}

html.ios-app .equivalent-item {
  min-height: 50px;
  align-items: center;
}

html.ios-app .equivalent-item strong {
  font-size: 15px;
}

html.ios-app .result-aside {
  gap: 10px;
}

html.ios-app .result-aside .sources-card {
  display: none;
}

html.ios-app .result-aside .engine-card {
  display: none;
}

html.ios-app .aside-card {
  padding: 17px;
}

html.ios-app .aside-card p,
html.ios-app .source-link,
html.ios-app .aside-empty {
  font-size: 12px;
  line-height: 1.7;
}

html.ios-app .collection-view,
html.ios-app .lexicon-view {
  padding: 31px 14px 24px;
}

html.ios-app .lexicon-view {
  padding-top: 23px;
}

html.ios-app .collection-header {
  margin-bottom: 25px;
}

html.ios-app .lexicon-header {
  margin-bottom: 21px;
}

html.ios-app .collection-title-row {
  align-items: flex-end;
  gap: 12px;
}

html.ios-app .collection-header h1 {
  font-size: 36px;
  line-height: 1.05;
}

html.ios-app .collection-header > p:last-child {
  max-width: 340px;
  font-size: 14px;
  line-height: 1.7;
}

html.ios-app .lexicon-header > p:last-child {
  max-width: 388px;
  font-size: 13.5px;
  line-height: 1.68;
}

html.ios-app .collection-clear {
  min-height: 36px;
  margin-bottom: 3px;
  padding: 0 11px;
  background: rgba(255, 251, 246, 0.82);
  font-size: 11px;
}

html.ios-app .collection-card {
  min-height: 164px;
  padding: 18px 17px;
}

html.ios-app .collection-card h2 {
  font-size: 25px;
}

html.ios-app .collection-card p {
  font-size: 13px;
}

html.ios-app .lexicon-search {
  min-height: 48px;
  height: 48px;
}

html.ios-app .lexicon-toolbar {
  align-items: stretch;
  gap: 10px;
  margin-bottom: 11px;
}

html.ios-app .lexicon-toolbar-meta {
  width: 100%;
  min-width: 0;
  justify-content: space-between;
}

html.ios-app .lexicon-toolbar-meta > span {
  font-size: 12px;
}

html.ios-app .lexicon-sort-picker {
  min-height: 36px;
  padding: 3px;
}

html.ios-app .lexicon-sort-picker > span {
  font-size: 10px;
}

html.ios-app .lexicon-sort-picker button {
  min-width: 42px;
  min-height: 29px;
  font-size: 10px;
}

html.ios-app .lexicon-filter-panel {
  margin-top: 2px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.62);
  box-shadow: 0 6px 18px rgba(34, 47, 40, 0.035);
}

html.ios-app .lexicon-filter-title {
  margin-bottom: 9px;
}

html.ios-app .lexicon-filter-title span,
html.ios-app .lexicon-subfilter-block > span {
  font-size: 11px;
}

html.ios-app .lexicon-filter-title small {
  font-size: 9.5px;
}

html.ios-app .lexicon-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  flex-wrap: wrap;
  margin-right: 0;
  margin-bottom: 7px;
  padding-right: 0;
  overflow: visible;
  gap: 7px;
}

html.ios-app .lexicon-filter {
  min-width: 0;
  min-height: 36px;
  padding: 7px 4px;
  font-size: 11.5px;
  white-space: nowrap;
}

html.ios-app .lexicon-subfilter-block {
  margin-top: 11px;
  padding-top: 10px;
}

html.ios-app .lexicon-subfilters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

html.ios-app .lexicon-subfilter {
  min-width: 0;
  min-height: 34px;
  padding: 6px 4px;
  overflow: hidden;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.ios-app .lexicon-alphabet {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
  margin: 9px -14px 16px;
  padding: 8px 14px 10px;
  overflow: visible;
  border-bottom: 1px solid rgba(208, 198, 182, 0.62);
  background: rgba(243, 239, 230, 0.72);
  backdrop-filter: blur(12px);
}

html.ios-app .lexicon-alpha-button {
  min-width: 0;
  height: 32px;
  padding: 0;
  border-radius: 10px;
  font-size: 12px;
}

html.ios-app .lexicon-letter-heading {
  margin-top: 10px;
  padding: 8px 2px 9px;
  background: rgba(243, 239, 230, 0.94);
  scroll-margin-top: calc(64px + var(--ios-safe-top));
}

html.ios-app .lexicon-letter-heading span {
  font-size: 26px;
}

html.ios-app .lexicon-letter-heading small {
  font-size: 10px;
}

html.ios-app .lexicon-card {
  min-width: 0;
  min-height: 178px;
}

html.ios-app .lexicon-card-open {
  min-width: 0;
  min-height: 176px;
  padding: 16px;
  overflow: hidden;
}

html.ios-app .lexicon-card-meta {
  font-size: 10px;
}

html.ios-app .lexicon-card h2 {
  font-size: 24px;
}

html.ios-app .lexicon-card h3 {
  font-size: 11px;
}

html.ios-app .lexicon-card p {
  font-size: 13px;
  line-height: 1.65;
}

html.ios-app .lexicon-variants span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  font-size: 10px;
}

html.ios-app .collection-list,
html.ios-app .lexicon-grid {
  grid-template-columns: minmax(0, 1fr);
}

html.ios-app .collection-card {
  min-width: 0;
}

html.ios-app .info-dialog {
  width: calc(100vw - 24px);
  max-height: calc(var(--visual-vh, 100dvh) - var(--ios-safe-top) - 24px);
  overflow-y: auto;
  padding: 31px 20px calc(20px + var(--ios-safe-bottom));
  border-radius: 20px;
}

html.ios-app .info-dialog h2 {
  padding-right: 28px;
  font-size: 26px;
}

html.ios-app .info-dialog > p:not(.dialog-kicker, .dialog-shortcut),
html.ios-app .dialog-notes > div {
  font-size: 14px;
}

html.ios-app .about-desktop-note,
html.ios-app .desktop-help {
  display: none;
}

html.ios-app .about-mobile-note {
  display: flex;
}

html.ios-app .dialog-mobile-help {
  display: block;
  margin-top: 19px;
  font-size: 13px;
}

html.ios-app .dialog-mobile-help strong {
  font-size: 13px;
}

html.ios-app .provider-row {
  min-height: 62px;
}

html.ios-app .key-form label {
  font-size: 12px;
}

html.ios-app .key-input-row {
  min-height: 48px;
}

html.ios-app .key-input-row button {
  min-width: 92px;
  min-height: 40px;
  font-size: 12px;
}

html.ios-app .primary-small,
html.ios-app .secondary-small,
html.ios-app .danger-small {
  min-height: 44px;
  font-size: 13px;
}

html.ios-app .confirm-dialog {
  width: calc(100vw - 28px);
  padding: 28px 21px calc(21px + var(--ios-safe-bottom));
}

html.ios-app .confirm-dialog h2 {
  font-size: 25px;
}

html.ios-app .confirm-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

html.ios-app .toast {
  bottom: calc(78px + var(--ios-safe-bottom));
  max-width: calc(100vw - 32px);
  padding: 11px 15px;
  font-size: 13px;
  text-align: center;
}

html.ios-app .ios-tabbar {
  position: fixed;
  z-index: 42;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: calc(62px + var(--ios-safe-bottom));
  padding:
    7px
    max(8px, var(--ios-safe-right))
    var(--ios-safe-bottom)
    max(8px, var(--ios-safe-left));
  border-top: 1px solid rgba(199, 190, 174, 0.7);
  background: rgba(250, 247, 239, 0.96);
  box-shadow: 0 -12px 30px rgba(32, 45, 37, 0.07);
  backdrop-filter: blur(22px) saturate(1.15);
}

html.ios-app .ios-tab-item {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  padding: 2px;
  color: #8b918b;
  border: 0;
  background: transparent;
  font-size: 10px;
  font-weight: 500;
}

html.ios-app .ios-tab-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.6;
}

html.ios-app .ios-tab-item.is-active {
  color: var(--forest);
}

html.ios-app .ios-tab-item.is-active::before {
  position: absolute;
  top: -8px;
  width: 28px;
  height: 2px;
  border-radius: 99px;
  background: var(--vermilion);
  content: "";
}

html.ios-app .ios-tab-item small {
  position: absolute;
  top: 0;
  left: calc(50% + 8px);
  min-width: 16px;
  padding: 1px 4px;
  color: #f8f5ed;
  border-radius: 99px;
  background: var(--vermilion);
  font-size: 8px;
  line-height: 1.4;
}

/* iPhone visual refinement */
html.ios-app {
  --font-serif: "Songti SC", "STSong", "New York", ui-serif, serif;
  --font-sans: "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at 88% 2%, rgba(180, 81, 61, 0.065), transparent 25%),
    linear-gradient(180deg, #f7f4ed 0%, var(--paper) 38%, #f1ede4 100%);
}

html.ios-app body {
  color: #1b2922;
  background: transparent;
  font-family: var(--font-sans);
}

html.ios-app .topbar {
  border-bottom-color: rgba(199, 190, 174, 0.42);
  background: rgba(247, 244, 237, 0.88);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(24px) saturate(1.15);
}

html.ios-app .crumb strong {
  color: #24352d;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

html.ios-app .icon-button {
  color: #52645b;
  border-color: rgba(201, 191, 175, 0.62);
  background: rgba(255, 253, 248, 0.56);
  box-shadow: 0 3px 12px rgba(31, 47, 39, 0.035);
}

html.ios-app .home-view {
  padding-top: 25px;
}

html.ios-app .eyebrow {
  color: #947b56;
  font-size: 8.5px;
  font-weight: 650;
  letter-spacing: 0.19em;
}

html.ios-app .eyebrow-line {
  width: 24px;
}

html.ios-app .hero h1 {
  margin: 14px 0;
  font-size: clamp(32px, 8.5vw, 37px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.17;
  text-wrap: balance;
}

html.ios-app .hero h1 em {
  display: inline-block;
  color: #a84c39;
  font-weight: 500;
  letter-spacing: -0.04em;
}

html.ios-app .hero-intro {
  max-width: 390px;
  margin-bottom: 19px;
  color: #68736c;
  font-size: 13.5px;
  line-height: 1.72;
}

html.ios-app .search-panel {
  border-color: rgba(188, 177, 158, 0.72);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.98), rgba(252, 249, 242, 0.97));
  box-shadow:
    0 18px 44px rgba(35, 48, 40, 0.105),
    0 2px 6px rgba(35, 48, 40, 0.035);
}

html.ios-app .search-panel:focus-within {
  border-color: rgba(139, 119, 87, 0.82);
  box-shadow:
    0 18px 44px rgba(35, 48, 40, 0.12),
    0 0 0 4px rgba(179, 139, 78, 0.07);
}

html.ios-app .search-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom-color: #ebe4d7;
}

html.ios-app .mode-switch {
  width: auto;
  min-width: 0;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(214, 205, 190, 0.7);
  border-radius: 12px;
  background: rgba(239, 235, 226, 0.78);
}

html.ios-app .mode-option {
  min-height: 33px;
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

html.ios-app .mode-option.is-active {
  color: #20392f;
  background: #fffdf8;
  box-shadow:
    0 2px 7px rgba(39, 52, 44, 0.09),
    inset 0 0 0 1px rgba(214, 204, 188, 0.55);
}

html.ios-app .search-options {
  width: auto;
  margin-left: auto;
}

html.ios-app .language-picker select {
  min-height: 34px;
  max-width: 118px;
  padding: 6px 22px 6px 9px;
  color: #365046;
  border-color: rgba(207, 197, 181, 0.82);
  border-radius: 10px;
  background:
    linear-gradient(45deg, transparent 50%, #7b887f 50%) calc(100% - 9px) 50% / 4px 4px no-repeat,
    linear-gradient(135deg, #7b887f 50%, transparent 50%) calc(100% - 6px) 50% / 4px 4px no-repeat,
    #fffdf8;
  font-size: 16px;
}

html.ios-app .search-row {
  min-height: 64px;
  padding: 6px 8px 6px 14px;
}

html.ios-app .search-icon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  color: #7c8a81;
}

html.ios-app .search-row textarea {
  min-width: 0;
  padding: 9px 4px;
  color: #20352b;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 450;
  line-height: 1.42;
  caret-color: var(--vermilion);
  cursor: text;
  touch-action: auto;
  user-select: text;
  -webkit-user-select: text;
}

/* Keep the one-line lookup field inside its card. Short terms must never
   become a nested vertical scroller; only an intentionally long draft may
   scroll internally after `autoResizeTextarea` adds `is-scrollable`. */
html.ios-app .search-row textarea:not(.is-scrollable) {
  overflow-y: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

html.ios-app .search-row textarea.is-scrollable {
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none;
}

html.ios-app .search-row textarea.is-scrollable::-webkit-scrollbar {
  display: none;
}

html.ios-app .search-row textarea::placeholder {
  color: #949c96;
  font-size: 13.5px;
  font-weight: 400;
}

html.ios-app .search-submit {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, #1e493d, #15372f);
  box-shadow: 0 8px 18px rgba(23, 59, 50, 0.2);
}

html.ios-app .search-submit:active {
  transform: scale(0.96);
}

html.ios-app .examples {
  gap: 7px;
  padding: 9px 10px 10px;
  border-top: 1px solid #eee7da;
  background: rgba(249, 246, 238, 0.72);
}

html.ios-app .examples > span {
  color: #9b9487;
  font-size: 9px;
  letter-spacing: 0.08em;
}

html.ios-app .examples button {
  min-height: 31px;
  padding: 5px 10px;
  color: #596860;
  border-color: rgba(207, 198, 182, 0.75);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.72);
  font-size: 11px;
}

html.ios-app .home-lower {
  margin-top: 18px;
}

html.ios-app .feature-panel,
html.ios-app .recent-panel {
  border-color: rgba(210, 200, 184, 0.75);
  border-radius: 20px;
  background-color: rgba(255, 253, 248, 0.78);
  box-shadow: 0 8px 24px rgba(34, 47, 40, 0.045);
}

html.ios-app .recent-panel:has(.recent-empty) {
  display: none;
}

html.ios-app .feature-title-row strong {
  font-size: clamp(29px, 8vw, 35px);
  font-weight: 500;
}

html.ios-app .feature-description {
  font-size: 13px;
  line-height: 1.72;
}

html.ios-app .ios-tabbar {
  min-height: calc(64px + var(--ios-safe-bottom));
  padding-top: 6px;
  border-top-color: rgba(198, 188, 172, 0.55);
  background: rgba(252, 250, 245, 0.95);
  box-shadow: 0 -14px 35px rgba(30, 44, 36, 0.075);
}

html.ios-app .ios-tab-item {
  min-height: 52px;
  gap: 2px;
  margin: 0 3px;
  border-radius: 13px;
  font-size: 10.5px;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

html.ios-app .ios-tab-item:active {
  transform: scale(0.96);
}

html.ios-app .ios-tab-item.is-active {
  color: #173b32;
  background: linear-gradient(180deg, #edf1eb, rgba(239, 242, 236, 0.36));
}

html.ios-app .ios-tab-item.is-active::before {
  top: 2px;
  width: 20px;
  height: 2px;
  background: var(--vermilion);
}

html.ios-app .ios-tab-item svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.7;
}

html.ios-app.is-keyboard-open .ios-tabbar {
  display: none;
}

html.ios-app.is-keyboard-open .main-scroll {
  padding-bottom: 0;
}

html.ios-app.is-keyboard-open .toast {
  bottom: calc(18px + var(--ios-safe-bottom));
}

html.ios-app .result-view {
  padding-top: 12px;
}

html.ios-app .query-context {
  margin-top: 16px;
}

html.ios-app .query-label {
  padding: 4px 6px;
  border-radius: 5px;
  background: #eee7db;
  font-size: 8px;
}

html.ios-app .query-context h2 {
  color: #26372f;
  font-size: 17px;
}

html.ios-app .entry-sheet {
  border-color: rgba(208, 198, 182, 0.72);
  border-radius: 22px;
  background:
    linear-gradient(rgba(255, 253, 248, 0.978), rgba(255, 253, 248, 0.978)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 29px,
      rgba(23, 59, 50, 0.035) 29px,
      rgba(23, 59, 50, 0.035) 30px
    );
  box-shadow: 0 12px 34px rgba(34, 48, 39, 0.07);
}

html.ios-app .entry-summary {
  color: #536158;
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.78;
  text-wrap: pretty;
}

html.ios-app .section-heading h2 {
  color: #26382f;
  font-size: 17px;
  letter-spacing: 0.01em;
}

html.ios-app .sense-head h3 {
  color: #26382f;
  font-size: 17px;
  font-weight: 600;
}

html.ios-app .sense-domain {
  color: #876a43;
  background: #f1e6d1;
}

html.ios-app .sense-definition {
  color: #536158;
  font-size: 15px;
  line-height: 1.84;
  text-wrap: pretty;
}

html.ios-app .sense-note {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(244, 235, 221, 0.62);
}

html.ios-app .equivalent-item {
  min-height: 48px;
  padding: 11px 12px;
}

html.ios-app .equivalent-item span {
  font-size: 11px;
}

html.ios-app .equivalent-item strong {
  font-size: 14px;
}

html.ios-app .related-term-button {
  min-height: 58px;
  padding: 13px 12px;
}

html.ios-app .related-term-button strong {
  font-size: 15px;
}

html.ios-app .related-term-button small {
  font-size: 13px;
  line-height: 1.7;
}

html.ios-app .reference-note {
  font-size: 12px;
  line-height: 1.75;
}

html.ios-app .reference-links a {
  min-height: 48px;
  padding: 10px 12px;
  font-size: 13px;
}

html.ios-app .aside-card {
  border-color: rgba(211, 201, 185, 0.7);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.72);
}

html.ios-app .collection-header h1,
html.ios-app .lexicon-header h1 {
  color: #26372f;
  font-weight: 550;
  letter-spacing: -0.035em;
}

html.ios-app .lexicon-search {
  border-color: rgba(208, 198, 182, 0.76);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.76);
}

html.ios-app .lexicon-filter {
  color: #5e6c64;
  border-color: rgba(207, 198, 182, 0.76);
  background: rgba(255, 253, 248, 0.58);
}

html.ios-app .lexicon-filter.is-active {
  border-color: #173b32;
  background: #173b32;
  box-shadow: 0 5px 14px rgba(23, 59, 50, 0.16);
}

html.ios-app .lexicon-card {
  border-color: rgba(208, 198, 182, 0.72);
  border-radius: 16px;
  background:
    linear-gradient(rgba(255, 253, 248, 0.94), rgba(255, 253, 248, 0.94)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 23px,
      rgba(23, 59, 50, 0.03) 23px,
      rgba(23, 59, 50, 0.03) 24px
    );
  box-shadow: 0 6px 18px rgba(34, 47, 40, 0.035);
}

html.ios-app .lexicon-card h2 {
  color: #22362c;
  font-weight: 550;
}

html.ios-app .lexicon-card p {
  color: #5f6c64;
}

@media (max-width: 370px) {
  html.ios-app .hero h1 {
    font-size: 32px;
  }

  html.ios-app .hero-intro {
    font-size: 13px;
  }

  html.ios-app .entry-sheet {
    padding-right: 14px;
    padding-left: 14px;
  }

  html.ios-app .source-toggle > span:last-child {
    display: none;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  html.ios-app .ios-tabbar {
    display: grid;
  }

  html.ios-app .home-view {
    max-width: 760px;
    padding-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.ios-app {
    scroll-behavior: auto;
  }
}

/* 1.9.5 mobile brand and larger reading type */
html.ios-app .mobile-brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  margin-right: 7px;
  color: var(--forest);
  border: 1px solid rgba(31, 61, 50, 0.16);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.62);
}

html.ios-app .mobile-brand-mark svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

html.ios-app .topbar-left {
  gap: 2px;
}

html.ios-app .hero h1 {
  margin: 6px 0 26px;
  font-size: clamp(38px, 10.2vw, 48px);
  line-height: 1.14;
}

html.ios-app .search-mode-label {
  padding: 8px 13px;
  font-size: 13px;
}

html.ios-app .search-row textarea {
  font-size: 18px;
}

html.ios-app .entry-summary {
  font-size: 17px;
  line-height: 1.8;
}

html.ios-app .sense-head h3 {
  font-size: 18px;
}

html.ios-app .sense-definition {
  font-size: 16px;
  line-height: 1.82;
}

html.ios-app .section-heading h2 {
  font-size: 18px;
}

html.ios-app .notes-list li {
  font-size: 15px;
  line-height: 1.8;
}

html.ios-app .ios-tab-item {
  font-size: 11px;
}

html.ios-app .search-topline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* 1.9.6 focused search landing page */
html.ios-app .home-view {
  display: flex;
  min-height: calc(100dvh - 128px);
  flex-direction: column;
  padding: 8px 14px 0;
}

html.ios-app .hero {
  width: 100%;
  margin: auto;
  padding: 8px 0 0;
  text-align: center;
}

html.ios-app .hero h1 {
  margin: 0 0 26px;
  font-size: clamp(38px, 10vw, 46px);
  line-height: 1.1;
  text-align: center;
}

html.ios-app .hero-rule {
  margin: 0 auto 17px;
}

html.ios-app .search-panel {
  max-width: none;
  border-radius: 22px;
}

html.ios-app .search-row {
  min-height: 68px;
  padding: 6px 8px 6px 16px;
}

html.ios-app .search-row textarea {
  font-size: 18px;
}

html.ios-app .search-submit {
  width: 46px;
  height: 46px;
  padding: 0;
  justify-content: center;
}

html.ios-app .search-submit span {
  display: none;
}

html.ios-app .search-meta {
  padding: 0 16px 8px;
}

html.ios-app .search-mode-label {
  font-size: 11px;
}

html.ios-app .search-options,
html.ios-app .source-toggle {
  display: none;
}

html.ios-app .examples {
  padding: 10px 13px 12px;
  gap: 5px;
}

html.ios-app .examples button {
  padding: 5px 9px;
  font-size: 11px;
}

html.ios-app .home-footer {
  display: none;
}

/* 1.9.7 iPhone landing: atmospheric backdrop, title high, search anchored low */
html.ios-app .home-view {
  position: relative;
  display: flex;
  min-height: calc(var(--visual-vh, 100dvh) - 54px - var(--ios-safe-top));
  flex-direction: column;
  overflow: hidden;
  padding: 18px 16px calc(96px + var(--ios-safe-bottom));
  background:
    radial-gradient(115% 68% at 96% -2%, rgba(184, 143, 87, 0.16), transparent 58%),
    radial-gradient(95% 58% at -8% 102%, rgba(31, 61, 50, 0.09), transparent 62%),
    linear-gradient(180deg, #f8f4eb 0%, #f4efe5 52%, #f1ece1 100%);
}

html.ios-app .home-view::before {
  position: absolute;
  top: -118px;
  right: -128px;
  width: 338px;
  height: 338px;
  border: 1px solid rgba(169, 127, 68, 0.18);
  border-radius: 50%;
  box-shadow:
    0 0 0 34px rgba(169, 127, 68, 0.04),
    0 0 0 76px rgba(169, 127, 68, 0.025);
  content: "";
  pointer-events: none;
}

html.ios-app .home-view::after {
  position: absolute;
  bottom: -46px;
  left: -92px;
  width: 286px;
  height: 286px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(35, 68, 55, 0.08), transparent 68%);
  content: "";
  pointer-events: none;
}

html.ios-app .ios-home-art {
  position: absolute;
  z-index: 0;
  top: 228px;
  left: 50%;
  display: block;
  width: min(360px, 92vw);
  opacity: 0.86;
  pointer-events: none;
  transform: translateX(-50%) rotate(-3deg);
}

html.ios-app .ios-home-art svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

html.ios-app .ios-home-art .staff-lines,
html.ios-app .ios-home-art .double-bar {
  stroke: rgba(31, 61, 50, 0.13);
  stroke-width: 1.1;
}

html.ios-app .ios-home-art .staff-notes {
  fill: rgba(166, 116, 55, 0.55);
}

html.ios-app .ios-home-art .stem,
html.ios-app .ios-home-art .flag {
  stroke: rgba(166, 116, 55, 0.5);
  stroke-width: 1.4;
  stroke-linecap: round;
}

html.ios-app .hero {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  flex: 1;
  flex-direction: column;
  margin: 0;
  padding: 0;
  text-align: center;
}

html.ios-app .hero-rule {
  width: 34px;
  margin: 6px auto 15px;
}

html.ios-app .hero h1 {
  margin: 0 auto;
  font-size: clamp(46px, 12.8vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.05em;
  text-align: center;
}

html.ios-app .search-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  margin-top: auto;
  border-color: rgba(190, 178, 157, 0.76);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(252, 248, 240, 0.97));
  box-shadow:
    0 26px 58px rgba(32, 45, 37, 0.15),
    0 3px 8px rgba(32, 45, 37, 0.045);
}

html.ios-app .search-row {
  min-height: 88px;
  padding: 8px 9px 8px 20px;
}

html.ios-app .search-icon {
  width: 25px;
  height: 25px;
  margin-right: 12px;
}

html.ios-app .search-row textarea {
  font-size: 21px;
}

html.ios-app .search-row textarea::placeholder {
  font-size: 15px;
}

html.ios-app .search-submit {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(23, 59, 50, 0.2);
}

html.ios-app .search-submit svg {
  width: 21px;
}

html.ios-app .search-meta {
  padding: 0 20px 12px;
}

html.ios-app .search-mode-label {
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.14em;
}

html.ios-app .search-mode-label::before {
  width: 20px;
}

html.ios-app .examples {
  gap: 7px;
  padding: 13px 18px 16px;
}

html.ios-app .examples > span {
  font-size: 10px;
}

html.ios-app .examples button {
  padding: 6px 10px;
  font-size: 12px;
}

html.ios-app.is-keyboard-open .home-view {
  min-height: calc(var(--visual-vh, 100dvh) - 54px - var(--ios-safe-top));
  padding-bottom: 14px;
}

html.ios-app.is-keyboard-open .hero h1 {
  font-size: clamp(34px, 9vw, 42px);
}

html.ios-app.is-keyboard-open .hero-rule {
  margin-bottom: 11px;
}

html.ios-app.is-keyboard-open .ios-home-art {
  opacity: 0.35;
}

@media (orientation: landscape) and (max-height: 500px) {
  html.ios-app .home-view {
    min-height: calc(var(--visual-vh, 100dvh) - 54px);
    padding: 8px 26px 74px;
  }

  html.ios-app .ios-home-art {
    display: none;
  }

  html.ios-app .hero-rule {
    width: 28px;
    margin: 2px auto 10px;
  }

  html.ios-app .hero h1 {
    font-size: 31px;
    letter-spacing: -0.04em;
  }

  html.ios-app .search-panel {
    max-width: 680px;
    margin-right: auto;
    margin-left: auto;
    border-radius: 22px;
  }

  html.ios-app .search-row {
    min-height: 64px;
    padding: 5px 7px 5px 16px;
  }

  html.ios-app .search-row textarea {
    font-size: 17px;
  }

  html.ios-app .search-submit {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  html.ios-app .search-meta {
    padding: 0 16px 8px;
  }

  html.ios-app .examples {
    padding: 8px 14px 10px;
  }
}

/* 1.9.8 calmer iPhone backdrop, fixed home, settings via brand mark */
html.ios-app.is-home-view body {
  height: var(--visual-vh, 100dvh);
  overflow: hidden;
}

html.ios-app.is-home-view .main-scroll {
  height: calc(var(--visual-vh, 100dvh) - 54px - var(--ios-safe-top));
  min-height: 0;
  padding-bottom: 0;
  overflow: hidden;
}

html.ios-app.is-home-view .home-view {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

html.ios-app .home-view {
  padding: 26px 16px calc(96px + var(--ios-safe-bottom));
  background:
    radial-gradient(120% 76% at 92% -8%, rgba(214, 192, 162, 0.18), transparent 58%),
    radial-gradient(100% 68% at -10% 108%, rgba(186, 201, 190, 0.18), transparent 62%),
    linear-gradient(180deg, #fbf8f2 0%, #f6f1e7 55%, #f2ecdf 100%);
}

html.ios-app .home-view::before,
html.ios-app .home-view::after,
html.ios-app .ios-home-art {
  display: none;
}

html.ios-app .hero-rule {
  margin: 8px auto 18px;
}

html.ios-app .hero h1 {
  font-size: clamp(46px, 12.8vw, 56px);
}

html.ios-app .search-panel {
  margin-top: auto;
}

html.ios-app #providerButton {
  display: none;
}

html.ios-app .mobile-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  margin-right: 8px;
  padding: 0;
  color: #f7ecd9;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 11px;
  background: linear-gradient(145deg, #2b5b4c, #173b32);
  box-shadow: 0 6px 14px rgba(23, 59, 50, 0.18);
  cursor: pointer;
}

html.ios-app .mobile-brand-mark svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.5;
}

html.ios-app .mobile-brand-mark:active {
  transform: translateY(1px);
}

html.ios-app .result-toolbar-actions {
  gap: 8px;
}

html.ios-app .tool-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  color: #5c6a61;
  border: 1px solid rgba(201, 191, 175, 0.55);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
  line-height: 0;
  font-size: 0;
}

html.ios-app .tool-button svg {
  display: block;
  width: 18px;
  height: 18px;
}

html.ios-app .tool-button:focus {
  outline: none;
}

html.ios-app .tool-button:focus-visible {
  outline: 2px solid rgba(174, 139, 84, 0.55);
  outline-offset: 2px;
}

html.ios-app .tool-button.is-saved {
  color: var(--vermilion);
  border-color: rgba(184, 81, 61, 0.2);
  background: rgba(184, 81, 61, 0.08);
}

html.ios-app.is-keyboard-open .home-view {
  height: 100%;
  padding: 20px 16px 14px;
}

html.ios-app.is-keyboard-open .hero h1 {
  font-size: clamp(34px, 9vw, 40px);
}
