/* ==========================================================================
   Insights blog: its own look. Trade-journal for property operations.
   Stone ground, ink type, one safety-yellow bar as the signature, blue only for links and actions.
   Newsreader (serif) for reading, Public Sans for the interface. Logical properties so RTL (translated Arabic) works.
   ========================================================================== */
:root {
  --ground: #f3f4f2; --paper: #ffffff; --ink: #15212b; --muted: #56646f; --line: #dde2e5; --tint: #e9ece9;
  --blue: #0b4c76; --blue-ink: #0b4c76; --yellow: #f2b705; --on-yellow: #15212b;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: light;
}
html[data-theme="dark"] {
  /* Built from the primary #0b4c76: deep blue-tinted grounds, the primary itself as the action colour */
  --ground: #06131d; --paper: #0b2132; --ink: #e8f0f6; --muted: #9db3c3; --line: #163449; --tint: #09192a;
  --blue: #0b4c76; --blue-ink: #7fc1ee;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; font: 400 1.0625rem/1.6 var(--sans); color: var(--ink); background: var(--ground); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--blue-ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; padding: 10px 16px; background: var(--yellow); color: var(--on-yellow); border-radius: 6px; font-weight: 600; }
.skip:focus { top: 12px; }
.i { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; font: 600 .98rem var(--sans); color: #fff; background: var(--blue); border: 0; border-radius: 6px; text-decoration: none; cursor: pointer; transition: background .2s; }
.btn:hover { background: #083a5a; }
html[data-theme="dark"] .btn:hover { background: #0f6296; }
html[data-theme="dark"] .btn { color: #fff; box-shadow: 0 0 0 1px rgba(127, 193, 238, .25) inset; }

/* The signature: one thick yellow bar, like a wayfinding sign */
.bar-mark { display: block; width: 64px; height: 8px; margin-block-end: 20px; background: var(--yellow); border-radius: 2px; transform-origin: left center; }
[dir="rtl"] .bar-mark, html.translated-rtl .bar-mark { transform-origin: right center; }
.section-h .bar-mark { display: inline-block; width: 28px; height: 8px; margin: 0 14px 0 0; vertical-align: middle; }
html.translated-rtl .section-h .bar-mark { margin: 0 0 0 14px; }

/* ---------- Masthead: centered wordmark, then a full-width topic bar ---------- */
.masthead { background: var(--ground); }
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding-block: 22px 18px; }
.top-l { display: flex; gap: 8px; }
.top-r { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.round { display: grid; place-items: center; width: 34px; height: 34px; color: var(--ink); border: 1px solid var(--line); border-radius: 50%; transition: border-color .2s, background .2s; }
.round:hover { border-color: var(--ink); background: var(--paper); }
.round .i { width: 1em; height: 1em; }
.wordmark { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.05; text-decoration: none; color: var(--ink); }
.wordmark strong { font: 600 clamp(2.2rem, 4.6vw, 3.3rem)/1 var(--serif); letter-spacing: -.025em; }
.wordmark span { margin-top: 8px; max-width: 34ch; font-size: .82rem; line-height: 1.35; color: var(--muted); }
.btn.small { padding: 9px 16px; font-size: .9rem; }
.navbar { position: sticky; top: 0; z-index: 20; background: var(--ground); border-block: 2px solid var(--ink); }
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.links { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.links::-webkit-scrollbar { display: none; }
.links a { flex: none; padding: 13px 14px 11px; font-weight: 600; font-size: .95rem; color: var(--ink); text-decoration: none; border-bottom: 4px solid transparent; margin-bottom: -2px; }
.links a:hover, .links a[aria-current="page"] { border-bottom-color: var(--yellow); }
.search { position: relative; display: flex; flex: none; }
.search input { width: 140px; padding: 7px 34px 7px 14px; font: inherit; font-size: .9rem; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; transition: width .3s var(--ease), border-color .2s; }
.search input:focus { width: 200px; border-color: var(--ink); outline: 0; }
.search button { position: absolute; inset-inline-end: 3px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 28px; height: 28px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.tool { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; font: 500 .9rem var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.tool:hover { border-color: var(--ink); }
.tool[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.ic-sun { display: none; } html[data-theme="dark"] .ic-sun { display: inline-block; } html[data-theme="dark"] .ic-moon { display: none; }
.translate-note { margin: 0; padding: 8px 20px; text-align: center; font-size: .85rem; color: var(--muted); background: var(--tint); }

/* ---------- Shared type ---------- */
.cat { display: inline-block; font: 600 .92rem var(--sans); color: var(--blue-ink); text-decoration: none; }
.cat:hover { text-decoration: underline; }
.meta, .byline { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; font-size: .88rem; color: var(--muted); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.015em; margin: 0; }
h1 a, h3 a { color: inherit; text-decoration: none; }
h1 a:hover, h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--yellow); }
.standfirst { margin: 16px 0 0; font: 400 1.3rem/1.5 var(--serif); color: var(--muted); max-width: 40em; }

/* ---------- Home: lead + side stories + author rail ---------- */
.front { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, .85fr) 280px; gap: clamp(24px, 3.4vw, 44px); padding-block: clamp(28px, 4vw, 48px) clamp(28px, 4vw, 44px); align-items: start; }
.lead .cat { margin-block: 18px 6px; }
.lead h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.12; letter-spacing: -.02em; }
.lead .standfirst { font-size: 1.12rem; margin-top: 12px; }
.lead .meta { margin-top: 14px; }
.cover { display: block; overflow: hidden; background: var(--tint); border-radius: 4px; }
.cover img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .6s var(--ease); }
.cover:hover img { transform: scale(1.025); }
.cover.ph { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--tint), var(--line)); }
.cover.ph::after { content: ""; position: absolute; inset-inline-start: 16px; bottom: 16px; width: 44px; height: 6px; background: var(--yellow); border-radius: 2px; }
.cover.wide img { aspect-ratio: 16 / 10; }
.stack { display: grid; gap: 26px; }
.entry.mini { display: block; } .entry.mini .cover { margin-block-end: 10px; } .entry.mini .cover img { aspect-ratio: 16 / 10; }
.entry.mini h3 { margin-top: 4px; font-size: 1.12rem; line-height: 1.25; } .entry.mini .meta { margin-top: 6px; font-size: .8rem; }
.rail { display: grid; gap: 20px; }
.box { padding: 22px; background: var(--paper); border-radius: 4px; border-top: 4px solid var(--yellow); }
.box h2 { font: 700 .95rem var(--sans); letter-spacing: 0; margin-block-end: 14px; }
.who { display: flex; align-items: center; gap: 14px; margin-block-end: 12px; } .who img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.who strong { display: block; font: 600 1.15rem var(--serif); line-height: 1.2; } .who span { display: block; font-size: .85rem; color: var(--muted); line-height: 1.35; }
.about p { margin: 0 0 14px; font-size: .95rem; color: var(--muted); }
.follow ul { margin: 0; padding: 0; list-style: none; } .follow li { padding-block: 9px; border-top: 1px solid var(--line); } .follow li:first-child { border-top: 0; padding-top: 0; }
.follow a { color: var(--ink); font-weight: 500; text-decoration: none; } .follow a:hover { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; }

/* ---------- Category band: image tiles ---------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-block-end: 20px; }
.sec-head .section-h { margin: 0; } .all { font-weight: 600; font-size: .92rem; color: var(--ink); text-decoration: none; border-bottom: 3px solid var(--yellow); }
.band, .most { padding-block: 0 clamp(36px, 5vw, 60px); }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile a { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; color: #fff; text-decoration: none; background: var(--ink); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.tile a:hover img { transform: scale(1.05); }
.tile .shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 16, 20, .88) 0%, rgba(10, 16, 20, .35) 45%, rgba(10, 16, 20, 0) 75%); }
.tile.plain a { background: linear-gradient(160deg, #0b4c76, #15212b); }
.tile .txt { position: absolute; inset-inline: 0; bottom: 0; display: block; padding: 16px; }
.tile .cat { display: block; color: var(--yellow); font-size: .8rem; margin-block-end: 4px; }
.tile h3 { font-size: 1.08rem; line-height: 1.22; color: #fff; }
.tile time { display: block; margin-top: 8px; font-size: .75rem; color: rgba(255, 255, 255, .78); }

/* ---------- Grids ---------- */
.more { padding-block: clamp(32px, 5vw, 64px) clamp(48px, 7vw, 96px); }
.section-h { font: 700 1.15rem var(--sans); letter-spacing: 0; margin-block-end: 28px; }
.section-h.big { font: 600 clamp(2rem, 4.4vw, 3.2rem)/1.1 var(--serif); letter-spacing: -.02em; margin-block-end: 10px; }
.section-h.big .bar-mark { width: 36px; margin-inline-end: 16px; }
.count { margin: 0 0 32px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 36px; }
.grid.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.entry { display: flex; flex-direction: column; align-items: flex-start; }
.entry .cover { width: 100%; margin-block-end: 16px; }
.entry h3 { margin-top: 6px; font-size: 1.5rem; line-height: 1.2; }
.entry p { margin: 10px 0 14px; color: var(--muted); font-size: .98rem; }
.entry .meta { margin-top: auto; }
.pager { display: flex; gap: 24px; padding-block: 0 72px; font-weight: 600; }
.pager a { padding: 10px 0; border-bottom: 3px solid var(--yellow); color: var(--ink); text-decoration: none; }
.empty { max-width: 40rem; padding-block: clamp(64px, 12vw, 140px); }
.empty h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin-block-end: 16px; }
.empty p { color: var(--muted); font-size: 1.15rem; }

/* ---------- Article ---------- */
.art-head { padding-block: clamp(36px, 6vw, 72px) 28px; max-width: 920px; margin-inline: auto; }
.art-head h1 { font-size: clamp(2.1rem, 5vw, 3.7rem); line-height: 1.08; letter-spacing: -.025em; margin-block: 10px 0; }
.byline { margin-top: 22px; }
.byline span:first-child { color: var(--ink); font-weight: 600; }
.art-cover { margin-block: 8px 12px; max-width: 1080px; }
.art-cover img { width: 100%; max-height: 620px; object-fit: cover; border-radius: 6px; }
.art-body { display: grid; grid-template-columns: minmax(0, 700px) 240px; justify-content: center; gap: 64px; padding-block: 24px 40px; }
.col { min-width: 0; }
.takeaways { margin-block-end: 36px; padding: 22px 26px; background: var(--paper); border-inline-start: 8px solid var(--yellow); border-radius: 2px 6px 6px 2px; }
.takeaways h2 { font: 700 1rem var(--sans); letter-spacing: 0; margin-block-end: 8px; }
.takeaways ul { margin: 0; padding-inline-start: 1.2em; } .takeaways li { margin-block: 6px; }
.prose { font: 400 1.22rem/1.72 var(--serif); }
.prose > * + * { margin-top: 1.2em; }
.prose h2 { margin-top: 2em; font-size: 1.85rem; line-height: 1.2; } .prose h3 { margin-top: 1.7em; font-size: 1.4rem; }
.prose h2 + *, .prose h3 + * { margin-top: .7em; }
.prose a { color: var(--blue-ink); text-decoration-thickness: 1.5px; }
.prose ul, .prose ol { padding-inline-start: 1.4em; } .prose li { margin-block: .4em; }
.prose blockquote { margin-inline: 0; padding: .2em 0 .2em 1.2em; border-inline-start: 6px solid var(--yellow); font-style: italic; font-size: 1.35rem; line-height: 1.5; }
.prose blockquote p { margin: 0; }
.prose figure { margin-inline: 0; } .prose figure img { width: 100%; border-radius: 6px; } .prose figcaption { margin-top: 8px; font: .88rem var(--sans); color: var(--muted); }
.prose pre { overflow-x: auto; padding: 16px 18px; font: .9rem/1.5 ui-monospace, Menlo, Consolas, monospace; background: var(--tint); border-radius: 6px; }
.prose code { font: .88em ui-monospace, Menlo, Consolas, monospace; background: var(--tint); padding: 1px 5px; border-radius: 4px; } .prose pre code { padding: 0; background: none; }
.prose hr { border: 0; height: 3px; width: 64px; background: var(--yellow); margin-block: 2em; }
.toc { position: sticky; top: 24px; align-self: start; font-size: .92rem; }
.toc h2 { font: 700 .95rem var(--sans); letter-spacing: 0; margin-block-end: 10px; }
.toc ol { margin: 0; padding: 0; list-style: none; border-inline-start: 3px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; color: var(--muted); text-decoration: none; margin-inline-start: -3px; border-inline-start: 3px solid transparent; }
.toc a:hover { color: var(--ink); border-inline-start-color: var(--yellow); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 0; }
.tags span { padding: 4px 12px; font: .85rem var(--sans); color: var(--muted); background: var(--tint); border-radius: 999px; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 32px; padding-block: 18px; border-block: 1px solid var(--line); font-size: .92rem; }
.share span { color: var(--muted); margin-inline-end: 6px; }
.share a, .share button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; font: 500 .9rem var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--ink); }
.author { display: flex; gap: 20px; margin-top: 40px; padding: 26px; background: var(--paper); border-radius: 6px; }
.author img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; }
.author strong { display: block; font: 600 1.25rem var(--serif); } .author span { display: block; font-size: .9rem; color: var(--muted); }
.author p { margin: 10px 0 0; font-size: .98rem; } .author .btn { margin-inline-end: 12px; } .plain { font-weight: 500; }
.related { padding-block-start: 24px; }

/* ---------- Footer ---------- */
.foot { margin-top: 24px; padding-block: 48px 28px; background: var(--ink); color: #c9d3da; }
html[data-theme="dark"] .foot { background: #040d14; }
/* Dark: the topic bar is the primary colour itself */
html[data-theme="dark"] .navbar { background: #0b4c76; border-block-color: #0b4c76; }
html[data-theme="dark"] .links a { color: #fff; }
html[data-theme="dark"] .links a:hover, html[data-theme="dark"] .links a[aria-current="page"] { border-bottom-color: var(--yellow); }
html[data-theme="dark"] .navbar .search input { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: #fff; }
html[data-theme="dark"] .navbar .search input::placeholder { color: rgba(255, 255, 255, .7); }
html[data-theme="dark"] .navbar .search button { color: #fff; }
html[data-theme="dark"] .masthead { background: linear-gradient(180deg, #0a2236 0%, var(--ground) 100%); }
html[data-theme="dark"] .box { border-top-color: var(--yellow); box-shadow: 0 0 0 1px var(--line) inset; }
html[data-theme="dark"] .cover { box-shadow: 0 0 0 1px var(--line); }
.foot a { color: #fff; } .foot p { margin: 0 0 8px; } .foot ul { margin: 0; padding: 0; list-style: none; } .foot li { margin-block: 6px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot-title { font: 600 1.5rem var(--serif); color: #fff; } .foot-title span { font: 400 .85rem var(--sans); color: #9fb0bb; }
.foot-end { margin-top: 32px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .15); color: #9fb0bb; }

/* ---------- One orchestrated moment on load: the bar draws, the headline settles ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .lead .bar-mark, .js .art-head .bar-mark { animation: bar-draw .7s var(--ease) both; }
  .js .lead h1, .js .art-head h1 { animation: settle .8s var(--ease) .12s both; }
}
@keyframes bar-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes settle { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Google Translate (Arabic button): hide its chrome, flip direction ---------- */
.goog-te-banner-frame, .goog-te-balloon-frame, .goog-te-gadget, .skiptranslate, .goog-te-spinner-pos, #goog-gt-tt, .VIpgJd-ZVi9od-aZ2wEe-wOHMyf, .VIpgJd-ZVi9od-aZ2wEe { display: none !important; }
body { top: 0 !important; position: static !important; }
html.translated-rtl body { direction: rtl; text-align: start; font-family: "IBM Plex Sans Arabic", var(--sans); }
html.translated-rtl .prose, html.translated-rtl h1, html.translated-rtl h2, html.translated-rtl h3, html.translated-rtl .standfirst, html.translated-rtl .wordmark strong { font-family: "IBM Plex Sans Arabic", var(--sans); letter-spacing: 0; }
html.translated-rtl .cover img, html.translated-rtl .art-cover img { transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .front { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .rail { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .tiles, .tiles-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .art-body { grid-template-columns: minmax(0, 700px); }
  .toc { display: none; }
}
@media (max-width: 760px) {
  .top { grid-template-columns: 1fr auto; padding-block: 16px 12px; }
  .top-l { display: none; }
  .wordmark { grid-column: 1; align-items: flex-start; text-align: start; } .wordmark span { display: none; }
  .top-r { grid-column: 2; }
  .top-r .btn { display: none; }
  .front { grid-template-columns: 1fr; }
  .rail { grid-template-columns: 1fr; }
  .stack { grid-template-columns: 1fr 1fr; gap: 18px; }
  .search input, .search input:focus { width: 110px; }
  .tiles, .tiles-3, .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles .tile:last-child:nth-child(odd) { grid-column: 1 / -1; } .tiles .tile:last-child:nth-child(odd) a { aspect-ratio: 16 / 9; }
  .grid { grid-template-columns: 1fr; gap: 36px; }
  .grid.grid-4 { grid-template-columns: 1fr 1fr; gap: 22px; }
  .foot-grid { grid-template-columns: 1fr; }
  .prose { font-size: 1.14rem; }
  .author { flex-direction: column; }
}
@media (max-width: 480px) { .stack { grid-template-columns: 1fr; } }

/* ==========================================================================
   App layer: opening screen, bottom tab bar, sheets, saved, ads, install. Phones get an app-like shell.
   ========================================================================== */
html { -webkit-tap-highlight-color: transparent; }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* Opening screen: logo + animated yellow bar. Shown once per visit. A CSS timer hides it even if scripts fail. */
.boot { display: none; }
html.boot-on .boot { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: #06131d; color: #e8f0f6; animation: bootOut .5s ease 3.4s forwards; }
html.boot-on .boot.done { opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s .45s; animation: none; }
html:not(.boot-on) .boot { display: none; }
.boot-in { display: grid; justify-items: center; gap: 14px; padding: 24px; text-align: center; animation: bootIn .6s var(--ease) both; }
.boot-name { font: 600 clamp(2.4rem, 9vw, 3.6rem)/1 var(--serif); letter-spacing: -.01em; }
.boot-logo { max-height: 84px; max-width: min(260px, 70vw); width: auto; }
.boot-bar { width: 84px; height: 6px; border-radius: 3px; background: var(--yellow); transform-origin: left center; animation: bootBar 1.1s ease-in-out infinite alternate; }
.boot-by { font: 500 .8rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #9db3c3; }
@keyframes bootIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes bootBar { from { transform: scaleX(.25); } to { transform: scaleX(1); } }
@keyframes bootOut { to { opacity: 0; visibility: hidden; } }
.no-js .boot { display: none !important; }

/* Bottom tab bar: phones only */
.tabbar, .sheet, .sheet-back, .toast { display: none; }
@media (max-width: 820px) {
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); overscroll-behavior-y: none; }
  .masthead { position: sticky; top: 0; z-index: 40; padding-top: env(safe-area-inset-top); background: var(--blue); }
  .masthead .top-l, .masthead .navbar, .masthead .btn.small, .masthead .wordmark span { display: none; }
  .masthead .top { padding-block: 10px; justify-content: space-between; }
  .masthead .wordmark { text-align: start; } .masthead .wordmark strong { font-size: 1.45rem; }
  .masthead .tool.lang { display: none; }
  .foot { padding-bottom: 28px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 60; padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--paper) 94%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 58px; padding: 6px 2px; font: 600 .68rem/1.1 var(--sans);
    color: var(--muted); background: none; border: 0; cursor: pointer; text-decoration: none; touch-action: manipulation; }
  .tabbar .i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar [aria-current="page"], .tabbar .on { color: var(--blue-ink); }
  .tabbar [aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--yellow); }
  .tabbar .badge { position: absolute; top: 5px; margin-inline-start: 22px; min-width: 16px; padding: 1px 4px; border-radius: 9px; font: 700 .62rem/1.25 var(--sans); text-align: center; background: var(--yellow); color: var(--on-yellow); }
  .tabbar a:active, .tabbar button:active { transform: scale(.94); }

  .sheet-back { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(2, 10, 16, .55); opacity: 0; transition: opacity .2s ease; }
  .sheet-back[hidden] { display: none; } .sheet-back.on { opacity: 1; }
  .sheet { display: block; position: fixed; inset: auto 0 0 0; z-index: 80; max-height: 78vh; overflow: auto; padding: 8px 20px calc(24px + env(safe-area-inset-bottom));
    background: var(--paper); border-radius: 18px 18px 0 0; border-top: 1px solid var(--line); transform: translateY(100%); transition: transform .24s var(--ease); overscroll-behavior: contain; }
  .sheet[hidden] { display: none; } .sheet.on { transform: none; }
  .sheet .grab { width: 40px; height: 4px; border-radius: 2px; margin: 4px auto 12px; background: var(--line); }
  .sheet h2 { margin: 0 0 8px; font: 600 1.25rem var(--serif); }
  .sheet-list { list-style: none; margin: 0; padding: 0; }
  .sheet-list li { border-top: 1px solid var(--line); }
  .sheet-list a, .sheet-list button { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 52px; padding: 0; font: 500 1.02rem var(--sans); color: var(--ink); background: none; border: 0; text-align: start; text-decoration: none; cursor: pointer; }
  .sheet-list small { color: var(--muted); } .sheet-list [hidden] { display: none; } .sheet-list .hint { padding-block: 12px; color: var(--muted); font-size: .92rem; }
  .sheet-search { display: flex; gap: 10px; } .sheet-search input { flex: 1; min-height: 48px; padding: 0 14px; font: inherit; color: var(--ink); background: var(--ground); border: 1px solid var(--line); border-radius: 10px; }
  body.sheet-open { overflow: hidden; }

  .toast { display: block; position: fixed; z-index: 90; inset-inline: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); margin: 0 auto; width: fit-content; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 10px;
    font: 600 .9rem var(--sans); color: #fff; background: #0b4c76; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
  .toast[hidden] { display: none; } .toast.on { opacity: 1; transform: none; }
  /* Larger touch targets */
  .share a, .share button, .pager a { min-height: 44px; display: inline-flex; align-items: center; }
}
html.is-app .translate-note { display: none; }

/* Share row additions */
.share [data-save][aria-pressed="true"] { color: var(--blue-ink); } .share [data-save][aria-pressed="true"] .i { fill: currentColor; }
.share [hidden] { display: none; }
.linklike { padding: 0; font: inherit; color: var(--blue-ink); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.empty-note { padding: 28px 0; color: var(--muted); } .saved .muted { color: var(--muted); }

/* Ads: reserved space so the page does not jump; collapses when Google has nothing to show */
.ad { position: relative; display: block; margin: 24px auto; min-height: 120px; max-width: 100%; text-align: center; }
.ad-l { display: block; margin-bottom: 4px; font: 600 .66rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-home { min-height: 110px; }
.art-body .ad { clear: both; }

/* Share rows: icons, and a lighter row under the byline */
.share .i { width: 16px; height: 16px; }
.share a .i[class], .share a svg { flex: none; }
.share-top { margin-top: 18px; padding-block: 12px 0; border-block: 0; }
.share-top a, .share-top button { padding: 5px 12px; font-size: .84rem; }