/* 4SHTF — self-contained, no CDN, no webfonts. Minimal: white, black, red. */

:root {
    --ink: #111111;
    --muted: #6b6b6b;
    --paper: #ffffff;
    --line: #e6e6e6;
    --accent: #ab0000;       /* sampled from the logo's "4" */
    --accent-dark: #7a0000;
    --max: 1160px;
    --narrow: 720px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.65 var(--font);
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

h1, h2, h3 { font-weight: 700; }

/* Header: logo top-left, nav top-right */
.site-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: var(--max);
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--line);
}

.brand { display: block; line-height: 0; }
.brand img { height: 64px; width: auto; display: block; }

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
    font-size: 0.95rem;
    font-weight: 700;
}

.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
.site-nav .nav-account { color: var(--accent); }
.site-nav .nav-account:hover { color: var(--accent-dark); }

/* Logged-in nav: avatar + name + dropdown */
.nav-user { position: relative; }
.nav-user-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 0;
    font: inherit;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    padding: 0;
}
.nav-user-toggle:hover { color: var(--accent); }
.nav-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    flex: 0 0 auto;
}
.avatar-img { object-fit: cover; }
.nav-alert-count {
    background: var(--accent); color: #fff; border-radius: 99px; font-size: 0.7rem; font-weight: 700;
    padding: 0.05rem 0.4rem; min-width: 1.1rem; text-align: center; line-height: 1.3;
}
.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    min-width: 170px;
    padding: 0.4rem;
    z-index: 50;
}
.nav-user.is-open .nav-dropdown { display: block; }
.nav-dropdown a, .nav-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.6rem;
    border-radius: 4px;
    background: none;
    border: 0;
    font: inherit;
    font-weight: 400;
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
}
.nav-dropdown a:hover, .nav-dropdown button:hover { background: #f5f5f5; color: var(--accent); }

.site-main {
    max-width: var(--max);
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.narrow { max-width: var(--narrow); margin: 0 auto; }

/* Homepage: 70/30 — full latest article, tiny thumbs of the rest */
.home-layout {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.home-main { flex: 0 0 70%; max-width: 70%; min-width: 0; }
.home-sidebar { flex: 1 1 30%; min-width: 0; }
.home-sidebar .search-form { margin-top: 0; }

.sidebar-heading {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.6rem;
    margin: 0 0 1.1rem;
}

.sidebar-list { display: flex; flex-direction: column; gap: 1.1rem; list-style: none; margin: 0; padding: 0; }

.sidebar-card { display: flex; gap: 0.75rem; }
.sidebar-thumb { flex: 0 0 60px; }
.sidebar-thumb img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }
.sidebar-card h3 { font-size: 1.06rem; line-height: 1.3; margin: 0; font-weight: 600; }
.sidebar-card h3 a { color: var(--ink); text-decoration: none; }
.sidebar-card h3 a:hover { color: var(--accent); }
.sidebar-card .byline { font-size: 0.72rem; margin: 0.25rem 0 0; }

@media (max-width: 860px) {
    .home-layout { flex-direction: column; }
    .home-main, .home-sidebar { max-width: 100%; flex-basis: auto; }
}

/* Hero / full article (shared: homepage hero and standalone article page) */
.article-full h1, .hero h1 { font-size: 1.9rem; line-height: 1.25; margin: 0.6rem 0 0.2rem; }
.article-full .featured, .hero-image { width: 100%; height: auto; border-radius: 6px; margin: 0 0 0.6rem; }
.article-full h1 a, .hero h1 a { color: var(--ink); text-decoration: none; }
.article-full h1 a:hover, .hero h1 a:hover { color: var(--accent); }

.byline { color: var(--muted); font-size: 0.85rem; margin: 0.2rem 0 0.6rem; }

.article-body, .hero .article-body { font-size: 1.05rem; }
.article-body img { max-width: 100%; height: auto; border-radius: 4px; }
.article-body h2, .article-body h3 { line-height: 1.3; margin-top: 1.8em; }
.article-body blockquote {
    margin: 1.2em 0;
    padding: 0.1em 1.2em;
    border-left: 4px solid var(--accent);
    background: #f7f7f7;
    font-style: italic;
}
.article-body pre { overflow-x: auto; background: #141414; color: #eee; padding: 1em; border-radius: 6px; }

.read-more { font-weight: 700; text-decoration: none; }

/* Article cards — search results */
.article-list { display: flex; flex-direction: column; gap: 1.6rem; }

.article-card {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.6rem;
    border-bottom: 1px solid var(--line);
}

.card-thumb { flex: 0 0 180px; }
.card-thumb img { width: 180px; height: 120px; object-fit: cover; border-radius: 4px; }
.card-body h2 { font-size: 1.5rem; line-height: 1.3; margin: 0 0 0.1rem; }
.card-body h2 a { color: var(--ink); text-decoration: none; }
.card-body h2 a:hover { color: var(--accent); }
.card-body p { margin: 0.3rem 0 0; }

@media (max-width: 560px) {
    .article-card { flex-direction: column; }
    .card-thumb, .card-thumb img { width: 100%; height: auto; }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    font-weight: 700;
}
.pagination a { text-decoration: none; }

/* Search */
.page-title { font-size: 1.6rem; }
.search-form { display: flex; gap: 0.5rem; margin: 1rem 0 1.5rem; }
.search-form input { flex: 1; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 4px; font-size: 1rem; font-family: var(--font); }
.search-form button {
    padding: 0.6rem 1.2rem;
    border: 0;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.search-form button:hover { background: var(--accent-dark); }
.result-count { color: var(--muted); font-size: 0.9rem; }

/* Members / account stubs + footer */
.members-stub h1, .account-stub h1 { font-size: 1.8rem; }
.empty-note { color: var(--muted); }

.account-form { display: flex; flex-direction: column; gap: 1rem; max-width: 360px; margin-top: 1.5rem; }
.account-form label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; font-size: 0.9rem; }
.account-form input {
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.6rem 0.7rem;
    font-size: 1rem;
    font-family: var(--font);
    font-weight: 400;
}
.account-form button {
    padding: 0.65rem 1.2rem;
    border: 0;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    align-self: flex-start;
}
.account-form button:hover { background: var(--accent-dark); }
.account-signup-hint { margin-top: 1.2rem; font-size: 0.9rem; color: var(--muted); }
.form-error { color: var(--accent); font-weight: 600; font-size: 0.9rem; margin-top: 1rem; }
.form-warn { color: #8a6d1d; background: #fdf6e3; border: 1px solid #eddfb0; border-radius: 4px; padding: 0.5rem 0.75rem; font-size: 0.85rem; margin-top: 0.75rem; }

.notification-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-direction: column; }
.notification-row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    padding: 0.9rem 0; border-bottom: 1px solid var(--line);
}
.notification-row a { color: var(--ink); text-decoration: none; }
.notification-row a:hover { color: var(--accent); }
.notification-row.is-unread { background: #fbf7ee; }
.notification-time { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }

/* Members feed: three-column TALL layout (docs/05, task #27).
   Left = Filter Deck (mode toggles, nav, groups). Center = composer/feed.
   Right = network overview + Regional Grid Matrix placeholder. */
.members-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr) 250px; gap: 2.2rem; align-items: start; }
.members-filter-deck, .members-network-panel, .members-main { min-width: 0; }

@media (max-width: 1100px) {
    .members-layout { grid-template-columns: 190px minmax(0, 1fr); }
    .members-network-panel { grid-column: 1 / -1; display: flex; gap: 2rem; flex-wrap: wrap; }
    .members-network-panel .sidebar-heading { flex-basis: 100%; }
}

@media (max-width: 860px) {
    .members-layout { display: flex; flex-direction: column; }
    .members-main { order: 1; }
    .members-filter-deck { order: 2; }
    .members-network-panel { order: 3; }
}

.filter-deck-hint { color: var(--muted); font-size: 0.76rem; margin: -0.3rem 0 0.6rem; }
.filter-mode-btn {
    display: block; width: 100%; text-align: left; padding: 0.5rem 0.7rem; margin-bottom: 0.4rem;
    border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; font-size: 0.85rem;
}
.filter-mode-btn.is-active { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.filter-deck-nav {
    display: flex; flex-direction: column; gap: 0.45rem; margin: 1.1rem 0;
    padding: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.filter-deck-nav a { color: var(--ink); text-decoration: none; font-size: 0.85rem; }
.filter-deck-nav a:hover { color: var(--accent); }

/* Persistent Field Manual search (members sidebar), mirrors the
   .tag-input-wrap / .tag-suggestions typeahead pattern above. */
.manual-search-wrap { position: relative; margin-bottom: 1rem; }
.manual-search-input {
    width: 100%; border: 1px solid var(--line); border-radius: 99px;
    padding: 0.4rem 0.9rem; font-size: 0.85rem; font-family: var(--font);
}
.manual-search-results {
    list-style: none; margin: 0.3rem 0 0; padding: 0.3rem;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
    background: #fff; border: 1px solid var(--line); border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1); max-height: 260px; overflow-y: auto;
}
.manual-search-results li { padding: 0; }
.manual-search-results a {
    display: flex; flex-direction: column; gap: 0.1rem;
    padding: 0.4rem 0.5rem; border-radius: 4px; text-decoration: none; color: var(--ink);
}
.manual-search-results a:hover { background: #f5f5f5; }
.manual-search-title { font-size: 0.85rem; font-weight: 600; }
.manual-search-section { font-size: 0.75rem; color: var(--muted); }
.manual-search-empty { padding: 0.4rem 0.5rem; font-size: 0.82rem; color: var(--muted); }

.network-stat-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 0.3rem 0; }
.network-stat-row a { color: var(--accent); font-weight: 700; text-decoration: none; }
.network-panel-placeholder {
    border: 1px dashed var(--line); border-radius: 6px; padding: 0.8rem; font-size: 0.8rem;
    color: var(--muted); text-align: center; margin: 0;
}

.event-sidebar-row { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.event-sidebar-row:last-of-type { border-bottom: 0; }
.event-sidebar-title { display: block; color: var(--ink); font-weight: 700; font-size: 0.85rem; text-decoration: none; }
.event-sidebar-title:hover { color: var(--accent); }
.event-sidebar-when { font-size: 0.78rem; color: var(--accent); margin-top: 0.15rem; }
.event-sidebar-location { font-size: 0.78rem; color: var(--muted); margin-top: 0.1rem; }

.post-composer { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 2rem; }
.post-composer textarea {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.75rem 0.9rem;
    font-size: 1rem;
    font-family: var(--font);
    resize: vertical;
}
.post-composer button {
    align-self: flex-start;
    padding: 0.6rem 1.3rem;
    border: 0;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.post-composer button:hover { background: var(--accent-dark); }

/* Composer: @-tag chips + typeahead (docs/06) */
.composer-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.tag-chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.25rem 0.5rem; background: #f5f5f5; border-radius: 99px;
    font-size: 0.82rem; font-weight: 600;
}
.tag-chip-group { background: #fbeaea; }
.tag-chip button {
    background: none; border: 0; cursor: pointer; color: var(--muted);
    font-size: 1rem; line-height: 1; padding: 0;
}
.tag-chip button:hover { color: var(--accent); }
.tag-input-wrap { position: relative; flex: 1 1 160px; min-width: 160px; }
.tag-input {
    width: 100%; border: 1px solid var(--line); border-radius: 99px;
    padding: 0.3rem 0.8rem; font-size: 0.85rem; font-family: var(--font);
}
.tag-suggestions {
    list-style: none; margin: 0.3rem 0 0; padding: 0.3rem;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
    background: #fff; border: 1px solid var(--line); border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1); max-height: 220px; overflow-y: auto;
}
.tag-suggestions li {
    padding: 0.4rem 0.5rem; border-radius: 4px; cursor: pointer;
    font-size: 0.85rem; display: flex; gap: 0.4rem; align-items: baseline;
}
.tag-suggestions li:hover { background: #f5f5f5; color: var(--accent); }
.tag-suggestion-label { color: var(--muted); font-size: 0.78rem; }

.composer-row { display: flex; align-items: center; gap: 1rem; }
.composer-image-label {
    font-size: 0.82rem; color: var(--muted); cursor: pointer; font-weight: 600;
}
.composer-preview { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.event-datetime-row { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: 0.8rem; font-size: 0.85rem; }
.event-datetime-row label { display: flex; flex-direction: column; gap: 0.25rem; font-weight: 600; color: var(--muted); }
.event-when { font-weight: 700; margin: 0.4rem 0 0.2rem; }
.event-location { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.4rem; }

.feed-filter-banner {
    display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.2rem;
    padding: 0.6rem 0.9rem; background: #f5f5f5; border-radius: 6px; font-size: 0.88rem;
}
.feed-filter-banner button {
    border: 0; background: none; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0;
}

.post-list { display: flex; flex-direction: column; gap: 1.5rem; }
.post-card { padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.post-meta { display: flex; gap: 0.6rem; align-items: center; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.4rem; }
.post-author { font-weight: 700; color: var(--ink); }
.post-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%; background: var(--accent);
    color: #fff; font-weight: 700; font-size: 0.72rem; flex: 0 0 auto;
}
.post-actions { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }
.post-delete { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 0.78rem; }
.post-delete:hover { color: var(--accent); }
.post-report { position: relative; }
.post-report summary {
    list-style: none; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 0.78rem;
}
.post-report summary::-webkit-details-marker { display: none; }
.post-report summary:hover { color: var(--accent); }
.post-report-done { color: var(--muted); font-size: 0.78rem; }
.post-report-menu {
    position: absolute; right: 0; top: calc(100% + 0.3rem); background: #fff; border: 1px solid var(--line);
    border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); padding: 0.4rem; display: flex;
    flex-direction: column; gap: 0.2rem; z-index: 5; white-space: nowrap;
}
.report-reason {
    border: 0; background: none; text-align: left; padding: 0.3rem 0.6rem; border-radius: 4px;
    font-size: 0.8rem; cursor: pointer;
}
.report-reason:hover { background: var(--bg-alt, #f6f4ef); }
.report-illegal { color: #a12a1c; }
.report-unethical { color: #9a5c05; }
.report-offensive { color: #7a6a05; }

/* Page comments (task #30) -- two layers, flat styling to match the
   feed's post-card conventions rather than inventing a new visual language. */
.comment-form { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.2rem; }
.comment-form textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 0.6rem 0.7rem;
    font-size: 0.9rem; font-family: var(--font); resize: vertical;
}
.comment-form button { align-self: flex-start; }
.comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.comment-row { display: flex; gap: 0.7rem; }
.comment-body-wrap { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: baseline; gap: 0.6rem; margin: 0 0 0.2rem; font-size: 0.85rem; }
.comment-time { color: var(--muted); font-size: 0.76rem; }
.comment-delete-form { margin-left: auto; }
.comment-text { margin: 0; line-height: 1.5; }
.comment-mention { color: var(--accent); text-decoration: none; font-weight: 600; }
.comment-mention:hover { text-decoration: underline; }
.comment-reply-toggle { margin-top: 0.4rem; }
.comment-reply-toggle summary {
    list-style: none; cursor: pointer; color: var(--muted); font-size: 0.78rem; font-weight: 700;
}
.comment-reply-toggle summary::-webkit-details-marker { display: none; }
.comment-reply-toggle summary:hover { color: var(--accent); }
.comment-reply-form { margin-top: 0.5rem; }
.comment-replies { margin: 0.8rem 0 0 1.5rem; padding-left: 1rem; border-left: 2px solid var(--line); }
.post-body { white-space: pre-wrap; margin: 0; }
.post-link { color: var(--accent); text-decoration: underline; word-break: break-all; }
.post-link:hover { color: var(--accent-dark); }
.post-image { max-width: 100%; height: auto; border-radius: 6px; margin-top: 0.6rem; }
.post-doors { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.post-door { font-size: 0.76rem; color: var(--muted); background: #f5f5f5; padding: 0.15rem 0.5rem; border-radius: 99px; display: inline-flex; align-items: center; gap: 0.25rem; }
.post-pinned-badge { font-size: 0.76rem; font-weight: 700; color: var(--accent); margin: 0 0 0.3rem; }
.post-pin-toggle { border: 0; background: none; cursor: pointer; padding: 0; font-size: 0.75rem; opacity: 0.4; line-height: 1; }
.post-pin-toggle:hover, .post-pin-toggle.is-pinned { opacity: 1; }
.post-footer { margin-top: 0.6rem; }
.post-reactions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.post-reaction-form { display: inline-block; margin: 0; }
.post-reaction {
    display: inline-flex; align-items: center; gap: 0.25rem; border: 1px solid var(--line); background: #fff;
    border-radius: 99px; padding: 0.15rem 0.55rem; font-size: 0.9rem; cursor: pointer; line-height: 1.4;
}
.post-reaction:hover { border-color: var(--reaction-color, var(--accent)); }
.post-reaction.is-mine {
    border-color: var(--reaction-color, var(--accent));
    background: color-mix(in srgb, var(--reaction-color, var(--accent)) 14%, #fff);
}
.post-reaction-count { font-size: 0.76rem; color: var(--muted); }

/* @mentions: pure-CSS hover/focus reveal, no JS */
.mention { position: relative; display: inline-block; }
.mention a, .mention-trigger { color: var(--accent); font-weight: 600; text-decoration: none; cursor: pointer; }
.mention-group a { cursor: pointer; }
.mention-card {
    display: none; position: absolute; bottom: calc(100% + 0.4rem); left: 0; z-index: 30;
    width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); padding: 0.75rem; text-align: left;
    white-space: normal; font-size: 0.82rem;
}
.mention:hover .mention-card, .mention:focus .mention-card, .mention:focus-within .mention-card { display: block; }
.mention-card img { width: 100%; height: 90px; object-fit: cover; border-radius: 4px; margin-bottom: 0.5rem; }
.mention-card strong { display: block; margin-bottom: 0.2rem; }
.mention-meta { display: block; color: var(--muted); font-size: 0.76rem; margin-bottom: 0.3rem; }
.mention-desc { display: block; color: var(--muted); }
.mention-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%; background: var(--accent);
    color: #fff; font-weight: 700; margin-bottom: 0.5rem;
}
.mention-follow-btn {
    display: block; width: 100%; margin-top: 0.5rem; padding: 0.35rem 0;
    border: 1px solid var(--accent); border-radius: 4px; background: #fff;
    color: var(--accent); font-weight: 700; font-size: 0.78rem; cursor: pointer;
}
.mention-follow-btn:hover { background: var(--accent); color: #fff; }
.mention-follow-btn.is-following, .mention-follow-btn.is-pending {
    border-color: var(--line); color: var(--muted);
}
.mention-follow-btn.is-following:hover, .mention-follow-btn.is-pending:hover {
    background: #fbeaea; border-color: var(--accent); color: var(--accent);
}

/* Settings page: @everyone opt-in + @network approvals */
.settings-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.settings-section h2 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.settings-hint { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.settings-toggle { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; cursor: pointer; }
.form-saved { color: #1e5c1e; font-weight: 600; }
.follow-request-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line);
}
.follow-request-actions { display: flex; gap: 0.5rem; }
.follow-request-actions form { display: inline; }
.btn-approve, .btn-deny {
    border: 1px solid var(--line); border-radius: 4px; padding: 0.3rem 0.7rem;
    background: #fff; font-size: 0.82rem; font-weight: 700; cursor: pointer;
}
.btn-approve { color: #1e5c1e; border-color: #1e5c1e; }
.btn-approve:hover { background: #1e5c1e; color: #fff; }
.btn-deny { color: var(--muted); }
.btn-deny:hover { border-color: var(--accent); color: var(--accent); }

.load-more {
    display: block;
    margin: 1.5rem auto 0;
    padding: 0.6rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    font-weight: 700;
    cursor: pointer;
}
.load-more:hover { border-color: var(--accent); color: var(--accent); }

.group-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.group-row { display: flex; align-items: center; gap: 0.6rem; }
.group-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }
.group-info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.group-handle-link {
    background: none; border: 0; padding: 0; text-align: left; cursor: pointer;
    font-weight: 700; font-size: 0.88rem; color: var(--accent); font-family: var(--font);
}
.group-handle-link:hover { color: var(--accent-dark); }
.group-meta { font-size: 0.74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-name { font-weight: 600; font-size: 0.92rem; }
.group-join, .group-leave {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 4px;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.group-join { color: var(--accent); border-color: var(--accent); }
.group-join:hover { background: var(--accent); color: #fff; }
.group-leave { color: var(--muted); }
.group-leave:hover { border-color: var(--accent); color: var(--accent); }

.site-footer {
    max-width: var(--max);
    margin: 0 auto;
    padding: 1.5rem 1.5rem 2.5rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.6rem;
}
.site-footer a { color: var(--muted); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.site-footer a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Legal modals */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 100;
}
.modal-overlay.is-open { display: flex; }
.modal-panel {
    background: #fff;
    max-width: 640px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    border-radius: 6px;
    position: relative;
    border-top: 4px solid var(--accent);
}
.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: 0;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--ink);
    padding: 0.25rem 0.5rem;
}
.modal-panel h2 { margin-top: 0; }
.legal-copy p { font-size: 0.9rem; line-height: 1.55; margin-bottom: 0.9rem; }
.legal-copy strong { color: var(--ink); }

/* ============================================================
   Profile Customizer (docs/05 #5) -- MySpace-inspired, 2026
   brutalist, utilitarian-for-preppers (Architect spec, 2026-08-03).
   Preset themes only -- no custom CSS injection, that's the point.
   Every theme shares the same brutalist DNA (thick square-cornered
   borders, no shadows, monospace labels) and only swaps 4 variables.
   ============================================================ */
.profile-page {
    --profile-bg: #f6f5f0;
    --profile-ink: #161616;
    --profile-accent: #ab0000;
    --profile-border: #161616;
    --mono: Consolas, Menlo, 'Courier New', monospace;

    background: var(--profile-bg);
    color: var(--profile-ink);
    border: 3px solid var(--profile-border);
    max-width: 760px;
    margin: 0 auto;
    padding: 0 0 2rem;
}

.theme-blackout { --profile-bg: #0a0a0a; --profile-ink: #ededed; --profile-accent: #d81c1c; --profile-border: #ededed; }
.theme-topo { --profile-bg: #4f4f38; --profile-ink: #f2efe2; --profile-accent: #d98e2b; --profile-border: #f2efe2; }
.theme-concrete { --profile-bg: #b9b6ae; --profile-ink: #141414; --profile-accent: #ab0000; --profile-border: #141414; }
.theme-signal { --profile-bg: #ffffff; --profile-ink: #111111; --profile-accent: #cc9a00; --profile-border: #111111; }

.profile-cover {
    height: 160px; background: var(--profile-ink); border-bottom: 3px solid var(--profile-border);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-cover-placeholder {
    width: 100%; height: 100%;
    background-image: repeating-linear-gradient(45deg, var(--profile-bg) 0 12px, transparent 12px 24px);
    opacity: 0.35;
}

.profile-header { display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem 0.5rem; }
.profile-avatar-large {
    width: 64px; height: 64px; border: 3px solid var(--profile-border); background: var(--profile-accent);
    color: var(--profile-bg); display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.6rem; flex: 0 0 auto;
}
.profile-name-block h1 { margin: 0; font-size: 1.4rem; }
.profile-handle { font-family: var(--mono); color: var(--profile-accent); font-size: 0.9rem; }
.profile-meta { display: block; color: var(--profile-ink); opacity: 0.6; font-size: 0.78rem; margin-top: 0.15rem; }
.profile-actions { margin-left: auto; }
.profile-actions .btn-edit-profile, .profile-actions .mention-follow-btn {
    border: 2px solid var(--profile-border); background: var(--profile-bg); color: var(--profile-ink);
    font-weight: 700; padding: 0.4rem 0.9rem; cursor: pointer; text-decoration: none; font-family: var(--mono);
    font-size: 0.82rem; display: inline-block;
}
.profile-actions .btn-edit-profile:hover, .profile-actions .mention-follow-btn:hover {
    background: var(--profile-accent); color: var(--profile-bg); border-color: var(--profile-accent);
}

.profile-section { padding: 1rem 1.5rem 0; }
.profile-section h2 {
    font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem;
    border-bottom: 2px solid var(--profile-border); padding-bottom: 0.5rem; margin: 0 0 0.8rem;
}
.profile-locked-note {
    color: var(--profile-ink); opacity: 0.7; font-size: 0.85rem; font-style: italic;
    display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
}
.profile-locked-form { display: inline; }
.profile-bio { line-height: 1.6; }
.profile-bio ul { padding-left: 1.2rem; }
.profile-bio a { color: var(--profile-accent); }

.profile-tabs { padding-top: 1rem; }
.profile-tab-radio { display: none; }
.profile-tab-labels { display: flex; gap: 1.2rem; border-bottom: 2px solid var(--profile-border); margin-bottom: 1rem; }
.profile-tab-labels label {
    padding: 0.4rem 0; cursor: pointer; font-family: var(--mono); text-transform: uppercase;
    letter-spacing: 0.08em; font-size: 0.78rem; opacity: 0.6; border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.profile-tab-panel { display: none; }
#tab-posts:checked ~ .profile-tab-labels label[for="tab-posts"],
#tab-interactions:checked ~ .profile-tab-labels label[for="tab-interactions"] {
    opacity: 1; border-bottom-color: var(--profile-accent);
}
#tab-posts:checked ~ #panel-posts { display: block; }
#tab-interactions:checked ~ #panel-interactions { display: block; }
.interaction-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.8rem; }
.interaction-row { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.9rem; }
.interaction-row a { color: inherit; text-decoration: none; }
.interaction-row a:hover .interaction-preview { text-decoration: underline; }
.interaction-preview { opacity: 0.75; }
.interaction-time { font-size: 0.76rem; opacity: 0.55; }
.profile-gear { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gear-tag {
    border: 2px solid var(--profile-border); font-family: var(--mono); font-size: 0.76rem;
    text-transform: uppercase; letter-spacing: 0.04em; padding: 0.25rem 0.6rem;
}
.skill-tag { display: inline-flex; align-items: center; gap: 0.4rem; }
.skill-vouch-count { opacity: 0.6; font-size: 0.7rem; }
.skill-vouch-form { display: inline-flex; margin: 0; }
.skill-vouch-btn {
    border: 1px solid var(--profile-border); background: none; color: inherit; cursor: pointer;
    border-radius: 50%; width: 1.1rem; height: 1.1rem; font-size: 0.68rem; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.skill-vouch-btn.is-vouched { background: var(--profile-accent); color: var(--profile-bg); border-color: var(--profile-accent); }

.topeight-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; }
.topeight-card {
    display: flex; flex-direction: column; align-items: center; gap: 0.4rem; text-decoration: none;
    color: var(--profile-ink); border: 2px solid var(--profile-border); padding: 0.6rem 0.3rem;
}
.topeight-card:hover { background: var(--profile-accent); color: var(--profile-bg); border-color: var(--profile-accent); }
.topeight-avatar {
    width: 40px; height: 40px; border-radius: 50%; background: var(--profile-accent); color: var(--profile-bg);
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.topeight-name { font-size: 0.76rem; text-align: center; word-break: break-word; }
@media (max-width: 560px) { .topeight-grid { grid-template-columns: repeat(2, 1fr); } }

/* Edit form (/profile) -- plain-palette, not theme-wrapped, since you're
   choosing the theme here, not viewing it yet. */
.theme-picker { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.2rem; }
.theme-swatch {
    border: 2px solid var(--line); border-radius: 6px; padding: 0.6rem 0.9rem; cursor: pointer;
    font-size: 0.82rem; font-weight: 700; background: #fff; display: flex; align-items: center; gap: 0.5rem;
}
.theme-swatch input { margin: 0; }
.theme-swatch.is-selected { border-color: var(--accent); color: var(--accent); }
.theme-swatch-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,0.2); }
.theme-swatch-dot-field-manual { background: #f6f5f0; border-color: #161616; }
.theme-swatch-dot-blackout { background: #0a0a0a; }
.theme-swatch-dot-topo { background: #4f4f38; }
.theme-swatch-dot-concrete { background: #b9b6ae; }
.theme-swatch-dot-signal { background: #ffffff; border-color: #cc9a00; }

.thumb-preview { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); margin-bottom: 0.5rem; }
/* Welcome/announcement hero (SPEC-launch item 6): the entire copy block
   and CTA sit directly on top of the photo -- a full-bleed background-
   cover image with a uniform dark scrim behind the text (not just a
   bottom gradient), so every line stays legible no matter where it falls
   on the image, and everything fits in one hero instead of a photo
   followed by a separate page. */
.welcome-hero {
    position: relative;
    margin: -2rem calc(50% - 50vw) 0;
    min-height: calc(100vh - 90px);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
}
.welcome-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 8, 7, 0.55) 0%, rgba(10, 8, 7, 0.72) 100%);
}
.welcome-hero-inner {
    position: relative;
    max-width: var(--narrow);
    margin: 0 auto;
    padding: 3rem 1.5rem;
    color: #e2e2e2;
}
.welcome-hero-inner h1 {
    color: #f5f5f5;
    text-shadow: 0 4px 28px rgba(0, 0, 0, 0.9), 0 0 60px rgba(0, 0, 0, 0.7);
    margin: 0 0 1.2rem;
    font-size: 2.1rem;
}
.welcome-hero-inner h2 {
    color: #f5f5f5;
    text-shadow: 0 3px 20px rgba(0, 0, 0, 0.85);
    margin: 1.4rem 0 0.5rem;
    font-size: 1.15rem;
}
.welcome-hero-inner p {
    color: #e2e2e2;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 0.7rem;
}
.welcome-hero-inner a:not(.welcome-cta) { color: #fff; }
.welcome-cta-row { margin-top: 1.3rem !important; }
.welcome-cta {
    display: inline-block;
    padding: 0.65rem 1.2rem;
    border: 0;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}
.welcome-cta:hover { background: var(--accent-dark); color: #fff; }
@media (max-width: 640px) {
    .welcome-hero { min-height: auto; }
    .welcome-hero-inner { padding: 2.5rem 1.25rem; }
}

.profile-edit-field { margin-bottom: 1.2rem; }
.profile-edit-field label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 0.4rem; }
.profile-edit-field textarea, .profile-edit-field input[type=text], .profile-edit-field input[type=file] {
    width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 0.6rem 0.7rem;
    font-size: 0.95rem; font-family: var(--font);
}
.profile-edit-hint { color: var(--muted); font-size: 0.8rem; margin-top: 0.3rem; }
.profile-edit-hint-inline { color: var(--muted); font-weight: 400; }
.profile-edit-region { display: flex; gap: 0.6rem; }
.profile-edit-region select {
    flex: 1; border: 1px solid var(--line); border-radius: 4px; padding: 0.6rem 0.7rem;
    font-size: 0.95rem; font-family: var(--font); background: #fff;
}

.topeight-manage-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.topeight-manage-row {
    display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
    padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: 4px; font-size: 0.88rem;
}
.topeight-manage-row .pill-pending { color: var(--muted); font-size: 0.76rem; }
.topeight-manage-row button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 0.8rem; }
.topeight-manage-row button:hover { color: var(--accent); }
.topeight-add-form { display: flex; gap: 0.5rem; }
.topeight-add-form input { flex: 1; }

/* Generic small action link/button -- used by pages-index, the Regional
   Grid directory, and Collaboration Requests (task #22). Was referenced
   in markup (pages-index.blade.php) but never actually defined; adding it
   properly here fixes that gap too. */
.btn {
    display: inline-block; border: 1px solid var(--line); border-radius: 4px;
    padding: 0.3rem 0.7rem; font-size: 0.8rem; text-decoration: none;
    color: var(--ink); cursor: pointer; background: none; font-family: var(--font);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.ghost { color: var(--muted); }

/* Profile opt-in checkbox (Regional Grid) + Regional Grid directory rows
   + Collaboration Requests dashboard. */
.profile-edit-checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; cursor: pointer; margin-bottom: 0.4rem; }
.grid-row-info { display: flex; align-items: center; gap: 0.6rem; }
.collaboration-handle { font-family: monospace; font-size: 0.85rem; color: var(--muted); }

/* ── The Homestead Field Manual ─────────────────────────────────────── */
.manual-head h1 { margin-bottom: 0.2rem; }
.manual-tagline { color: var(--muted); margin-top: 0; }
.manual-crumb { font-size: 0.85rem; color: var(--muted); }
.manual-crumb a { color: var(--muted); }
.manual-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.manual-section-card { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem; text-decoration: none; color: var(--ink); }
.manual-section-card:hover { border-color: var(--accent); }
.manual-section-card h2 { margin: 0 0 0.3rem; font-size: 1.1rem; }
.manual-section-card p { margin: 0 0 0.5rem; font-size: 0.88rem; color: var(--muted); }
.manual-count { font-size: 0.78rem; color: var(--accent); font-weight: 700; }
.manual-entry-list { list-style: none; padding: 0; }
.manual-entry-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }

.field-card { border: 2px solid var(--ink); border-radius: 6px; padding: 1rem 1.2rem; margin: 1.2rem 0; background: #fafafa; }
.field-card-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; color: var(--accent); margin: 0 0 0.4rem; }
.field-card ol, .field-card ul { padding-left: 1.3rem; }

.manual-badges .pill { margin-right: 0.4rem; }
.manual-sources ul { padding-left: 1.2rem; font-size: 0.88rem; }
.pd-tag { font-size: 0.72rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0.05rem 0.45rem; }

.manual-disclaimer { border-top: 2px solid var(--ink); margin-top: 1.6rem; padding-top: 0.8rem; font-size: 0.85rem; color: var(--muted); }
.manual-disclaimer strong { color: var(--ink); }

.manual-notes textarea { margin-bottom: 0.5rem; }
.notes-visibility { font-size: 0.8rem; color: var(--muted); margin: 0.1rem 0 0.5rem; }
.attest-row { display: flex; align-items: center; gap: 0.6rem; margin: 0.3rem 0; }
.attest-cond { color: var(--muted); font-size: 0.85rem; }
.attest-form { display: flex; gap: 0.5rem; margin-top: 0.7rem; flex-wrap: wrap; }
.attest-form select { max-width: 130px; }
.manual-print-hint { margin-top: 1.5rem; font-size: 0.85rem; }

/* Print: the entry becomes paper. Chrome vanishes, the card and the
   disclaimer always make the page. */
@media print {
    .site-header, .site-footer, .screen-only, .nav-search { display: none !important; }
    body { background: #fff; font-size: 11pt; }
    .manual-entry { max-width: none; }
    .field-card { break-inside: avoid; background: #fff; }
    .manual-disclaimer { break-inside: avoid; }
    a { color: #000; text-decoration: none; }
}
