/* Styles for the paper-digest web app, based on paper_digest/style.css in paper-digest.
   An app-style shell: fixed top bar and tab bar (a sidebar on wide screens), one scrolling
   content area, papers as rounded cards. Only fonts installed on the device are used (nothing is downloaded):
   the system font (San Francisco on Apple devices) for the interface, a serif for paper
   titles and English abstracts, and Japanese fonts for passages marked lang="ja". */

/* ---------- Colors and type (change these to restyle everything) ---------- */
:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --bg: #f4f2ed;          /* page background, slightly warm */
  --card: #fffefb;        /* cards float on the background */
  --bar: rgba(246, 244, 239, .86);   /* top and tab bars (translucent) */
  --text: #1f2328;
  --muted: #5b626b;       /* secondary text (5.4:1 on the background) */
  --line: #e3dfd5;
  --chip: #efece5;        /* chips, inputs, segmented control track */
  --link: #1f5c99;
  --accent: #9a4f0e;      /* highlight */
  --ok: #2d6a44;          /* full text, saved */
  --danger: #a3302a;
  --primary: #1f2328;     /* filled buttons */
  --on-primary: #fbfaf7;
  --seg-on: #fffefb;
  --shadow: 0 1px 2px rgba(31, 35, 40, .05), 0 3px 12px rgba(31, 35, 40, .05);
  --skeleton: #e9e6df;
  --rel-off: #dcd7cc;     /* empty relevance dots */

  --measure: 40em;        /* maximum text width */
  --tap: 44px;            /* comfortable tap height */
  --radius: 14px;
  --bar-h: 52px;
  --tab-h: 56px;
  --top: calc(var(--bar-h) + env(safe-area-inset-top));
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --card: #1c1f24;      /* a lighter surface instead of a shadow */
    --bar: rgba(22, 24, 28, .86);
    --text: #e7e5e0;
    --muted: #a7adb5;     /* 7.5:1 on the cards */
    --line: #2c3036;
    --chip: #262a30;
    --link: #8fb8ee;
    --accent: #e3a664;
    --ok: #82c79d;
    --danger: #f0938c;
    --primary: #e7e5e0;
    --on-primary: #16181c;
    --seg-on: #3a3f46;
    --shadow: 0 0 0 .5px #2c3036;   /* a hairline edge instead of a shadow (not "none": it is used inside shadow lists) */
    --skeleton: #23272d;
    --rel-off: #3a3f46;
  }
}

/* ---------- Shell: fixed bars, one scrolling area ---------- */
html { font-size: 17px; -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: var(--font-ui); line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
:lang(ja) { font-family: var(--font-ja); line-height: 1.8; }
a { color: var(--link); text-decoration: none; }
p { margin: 0; }

.appbar, .tabbar {
  position: fixed; left: 0; right: 0; z-index: 10;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
}
.appbar {
  top: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  border-bottom: .5px solid var(--line);
}
.tabbar {
  bottom: 0; display: flex; justify-content: space-around;
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  border-top: .5px solid var(--line);
}
/* The content scrolls under the translucent bars */
.content {
  position: fixed; inset: 0; overflow-y: auto; overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding:
    var(--top) calc(12px + env(safe-area-inset-right))
    calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px) calc(12px + env(safe-area-inset-left));
  scroll-padding-top: var(--top);
}
.content > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
body.signed-out .appbar, body.signed-out .tabbar { display: none; }
body.signed-out .content { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }

/* Top bar */
.appbar-inner {
  height: var(--bar-h); max-width: var(--measure); margin: 0 auto; padding: 0 4px;
  display: flex; align-items: center; justify-content: space-between;
}
.appbar-title { flex: 1; margin: 0; text-align: center; font-size: 1rem; font-weight: 600; letter-spacing: .01em; }
.appbar-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap); border-radius: 50%; color: var(--text);
}
.appbar-btn .icon { width: 22px; height: 22px; stroke-width: 2; }
.appbar-btn.off { color: var(--line); }
.appbar-btn:active { background: var(--chip); }
.date-pick {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: var(--tap); min-width: 10rem; padding: 0 .75rem; border-radius: 10px; cursor: pointer;
}
.date-pick:active { background: var(--chip); }
.date-main { font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.25; }
.date-sub { font-size: .68rem; color: var(--muted); line-height: 1.25; }
.date-sub.today { color: var(--link); font-weight: 600; }
.date-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* Tab bar */
.tabbar a {
  flex: 1; max-width: 9rem; height: var(--tab-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: .64rem; font-weight: 500; letter-spacing: .01em;
}
.tabbar a[aria-current="page"] { color: var(--text); }
.tabbar svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabbar svg .fill { fill: currentColor; stroke: none; }
.tabbar a[aria-current="page"] svg { stroke-width: 2; }

/* ---------- Page header and contents ---------- */
.page-head { padding: 1rem 4px .25rem; }
.page-head .sub { color: var(--muted); font-size: .82rem; }
.toc { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; margin-bottom: .25rem; padding: 0; list-style: none; }
.toc a {
  display: inline-flex; align-items: center; min-height: 36px;
  padding: 0 .85rem; border-radius: 999px; background: var(--card); box-shadow: var(--shadow);
  color: var(--text); font-size: .8rem; position: relative;
}
.toc a::after { content: ""; position: absolute; inset: -4px 0; }
.toc .n { color: var(--muted); margin-left: .4em; }
/* Phones: the day's fields in one row that scrolls sideways */
.day-toc {
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  margin-left: -12px; margin-right: -12px; padding: 4px 12px 6px;
}
.day-toc::-webkit-scrollbar { display: none; }
.day-toc li { flex: none; }
@media (min-width: 700px) { .day-toc { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding: 0; } }

/* Group headings stay just under the top bar while scrolling */
.group > h2 {
  position: sticky; top: 0; z-index: 2;   /* 0 = just under the top bar (the content padding) */
  margin: 1rem -12px .35rem; padding: .5rem 16px .4rem;
  background: var(--bg);
  font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.group > h2 .n { font-weight: normal; margin-left: .5em; }

/* Favourite fields: a star on the heading */
.star { color: var(--accent); margin-right: .35em; }

/* ---------- Paper cards ---------- */
.paper {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 16px 0; margin-bottom: 12px; overflow: hidden;
}
.paper.highlighted {
  box-shadow: var(--shadow), inset 3px 0 0 var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--card));
}
/* Low relevance (admins): quieter, still readable */
.paper.low .title a, .paper.low .oneliner { color: var(--muted); }

/* One quiet line above the title: OA / OA · PDF needed / Full text (and the saved date) */
.card-top { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin: 0 0 .4rem; }
.card-meta {
  margin: 0; color: var(--muted); font-size: .7rem; font-weight: 500; letter-spacing: .02em;
}
.card-meta:empty { display: none; }
.card-top:not(:has(*)) { display: none; }
/* What the digest could not get: quiet amber notes */
.flag {
  color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 999px; padding: 0 .5em; font-weight: 600; white-space: nowrap;
}
.card-meta .ft { color: var(--ok); font-weight: 600; }
.card-meta .sep { margin: 0 .4em; }

.title { font-family: var(--font-serif); font-size: 1.18rem; line-height: 1.32; font-weight: 600; margin: 0; letter-spacing: -.003em; text-wrap: balance; }
.title a { color: var(--text); }
.byline { color: var(--muted); font-size: .76rem; line-height: 1.5; margin-top: .4rem; }
.oneliner { margin-top: .65rem; font-size: .94rem; line-height: 1.55; text-wrap: pretty; }
.oneliner:lang(ja) { line-height: 1.75; }
.reason { color: var(--muted); font-size: .82rem; margin-top: .45rem; }

/* Relevance (admins): five small dots and the number */
.rel {
  display: inline-flex; align-items: center; gap: 2.5px; margin-left: .5rem; vertical-align: .14em;
  font-family: var(--font-ui); white-space: nowrap;
}
.rel i { width: 5px; height: 5px; border-radius: 50%; background: var(--rel-off); }
.rel i.on { background: var(--accent); }
.rel b { margin-left: .3rem; font-size: .66rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
/* The same, as a chip above a card's title: highlight (accent), middle (neutral), low (faint) */
.rel-chip {
  display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 .55rem; border-radius: 999px;
  background: var(--chip); color: var(--muted); font-family: var(--font-ui);
}
.rel-chip i { width: 5px; height: 5px; border-radius: 50%; background: var(--rel-off); }
.rel-chip i.on { background: var(--accent); }
.rel-chip b { margin-left: .25rem; font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rel-chip.hi { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.rel-chip.lo { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.rel-chip.lo i.on { background: var(--muted); }

/* ---------- Buttons ---------- */
button { font: inherit; color: inherit; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon .fill { fill: currentColor; }
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 38px; padding: 0 .9rem; border: 0; border-radius: 999px;
  background: var(--chip); color: var(--text); font-family: var(--font-ui); font-size: .8rem; font-weight: 500;
  cursor: pointer; transition: transform .12s var(--ease), background-color .15s, color .15s;
}
.btn::after { content: ""; position: absolute; inset: -3px; }   /* 44px touch target */
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.on { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.icon-only { width: 38px; padding: 0; }
.btn.wide { width: 100%; min-height: var(--tap); font-size: .95rem; }
.btn.link { background: none; color: var(--link); width: 100%; margin-top: .25rem; }
.btn.request { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.btn.request .count {
  position: absolute; top: -3px; right: -5px; min-width: 16px; height: 16px; padding: 0 3px; box-sizing: border-box;
  border-radius: 999px; background: var(--card); box-shadow: 0 0 0 1px var(--line);
  font-size: .6rem; font-weight: 600; line-height: 16px; text-align: center; color: var(--ok);
}
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--chip); }

/* Segmented control (To read | Read) */
.seg { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--chip); }
.seg button {
  position: relative; display: inline-flex; align-items: center; gap: .3rem; min-height: 34px; padding: 0 .75rem;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  font-family: var(--font-ui); font-size: .78rem; font-weight: 500; cursor: pointer;
  transition: background-color .18s var(--ease), color .18s, box-shadow .18s;
}
.seg button::after { content: ""; position: absolute; inset: -5px -1px; }
.seg button .icon { width: 16px; height: 16px; }
.seg button.on { background: var(--seg-on); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* One row: save, To read | Read, note, request on the left; links on the right (wraps when narrow) */
.actions { margin: .85rem 0 .75rem; }
.buttons { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.group-l, .group-r { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.group-r { gap: .15rem; margin-left: auto; }
.pill {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 32px; padding: 0 .75rem;
  border-radius: 999px; font-size: .76rem; font-weight: 500; background: var(--chip); color: var(--muted);
}
.pill .icon { width: 16px; height: 16px; }
.pill.pending, .pill.processing { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pill.processing .icon { animation: spin 1.6s linear infinite; }
.pill.done { color: var(--ok); }
.req-error { margin-top: .5rem; display: flex; gap: .35rem; align-items: flex-start; width: 100%; font-size: .76rem; color: var(--danger); }
.req-error .icon { width: 16px; height: 16px; margin-top: .15rem; }

/* ---------- "Details": translation, abstract, authors, full text as tabs (full card width) ---------- */
details.more { margin: 0 -16px; border-top: .5px solid var(--line); }
summary {
  display: flex; align-items: center; gap: .5rem;
  min-height: var(--tap); padding: 0 16px; cursor: pointer; list-style: none;
  font-size: .84rem; font-weight: 600;
}
summary > span:first-child { flex: 1; min-width: 0; }
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; width: 7px; height: 7px; margin-left: .25rem; flex: none;
  border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
  transform: translateY(-2px) rotate(45deg); transition: transform .2s var(--ease);
}
details[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
summary .meta { color: var(--muted); font-weight: normal; font-size: .74rem; margin-left: .5em; }

.tabs {
  display: flex; gap: .1rem; padding: 0 10px; overflow-x: auto; scrollbar-width: none;
  border-bottom: .5px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tab"] {
  flex: none; min-height: 40px; padding: 0 .7rem; border: 0; background: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -.5px;
  color: var(--muted); font-family: var(--font-ui); font-size: .8rem; font-weight: 500;
}
.tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.tabs [role="tab"][hidden] { display: none; }
.pane { padding: .9rem 16px 1.1rem; }
details[open] .pane { animation: reveal .22s var(--ease); }
.pane-meta { color: var(--muted); font-size: .72rem; margin-bottom: .75rem; }

.sections dt { font-weight: 600; font-size: .82rem; margin-top: 1rem; }
.sections dt:first-child { margin-top: 0; }
.sections dd { margin: .15rem 0 0; }
.ft-oneliner { margin-bottom: 1rem; font-style: italic; }
.markdown { white-space: pre-wrap; }
.abstract-en { font-family: var(--font-serif); font-size: .98rem; line-height: 1.7; }
/* Translation and abstract: a little smaller than the one-liner, so more fits on a phone */
.pane[data-pane="tr"] p { font-size: .95rem; line-height: 1.85; margin: 0; }
.pane p { text-wrap: pretty; }

.authors { margin: 0; padding: 0; list-style: none; }
.authors li { padding: .5rem 0; line-height: 1.5; }
.authors li + li { border-top: .5px solid var(--line); }
.authors .aff { color: var(--muted); font-size: .84rem; }
.authors .career { display: block; color: var(--muted); font-size: .76rem; }
p.more { color: var(--muted); font-size: .76rem; padding-top: .5rem; }

/* Notes */
.notes { margin: 0 0 .75rem; padding: 0; list-style: none; }
.notes li { padding: .55rem .75rem; background: var(--chip); border-radius: 10px; white-space: pre-wrap; font-size: .9rem; }
.notes li + li { margin-top: .4rem; }
.notes time { display: block; color: var(--muted); font-size: .7rem; font-family: var(--font-ui); }

.empty { color: var(--muted); padding: 2rem 4px; text-align: center; }
/* Shown in place of the page until the app has signed in and drawn its first screen */
.boot { text-align: center; color: var(--muted); padding-top: 18vh; }
.boot img { border-radius: 16px; display: block; margin: 0 auto .75rem; }
.boot p { margin: .25rem 0; }
.boot-slow button { font: inherit; color: var(--accent, inherit); background: none; border: 0; text-decoration: underline; padding: .5rem; cursor: pointer; }
.empty + .empty-sub { margin-top: -1.5rem; }
.empty-sub { color: var(--muted); font-size: .82rem; text-align: center; padding: 0 4px 1rem; }
.empty-action { text-align: center; }
/* Empty and failed pages: an icon, a title, a line, a button */
.empty-state { text-align: center; padding: 14vh 24px 2rem; color: var(--muted); }
.empty-state > .icon { width: 36px; height: 36px; stroke-width: 1.4; margin: 0 auto .75rem; display: block; opacity: .7; }
.empty-title { margin: 0; color: var(--text); font-weight: 600; font-size: 1.02rem; }
.empty-state .empty-sub { margin: .35rem auto 0; max-width: 24rem; padding: 0; }
.empty-state .empty-action { margin-top: 1.1rem; }
.empty-state .btn { padding: 0 1.2rem; }
.slow-note { text-align: center; color: var(--muted); font-size: .82rem; padding: .5rem 1rem; }
.link-btn { background: none; border: 0; padding: .25rem .4rem; color: var(--link); font: inherit; text-decoration: underline; cursor: pointer; }
.run-note { color: var(--muted); font-size: .72rem; margin-top: 1.5rem; padding: 0 4px; }

/* ---------- A day: count and the Cards / Compact switch ---------- */
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.view-mode button { padding: 0 .6rem; min-height: 30px; }
.view-mode button .icon { width: 17px; height: 17px; }

/* Compact view: one row per paper; tapping a row opens its card */
.compact-list {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px;
}
.compact-list > .paper { border-radius: 0; box-shadow: none; margin: 0; }
.compact-list > * + * { border-top: .5px solid var(--line); }
.compact-row {
  display: flex; flex-direction: column; gap: .2rem; width: 100%; box-sizing: border-box;
  padding: .75rem 16px; border: 0; background: none; color: var(--text); text-align: left;
  font: inherit; cursor: pointer;
}
.compact-row:hover { background: color-mix(in srgb, var(--chip) 55%, transparent); }
.compact-row:active { background: var(--chip); }
.c-title { font-family: var(--font-serif); font-size: 1rem; font-weight: 600; line-height: 1.35; }
.c-meta { display: flex; align-items: center; gap: .45rem; min-width: 0; color: var(--muted); font-size: .76rem; }
.c-meta b { flex: none; font-weight: 600; }
.c-meta .icon { width: 13px; height: 13px; flex: none; color: var(--ok); }
.c-meta span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- Loading placeholders ---------- */
.skeleton { padding-top: 1rem; }
.sk-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px 8px; margin-bottom: 12px; }
.sk-line {
  height: .7rem; border-radius: 6px; margin-bottom: .75rem;
  background: linear-gradient(90deg, var(--skeleton) 0%, var(--chip) 50%, var(--skeleton) 100%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;
}
.sk-line.tall { height: 1.05rem; }
.w30 { width: 30%; } .w50 { width: 50%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; } .w100 { width: 100%; }

/* ---------- Note sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .28);
  opacity: 0; transition: opacity .25s var(--ease);
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  max-width: 34rem; margin: 0 auto; box-sizing: border-box;
  padding: 8px calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  background: var(--card); border-radius: 18px 18px 0 0; box-shadow: 0 -4px 24px rgba(0, 0, 0, .12);
  transform: translateY(100%); transition: transform .28s var(--ease);
}
.sheet.open { transform: translateY(0); }
.sheet-grip { width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet h2 { margin: 0; font-size: 1rem; text-align: center; }
.sheet-paper {
  margin: .25rem 0 .75rem; text-align: center; color: var(--muted); font-size: .76rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet textarea {
  box-sizing: border-box; width: 100%; resize: none; display: block;
  font: inherit; font-size: 16px; /* 16px stops iOS from zooming */
  color: var(--text); background: var(--chip); border: 0; border-radius: 12px; padding: .7rem .8rem;
}
.sheet textarea:focus { outline: 2px solid color-mix(in srgb, var(--link) 50%, transparent); }
.sheet-buttons { display: flex; gap: .6rem; margin-top: .75rem; }
.sheet-buttons .btn { flex: 1; min-height: var(--tap); font-size: .92rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; z-index: 30;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px);
  transform: translate(-50%, 8px) scale(.96); opacity: 0; pointer-events: none;
  max-width: calc(100% - 48px); padding: .55rem 1.1rem; border-radius: 999px;
  background: var(--primary); color: var(--on-primary);
  font-size: .84rem; font-weight: 500; box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast.error { background: var(--danger); color: #fff; border-radius: 12px; }
body.signed-out .toast { bottom: calc(env(safe-area-inset-bottom) + 24px); }

/* ---------- Sign-in and settings ---------- */
.login { max-width: 20rem; margin: 14vh auto 0; text-align: center; }
.login-icon { border-radius: 16px; display: block; margin: 0 auto 1rem; }
.login h1 { font-family: var(--font-serif); font-size: 1.6rem; margin: 0 0 1.5rem; }
.login form { text-align: left; }
.login .who { color: var(--muted); font-size: .88rem; margin-bottom: .75rem; text-align: center; }
.login label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .9rem; }
.login input {
  box-sizing: border-box; display: block; width: 100%; margin-top: .3rem;
  font: inherit; font-size: 16px; color: var(--text); background: var(--card); box-shadow: var(--shadow);
  border: .5px solid var(--line); border-radius: 12px; min-height: 48px; padding: 0 .9rem;
}
input[inputmode="numeric"] { letter-spacing: .4em; font-variant-numeric: tabular-nums; }
input.limit { letter-spacing: normal; }   /* the monthly limit is a number, not a PIN */
.login input[inputmode="numeric"] { text-align: center; font-size: 22px; }
.msg { min-height: 1.5em; font-size: .84rem; color: var(--danger); margin: .5rem 0; }
.msg.ok { color: var(--ok); }

.settings { padding-top: .5rem; }
.group-label { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 1.5rem 16px .4rem; }
.inset { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 48px; padding: 0 16px; margin: 0; font-size: .92rem; color: var(--text);
}
.row + .row { border-top: .5px solid var(--line); }
.row .value { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row:has(.value) > span:first-child { flex: none; white-space: nowrap; }   /* e.g. "Last run" stays on one line */
.row input[type="password"] {
  width: 8.5rem; text-align: right; border: 0; background: none; color: var(--text);
  font: inherit; font-size: 16px; min-height: 44px;
}
.row input[type="password"]:focus { outline: none; }
.settings form .msg { margin: .6rem 16px; }
.signout { margin-top: 2rem; }
button.row { width: 100%; border: 0; background: none; justify-content: center; cursor: pointer; font-weight: 500; }
button.row.danger { color: var(--danger); }
.hint { color: var(--muted); font-size: .76rem; margin: .5rem 16px; }

/* ---------- Top bar: date button and back button ---------- */
button.date-pick { border: 0; background: none; color: var(--text); font: inherit; }
.date-main { display: inline-flex; align-items: center; gap: .2rem; }
.date-main .icon { width: 14px; height: 14px; stroke-width: 2.2; color: var(--muted); }
.appbar-back {
  display: inline-flex; align-items: center; gap: .1rem; min-height: var(--tap); min-width: 5.5rem;
  padding: 0 .25rem; border: 0; background: none; color: var(--link); font: inherit; font-size: .95rem; cursor: pointer;
}
.appbar-back .icon { width: 22px; height: 22px; stroke-width: 2; }
.appbar-spacer { min-width: 5.5rem; }

/* ---------- Calendar ---------- */
.cal { font-family: var(--font-ui); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .25rem; }
.cal-head button { border: 0; background: none; cursor: pointer; }
.cal-title { font-weight: 600; font-size: .98rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: .66rem; font-weight: 600; color: var(--muted); padding: .25rem 0; }
.cal-day {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 44px; border: 0; border-radius: 12px; background: none; padding: 0;
  font: inherit; font-size: .9rem; font-variant-numeric: tabular-nums; color: var(--muted); opacity: .55;
}
.cal-day.blank { visibility: hidden; }
.cal-day.has { color: var(--text); opacity: 1; cursor: pointer; font-weight: 500; }
.cal-day.has:hover { background: var(--chip); }
.cal-day.has:active { transform: scale(.94); }
.cal-day .dot { position: absolute; bottom: 3px; }
.cal-day.today > span:first-child {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-top: -6px;
  border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--link); color: var(--link); font-weight: 600;
}
.cal-day.selected { background: var(--primary); color: var(--on-primary); opacity: 1; }
.cal-day.selected:hover { background: var(--primary); }
.cal-day.selected .dot { background: var(--on-primary); }
.cal-day.selected.today > span:first-child { box-shadow: none; color: var(--on-primary); }
.dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); font-style: normal; }
.dot.hl, .cal-day.hl .dot { background: var(--accent); width: 6px; height: 6px; }
.cal-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .5rem; }
.cal-legend { display: inline-flex; align-items: center; gap: .35rem; font-size: .7rem; color: var(--muted); }
.cal-legend .dot.hl { margin-left: .75rem; }

/* Phones: a bottom sheet */
.cal-sheet { padding-top: 8px; }
/* Wider screens: a small window under the date */
.cal-pop {
  position: fixed; z-index: 21; left: 50%; top: calc(var(--top) + 6px); width: 21rem; box-sizing: border-box;
  padding: 12px 14px 14px; background: var(--card); border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .16), 0 0 0 .5px var(--line);
  transform: translate(-50%, -6px); opacity: 0; transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.cal-pop.open { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Wide screens (1100 px and up): a sidebar instead of the tab bar ----------
   The sidebar and the content column are centered together as one block; the content keeps
   its usual width. Between 700 and 1100 px the calendar stays a small window. */
.sidebar { display: none; }
@media (min-width: 1100px) {
  :root {
    --side-w: 15.5rem;
    --gap: 2.5rem;
    --left: max(16px, calc((100vw - var(--side-w) - var(--gap) - var(--measure)) / 2));
    --col-left: calc(var(--left) + var(--side-w) + var(--gap));
  }
  .tabbar { display: none; }
  .content { padding: var(--top) var(--left) 48px var(--col-left); }
  .appbar-inner { margin: 0 var(--left) 0 var(--col-left); }
  body.signed-out .content { padding-left: 12px; padding-right: 12px; }
  .toast { bottom: calc(env(safe-area-inset-bottom) + 24px); }

  body:not(.signed-out) .sidebar {
    display: flex; flex-direction: column; position: fixed; z-index: 11; top: 0; bottom: 0;
    left: var(--left); width: var(--side-w); box-sizing: border-box; overflow-y: auto; scrollbar-width: none;
    padding: env(safe-area-inset-top) 0 24px;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .brand {
    display: flex; align-items: center; gap: .6rem; height: var(--bar-h); flex: none; margin: 0; padding: 0 8px;
    font-weight: 600; font-size: .95rem; letter-spacing: .01em;
  }
  .brand img { border-radius: 7px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; }
  .side-nav a {
    position: relative; display: flex; align-items: center; gap: .7rem; min-height: 40px; padding: 0 10px;
    border-radius: 10px; color: var(--muted); font-size: .9rem; font-weight: 500;
  }
  .side-nav a:hover { background: color-mix(in srgb, var(--chip) 60%, transparent); color: var(--text); }
  .side-nav a[aria-current="page"] { background: var(--chip); color: var(--text); font-weight: 600; }
  .side-nav svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .side-nav svg .fill { fill: currentColor; stroke: none; }
  .side-nav a.has-dot::after {
    content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
    border-radius: 50%; background: #e5484d;
  }

  .cal-side:not(:empty) {
    margin-top: 20px; padding: 10px 10px 12px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .cal-side .cal-title { font-size: .88rem; }
  .cal-side .cal-day { height: 34px; font-size: .8rem; border-radius: 9px; }
  .cal-side .cal-day.today > span:first-child { width: 24px; height: 24px; margin-top: -4px; }
  .cal-side .cal-day .dot { bottom: 1px; }
  .cal-side .cal-legend { font-size: .64rem; }
  .cal-side .cal-foot .btn { min-height: 30px; font-size: .74rem; padding: 0 .7rem; }

  .side-label {
    margin: 22px 10px 6px; font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  }
  .side-toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
  .side-toc a {
    display: flex; align-items: center; gap: .1rem; min-height: 34px; padding: 0 10px;
    border-radius: 8px; color: var(--muted); font-size: .82rem; line-height: 1.3;
    box-shadow: inset 2px 0 0 transparent; transition: background-color .15s, color .15s, box-shadow .15s;
  }
  .side-toc a:hover { color: var(--text); }
  .side-toc a[aria-current="true"] { color: var(--text); font-weight: 600; background: var(--chip); box-shadow: inset 2px 0 0 var(--text); }
  .side-toc .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-toc .n { margin-left: .5rem; font-variant-numeric: tabular-nums; font-weight: normal; color: var(--muted); }

  /* The fields are in the sidebar, so not above the cards */
  .day-toc { display: none; }
}

/* ---------- Browse ---------- */
.browse-bar {
  position: sticky; top: 0; z-index: 3; margin: 0 -12px; padding: .6rem 12px .5rem;
  background: var(--bg);
}
.browse-bar > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.search {
  display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 .8rem;
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow); color: var(--muted);
}
.search input {
  flex: 1; min-width: 0; border: 0; background: none; color: var(--text);
  font: inherit; font-size: 16px; min-height: 44px; outline: none;
}
.search input::-webkit-search-cancel-button { cursor: pointer; }
.filters { display: flex; gap: .5rem; margin-top: .5rem; }
.select { position: relative; flex: 1; min-width: 0; }
.select select {
  appearance: none; -webkit-appearance: none; width: 100%; min-height: 38px; padding: 0 2rem 0 .85rem;
  border: 0; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); color: var(--text);
  font-family: var(--font-ui); font-size: .8rem; font-weight: 500; text-overflow: ellipsis; cursor: pointer;
}
.select .icon { position: absolute; right: .7rem; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.list-head { color: var(--muted); font-size: .76rem; margin: .75rem 4px .4rem; }
.rows { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.rows li + li { border-top: .5px solid var(--line); }
.row-btn {
  display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 56px; box-sizing: border-box;
  padding: .7rem 14px .7rem 16px; border: 0; background: none; color: var(--text); text-align: left;
  font: inherit; cursor: pointer;
}
.row-btn:active { background: var(--chip); }
.row-btn > .icon { color: var(--muted); width: 16px; height: 16px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.row-title { font-size: .95rem; line-height: 1.35; }
.row-title.serif { font-family: var(--font-serif); font-size: 1.02rem; font-weight: 600; }
.row-meta { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .74rem; }
.row-mark { width: 18px; flex: none; color: var(--ok); }
.count { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.more-btn { margin-top: .75rem; }
.appeared { color: var(--muted); font-size: .78rem; margin: 0 4px 1rem; }

/* ---------- Settings: daily digest time ---------- */
.select.inline { flex: 0 1 auto; max-width: 62%; }
.select.inline select { box-shadow: none; background: var(--chip); min-height: 34px; font-size: .85rem; }
.row .value.small { font-size: .78rem; text-align: right; white-space: normal; }
#digest-form .hint { margin-top: .6rem; }
#digest-form .msg { margin: .4rem 16px; }

/* ---------- Notifications and dots ---------- */
.tabbar a { position: relative; }
.tabbar a.has-dot::after {
  content: ""; position: absolute; top: 7px; left: calc(50% + 9px);
  width: 8px; height: 8px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 2px var(--bar);
}
.status-row { font-size: .84rem; color: var(--muted); }
.status-row.ok { color: var(--ok); }
.status-row.bad { color: var(--danger); }
.switch-row { cursor: pointer; }
.switch-row.disabled { color: var(--muted); cursor: default; }
.switch:disabled { opacity: .45; cursor: default; }
.switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; margin: 0; padding: 0; cursor: pointer;
  width: 46px; min-width: 46px; max-width: 46px; height: 28px; min-height: 0; border-radius: 999px; background: var(--chip); box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .2s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .2s var(--ease);
}
.switch:checked { background: var(--ok); box-shadow: none; }
.switch:checked::after { left: calc(100% - 26px); }   /* on: the knob at the right end */
.switch:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.stack { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.btn.link.danger { color: var(--danger); }

/* ---------- Members (admins) and the monthly allowance ---------- */
.row input[type="text"], .row input[type="number"] {
  flex: 1; min-width: 0; max-width: 62%; text-align: right; border: 0; background: none; color: var(--text);
  font: inherit; font-size: 16px; min-height: 44px; padding: 0;
}
.row input[type="text"]:focus, .row input[type="number"]:focus { outline: none; }
.members { display: flex; flex-direction: column; gap: .6rem; }
.member.inactive { opacity: .6; }
.member-name { font-weight: 600; }
.row.uid { min-height: 30px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .7rem; }
.left { font-size: .74rem; color: var(--muted); }

/* ---------- Preferences, first-run screen, journals and languages ---------- */
.check-row { cursor: pointer; }
.check-row > span:first-child { flex: 1; min-width: 0; }
.check-row.paused { color: var(--muted); }
.j-abbr { display: inline-block; min-width: 3.6em; font-weight: 600; font-size: .82rem; }
.tag { font-size: .68rem; color: var(--muted); background: var(--chip); border-radius: 999px; padding: 0 .5em; }
.badge.fav { color: var(--link); background: color-mix(in srgb, var(--link) 12%, transparent); }
.onboarding { padding: 1.5rem 0 3rem; }
.onboarding h1 { font-family: var(--font-serif); font-size: 1.5rem; margin: 0; text-align: center; }
.onboarding .sub { text-align: center; color: var(--muted); font-size: .88rem; margin: .4rem 0 .5rem; }
.onboarding .login-icon { margin: 0 auto .75rem; border-radius: 14px; display: block; }
.onboarding > .btn { margin-top: 1rem; }
.journal.inactive { opacity: .65; }
.rows.results { margin-top: .6rem; }

/* ---------- Settings list (each row opens its own page) ---------- */
a.menu-row { color: var(--text); text-decoration: none; cursor: pointer; }
a.menu-row:active { background: var(--chip); }
.menu-end { display: inline-flex; align-items: center; gap: .3rem; min-width: 0; }
.menu-end .value { max-width: 13rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-end .icon { width: 16px; height: 16px; flex: none; color: var(--muted); }

/* ---------- Costs (admins) ---------- */
.cost-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: .75rem; }
.cost-card {
  display: flex; flex-direction: column; gap: .15rem; padding: 12px 14px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}
.cost-card span { color: var(--muted); font-size: .72rem; font-weight: 500; }
.cost-card b { font-size: 1.45rem; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.chart-head { display: flex; justify-content: flex-end; margin: 1.25rem 0 .5rem; }
.chart-box { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 12px 6px; }
.cost-chart { display: block; width: 100%; height: 160px; overflow: visible; }
.cost-chart .base { stroke: var(--line); stroke-width: 1; }
.cost-chart .hit { fill: transparent; }
.cost-chart .val { fill: var(--link); opacity: .75; }
.cost-chart .est { fill: var(--link); opacity: .3; }
.cost-chart .bar { cursor: pointer; outline: none; }
.cost-chart .bar:hover .hit, .cost-chart .bar:focus-visible .hit { fill: var(--chip); }
.cost-chart .bar.on .hit { fill: color-mix(in srgb, var(--link) 10%, transparent); }
.cost-chart .bar.on .val { opacity: 1; }
.chart-labels { position: relative; height: 1.3rem; margin-top: 4px; }
.chart-labels span {
  position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap;
  color: var(--muted); font-size: .66rem; font-variant-numeric: tabular-nums;
}
.chart-labels span:last-child { transform: translateX(-100%); }
.row.cost-row > span:first-child { flex: 1; min-width: 0; white-space: normal; }
.row.cost-row > .value { flex: none; font-variant-numeric: tabular-nums; }
.chart-scale { color: var(--muted); font-size: .68rem; text-align: right; margin-top: .1rem; }
.model-row { flex-wrap: wrap; gap: .25rem 1rem; padding-top: .5rem; padding-bottom: .5rem; }
.model-row .value { white-space: normal; }
.meter { position: relative; height: 10px; margin: .9rem 16px .3rem; border-radius: 999px; background: var(--chip); }
.meter .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--ok); }
.meter.near .fill { background: var(--accent); }
.meter.over .fill { background: var(--danger); }
.meter .tick { position: absolute; top: -3px; bottom: -3px; width: 1.5px; margin-left: -.75px; background: var(--muted); }
.meter-text { color: var(--muted); font-size: .76rem; margin: 0 16px; }
.meter-text b { color: var(--text); }
.hint.fine { font-size: .7rem; margin-top: 1.25rem; }

/* ---------- Run now (admins) ---------- */
.run-buttons { margin-top: 0; }
.run-inset { margin-top: .75rem; }
.run-status b { font-weight: 600; }
.run-status.busy b { color: var(--accent); }
.run-status.ok b { color: var(--ok); }
.run-status.bad b { color: var(--danger); }
.warn { color: var(--danger); }
.row input[type="password"].token { width: auto; flex: 1; min-width: 0; max-width: 62%; }
.row input[type="date"] {
  border: 0; background: none; color: var(--text); font: inherit; font-size: 16px; min-height: 44px; text-align: right;
}
#run-form .msg { margin: .5rem 16px; }

/* ---------- Motion (stopped when the device asks for reduced motion) ---------- */
.content.enter > * { animation: enter .24s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Larger screens: a little more room */
@media (min-width: 700px) {
  .paper { padding: 20px 22px 0; }
  details.more { margin-left: -22px; margin-right: -22px; }
  summary, .pane { padding-left: 22px; padding-right: 22px; }
  .tabs { padding: 0 16px; }
  .compact-row { padding-left: 22px; padding-right: 22px; }
}

/* Journal lists: the search box and the rows it hides */
.journal-filter { margin: 0 16px .75rem; max-width: var(--measure); }
.is-hidden { display: none !important; }

/* ---------- Day filters: show (all / highlights / unread), sort, group ---------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .5rem; margin: 0 0 .85rem; }
.filter-bar .seg { flex: none; }
.filter-bar .seg button { min-height: 32px; padding: 0 .7rem; }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.chip-toggle {
  flex: none; display: inline-flex; align-items: center; min-height: 32px; padding: 0 .75rem; border: 0; border-radius: 999px;
  background: var(--chip); color: var(--muted); font-family: var(--font-ui); font-size: .76rem; font-weight: 500;
  white-space: nowrap; cursor: pointer; transition: transform .12s var(--ease);
}
.chip-toggle:active { transform: scale(.96); }
.chip-toggle.quiet { background: transparent; text-decoration: underline; }
.group.flat { margin-top: 0; }

/* ---------- Browse: more filters, recent searches, matched words ---------- */
.browse-bar .filters + .filters { margin-top: .4rem; }
.recent { display: flex; align-items: center; gap: .4rem; margin-top: .5rem; overflow-x: auto; scrollbar-width: none; }
.recent::-webkit-scrollbar { display: none; }
.recent-label { flex: none; color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 .08em; }
.row-snip {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: .2rem; color: var(--muted); font-size: .78rem; line-height: 1.45;
}

/* Offline notice, saving feedback, bookmark pop, author links */
.net-banner {
  position: fixed; z-index: 6; left: 0; right: 0; margin: 0 auto; top: calc(var(--top) + 8px);
  width: fit-content; max-width: calc(100% - 32px); padding: .4rem .9rem; border-radius: 999px; text-align: center;
  background: var(--primary); color: var(--on-primary); font-size: .76rem; font-weight: 500; box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
}
.net-banner[hidden] { display: none; }
.paper.saving .actions { opacity: .65; transition: opacity .15s; }
.pop .icon, .btn.pop { animation: pop .32s var(--ease); }
@keyframes pop { 0% { transform: scale(.8); } 55% { transform: scale(1.18); } 100% { transform: scale(1); } }
.author-link {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--link); text-align: left; cursor: pointer;
}
.author-link:hover { text-decoration: underline; }
.authors .orcid { font-size: .7rem; margin-left: .35rem; color: var(--muted); border: .5px solid var(--line); border-radius: 999px; padding: 0 .45em; }

/* A priority journal's paper: its star in the line above the title */
.prio { color: var(--link); font-weight: 600; }
