/* Readability and keyboard refinements; loaded after the original theme. */
:root {
  /* Contrast: 5.63:1 on #f5f5ef; 5.99:1 on #fcfcf8. */
  --muted: #56664f;
}

/* Keep the green palette, with supporting copy readable at ordinary zoom. */
.home-chat .chat-subtitle,
.home-chat .chat-intro,
.home-chat .chat-intro p,
.today-head p,
.today-head .subtle,
.card-author,
.card-reason,
.chat-message,
.chat-message.assistant,
.chat-message.user,
.feedback,
.feed-slide p,
.result p,
.saved-card p,
.demo-info p,
.subtle,
.progress-note,
.book-context p,
.book-limits,
.fit-list li,
.guide-outline li,
.starting-point p,
.source-guide-links small,
.reflection,
.reflection small,
.exercise-check li,
.access-list span:last-child,
.library-result-count,
dialog p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.prose {
  font-size: 16px;
  color: #465c40;
}

.eyebrow,
.home-chat > .eyebrow,
.chat-intro .eyebrow,
.home-chat .chat-hero .eyebrow,
.detail-layout .detail-book-header .eyebrow,
.takeaway .eyebrow,
dialog .eyebrow,
.card-category,
.chat-speaker,
.chat-disclaimer,
.composer-footer .chat-status,
.composer-hint,
.story-meta,
.read-header,
.guide-reference,
.access-kind,
.card-reading-status,
.feed-hint,
.stream-title,
.site-footer,
.site-footer button,
.no-pressure,
.stage-note,
.source-label,
.note-label,
.reader-upload,
.reader-upload small,
.reader-upload input,
.saved-link .badge,
.guide-outline li span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.eyebrow,
.detail-layout .detail-book-header .eyebrow,
.access-kind {
  letter-spacing: .08em;
}

.detail-layout .detail-book-header p {
  font-size: 14px;
  color: var(--muted);
}

.edition-line,
.reading-level {
  font-size: 13px !important;
  color: var(--muted) !important;
}

.quote-source,
.quote-source .source-button,
.source-button {
  color: var(--muted) !important;
  font-size: 12px !important;
  line-height: 1.65;
}

.home-chat .chat-form textarea,
textarea,
input[type="text"],
.search-form input {
  font-size: 16px;
}

.home-chat .chat-form textarea::placeholder,
textarea::placeholder,
input::placeholder {
  color: var(--muted);
  opacity: 1;
}

/* Large targets need not add visual weight to quiet actions. */
button {
  min-height: 44px;
}

.icon-button,
.send-button,
.daily-actions .icon-button,
.header-actions .icon-button,
.header-actions .saved-link {
  min-width: 44px;
  width: 44px;
  min-height: 44px;
  height: 44px;
}

.send-button {
  flex-basis: 44px;
}

.primary,
.daily-actions .primary,
.secondary,
.quiet,
.today-head .quiet,
.back,
.save-inline,
.card-explore,
.chat-prompts button,
.chat-links button,
.chat-links a,
.suggestions button,
.library-shelves button,
.local-reader-toolbar button,
.guide-reference button,
.guide-outline summary,
.source-guide-links summary,
.source-guide-links a {
  min-height: 44px;
  font-size: 14px;
}

.quiet,
.today-head .quiet,
.back,
.save-inline,
.card-explore,
.chat-prompts button,
.chat-links button,
.chat-links a,
.suggestions button,
.library-shelves button,
.local-reader-toolbar button,
.guide-reference button,
.guide-outline summary,
.source-guide-links summary,
.source-guide-links a,
.feed-slide p,
#menu div {
  color: var(--muted);
}

.library-shelves button.selected {
  color: #f8faef;
}

.chat-prompts button,
.library-shelves button,
.chat-links button,
.chat-links a {
  padding: 10px 14px;
}

.chat-links a,
.source-guide-links a,
.source-link {
  display: inline-flex;
  align-items: center;
}

.source-link {
  min-height: 44px;
  font-size: 14px;
  color: var(--muted);
}

.demo-info summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 6px 4px;
}

.reflection summary,
.guide-outline summary,
.source-guide-links summary {
  min-height: 44px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.composer-footer .chat-status {
  max-width: none;
}

.composer-footer {
  gap: 14px;
}

.card-top {
  align-items: flex-start;
}

.card-index {
  color: var(--muted);
}

.language-switch {
  flex-shrink: 0;
}

.language-switch button {
  min-width: 44px;
  min-height: 44px;
  font-size: 13px;
}

.language-switch button:not([aria-pressed="true"]),
.language-switch > span {
  color: var(--muted);
}

.guide-reference,
.today-head,
.read-header {
  flex-wrap: wrap;
}

.guide-reference button {
  white-space: normal;
  text-align: left;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.feed-window:focus-visible,
.reader-text:focus-visible,
.language-switch button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.home-chat .chat-form:focus-within {
  border-color: var(--green);
  outline: 2px solid var(--green);
  outline-offset: 4px;
}

/* The new language choice gets its own row before controls can crowd. */
@media (max-width: 560px) {
  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    column-gap: 4px;
    row-gap: 6px;
    height: auto;
    min-height: 120px;
    padding: 10px 16px;
  }

  .site-header .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    font-size: 22px;
    gap: 6px;
  }

  .site-header .brand svg {
    width: 22px;
    height: 22px;
  }

  .header-actions {
    display: contents;
  }

  .header-actions .saved-link {
    grid-column: 2;
    grid-row: 1;
    padding: 0;
  }

  #menu-toggle {
    grid-column: 3;
    grid-row: 1;
  }

  .language-switch {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
    margin-right: 0;
    padding: 2px;
  }

  #menu {
    top: calc(100% - 4px);
    right: 16px;
    max-width: calc(100vw - 32px);
  }

  .home-chat {
    padding-top: 16px;
  }

  .home-chat .chat-form textarea,
  .search-form input,
  textarea,
  input[type="text"] {
    font-size: 16px;
  }

  .feed-slide {
    height: auto;
    min-height: 100%;
  }

  .page-head {
    gap: 10px;
    flex-wrap: wrap;
  }

  .site-footer {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* At phone widths with enough room, retain a compact single header row. */
@media (min-width:401px) and (max-width:560px){.site-header{display:flex;justify-content:space-between;min-height:84px;height:84px;padding:0 16px}.header-actions{display:flex;gap:2px}.language-switch{margin-right:2px}.language-switch button{min-width:38px}.home-chat{padding-top:14px}.site-header .brand{font-size:22px}}
.resume-reading{border:1px solid #cdd8c5;border-radius:12px;padding:18px 22px;margin:20px auto 8px;max-width:730px;display:flex;align-items:center;justify-content:space-between;gap:18px;background:#eef2e7}.resume-reading .eyebrow{font-size:11px}.resume-reading p{margin:7px 0 0;font-size:15px;color:var(--ink);line-height:1.6}.resume-reading p span{font-size:13px;color:var(--muted)}.resume-reading .quiet{display:inline-flex;align-items:center;gap:10px;white-space:nowrap}.copy-book-link{font-size:13px!important}.share-link-input{width:100%;font-size:15px;color:var(--ink);padding:14px;border:1px solid #bac9ad;border-radius:7px;background:#fafbf6}@media(max-width:560px){.resume-reading{padding:16px;align-items:flex-start;flex-wrap:wrap;gap:5px}.resume-reading .quiet{margin-left:auto}.resume-reading p span{display:block}.detail-cta .copy-book-link{width:100%;text-align:left}}
.personal-data-page>p{font-size:15px;line-height:1.9;max-width:680px;color:var(--muted)}.personal-data-page>h2{font:30px/1.4 var(--serif);color:var(--ink);margin:26px 0 14px}.personal-data-page hr{border:0;border-top:1px solid var(--line);margin:30px 0}.personal-data-page input[type="file"]{display:block;max-width:100%;font-size:14px;margin:14px 0;color:var(--muted)}.personal-data-page .takeaway ul{padding-left:20px;font-size:14px;line-height:1.9;color:var(--muted)}.personal-data-page .takeaway h3{font-size:18px;font-weight:500;color:var(--ink)}#reading-data-status{margin:20px 0;font-size:15px;line-height:1.8;color:var(--ink)}#reading-data-status:focus-visible{outline:2px solid var(--green);outline-offset:5px}.noscript-message{max-width:650px;padding:30px;margin:auto;font-size:16px;line-height:1.8}
.swap-notice{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 13px;margin:0 0 14px;border-radius:8px;background:#e9efdf;color:var(--muted);font-size:13px;line-height:1.65}.swap-notice .quiet{white-space:nowrap;flex-shrink:0;font-size:13px}.daily-actions .swap-pick{font-size:13px;padding:7px 10px;color:var(--muted);border:1px solid #d1dcc7;border-radius:20px;min-height:44px}.swap-pick:hover{background:#e9efdf}
.shelf-tabs{display:flex;flex-wrap:wrap;gap:9px;margin:23px 0 5px}.shelf-tabs button{display:flex;align-items:center;gap:9px;min-height:44px;padding:9px 16px;border:1px solid #cdd8c5;border-radius:24px;font-size:14px;color:var(--muted)}.shelf-tabs button[aria-pressed="true"]{background:var(--green);border-color:var(--green);color:#fff}.shelf-tabs span{font-size:12px;opacity:.95}.shelf-empty{margin:55px 0}.shelf-empty h2{font:34px/1.4 var(--serif);font-weight:400;color:var(--ink)}html:lang(zh-CN) .shelf-empty h2{font-size:28px;line-height:1.7}.shelf-empty p{color:var(--muted);font-size:15px;line-height:1.9;max-width:490px;margin:15px auto 25px}
