/* =====================================================================
   enisnews reading screens — an editorial palette and components
   Activated with body.news-mode (set by the feed, reader, Review and Settings).
   ===================================================================== */

body.news-mode {
  --bg: #0e0d0b;
  --surface: #171512;
  --surface-2: #201d19;
  --surface-3: #2c2823;
  --line: rgba(255, 240, 220, .08);
  --line-2: rgba(255, 240, 220, .16);
  --text: #f4efe6;
  --text-2: #bcb3a4;
  --text-3: #80786b;
  --brand: #f5a524;
  --brand-2: #f97316;
  --brand-soft: rgba(245, 165, 36, .15);
  --brand-grad: linear-gradient(135deg, #f5a524 0%, #f97316 55%, #e5484d 100%);
  --glass: rgba(14, 13, 11, .84);
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", "Book Antiqua", Georgia, Cambria, "Times New Roman", serif;
  --nx-size: 19px;
}
[data-theme="light"] body.news-mode {
  --bg: #f5efe4;
  --surface: #fffdf8;
  --surface-2: #f0e9dc;
  --surface-3: #e5dccb;
  --line: rgba(70, 45, 10, .10);
  --line-2: rgba(70, 45, 10, .18);
  --text: #1c1a16;
  --text-2: #5c5549;
  --text-3: #8f8676;
  --brand: #c2410c;
  --brand-2: #ea580c;
  --brand-soft: rgba(194, 65, 12, .10);
  --brand-grad: linear-gradient(135deg, #ea580c 0%, #c2410c 60%, #9a3412 100%);
  --glass: rgba(245, 239, 228, .88);
}
body.news-mode::before {
  background:
    radial-gradient(800px 460px at 100% -10%, rgba(245, 165, 36, .10), transparent 60%),
    radial-gradient(600px 400px at -10% 0%, rgba(229, 72, 77, .06), transparent 60%);
}
body.news-mode #app { padding-bottom: calc(92px + var(--safe-b)); }
body.news-mode .btn.primary { box-shadow: 0 10px 26px -12px rgba(245, 120, 36, .8); }

.serif { font-family: var(--serif); }

/* ---------- top bar ---------- */
.nx-top {
  position: sticky; top: 0; z-index: 30;
  margin: 0 -16px;
  padding: calc(var(--safe-t) + 6px) 8px 6px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  backdrop-filter: saturate(1.4) blur(18px);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px;
  border-bottom: 1px solid var(--line);
}
.nx-back { display: inline-flex; align-items: center; gap: 2px; height: 38px; padding: 0 10px 0 4px; border-radius: 12px; color: var(--text-2); font-weight: 700; font-size: 14px; }
.nx-back svg { width: 22px; height: 22px; }
.nx-back:active { background: var(--surface-2); }
.nx-brand { text-align: center; line-height: 1.05; min-width: 0; }
.nx-brand .t { font: 800 19px/1.1 var(--serif); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-brand .s { font-size: 9.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); margin-top: 3px; }
.nx-top .icon-btn { position: relative; color: var(--text); }
.nx-badge { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--brand); color: #111; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; }

/* ---------- categories ---------- */
.nx-cats { position: sticky; top: calc(var(--safe-t) + 51px); z-index: 25; display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 10px 16px; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); scrollbar-width: none; }
.nx-cats::-webkit-scrollbar { display: none; }
.nx-chip { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-weight: 700; font-size: 13.5px; }
.nx-chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- feed ---------- */
.nx-section { font: 800 13px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin: 22px 2px 12px; display: flex; align-items: center; gap: 8px; }
.nx-section::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.nx-hero { position: relative; display: block; border-radius: 22px; overflow: hidden; background: var(--surface-2); aspect-ratio: 16 / 11; box-shadow: var(--shadow); }
.nx-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nx-hero .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .78) 100%); }
.nx-hero .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px; color: #fff; }
.nx-hero .cap .k { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #fbbf24; }
.nx-hero .cap .h { font: 800 23px/1.2 var(--serif); margin-top: 6px; letter-spacing: -.01em; text-wrap: balance; }
.nx-hero:active { transform: scale(.99); }
.nx-skel-hero { aspect-ratio: 16 / 11; border-radius: 22px; }
.nx-list { display: grid; }
.nx-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 2px; border-bottom: 1px solid var(--line); color: inherit; }
.nx-item:active { background: var(--surface-2); }
.nx-item .th { flex: none; width: 96px; height: 96px; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.nx-item .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nx-item .th.none { display: grid; place-items: center; color: var(--text-3); }
.nx-item .k { font-size: 10.5px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--brand); }
.nx-item .h { font: 700 17.5px/1.28 var(--serif); margin-top: 4px; letter-spacing: -.005em; text-wrap: pretty; }
.nx-item .b { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.nx-tag { height: 22px; padding: 0 8px; border-radius: 7px; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); color: var(--text-2); }
.nx-tag svg { width: 12px; height: 12px; }
.nx-tag.new { background: var(--brand); color: #111; }
.nx-tag.ok { background: var(--ok-soft); color: var(--ok); }
/* AI study pack ready */
.nx-tag.ai { background: rgba(167, 139, 250, .18); color: #c4b5fd; }
[data-theme="light"] body.news-mode .nx-tag.ai { background: rgba(109, 40, 217, .10); color: #6d28d9; }
body.news-mode .nx-hero .cap .nx-tag.ai { background: rgba(124, 58, 237, .88); color: #fff; } /* on the photo, both themes */
/* AI voice ready: the whole AI narration is kept on this device (lib/listen.js) */
.nx-tag.voice { background: rgba(56, 189, 248, .14); color: #7dd3fc; }
[data-theme="light"] body.news-mode .nx-tag.voice { background: rgba(3, 105, 161, .10); color: #0369a1; }
body.news-mode .nx-hero .cap .nx-tag.voice { background: rgba(3, 105, 161, .88); color: #fff; }
.nx-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nx-hero-tags:empty { display: none; }
.nx-chip { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.nx-chip svg { width: 14px; height: 14px; margin-left: -2px; }
.nx-more { margin: 18px auto 4px; display: flex; }
.nx-continue { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-2); color: inherit; }
.nx-continue .th { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; flex: none; background: var(--surface-2); }
.nx-continue .th img { width: 100%; height: 100%; object-fit: cover; }
.nx-continue .h { font: 700 15px/1.3 var(--serif); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nx-continue .grow { min-width: 0; }
.nx-continue > svg { flex: none; color: var(--text-3); }
.nx-cmeta { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--text-3); white-space: nowrap; }
/* the status gives way (…) before the tags on the right do */
.nx-cmeta .st { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nx-cmeta .nx-tag { flex: none; height: 20px; padding: 0 6px; font-size: 10.5px; }
/* swipeable "Continue reading" row: full-bleed, snaps card by card, next card peeks in */
.nx-carousel { display: flex; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.nx-carousel::-webkit-scrollbar { display: none; }
.nx-carousel > .nx-continue { flex: 0 0 min(86%, 420px); scroll-snap-align: start; }
.nx-carousel.one > .nx-continue { flex-basis: 100%; }
.nx-section .nx-carousel-nav { order: 2; display: flex; gap: 4px; margin: -8px 0; } /* after the section's rule line */
.nx-carousel-nav .icon-btn { width: 30px; height: 30px; }
@media (hover: none), (pointer: coarse) { .nx-carousel-nav { display: none !important; } }
.nx-dots { display: flex; justify-content: center; gap: 5px; margin-top: 10px; }
.nx-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line-2); transition: width .2s, background .2s; }
.nx-dots i.on { width: 16px; background: var(--brand); }

/* ---------- bottom nav ---------- */
.nx-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 0 12px var(--safe-b); background: var(--glass); -webkit-backdrop-filter: saturate(1.5) blur(20px); backdrop-filter: saturate(1.5) blur(20px); border-top: 1px solid var(--line); transition: transform .25s; }
.nx-nav .inner { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: 62px; }
.nx-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--text-3); position: relative; }
.nx-nav a svg { width: 23px; height: 23px; }
.nx-nav a.on { color: var(--text); }
.nx-nav a.on svg { color: var(--brand); }
.nx-nav a .nx-badge { top: 6px; right: calc(50% - 22px); }
body.kb-open .nx-nav { transform: translateY(115%); }
/* Review opened from the reader's "My words": the way back to the same place in the article */
.nx-resume { position: fixed; left: 0; right: 0; width: max-content; margin: 0 auto; bottom: calc(74px + var(--safe-b)); z-index: 49; height: 44px; padding: 0 18px; border-radius: 99px; display: flex; align-items: center; gap: 8px; background: var(--brand-grad); color: #fff; font-size: 14.5px; font-weight: 800; box-shadow: 0 12px 30px -12px rgba(245, 120, 36, .9); white-space: nowrap; animation: rise .3s cubic-bezier(.2, .8, .2, 1) both; }
.nx-resume svg { width: 18px; height: 18px; }
.nx-resume[hidden] { display: none; }
body.kb-open .nx-resume { visibility: hidden; }
body.news-mode.nx-resuming #app { padding-bottom: calc(150px + var(--safe-b)); }
@media (min-width: 1000px) {
  .nx-nav { left: 50%; right: auto; bottom: max(16px, var(--safe-b)); transform: translateX(-50%); width: 520px; border-radius: 22px; border: 1px solid var(--line-2); padding: 0 6px; box-shadow: var(--shadow); }
  /* the floating pill is centred with translateX: keep it while sliding away */
  body.kb-open .nx-nav { transform: translate(-50%, 160%); }
  .nx-resume { bottom: calc(max(16px, var(--safe-b)) + 76px); }
}

/* ---------- reader ---------- */
.nx-art-img { margin: 0 -16px; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.nx-art-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nx-art-head { padding: 18px 2px 8px; }
.nx-art-head .k { font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.nx-art-head h1 { font: 800 29px/1.16 var(--serif); letter-spacing: -.015em; margin: 8px 0 10px; text-wrap: balance; }
.nx-art-head .d { font: italic 400 17px/1.5 var(--serif); color: var(--text-2); }
.nx-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--text-3); font-weight: 600; margin-top: 12px; }
.nx-meta b { color: var(--text-2); }
.nx-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.nx-modes { position: sticky; top: calc(var(--safe-t) + 51px); z-index: 20; margin: 8px -16px 0; padding: 8px 16px; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.nx-body { font-family: var(--serif); font-size: var(--nx-size); line-height: 1.72; color: var(--text); padding-top: 8px; overflow-wrap: break-word; }
.nx-body .nx-p { margin: 0 -10px 1.05em; padding: 4px 10px; border-radius: 12px; transition: background .25s, box-shadow .25s; }
.nx-body .nx-p.h { font-weight: 800; font-size: 1.08em; line-height: 1.35; margin-top: 1.4em; }
.nx-body .nx-p.quote { font-style: italic; border-left: 3px solid var(--brand); border-radius: 0 12px 12px 0; padding-left: 14px; color: var(--text-2); }
.nx-body .nx-p.bio { font-size: .82em; font-style: italic; color: var(--text-3); border-top: 1px solid var(--line-2); border-radius: 0; padding-top: 14px; margin-top: 1.6em; }
.nx-body .nx-p.live { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.nx-body .nx-p.flash { animation: nxflash 1.6s ease-out; }
@keyframes nxflash { 0%, 40% { background: var(--brand-soft); } 100% { background: transparent; } }
.wd { cursor: pointer; border-radius: 4px; transition: background .12s; -webkit-user-select: none; user-select: none; }
.wd:active, .wd.sel { background: var(--brand-soft); box-shadow: 0 0 0 2px var(--brand-soft); }
.wd.saved { text-decoration: underline dotted var(--brand); text-decoration-thickness: 2px; text-underline-offset: 4px; }
html.no-marks .wd.saved { text-decoration: none; } /* Settings → Underline my words: off */
html.no-marks .nx-hint-marks { display: none; }
.nx-src { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); margin-top: 20px; }
.nx-src svg { width: 18px; height: 18px; color: var(--text-3); }
.nx-hint { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); font-weight: 600; padding: 4px 2px 0; }
.nx-hint svg { width: 16px; height: 16px; color: var(--brand); }

/* reader action bar + player */
.nx-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 8px 10px calc(8px + var(--safe-b)); background: var(--glass); -webkit-backdrop-filter: saturate(1.5) blur(20px); backdrop-filter: saturate(1.5) blur(20px); border-top: 1px solid var(--line); transition: transform .25s; }
.nx-actions .inner { max-width: 620px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.nx-act { position: relative; min-width: 0; height: 54px; border-radius: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 800; color: var(--text-2); white-space: nowrap; }
.nx-act .nx-badge { top: 3px; right: calc(50% - 25px); }
.nx-act svg { width: 22px; height: 22px; }
.nx-act:active { background: var(--surface-2); }
.nx-act.on { color: var(--brand); background: var(--brand-soft); }
.nx-act.primary { background: var(--brand-grad); color: #fff; }
/* Listen player (lib/listen.js): full in the reader (two rows, above the action bar), a slim mini
   player above the bottom bar everywhere else; it keeps playing between pages */
.nx-player { position: fixed; left: 10px; right: 10px; bottom: calc(80px + var(--safe-b)); z-index: 44; max-width: 600px; margin: 0 auto; padding: 10px 12px 8px; border-radius: 20px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 4px; align-items: center; animation: rise .3s cubic-bezier(.2, .8, .2, 1) both; }
.nx-play { width: 46px; height: 46px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: grid; place-items: center; }
.nx-play svg { width: 22px; height: 22px; }
.nx-play .spinner { width: 20px; height: 20px; border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.nx-pmain { min-width: 0; }
.nx-seek { width: 100%; accent-color: var(--brand); height: 22px; }
.nx-ptime { display: flex; justify-content: space-between; gap: 8px; font: 700 11.5px var(--mono); color: var(--text-3); margin-top: -2px; }
.nx-pctl { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.nx-pctl .icon-btn, .nx-player > .icon-btn { width: 38px; height: 38px; font-size: 12.5px; font-weight: 800; color: var(--text-2); }
.nx-pctl .icon-btn svg, .nx-player > .icon-btn svg { width: 19px; height: 19px; }
.nx-plabel { font-size: 11.5px; font-weight: 700; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-ptitle { display: block; max-width: 100%; font-size: 14px; font-weight: 800; color: var(--text); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0; }
.nx-ptitle[hidden] { display: none; }
/* speed: − 0.95× +, in 0.05 steps (tap the value for 1×) */
.nx-speed { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 2px; }
.nx-speed button { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.nx-speed button:disabled { opacity: .35; }
.nx-speed button svg { width: 16px; height: 16px; }
.nx-speed .v { width: auto; min-width: 58px; border-radius: 99px; font: 800 13.5px var(--mono); color: var(--text); }
.nx-speed button:active { background: var(--surface-3); }
/* mini: play · title + what is playing · close */
.nx-player.mini { bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); padding: 7px 8px 7px 8px; border-radius: 18px; }
.nx-player.mini .nx-play { width: 40px; height: 40px; }
.nx-player.mini .nx-seek, .nx-player.mini .nx-ptime, .nx-player.mini .nx-pctl { display: none; }
body.nx-resuming .nx-player.mini { bottom: calc(128px + var(--safe-b)); }
/* full-screen pages outside the reading screens (the welcome): no player there (listen.js pauses it) */
body.full:not(.news-mode) .nx-player { display: none; }
body.nx-playing:not(.news-mode) #app { padding-bottom: calc(var(--tabbar-h) + 96px + var(--safe-b)); }
body.news-mode.nx-mini-player #app { padding-bottom: calc(150px + var(--safe-b)); }
/* the full player in the reader is two rows tall: the end of the article stays reachable */
body.news-mode.nx-playing:not(.nx-mini-player) #app { padding-bottom: calc(210px + var(--safe-b)); }
/* another article's reader: the mini player sits above its action bar */
body:has(.nx-actions) .nx-player.mini { bottom: calc(80px + var(--safe-b)); }
/* follow-along scrolls a paragraph into the band between the sticky bars and the player */
.nx-body .nx-p { scroll-margin-top: calc(var(--safe-t) + 120px); scroll-margin-bottom: calc(var(--safe-b) + 210px); }
/* keyboard open (e.g. the summary textarea): the fixed bars get out of the way */
body.kb-open .nx-actions { transform: translateY(120%); pointer-events: none; }
/* .nx-player's `rise` animation (fill-mode both) pins opacity/transform, so hide it with visibility */
body.kb-open .nx-player { visibility: hidden; pointer-events: none; }
/* the open player sits above the action bar: keep the end of the page scrollable clear of it */
body.news-mode.nx-playing #app { padding-bottom: calc(160px + var(--safe-b)); }

/* study */
.nx-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.nx-card h3 { font: 800 18px/1.25 var(--serif); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.nx-card h3 svg { width: 20px; height: 20px; color: var(--brand); }
.nx-lead { font: 400 17px/1.6 var(--serif); }
.nx-level { display: inline-grid; place-items: center; min-width: 42px; height: 26px; padding: 0 8px; border-radius: 8px; border: 0; background: var(--brand-grad); color: #fff; font: 900 13px/1 var(--font); }
button.nx-level { cursor: pointer; box-shadow: 0 0 0 0 transparent; transition: transform .12s; }
button.nx-level:active { transform: scale(.94); }
.nx-level[hidden] { display: none; }
.nx-level.lg { min-width: 56px; height: 44px; border-radius: 12px; font-size: 19px; flex: none; }
.nx-lv-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.label + .nx-lv-row { border-top: 0; }
.nx-lv-row .v { font-weight: 900; font-size: 15px; white-space: nowrap; }
.nx-vocab { display: grid; gap: 10px; }
.nx-v { padding: 14px; border-radius: 16px; background: var(--surface-2); }
.nx-v .top { display: flex; align-items: center; gap: 8px; }
.nx-v .term { font: 800 18px/1.2 var(--serif); }
.nx-v .tr { font-weight: 800; color: var(--brand); margin-top: 6px; font-size: 15px; }
.nx-v .def { font-size: 14px; color: var(--text-2); margin-top: 3px; line-height: 1.45; }
.nx-v .ex { font: italic 400 14.5px/1.5 var(--serif); color: var(--text-2); margin-top: 8px; border-left: 2px solid var(--line-2); padding-left: 10px; }
.nx-q { display: grid; gap: 12px; }
.nx-q .qh { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.nx-q .qt { font: 700 17px/1.45 var(--serif); }
.nx-q .why { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14px; line-height: 1.55; color: var(--text-2); }
.nx-q .why b { color: var(--text); }
.nx-score { display: flex; align-items: center; gap: 14px; }
.nx-score .big { font: 900 44px/1 var(--serif); }
.nx-cta { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 26px 18px; }
.nx-cta .ic { width: 64px; height: 64px; border-radius: 20px; background: var(--brand-grad); display: grid; place-items: center; color: #fff; box-shadow: 0 16px 36px -16px rgba(245, 120, 36, .9); }
.nx-cta .ic svg { width: 30px; height: 30px; }

/* word sheet */
.nx-word { font: 800 30px/1.1 var(--serif); letter-spacing: -.01em; }
.nx-ipa { font: 400 15px var(--mono); color: var(--text-3); }
.nx-mean { font-size: 20px; font-weight: 800; color: var(--brand); line-height: 1.3; }
.nx-def { font-size: 16.5px; font-weight: 600; line-height: 1.45; color: var(--text); }
/* "Show Turkish": understand the English first */
.nx-tr-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 999px; border: 1px dashed var(--line-2); background: transparent; color: var(--text-2); font: 700 13px/1 var(--font); cursor: pointer; }
.nx-tr-btn svg { width: 15px; height: 15px; }
.nx-tr-btn.on { border-style: solid; border-color: transparent; background: var(--brand-soft); color: var(--brand); }
.nx-tr-body { display: grid; gap: 8px; margin-top: 10px; animation: nxTrIn .18s ease-out; }
.nx-tr-body[hidden] { display: none; }
@keyframes nxTrIn { from { opacity: 0; transform: translateY(-4px); } }
.nx-v-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 10px; }
.nx-v-foot .nx-tr { flex: 1; min-width: 0; }
.nx-v-foot .link-btn { margin-top: 8px; flex: none; }
.nx-v .nx-tr-body .tr { margin-top: 0; }
.nx-wrow .def1 { color: var(--text-2); font-size: 14px; line-height: 1.4; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nx-ctx { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font: 400 15.5px/1.6 var(--serif); color: var(--text-2); }
.nx-ctx mark { background: var(--brand-soft); color: var(--text); border-radius: 4px; padding: 0 3px; font-weight: 700; }
.nx-ctx .tr { font-family: var(--font); font-size: 14px; margin-top: 8px; color: var(--text-3); font-style: normal; }

/* Review (views/words.js): what is waiting, a strip of tiles at the top of the page */
.enx-today { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-top: 16px; }
.enx-tile { min-width: 0; display: grid; align-content: start; gap: 5px; padding: 11px 12px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: inherit; transition: transform .12s, border-color .2s; }
.enx-tile:active { transform: scale(.97); }
.enx-tile .v { display: flex; align-items: center; gap: 7px; font: 800 22px/1 var(--serif); font-variant-numeric: tabular-nums; }
.enx-tile .v svg { width: 17px; height: 17px; color: var(--brand); }
.enx-tile .l { font-size: 12px; font-weight: 700; line-height: 1.3; color: var(--text-2); }
.enx-tile.hot { background: var(--brand-soft); border-color: transparent; }
.enx-tile.hot .v { color: var(--brand); }
/* AI study packs ready: the purple of the "Study ready" tags */
.enx-tile.ai .v svg { color: #c4b5fd; }
[data-theme="light"] .enx-tile.ai .v svg { color: #6d28d9; }
@media (hover: hover) { .enx-tile:hover { border-color: var(--line-2); } }
/* four tiles on a phone: two rows of two, each number beside its label (one row would leave the
   labels a few letters wide) */
@media (max-width: 559px) {
  .enx-today[data-tiles="4"] { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .enx-today[data-tiles="4"] .enx-tile { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 10px; padding: 10px 12px; }
  .enx-today[data-tiles="4"] .enx-tile .l { line-height: 1.25; }
}
/* the list's heading: a tile scrolls it into view, just below the top bar */
.nx-w-head { scroll-margin-top: calc(var(--safe-t) + 60px); }

/* words notebook + flashcards */
.nx-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.nx-stat { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.nx-stat .v { font: 900 26px/1 var(--serif); }
.nx-stat .l { font-size: 11.5px; font-weight: 700; color: var(--text-3); margin-top: 4px; }
.nx-wrow { display: flex; gap: 12px; align-items: flex-start; padding: 14px 2px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; color: inherit; }
.nx-wrow .term { font: 800 17px/1.25 var(--serif); }
.nx-wrow .tr { color: var(--brand); font-weight: 800; font-size: 14px; margin-top: 2px; }
.nx-wrow .src { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.nx-box { flex: none; display: flex; gap: 3px; margin-top: 6px; }
.nx-box i { width: 6px; height: 14px; border-radius: 2px; background: var(--surface-3); }
.nx-box i.on { background: var(--brand); }
.fc-wrap { perspective: 1400px; }
.fc { position: relative; min-height: 340px; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2, .8, .2, 1); cursor: pointer; }
.fc.flip { transform: rotateY(180deg); }
.fc .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 26px; padding: 26px 22px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
/* centred while it fits; when "Show Turkish" makes it taller it scrolls instead of clipping the top */
.fc .face > :first-child { margin-top: auto; }
.fc .face > :last-child { margin-bottom: auto; }
.fc .nx-tr-body { justify-items: center; }
.fc .back { transform: rotateY(180deg); }
.fc .term { font: 800 34px/1.1 var(--serif); text-align: center; }
.fc .ctx { font: italic 400 16px/1.55 var(--serif); color: var(--text-2); text-align: center; }
.fc .tap { text-align: center; font-size: 12px; font-weight: 700; color: var(--text-3); }
.fc-grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fc-grades .btn { height: 58px; flex-direction: column; gap: 2px; font-size: 13px; }
.fc-grades .btn small { font-size: 10.5px; font-weight: 700; opacity: .75; }
.fc-grades .again { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.fc-grades .hard { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.fc-grades .good { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.fc-grades .easy { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

/* ---------- wide screens (iPad landscape, desktop) ----------
   Phones and iPad portrait never reach these rules. The column widens; long text keeps a
   ~72ch measure and the extra room goes to grids and side-by-side panels. */
@media (min-width: 1000px) {
  body.news-mode { --nx-gut: 32px; }
  body.news-mode #app { max-width: 1240px; padding-left: var(--nx-gut); padding-right: var(--nx-gut); padding-bottom: calc(max(16px, var(--safe-b)) + 96px); }
  body.news-mode.nx-playing #app { padding-bottom: calc(max(16px, var(--safe-b)) + 176px); }
  /* sticky bars span the whole column */
  .nx-top { margin: 0 calc(-1 * var(--nx-gut)); padding-left: 16px; padding-right: 16px; }
  .nx-cats { margin: 0 calc(-1 * var(--nx-gut)); padding: 10px var(--nx-gut); }
  .nx-modes { margin: 8px calc(-1 * var(--nx-gut)) 0; padding: 8px var(--nx-gut); }
  .nx-modes > .seg { max-width: 440px; margin: 0 auto; }
  .nx-card.nx-cta { max-width: 640px; margin-left: auto; margin-right: auto; }

  /* feed + My reading: the lead story as a banner, stories in two columns */
  .nx-hero { aspect-ratio: auto; height: clamp(340px, 50vh, 500px); }
  .nx-hero .cap { padding: 28px 32px; }
  .nx-hero .cap .h { font-size: 34px; line-height: 1.16; max-width: 780px; }
  .nx-skel { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
  .nx-skel-hero { grid-column: 1 / -1; aspect-ratio: auto; height: clamp(340px, 50vh, 500px); }
  .nx-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .nx-item .th { width: 112px; height: 112px; }
  .nx-item .h { font-size: 18.5px; }
  /* "Continue reading": two cards per view, the next one peeks into the gutter */
  .nx-carousel { gap: 14px; margin: 0 calc(-1 * var(--nx-gut)); padding: 0 var(--nx-gut) 2px; scroll-padding-inline: var(--nx-gut); }
  .nx-carousel > .nx-continue, .nx-carousel.one > .nx-continue { flex-basis: calc((100% - 14px) / 2); }

  /* reader: centred text column, banner photo, floating action pill */
  .nx-art-img { max-width: 960px; height: min(52vh, 500px); aspect-ratio: auto; margin: 20px auto 0; border-radius: 22px; box-shadow: var(--shadow); }
  .nx-art-head, .nx-article, .nx-art-skel { max-width: 720px; margin-left: auto; margin-right: auto; }
  .nx-art-head { padding-top: 28px; }
  .nx-art-head h1 { font-size: 38px; }
  .nx-art-head .d { font-size: 19px; }
  .nx-actions { left: 50%; right: auto; bottom: max(16px, var(--safe-b)); transform: translateX(-50%); width: 560px; padding: 6px; border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow); }
  body.kb-open .nx-actions { transform: translate(-50%, 160%); }
  .nx-player { bottom: calc(max(16px, var(--safe-b)) + 80px); }
  .nx-player.mini { bottom: calc(max(16px, var(--safe-b)) + 76px); }
  body:has(.nx-actions) .nx-player.mini { bottom: calc(max(16px, var(--safe-b)) + 80px); }
  body.news-mode.nx-playing:not(.nx-mini-player) #app { padding-bottom: calc(max(16px, var(--safe-b)) + 210px); }
  body.nx-resuming .nx-player.mini { bottom: calc(max(16px, var(--safe-b)) + 130px); }
  /* study: text cards stay on the 720px centre line, the vocabulary spans the full width,
     writing and speaking sit side by side */
  .nx-study { max-width: 1040px; margin-left: auto; margin-right: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; align-items: start; }
  .nx-study > * { grid-column: 1 / -1; justify-self: center; width: 100%; max-width: 720px; }
  .nx-study > .nx-s-vocab { max-width: none; }
  .nx-study > .nx-s-write, .nx-study > .nx-s-speak { grid-column: auto; max-width: none; }
  .nx-s-vocab .nx-vocab { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  /* Review: the tiles in one row over both columns; stats + review stay in view on the left, the
     list on the right; flashcards centred */
  .enx-today { max-width: 1100px; margin-left: auto; margin-right: auto; }
  .nx-words { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0 32px; align-items: start; max-width: 1100px; margin-left: auto; margin-right: auto; }
  .nx-w-side { position: sticky; top: calc(var(--safe-t) + 52px); }
  .nx-w-main > .nx-w-head { margin-top: 16px; } /* the list heading's top level with the stats beside it */
  .nx-fc-stage { max-width: 560px; margin-left: auto; margin-right: auto; }
  .nx-fc-stage .fc { min-height: 400px; }

  /* Settings: its two columns of sections stay a readable width */
  body.news-mode .set-cols { max-width: 1040px; margin-left: auto; margin-right: auto; }
}
@media (min-width: 1280px) {
  /* stories: three columns of picture-on-top cards */
  .nx-list { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; }
  .nx-item { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 0 20px; }
  .nx-item .th { position: relative; width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 16px; display: grid; place-items: center; color: var(--text-3); }
  .nx-item .th img { position: absolute; inset: 0; }
  .nx-item .h { font-size: 19px; }
  .nx-carousel > .nx-continue, .nx-carousel.one > .nx-continue { flex-basis: calc((100% - 28px) / 3); }
  .nx-s-vocab .nx-vocab { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Study word pack (Review): exam-style practice */
.nx-pack-cta { background: linear-gradient(135deg, #7c3aed, #4f46e5); }
.nx-ex-k { font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.nx-ex-sent { font: 19px/1.65 var(--serif); color: var(--text); }
.nx-ex-def { font: italic 19px/1.5 var(--serif); color: var(--text); }
.nx-ex-term { font: 800 28px/1.2 var(--serif); color: var(--text); }
.nx-gap { display: inline-block; min-width: 92px; padding: 0 6px; margin: 0 2px; border-bottom: 2.5px dashed var(--brand); border-radius: 4px; text-align: center; font-weight: 700; }
.nx-gap.ok { border-bottom-style: solid; border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.nx-gap.bad { border-bottom-style: solid; border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.nx-verdict { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px; border-radius: 99px; font-size: 13.5px; font-weight: 800; }
.nx-verdict svg { width: 16px; height: 16px; }
.nx-verdict.ok { background: var(--ok-soft); color: var(--ok); }
.nx-verdict.bad { background: var(--bad-soft); color: var(--bad); }
.nx-remind { border-color: var(--line-2); }
.nx-check { gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.nx-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
