/* Daily Chinese reading, in the app's paper, jade and cinnabar palette. */
.news-shell { width: min(1120px, 100%); margin: 0 auto; padding: 0 0 2rem; color: var(--fg); font-family: 'Noto Sans SC', system-ui, sans-serif; }
.news-shell[hidden], .news-shell [hidden] { display: none !important; }
/* Public headlines can paint while the embedded app is still loading the account. */
.hr-account-pending body.view-news :is(.news-grid, .news-toolbar, .news-pull, .news-status, .news-empty, .news-more) { visibility: visible; }
.hr-account-pending body.view-news .news-grid { pointer-events: none; }
.news-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; }
html:has(body.view-news) { overscroll-behavior-y: contain; }
.news-pull { display: flex; align-items: center; justify-content: center; gap: .65rem; height: var(--news-pull-distance, 0px); overflow: hidden; opacity: 0; color: var(--ui-active); pointer-events: none; transition: height .22s ease, opacity .18s ease; }
.news-pull[data-state="idle"] { transition: none; }
.news-pull[data-state="pulling"], .news-pull[data-state="ready"] { opacity: 1; transition: none; }
.news-pull[data-state="loading"] { position: fixed; top: 50%; left: 50%; z-index: 40; transform: translate(-50%, -50%); box-sizing: border-box; height: 56px; max-width: calc(100% - 2rem); padding: 0 1rem; overflow: visible; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface-raised); box-shadow: var(--shadow-float); opacity: 1; transition: none; }
.news-pull-mark { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; box-sizing: border-box; border: 1px solid var(--ui-active-line); border-radius: 8px; background: var(--ui-active-tint); }
.news-pull-glyph { display: none; font: 500 18px/1 var(--font-hanzi); }
.news-pull-arrow { transition: transform .2s ease; }
.news-pull[data-state="ready"] .news-pull-arrow { transform: rotate(180deg); }
.news-pull[data-state="loading"] .news-pull-arrow { display: none; }
.news-pull[data-state="loading"] .news-pull-glyph { display: block; }
.news-pull-label { flex: 0 0 auto; color: var(--fg-60); font-size: .75rem; line-height: 1.5; letter-spacing: .06em; }
.news-pull-dots { display: none; align-items: center; gap: 4px; height: 12px; }
.news-pull[data-state="loading"] .news-pull-dots { display: flex; }
.news-pull-dots span { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .35; }
.news-pull[data-state="loading"] .news-pull-dots span { animation: news-ink-pulse 1.5s ease-in-out var(--news-dot-delay, 0s) infinite; }
.news-pull-dots span:nth-child(2) { --news-dot-delay: .18s; }
.news-pull-dots span:nth-child(3) { --news-dot-delay: .36s; }
@keyframes news-ink-pulse { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: .85; transform: translateY(-2px); } }
.news-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--rule); }
.news-categories { display: flex; gap: .4rem; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.news-categories::-webkit-scrollbar { display: none; }
.news-categories button { flex: 0 0 auto; min-height: 44px; padding: .5rem 1rem; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--fg-60); font: 550 .83rem 'Noto Sans SC', sans-serif; cursor: pointer; }
.news-categories button[aria-pressed="true"] { background: var(--ui-active); color: #fff; }
.news-count { flex-shrink: 0; color: var(--fg-60); font-size: .73rem; }
.news-today { flex-shrink: 0; min-height: 44px; padding: .4rem .65rem; border: 0; background: transparent; color: var(--ui-active-deep); font: 550 .75rem 'Noto Sans SC', sans-serif; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.news-status { min-height: 1.4em; margin: .7rem 0; color: var(--fg-60); font-size: .75rem; line-height: 1.6; }
.news-status:empty { display: none; }
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.35rem; margin-top: 1.1rem; }
.news-card { min-width: 0; overflow: hidden; border: 1px solid var(--rule); border-radius: 18px; background: var(--surface-raised); }
.news-card:first-child { grid-column: span 2; }
.news-card-open { display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.news-card-art { display: grid; place-items: center; position: relative; overflow: hidden; width: 100%; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #d4e3d9, #f1ede1); }
.news-card:first-child .news-card-art { aspect-ratio: 2.2; }
.news-card-art::before { content: attr(data-glyph); color: #2f62582b; font: 500 5rem 'Noto Sans SC', serif; }
.news-card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.news-card-badge { position: absolute; top: .85rem; left: .85rem; padding: .3rem .6rem; border: 1px solid #ffffff6b; border-radius: 6px; background: #f6f4eeed; color: #244d46; font-size: .68rem; font-weight: 650; }
.news-card-body { display: flex; flex: 1; flex-direction: column; width: 100%; box-sizing: border-box; gap: .7rem; padding: 1.15rem; }
.news-card-meta { display: flex; align-items: center; gap: .5rem; color: var(--fg-60); font-size: .68rem; line-height: 1.6; }
.news-card-meta .news-source { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-card-meta time { flex-shrink: 0; margin-left: auto; }
.news-source-dot { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--ui-active); }
.news-card h3 { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; margin: 0; font-size: 1.07rem; line-height: 1.65; font-weight: 650; overflow-wrap: anywhere; }
.news-card:first-child h3 { font-size: clamp(1.2rem, 2.2vw, 1.65rem); line-height: 1.6; }
.news-card-summary { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin: 0; color: var(--fg); font-size: 1rem; line-height: 1.8; overflow-wrap: anywhere; }
.news-card-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: .3rem; color: var(--ui-active-deep); font-size: .72rem; }
.news-card-bottom span:last-child { font-size: 1.1rem; }
.news-empty { display: flex; flex-direction: column; align-items: center; gap: .8rem; padding: 3rem 1rem; text-align: center; }
.news-empty-glyph { color: var(--ui-active-line); font-size: 4rem; line-height: 1.2; }
.news-empty p { max-width: 30rem; color: var(--fg-60); font-size: .9rem; line-height: 1.9; }
.news-action { display: inline-flex; justify-content: center; align-items: center; gap: .7rem; min-height: 44px; padding: .65rem 1.15rem; border: 1px solid var(--ui-active); border-radius: 999px; background: var(--ui-active); color: #fff; font: 550 .8rem 'Noto Sans SC', sans-serif; cursor: pointer; }
.news-more { display: flex; margin: 1.5rem auto 0; }
.news-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--rule); color: var(--fg-60); font-size: .7rem; line-height: 1.8; }
.news-dialog { position: fixed; inset: auto 0 0; box-sizing: border-box; width: 100%; max-width: none; height: 90vh; height: 90dvh; max-height: 90dvh; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--fg); font-family: 'Noto Sans SC', sans-serif; }
.news-dialog[open] { animation: news-sheet-enter .26s cubic-bezier(.2,.7,.2,1); }
@keyframes news-sheet-enter { from { transform: translateY(100%); } to { transform: translateY(0); } }
.news-dialog::backdrop { background: #14251e8c; backdrop-filter: blur(8px); }
html:has(#newsDialog[open]), body:has(#newsDialog[open]) { overflow: hidden; }
.news-sheet-handle { display: grid; place-items: center; width: 100%; height: 40px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--fg-60); cursor: grab; touch-action: none; }
.news-sheet-handle span { display: block; width: 42px; height: 4px; border-radius: 999px; background: currentColor; opacity: .55; }
.news-sheet-handle:active { cursor: grabbing; }
.news-sheet-scroll { box-sizing: border-box; width: 100%; height: calc(100% - 40px); margin: 0; padding: 0 0 calc(1.25rem + env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: none; }
.news-sheet-scroll::-webkit-scrollbar { display: none; }
.news-sheet-scrollbar { position: absolute; top: 44px; bottom: max(8px, env(safe-area-inset-bottom, 0px)); right: 2px; width: 3px; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.news-sheet-scrollbar span { display: block; width: 100%; min-height: 28px; border-radius: 99px; background: #54665c80; }
.news-sheet-scroll[data-scrolling="true"] + .news-sheet-scrollbar { opacity: 1; }
.news-dialog #newsStoryBody > :not(img), .news-story-actions, .news-story-note { box-sizing: border-box; padding-inline: clamp(16px, 4vw, 28px); }
.news-story-image { display: block; width: 100%; max-height: 40dvh; margin: 0 0 1.1rem; border-radius: 0; object-fit: cover; }
#newsStoryTitle { margin: 1rem 0; font-size: clamp(1.5rem, 5.5vw, 1.9rem); font-weight: 650; line-height: 1.7; overflow-wrap: anywhere; }
.news-story-summary { white-space: pre-line; font-size: clamp(1.5rem, 4.5vw, 1.625rem); line-height: 1.8; overflow-wrap: anywhere; }
.news-dialog .news-card-meta { font-size: .875rem; }
/* News stays plain at every learning level; pronunciation appears in Fuffy on tap. */
#newsStoryBody .news-reading-text :is(.bop, .tooltip, .hanzi-gap) { display: none; }
#newsStoryBody .news-reading-text :is(.hanzi, .hanzi-glyph, .hanzi-punct, .punct-wrap) { display: inline; padding: 0; margin: 0; line-height: inherit; vertical-align: baseline; white-space: normal; }
#newsStoryBody .news-reading-text .hanzi { -webkit-box-decoration-break: clone; box-decoration-break: clone; }
#newsStoryBody .news-reading-text .hanzi.word > span[data-idx] { display: inline; width: auto; min-width: 0; }
.news-reading-text .reading-paragraph { margin: 0; }
.news-reading-text .reading-paragraph + .reading-paragraph { margin-top: .7em; }
.news-dialog > .study-dock { bottom: max(.75rem, env(safe-area-inset-bottom, 0px)); box-sizing: border-box; max-height: calc(90dvh - 52px); overflow-y: auto; }
.news-dialog:has(> .study-dock.visible:not(.minimized)) .news-sheet-scroll { padding-bottom: calc(var(--floating-panel-height, 0px) + 1.75rem + env(safe-area-inset-bottom, 0px)); }
.news-story-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem; margin-top: 1.5rem; }
.news-story-actions a { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; color: var(--ui-active-deep); font-size: .8rem; text-underline-offset: 4px; }
.news-story-note { margin: 1rem 0 0; color: var(--fg-60); font-size: .7rem; line-height: 1.8; }
.news-shell :is(button, a):focus-visible { outline: 2px solid var(--ui-active); outline-offset: 3px; }
.news-card:focus-within { outline: 2px solid var(--ui-active); outline-offset: 3px; }
@media (hover: hover) { .news-card-open:hover .news-card-art img { transform: scale(1.035); } .news-categories button[aria-pressed="false"]:hover { background: var(--tint); } }
@media (max-width: 900px) { .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .news-card:first-child .news-card-art { aspect-ratio: 2.4; } }
@media (max-width: 560px) {
  .news-toolbar { gap: 0; }
  .news-count { display: none; }
  .news-categories { width: 100%; }
  .news-categories button { padding-inline: .85rem; }
  .news-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .news-card:first-child { grid-column: auto; }
  .news-card:first-child .news-card-art { aspect-ratio: 16 / 9; }
  .news-card-body { padding: 1rem; }
  .news-card h3, .news-card:first-child h3 { font-size: 1.375rem; }
  .news-card-summary { font-size: 1.375rem; }
}
@media (prefers-reduced-motion: reduce) { .news-card-art img, .news-pull, .news-pull-arrow { transition: none; } .news-pull[data-state="loading"] .news-pull-dots span, .news-dialog[open] { animation: none; } }
