/* Npaper reader — phone app (mobile.js), to the NHBR mobile design (MOBILE.md).
   Loaded for screens under 700px; every rule is scoped to .m-app. */

.m-app {
  --m-green: #0d4a3c; --m-lime: #c6e01e; --m-navy: #344f72; --m-teal: #4acba5;
  --m-ink: #17171a; --m-muted: #6b6b72; --m-muted-2: #55555b; --m-faint: #8a8a90;
  --m-stage: #edebe6; --m-fill: #f4f2ee; --m-line: #e7e5e0; --m-line-2: #eeece7; --m-line-3: #dedbd4;
  --m-pill: #dff2ea; --m-hl: #e4ef9a; --m-tint: #e6f5ef;
  --m-sans: 'Geist', system-ui, -apple-system, sans-serif; --m-serif: 'Newsreader', Georgia, serif; --m-mono: 'Geist Mono', ui-monospace, monospace;
  --m-safe: env(safe-area-inset-bottom, 0px);
  position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  background: #fff; color: var(--m-ink); font-family: var(--m-sans); font-size: 15px;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
}
.m-app :where(*, *::before, *::after) { box-sizing: border-box; }
.m-app [hidden] { display: none !important; }
/* Resets carry no weight (:where), so the component classes below always win */
.m-app :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
.m-app :where(a) { color: inherit; text-decoration: none; }
.m-app :where(input, select) { font: inherit; font-size: 16px; color: inherit; }
.m-app :focus-visible { outline: 2px solid var(--m-green); outline-offset: 2px; }
.m-field input:focus-visible, .m-afield input:focus-visible { outline: none; }
.m-app svg { flex: none; }
.m-flex { flex: 1; }
.m-muted { color: var(--m-muted); font-size: 13.5px; }

/* ---- top bar (46px, no logo) ---- */
.m-top { height: 46px; flex: none; display: flex; align-items: center; padding: 0 2px 0 4px; border-bottom: 1px solid var(--m-line); background: #fff; position: relative; z-index: 20; padding-top: env(safe-area-inset-top, 0px); box-sizing: content-box; }
/* Logo, divider, issue date (left to right) */
.m-logo { margin-left: 10px; flex: none; font-family: var(--m-sans); font-size: 19px; font-weight: 700; font-style: italic; letter-spacing: -.035em; line-height: 1; white-space: nowrap; }
.m-logo span:first-child { color: var(--m-navy); }
.m-logo span:last-child { color: var(--m-teal); }
.m-divider { width: 1px; height: 18px; background: #dedbd4; margin: 0 4px 0 10px; flex: none; }
.m-issue { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 8px; border-radius: 10px; font-size: 14px; font-weight: 500; color: #33333a; white-space: nowrap; flex: none; }
@media (max-width: 339px) { .m-logo { font-size: 17px; } }
.m-issue:disabled { cursor: default; }
.m-caret { color: var(--m-faint); }
.m-ib { position: relative; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.m-ib.is-on { color: var(--m-green); }
.m-ib--dim { color: var(--m-faint); }
.m-badge { position: absolute; top: 6px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--m-green); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; }

/* ---- content panes ---- */
.m-main { flex: 1; min-height: 0; position: relative; }
.m-pane { position: absolute; inset: 0; display: none; }
.m-pane.is-on { display: flex; flex-direction: column; }
.m-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.m-pane.m-scroll.is-on { display: block; }

/* ---- bottom tab bar (48px + safe area) ---- */
.m-tabs { flex: none; display: flex; border-top: 1px solid var(--m-line); background: #fff; padding: 2px 4px calc(2px + var(--m-safe)); position: relative; z-index: 20; }
.m-tab { flex: 1; min-width: 0; height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--m-muted-2); }
.m-tab-ic { width: 50px; height: 26px; border-radius: 999px; display: grid; place-items: center; }
.m-tab-t { font-size: 10.5px; font-weight: 500; white-space: nowrap; }
.m-tab.is-on { color: var(--m-green); }
.m-tab.is-on .m-tab-ic { background: var(--m-pill); }
.m-tab.is-on .m-tab-t { font-weight: 600; }

/* ---- Pages tab ---- */
.m-pages { background: var(--m-stage); }
.m-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.m-track { position: absolute; inset: 0; will-change: transform; }
.m-page { position: absolute; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 12px 28px rgba(0, 0, 0, .12); }
.m-page img { width: 100%; height: 100%; display: block; pointer-events: none; }
.m-areas, .m-hls { position: absolute; inset: 0; }
/* Only the tapped region shows, with a light 1px border that fades out (operators: overlapping boxes looked heavy) */
.m-area { position: absolute; border-radius: 3px; background: rgba(74, 203, 165, 0); outline: 1px solid rgba(13, 74, 60, 0); transition: background-color .3s ease, outline-color .3s ease; }
.m-area.is-tap { background: rgba(74, 203, 165, .1); outline-color: rgba(13, 74, 60, .4); transition: none; }
.m-hls i { position: absolute; background: rgba(255, 224, 102, .7); mix-blend-mode: multiply; border-radius: 2px; pointer-events: none; }
.m-zoom { position: absolute; inset: 0; overflow: auto; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; scrollbar-width: none; background: var(--m-stage); }
.m-zpage { position: relative; margin: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.m-zpage img { width: 100%; height: 100%; display: block; }
.m-fitbtn { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); height: 44px; padding: 0 18px; border-radius: 999px; background: var(--m-ink); color: #fff !important; font-size: 14.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; white-space: nowrap; z-index: 3; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.m-pagebar { height: 46px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 4px; background: #fff; border-top: 1px solid var(--m-line); }
.m-pb-btn { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px; border-radius: 10px; font-size: 15.5px; font-weight: 500; }
.m-pb-btn.is-off { opacity: .35; }
.m-pb-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 44px; padding: 0 14px; border-radius: 10px; min-width: 0; }
.m-pb-mid b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.m-pb-mid span { font-size: 11px; color: var(--m-muted); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }

/* first-time tips */
.m-tips { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 5; background: #fff; border-radius: 18px; box-shadow: 0 14px 40px rgba(0, 0, 0, .22); padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 12px; }
.m-tips-h { font-family: var(--m-serif); font-size: 21px; font-weight: 600; line-height: 1.15; }
.m-tip { display: flex; align-items: center; gap: 14px; font-size: 15px; line-height: 1.35; }
.m-tip b { font-weight: 600; }
.m-tip-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--m-tint); color: var(--m-green); display: grid; place-items: center; flex: none; }

/* ---- buttons ---- */
.m-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 0 16px; border-radius: 14px; font-size: 15.5px; font-weight: 600; text-align: center; }
.m-btn--go { background: var(--m-green); color: #fff; }
.m-btn--line { border: 1.5px solid var(--m-ink); }
.m-link { color: var(--m-green); font-size: 14.5px; font-weight: 500; min-height: 40px; white-space: nowrap; }
.m-pad { padding: 20px 20px 32px; }

/* ---- lists ---- */
.m-head { padding: 22px 16px 10px; display: flex; flex-direction: column; gap: 4px; }
.m-head span { font-size: 15px; color: var(--m-muted); line-height: 1.4; }
.m-head--a { gap: 6px; }
.m-head--a span { color: var(--m-muted-2); }
.m-h1 { margin: 0; font-family: var(--m-serif); font-size: 31px; font-weight: 600; line-height: 1.05; letter-spacing: -.01em; }
.m-label { padding: 18px 16px 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--m-muted); }
.m-list { padding: 0 16px 28px; display: flex; flex-direction: column; }
.m-list--tight { padding: 0 8px 28px; }
.m-empty { padding: 30px 16px; font-size: 15.5px; line-height: 1.5; color: var(--m-muted-2); }
.m-card { margin: 12px 16px; padding: 22px; border-radius: 16px; background: var(--m-fill); display: flex; flex-direction: column; gap: 8px; }
.m-card b { font-size: 16px; }
.m-card span { font-size: 15px; line-height: 1.5; color: var(--m-muted-2); }
.m-kicker { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--m-green); }
.m-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--m-muted); }
.m-meta b { font-weight: 600; color: var(--m-ink); }
.m-sv { color: var(--m-green); }
.m-chev { color: #b5b3ad; }
.m-count { font-size: 13.5px; color: var(--m-muted); white-space: nowrap; }
.m-mini { width: 40px; height: 50px; object-fit: cover; object-position: top; flex: none; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.m-mini--blank { display: block; background: var(--m-fill); }

/* chips */
.m-chips { position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 1px solid var(--m-line-2); display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
.m-chips::-webkit-scrollbar, .m-years::-webkit-scrollbar { display: none; }
.m-chips--flat { position: static; border: 0; padding: 0; flex-wrap: wrap; }
.m-chip { height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14.5px; font-weight: 500; white-space: nowrap; flex: none; background: var(--m-fill); display: inline-flex; align-items: center; gap: 8px; }
.m-chip.is-on { background: var(--m-ink); color: #fff; }
.m-chip--line { background: #fff; border: 1px solid var(--m-line-3); padding: 0 14px; }
.m-chip--line.is-on { background: var(--m-tint); color: var(--m-ink); border-color: var(--m-green); }
.m-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #b5b3ad; background: #fff; display: grid; place-items: center; color: #fff; font-size: 12px; line-height: 1; }
.is-on > .m-check { border-color: var(--m-green); background: var(--m-green); }

/* Articles tab */
.m-group { display: flex; align-items: center; gap: 8px; padding: 20px 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--m-muted); }
.m-group b { color: var(--m-green); font-weight: 600; }
.m-group i { width: 3px; height: 3px; border-radius: 999px; background: #b5b3ad; }
.m-lead { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 18px; border-bottom: 1px solid var(--m-line-2); width: 100%; }
.m-lead-img { display: block; width: 100%; height: 210px; border-radius: 12px; background: #e9e7e1 center / cover no-repeat; }
.m-lead .m-kicker { padding-top: 4px; }
.m-lead-h { font-family: var(--m-serif); font-size: 27px; font-weight: 600; line-height: 1.08; letter-spacing: -.01em; text-wrap: balance; }
.m-lead-d { font-family: var(--m-serif); font-size: 17px; line-height: 1.35; color: var(--m-muted-2); text-wrap: pretty; }
.m-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--m-line-2); align-items: start; width: 100%; }
.m-row-t { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.m-row-h { font-family: var(--m-serif); font-size: 19px; font-weight: 600; line-height: 1.18; text-wrap: pretty; overflow-wrap: anywhere; }
.m-row-th { width: 76px; height: 96px; overflow: hidden; border-radius: 6px; background: #e9e7e1; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); display: grid; place-items: center; }
.m-row-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-row-th img.m-mini { width: 62px; height: 78px; box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }

/* Writers / Advertisers */
.m-wrow, .m-arow { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 10px; border-radius: 14px; width: 100%; }
.m-arow { min-height: 70px; }
.m-wrow-t, .m-arow-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.m-wrow-t b { font-size: 17px; font-weight: 600; }
.m-arow-t b { font-size: 16.5px; font-weight: 600; line-height: 1.25; }
.m-av { width: 50px; height: 50px; border-radius: 999px; background: var(--m-green); color: var(--m-lime); display: grid; place-items: center; font-size: 16px; font-weight: 600; flex: none; }
.m-av--xl { width: 76px; height: 76px; font-size: 24px; }
.m-tile { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 15px; font-weight: 700; flex: none; }
.m-tile--ad { object-fit: cover; background: #e9e7e1; }
.m-letter { padding: 14px 10px 4px; font-family: var(--m-mono); font-size: 12px; color: var(--m-faint); }
.m-subbar { height: 52px; display: flex; align-items: center; padding: 0 6px; }
.m-back { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px; border-radius: 10px; font-size: 15.5px; font-weight: 500; color: var(--m-green); white-space: nowrap; }
.m-profile { padding: 4px 20px 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; border-bottom: 1px solid var(--m-line-2); }
.m-profile .m-h1 { font-size: 30px; }
.m-srow { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--m-line-2); width: 100%; }
.m-srow-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.m-sticky { position: sticky; top: 0; z-index: 2; background: #fff; padding: 10px 16px; }
.m-field { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px; background: var(--m-fill); border-radius: 12px; min-width: 0; flex: 1; color: var(--m-muted); }
.m-field--soft { height: 48px; padding: 0 14px; }
.m-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--m-ink); -webkit-appearance: none; appearance: none; }
.m-field input::-webkit-search-cancel-button { display: none; }
.m-clear { width: 30px; height: 30px; border-radius: 999px; background: #d9d6cf; color: #fff; display: grid; place-items: center; flex: none; }
.m-clear--dim { width: 36px; height: 36px; background: none; color: var(--m-faint); }

/* ---- Archive tab ---- */
.m-asearch { padding: 12px 16px 4px; display: flex; flex-direction: column; gap: 12px; }
.m-afield { display: flex; align-items: center; gap: 8px; height: 54px; padding: 0 6px 0 14px; border: 1.5px solid var(--m-ink); border-radius: 14px; }
.m-afield input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; -webkit-appearance: none; appearance: none; }
.m-afield input::-webkit-search-cancel-button { display: none; }
.m-asubmit { height: 42px; padding: 0 16px; border-radius: 10px; background: var(--m-green); color: #fff; font-size: 15px; font-weight: 600; flex: none; }
.m-years { position: sticky; top: 0; z-index: 2; background: #fff; display: flex; gap: 6px; overflow-x: auto; padding: 14px 16px 10px; border-bottom: 1px solid var(--m-line); scrollbar-width: none; margin-top: 8px; }
.m-years .m-chip { font-size: 15px; }
.m-months { padding: 0 16px 28px; }
.m-month { display: flex; flex-direction: column; gap: 12px; padding: 18px 0; border-bottom: 1px solid #f0eee9; }
.m-month h2 { margin: 0; font-family: var(--m-serif); font-size: 21px; font-weight: 600; }
.m-covers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 12px; }
.m-cover { display: flex; flex-direction: column; gap: 7px; }
.m-cover-img { display: block; aspect-ratio: .793; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .14), 0 6px 16px rgba(0, 0, 0, .07); }
.m-cover-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.m-cover-d { font-size: 13.5px; font-weight: 600; }
.m-rsum { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 4px; font-size: 15px; }
.m-res { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 18px 16px; border-bottom: 1px solid var(--m-line-2); width: 100%; }
.m-res-th { aspect-ratio: .793; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .16); align-self: start; }
.m-res-th img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.m-res-t { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.m-res-t .m-meta { font-size: 12.5px; }
.m-res-h { font-family: var(--m-serif); font-size: 19px; font-weight: 600; line-height: 1.2; }
.m-res-s { font-family: var(--m-serif); font-size: 16px; line-height: 1.45; color: #33333a; text-wrap: pretty; overflow-wrap: anywhere; }
.m-res-s mark { background: var(--m-hl); color: inherit; font-weight: 600; }
.m-rclip { position: relative; display: block; width: 100%; overflow: hidden; background: #fff; border: 1px solid #d4d4d4; box-shadow: 0 2px 4px rgba(0, 0, 0, .18); margin: 2px 0; }
.m-rclip img { width: 100%; height: 100%; display: block; }
.m-rclip i { position: absolute; background: rgba(160, 196, 245, .55); mix-blend-mode: multiply; box-shadow: 0 0 0 2px rgba(160, 196, 245, .55); }
.m-res-go { font-size: 14px; font-weight: 600; color: var(--m-green); padding-top: 2px; }
.m-more { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 20px 16px 32px; font-size: 14px; color: var(--m-muted); text-align: center; }
.m-more .m-btn { min-height: 44px; font-size: 14.5px; }

/* ---- full-screen layers ---- */
.m-layer { position: absolute; inset: 0; z-index: 60; background: #fff; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }
.m-lbar { height: 56px; flex: none; display: flex; align-items: center; gap: 2px; padding: 0 6px; border-bottom: 1px solid var(--m-line-2); }
/* Article bar: the logo sits centred between Back and the buttons */
.m-art .m-lbar { position: relative; }
.m-art .m-lbar .m-logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; pointer-events: none; }
@media (max-width: 374px) {
  .m-art .m-lbar .m-logo { position: static; transform: none; order: 1; font-size: 17px; margin-left: 2px; }
  .m-art .m-back { order: 0; padding-right: 4px; }
  .m-art .m-back span { display: none; }
  .m-art .m-lbar .m-flex { order: 2; }
  .m-art .m-lbar .m-ib { order: 3; }
}
.m-aa { font-family: var(--m-serif); font-size: 17px; font-weight: 600; }

/* article */
.m-art-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.m-art-body article { padding: 22px 20px 28px; display: flex; flex-direction: column; gap: 14px; }
.m-art-body .m-kicker { font-size: 12px; letter-spacing: .1em; }
.m-headline { margin: 0; font-family: var(--m-serif); font-size: var(--m-hs, 32px); line-height: 1.08; font-weight: 600; letter-spacing: -.015em; text-wrap: balance; overflow-wrap: anywhere; }
.m-deck { margin: 0; font-family: var(--m-serif); font-size: calc(var(--m-fs, 19px) + .5px); line-height: 1.35; color: var(--m-muted-2); text-wrap: pretty; }
.m-byline { display: flex; align-items: center; gap: 12px; padding: 6px 0 16px; border-bottom: 1px solid var(--m-line-2); }
.m-byline .m-av { width: 40px; height: 40px; font-size: 13.5px; }
.m-byline-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; color: var(--m-muted); }
.m-byline-t b, .m-byname { font-size: 15px; font-weight: 600; color: var(--m-ink); }
.m-byname { text-decoration: underline; text-decoration-color: var(--m-line-3); text-underline-offset: 3px; align-self: flex-start; }
.m-text { font-family: var(--m-serif); font-size: var(--m-fs, 19px); line-height: 1.62; overflow-wrap: anywhere; }
.m-text p, .m-text div { margin: 0 0 1em; font-size: inherit !important; line-height: inherit !important; font-family: inherit !important; }
.m-text h2, .m-text h3, .m-text h4 { font-family: var(--m-serif); font-size: 1.15em; line-height: 1.25; margin: 1.2em 0 .5em; }
.m-text a { color: var(--m-green); text-decoration: underline; }
.m-text img { max-width: 100%; height: auto; }
/* Photos run edge to edge with their caption */
.m-text .nv-fig { margin: 4px -20px 1.2em; display: flex; flex-direction: column; gap: 8px; }
.m-text .nv-fig img { width: 100%; height: auto; display: block; background: #e9e7e1; }
.m-text .nv-fig, .m-text .nv-fig * { font-family: var(--m-sans) !important; }
.m-text .nv-fig :not(img) { font-size: 13.5px !important; line-height: 1.45 !important; color: var(--m-muted); margin: 0; }
/* The caption block takes the side padding; inline padding on <i><font> indented its first line */
.m-text .nv-fig > :not(img):not(:has(img)) { display: block; padding: 0 20px; text-indent: 0; }
.m-text .nv-fig br { display: none; }
.m-text--ad .nv-fig { margin: 0 -20px; }
.m-cont { align-self: flex-start; min-height: 44px; padding: 0 16px; border: 1px solid var(--m-line-3); border-radius: 12px; font-size: 14.5px; font-weight: 500; }
.m-visit { display: inline-flex; align-items: center; background: var(--m-green); color: #fff; border: 0; font-weight: 600; text-decoration: none; }
.m-upnext { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; background: var(--m-fill); margin-top: 8px; width: 100%; }
.m-upnext > span:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.m-upnext small { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--m-muted); }
.m-upnext b { font-family: var(--m-serif); font-size: 20px; font-weight: 600; line-height: 1.2; text-wrap: pretty; }
.m-upnext-go { width: 44px; height: 44px; border-radius: 999px; background: var(--m-green); color: #fff; display: grid; place-items: center; flex: none; }
.m-art-foot { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px calc(8px + var(--m-safe)); border-top: 1px solid var(--m-line-2); background: #fff; }
.m-round { width: 48px; height: 48px; border-radius: 999px; border: 1px solid var(--m-line-3); display: grid; place-items: center; flex: none; }
.m-round--go { background: var(--m-green); color: #fff; border: 0; }
.m-round.is-off { opacity: .35; pointer-events: none; }
.m-onpage { flex: 1; min-width: 0; height: 48px; border-radius: 999px; background: var(--m-fill); font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }

/* search */
.m-sbar { height: 64px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; border-bottom: 1px solid var(--m-line-2); }
.m-cancel { height: 44px; padding: 0 10px; font-size: 15.5px; font-weight: 500; color: var(--m-green); }
.m-sbody { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px calc(24px + var(--m-safe)); overscroll-behavior: contain; }
.m-sbody .m-label { padding: 14px 10px 6px; }
.m-jrow { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 10px; border-radius: 12px; width: 100%; }
.m-jrow > span:first-child { flex: 1; font-size: 16px; font-weight: 500; }
.m-qrow { display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 10px; border-radius: 12px; width: 100%; cursor: pointer; }
.m-qrow-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.m-qrow-t b { font-family: var(--m-serif); font-size: 17px; font-weight: 600; line-height: 1.2; }
.m-snip { font-family: var(--m-serif); font-size: 14.5px; line-height: 1.4; color: #33333a; }
.m-snip b { font-family: inherit; font-size: inherit; background: var(--m-hl); font-weight: 600; }
.m-qarch { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px; margin-top: 8px; border-radius: 12px; background: var(--m-fill); width: 100%; }
.m-qarch b { flex: 1; font-size: 15.5px; font-weight: 600; }
.m-qarch-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--m-green); color: #fff; display: grid; place-items: center; flex: none; }
.m-saved-body { flex: 1; min-height: 0; padding-bottom: var(--m-safe); }

/* ---- bottom sheets ---- */
.m-sheet-wrap { position: absolute; inset: 0; z-index: 80; background: rgba(15, 20, 18, .42); display: flex; flex-direction: column; justify-content: flex-end; animation: m-fade .18s ease-out; }
.m-sheet { max-height: 84%; display: flex; flex-direction: column; background: #fff; border-radius: 22px 22px 0 0; padding-bottom: var(--m-safe); box-shadow: 0 -10px 40px rgba(0, 0, 0, .18); animation: m-up .22s ease-out; }
.m-sheet.is-tall { max-height: 90%; }
.m-grab { align-self: center; width: 38px; height: 5px; border-radius: 999px; background: #d9d6cf; margin: 8px 0 2px; flex: none; }
.m-sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 8px 8px 20px; flex: none; }
.m-sheet-h > span { font-family: var(--m-serif); font-size: 23px; font-weight: 600; }
.m-sheet-x { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; color: var(--m-muted-2); }
.m-sheet-x span { width: 32px; height: 32px; border-radius: 999px; background: #f0eee9; display: grid; place-items: center; }
.m-sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 16px; overscroll-behavior: contain; }
.m-sheet-body > .m-btn { margin-top: 10px; }
@keyframes m-up { from { transform: translateY(40px); opacity: .6; } }
@keyframes m-fade { from { opacity: 0; } }
.m-irow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 12px; border-radius: 12px; }
.m-irow span { font-size: 16px; font-weight: 500; white-space: nowrap; }
.m-irow i { font-family: var(--m-serif); font-size: 15px; color: var(--m-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-irow.is-on { background: var(--m-fill); }
.m-irow.is-on span { font-weight: 600; }
.m-ghead { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 2px 10px; }
.m-ghead b { font-size: 15px; font-weight: 600; }
.m-ghead span { font-size: 13px; color: var(--m-faint); }
.m-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; }
.m-gcell { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--m-muted-2); }
.m-gimg { display: block; width: 100%; aspect-ratio: .793; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); outline: 2.5px solid transparent; outline-offset: 3px; }
.m-gimg img { width: 100%; height: 100%; object-fit: contain; display: block; }
.m-gcell.is-on { color: var(--m-green); font-weight: 700; }
.m-gcell.is-on .m-gimg { outline-color: var(--m-green); }
.m-fs-demo { margin: 0 0 18px; font-family: var(--m-serif); line-height: 1.55; color: #33333a; }
.m-fs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.m-fs button { height: 64px; border-radius: 14px; border: 1px solid var(--m-line-3); font-family: var(--m-serif); font-weight: 600; text-align: center; }
.m-fs button.is-on { border: 2px solid var(--m-green); background: var(--m-tint); }
.m-advcard { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 18px; }
.m-advpage { width: 112px; height: auto; max-height: 160px; object-fit: contain; flex: none; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.m-advcard > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.m-advname { font-family: var(--m-serif); font-size: 23px; font-weight: 600; line-height: 1.1; }
.m-forms { display: flex; flex-direction: column; gap: 16px; }
.m-form { display: flex; flex-direction: column; gap: 6px; }
.m-form > b { font-size: 14px; font-weight: 600; }
.m-form > span { font-size: 13px; color: var(--m-faint); }
.m-form input, .m-form select { height: 50px; padding: 0 14px; border: 1px solid var(--m-line-3); border-radius: 12px; outline: 0; background: #fff; width: 100%; }
.m-form input:focus { border-color: var(--m-ink); }
.m-years2 { display: flex; align-items: center; gap: 10px; }
.m-years2 span { color: var(--m-faint); font-size: 14px; }
.m-years2 select { flex: 1; min-width: 0; }
.m-formbtns { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding-top: 4px; }
.m-formbtns .m-btn { min-height: 54px; }
.m-formbtns .m-btn--line { border: 1px solid var(--m-line-3); font-weight: 500; }

/* toast, errors */
.m-toast { position: absolute; left: 50%; bottom: calc(66px + var(--m-safe)); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; background: var(--m-ink); color: #fff; border-radius: 14px; font-size: 14px; line-height: 1.35; text-align: center; z-index: 95; pointer-events: none; }
.m-fatal { margin: auto; padding: 32px 24px; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.m-fatal b { font-family: var(--m-serif); font-size: 24px; }
.m-fatal span { color: var(--m-muted); line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  .m-app *, .m-app *::before, .m-app *::after { animation: none !important; transition: none !important; }
}
/* Landscape and short screens: the page gets the room */
@media (max-height: 460px) {
  .m-top, .m-pagebar { height: 40px; }
  .m-tab { height: 42px; }
  .m-tab-t { display: none; }
}
