@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  color-scheme: light;
  --bg: #f6f3ed;
  --panel: #ffffff;
  --panel-soft: #f9f7f2;
  --ink: #1c2327;
  --muted: #657077;
  --line: #ded8ce;
  --accent: #2f6f68;
  --accent-ink: #ffffff;
  --shadow: 0 18px 48px rgba(39, 35, 28, 0.14);
  --rail-width: 360px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  font-family: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
}

.paper-rail {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  z-index: 5;
}

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: #b9aea1;
  background: var(--panel-soft);
}

.search-box {
  display: block;
  padding: 12px 16px;
}

.search-box input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel-soft);
  color: var(--ink);
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 104, 0.14);
}

.status-line {
  padding: 0 16px 10px;
  color: var(--muted);
  font-size: 13px;
}

.paper-list {
  min-height: 0;
  overflow: auto;
  padding: 0 10px 14px;
}

.paper-item {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
}

.paper-item:hover {
  background: var(--panel-soft);
}

.paper-item[aria-current="page"] {
  border-color: rgba(47, 111, 104, 0.36);
  background: rgba(47, 111, 104, 0.08);
}

.paper-item strong {
  font-size: 14px;
  line-height: 1.25;
}

.paper-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.reader-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.reader-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 243, 237, 0.94);
  backdrop-filter: blur(16px);
}

.digest-progress {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  min-width: 0;
  max-width: 100%;
  gap: 6px;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 104, 0.18);
  border-radius: 8px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.72);
}

.digest-progress[hidden] {
  display: none;
}

.digest-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.digest-icon {
  position: relative;
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
}

.digest-icon svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.digest-step[data-state="complete"] {
  color: var(--accent);
}

.digest-step[data-state="complete"] .digest-icon {
  border-color: rgba(47, 111, 104, 0.3);
  background: rgba(47, 111, 104, 0.12);
  color: var(--accent);
}

.digest-step[data-state="active"] {
  color: var(--ink);
}

.digest-step[data-state="active"] .digest-icon {
  border-color: rgba(47, 111, 104, 0.42);
  background: var(--accent);
  color: var(--accent-ink);
  animation: digestIconLift 1.2s ease-in-out infinite;
}

.digest-step[data-state="active"] .digest-icon::after {
  position: absolute;
  inset: -5px;
  border: 2px solid rgba(47, 111, 104, 0.25);
  border-radius: 12px;
  content: "";
  animation: digestPulse 1.2s ease-out infinite;
}

.digest-step[data-state="error"] {
  color: #9f3328;
}

.digest-step[data-state="error"] .digest-icon {
  border-color: rgba(159, 51, 40, 0.4);
  background: rgba(159, 51, 40, 0.12);
  color: #9f3328;
}

.digest-step[data-state="skipped"] .digest-icon {
  border-color: #d2bc7a;
  background: #fff4cf;
  color: #8a6a12;
}

.digest-connector {
  position: relative;
  width: 26px;
  height: 2px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.digest-connector[data-state="complete"] {
  background: rgba(47, 111, 104, 0.42);
}

.digest-connector[data-state="active"]::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  content: "";
  animation: digestFlow 1.1s linear infinite;
}

.reader-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.action-link:hover {
  border-color: #b9aea1;
  background: var(--panel-soft);
}

.auth-action {
  min-width: 76px;
}

.digest-action {
  min-width: 82px;
}

.digest-action[hidden] {
  display: none;
}

.auth-identity {
  display: inline-flex;
  align-items: center;
  max-width: 160px;
  height: 40px;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 104, 0.28);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(47, 111, 104, 0.08);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-identity[hidden] {
  display: none;
}

.view-switcher {
  display: inline-flex;
  align-items: center;
  height: 40px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.view-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 100%;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.view-mode:last-child {
  border-right: 0;
}

.view-mode[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.view-mode:disabled {
  cursor: default;
}

.reader-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #d9d4cc;
}

.content-viewer {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 28px;
  background: #eee9df;
}

.pdf-viewer {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 20px;
  background: #d9d4cc;
}

.content-viewer[hidden],
.pdf-viewer[hidden] {
  display: none;
}

.paper-article {
  width: min(100%, 920px);
  margin: 0 auto;
  border: 1px solid rgba(222, 216, 206, 0.92);
  border-radius: 8px;
  padding: clamp(24px, 5vw, 56px);
  background: #fffdf8;
  box-shadow: 0 16px 42px rgba(41, 35, 28, 0.12);
}

.paper-header h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
}

.paper-subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
}

.paper-meta {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.paper-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.paper-tags span {
  border: 1px solid rgba(47, 111, 104, 0.22);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(47, 111, 104, 0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.paper-summary {
  margin: 28px 0 34px;
  border-left: 3px solid var(--accent);
  padding: 0 0 0 16px;
  color: #364246;
  font-size: 17px;
  line-height: 1.75;
}

.paper-rendered {
  min-width: 0;
  max-width: 100%;
  color: #1c2327;
  font-size: 17px;
  line-height: 1.85;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.paper-rendered h2,
.paper-rendered h3,
.paper-rendered h4 {
  margin: 2.1em 0 0.75em;
  color: #151b1f;
  line-height: 1.22;
}

.paper-rendered h2 {
  font-size: 28px;
}

.paper-rendered h3 {
  font-size: 22px;
}

.paper-rendered h4 {
  font-size: 18px;
}

.paper-rendered p {
  margin: 0 0 1rem;
}

.paper-rendered a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.paper-rendered code {
  border-radius: 5px;
  padding: 0.1em 0.32em;
  background: rgba(47, 111, 104, 0.1);
  color: #1d514c;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92em;
}

.paper-abstract,
.paper-callout {
  margin: 1.3rem 0 1.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  background: #f8f6f0;
}

.paper-abstract h3,
.paper-callout h3 {
  margin-top: 0;
}

.paper-center {
  margin: 1.1rem 0 1.4rem;
  text-align: center;
}

.paper-quote {
  margin: 1.1rem 0 1.4rem;
  border-left: 4px solid var(--line);
  padding: 0.1rem 0 0.1rem 1rem;
  color: var(--muted);
}

.paper-math-block {
  margin: 1rem 0;
  overflow-x: auto;
  border-radius: 8px;
  padding: 1rem 0.5rem;
  background: rgba(28, 35, 39, 0.04);
}

.paper-ref {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.05rem 0.42rem;
  background: rgba(47, 111, 104, 0.1);
  color: var(--accent);
  font-size: 0.9em;
}

.paper-listing,
.paper-figure {
  margin: 1.3rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.paper-listing figcaption,
.paper-figure figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.78rem 1rem;
  background: #f7f2e8;
  color: var(--muted);
  font-size: 13px;
}

.paper-listing figcaption {
  border-bottom: 1px solid var(--line);
}

.paper-figure figcaption {
  border-top: 1px solid var(--line);
}

.paper-listing pre {
  margin: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem;
  background: #1c2327;
  color: #f5f7fb;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  line-height: 1.65;
}

.paper-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  background: #ffffff;
}

.paper-figure-missing-copy {
  padding: 1rem;
  color: var(--muted);
}

.paper-caption {
  margin: 0.4rem 0 1rem;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.paper-list-block {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0 1.4rem;
  padding-left: 1.5rem;
}

.paper-list-block .paper-list-block {
  margin-top: 0.6rem;
}

.paper-description-list {
  display: grid;
  grid-template-columns: minmax(7rem, auto) minmax(0, 1fr);
  gap: 0.45rem 0.8rem;
  margin: 1rem 0;
}

.paper-description-list dt {
  color: #151b1f;
  font-weight: 700;
}

.paper-description-list dd {
  margin: 0;
}

.paper-bibliography {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0 1.4rem;
  padding-left: 1.5rem;
}

.paper-table-block {
  margin: 1.2rem 0;
  overflow-x: auto;
}

.paper-tabular {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1rem auto;
  overflow-x: auto;
  border-collapse: collapse;
}

.paper-tabular td {
  border: 1px solid var(--line);
  padding: 0.45rem 0.65rem;
}

.pdf-page {
  display: block;
  width: min(100%, 1120px);
  height: auto;
  margin: 0 auto 18px;
  background: #ffffff;
  box-shadow: 0 12px 36px rgba(41, 35, 28, 0.18);
}

.pdf-loading {
  display: grid;
  min-height: 100%;
  place-content: center;
  color: var(--muted);
  font-weight: 600;
}

.content-loading {
  display: grid;
  min-height: 100%;
  place-content: center;
  color: var(--muted);
  font-weight: 600;
}

@keyframes digestIconLift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

@keyframes digestPulse {
  0% {
    opacity: 0.95;
    transform: scale(0.86);
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

@keyframes digestFlow {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state strong {
  color: var(--ink);
}

@media (max-width: 860px) {
  html,
  body {
    width: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .paper-rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(88vw, var(--rail-width));
    box-shadow: var(--shadow);
    transform: translateX(-104%);
    transition: transform 0.2s ease;
  }

  .app-shell[data-sidebar-open="true"] .paper-rail {
    transform: translateX(0);
  }

  .reader-bar {
    position: sticky;
    top: env(safe-area-inset-top);
    z-index: 25;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 64px;
    padding: 8px 10px;
  }

  .digest-progress {
    gap: 4px;
    padding: 4px 6px;
  }

  .digest-step {
    gap: 4px;
    font-size: 11px;
  }

  .digest-icon {
    width: 28px;
    height: 28px;
  }

  .digest-connector {
    width: 18px;
  }

  .action-link {
    min-width: 48px;
    height: 38px;
    padding: 0 9px;
    font-size: 13px;
  }

  .reader-actions {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .reader-actions::-webkit-scrollbar {
    display: none;
  }

  .reader-actions > * {
    flex: 0 0 auto;
  }

  .auth-action {
    min-width: 58px;
  }

  .digest-action {
    min-width: 64px;
  }

  .auth-identity {
    max-width: 96px;
    height: 38px;
    padding: 0 8px;
    font-size: 12px;
  }

  .view-switcher {
    height: 38px;
  }

  .view-mode {
    min-width: 44px;
    padding: 0 8px;
    font-size: 12px;
  }

  .content-viewer {
    padding: 12px;
    overscroll-behavior-y: contain;
  }

  .paper-article {
    padding: 22px 18px;
  }

  .paper-header h1 {
    font-size: 28px;
  }

  .paper-subtitle {
    font-size: 17px;
  }

  .paper-summary,
  .paper-rendered {
    font-size: 16px;
  }

  .paper-rendered h2 {
    font-size: 23px;
  }

  .paper-rendered h3 {
    font-size: 19px;
  }

  .pdf-viewer {
    padding: 10px;
    overscroll-behavior-y: contain;
  }

  .pdf-page {
    margin-bottom: 10px;
  }
}

@media (max-width: 520px) {
  .reader-bar {
    min-height: 60px;
    padding-inline: 8px;
  }

  .icon-button,
  .action-link,
  .view-switcher {
    min-height: 44px;
  }

  .auth-identity {
    display: none;
  }

  .digest-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .digest-connector {
    width: 12px;
  }
}

@media (min-width: 861px) {
  .rail-close {
    display: none;
  }

  .app-shell[data-sidebar-open="false"] {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .app-shell[data-sidebar-open="false"] .paper-rail {
    overflow: hidden;
    border-right: 0;
  }
}

/* A persistent, readable job panel outside the compact action toolbar. */
#digestProgress { display:grid; justify-self:stretch; gap:10px; margin:12px 16px; padding:14px 16px; overflow:visible; border-radius:12px; }
#digestProgress[hidden] { display:none; }
.digest-steps { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.digest-detail { margin:0; line-height:1.6; overflow-wrap:anywhere; white-space:pre-wrap; }
.digest-meta { color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
#digestActivity { width:100%; height:8px; accent-color:var(--accent); }
#digestProgress[data-result="error"] { border-color:#b54646; }
@media(max-width:600px) { #digestProgress { margin:10px; padding:12px; } }
.reader-pane { grid-template-rows:auto auto minmax(0,1fr); }
#digestProgress { grid-row:2; }
.reader-stage { grid-row:3; }

/* Drawer tabs share one list rail; review fills the existing reader pane. */
.app-shell[hidden],.draft-review[hidden],.rail-panel[hidden],.published-reader[hidden],#draftReviewBtn[hidden],#draftReviewMore[hidden]{display:none!important}
.rail-tabs{display:flex;gap:6px;padding:12px 12px 8px;border-bottom:1px solid var(--line);flex-shrink:0}
.rail-tabs button{flex:1;min-width:0;min-height:44px;padding:9px 10px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--muted);font-weight:600;cursor:pointer}
.rail-tabs button[aria-selected=true]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.rail-tabs button:focus-visible,#draftReviewList button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.rail-panel{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0}
.rail-panel .paper-list{flex:1}
.published-reader{height:100%;min-height:0;position:relative}
.draft-review{height:100%;min-height:0;display:flex;flex-direction:column;gap:10px;padding:16px;color:var(--ink);background:var(--panel)}
.draft-review header h2{margin:0;font-size:18px}.draft-review header h2:focus{outline:none}
.draft-review-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:12px}
.draft-review button,.draft-review-tools button,.draft-review-more{min-height:40px;padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--ink);cursor:pointer}
.draft-review-more{margin:8px 12px 12px;flex-shrink:0}
.draft-review button:disabled,.draft-review-tools button:disabled,.draft-review-more:disabled{opacity:.55;cursor:default}
#draftReviewList button{width:100%;text-align:left;background:transparent;overflow-wrap:anywhere;font:inherit;cursor:pointer}
#draftReviewList button[aria-current=page]{border-color:var(--accent);background:var(--panel-soft)}
.draft-review-document{display:flex;flex-direction:column;min-width:0;min-height:0;gap:6px;overflow:auto;flex:1}
#draftReviewTitle{font-size:20px;line-height:1.4;margin:0;overflow-wrap:anywhere}
#draftReviewVersion{margin:0;color:var(--muted);font-size:13px}
#draftReviewPreview{flex:1;min-height:250px;display:flex;align-items:stretch}
#draftReviewPreview iframe{width:100%;height:100%;min-height:250px;border:1px solid var(--line);flex:1}
.review-placeholder{align-self:center;width:100%;text-align:center;padding:24px;color:var(--muted);line-height:1.7}
.draft-review summary{cursor:pointer;padding:6px 0;color:var(--muted);font-size:14px}
#draftReviewSummary{white-space:pre-wrap;max-height:120px;overflow:auto;margin:0;line-height:1.7}
#draftReviewStatus{margin:0;overflow-wrap:anywhere;font-size:14px;line-height:1.5}
.draft-review footer{display:flex;align-items:center;gap:16px;border-top:1px solid var(--line);padding-top:10px;flex-shrink:0}
.draft-review-confirmation{flex:1;min-width:0}
.draft-review footer p{margin:4px 0;font-size:13px;color:var(--muted)}
#draftReviewPublish{flex-shrink:0;background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.app-shell[data-reader-view=review] #digestProgress,.app-shell[data-reader-view=review] .view-switcher,.app-shell[data-reader-view=review] #digestBtn,.app-shell[data-reader-view=review] #researchBtn{display:none!important}
.drawer-backdrop{display:none}
@media(max-width:860px){.paper-rail{z-index:40}.app-shell[data-sidebar-open=true] .drawer-backdrop{display:block;position:fixed;inset:var(--mmrnd-site-header-height,0px) 0 0;z-index:30;border:0;background:rgba(20,30,40,.3);cursor:pointer}.draft-review{padding:10px;padding-bottom:max(10px,env(safe-area-inset-bottom));gap:6px}.draft-review footer{gap:8px}.draft-review footer button{max-width:115px}.draft-review footer label{font-size:14px}.draft-review footer p{font-size:12px}#draftReviewTitle{font-size:17px}}

.digest-progress-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
#digestDismiss { flex-shrink:0; padding:6px 10px; min-height:36px; border:1px solid var(--line); border-radius:8px; background:var(--panel); color:var(--ink); cursor:pointer; }
#digestDismiss[hidden] { display:none; }

.generation-settings{max-width:900px;margin:auto;padding:24px 16px 48px;line-height:1.7}.generation-settings[hidden]{display:none!important}.generation-settings header,.generation-settings footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.generation-settings h1{font-size:1.5rem}.generation-settings fieldset{margin:18px 0;padding:18px;border:1px solid #aab7cc;border-radius:16px;min-width:0}.generation-settings legend{font-weight:700}.generation-settings label{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0}.generation-settings input[type=number]{width:90px}.generation-settings input,.generation-settings textarea{font:inherit;padding:8px;border:1px solid #aab7cc;border-radius:8px;max-width:100%}.generation-settings textarea{width:100%;box-sizing:border-box}.generation-settings label:has(textarea){display:block}.generation-checks{display:flex;gap:8px 16px;flex-wrap:wrap}.generation-checks label{justify-content:flex-start}.generation-settings input[type=checkbox]{width:20px;height:20px;flex-shrink:0}.generation-settings button{min-height:44px;padding:10px 16px}.generation-settings button[type=submit]{background:#244b83;color:white;border:0;border-radius:10px}.generation-settings p{overflow-wrap:anywhere}.app-shell[hidden]{display:none!important}
.generation-settings{height:100dvh;overflow-y:auto;box-sizing:border-box;overscroll-behavior:contain}
.generation-settings button{font:inherit;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--ink)}.generation-settings button[type=submit]{background:var(--accent);color:var(--accent-ink)}.generation-settings button:disabled{opacity:.55;cursor:default}.generation-settings fieldset{background:var(--panel)}.generation-settings h1:focus{outline:none}.generation-settings input,.generation-settings textarea{background:var(--panel);color:var(--ink)}

/* Compact SVG actions; native labels remain available to keyboard and screen-reader users. */
.toolbar-group{display:inline-flex;align-items:center;gap:6px}.reader-actions{gap:8px}
.toolbar-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;min-width:44px;height:44px;padding:0;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--ink);cursor:pointer}
.toolbar-icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.toolbar-icon:hover{background:var(--panel-soft);border-color:var(--accent);color:var(--accent)}.toolbar-icon:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.toolbar-icon:disabled{cursor:default;opacity:.55}.toolbar-icon[hidden]{display:none!important}
.view-switcher{height:44px;border-radius:10px}.view-switcher .toolbar-icon{height:42px;width:44px;min-width:44px;border:0;border-right:1px solid var(--line);border-radius:0}.view-switcher .toolbar-icon:last-child{border-right:0}.view-switcher .toolbar-icon[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);opacity:1}
#authBtn[data-session=signed-in] [data-auth-icon=login],#authBtn[data-session=signed-out] [data-auth-icon=logout]{display:none}
.app-shell[data-reader-view=review] .generation-actions{display:none}
@media(max-width:600px){.reader-actions{gap:6px}.reader-bar{gap:8px}.auth-identity{display:none}}

.rail-preferences{display:flex;justify-content:flex-end;flex-shrink:0;padding:8px 12px;border-top:1px solid var(--line)}.rail-preferences .mmrnd-language{margin:0}
.reader-bar{grid-template-columns:40px minmax(0,1fr)}.reader-actions{justify-self:end}
@media(max-width:600px){.reader-bar{padding:8px;gap:6px;grid-template-columns:40px minmax(0,1fr)}.reader-actions,.toolbar-group{gap:4px}.toolbar-icon{flex-basis:40px;width:40px;min-width:40px;height:40px}.view-switcher{height:40px}.view-switcher .toolbar-icon{width:40px;min-width:40px;height:38px}}
