/* Mirrors telegei/lib/widgets/discovery_glass.dart. Blur belongs to controls,
   while repeated content cards stay inexpensive to paint. */
:root {
    --discovery-bg: #f7f5ef;
    --discovery-ink: #23382e;
    --discovery-muted: #485f52;
    --discovery-accent: #2f654b;
    --discovery-panel: rgba(255, 255, 255, .78);
    --discovery-glass: rgba(255, 255, 255, .58);
    --discovery-edge: rgba(255, 255, 255, .85);
    --discovery-shadow: 0 5px 16px rgba(21, 42, 30, .035);
}
.discovery-shell, .discovery-page {
    --qz-brand-1: #2f654b;
    --qz-brand-2: #48866a;
    --qz-brand-1-rgb: 47, 101, 75;
    --qz-brand-2-rgb: 72, 134, 106;
    --qz-bg: #f7f5ef;
    --qz-bg-soft: #e0eadf;
    --qz-text: #23382e;
    --qz-muted: #485f52;
    --qz-surface: rgba(255, 255, 255, .78);
    --qz-surface-soft: rgba(255, 255, 255, .65);
    --qz-border: rgba(255, 255, 255, .85);
    --qz-shadow-soft: var(--discovery-shadow);
    --brand-primary: #2f654b;
    --brand-primary-soft: #3e785c;
    background: linear-gradient(135deg, #d6e9dd 0%, #e6e7f0 35%, #f6ecdd 70%, #daebdd 100%);
    color: var(--discovery-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "KazNet", sans-serif;
    min-height: 100vh;
    min-height: 100svh;
}
.converter-shell.discovery-shell { display: block; overflow: visible; }
.discovery-shell::before, .discovery-shell::after { display: none; }
.discovery-shell .converter-content { width: 100%; min-width: 0; }
.discovery-shell .converter-main {
    width: min(100%, 948px);
    margin: 0 auto;
    padding: 8px 24px 28px;
    box-sizing: border-box;
}
.discovery-header, .discovery-shell .converter-topbar {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(100%, 948px);
    min-height: 82px;
    margin: 0 auto;
    padding: max(18px, env(safe-area-inset-top)) 24px 18px;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    position: relative;
    z-index: 30;
}
.discovery-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--discovery-ink);
    font: 600 28px/1.1 Georgia, "Times New Roman", serif;
    letter-spacing: -.8px;
    text-decoration: none;
}
.discovery-brand:hover { color: var(--discovery-accent); text-decoration: none; }
.discovery-brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--discovery-accent);
    color: white;
    flex-shrink: 0;
}
.discovery-icon { width: 24px; height: 24px; display: inline-block; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.discovery-brand-mark .discovery-icon { width: 21px; height: 21px; }
.discovery-header-actions { display: flex; align-items: center; gap: 10px; }
.discovery-shell .script-toggle {
    margin: 0;
    gap: 2px;
    padding: 4px;
    border-radius: 26px;
    background: var(--discovery-glass);
    border: 1px solid var(--discovery-edge);
    box-shadow: var(--discovery-shadow);
}
.discovery-shell .script-mode-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    color: var(--discovery-ink);
    background: transparent;
    font-family: "KazNet", sans-serif;
    font-size: 19px;
    border: 0;
    box-shadow: none;
}
.discovery-shell .script-mode-btn[aria-pressed="true"] { background: var(--discovery-accent); color: white; box-shadow: none; }
.discovery-icon-button {
    display: grid;
    place-items: center;
    height: 44px;
    width: 44px;
    border-radius: 50%;
    border: 1px solid var(--discovery-edge);
    color: var(--discovery-muted);
    background: var(--discovery-glass);
    cursor: pointer;
    list-style: none;
}
.discovery-icon-button::-webkit-details-marker { display: none; }
.discovery-account-menu { position: relative; }
.discovery-menu-panel {
    position: absolute;
    inset-inline-end: 0;
    top: 54px;
    width: min(290px, calc(100vw - 36px));
    border: 1px solid var(--discovery-edge);
    border-radius: 24px;
    background: #f8fbf7;
    box-shadow: 0 16px 40px rgba(35, 56, 46, .14);
    padding: 16px;
    color: var(--discovery-ink);
}
.discovery-menu-panel > a { display: block; padding: 10px 8px; border-radius: 12px; color: inherit; text-decoration: none; }
.discovery-menu-panel > a:hover { background: #e5ede4; }
.discovery-menu-name { font-size: 16px; font-weight: 650; margin: 0 0 4px; overflow-wrap: anywhere; }
.discovery-menu-metrics { font-size: 12px; margin: 14px 0; }
.discovery-menu-metrics > div { display: flex; gap: 12px; justify-content: space-between; padding: 4px 0; }
.discovery-menu-metrics dt { font-weight: 400; }
.discovery-menu-metrics dd { margin: 0; text-align: end; font-weight: 600; }
.discovery-navigation {
    position: fixed;
    bottom: max(18px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: min(600px, calc(100% - 24px));
    padding: 6px;
    border-radius: 36px;
    border: 1px solid var(--discovery-edge);
    background: var(--discovery-glass);
    box-shadow: 0 8px 30px rgba(35, 56, 46, .1), inset 0 1px 0 rgba(255,255,255,.6);
    box-sizing: border-box;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.discovery-nav-item {
    min-width: 0;
    height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    border: 1px solid transparent;
    border-radius: 30px;
    font-size: 11px;
    white-space: nowrap;
    color: var(--discovery-muted);
    text-decoration: none;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.discovery-nav-item.active, .discovery-nav-item[aria-current="page"] {
    background: rgba(255,255,255,.72);
    border-color: var(--discovery-edge);
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    color: var(--discovery-accent);
    font-weight: 650;
}
.discovery-nav-item:hover { background: rgba(255,255,255,.5); color: var(--discovery-accent); text-decoration: none; }
.discovery-nav-item:active { transform: scale(.96); }
.discovery-footer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin: 0 auto;
    padding: 12px 24px calc(130px + env(safe-area-inset-bottom));
    color: var(--discovery-muted);
    font-size: 12px;
}
.discovery-footer a { color: inherit; }
.discovery-home, .discovery-catalog, .discovery-library { display: flex; flex-direction: column; gap: 22px; }
.discovery-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px 7px 16px;
    min-height: 56px;
    border: 1px solid var(--discovery-edge);
    border-radius: 28px;
    background: var(--discovery-glass);
    box-shadow: var(--discovery-shadow);
}
.discovery-search > .discovery-icon { width: 22px; color: var(--discovery-muted); }
.discovery-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--discovery-ink);
    font: inherit;
    font-size: 14px;
    background: transparent;
}
.discovery-search input::placeholder { color: var(--discovery-muted); opacity: 1; }
.discovery-search button {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: rgba(255,255,255,.72);
    color: var(--discovery-accent);
    cursor: pointer;
}
.discovery-search:focus-within { outline: 2px solid var(--discovery-accent); outline-offset: 3px; }
.discovery-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 5px; border: 1px solid var(--discovery-edge); border-radius: 28px; background: var(--discovery-glass); box-shadow: var(--discovery-shadow); margin-top: -6px; }
.discovery-tabs a { display: grid; place-items: center; min-height: 44px; padding: 8px 5px; border-radius: 24px; color: var(--discovery-ink); font-size: 13px; text-align: center; text-decoration: none; }
.discovery-tabs a.active { background: var(--discovery-accent); color: white; }
.discovery-tabs a:hover:not(.active) { background: rgba(255,255,255,.6); }
.discovery-daily { padding: 22px; border-radius: 26px; border: 1px solid var(--discovery-edge); background: rgba(212,234,218,.68); box-shadow: var(--discovery-shadow); }
.discovery-daily-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; color: var(--discovery-muted); font-size: 12px; }
.discovery-daily-top > span:last-child { display: flex; align-items: center; gap: 5px; color: var(--discovery-accent); }
.discovery-daily-top .discovery-icon { width: 15px; height: 15px; }
.discovery-daily-body { display: grid; grid-template-columns: 98px minmax(0, 1fr); gap: 20px; align-items: start; }
.discovery-daily-body img { width: 98px; height: 146px; object-fit: cover; border-radius: 9px; box-shadow: 0 8px 16px rgba(21,42,30,.12); }
.discovery-daily h2 { margin: 0 0 6px; color: var(--discovery-ink); font-size: clamp(20px, 3vw, 26px); font-weight: 650; line-height: 1.35; }
.discovery-daily p { margin: 0 0 10px; font-size: 13px; }
.discovery-daily-description { line-height: 1.6; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.discovery-primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px; border-radius: 24px; background: var(--discovery-accent); color: white; font-size: 13px; text-decoration: none; }
.discovery-primary-button:hover { background: #244f3b; color: white; text-decoration: none; }
.discovery-primary-button .discovery-icon { width: 18px; height: 18px; }
.discovery-shelf { content-visibility: auto; contain-intrinsic-size: auto 350px; }
.discovery-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.discovery-section-head h2, .discovery-section-head h1 { margin: 0; font-size: clamp(19px, 2.6vw, 23px); font-weight: 650; color: var(--discovery-ink); line-height: 1.3; }
.discovery-section-head > a, .discovery-quote > a { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; color: var(--discovery-muted); font-size: 12px; text-decoration: none; min-height: 36px; }
.discovery-section-head > a:hover { color: var(--discovery-accent); }
.discovery-section-head .discovery-icon { width: 16px; height: 16px; }
.discovery-book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.discovery-book-card { min-width: 0; display: block; padding: 12px; border-radius: 24px; border: 1px solid var(--discovery-edge); background: var(--discovery-panel); color: var(--discovery-ink); text-decoration: none; box-shadow: var(--discovery-shadow); transition: transform .2s ease; }
.discovery-book-card:hover { color: var(--discovery-ink); text-decoration: none; transform: translateY(-3px); }
.discovery-book-art { display: flex; justify-content: center; align-items: center; padding: 14px 10px; border-radius: 16px; background: rgba(216,229,219,.36); aspect-ratio: 1.18; overflow: hidden; }
.discovery-book-art img { display: block; width: auto; max-width: 100%; height: 100%; max-height: 220px; object-fit: contain; border-radius: 5px; box-shadow: 3px 5px 12px rgba(29,51,37,.13); }
.discovery-book-card h3 { margin: 12px 0 5px; color: var(--discovery-ink); font-size: 15px; line-height: 1.4; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.discovery-book-card p { margin: 0; color: var(--discovery-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.discovery-shelf-prompt { display: flex; align-items: center; gap: 12px; padding: 18px; border: 1px solid var(--discovery-edge); border-radius: 24px; background: var(--discovery-panel); color: var(--discovery-muted); font-size: 13px; text-decoration: none; }
.discovery-shelf-prompt span { flex: 1; }
.discovery-shelf-prompt:hover { color: var(--discovery-accent); }
.discovery-article-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.discovery-article-card { min-width: 0; display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 14px; padding: 14px; border: 1px solid var(--discovery-edge); border-radius: 24px; background: var(--discovery-panel); color: var(--discovery-ink); box-shadow: var(--discovery-shadow); text-decoration: none; }
.discovery-article-card:hover { color: var(--discovery-ink); text-decoration: none; }
.discovery-article-card img { width: 110px; height: 136px; object-fit: cover; border-radius: 14px; background: #e0eadd; }
.discovery-article-card h3 { margin: 8px 0; font-size: 15px; line-height: 1.4; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.discovery-article-card p { margin: 0 0 8px; font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.discovery-article-card .discovery-muted { font-size: 10px; }
.discovery-eyebrow { color: var(--discovery-accent); font-size: 11px; font-weight: 600; }
.discovery-muted { color: var(--discovery-muted); font-size: 12px; }
.discovery-state { padding: 20px; margin: 0; border-radius: 24px; background: var(--discovery-panel); color: var(--discovery-muted); font-size: 14px; line-height: 1.6; }
.discovery-state h2 { font-size: 20px; color: var(--discovery-ink); }
.discovery-state a { color: var(--discovery-accent); }
.discovery-quote { padding: 24px; border-radius: 24px; border: 1px solid var(--discovery-edge); background: rgba(255,255,255,.4); position: relative; }
.discovery-quote > p { font: 500 23px/1.6 Georgia, "KazNet", serif; margin: 12px 0; color: var(--discovery-ink); }
.discovery-quote > a { margin-inline-start: 12px; }
.discovery-quote-controls { display: flex; justify-content: end; gap: 6px; }
.discovery-quote-controls button { width: 44px; height: 44px; border: 1px solid var(--discovery-edge); border-radius: 50%; color: var(--discovery-accent); background: var(--discovery-panel); cursor: pointer; }
.discovery-skeleton { background: rgba(255,255,255,.45); animation: discovery-pulse 1.8s ease-in-out infinite alternate; }
.discovery-daily.discovery-skeleton { min-height: 200px; }
.discovery-skeleton-line { height: 16px; border-radius: 8px; margin: 18px 0; background: rgba(47,101,75,.08); width: 80%; }
.discovery-skeleton-line.short { width: 40%; }
.discovery-book-placeholder { height: 270px; border-radius: 24px; }
.discovery-article-placeholder { height: 165px; border-radius: 24px; }
@keyframes discovery-pulse { to { opacity: .55; } }
.discovery-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.discovery-skip { position: fixed; top: -80px; left: 18px; padding: 12px 20px; z-index: 200; border-radius: 20px; background: white; color: var(--discovery-accent); }
.discovery-skip:focus { top: 12px; }
.discovery-shell :focus-visible, .discovery-page :focus-visible { outline: 2px solid var(--discovery-accent); outline-offset: 3px; }
.discovery-catalog-main { box-sizing: border-box; width: min(100%, 948px); margin: 0 auto; padding: 8px 24px 32px; }
.discovery-page { margin: 0; }
.discovery-page a { color: inherit; }
.discovery-page button, .discovery-page input { font: inherit; }
.discovery-category-row { display: flex; flex-wrap: wrap; gap: 8px; }
.discovery-category-row a { padding: 10px 16px; border: 1px solid var(--discovery-edge); border-radius: 22px; background: var(--discovery-panel); color: var(--discovery-muted); font-size: 12px; text-decoration: none; }
.discovery-category-row a.active { background: var(--discovery-accent); color: white; }
.discovery-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 13px; }
.discovery-pagination a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border-radius: 24px; background: var(--discovery-panel); border: 1px solid var(--discovery-edge); color: var(--discovery-accent); text-decoration: none; }
.discovery-downloads { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.discovery-downloads a { display: inline-flex; align-items: center; gap: 4px; padding: 8px 10px; border-radius: 18px; background: rgba(47,101,75,.08); color: var(--discovery-accent); font-size: 11px; text-decoration: none; }
.discovery-downloads .discovery-icon { width: 14px; height: 14px; }
.discovery-card-category { display: block; color: var(--discovery-muted); font-size: 11px; margin: 8px 0 0; }
.discovery-progress { accent-color: var(--discovery-accent); width: 100%; height: 5px; margin-top: 12px; }
.discovery-page-title { margin: 0 0 6px; color: var(--discovery-ink); font-size: 27px; font-weight: 650; }
.discovery-page-intro { margin: 0; color: var(--discovery-muted); font-size: 14px; }
/* Apply the same surface language to existing feature and reading screens. */
.discovery-shell .articles-page { max-width: 900px; padding: 8px 0 24px; }
.discovery-shell .articles-page .article-card { background: var(--discovery-panel); border-color: var(--discovery-edge); border-radius: 24px; box-shadow: var(--discovery-shadow); }
.discovery-shell .articles-page .articles-grid { gap: 16px; }
.discovery-shell .subscription-shell, .discovery-shell .converter-wrapper { max-width: 900px; margin-inline: auto; }
.discovery-shell .subscription-hero, .discovery-shell .account-section, .discovery-shell .plan-card { background: var(--discovery-panel); border: 1px solid var(--discovery-edge); border-radius: 24px; box-shadow: var(--discovery-shadow); }
@supports (backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px)) {
    .discovery-search, .discovery-tabs, .discovery-shell .script-toggle, .discovery-icon-button { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
}
@media (max-width: 640px) {
    .discovery-shell .converter-main, .discovery-catalog-main { padding: 0 18px 24px; }
    .discovery-header, .discovery-shell .converter-topbar { padding-inline: 18px; min-height: 78px; }
    .discovery-shell .brand-wrap { width: auto; }
    .discovery-home, .discovery-catalog, .discovery-library { gap: 22px; }
    .discovery-daily { padding: 18px; }
    .discovery-daily-body { grid-template-columns: 74px minmax(0,1fr); gap: 16px; }
    .discovery-daily-body img { width: 74px; height: 112px; }
    .discovery-daily h2 { font-size: 21px; }
    .discovery-daily-description { -webkit-line-clamp: 3; }
    .discovery-tabs a { font-size: 12px; }
    .discovery-book-grid { gap: 8px; }
    .discovery-book-card { padding: 8px; border-radius: 20px; }
    .discovery-book-art { aspect-ratio: .72; padding: 8px 6px; border-radius: 12px; }
    .discovery-book-card h3 { font-size: 13px; margin-top: 9px; }
    .discovery-book-card p { font-size: 10px; }
    .discovery-article-grid { grid-template-columns: 1fr; }
    .discovery-article-card { grid-template-columns: 94px minmax(0,1fr); gap: 12px; padding: 12px; }
    .discovery-article-card img { width: 94px; height: 126px; }
    .discovery-section-head { gap: 8px; }
    .discovery-section-head h2 { font-size: 20px; }
    .discovery-book-placeholder { height: 190px; }
    .discovery-catalog .discovery-book-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
    .discovery-catalog .discovery-book-card { padding: 12px; }
    .discovery-catalog .discovery-book-art { aspect-ratio: 1; }
    .discovery-daily-top { font-size: 11px; }
    .discovery-menu-panel { position: fixed; top: 76px; right: 18px; }
}
@media (max-width: 360px) {
    .discovery-nav-item { font-size: 10px; letter-spacing: -.2px; }
    .discovery-shell .converter-main, .discovery-catalog-main { padding-inline: 12px; }
    .discovery-tabs a { font-size: 11px; }
    .discovery-daily { padding: 14px; }
    .discovery-daily-top { flex-wrap: wrap; }
    .discovery-section-head h2 { font-size: 18px; }
    .discovery-section-head > a { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
    .discovery-shell *, .discovery-page * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
    .discovery-shell, .discovery-page { --discovery-panel: #fff; --discovery-glass: #fff; --discovery-edge: #9bad9c; }
    .discovery-navigation, .discovery-search, .discovery-tabs, .discovery-shell .script-toggle, .discovery-icon-button { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (forced-colors: active) {
    .discovery-nav-item.active, .discovery-tabs a.active, .discovery-category-row a.active { outline: 2px solid Highlight; }
}
@media print {
    .discovery-navigation, .discovery-header-actions, .discovery-footer, .discovery-tabs, .discovery-search { display: none !important; }
    .discovery-shell, .discovery-page { background: white; }
    .discovery-shelf { content-visibility: visible; }
}
.discovery-book-open, .discovery-book-open:hover { display: block; color: inherit; text-decoration: none; }
.discovery-shell .converter-wrapper .page-header h2 { color: var(--discovery-ink); font-weight: 650; font-size: 24px; }
.discovery-shell .converter-wrapper .editor-panel { background: var(--discovery-panel); border: 1px solid var(--discovery-edge); border-radius: 24px; box-shadow: var(--discovery-shadow); }
.discovery-shell .converter-wrapper .converter-tabs { background: var(--discovery-glass); border: 1px solid var(--discovery-edge); border-radius: 28px; padding: 5px; }
.discovery-shell .converter-wrapper .converter-tab { border-radius: 24px; color: var(--discovery-muted); }
.discovery-shell .converter-wrapper .converter-tab.active, .discovery-shell .converter-wrapper .actions .primary { background: var(--discovery-accent); color: white; box-shadow: none; }
.discovery-shell .converter-wrapper .editor { background: rgba(255,255,255,.5); border-color: var(--discovery-edge); }
.discovery-shell .articles-page .articles-head { background: var(--discovery-panel); border: 1px solid var(--discovery-edge); border-radius: 24px; box-shadow: var(--discovery-shadow); }
.discovery-shell .articles-page .articles-head h1 { color: var(--discovery-ink); font-weight: 650; }
.discovery-shell .articles-page .article-type-btn.is-active { background: var(--discovery-accent); border-color: var(--discovery-accent); }
.discovery-shell .articles-page .articles-back-link { color: var(--discovery-accent); border-color: var(--discovery-edge); }
.discovery-shell .subscription-hero h1 { color: var(--discovery-ink); font-weight: 650; }
.discovery-shell .discovery-search input[type="search"], .discovery-page .discovery-search input[type="search"] { appearance: none; -webkit-appearance: none; background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; padding: 0; }
.discovery-shell .converter-wrapper { background: var(--discovery-panel); border: 1px solid var(--discovery-edge); box-shadow: var(--discovery-shadow); }
.discovery-shell .converter-wrapper::before, .discovery-shell .converter-wrapper::after { display: none; }
.discovery-shell .converter-wrapper .page-header h2 { background: none; -webkit-background-clip: initial; text-shadow: none; }
.discovery-shell .converter-wrapper .converter-tab:hover { background: rgba(47,101,75,.08); }
.discovery-shell .converter-wrapper .actions .primary, .discovery-shell .converter-wrapper .actions .secondary { border-radius: 24px; }
@media (max-width: 640px) { .discovery-shell .converter-wrapper { padding: 14px; gap: 18px; } }
.discovery-category-menu { border: 1px solid var(--discovery-edge); border-radius: 24px; background: var(--discovery-glass); }
.discovery-category-menu > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; color: var(--discovery-muted); font-size: 13px; cursor: pointer; list-style: none; }
.discovery-category-menu > summary::-webkit-details-marker { display: none; }
.discovery-category-menu .discovery-icon { width: 18px; height: 18px; }
.discovery-category-menu[open] > summary .discovery-icon { transform: rotate(90deg); }
.discovery-category-menu .discovery-category-row { padding: 0 14px 14px; max-height: 280px; overflow: auto; }
.discovery-shell button.primary, .discovery-shell .btn-primary { background: var(--discovery-accent) !important; border-color: var(--discovery-accent) !important; box-shadow: none !important; }
.discovery-shell .converter-wrapper .actions { position: static; margin: 0; padding: 12px 0; background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.discovery-shell .converter-wrapper .conversion-option, .discovery-shell .converter-wrapper .editor-view-toggle-btn { background: rgba(47,101,75,.07); border-color: rgba(47,101,75,.16); color: var(--discovery-accent); box-shadow: none; }
.discovery-shell .converter-wrapper input[type="checkbox"] { accent-color: var(--discovery-accent); }
.discovery-shell .converter-wrapper .editor:focus { border-color: var(--discovery-accent); box-shadow: 0 0 0 3px rgba(47,101,75,.08); }
.discovery-page .series-empty-list { background: var(--discovery-panel); border: 1px solid var(--discovery-edge); border-radius: 24px; color: var(--discovery-muted); }
/* Converter keeps its tools on separate translucent surfaces. */
.discovery-shell .converter-discovery { padding: 0; gap: 20px; background: transparent; border: 0; box-shadow: none; animation: none; }
.discovery-shell .converter-discovery .page-header { padding: 22px 24px; border: 1px solid var(--discovery-edge); border-radius: 28px; background: var(--discovery-glass); }
.discovery-shell .converter-discovery .page-header h2 { font-size: 28px; }
.discovery-shell .converter-discovery .page-header p { color: var(--discovery-muted); font-size: 14px; }
.discovery-shell .converter-discovery .converter-tabs { width: 100%; box-sizing: border-box; box-shadow: var(--discovery-shadow); }
.discovery-shell .converter-discovery .converter-tab { flex: 1; min-width: 0; font-weight: 600; }
.discovery-shell .converter-discovery .editor-stack, .discovery-shell .converter-discovery .converter-tab-panel.active { gap: 16px; }
.discovery-shell .converter-discovery .editor-panel { padding: 16px; background: var(--discovery-glass); }
.discovery-shell .converter-discovery .editor-panel label, .discovery-shell .converter-discovery .document-file-row label { color: var(--discovery-ink); }
.discovery-shell .converter-discovery .editor { box-sizing: border-box; width: 100%; padding: 16px; border-radius: 18px; background: rgba(255,255,255,.4) !important; border-color: var(--discovery-edge) !important; box-shadow: none; color: var(--discovery-ink); }
.discovery-shell .converter-discovery .editor::placeholder { color: var(--discovery-muted); opacity: .8; }
.discovery-shell .converter-discovery .actions { padding: 0; gap: 10px; }
.discovery-shell .converter-discovery .actions button { min-height: 46px; flex: 1; }
.discovery-shell .converter-discovery .secondary, .discovery-shell .converter-discovery .secondary-action-btn, .discovery-shell .converter-discovery .copy-icon-button { background: var(--discovery-glass); color: var(--discovery-accent); border: 1px solid var(--discovery-edge); border-radius: 24px; box-shadow: none; }
.discovery-shell .converter-discovery .document-converter-panel, .discovery-shell .converter-discovery .saved-conversions-section, .discovery-shell .converter-discovery .json-viewer-panel { padding: 20px; border: 1px solid var(--discovery-edge); border-radius: 24px; background: var(--discovery-glass); box-shadow: var(--discovery-shadow); }
.discovery-shell .converter-discovery .document-converter-header h3, .discovery-shell .converter-discovery .saved-header-title h3 { color: var(--discovery-ink); font-size: 20px; }
.discovery-shell .converter-discovery .document-converter-header p, .discovery-shell .converter-discovery .document-file-meta, .discovery-shell .converter-discovery .saved-empty-state { color: var(--discovery-muted); }
.discovery-shell .converter-discovery .document-file-input { box-sizing: border-box; border-color: var(--discovery-edge) !important; border-radius: 18px !important; background: rgba(255,255,255,.4) !important; color: var(--discovery-ink); }
.discovery-shell .converter-discovery .document-file-input::file-selector-button { padding: 8px 12px; margin-inline-end: 10px; border: 1px solid var(--discovery-edge); border-radius: 14px; background: var(--discovery-glass); color: var(--discovery-accent); cursor: pointer; }
.discovery-shell .converter-discovery .document-actions button { min-height: 44px; border-radius: 24px; }
.discovery-shell .converter-discovery .saved-conversions-header { border-color: var(--discovery-edge); }
.discovery-shell .converter-discovery .saved-header-title > i, .discovery-shell .converter-discovery .saved-empty-state > i { color: var(--discovery-accent); }
.discovery-shell .converter-discovery .saved-badge, .discovery-shell .converter-discovery .mode-tag { background: rgba(47,101,75,.09); color: var(--discovery-accent); }
.discovery-shell .converter-discovery .saved-item-row { background: rgba(255,255,255,.4); border-color: var(--discovery-edge); box-shadow: none; }
.discovery-shell .converter-discovery .saved-item-row.active { border-color: var(--discovery-accent); background: rgba(47,101,75,.07); }
@media (max-width: 640px) {
    .discovery-shell .converter-discovery .page-header { padding: 18px; }
    .discovery-shell .converter-discovery .converter-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; }
    .discovery-shell .converter-discovery .converter-tab { padding: 10px 8px; font-size: 12px; }
    .discovery-shell .converter-discovery .editor-panel { padding: 12px; }
    .discovery-shell .converter-discovery .editor-label-row, .discovery-shell .converter-discovery .output-label-row { flex-wrap: wrap; }
    .discovery-shell .converter-discovery .actions { flex-direction: row; flex-wrap: wrap; }
    .discovery-shell .converter-discovery .actions button { flex: 1 1 130px; width: auto; padding-inline: 12px; }
    .discovery-shell .converter-discovery .actions .secondary { flex-basis: 100%; }
}

/* Author Circles & Official Author Profile Page */
.discovery-author-circles-section {
    padding: 20px;
    border-radius: 26px;
    border: 1px solid var(--discovery-edge);
    background: var(--discovery-panel);
    box-shadow: var(--discovery-shadow);
}
.discovery-author-circles-head {
    align-items: flex-start;
    margin-bottom: 16px;
}
.discovery-author-circles-head p {
    margin: 4px 0 0;
}
.discovery-author-rotate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(47, 101, 75, .22);
    background: rgba(47, 101, 75, .08);
    color: var(--discovery-accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s ease, transform .18s ease;
}
.discovery-author-rotate-btn:hover {
    background: var(--discovery-accent);
    color: #fff;
}
.discovery-rotate-icon {
    display: inline-block;
    font-size: 14px;
    line-height: 1;
    transition: transform .35s ease;
}
.discovery-author-rotate-btn.is-spinning .discovery-rotate-icon {
    transform: rotate(360deg);
}
.discovery-author-circles-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px 10px;
}
.discovery-author-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 6px;
    border-radius: 20px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, .52);
    color: var(--discovery-ink);
    text-decoration: none;
    transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.discovery-author-circle:hover {
    transform: translateY(-3px);
    background: #fff;
    border-color: rgba(47, 101, 75, .28);
    box-shadow: 0 8px 20px rgba(21, 42, 30, .08);
    text-decoration: none;
}
.discovery-author-avatar-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #2f654b 0%, #7aa98c 52%, #d2b47c 100%);
    display: grid;
    place-items: center;
    margin-bottom: 8px;
    box-shadow: 0 6px 14px rgba(35, 56, 46, .14);
    overflow: hidden;
    flex-shrink: 0;
}
.discovery-author-avatar-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #e5efe7;
    display: block;
}
.discovery-author-initials {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(145deg, #2f654b 0%, #1e4633 100%);
    color: #f7f5ef;
    display: grid;
    place-items: center;
    font: 700 20px/1 Georgia, "Times New Roman", serif;
    letter-spacing: .5px;
}
.discovery-author-circle-name {
    font-size: 12.5px;
    font-weight: 650;
    line-height: 1.3;
    color: var(--discovery-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
}
.discovery-author-circle-meta {
    margin-top: 3px;
    font-size: 10.5px;
    color: var(--discovery-muted);
    background: rgba(47, 101, 75, .08);
    padding: 2px 8px;
    border-radius: 999px;
}
.discovery-book-author-link {
    display: block;
    margin: 2px 0 0;
    color: var(--discovery-accent);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}
.discovery-book-author-link:hover {
    text-decoration: underline;
}

/* Official Author Profile Page */
.discovery-author-hero {
    padding: 24px;
    border-radius: 28px;
    border: 1px solid var(--discovery-edge);
    background: linear-gradient(140deg, rgba(255, 255, 255, .88) 0%, rgba(216, 236, 223, .78) 100%);
    box-shadow: var(--discovery-shadow);
}
.discovery-author-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 12.5px;
}
.discovery-author-breadcrumb a {
    color: var(--discovery-accent);
    font-weight: 600;
    text-decoration: none;
}
.discovery-author-wiki-pill {
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(47, 101, 75, .1);
    border: 1px solid rgba(47, 101, 75, .2);
}
.discovery-author-hero-top {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 22px;
    align-items: center;
}
.discovery-author-hero-avatar {
    width: 116px;
    height: 116px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, #2f654b 0%, #6ea184 50%, #d2b47c 100%);
    box-shadow: 0 12px 26px rgba(21, 42, 30, .16);
    display: grid;
    place-items: center;
    overflow: hidden;
}
.discovery-author-hero-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #e5efe7;
}
.discovery-author-hero-avatar .discovery-author-initials {
    font-size: 34px;
}
.discovery-author-hero-copy h1 {
    margin: 4px 0 10px;
    font-size: clamp(24px, 3.6vw, 34px);
    line-height: 1.2;
    color: var(--discovery-ink);
}
.discovery-author-summary {
    margin: 0;
    font-size: 14px;
    line-height: 1.68;
    color: var(--discovery-ink);
}
.discovery-author-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.discovery-author-tag {
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    border: 1px solid var(--discovery-edge);
    color: var(--discovery-accent);
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
}
.discovery-author-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(47, 101, 75, .12);
}
.discovery-author-stat {
    padding: 12px 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .74);
    border: 1px solid var(--discovery-edge);
    text-align: center;
}
.discovery-author-stat strong {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--discovery-accent);
}
.discovery-author-stat span {
    font-size: 11.5px;
    color: var(--discovery-muted);
}
.discovery-author-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    border-radius: 26px;
    border: 1px solid var(--discovery-edge);
    background: var(--discovery-glass);
    box-shadow: var(--discovery-shadow);
}
.discovery-author-tab {
    flex: 1 1 auto;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 20px;
    border: 0;
    background: transparent;
    color: var(--discovery-ink);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}
.discovery-author-tab.active {
    background: var(--discovery-accent);
    color: #fff;
}
.discovery-author-tab:hover:not(.active) {
    background: rgba(255, 255, 255, .65);
}
.discovery-author-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.discovery-author-panel[hidden] {
    display: none !important;
}
.discovery-subsection-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}
.discovery-subsection-head h3 {
    margin: 0;
    font-size: 17px;
    color: var(--discovery-ink);
}
.discovery-bio-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.discovery-bio-card {
    padding: 20px 22px;
    border-radius: 24px;
    border: 1px solid var(--discovery-edge);
    background: var(--discovery-panel);
    box-shadow: var(--discovery-shadow);
}
.discovery-bio-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(47, 101, 75, .1);
}
.discovery-bio-card-head h3 {
    margin: 0;
    font-size: 18px;
    color: var(--discovery-ink);
}
.discovery-bio-source {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--discovery-accent);
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(47, 101, 75, .08);
    text-decoration: none;
}
.discovery-bio-card-body p {
    margin: 0 0 12px;
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--discovery-ink);
}
.discovery-bio-card-body p:last-child {
    margin-bottom: 0;
}
.discovery-web-materials-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.discovery-web-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid var(--discovery-edge);
    background: var(--discovery-panel);
    box-shadow: var(--discovery-shadow);
    color: var(--discovery-ink);
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease;
}
.discovery-web-card:hover {
    transform: translateY(-3px);
    border-color: rgba(47, 101, 75, .35);
    text-decoration: none;
}
.discovery-web-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.discovery-web-badge {
    font-size: 11px;
    font-weight: 650;
    color: var(--discovery-accent);
    background: rgba(47, 101, 75, .1);
    padding: 4px 10px;
    border-radius: 999px;
}
.discovery-web-source {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--discovery-muted);
}
.discovery-web-card h3 {
    margin: 2px 0;
    font-size: 15.5px;
    line-height: 1.4;
    color: var(--discovery-ink);
}
.discovery-web-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--discovery-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 760px) {
    .discovery-author-circles-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px 8px;
    }
    .discovery-author-hero-top {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 16px;
    }
    .discovery-author-hero-avatar {
        width: 88px;
        height: 88px;
    }
    .discovery-author-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .discovery-web-materials-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 480px) {
    .discovery-author-circles-section {
        padding: 16px 12px;
    }
    .discovery-author-circles-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px 6px;
    }
    .discovery-author-avatar-ring {
        width: 58px;
        height: 58px;
    }
    .discovery-author-initials {
        font-size: 16px;
    }
    .discovery-author-circle-name {
        font-size: 11px;
        min-height: 28px;
    }
    .discovery-author-circle-meta {
        font-size: 9.5px;
        padding: 2px 6px;
    }
    .discovery-author-hero {
        padding: 18px 16px;
    }
    .discovery-author-hero-top {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
    .discovery-author-tags {
        justify-content: center;
    }
}

