/* fustat-regular - latin */ @font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */ font-family: 'Fustat';
    font-style: normal;
    font-weight: 400;
    src: url('/shared-assets/fonts/fustat-v4-latin-regular.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* fustat-500 - latin */ @font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */ font-family: 'Fustat';
    font-style: normal;
    font-weight: 500;
    src: url('/shared-assets/fonts/fustat-v4-latin-500.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* fustat-700 - latin */ @font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */ font-family: 'Fustat';
    font-style: normal;
    font-weight: 700;
    src: url('/shared-assets/fonts/fustat-v4-latin-700.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* fustat-800 - latin */ @font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */ font-family: 'Fustat';
    font-style: normal;
    font-weight: 800;
    src: url('/shared-assets/fonts/fustat-v4-latin-800.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

@font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */ font-family: 'Inclusive Sans';
    font-style: normal;
    font-weight: 400;
    src: url('/shared-assets/fonts/inclusive-sans-v5-latin-regular.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inclusive-sans-600 - latin */ @font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */ font-family: 'Inclusive Sans';
    font-style: normal;
    font-weight: 600;
    src: url('/shared-assets/fonts/inclusive-sans-v5-latin-600.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inclusive-sans-700 - latin */ @font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */ font-family: 'Inclusive Sans';
    font-style: normal;
    font-weight: 700;
    src: url('/shared-assets/fonts/inclusive-sans-v5-latin-700.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

@font-face {
    font-family: "Source Serif 4";
    src: url("/shared-assets/fonts/SourceSerif4-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Source Serif 4";
    src: url("/shared-assets/fonts/SourceSerif4-SemiBold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #f6f4ef;
    --surface: #ffffff;
    --surface2: #f0ece5;
    --border: #ddd6cc;
    --text: #171512;
    --muted: #7a746c;
    --accent: #ff6a3d;
    --accent2: #e85b31;
    --accent-soft: #fff1eb;
    --danger: #d84949;
    --shadow: 0 12px 40px rgba(25, 28, 22, .06);
    --radius: 16px;
}

html[data-theme="dark"] {
    --bg: #11110f;
    --surface: #181715;
    --surface2: #201e1a;
    --border: #2c2924;
    --text: #f4f1eb;
    --muted: #a29a90;
    --accent: #ff7a52;
    --accent2: #ff8a67;
    --accent-soft: rgba(255, 122, 82, .14);
    --danger: #ff7070;
    --shadow: none;
}

* {
    box-sizing:border-box
}

html {
    color-scheme:light
}

html[data-theme="dark"] {
    color-scheme:dark
}

body {
    margin:0;
    background:var(--bg);
    color:var(--text);
    font:15px/1.5 'Fustat',ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif
}

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

button,input,textarea,select {
    font:inherit
}

.topbar {
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 20;

    display: grid;
    grid-template-columns: 165px minmax(0, 1fr) auto;
    align-items: center;

    padding: 0 24px 0 8px;

    border-bottom: 1px solid var(--border);

    background: color-mix(
        in srgb,
        var(--bg) 90%,
        transparent
    );

    backdrop-filter: blur(18px);
}

.brand {
    justify-self: start;
}

.topbar-search-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
}

.search {
    width: min(600px, 70%);
    max-width: 600px;
}

.top-actions {
    justify-self: end;
    margin-left: 0;
}

.brand-mark {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    overflow: hidden;
    flex: 0 0 32px;
    background: transparent;
    box-shadow: none;
}

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

.brand-word {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.045em;
}

.search input {
    border:0;
    background:transparent;
    width:100%;
    height:42px;
    outline:none;
    color:var(--text)
}

.top-actions>a:not(.btn),.text-btn {
    color:var(--muted)
}

.inline {
    display:inline
}

.text-btn,.icon-btn,.link-btn,.vote-btn {
    border:0;
    background:none;
    color:inherit;
    cursor:pointer
}

.icon-btn {
    width:38px;
    height:38px;
    border-radius:10px;
    border:1px solid var(--border);
    background:var(--surface)
}

.user-chip {
    padding:8px 10px;
    background:var(--surface2);
    border-radius:10px
}

.admin-link {
    font-weight:700
}

.app-shell {
    display:grid;
    grid-template-columns:170px minmax(0,1fr);
    max-width:1440px;
    margin:0 auto
}

.sidebar {
    position:sticky;
    top:70px;
    height:calc(100vh - 70px);
    padding:22px 10px 20px;
    border-right:1px solid var(--border);
    display:flex;
    flex-direction:column;
    overflow:auto
}

.side-group {
    margin-bottom:20px
}

.side-label,.eyebrow {
    text-transform:uppercase;
    letter-spacing:.12em;
    font-size:10px;
    font-weight:800;
    color:var(--muted)
}

.side-label {
    padding:0 8px 7px
}

.side-link {
    display:flex;
    gap:8px;
    align-items:center;
    padding:8px 8px;
    border-radius:9px;
    color:var(--muted);
    font-size:13px;
    font-weight:650
}

.side-link:hover,.side-link.active {
    background:var(--surface2);
    color:var(--text)
}

.side-link.active .hash,.hash {
    color:var(--accent2);
    font-weight:900
}

.sidebar-foot {
    margin-top:auto;
    padding:14px 8px 0;
    border-top:1px solid var(--border);
    display:flex;
    flex-wrap:wrap;
    gap:7px 10px;
    color:var(--muted);
    font-size:11px
}

.content {
    min-width:0;
    padding:34px clamp(22px,3vw,46px) 70px;
    max-width:1140px
}

.feed-head {
    display:flex;
    align-items:end;
    justify-content:space-between;
    gap:24px;
    margin-bottom:24px
}

.feed-head h1,.story-detail h1,.auth-card h1,.admin-head h1,.prose h1 {
    margin:4px 0 4px;
    letter-spacing:-.045em;
    line-height:1.05
}

.feed-head h1 {
    font-size:36px;
    font-family: "Source Serif 4";
}

.feed-head p,.auth-card>p,.profile-head p {
    margin:0;
    color:var(--muted)
}

.segmented {
    display:flex;
    padding:4px;
    background:var(--surface2);
    border-radius:11px
}

.segmented a {
    padding:7px 11px;
    border-radius:8px;
    color:var(--muted);
    font-weight:700
}

.segmented .active {
    background:var(--surface);
    color:var(--text);
    box-shadow:var(--shadow)
}

.story-list {
    display:grid;
    gap:10px
}

.story-card {
    display:grid;
    grid-template-columns:54px minmax(0,1fr);
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:15px 18px 15px 8px;
    transition:.15s
}

.story-card:hover {
    transform:translateY(-1px);
    border-color:color-mix(in srgb,var(--border),var(--text) 15%)
}

.vote-col {
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:1px
}

.vote-btn {
    font-size:13px;
    color:var(--muted);
    padding:0
}

.vote-btn:hover {
    color:var(--accent2)
}

.vote-btn.down:hover {
    color:var(--danger)
}

.score {
    font-size:13px
}

.story-kicker {
    display:flex;
    gap:7px;
    align-items:center;
    color:var(--muted);
    font-size:12px
}

.story-kicker a {
    color:var(--accent2);
    font-weight:800
}

.story-main h2 {
    font-size:18px;
    line-height:1.28;
    letter-spacing:-.02em;
    margin:5px 0
}

.story-main h2 a:hover {
    text-decoration:underline;
    text-decoration-thickness:1px;
    text-underline-offset:3px
}

.story-main p {
    color:var(--muted);
    margin:4px 0 9px;
    display:-webkit-box;
    -webkit-line-clamp:3;
    -webkit-box-orient:vertical;
    overflow:hidden
}

.story-actions {
    display:flex;
    gap:16px;
    color:var(--muted);
    font-size:12px;
    font-weight:650
}

.story-actions a:hover {
    color:var(--text)
}

.btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:40px;
    padding:8px 14px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--surface);
    color:var(--text);
    cursor:pointer;
    font-weight:750
}

.btn-primary {
    background:var(--accent);
    border-color:var(--accent);
    color:#12130f
}

.btn:hover {
    filter:brightness(.98)
}

.btn-block {
    width:100%
}

.btn-small {
    min-height:32px;
    padding:5px 9px;
    font-size:12px
}

.danger {
    color:var(--danger)!important
}

.back-link {
    display:inline-block;
    margin-bottom:18px;
    color:var(--muted)
}

.story-detail {
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:20px;
    padding:30px
}

.story-detail h1 {
    font-size:38px;
    max-width:850px
}

.lede {
    font-size:17px;
    color:var(--muted);
    max-width:760px
}

.detail-actions {
    display:flex;
    align-items:center;
    gap:16px;
    margin-top:22px;
    color:var(--muted)
}

.discussion {
    margin-top:34px
}

.section-title {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    margin-bottom:14px
}

.section-title h2 {
    margin:2px 0;
    font-size:21px;
    letter-spacing:-.025em
}

.comment-compose,.reply-form {
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:14px;
    padding:12px;
    margin:14px 0 22px
}

.comment-compose textarea,.reply-form textarea {
    width:100%;
    min-height:100px;
    resize:vertical;
    border:0;
    background:transparent;
    color:var(--text);
    outline:none
}

.comment-compose>div {
    display:flex;
    justify-content:flex-end
}

.comment {
    margin-left:calc(var(--depth) * 19px);
    border-left:2px solid var(--border);
    padding:11px 0 8px 14px
}

.comment-head {
    display:flex;
    gap:6px;
    color:var(--muted);
    font-size:12px
}

.comment-head strong {
    color:var(--text)
}

.comment-body {
    margin:6px 0;
    font-size:14px
}

.comment-actions {
    display:flex;
    gap:12px
}

.link-btn {
    font-size:12px;
    color:var(--muted);
    padding:0
}

.hidden {
    display:none!important
}

.signin-nudge,.empty,.empty-card {
    border:1px dashed var(--border);
    border-radius:14px;
    padding:18px;
    color:var(--muted);
    background:var(--surface)
}

.signin-nudge a {
    color:var(--text);
    font-weight:700
}

.auth-wrap {
    min-height:calc(100vh - 150px);
    display:grid;
    place-items:center
}

.auth-card {
    width:min(440px,100%);
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:22px;
    padding:32px;
    box-shadow:var(--shadow)
}

.auth-card h1 {
    font-size:32px
}

.auth-card form,.stack-form {
    display:grid;
    gap:16px;
    margin-top:24px
}

.auth-card label,.stack-form label,.modal label {
    display:grid;
    gap:6px;
    font-weight:700
}

.auth-card input,.stack-form input,.stack-form select,.modal input,.modal select,.modal textarea,.filter-row input,.filter-row select {
    width:100%;
    border:1px solid var(--border);
    background:var(--bg);
    color:var(--text);
    border-radius:10px;
    padding:10px 11px;
    outline:none
}

.auth-card input:focus,.stack-form input:focus,.filter-row input:focus {
    border-color:var(--accent2)
}

small,.optional {
    font-size:11px;
    color:var(--muted);
    font-weight:500
}

.auth-foot {
    margin-top:18px;
    color:var(--muted);
    text-align:center
}

.auth-foot a {
    color:var(--text);
    font-weight:700
}

.profile-head {
    display:flex;
    align-items:center;
    gap:18px;
    margin-bottom:34px
}

.avatar {
    width:64px;
    height:64px;
    border-radius:20px;
    background:var(--accent);
    color:#111;
    display:grid;
    place-items:center;
    font-weight:900;
    font-size:26px
}

.profile-head h1 {
    margin:1px 0;
    font-size:34px
}

.profile-comment {
    padding:18px 0;
    border-bottom:1px solid var(--border)
}

.profile-comment>a {
    font-weight:800
}

.profile-comment p {
    margin:7px 0;
    color:var(--muted)
}

.profile-comment span {
    font-size:12px;
    color:var(--muted)
}

.prose {
    max-width:700px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:20px;
    padding:34px
}

.prose h1 {
    font-size:36px
}

.prose p {
    font-size:17px;
    color:var(--muted)
}

.flash {
    padding:12px 14px;
    border-radius:11px;
    margin-bottom:15px;
    background:var(--surface);
    border:1px solid var(--border)
}

.flash.error {
    border-color:color-mix(in srgb,var(--danger),var(--border) 50%);
    color:var(--danger)
}

.flash.success {
    border-color:var(--accent2)
}

.admin-head {
    margin-bottom:24px
}

.admin-head h1 {
    font-size:36px
}

.admin-tabs {
    display:flex;
    gap:4px;
    margin-top:18px;
    overflow:auto
}

.admin-tabs a {
    padding:8px 11px;
    border-radius:9px;
    color:var(--muted);
    font-weight:700;
    white-space:nowrap
}

.admin-tabs .active {
    background:var(--surface2);
    color:var(--text)
}

.stat-grid {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:12px;
    margin-bottom:18px
}

.stat,.admin-panel {
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:16px;
    padding:18px
}

.stat span,.stat small {
    display:block;
    color:var(--muted)
}

.stat strong {
    font-size:30px;
    letter-spacing:-.04em
}

.admin-grid {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px
}

.health-row,.log-row,.admin-row,.source-card {
    display:flex;
    justify-content:space-between;
    gap:20px;
    align-items:center;
    padding:13px 0;
    border-top:1px solid var(--border)
}

.health-row:first-of-type,.admin-row:first-child,.source-card:first-child {
    border-top:0
}

.health-row>div,.log-row,.admin-row-main,.source-card>div {
    display:grid
}

.health-row span,.log-row span,.admin-row-main span,.source-card span,.source-card small {
    color:var(--muted);
    font-size:12px
}

.status {
    font-size:11px!important;
    font-weight:800;
    padding:4px 7px;
    border-radius:999px
}

.status.ok {
    background:color-mix(in srgb,var(--accent) 18%,transparent);
    color:var(--accent2)
}

.status.paused {
    background:var(--surface2)
}

.filter-row {
    display:flex;
    gap:8px;
    margin-bottom:12px
}

.filter-row input {
    flex:1
}

.row-actions {
    display:flex;
    gap:7px;
    flex-wrap:wrap;
    justify-content:flex-end
}

.report-card {
    padding:18px 0;
    border-top:1px solid var(--border)
}

.report-card:first-child {
    border-top:0
}

.report-meta {
    display:flex;
    justify-content:space-between;
    gap:15px
}

.report-meta span,.muted {
    color:var(--muted)
}

.report-story {
    display:inline-block;
    margin-top:8px;
    font-weight:800
}

.report-card blockquote {
    margin:12px 0;
    padding-left:14px;
    border-left:3px solid var(--border)
}

.removed {
    color:var(--muted)
}

.sources-grid {
    grid-template-columns:1.25fr .75fr
}

.modal-backdrop {
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.55);
    z-index:80;
    display:grid;
    place-items:center;
    padding:20px
}

.modal {
    width:min(460px,100%);
    position:relative;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:20px;
    padding:26px;
    box-shadow:0 30px 90px rgba(0,0,0,.25)
}

.modal h2 {
    margin:4px 0 16px
}

.modal form {
    display:grid;
    gap:15px
}

.modal textarea {
    min-height:90px;
    resize:vertical
}

.modal-x {
    position:absolute;
    right:15px;
    top:12px;
    border:0;
    background:none;
    color:var(--muted);
    font-size:25px;
    cursor:pointer
}

@media(max-width:900px) {
    .app-shell {
        grid-template-columns:1fr
    }
    .sidebar {
        display:none
    }
    .content {
        padding:25px 18px 60px;
        max-width:none
    }
    .search {
        display:none
    }
    .stat-grid {
        grid-template-columns:1fr 1fr
    }
    .admin-grid,.sources-grid {
        grid-template-columns:1fr
    }
    .topbar {
        padding:0 16px
    }
    .top-actions {
        gap:8px
    }
    .top-actions .user-chip {
        display:none
    }
    .feed-head {
        align-items:flex-start;
        flex-direction:column
    }
    .story-detail h1 {
        font-size:31px
    }
}

@media(max-width:580px) {
    .story-card {
        grid-template-columns:42px minmax(0,1fr);
        padding-right:12px
    }
    .story-main h2 {
        font-size:16px
    }
    .story-main p {
        display:none
    }
    .top-actions>a:not(.btn) {
        display:none
    }
    .stat-grid {
        grid-template-columns:1fr 1fr
    }
    .stat strong {
        font-size:24px
    }
    .filter-row {
        flex-direction:column
    }
    .admin-row,.source-card {
        align-items:flex-start;
        flex-direction:column
    }
    .row-actions {
        justify-content:flex-start
    }
    .story-detail {
        padding:22px
    }
    .story-detail h1 {
        font-size:27px
    }
    .content {
        padding-inline:12px
    }
    .auth-card {
        padding:24px
    }
    .detail-actions {
        flex-wrap:wrap
    }
}

/* ==========================================================================
   Rillr layout refinements
   ========================================================================== */ .app-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: 165px minmax(0, 1fr) !important;
}

.sidebar {
    width: auto !important;
    min-width: 0 !important;
    padding: 18px 8px !important;
}

.side-link {
    padding: 6px 7px !important;
    font-size: 12px !important;
}

.side-label {
    font-size: 9px !important;
    padding-left: 7px !important;
}

.content {
    width: 100%;
    max-width: 1760px !important;
    padding-left: 24px !important;
    padding-right: 28px !important;
}

/* ==========================================================================
   Brand / logo
   ========================================================================== */ .brand {
    gap: 10px;
    font-size: 22px;
    font-weight: 850;
    letter-spacing: -.045em;
}

.brand-mark {
    position: relative;
    width: 32px;
    height: 32px;
    overflow: hidden;
    border-radius: 10px;
    color: transparent;
}


/* ==========================================================================
   Accent styling
   ========================================================================== */ .side-link.active .hash, .hash, .story-kicker a {
    color: var(--accent);
}

.side-link:hover, .side-link.active {
    background: var(--accent-soft);
    color: var(--text);
}

.vote-btn:hover {
    color: var(--accent);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.avatar {
    background: var(--accent);
    color: #ffffff;
}

.auth-card input:focus, .stack-form input:focus, .filter-row input:focus {
    border-color: var(--accent);
}

.flash.success {
    border-color: var(--accent);
}

.status.ok {
    background: var(--accent-soft);
    color: var(--accent);
}

/* ==========================================================================
   Three-column story feed
   ========================================================================== */ .story-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.story-card {
    width: 100%;
    height: 100%;
    margin: 0;
}

.story-main {
    min-width: 0;
}

.story-main h2 {
    overflow-wrap: anywhere;
}

.feed-head, .feed-header {
    grid-column: 1 / -1;
}

/* ==========================================================================
   Responsive story grid
   ========================================================================== */ @media (max-width: 1500px) {
    .story-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1050px) {
    .story-list {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   User actions: bookmarks, submissions, profile stories
   ========================================================================== */

.bookmark-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

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

.submitted-by {
    margin: -1px 0 8px;
    color: var(--muted);
    font-size: 12px;
}

.submitted-by a {
    color: var(--text);
    font-weight: 700;
}

.submit-wrap {
    width: min(760px, 100%);
}

.submit-head {
    margin-bottom: 22px;
}

.submit-head h1 {
    margin: 4px 0 5px;
    font-size: 38px;
    line-height: 1.05;
    letter-spacing: -.045em;
}

.submit-head p {
    margin: 0;
    color: var(--muted);
}

.submit-card {
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.submit-form {
    display: grid;
    gap: 20px;
}

.submit-form label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.submit-form label > span {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.submit-form em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 500;
}

.submit-form input,
.submit-form select,
.submit-form textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    background: var(--bg);
    color: var(--text);
    padding: 11px 12px;
}

.submit-form input,
.submit-form select {
    min-height: 44px;
}

.submit-form textarea {
    min-height: 130px;
    resize: vertical;
}

.submit-form input:focus,
.submit-form select:focus,
.submit-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.submit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 2px;
}

.bookmark-empty {
    grid-column: 1 / -1;
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
    gap: 30px;
    align-items: start;
}

.profile-story-list {
    display: grid;
    gap: 12px;
}

.profile-story-list .story-card {
    height: auto;
}

.mobile-nav {
    display: none;
}


/* ==========================================================================
   iPhone / mobile layout
   ========================================================================== */

@media (max-width: 900px) {
    .app-shell {
        display: block !important;
    }

    .sidebar {
        display: none !important;
    }

    .content {
        width: 100%;
        max-width: none !important;
        padding: 24px 18px 88px !important;
    }

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

@media (max-width: 700px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        padding-bottom: calc(68px + env(safe-area-inset-bottom));
    }

    .topbar {
        height: 58px;
        gap: 10px;
        padding-top: env(safe-area-inset-top);
        padding-right: 12px;
        padding-left: 12px;
        border-bottom: 1px solid var(--border);
    }

    .brand {
        flex: 0 0 auto;
        gap: 8px;
        font-size: 20px;
    }

    .brand-mark {
        width: 29px;
        height: 29px;
        border-radius: 9px;
    }

    .search {
        display: none;
    }

    .top-actions {
        margin-left: auto;
        gap: 6px;
    }

    .top-actions > a,
    .top-actions .inline,
    .top-actions .user-chip,
    .top-actions .admin-link {
        display: none;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .content {
        padding: 20px 12px 30px !important;
    }

    .feed-head {
        display: grid;
        gap: 16px;
        margin-bottom: 18px;
    }

    .feed-head h1 {
        font-size: 30px;
    }

    .feed-head p {
        font-size: 14px;
    }

    .segmented {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .segmented a {
        text-align: center;
    }

    .story-list {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .story-card {
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 13px 12px 13px 4px;
        border-radius: 14px;
    }

    .vote-col {
        gap: 2px;
    }

    .vote-btn {
        min-width: 28px;
        min-height: 25px;
    }

    .story-kicker {
        flex-wrap: wrap;
        gap: 4px 6px;
        font-size: 11px;
        line-height: 1.35;
    }

    .story-main h2 {
        margin-top: 6px;
        font-size: 17px;
        line-height: 1.3;
    }

    .story-main p {
        margin-bottom: 8px;
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    .story-actions {
        flex-wrap: wrap;
        gap: 8px 13px;
        font-size: 11px;
    }

    .bookmark-btn {
        min-height: 28px;
        padding: 0;
    }

    .submitted-by {
        font-size: 11px;
    }

    .story-detail {
        padding: 20px 17px;
        border-radius: 16px;
    }

    .story-detail h1 {
        max-width: 100%;
        font-size: 28px;
        overflow-wrap: anywhere;
    }

    .lede {
        font-size: 15px;
    }

    .detail-actions {
        align-items: flex-start;
        gap: 10px 14px;
        flex-wrap: wrap;
    }

    .detail-actions .btn-primary {
        width: 100%;
    }

    .discussion {
        margin-top: 26px;
    }

    .comment {
        margin-left: min(calc(var(--depth) * 12px), 36px);
        padding-left: 10px;
    }

    .comment-compose,
    .reply-form {
        padding: 10px;
    }

    .auth-wrap {
        min-height: auto;
        display: block;
    }

    .auth-card {
        width: 100%;
        padding: 22px 18px;
        border-radius: 17px;
    }

    .submit-head h1 {
        font-size: 31px;
    }

    .submit-card {
        padding: 20px 16px;
        border-radius: 17px;
    }

    .submit-form {
        gap: 17px;
    }

    .submit-form input,
    .submit-form select,
    .submit-form textarea {
        font-size: 16px;
    }

    .submit-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .profile-head {
        gap: 13px;
        margin-bottom: 25px;
    }

    .avatar {
        width: 52px;
        height: 52px;
        border-radius: 16px;
        font-size: 22px;
    }

    .profile-head h1 {
        font-size: 28px;
        overflow-wrap: anywhere;
    }

    .admin-tabs {
        margin-right: -12px;
        padding-right: 12px;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .stat,
    .admin-panel {
        padding: 14px;
    }

    .modal-backdrop {
        align-items: end;
        padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    }

    .modal {
        width: 100%;
        max-height: 88vh;
        overflow-y: auto;
        padding: 22px 18px;
        border-radius: 18px;
    }

    .mobile-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 100;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        min-height: 58px;
        padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        background: color-mix(in srgb, var(--surface) 94%, transparent);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .mobile-nav a {
        display: grid;
        place-items: center;
        align-content: center;
        gap: 1px;
        min-width: 0;
        color: var(--muted);
        font-size: 10px;
        font-weight: 700;
        line-height: 1.15;
    }

    .mobile-nav a.active {
        color: var(--accent);
    }

    .mobile-nav-icon {
        display: grid;
        place-items: center;
        width: 28px;
        height: 24px;
        font-size: 18px;
        line-height: 1;
    }

    .mobile-nav-submit {
        width: 28px;
        height: 28px;
        border-radius: 9px;
        background: var(--accent);
        color: #ffffff;
        font-size: 20px;
    }
}

@media (max-width: 380px) {
    .content {
        padding-right: 9px !important;
        padding-left: 9px !important;
    }

    .brand-word {
        font-size: 19px;
    }

    .story-card {
        grid-template-columns: 36px minmax(0, 1fr);
        padding-right: 9px;
    }

    .story-main h2 {
        font-size: 16px;
    }

    .story-actions {
        gap: 7px 10px;
    }

    .mobile-nav {
        padding-right: 2px;
        padding-left: 2px;
    }

    .mobile-nav a {
        font-size: 9px;
    }
}


/* ==========================================================================
   Main feed footer
   ========================================================================== */

.feed-footer {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 32px;
    padding: 22px 0 8px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.feed-footer-sep {
    display: inline-block;
    margin: 0 10px;
    color: var(--border);
}

@media (max-width: 580px) {
    .feed-footer {
        margin-top: 24px;
        padding: 20px 10px 80px;
        font-size: 11px;
        line-height: 1.8;
    }

    .feed-footer-sep {
        display: none;
    }

    .feed-footer {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
    }
}

/* ==========================================================================
   Community growth features
   ========================================================================== */

.search {
    display: flex;
    align-items: center;
    gap: 9px;
    width: min(620px, 75%);
    height: 44px;
    padding: 0 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.search > span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 14px;
    line-height: 1;
}

.search input {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 42px;
    padding: 0;
}

.trending-discussions {
    grid-column: 1 / -1;
    margin: 0 0 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.trending-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}

.trending-head h2 {
    margin: 2px 0 0;
    font-size: 20px;
    letter-spacing: -.025em;
}

.trending-head > a {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}

.trending-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.trending-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
}

.trending-item:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.trending-count {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
}

.trending-copy {
    min-width: 0;
}

.trending-copy strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 13px;
    line-height: 1.35;
}

.trending-copy small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
}

.share-btn {
    padding: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

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

.notification-link {
    position: relative;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted) !important;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border: 2px solid var(--bg);
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
}

.notification-list {
    display: grid;
    gap: 10px;
    max-width: 920px;
}

.notification-item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.notification-item.unread {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
}

.notification-dot {
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 999px;
    background: var(--border);
}

.notification-item.unread .notification-dot {
    background: var(--accent);
}

.notification-copy {
    display: block;
    min-width: 0;
}

.notification-copy small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.comment-score {
    color: var(--muted);
}

.comment-posted {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
}

.profile-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 24px;
}

.profile-stats > div {
    min-width: 110px;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.profile-stats strong,
.profile-stats span {
    display: block;
}

.profile-stats strong {
    font-size: 20px;
}

.profile-stats span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

@media (max-width: 1500px) {
    .trending-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .trending-list {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .trending-discussions {
        padding: 14px;
    }

    .trending-list {
        grid-template-columns: 1fr;
    }

    .notification-link {
        width: 34px;
        height: 34px;
    }

    .profile-stats > div {
        flex: 1 1 90px;
        min-width: 0;
    }
}
/* ==========================================================================
   Top bar repair
   ========================================================================== */

.topbar {
    height: 70px;
    display: grid;
    grid-template-columns: 165px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;

    padding: 0 24px 0 8px;
}


/* Brand */

.topbar .brand {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;

    width: auto !important;
    margin: 0 !important;
}

.topbar .brand-mark {
    display: block !important;
    flex: 0 0 32px !important;

    width: 32px !important;
    height: 32px !important;

    margin: 0 !important;

    overflow: hidden;
    border-radius: 9px;
}

.topbar .brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar .brand-word {
    display: block;
    margin: 0;

    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.045em;
}


/* Search */

.topbar-search-wrap {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-width: 0;
}

.topbar .search {
    display: flex;
    align-items: center;
    gap: 9px;

    width: min(620px, 75%);
    max-width: 620px;
    height: 44px;
}


/* Right-side actions */

.top-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;

    justify-self: end;

    width: auto !important;
    margin: 0 !important;
    white-space: nowrap;
}

.top-actions .icon-btn,
.top-actions .notification-link {
    flex: 0 0 38px;

    width: 38px;
    height: 38px;
}

.top-actions .user-chip {
    display: inline-flex;
    align-items: center;

    height: 38px;
    margin: 0;
}

.top-actions .inline {
    display: inline-flex;
    align-items: center;

    margin: 0;
}

.top-actions .text-btn {
    white-space: nowrap;
}


/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 700px) {

    .topbar {
        height: 58px;
        grid-template-columns: auto 1fr auto;
        gap: 10px;

        padding-right: 12px;
        padding-left: 12px;
    }

    .topbar .brand {
        gap: 8px !important;
    }

    .topbar .brand-mark {
        flex-basis: 29px !important;

        width: 29px !important;
        height: 29px !important;
    }

    .topbar .brand-word {
        font-size: 20px;
    }

    .topbar-search-wrap {
        display: none;
    }

    .top-actions {
        gap: 6px !important;
    }

    .top-actions > a,
    .top-actions .inline,
    .top-actions .user-chip,
    .top-actions .admin-link {
        display: none !important;
    }

    .top-actions #themeToggle {
        display: grid !important;
    }
}


/* ==========================================================================
   Rillr mobile drawer + logout page
   Append this to the BOTTOM of public/assets/css/rillr.css
   ========================================================================== */

.mobile-menu-toggle,
.mobile-menu-overlay {
    display: none;
}

.logout-card {
    max-width: 520px;
}

.logout-card .auth-copy {
    margin: 12px 0 22px;
    color: var(--muted);
}

.logout-card .auth-copy strong {
    color: var(--text);
}

.logout-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-actions .btn {
    min-width: 110px;
    justify-content: center;
}

@media (max-width: 900px) {
    .mobile-menu-toggle {
        display: grid !important;
        place-items: center;
    }

    .sidebar {
        display: block !important;
        position: fixed !important;
        top: 58px;
        bottom: 0;
        left: 0;
        z-index: 130;

        width: min(310px, 86vw) !important;
        min-width: 0 !important;
        max-width: 86vw;

        padding: 18px 10px calc(88px + env(safe-area-inset-bottom)) !important;

        overflow-y: auto;
        overscroll-behavior: contain;

        background: var(--bg);
        border-right: 1px solid var(--border);

        transform: translateX(-105%);
        transition: transform .2s ease;
    }

    body.mobile-menu-open .sidebar {
        transform: translateX(0);
    }

    .mobile-menu-overlay {
        display: block;
        position: fixed;
        inset: 58px 0 0 0;
        z-index: 125;

        width: 100%;
        height: auto;

        padding: 0;
        border: 0;

        background: rgba(0, 0, 0, .32);

        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    body.mobile-menu-open .mobile-menu-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    .sidebar .sidebar-foot {
        padding-bottom: 10px;
    }
}

@media (max-width: 700px) {
    .top-actions .mobile-menu-toggle,
    .top-actions #themeToggle {
        display: grid !important;
    }

    .top-actions .mobile-menu-toggle {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
    }

    .logout-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .logout-actions .btn {
        width: 100%;
    }
}


/* ==========================================================================
   Mobile header action alignment
   ========================================================================== */

.mobile-logout-btn {
    display: none;
}

@media (max-width: 700px) {

    .topbar {
        grid-template-columns: auto 1fr auto;
        align-items: center;
    }

    .top-actions {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;

        gap: 8px !important;

        justify-self: end !important;
        align-self: center !important;

        height: 100%;
        margin: 0 !important;
    }

    .top-actions .mobile-menu-toggle,
    .top-actions #themeToggle,
    .top-actions .mobile-logout-btn {
        display: grid !important;
        place-items: center !important;

        flex: 0 0 38px !important;

        width: 38px !important;
        height: 38px !important;

        margin: 0 !important;
        padding: 0 !important;

        border: 1px solid var(--border);
        border-radius: 12px;

        background: var(--surface);
        color: var(--text);

        font-size: 19px;
        line-height: 1;
    }

    .top-actions .mobile-menu-toggle span,
    .top-actions .mobile-logout-btn span {
        display: block;

        line-height: 1;

        transform: translateY(-1px);
    }

    .top-actions #themeToggle {
        line-height: 1 !important;
    }

    .top-actions > a:not(.mobile-logout-btn),
    .top-actions .inline,
    .top-actions .user-chip,
    .top-actions .admin-link {
        display: none !important;
    }
}

/* ==========================================================================
   Comment actions - match story card actions
   ========================================================================== */

.comment-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;

    margin-top: 10px;
}

.comment-action {
    appearance: none;
    -webkit-appearance: none;

    display: inline-flex;
    align-items: center;
    gap: 5px;

    width: auto;
    min-width: 0;
    height: auto;

    margin: 0;
    padding: 0;

    border: 0 !important;
    border-radius: 0;

    background: transparent !important;
    box-shadow: none !important;

    color: var(--muted);

    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;

    cursor: pointer;
}

.comment-action:hover {
    color: var(--accent);
    background: transparent !important;
}

.comment-action:focus {
    outline: none;
}

.comment-action:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 3px;
}

.comment-action-icon {
    display: inline-block;
    flex: 0 0 auto;

    color: inherit;

    font-size: 12px;
    line-height: 1;
}


.infinite-scroll-trigger {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 18px 0 8px;
}

.story-detail-vote {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.story-detail-vote .vote-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.story-detail-vote .vote-btn {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 2px 3px;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
}

.story-detail-vote .vote-btn:hover {
    color: var(--accent);
}

.story-detail-vote .score {
    min-width: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--text);
}

/* ==========================================================================
   Rillr Legal Pages
   Modern editorial legal layout
   ========================================================================== */

.legal-page {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
}


/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.legal-hero {
    position: relative;

    margin-bottom: 34px;
    padding: 34px 36px;

    border: 1px solid var(--border);
    border-radius: 22px;

    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--accent-soft) 55%, var(--surface)),
            var(--surface) 65%
        );

    overflow: hidden;
}

.legal-hero::after {
    content: "";

    position: absolute;
    top: -70px;
    right: -70px;

    width: 220px;
    height: 220px;

    border-radius: 50%;

    background:
        color-mix(
            in srgb,
            var(--accent) 7%,
            transparent
        );

    pointer-events: none;
}

.legal-hero .eyebrow {
    position: relative;
    z-index: 1;

    margin-bottom: 12px;

    color: var(--accent);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.legal-hero h1 {
    position: relative;
    z-index: 1;

    margin: 0 0 14px;

    max-width: 780px;

    color: var(--text);

    font-size: clamp(42px, 5vw, 66px);
    line-height: .98;
    letter-spacing: -.055em;
}

.legal-hero > p {
    position: relative;
    z-index: 1;

    max-width: 760px;
    margin: 0;

    color: var(--muted);

    font-size: 16px;
    line-height: 1.7;
}

.legal-updated {
    position: relative;
    z-index: 1;

    display: inline-flex;
    align-items: center;
    gap: 7px;

    margin-top: 18px;
    padding: 7px 11px;

    border: 1px solid var(--border);
    border-radius: 999px;

    background:
        color-mix(
            in srgb,
            var(--surface) 88%,
            transparent
        );

    color: var(--muted);

    font-size: 11px;
    font-weight: 700;
}

.legal-updated::before {
    content: "";

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--accent);
}


/* --------------------------------------------------------------------------
   Main layout
   -------------------------------------------------------------------------- */

.legal-layout {
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
    gap: 34px;

    align-items: start;
}


/* --------------------------------------------------------------------------
   Sticky table of contents
   -------------------------------------------------------------------------- */

.legal-toc {
    position: sticky;
    top: 92px;

    display: flex;
    flex-direction: column;

    padding: 14px;

    border: 1px solid var(--border);
    border-radius: 18px;

    background:
        color-mix(
            in srgb,
            var(--surface) 94%,
            var(--bg)
        );
}

.legal-toc-title {
    padding: 7px 9px 11px;

    color: var(--text);

    font-size: 10px;
    font-weight: 850;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.legal-toc a {
    position: relative;

    display: block;

    padding: 8px 10px;

    border-radius: 9px;

    color: var(--muted);

    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;

    transition:
        background .15s ease,
        color .15s ease,
        transform .15s ease;
}

.legal-toc a:hover {
    background: var(--accent-soft);
    color: var(--text);

    transform: translateX(2px);
}


/* --------------------------------------------------------------------------
   Content stack
   -------------------------------------------------------------------------- */

.legal-content {
    min-width: 0;

    display: grid;
    gap: 18px;
}


/* --------------------------------------------------------------------------
   Section cards
   -------------------------------------------------------------------------- */

.legal-content section {
    position: relative;

    margin: 0;
    padding: 30px 32px;

    border: 1px solid var(--border);
    border-radius: 20px;

    background: var(--surface);

    overflow: hidden;

    scroll-margin-top: 96px;

    transition:
        border-color .15s ease,
        transform .15s ease;
}

.legal-content section:hover {
    border-color:
        color-mix(
            in srgb,
            var(--border) 75%,
            var(--text)
        );
}

.legal-content section::before {
    content: "";

    position: absolute;

    top: 0;
    bottom: 0;
    left: 0;

    width: 3px;

    background: var(--accent);
}

.legal-section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 31px;
    height: 24px;

    margin-bottom: 12px;
    padding: 0 7px;

    border-radius: 999px;

    background: var(--accent-soft);

    color: var(--accent);

    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
}

.legal-content h2 {
    margin: 0 0 16px;

    color: var(--text);

    font-size: 27px;
    line-height: 1.12;
    letter-spacing: -.035em;
}

.legal-content h3 {
    margin: 24px 0 8px;

    color: var(--text);

    font-size: 16px;
    line-height: 1.35;
    letter-spacing: -.015em;
}

.legal-content p {
    margin: 0 0 15px;

    color: var(--muted);

    font-size: 15px;
    line-height: 1.78;
}

.legal-content p:last-child {
    margin-bottom: 0;
}

.legal-content ul {
    margin: 10px 0 16px;
    padding-left: 20px;
}

.legal-content li {
    margin: 7px 0;

    color: var(--muted);

    font-size: 15px;
    line-height: 1.7;
}

.legal-content li::marker {
    color: var(--accent);
}

.legal-content strong {
    color: var(--text);
}


/* --------------------------------------------------------------------------
   Legal emphasis blocks
   -------------------------------------------------------------------------- */

.legal-caps {
    margin-top: 18px !important;
    padding: 17px 18px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--bg);

    color: var(--text) !important;

    font-size: 13px !important;
    font-weight: 700;
    line-height: 1.65 !important;
}


/* --------------------------------------------------------------------------
   Optional notice card
   -------------------------------------------------------------------------- */

.legal-notice {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 16px;

    align-items: start;

    margin-bottom: 18px;
    padding: 22px 24px;

    border:
        1px solid
        color-mix(
            in srgb,
            var(--accent) 30%,
            var(--border)
        );

    border-radius: 18px;

    background:
        color-mix(
            in srgb,
            var(--accent-soft) 48%,
            var(--surface)
        );
}

.legal-notice-icon {
    display: grid;
    place-items: center;

    width: 46px;
    height: 46px;

    border-radius: 13px;

    background: var(--surface);

    color: var(--accent);

    font-size: 19px;
}

.legal-notice h2 {
    margin: 1px 0 5px;

    color: var(--text);

    font-size: 18px;
    letter-spacing: -.02em;
}

.legal-notice p {
    margin: 0;

    color: var(--muted);

    font-size: 14px;
    line-height: 1.6;
}


/* ==========================================================================
   Tablet
   ========================================================================== */

@media (max-width: 1000px) {

    .legal-layout {
        grid-template-columns: 210px minmax(0, 1fr);
        gap: 24px;
    }

    .legal-hero {
        padding: 28px;
    }

    .legal-content section {
        padding: 26px;
    }
}


/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 760px) {

    .legal-page {
        max-width: none;
    }

    .legal-hero {
        margin-bottom: 20px;
        padding: 24px 20px;

        border-radius: 17px;
    }

    .legal-hero h1 {
        font-size: 39px;
    }

    .legal-hero > p {
        font-size: 14px;
    }

    .legal-layout {
        display: block;
    }

    .legal-toc {
        position: static;

        margin-bottom: 16px;

        max-height: 250px;

        overflow-y: auto;
    }

    .legal-content {
        gap: 12px;
    }

    .legal-content section {
        padding: 23px 19px 23px 22px;

        border-radius: 16px;
    }

    .legal-content h2 {
        font-size: 23px;
    }

    .legal-content p,
    .legal-content li {
        font-size: 14px;
        line-height: 1.72;
    }

    .legal-notice {
        grid-template-columns: 38px minmax(0, 1fr);

        padding: 18px;

        border-radius: 15px;
    }

    .legal-notice-icon {
        width: 38px;
        height: 38px;

        border-radius: 10px;
    }
}

/* ==========================================================================
   Rillr 2026 editorial homepage
   ========================================================================== */

.content {
    max-width: 1680px !important;
    padding-top: 28px !important;
}

.feed-head-editorial {
    margin-bottom: 20px;
}

.feed-head-editorial h1 {
    font-size: clamp(42px, 4.2vw, 62px);
    line-height: .94;
}

.home-editorial-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.home-feature-stack {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.home-lead-story {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(320px, 1.05fr);
    gap: 22px;
    min-height: 330px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
}

.home-lead-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 6px 2px 4px;
}

.home-category-pill {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
}

.home-lead-story h2 {
    margin: 12px 0 10px;
    font-family: "Source Serif 4", serif;
    font-size: clamp(31px, 3vw, 48px);
    font-weight: 600;
    line-height: .98;
    letter-spacing: -.04em;
}

.home-lead-story h2 a:hover,
.home-secondary-story h3 a:hover,
.home-latest-card h3 a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.home-lead-copy > p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

.home-feature-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 14px;
    margin-top: auto;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.home-feature-meta a:hover {
    color: var(--text);
}

.home-lead-media {
    position: relative;
    display: block;
    min-height: 286px;
    overflow: hidden;
    border-radius: 16px;
    background:
        radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 42%),
        linear-gradient(145deg, var(--surface2), color-mix(in srgb, var(--accent-soft) 58%, var(--surface2)));
}

.home-lead-media img,
.home-secondary-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-lead-media img {
    position: absolute;
    inset: 0;
}

.home-media-mark {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: color-mix(in srgb, var(--accent) 58%, var(--muted));
    font-size: 120px;
    font-weight: 800;
    transform: rotate(-7deg);
}

.home-read-source {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(18, 18, 16, .82);
    color: #fff;
    font-size: 11px;
    font-weight: 750;
    backdrop-filter: blur(10px);
}

.home-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.home-secondary-story {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(128px, .78fr);
    min-height: 190px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.home-secondary-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 17px;
}

.home-secondary-story h3 {
    margin: 8px 0 7px;
    font-family: "Source Serif 4", serif;
    font-size: 22px;
    line-height: 1.05;
    letter-spacing: -.025em;
}

.home-secondary-story p {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.home-secondary-media {
    min-width: 0;
    min-height: 100%;
    background: var(--surface2);
}

.home-trending-panel {
    position: sticky;
    top: 88px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
    border-radius: 20px;
    background: color-mix(in srgb, var(--accent-soft) 56%, var(--surface));
}

.home-trending-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 12px;
}

.home-trending-title h2 {
    margin: 2px 0 0;
    font-size: 21px;
    letter-spacing: -.025em;
}

.home-trending-title > a {
    color: var(--accent);
    font-size: 11px;
    font-weight: 750;
}

.home-trending-list {
    display: grid;
}

.home-trending-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 14px 16px;
    border-top: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
}

.home-trending-item:hover {
    background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.home-trending-rank {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
    border-radius: 999px;
    background: var(--surface);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
}

.home-trending-copy {
    min-width: 0;
}

.home-trending-copy strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 13px;
    line-height: 1.3;
}

.home-trending-copy small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
}

.home-trending-item > span:last-child {
    color: var(--accent);
    font-size: 12px;
}

.home-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin: 24px 0 12px;
}

.home-section-head > div {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.home-section-head h2 {
    margin: 0;
    font-family: "Source Serif 4", serif;
    font-size: 28px;
    line-height: 1;
    letter-spacing: -.025em;
}

.home-section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.home-latest-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.home-latest-card {
    display: flex !important;
    flex-direction: column;
    min-height: 150px;
    padding: 14px 15px !important;
}

.home-latest-topline {
    display: flex;
    align-items: center;
    min-height: 25px;
}

.home-latest-card h3 {
    margin: 7px 0 14px;
    font-size: 15px;
    line-height: 1.22;
    letter-spacing: -.015em;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.home-latest-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 11px;
    margin-top: auto;
    color: var(--muted);
    font-size: 10px;
}



.home-comment-link:hover {
    color: var(--text);
}

.home-latest-meta .bookmark-btn {
    font-size: 10px;
}

/* ==========================================================================
   Category story cards
   ========================================================================== */

.story-list:not(.home-latest-grid) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}


/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */

.category-story-card {
    display: flex;
    flex-direction: column;

    min-width: 0;
    height: 100%;

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 18px;

    background: var(--surface);
}


/* --------------------------------------------------------------------------
   Story image
   -------------------------------------------------------------------------- */

.category-story-image {
    position: relative;

    display: block;

    width: 100%;
    aspect-ratio: 16 / 9;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 30% 25%,
            color-mix(in srgb, var(--accent) 18%, transparent),
            transparent 46%
        ),
        linear-gradient(
            145deg,
            var(--surface2),
            color-mix(
                in srgb,
                var(--accent-soft) 60%,
                var(--surface2)
            )
        );
}


.category-story-image img {
    position: relative;
    z-index: 2;

    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform .25s ease;
}


@media (hover: hover) and (pointer: fine) {

    .category-story-card:hover .category-story-image img {
        transform: scale(1.025);
    }

}


/* --------------------------------------------------------------------------
   Image fallback
   -------------------------------------------------------------------------- */

.category-story-image-fallback {
    position: absolute;
    inset: 0;
    z-index: 1;

    display: grid;
    place-items: center;

    color:
        color-mix(
            in srgb,
            var(--accent) 50%,
            var(--muted)
        );

    font-size: 50px;
    font-weight: 800;

    transform: rotate(-7deg);
}


.category-story-image:not(.image-failed)
.category-story-image-fallback {
    opacity: 0;
}


.category-story-image.image-failed
.category-story-image-fallback {
    opacity: 1;
}


/* --------------------------------------------------------------------------
   Body
   -------------------------------------------------------------------------- */

.category-story-body {
    display: flex;
    flex-direction: column;
    flex: 1;

    min-width: 0;

    padding: 17px 18px 16px;
}


/* --------------------------------------------------------------------------
   Metadata
   -------------------------------------------------------------------------- */

.category-story-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 7px;

    margin-bottom: 10px;

    color: var(--muted);

    font-size: 11px;
}


.category-story-meta > span + span::before {
    content: "·";
    margin-right: 7px;
}


/* --------------------------------------------------------------------------
   Headline
   -------------------------------------------------------------------------- */

.category-story-card h2 {
    margin: 0 0 9px;

    font-size: 19px;
    line-height: 1.18;
    letter-spacing: -.025em;
}


.category-story-card h2 a {
    color: var(--text);
}


/* --------------------------------------------------------------------------
   Summary
   -------------------------------------------------------------------------- */

.category-story-summary {
    display: -webkit-box;

    margin: 0 0 15px;

    overflow: hidden;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.55;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}


/* --------------------------------------------------------------------------
   Actions
   -------------------------------------------------------------------------- */

.category-story-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 12px;

    margin-top: auto;
    padding-top: 8px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 650;
}


.category-story-actions a {
    color: var(--muted);
}


.category-story-actions a:hover {
    color: var(--text);
}


/* ==========================================================================
   Category responsive layout
   ========================================================================== */

@media (max-width: 1300px) {

    .story-list:not(.home-latest-grid) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 760px) {

    .story-list:not(.home-latest-grid) {
        grid-template-columns: 1fr;
    }

    .category-story-card {
        border-radius: 15px;
    }

    .category-story-body {
        padding: 15px 16px;
    }

    .category-story-card h2 {
        font-size: 18px;
    }

}


/* ==========================================================================
   Homepage editorial polish
   ========================================================================== */

/* --------------------------------------------------------------------------
   Trending panel
   -------------------------------------------------------------------------- */

.home-trending-panel {
    min-width: 0;
    width: 100%;

    overflow: hidden;

    border: 1px solid
        color-mix(
            in srgb,
            var(--accent) 32%,
            var(--border)
        );

    border-radius: 18px;

    background:
        color-mix(
            in srgb,
            var(--accent-soft) 36%,
            var(--surface)
        );
}


.home-trending-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 18px;

    min-width: 0;

    padding: 22px 22px 15px;
}


.home-trending-title > div {
    min-width: 0;
}


.home-trending-title h2 {
    margin: 4px 0 0;

    font-size: 22px;
    line-height: 1.1;
    letter-spacing: -0.035em;
}


.home-trending-title > a {
    flex: 0 0 auto;

    margin-top: 18px;

    color: var(--accent);

    font-size: 11px;
    font-weight: 750;

    white-space: nowrap;
}


/* --------------------------------------------------------------------------
   Trending list
   -------------------------------------------------------------------------- */

.home-trending-list {
    min-width: 0;

    padding: 0 18px 18px;
}


.home-trending-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;

    gap: 11px;

    align-items: center;

    min-width: 0;

    padding: 13px 4px;

    border-top: 1px solid var(--border);
}


.home-trending-rank {
    display: grid;
    place-items: center;

    width: 30px;
    height: 30px;

    border-radius: 50%;

    background: var(--surface);

    color: var(--accent);

    font-size: 12px;
    font-weight: 800;
}


.home-trending-copy {
    min-width: 0;
}


.home-trending-copy strong {
    display: block;

    color: var(--text);

    font-size: 13px;
    line-height: 1.3;
}


.home-trending-copy small {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 10px;
    line-height: 1.35;
}


/* --------------------------------------------------------------------------
   Empty trending state
   -------------------------------------------------------------------------- */

.home-trending-list > .muted {
    width: 100%;
    min-width: 0;

    margin: 0;

    padding: 8px 0 16px;

    box-sizing: border-box;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.55;

    white-space: normal;

    overflow-wrap: anywhere;
}


/* --------------------------------------------------------------------------
   Resilient publisher images
   -------------------------------------------------------------------------- */

.home-lead-media,
.home-secondary-media {
    background:
        radial-gradient(
            circle at 30% 25%,
            color-mix(
                in srgb,
                var(--accent) 20%,
                transparent
            ),
            transparent 45%
        ),
        linear-gradient(
            145deg,
            var(--surface2),
            color-mix(
                in srgb,
                var(--accent-soft) 58%,
                var(--surface2)
            )
        );
}


.home-lead-media {
    position: relative;
    overflow: hidden;
}


.home-lead-media img {
    position: relative;

    z-index: 2;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


.home-lead-media .home-media-mark {
    position: absolute;
    inset: 0;

    z-index: 1;

    display: grid;
    place-items: center;
}


.home-secondary-media {
    position: relative;

    overflow: hidden;
}


.home-secondary-media::after {
    content: "≈";

    position: absolute;
    inset: 0;

    z-index: 0;

    display: grid;
    place-items: center;

    color:
        color-mix(
            in srgb,
            var(--accent) 44%,
            var(--muted)
        );

    font-size: 52px;
    font-weight: 800;

    transform: rotate(-7deg);
}


.home-secondary-media img {
    position: relative;

    z-index: 1;

    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* ==========================================================================
   Homepage responsive polish
   ========================================================================== */

@media (max-width: 1050px) {

    .home-trending-title {
        padding: 18px 18px 13px;
    }

    .home-trending-list {
        padding: 0 14px 14px;
    }

}


@media (max-width: 760px) {

    .home-trending-panel {
        border-radius: 15px;
    }

    .home-trending-title {
        padding: 17px 16px 12px;
    }

    .home-trending-title h2 {
        font-size: 20px;
    }

    .home-trending-title > a {
        margin-top: 15px;
    }

    .home-trending-list {
        padding: 0 12px 13px;
    }

}



/* ==========================================================================
   Homepage latest-story cards with images
   ========================================================================== */

.home-latest-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.home-latest-card {
    display: flex;
    flex-direction: column;

    min-width: 0;
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--surface);
}

.home-latest-image {
    position: relative;

    display: block;

    width: 100%;
    aspect-ratio: 16 / 8.5;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 30% 25%,
            color-mix(in srgb, var(--accent) 17%, transparent),
            transparent 45%
        ),
        linear-gradient(
            145deg,
            var(--surface2),
            color-mix(
                in srgb,
                var(--accent-soft) 55%,
                var(--surface2)
            )
        );
}

.home-latest-image img {
    position: relative;
    z-index: 2;

    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform .25s ease;
}

.home-latest-card:hover .home-latest-image img {
    transform: scale(1.025);
}

.home-latest-image-fallback {
    position: absolute;
    inset: 0;
    z-index: 1;

    display: grid;
    place-items: center;

    color:
        color-mix(
            in srgb,
            var(--accent) 45%,
            var(--muted)
        );

    font-size: 42px;
    font-weight: 800;

    transform: rotate(-7deg);
}

.home-latest-image:not(.image-failed)
.home-latest-image-fallback {
    opacity: 0;
}

.home-latest-body {
    display: flex;
    flex-direction: column;
    flex: 1;

    min-width: 0;

    padding: 14px 15px 15px;
}

.home-latest-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 6px;

    margin-bottom: 8px;

    color: var(--muted);

    font-size: 10px;
}

.home-latest-card h3 {
    margin: 0 0 9px;

    font-size: 15px;
    line-height: 1.25;
    letter-spacing: -.02em;
}

.home-latest-card h3 a {
    color: var(--text);
}

.home-latest-summary {
    display: -webkit-box;

    margin: 0 0 12px;

    overflow: hidden;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.5;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.home-latest-actions {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: auto;

    color: var(--muted);

    font-size: 10px;
}

.home-latest-actions a {
    color: var(--muted);
}



/* ==========================================================================
   Homepage editorial mobile layout
   ========================================================================== */

@media (max-width: 760px) {

    /*
     * Header / intro
     */
    .feed-head-editorial {
        display: block;
    }

    .feed-head-editorial .segmented {
        width: 100%;
        margin-top: 24px;
    }


    /*
     * Editorial top section
     */
    .home-editorial-grid {
        display: flex;
        flex-direction: column;

        gap: 14px;

        width: 100%;
    }


    /*
     * Put the lead story before Trending.
     */
    .home-feature-stack {
        order: 1;

        width: 100%;
        min-width: 0;
    }

    .home-trending-panel {
        order: 2;

        width: 100%;
        min-width: 0;
    }


    /*
     * Lead card must stack vertically.
     */
    .home-lead-story {
        display: flex;
        flex-direction: column;

        width: 100%;
        min-width: 0;

        overflow: hidden;
    }

    .home-lead-copy {
        order: 1;

        width: 100%;
        min-width: 0;

        padding: 22px 20px;
    }

    .home-lead-copy h2 {
        margin: 12px 0 12px;

        font-size: clamp(34px, 9vw, 46px);
        line-height: .98;
    }

    .home-lead-copy > p {
        font-size: 14px;
        line-height: 1.6;
    }


    /*
     * Image becomes a normal block BELOW the text.
     */
    .home-lead-media {
        position: relative;

        order: 2;

        width: 100%;
        height: auto;
        min-height: 0;

        aspect-ratio: 16 / 10;

        border-radius: 0;
    }

    .home-lead-media img {
        position: absolute;
        inset: 0;

        width: 100%;
        height: 100%;

        object-fit: cover;
    }

    .home-read-source {
        right: 14px;
        bottom: 14px;
    }


    /*
     * Secondary stories
     */
    .home-secondary-grid {
        display: grid;
        grid-template-columns: 1fr;

        gap: 12px;

        margin-top: 12px;
    }

    .home-secondary-story {
        display: flex;
        flex-direction: column;

        min-width: 0;
        overflow: hidden;
    }

    .home-secondary-copy {
        order: 2;

        width: 100%;
        padding: 18px;
    }

    .home-secondary-media {
        order: 1;

        width: 100%;
        height: auto;

        aspect-ratio: 16 / 9;
    }

    .home-secondary-media img {
        width: 100%;
        height: 100%;

        object-fit: cover;
    }


    /*
     * Latest stories
     */
    .home-latest-grid {
        grid-template-columns: 1fr;

        gap: 12px;
    }

    .home-latest-image {
        aspect-ratio: 16 / 9;
    }


    /*
     * Prevent any desktop widths from pushing outside viewport.
     */
    .home-editorial-grid,
    .home-feature-stack,
    .home-lead-story,
    .home-lead-copy,
    .home-lead-media,
    .home-secondary-grid,
    .home-secondary-story,
    .home-secondary-copy,
    .home-secondary-media,
    .home-trending-panel,
    .home-latest-grid,
    .home-latest-card {
        max-width: 100%;
        min-width: 0;
    }
}


/* ==========================================================================
   Bigheim centralized advertising
   ========================================================================== */

/*
 * Centralized ad renderer markup:
 *
 * .bigheim-ad-slot
 *   .bigheim-ad-unit
 *     .bigheim-ad-label
 *     a.bigheim-ad-card
 *       .bigheim-ad-media
 *         img.bigheim-ad-creative
 *       .bigheim-ad-copy
 *
 * Match the horizontal sponsored-card layout used by DiarioVegas.
 */

.bigheim-ad-slot {
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    margin: 28px 0;
}

.bigheim-ad-slot[hidden] {
    display: none !important;
}

.bigheim-ad-unit {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
}

.bigheim-ad-label {
    display: block;
    width: 100%;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* The actual clickable ad card. */
.bigheim-ad-card {
    display: grid !important;
    grid-template-columns: minmax(320px, 38%) minmax(0, 1fr) !important;
    align-items: stretch !important;

    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden;

    border: 1px solid var(--border) !important;
    border-radius: 16px !important;

    background: var(--surface) !important;
    color: var(--text) !important;

    text-decoration: none !important;
}

.bigheim-ad-card:hover {
    color: var(--text) !important;
    border-color: color-mix(in srgb, var(--border) 55%, var(--text)) !important;
}

/* Left artwork panel. */
.bigheim-ad-media {
    grid-column: 1 !important;
    grid-row: 1 !important;

    display: flex !important;
    align-items: center;
    justify-content: center;

    width: 100% !important;
    min-width: 0 !important;
    min-height: 260px;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden;
    background: #111;
}

.bigheim-ad-creative {
    display: block !important;

    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: none !important;

    margin: 0 !important;
    padding: 0 !important;

    object-fit: contain !important;
}

/* Right text panel. */
.bigheim-ad-copy {
    grid-column: 2 !important;
    grid-row: 1 !important;

    display: flex !important;
    flex-direction: column;
    justify-content: center;

    min-width: 0 !important;

    margin: 0 !important;
    padding: 32px 36px !important;

    background: var(--surface) !important;
}

.bigheim-ad-copy .bigheim-ad-sponsor,
.bigheim-ad-copy .ad-sponsor {
    margin: 0 0 9px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.bigheim-ad-copy h2,
.bigheim-ad-copy h3 {
    margin: 0 0 9px !important;

    color: var(--text);

    font-family: "Source Serif 4", serif;
    font-size: clamp(23px, 2.4vw, 34px);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -.025em;
}

.bigheim-ad-copy p {
    max-width: 760px;
    margin: 0 0 16px !important;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.55;
}

.bigheim-ad-copy .bigheim-ad-cta,
.bigheim-ad-copy .ad-cta {
    align-self: flex-start;

    display: inline-flex;
    align-items: center;

    min-height: 34px;
    padding: 7px 13px;

    border-radius: 999px;

    background: var(--text);
    color: var(--bg);

    font-size: 10px;
    font-weight: 800;
}

/*
 * Feed placements inside Rillr's story grid span all columns.
 */
.bigheim-ad-slot--feed,
.home-latest-grid > .bigheim-ad-slot,
.story-list > .bigheim-ad-slot,
[data-bigheim-ad][data-placement="home_mid"],
[data-bigheim-ad][data-placement="home_lower"] {
    grid-column: 1 / -1 !important;

    width: 100% !important;
    max-width: none !important;

    justify-self: stretch !important;
}

/*
 * The homepage feature ad lives inside .home-feature-stack, so it fills
 * that complete editorial column while Trending remains in the right rail.
 */
[data-bigheim-ad][data-placement="home_feature"] {
    width: 100% !important;
    max-width: none !important;
}

/* Tablet */
@media (max-width: 1050px) {
    .bigheim-ad-card {
        grid-template-columns: minmax(275px, 40%) minmax(0, 1fr) !important;
    }

    .bigheim-ad-media {
        min-height: 230px;
    }

    .bigheim-ad-copy {
        padding: 26px 28px !important;
    }
}

/* Mobile: creative above copy. */
@media (max-width: 760px) {
    .bigheim-ad-slot {
        margin: 20px 0;
    }

    .bigheim-ad-card {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important;
        border-radius: 14px !important;
    }

    .bigheim-ad-media {
        grid-column: 1 !important;
        grid-row: 1 !important;

        width: 100% !important;
        min-height: 0;
    }

    .bigheim-ad-creative {
        width: 100% !important;
        height: auto !important;
    }

    .bigheim-ad-copy {
        grid-column: 1 !important;
        grid-row: 2 !important;

        padding: 22px !important;
    }
}


/* Keep secondary story images and text visible on mobile */
@media (max-width: 760px) {
    .home-secondary-story {
        display: flex;
        flex-direction: column;
        height: auto;
        max-height: none;
    }

    .home-secondary-story .home-secondary-media {
        order: 1;
        flex: none;
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        aspect-ratio: 16 / 9;
    }

    .home-secondary-story .home-secondary-media img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .home-secondary-story .home-secondary-copy {
        order: 2;
        flex: none;
        display: flex;
        flex-direction: column;
        position: relative;
        width: 100%;
        height: auto;
        padding: 18px;
        box-sizing: border-box;
    }
}

/* ==========================================================================
   Inline story voting
   Homepage, category, search, and infinite-scroll cards
   ========================================================================== */

.inline-story-vote {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0;
}

.inline-vote-form {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;

    width: auto !important;
    min-width: 0;
    height: auto;

    margin: 0 !important;
    padding: 0 !important;

    border: 0;
    background: transparent;
}

.inline-vote-form .vote-btn {
    appearance: none;
    -webkit-appearance: none;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    flex: 0 0 24px;

    width: 24px;
    min-width: 24px;
    height: 24px;
    min-height: 24px;

    margin: 0;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 0;

    background: transparent !important;
    box-shadow: none !important;

    color: var(--muted);

    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;

    cursor: pointer;
    text-decoration: none;
    touch-action: manipulation;
}

.inline-vote-form .vote-btn:hover,
.inline-vote-form .vote-btn:focus-visible {
    color: var(--accent);
}

.inline-vote-form .vote-btn[aria-label="Downvote"]:hover,
.inline-vote-form .vote-btn[aria-label="Downvote"]:focus-visible {
    color: var(--danger);
}

.inline-vote-form .vote-btn:focus {
    outline: none;
}

.inline-vote-form .vote-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 3px;
}

.inline-vote-form .score {
    display: inline-block;
    min-width: 14px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

@media (max-width: 700px) {
    .inline-vote-form .vote-btn {
        flex-basis: 30px;
        width: 30px;
        min-width: 30px;
        height: 30px;
        min-height: 30px;
    }

    .inline-vote-form .score {
        min-width: 16px;
        font-size: 11px;
    }
}






.top-nav-link {
    display: inline-flex;
    align-items: center;

    min-height: 34px;
    padding: 0 3px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 650;
    line-height: 1;

    white-space: nowrap;
}

.top-nav-link:hover {
    color: var(--text);
}

@media (max-width: 1050px) {
    .top-nav-link {
        display: none;
    }
}


/* Story detail image */

.story-detail-image {
    position: relative;

    display: block;

    width: 100%;
    max-width: 980px;

    margin: 22px 0;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    border-radius: 16px;

    background:
        radial-gradient(
            circle at 30% 25%,
            color-mix(in srgb, var(--accent) 18%, transparent),
            transparent 46%
        ),
        linear-gradient(
            145deg,
            var(--surface2),
            color-mix(
                in srgb,
                var(--accent-soft) 60%,
                var(--surface2)
            )
        );
}

.story-detail-image img {
    position: relative;
    z-index: 2;

    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.story-detail-image-fallback {
    position: absolute;
    inset: 0;
    z-index: 1;

    display: grid;
    place-items: center;

    color:
        color-mix(
            in srgb,
            var(--accent) 50%,
            var(--muted)
        );

    font-size: 64px;
    font-weight: 800;

    transform: rotate(-7deg);
}

.story-detail-image:not(.image-failed)
.story-detail-image-fallback {
    opacity: 0;
}

.story-detail-image.image-failed
.story-detail-image-fallback {
    opacity: 1;
}

@media (max-width: 760px) {
    .story-detail-image {
        margin: 18px 0;
        border-radius: 13px;
        aspect-ratio: 16 / 10;
    }
}

/* ==========================================================================
   Rillr editorial homepage — full-width redesign (October 2026)
   No permanent discussion rail; preserve original card and ad markup.
   ========================================================================== */

@media (min-width: 1101px) {
    .home-editorial-grid {
        display: block;
        width: 100%;
        margin-bottom: 18px;
    }

    .home-editorial-grid .home-feature-stack {
        display: grid;
        grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
        align-items: stretch;
        gap: 16px;
    }

    .home-editorial-grid .home-lead-story {
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%;
        gap: 0;
        padding: 0;
        overflow: hidden;
    }

    .home-editorial-grid .home-lead-media {
        order: -1;
        width: 100%;
        min-height: 0;
        height: auto;
        aspect-ratio: 16 / 9;
        border-radius: 0;
        flex-shrink: 0;
    }

    .home-editorial-grid .home-lead-copy {
        flex: 1 1 auto;
        padding: 21px 25px 22px;
    }

    .home-editorial-grid .home-lead-story h2 {
        font-size: clamp(30px, 2.65vw, 45px);
        line-height: 1.04;
    }

    .home-editorial-grid .home-secondary-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: repeat(2, minmax(0, 1fr));
        gap: 16px;
        min-width: 0;
        height: 100%;
    }

    .home-editorial-grid .home-secondary-story {
        display: grid;
        grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
        min-height: 0;
        height: 100%;
    }

    .home-editorial-grid .home-secondary-copy {
        padding: 18px 19px;
    }

    .home-editorial-grid .home-secondary-story h3 {
        font-size: clamp(19px, 1.4vw, 25px);
        line-height: 1.13;
    }

    .home-editorial-grid .home-secondary-media {
        display: block;
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }
}

/* A full-width, horizontally arranged discussion strip. */
.home-trending-panel {
    position: static;
    top: auto;
    width: 100%;
    min-width: 0;
    margin: 0 0 21px;
    padding: 0;
    border-radius: 18px;
    overflow: hidden;
}

.home-trending-panel .home-trending-title {
    display: flex;
    align-items: center;
    padding: 18px 21px 14px;
}

.home-trending-panel .home-trending-title > a {
    margin-top: 0;
}

.home-trending-panel .home-trending-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 11px;
    padding: 0 20px 19px;
    min-width: 0;
}

.home-trending-panel .home-trending-item {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    min-width: 0;
    padding: 13px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.home-trending-panel .home-trending-item > span:last-child {
    display: none;
}

.home-trending-panel .home-trending-rank {
    width: 25px;
    height: 25px;
    font-size: 10px;
}

.home-trending-panel .home-trending-copy strong {
    font-size: 12px;
    line-height: 1.32;
}

.home-trending-panel .home-trending-copy small {
    font-size: 10px;
}

.home-trending-panel .home-trending-list > .muted {
    grid-column: 1 / -1;
}

/* The featured campaign now spans the full editorial width. */
.home-editorial-grid + .home-trending-panel + [data-bigheim-ad][data-placement="home_feature"] {
    width: 100% !important;
    max-width: none !important;
    margin: 22px 0;
}

@media (min-width: 761px) and (max-width: 1100px) {
    .home-editorial-grid {
        display: block;
        width: 100%;
    }

    .home-editorial-grid .home-feature-stack {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .home-editorial-grid .home-secondary-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .home-trending-panel .home-trending-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .home-editorial-grid {
        display: block;
    }

    .home-trending-panel {
        margin-top: 16px;
        margin-bottom: 18px;
    }

    .home-trending-panel .home-trending-title {
        padding: 17px 16px 13px;
    }

    .home-trending-panel .home-trending-list {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 10px;
        padding: 0 15px 16px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .home-trending-panel .home-trending-list::-webkit-scrollbar {
        display: none;
    }

    .home-trending-panel .home-trending-item {
        flex: 0 0 min(78vw, 255px);
        scroll-snap-align: start;
    }

    .home-trending-panel .home-trending-list > .muted {
        flex: 1 1 auto;
    }
}

/* ==========================================================================
   Wide desktop homepage: use all available space beside the category rail.
   Scoped to the editorial homepage; category, search, and legal widths remain.
   ========================================================================== */
@media (min-width: 1101px) {
    .app-shell > .content:has(.home-editorial-grid) {
        width: 100% !important;
        min-width: 0;
        max-width: none !important;
        box-sizing: border-box;
        padding-right: clamp(24px, 2vw, 44px) !important;
    }
}

/* ==========================================================================
   Wide category and search cards: fill the available desktop content area.
   Preserves existing card grids and responsive breakpoints.
   ========================================================================== */
@media (min-width: 1101px) {
    .app-shell > .content:has(.story-list .category-story-card) {
        width: 100% !important;
        min-width: 0;
        max-width: none !important;
        box-sizing: border-box;
        padding-right: clamp(24px, 2vw, 44px) !important;
    }
}


.category-story-image img[hidden],
.home-latest-image img[hidden],
.story-detail-image img[hidden] {
    display: none !important;
}


