/* Offline mode (features.offlineMode, offline.js) — loaded only on the pages with the "Save offline" button and on
   /saved/, so every other page stays byte-identical. Drawn from style.css's tokens, so light and dark need no rules of
   their own. */

/* The nav button: Share's pill (share.css), with its own icon. */
.off-btn { font-family: var(--font-display); font-weight: 800; font-size: 14px; line-height: 1;
  height: 40px; padding: 0 16px 0 13px; border-radius: 999px; border: 2px solid var(--line);
  background: var(--surface); color: inherit; cursor: pointer; flex: none;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
/* In the HTML hidden; offline.js shows it where the browser can keep pages (service worker + Cache Storage). */
.off-btn[hidden] { display: none; }
.off-btn:hover { border-color: var(--clover); }
.off-ico { display: inline-flex; }
.off-btn svg { width: 16px; height: 16px; flex: none; }
.off-btn.done { border-color: var(--clover); color: var(--clover-deep); }
.off-btn[data-state="saving"] { cursor: progress; opacity: .8; }
.off-btn[data-state="failed"] { border-color: var(--carrot); color: var(--carrot-deep); }
.nav .off-btn + .share-btn { margin-left: 8px; }

/* Phones and narrow tablets: the nav row has no room for a third button (brand, Share and the theme toggle already
   fill it at 360px), so offline.js moves the button to the right end of the breadcrumb line and shortens it to "Save".
   The line never wraps (a wrapped button cost a whole row on an iPhone): "Home ›" goes (the logo is the way home) and a
   long crumb is cut with an ellipsis; the page's own name is the h1 right below. */
.crumbs.off-crumbs { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; min-width: 0; }
.crumbs.off-crumbs > a[href="/"]:first-child, .crumbs.off-crumbs > a[href="/"]:first-child + span { display: none; }
.crumbs.off-crumbs > :not(.off-btn) { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.crumbs > .off-btn { margin-left: auto; height: 30px; font-size: 12.5px; padding: 0 11px 0 9px; gap: 5px;
  color: var(--ink); }
.crumbs > .off-btn.done { color: var(--clover-deep); }
.crumbs > .off-btn svg { width: 14px; height: 14px; }

/* Tapping a saved button: when, what, Remove and the saved list. */
.off-pop { position: absolute; z-index: 70; width: min(280px, calc(100vw - 16px)); background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 12px 14px 14px;
  color: var(--ink); font-size: 14px; }
.off-pop-t { font-family: var(--font-display); font-weight: 800; font-size: 15px; }
.off-pop-w { color: var(--ink-soft); margin-top: 3px; line-height: 1.35; }
.off-pop-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.off-pop-rm, .off-rm { font: inherit; font-weight: 700; border: 2px solid var(--line); background: var(--surface);
  color: var(--carrot-deep); border-radius: 999px; padding: 6px 13px; cursor: pointer; }
.off-pop-rm:hover, .off-rm:hover { border-color: var(--carrot); }
.off-pop-all { font-weight: 700; color: var(--clover-deep); }

/* A saved copy, answered with no signal (or a slow one). */
.off-note { background: var(--sky); color: var(--sky-ink); font-size: 13px; font-weight: 700; }
.off-note .wrap { padding-top: 7px; padding-bottom: 7px; }

/* /saved/ */
.off-saved h1 { margin-bottom: 14px; }
.off-miss { font-weight: 700; color: var(--carrot-deep); }
.off-list { display: grid; gap: 14px; margin: 8px 0 18px; }
.off-group { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; }
.prose-page .off-group-h { font-size: 19px; margin: 0 0 10px; }
.off-code { font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.prose-page .off-items { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.prose-page .off-item { margin: 0; line-height: 1.3; }
.prose-page .off-group-single .off-items { display: grid; gap: 10px; }
.off-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.off-group-single .off-item .off-link { flex: 1 1 auto; }
.off-link { font-weight: 700; color: var(--clover-deep); }
.off-group-h + .off-items .off-link { display: inline-block; border: 2px solid var(--line); border-radius: 999px;
  padding: 7px 14px; text-decoration: none; background: var(--surface-2); }
.off-when { color: var(--ink-soft); font-size: 13px; }
.off-group-f { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.off-rm { font-size: 13px; padding: 4px 11px; }
.off-empty, .off-ios { color: var(--ink-soft); }
