/* ─────────────────────────────────────────────────────────
   FONTS
───────────────────────────────────────────────────────── */
@font-face {
    font-family: 'Heros';
    src: url('../fonts/TeXGyreHeros-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'HerosCn';
    src: url('../fonts/texgyreheroscn-regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ─────────────────────────────────────────────────────────
   RESET & BASIS
───────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --black:   #000000;
    --white:   #f1f1f1;
    --grey:    #e7e7e7;
    --mid:     rgba(0, 0, 0, 0.346);
    --accent:  #0bd8b2;
    --accent2: #00e5ff;
    --accent3: #006b42;

    --font:    'Heros', Helvetica, Arial, sans-serif;
    --font-cn: 'HerosCn', 'Heros', Helvetica, Arial, sans-serif;

    --topbar-height:  5rem;
    --feedbar-height: 2.5rem;
}

html {
    /* fluid base: 15px auf kleinen Screens, bis 17px auf großen */
    font-size: clamp(15px, 0.5vw + 13px, 17px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--white);
    color: var(--black);
    max-width: 30rem;
    margin: 0 auto;
    min-height: 100dvh;
}

html {
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: var(--font);
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

ul, ol {
    list-style: none;
}

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ─────────────────────────────────────────────────────────
   TOPBAR
───────────────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    height: var(--topbar-height);
    padding: 1rem 0.75rem;
    background: var(--white);
}

/* Linke Icon-Buttons: + und X */
.btn-open-channels
 {
    font-family: var(--font);
    font-size: 2rem;
    line-height: 1;
    color: var(--black);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    justify-content: flex-start;
}

.btn-close-stash, .btn-close-channels {
    font-family: var(--font);
    font-size: 1.6rem;
    line-height: 1;
    color: var(--black);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    justify-content: flex-start;
}



/* Rechte Text-Buttons: stash-icon und (log-in) */
.btn-stash {
    position: relative;
    font-size: 2rem;
    color: var(--black);
    height: 2.5rem;
    display: flex;
    align-items: center;
}

.stash-icon-wrap {
    position: relative;
    display: inline-flex;
    width: 1em;
    height: 1em;
}

.btn-stash .icon-bookmark-f {
    width: 1em;
    height: 1em;
}

.stash-count-label {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1em;
    height: 0.7em;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font);
    font-size: 0.5em;
    font-weight: bold;
    color: var(--white);
    line-height: 1;
    pointer-events: none;
    letter-spacing: 0;
}

.btn-user {
    font-family: var(--font);
    font-size: 1.4rem;
    color: var(--black);
    letter-spacing: -0.02em;
    line-height: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
}

/* ─────────────────────────────────────────────────────────
   FEED-LEISTE
───────────────────────────────────────────────────────── */
.feed-bar {
    display: flex;
    position: sticky;
    top: var(--topbar-height);
    z-index: 90;
    align-items: center;
    gap: 0.5rem;
    height: var(--feedbar-height);
    padding: 0 0.75rem;
    background: var(--white);
    border-bottom: 1px solid var(--accent2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.189);
}

.feed-count {
    font-family: var(--font-cn);
    font-size: 1rem;
    background: var(--accent3);
    color: var(--accent2);
    padding: 2px 8px;
    min-width: 2.5rem;
    text-align: center;
}

.feed-label {
    font-family: var(--font);
    font-size: 1rem;
    color: var(--mid);
    flex: 1;
    text-align: center;
}

.feed-hours {
    font-family: var(--font-cn);
    font-size: 1rem;
    background: var(--accent3);
    color: var(--accent2);
    padding: 2px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-stash-sort {
    font-size: 1rem;
    font-family: var(--font-cn);
    background: transparent;
    color: var(--mid);
    border: none;
    padding: 2px 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.btn-stash-sort--active {
    background: var(--accent2);
    color: var(--accent3);
}

/* ─────────────────────────────────────────────────────────
   ARTIKEL-LISTE (Feed)
───────────────────────────────────────────────────────── */
.article-list {
    padding: 0;
}

.article-card {
    border-bottom: 5px solid var(--accent2);
    transform-origin: bottom center;
    will-change: transform, opacity;
}

.hint-card {
    background: var(--accent);
    margin-top: 0;
}

.hint-card .article-meta {
    padding-top: 0.5rem;
    margin-top: 0;
}

.hint-card .article-desc {
    color: var(--black);
}

.article-link {
    display: block;
}

.article-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--grey);
    line-height: 0;
    font-size: 0;
}

.images-bw .article-img img {
    filter: grayscale(100%);
}

.article-img-placeholder-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-img-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--grey);
    display: flex;
    align-items: center;
    justify-content: center;
}


.article-img-placeholder--text {
    background: var(--grey);
    align-items: flex-start;
    padding: 0.75rem;
}

.placeholder-text {
    font-family: var(--font);
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--blue);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem 0;
    font-size: 1rem;
    color: var(--black);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    margin-top: 0.3rem;
}

.article-meta .article-source,
.article-meta .article-date {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.article-channel {
    flex-shrink: 0;
}

.article-date {
    margin-left: auto;
    flex-shrink: 0;
}

body.font-large .article-meta {
    font-size: 0.72rem;
    letter-spacing: 0;
    gap: 0.3rem;
}

.article-title {
    font-family: var(--font-cn);
    font-size: 1.7rem;
    font-weight: normal;
    line-height: 1.1;
    padding: 0.375rem 0.75rem 0.6rem;
    hyphens: auto;
    overflow-wrap: break-word;
}

.article-desc {
    font-size: 1.2rem;
    line-height: 1.15;
    color: var(--black);
    opacity: 60%;
    overflow-wrap: break-word;
    hyphens: auto;
    padding: 0 0.75rem 1.2rem;
}

.cluster-badge {
    position: absolute;
    bottom: 0.35rem;
    left: 0.35rem;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.2;
    color: var(--accent3);
    background: var(--accent2);
    border: none;
    padding: 0.1rem 0.2rem;
    cursor: pointer;
    z-index: 1;
    max-width: calc(100% - 0.7rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}
.cluster-badge--open {
    color: var(--white);
    background: var(--blue);
}

.cluster-dropdown {
    background: var(--grey);
}
.cluster-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: var(--black);
    border-bottom: 1px solid var(--light);
}
.cluster-item:last-child { border-bottom: none; }
.cluster-item:hover { background: var(--light); }
.cluster-item-source {
    font-size: 1rem;
    color: var(--blue);
    font-family: var(--font-cn);
}
.cluster-item-title {
    font-size: 1rem;
    line-height: 1.3;
}

.article-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem 0.3rem;
    border-top: 1px solid var(--black);
}

.btn-bookmark {
    font-size: 1.8rem;
    color: var(--black);
    background: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s;
}

.btn-bookmark--saved {
    color: var(--accent);
}

.btn-share {
    font-size: 1.8rem;
    color: var(--black);
    background: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s;
}

.btn-share--active {
    color: var(--accent);
}

/* ─────────────────────────────────────────────────────────
   CHANNEL-OVERLAY
───────────────────────────────────────────────────────── */
.channel-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--grey);
    overflow-y: auto;
    padding-bottom: 1rem;
}

.overlay-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    height: var(--topbar-height);
    padding: 1rem 0.75rem;
    background: var(--grey);
}


.overlay-bar {
    display: flex;
    position: sticky;
    top: var(--topbar-height);
    z-index: 90;
    align-items: center;
    gap: 0.5rem;
    height: var(--feedbar-height);
    padding: 0 0.75rem;
    background: var(--grey);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.189);
}

.overlay-label {
    font-family: var(--font);
    font-size: 1rem;
    color: var(--mid);
    flex: 1;
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 1.8rem;
}

.overlay-label2 {
    font-family: var(--font);
    font-size: 1rem;
    color: var(--mid);
    flex: 1;
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}
/* ─────────────────────────────────────────────────────────
   RATINGS TOGGLE
───────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────────────
   STYLE SECTION
───────────────────────────────────────────────────────── */
.style-section {
    background: var(--white);
    border: 1px solid var(--mid);
    margin: 0 0.75rem 0;
    overflow: hidden;
}

.style-section[open] {
    border-radius: 0;
    background: var(--grey);
}

.style-summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.style-summary::-webkit-details-marker {
    display: none;
}

.style-summary-text {
    font-family: var(--font-cn);
    font-size: 1.3rem;
    color: var(--black);
    padding: 0.4rem 0.75rem;
    flex: 1;
}

.style-summary-icon {
    font-size: 1.375rem;
    padding: 0.625rem 0.875rem;
    border-left: 1px solid var(--mid);
    line-height: 1;
    display: flex;
    align-items: center;
    color: var(--black);
}

.style-section[open] .style-summary {
    border-bottom: 1px solid var(--mid);
}

.style-rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.style-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    padding: 0.3rem 0.5rem;
    cursor: pointer;
}

.style-label {
    font-family: var(--font-cn);
    font-size: 1.3rem;
    color: var(--black);
    padding: 0 0 2px;
}

.style-color {
    font-family: var(--font-cn);
    font-size: 1rem;
    color: var(--white);
    cursor: pointer;
    border: none;
}

.style-font-toggle {
    font-family: var(--font-cn);
    font-size: 1.1rem;
    color: var(--black);
    padding: 0.25rem 0.35rem;
    text-align: center;
}

.style-font-toggle--large {
    padding: 0.25rem 0.34rem;
}

.style-reset {
    margin-top: 4px;
    width: 100%;
    font-family: var(--font-cn);
    font-size: 1rem;
    background: none;
    color: var(--mid);
    padding: 0.1rem 0 0.4rem;
    background-color: var(--white);
    text-align: center;
}

.channel-list {
    padding: 0 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.channel-item {
    position: relative;
}

.channel-row {
    position: relative;
    overflow: hidden;
}

.channel-btn {
    display: block;
    width: 100%;
    font-family: var(--font-cn);
    font-size: 3rem;
    text-align: center;
    padding: 0 0.02rem 0.02rem;
    background: var(--white);
    color: var(--black);
    /* border: 1px solid var(--black); */
    letter-spacing: 0.02em;
    transition: background 0.15s, transform 0.2s;
    position: relative;
    z-index: 1;
}

.btn-delete-channel {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 3.75rem;
    background: var(--grey);
    color: var(--black);
    font-size: 1.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
}

.channel-btn--active {
    background: var(--accent3);
    color: var(--accent2);
}

/* Sources-Panel (unter aktivem Channel) */
.sources-panel {
    background: var(--white);
    border: 1px solid var(--accent3);
    border-radius: 0 0 0.5rem 0.5rem;
    border-top: none;
    padding: 0.5rem 0;
}

.sources-actions {
    display: none;
}

.btn-clean {
    font-family: var(--font-cn);
    font-size: 1rem;
    letter-spacing: 0.07em;
    padding: 1px 10px 2px;
    border: 1px solid var(--black);
}

/* ── Toggle Switch ── */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.toggle-switch__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch__track {
    position: relative;
    width: 3.02rem;
    height: 1.4rem;
    border-radius: 1rem;
    background: #b0b0b0;
    box-shadow:
        inset 0 3px 6px rgba(0,0,0,0.25),
        inset 0 1px 3px rgba(0,0,0,0.2),
        0 1px 2px rgba(255,255,255,0.6);
    transition: background 0.25s;
}

.toggle-switch__thumb {
    position: absolute;
    top: 1px;
    left: 1px;
    width: calc(1.4rem - 2px);
    height: calc(1.4rem - 2px);
    border-radius: 50%;
    background: radial-gradient(circle at 38% 35%, #ffffff 0%, #d8d8d8 60%, #b8b8b8 100%);
    transition: left 0.25s cubic-bezier(0.34,1.56,0.64,1);
    flex-shrink: 0;
}

.toggle-switch__input:checked + .toggle-switch__track {
    background: var(--accent3);
    box-shadow:
        inset 0 3px 6px rgba(0,0,0,0.2),
        inset 0 1px 3px rgba(0,0,0,0.15),
        0 1px 2px rgba(255,255,255,0.3);
}

.toggle-switch__input:checked + .toggle-switch__track .toggle-switch__thumb {
    left: calc(100% - (1.4rem - 2px) - 1px);
}

.btn-all {
    background: var(--white);
}

.source-list {
    padding: 0;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.05rem 1rem;
}

.btn-del-source {
    display: none;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    color: var(--mid);
    flex-shrink: 0;
}

.btn-del-source--visible {
    display: flex;
}

.btn-del-source .icon {
    width: 1.3rem;
    height: 1.3rem;
}

.source-toggle {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    border: 1.4px solid var(--black);
    background: transparent;
    flex-shrink: 0;
    transition: background 0.15s;
}

.source-toggle--active {
    background: var(--black);
}

.source-name {
    font-size: 1.25rem;
    position: relative;
    top: -0.07em;
}

.source-add {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.source-add .toggle-switch {
    margin-right: auto;
}

.btn-add-source,
.btn-delete-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--black);
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}

.btn-add-source .icon,
.btn-delete-mode .icon {
    width: 1.3rem;
    height: 1.3rem;
}

.btn-delete-mode--active {
    color: var(--accent);
}

/* Neuer Channel */
.new-channel-row {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0.75rem 0.75rem 0;
    border: 1px solid var(--mid);
    background: var(--white);
}

.new-channel-plus {
    font-family: var(--font-cn);
    font-size: 1.375rem;
    padding: 0.625rem 0.875rem;
    border-left: 1px solid var(--mid);
    line-height: 1;
}

#new-channel-input {
    flex: 1;
    font-family: var(--font-cn);
    font-size: 1.3rem;
    padding: 0.4rem 0.75rem;
    border: none;
    background: transparent;
    outline: none;
    color: var(--mid);
    letter-spacing: 0.02em;
}

#new-channel-input::placeholder {
    color: var(--mid);
}

/* ─────────────────────────────────────────────────────────
   ADD-FEED DIALOG
───────────────────────────────────────────────────────── */
.add-feed-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
}

.add-feed-overlay[hidden] {
    display: none;
}

.add-feed-panel {
    background: var(--white);
    width: 100%;
    height: 50%;
    padding: 1.5rem 1rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.add-feed-title {
    font-family: var(--font-cn);
    font-size: 1.25rem;
    font-weight: normal;
    margin-bottom: 0.25rem;
}

.add-feed-panel label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--mid);
}

.add-feed-panel input {
    font-family: var(--font);
    font-size: 16px;
    padding: 0.625rem;
    border: 1px solid var(--black);
    background: var(--white);
    outline: none;
    width: 100%;
}

.add-feed-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

#add-feed-cancel {
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border: 1px solid var(--black);
    background: var(--white);
}

.add-feed-search-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.add-feed-search-row input {
    flex: 1;
}

.add-feed-search-btn {
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
    background: var(--black);
    color: var(--white);
    white-space: nowrap;
    flex-shrink: 0;
}

.add-feed-search-btn:disabled {
    opacity: 0.5;
}

.add-feed-results {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    max-height: 14rem;
    overflow-y: auto;
}

.add-feed-status {
    font-family: var(--font);
    font-size: 0.875rem;
    color: var(--mid);
    padding: 0.5rem 0;
}

.add-feed-status--error {
    color: #c0392b;
}

.add-feed-result-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--mid);
    background: var(--white);
    text-align: left;
    cursor: pointer;
}

.add-feed-result-item:hover,
.add-feed-result-item:active {
    background: var(--grey);
}

.add-feed-result-name {
    font-family: var(--font-cn);
    font-size: 1rem;
    color: var(--black);
}

.add-feed-result-url {
    font-family: var(--font);
    font-size: 0.7rem;
    color: var(--mid);
    word-break: break-all;
}

.add-feed-name-step {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.add-feed-name-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--mid);
}

.add-feed-name-input {
    font-family: var(--font);
    font-size: 0.9375rem;
    padding: 0.625rem;
    border: 1px solid var(--black);
    background: var(--white);
    outline: none;
    width: 100%;
}

.add-feed-name-confirm {
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 0.625rem;
    background: var(--black);
    color: var(--white);
    width: 100%;
}

/* ─────────────────────────────────────────────────────────
   STASH-GRID
───────────────────────────────────────────────────────── */
.stash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--black);
    border-top: 1px solid var(--black);
}

.stash-card {
    background: var(--white);
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.stash-remove {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    width: 1.4rem;
    height: 1.4rem;
    background: var(--black);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

.stash-remove .icon {
    background-color: var(--white);
    width: 0.7rem;
    height: 0.7rem;
}

.stash-card .article-link {
    display: block;
}

.stash-card .article-img {
    aspect-ratio: 1 / 1;
}

.stash-card .article-title {
    font-family: var(--font-cn);
    font-size: 1rem;
    padding: 0.375rem 0.5rem 0.25rem;
    line-height: 1.2;
}

.stash-card .article-source {
    display: block;
    font-size: 0.625rem;
    color: var(--mid);
    padding: 0 0.5rem 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stash-meta {
    display: flex;
    flex-direction: column;
    padding: 0.375rem 0.5rem 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    overflow: hidden;
}

.stash-meta-date {
    color: var(--mid);
    white-space: nowrap;
}

.stash-meta-source {
    color: var(--black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stash-card-scores {
    display: flex;
    justify-content: space-between;
    padding: 4px 0.5rem;
    font-size: 0.6875rem;
    border-top: 1px solid var(--grey);
}

.score-pos { color: var(--black); }
.score-neg { color: var(--mid); }

.stash-click-count {
    position: absolute;
    top: 0.35rem;
    left: 0.35rem;
    font-family: var(--font-cn);
    font-size: 0.75rem;
    line-height: 1;
    color: var(--white);
    background: rgba(0, 0, 0, 0.55);
    padding: 0.15rem 0.35rem;
    pointer-events: none;
    z-index: 1;
}

.btn-user--active {
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
}

/* ─────────────────────────────────────────────────────────
   AUTH OVERLAY
───────────────────────────────────────────────────────── */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: flex-end;
}

.auth-overlay[hidden] { display: none; }

.auth-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
}

.auth-panel {
    position: relative;
    z-index: 1;
    background: var(--white);
    width: 100%;
    border-top: 2px solid var(--black);
    padding-bottom: 2.5rem;
}

.auth-tabs {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--black);
}

.auth-tab {
    font-family: var(--font-cn);
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    padding: 0.875rem 1rem;
    color: var(--mid);
    border-right: 1px solid var(--black);
}

.auth-tab--active {
    color: var(--black);
    background: var(--grey);
}

.btn-close-auth {
    margin-left: auto;
    font-size: 1.5rem;
    padding: 0.625rem 1rem;
    color: var(--black);
    line-height: 1;
}

.auth-form {
    padding: 1.25rem 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.auth-form input {
    font-family: var(--font);
    font-size: 0.9375rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--black);
    background: var(--white);
    outline: none;
    width: 100%;
}

.auth-submit {
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 0.75rem;
    background: var(--black);
    color: var(--white);
    text-align: center;
    letter-spacing: 0.06em;
}

.auth-hint {
    font-size: 0.75rem;
    color: var(--mid);
    text-align: center;
    line-height: 1.5;
}

.auth-error {
    margin: 0.75rem 1rem 0;
    padding: 0.625rem 0.75rem;
    background: #ffe0e0;
    border: 1px solid #cc0000;
    font-size: 0.8125rem;
    color: #cc0000;
}

.auth-error[hidden] { display: none; }

.auth-username {
    font-family: var(--font-cn);
    font-size: 1.375rem;
    text-align: center;
    padding-bottom: 0.25rem;
}

.auth-invite-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0.75rem;
    background: var(--grey);
    border: 1px solid var(--black);
}

.auth-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--mid);
}

.auth-invite-code {
    font-family: var(--font-cn);
    font-size: 1.5rem;
    letter-spacing: 0.15em;
    color: var(--black);
}

.auth-email-row {
    display: flex;
    gap: 0.5rem;
}

.auth-email-row input {
    flex: 1;
}

.auth-email-row button {
    font-family: var(--font);
    font-size: 0.8125rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--black);
    background: var(--white);
    white-space: nowrap;
}

.auth-logout {
    font-family: var(--font);
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
    padding: 0.625rem;
    border: 1px solid var(--black);
    color: var(--mid);
    text-align: center;
}

/* ─────────────────────────────────────────────────────────
   CONTENT-BAN
───────────────────────────────────────────────────────── */
.contentban-section {
    padding-top: 4px;
}

.contentban-modes {
    display: flex;
    gap: 4px;
    padding: 0 0.75rem;
}

.contentban-mode-btn {
    flex: 1;
    font-family: var(--font-cn);
    font-size: 1.3rem;
    letter-spacing: 0.08em;
    padding: 0.4rem 0;
    border: 1px solid var(--mid);
    border-radius: 5rem;
    background: var(--white);
    color: var(--black);
}

.contentban-mode-btn--active {
    background: var(--mid);
    color: var(--white);
}

.contentban-list {
    padding: 0 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 4px;
}

.contentban-word {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.625rem;
    background: var(--white);
    border: 1px solid var(--mid);
    border-radius: 5rem;
    font-family: var(--font-cn);
    font-size: 1rem;
    margin-top: 1rem;
}


#contentban-input{
    flex: 1;
    font-family: var(--font-cn);
    font-size: 1.3rem;
    padding: 0.4rem 0.75rem;
    border: none;
    background: transparent;
    outline: none;
    color: var(--mid);
    letter-spacing: 0.02em;


}
.btn-remove-word {
    font-size: 1.125rem;
    color: var(--mid);
    line-height: 1;
}

/* blurred article */
.article-blurred .article-link {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

.content-note {
    display: none;
}

.article-blurred .content-note {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0.75rem;
    background: var(--accent);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: var(--font);
}

/* ─────────────────────────────────────────────────────────
   PULL-TO-REFRESH
───────────────────────────────────────────────────────── */
.ptr-indicator {
    overflow: hidden;
    height: 0;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--mid);
    background: var(--grey);
    transition: height 0.1s, opacity 0.1s;
}

.feed-loading,
.feed-empty {
    font-size: 0.875rem;
    color: var(--mid);
    text-align: center;
    padding: 2.5rem 1.25rem;
    line-height: 1.6;
}

/* ─────────────────────────────────────────────────────────
   ICONS
───────────────────────────────────────────────────────── */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
    vertical-align: middle;
}

.icon--white {
    background-color: var(--white);
}

.icon-plus  { -webkit-mask-image: url('../svg/icon-plus.svg');  mask-image: url('../svg/icon-plus.svg'); }
.icon-plus2  { -webkit-mask-image: url('../svg/icon-plus2.svg');  mask-image: url('../svg/icon-plus2.svg'); }
.icon-minus  { -webkit-mask-image: url('../svg/icon-minus.svg');  mask-image: url('../svg/icon-minus.svg'); }
.icon-minus2 { -webkit-mask-image: url('../svg/icon-minus2.svg'); mask-image: url('../svg/icon-minus2.svg'); }
.icon-x     { -webkit-mask-image: url('../svg/icon-x.svg');     mask-image: url('../svg/icon-x.svg'); }
.icon-stash    { -webkit-mask-image: url('../svg/icon-stash.svg');    mask-image: url('../svg/icon-stash.svg'); }
.icon-share    { -webkit-mask-image: url('../svg/icon-share.svg');    mask-image: url('../svg/icon-share.svg'); }
.icon-bookmark   { -webkit-mask-image: url('../svg/icon-bookmark.svg');   mask-image: url('../svg/icon-bookmark.svg'); }
.icon-bookmark-f { -webkit-mask-image: url('../svg/icon-bookmark-f.svg'); mask-image: url('../svg/icon-bookmark-f.svg'); }
.icon-a          { -webkit-mask-image: url('../svg/icon-a.svg');          mask-image: url('../svg/icon-a.svg'); }

/* ─────────────────────────────────────────────────────────
   RESPONSIVE — TABLET (≥ 640px)
───────────────────────────────────────────────────────── */
@media (min-width: 40rem) {
    body {
        max-width: 100%;
    }

    .article-title {
        font-size: 1.375rem;
    }

    .stash-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* ─────────────────────────────────────────────────────────
   RESPONSIVE — DESKTOP (≥ 1024px)
───────────────────────────────────────────────────────── */
@media (min-width: 64rem) {
    body {
        max-width: 100%;
    }

    .article-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
        align-items: stretch;
    }

    .article-card {
        display: flex;
        flex-direction: column;
    }

    .article-card .article-link {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .article-card .article-link:has(.article-img) {
        flex: none;
        display: block;
    }

    .article-card .article-desc {
        flex: 1;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .stash-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }

    .btn-share {
        font-size: 1.8rem;
        margin-bottom: 0;
    }
    

    /* Channel-Overlay als Sidebar */
    .channel-overlay {
        position: fixed;
        inset: 0 auto 0 0;
        width: 22rem;
        border-right: 2px solid var(--black);
    }

    /* Feed rückt rechts neben die Sidebar */
    body.sidebar-open {
        margin-left: 22rem;
        transition: margin-left 0.2s;
    }

    .auth-panel {
        max-width: 28rem;
        margin: 0 auto;
    }
    
}
