/* ETO list pages: page grid with right rail, toolbar, list/grid items, pagination, empty state. */
.eto-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; }
.eto-main > .eto-page--rail { max-width: 1360px; }
@media (min-width: 1280px) { .eto-page--rail { grid-template-columns: minmax(0, 1fr) 300px; } .eto-page--rail .eto-rail { position: sticky; top: calc(var(--tb) + 24px); align-self: start; } .eto-rail .eto-ad { margin-top: 0; } }
.eto-page__main { min-width: 0; }

.eto-crumbs { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.eto-crumbs a { display: inline-block; padding: 4px 2px; border-radius: 4px; text-decoration: none; }
.eto-crumbs a:hover { color: var(--text); text-decoration: underline; }
.eto-crumbs .breadcrumb_last { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; padding: 4px 0; color: var(--text-2); font-weight: 500; }
.eto-h1 { margin: 0 0 12px; font-family: var(--font-serif); font-weight: 500; font-size: 38px; line-height: 1.16; letter-spacing: -.015em; overflow-wrap: anywhere; }
.eto-lead { max-width: 68ch; font-size: 17px; color: var(--text-2); }
.eto-lead p { margin: 0 0 .8em; }
@media (max-width: 620px) { .eto-h1 { font-size: 29px; } .eto-lead { font-size: 16px; } }

.eto-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 14px; font-size: 14px; color: var(--muted); }
.eto-seg { display: none; padding: 2px; gap: 2px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.js .eto-seg { display: inline-flex; }
.eto-seg button { display: grid; place-items: center; width: 44px; height: 40px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.eto-seg button:hover { color: var(--text); background: var(--surface-2); }
.eto-seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }

/* ETO Quiz's cards use its own light variables; follow the theme tokens so dark mode works. */
.eto-lc { min-width: 0; margin: 0; padding: 14px 16px 16px; }
.eto-lc-t { overflow-wrap: anywhere; }
.eto-lc-t a { color: var(--text); }
.eto-lc:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 45%, transparent); border-color: var(--focus); }

/* List view (default): one connected block with dividers */
.eto-items { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.eto-items > .eto-lc { height: auto; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.eto-items > :first-child { border-top: 0; }
.eto-items > .eto-lc:hover { background: var(--surface-2); }
.eto-items > .eto-ad { margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); }

/* Grid view */
html[data-eto-view="grid"] .eto-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; border: 0; border-radius: 0; background: transparent; overflow: visible; }
html[data-eto-view="grid"] .eto-items > .eto-lc { height: 100%; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); }
html[data-eto-view="grid"] .eto-items > .eto-lc:hover { border-color: var(--accent); background: var(--surface); }
html[data-eto-view="grid"] .eto-items > .eto-ad { grid-column: 1 / -1; padding: 0; border: 0; }

/* Pagination */
.eto-pager { margin: 28px 0 0; }
.eto-pager ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.eto-pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-weight: 600; font-size: 14.5px; text-decoration: none; }
.eto-pager a.page-numbers:hover { background: var(--surface-2); }
.eto-pager .page-numbers.current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.eto-pager .page-numbers.dots { border-color: transparent; background: transparent; }

/* Empty state */
.eto-empty { max-width: 560px; margin-top: 24px; color: var(--text-2); }
.eto-empty__search { display: flex; gap: 8px; margin: 16px 0; }
.eto-empty__search input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--text); font: inherit; }
.eto-empty__search button { min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r); background: var(--accent); color: var(--on-accent); font-weight: 650; }
.eto-empty__links { display: flex; gap: 10px; flex-wrap: wrap; }
.eto-empty__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-weight: 650; text-decoration: none; }

/* Landing pages (ETO Quiz): topic chips, FAQ, related topics */
.eto-tchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; }
.eto-tchip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text-2); font-weight: 500; font-size: 14.5px; text-decoration: none; }
.eto-tchip:hover { border-color: var(--muted); color: var(--text); }
.eto-tchip[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 650; }
.eto-tchip .n { font-size: 12.5px; opacity: .75; }
@media (max-width: 620px) { .eto-tchips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; } .eto-tchip { flex: none; } }
.eto-faq, .eto-related { margin-top: 36px; }
.eto-faq h2, .eto-related h2 { margin: 0 0 12px; font-family: var(--font-serif); font-weight: 500; font-size: 24px; }
.eto-faq details { border: 1px solid var(--line); border-top-width: 0; background: var(--surface); }
.eto-faq h2 + details { border-top-width: 1px; border-radius: var(--r) var(--r) 0 0; }
.eto-faq details:last-child { border-radius: 0 0 var(--r) var(--r); }
.eto-faq h2 + details:last-child { border-radius: var(--r); }
.eto-faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 12px 18px; font-weight: 600; font-size: 16px; }
.eto-faq summary::-webkit-details-marker { display: none; }
.eto-faq summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--muted); line-height: 1; }
.eto-faq details[open] summary::after { content: "–"; }
.eto-faq summary:hover { background: var(--surface-2); }
.eto-faq details > :not(summary) { margin: 0; padding: 0 18px 16px; color: var(--text-2); max-width: 70ch; }
.eto-related ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 0; }
.eto-related a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-decoration: none; font-weight: 600; }
.eto-related a:hover { border-color: var(--line-strong); }
.eto-related small { font-weight: 400; font-size: 13px; color: var(--muted); }

/* Progress marks on list cards (members from the server, guests from this device) and the "finished x of y" line */
.eto-chip.eto-mark { font-variant-numeric: tabular-nums; }
.eto-mark--good, .eto-mark--read { background: var(--right-soft); color: var(--right); }
.eto-mark--ok { background: var(--reward-soft); color: var(--reward-ink); }
.eto-mark--low { background: var(--wrong-soft); color: var(--wrong); }
.eto-mark--part { background: var(--surface); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.eto-progress-line { margin: 6px 0 14px; color: var(--muted); font-size: 14.5px; }
