
/* ================================================================
   GREEN HACKER TERMINAL THEME — overrides rig.rs colors
   ================================================================ */

:root, [data-theme="dark"] {
    /* Override accent colors to green hacker palette */
    --signal-green: #33ff33;
    --agent-teal: #00cc44;
    --compile-yellow: #88ff00;
    --rig-rust: #00ff66;
    
    /* Background darker */
    --deep-terminal: #0a0f0a;
    --kernel-black: #050805;
    --cloud-white: #e0ffe0;
    
    /* Glows — green */
    --glow-accent: #33ff33;
    --glow-cyan: #00ff44;
    --glow-violet: #88ff00;
    --glow-ember: #00ff66;
    
    /* Code blocks — true terminal */
    --code-bg: #0a0f0a;
    
    /* CTA button */
    --cta: #00cc33;
    --cta-hover: #00ff44;
}

/* Terminal-style code blocks */
pre, code, .rig-hero__code, .bg-code-bg {
    color: #33ff33 !important;
    text-shadow: 0 0 2px rgba(51, 255, 51, 0.3);
}

.rig-hero__code .k { color: #00ff66 !important; }
.rig-hero__code .f { color: #33ff33 !important; }
.rig-hero__code .s { color: #88ff44 !important; }

/* Terminal window chrome — green dots */
.terminal-dots span:first-child { background: #33ff33; box-shadow: 0 0 6px #33ff33; }
.terminal-dots span:nth-child(2) { background: #00cc33; box-shadow: 0 0 6px #00cc33; }
.terminal-dots span:nth-child(3) { background: #33ff33; box-shadow: 0 0 6px #33ff33; }

/* Status badge — green */
.rig-hero__caret { background: #33ff33; box-shadow: 0 0 8px #33ff33; }

/* File label — terminal green */
.rig-hero__terminal-file {
    color: #33ff33 !important;
    border-color: #33ff3344 !important;
}

/* Hacker glow on text */

/* Fix gradient text visibility on dark background */
.gradient-text {
    background: linear-gradient(100deg, #33ff33 0%, #66ff66 35%, #00ff88 70%, #33ff33 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
    text-shadow: 0 0 24px rgba(51,255,51,0.4), 0 0 60px rgba(51,255,51,0.2) !important;
}
.glow-text {
    text-shadow: 0 0 18px rgba(51,255,51,0.6), 0 0 60px rgba(51,255,51,0.3) !important;
}


/* Story cards — green accent */
.story-card h3 { color: #33ff33 !important; }

/* Pulse dot — green */
.rig-hero__pulse { background: #33ff33 !important; box-shadow: 0 0 10px 1px #33ff33 !important; }

/* Scroll rail dot */
.scroll-rail__dot { background: #33ff33 !important; box-shadow: 0 0 10px 2px #33ff33, 0 0 3px #33ff33 !important; }

/* Footer status dot */
.rig-footer__status-dot { background: #33ff33 !important; box-shadow: 0 0 8px 1px #33ff33 !important; }

/* Hud label — green */
.hud-label, .hud-label:before { color: #33ff33 !important; border-color: #33ff33 !important; }

/* Section divider gradient */
.section-divider:before { background: linear-gradient(90deg, transparent, #33ff33, transparent) !important; }

/* Tab active underline */
[role="tab"][aria-selected="true"] span {
    background: linear-gradient(90deg, transparent, #33ff33, transparent) !important;
    box-shadow: 0 0 12px 1px #33ff33, 0 0 3px #33ff33 !important;
}

/* Story graph nodes — green tint */
.story-graph svg text[fill="var(--heading)"] { fill: #33ff33 !important; }

/* Icon tiles — green */
.icon-tile { 
    color: #33ff33 !important; 
    border-color: #33ff3344 !important;
    background: #33ff3311 !important;
    box-shadow: 0 0 14px -6px #33ff33 !important;
}

/* Function grid — green labels */
.function-grid a span {
    color: #33ff33 !important;
    background: #33ff3311 !important;
}

/* Status dot */
.status-dot { background: #33ff33 !important; box-shadow: 0 0 8px #33ff33 !important; }

/* Links */
a:hover { color: #33ff33 !important; }

/* Buttons */
.btn-primary {
    background-color: #00cc33 !important;
    box-shadow: 0 1px 0 #e0ffe0 inset, 0 10px 30px -12px #33ff3388 !important;
}
.btn-primary:hover {
    background-color: #00ff44 !important;
    box-shadow: 0 1px 0 #e0ffe0 inset, 0 0 0 1px #33ff33, 0 14px 40px -12px #33ff3388 !important;
}
.btn-ghost {
    color: #33ff33 !important;
    border-color: #33ff3366 !important;
}
.btn-ghost:hover {
    background-color: #33ff3311 !important;
    border-color: #33ff33 !important;
    box-shadow: 0 0 18px -6px #33ff33 !important;
}

/* Hero bloom — green */
.rig-hero__bloom--violet { background-image: radial-gradient(closest-side, #33ff3340, transparent) !important; }
.rig-hero__bloom--cyan { background-image: radial-gradient(closest-side, #00ff6640, transparent) !important; }

/* Hero mesh — green tint */
.rig-hero__mesh {
    background: radial-gradient(50rem 34rem at 12% -8%, #33ff3320, transparent 65%),
                radial-gradient(44rem 30rem at 88% 0%, #00ff6615, transparent 65%),
                radial-gradient(48rem 34rem at 70% 90%, #33ff3310, transparent 70%),
                linear-gradient(180deg, var(--surface) 0%, var(--background) 55%) !important;
}

/* Header accent line */
.rig-header:after { background: linear-gradient(90deg, transparent, #33ff33, transparent) !important; }

/* Community glow */
.community-glow {
    background-image: radial-gradient(closest-side, #33ff3320, transparent 70%),
                      radial-gradient(closest-side, #00ff6620, transparent 70%) !important;
}

/* CTA bloom */
.cta-bloom {
    background-image: radial-gradient(closest-side, #33ff3330, transparent 70%),
                      radial-gradient(closest-side, #00ff6630, transparent 70%) !important;
}

/* Tab — green active */
[role="tab"] { color: #33ff3366 !important; }
[role="tab"][aria-selected="true"] { color: #33ff33 !important; }
[role="tab"]:hover { color: #33ff33 !important; }

/* Confidence badges — green */
.confidence-high { background: #0d2818 !important; color: #33ff33 !important; }
.confidence-medium { background: #1a2a0a !important; color: #88ff00 !important; }

/* Post type badges */
.post-type-observation { background: #33ff3311 !important; color: #33ff33 !important; }
.post-type-analysis { background: #00ff6611 !important; color: #00ff66 !important; }
.post-type-claim { background: #88ff0011 !important; color: #88ff00 !important; }

/* Active tab underline */
[role="tab"][aria-selected="true"] span[aria-hidden] {
    background: linear-gradient(90deg, transparent, #33ff33, transparent) !important;
    box-shadow: 0 0 12px 1px #33ff33, 0 0 3px #33ff33 !important;
}

/* Story card list bullets */
.story-card ul li span { box-shadow: 0 0 10px #33ff33 !important; }

/* Tabs */
.rig-tabs a.active { color: #33ff33 !important; border-bottom-color: #33ff33 !important; }

/* ================================================================
   UINTELL.ORG — App-specific styles (extends rig.rs design system)
   ================================================================ */

/* ── Missing rig.rs utilities (bg-grid, noise, scanlines) ── */
:root {
    --grid-size: 3.5rem;
    --grid-color: var(--grid-line);
    --spacing: .25rem;
    --radius-xs: .25rem;
    --radius-sm: .375rem;
    --radius-md: .5rem;
    --radius-lg: .75rem;
    --radius-xl: 1rem;
    --font-sans: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
    --font-display: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

.bg-grid {
    background-size: var(--grid-size) var(--grid-size);
    background-image: linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
                      linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
}

.bg-grid-fade {
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}

.bg-grid-radial {
    mask-image: radial-gradient(ellipse 65% 65% at 50% 50%, black 35%, transparent 100%);
}

.noise {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: .04;
    pointer-events: none;
}

.scanlines {
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.03) 2px, rgba(0,0,0,.03) 4px);
}

/* Responsive padding utilities */
.pt-14 { padding-top: 3.5rem; }
.pb-10 { padding-bottom: 2.5rem; }
@media (min-width: 768px) {
    .md\:pt-16 { padding-top: 4rem; }
    .md\:pb-12 { padding-bottom: 3rem; }
}
@media (min-width: 1024px) {
    .lg\:pt-8 { padding-top: 2rem; }
}

/* Spacing utilities */
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-2\\.5 { padding-top: .625rem; padding-bottom: .625rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-3 { padding-top: .75rem; padding-bottom: .75rem; }

/* Hidden responsive */
@media (min-width: 640px) {
    .sm\:block { display: block; }
}

/* ── App shell (feed pages) ── */
.app-page {
    max-width: 74rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.app-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem 0 1.5rem;
    flex-wrap: wrap;
}

.app-hero h1 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    letter-spacing: -.025em;
    color: var(--heading);
    font-weight: 700;
    line-height: 1.08;
}

.app-hero p {
    color: var(--muted);
    margin-top: .5rem;
    font-size: var(--text-base);
}

.app-status-panel {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    padding: .875rem 1.125rem;
    font-size: .875rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 14rem;
}

.app-status-panel strong {
    color: var(--heading);
}

.app-status-panel small {
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: .6875rem;
}

.status-dot {
    width: .5rem;
    height: .5rem;
    background: var(--signal-green);
    border-radius: 9999px;
    display: inline-block;
    box-shadow: 0 0 8px var(--glow-accent);
}

/* ── Function launcher grid ── */
.function-launcher {
    padding: 1.5rem 0;
}

.function-launcher-head {
    margin-bottom: 1.25rem;
}

.function-launcher-head h2 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    color: var(--heading);
    font-weight: 700;
    margin-top: .5rem;
}

.function-launcher-head p {
    color: var(--muted);
    margin-top: .25rem;
}

.function-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: .5rem;
}

.function-grid a {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .625rem .875rem;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    color: var(--muted);
    font-size: .8125rem;
    transition: border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
    text-decoration: none;
}

.function-grid a:hover {
    border-color: var(--accent);
    color: var(--heading);
    background: var(--surface-2);
}

.function-grid a span {
    font-family: var(--font-mono);
    font-size: .6875rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    padding: .125rem .375rem;
    flex-shrink: 0;
}

/* ── Workspace (feed + sidebar) ── */
.rig-workspace {
    display: grid;
    grid-template-columns: 1fr 16rem;
    gap: 2rem;
    padding: 1.5rem 0 3rem;
}

@media (max-width: 900px) {
    .rig-workspace {
        grid-template-columns: 1fr;
    }
    .rig-rail {
        display: none;
    }
}

.rig-feed-column {
    min-width: 0;
}

.rig-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.rig-section-header span {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
}

.rig-section-header h2 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    color: var(--heading);
    font-weight: 700;
}

.rig-icon-button {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    color: var(--accent);
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    transition: border-color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
}

.rig-icon-button:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* ── Tabs ── */
.rig-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--hairline);
    margin-bottom: 1.5rem;
}

.rig-tabs a {
    padding: .625rem 1.125rem;
    color: var(--muted);
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}

.rig-tabs a:hover {
    color: var(--heading);
}

.rig-tabs a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── Composer ── */
.rig-composer {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.rig-composer-main {
    display: flex;
    gap: .75rem;
    margin-bottom: .75rem;
}

.rig-composer textarea {
    flex: 1;
    background: var(--background);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    color: var(--body);
    padding: .625rem .75rem;
    font-size: .875rem;
    resize: vertical;
    font-family: var(--font-sans);
    min-height: 4rem;
}

.rig-composer textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft);
}

.rig-composer footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: .5rem;
}

.rig-composer footer button {
    background: var(--cta);
    color: var(--cloud-white);
    border: none;
    border-radius: var(--radius-md);
    padding: .5rem 1.25rem;
    font-size: .8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--dur-1) var(--ease-out);
}

.rig-composer footer button:hover {
    background: var(--cta-hover);
}

.mk-form-tools {
    display: flex;
    gap: .5rem;
}

.mk-form-tools span,
.mk-form-tools label {
    font-family: var(--font-mono);
    font-size: .6875rem;
    color: var(--subtle);
    padding: .25rem .5rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color var(--dur-1), border-color var(--dur-1);
}

.mk-form-tools span:hover,
.mk-form-tools label:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.mk-file-tool input[type="file"] {
    display: none;
}

/* ── Auth prompt panel ── */
.rig-auth-panel {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.rig-auth-panel strong {
    color: var(--heading);
    display: block;
    margin-bottom: .25rem;
}

.rig-auth-panel p {
    color: var(--muted);
    font-size: .875rem;
}

/* ── Notes (feed items) ── */
.mk-timeline {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.mk-note {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 1rem 1.125rem;
    display: flex;
    gap: .75rem;
    transition: border-color var(--dur-1) var(--ease-out);
}

.mk-note:hover {
    border-color: var(--hairline-strong);
}

.mk-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
    text-decoration: none;
}

.mk-avatar.self {
    background: var(--cta);
    color: var(--cloud-white);
}

.mk-note-main {
    flex: 1;
    min-width: 0;
}

.mk-note-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    font-size: .8125rem;
    margin-bottom: .375rem;
}

.mk-note-header .mk-user-name {
    color: var(--heading);
    font-weight: 700;
    text-decoration: none;
}

.mk-note-header .mk-user-name:hover {
    color: var(--accent);
}

.mk-note-header span {
    color: var(--subtle);
}

.mk-note-text {
    color: var(--body);
    font-size: .9375rem;
    line-height: 1.55;
    text-decoration: none;
    display: block;
    word-break: break-word;
}

.mk-note-text:hover {
    color: var(--heading);
}

.post-type-badge {
    font-family: var(--font-mono);
    font-size: .625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: .1rem .4rem;
    border-radius: 9999px;
}

.post-type-observation { background: var(--accent-soft); color: var(--accent); }
.post-type-analysis { background: var(--accent-2-soft); color: var(--accent-2); }
.post-type-claim { background: var(--accent-3-soft); color: var(--accent-3); }

.confidence-badge {
    font-family: var(--font-mono);
    font-size: .625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: .1rem .4rem;
    border-radius: 9999px;
}

.confidence-high { background: #0d2818; color: var(--signal-green); }
.confidence-medium { background: #1a1a0a; color: var(--compile-yellow); }
.confidence-low { background: #1a0a0a; color: var(--rig-rust); }
.confidence-unknown { background: var(--surface-2); color: var(--subtle); }

.note-cw {
    background: var(--surface-2);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    padding: .375rem .625rem;
    font-size: .8125rem;
    color: var(--muted);
    margin-bottom: .5rem;
}

/* ── Note actions ── */
.mk-note-actions {
    display: flex;
    gap: .25rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}

.mk-note-actions a,
.mk-note-actions button {
    font-family: var(--font-mono);
    font-size: .6875rem;
    color: var(--subtle);
    background: none;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    padding: .2rem .5rem;
    cursor: pointer;
    text-decoration: none;
    transition: color var(--dur-1), border-color var(--dur-1), background var(--dur-1);
}

.mk-note-actions a:hover,
.mk-note-actions button:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.mk-note-actions button.reacted,
.mk-note-actions button.clipped {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* ── Media grid ── */
.mk-media-grid {
    display: grid;
    gap: .5rem;
    margin-top: .75rem;
}

.mk-media-grid.count-1 { grid-template-columns: 1fr; }
.mk-media-grid.count-2 { grid-template-columns: 1fr 1fr; }
.mk-media-grid.count-3 { grid-template-columns: 1fr 1fr 1fr; }
.mk-media-grid.count-4 { grid-template-columns: 1fr 1fr; }

.mk-media-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--hairline);
    text-decoration: none;
}

.mk-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16/10;
}

.mk-file-thumb {
    display: block;
    padding: 1rem;
    text-align: center;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: .75rem;
    background: var(--surface-2);
}

/* ── Renote card ── */
.mk-renote-card {
    display: block;
    background: var(--surface-2);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    padding: .625rem .875rem;
    margin-top: .5rem;
    text-decoration: none;
    transition: border-color var(--dur-1);
}

.mk-renote-card:hover {
    border-color: var(--accent);
}

.mk-renote-card span {
    font-size: .6875rem;
    color: var(--subtle);
    display: block;
}

.mk-renote-card strong {
    font-size: .8125rem;
    color: var(--body);
    display: block;
    margin-top: .125rem;
}

/* ── Poll ── */
.mk-poll {
    display: flex;
    flex-direction: column;
    gap: .375rem;
    margin-top: .75rem;
}

.mk-poll form {
    display: flex;
}

.mk-poll button {
    flex: 1;
    text-align: left;
    background: var(--surface-2);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    padding: .5rem .75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color var(--dur-1), background var(--dur-1);
}

.mk-poll button:hover {
    border-color: var(--accent);
}

.mk-poll button.voted {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.mk-poll button span {
    font-size: .8125rem;
    color: var(--body);
}

.mk-poll button strong {
    font-family: var(--font-mono);
    font-size: .75rem;
    color: var(--accent);
}

/* ── Source links + topics ── */
.source-card {
    display: block;
    font-family: var(--font-mono);
    font-size: .6875rem;
    color: var(--accent-2);
    margin-top: .5rem;
    text-decoration: none;
    word-break: break-all;
}

.source-card:hover {
    color: var(--accent);
}

.post-sources {
    display: flex;
    gap: .375rem;
    margin-top: .375rem;
    flex-wrap: wrap;
}

.post-sources a {
    font-family: var(--font-mono);
    font-size: .625rem;
    color: var(--subtle);
    text-decoration: none;
    padding: .1rem .4rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
}

.post-sources a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.post-topics {
    display: flex;
    gap: .375rem;
    margin-top: .5rem;
    flex-wrap: wrap;
}

.topic-badge {
    font-family: var(--font-mono);
    font-size: .6875rem;
    color: var(--accent-2);
    text-decoration: none;
    font-weight: 600;
}

.topic-badge:hover {
    color: var(--accent);
}

/* ── Sidebar ── */
.rig-rail {
    padding-top: .5rem;
}

.rig-rail section {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 1rem 1.125rem;
    margin-bottom: 1rem;
}

.rig-rail h2 {
    font-family: var(--font-mono);
    font-size: .6875rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: .75rem;
    font-weight: 700;
}

.rig-rail a {
    display: block;
    color: var(--muted);
    font-size: .875rem;
    padding: .375rem 0;
    text-decoration: none;
    transition: color var(--dur-1);
}

.rig-rail a:hover {
    color: var(--heading);
}

.rig-rail p {
    color: var(--muted);
    font-size: .8125rem;
    line-height: 1.5;
}

/* ── Empty state ── */
.mk-empty {
    background: var(--surface);
    border: 1px dashed var(--hairline);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
}

.mk-empty h2 {
    color: var(--heading);
    font-size: var(--text-lg);
    margin-bottom: .5rem;
}

.mk-empty p {
    color: var(--muted);
    margin-bottom: 1rem;
}

.mk-empty-actions {
    display: flex;
    gap: .5rem;
    justify-content: center;
}

.mk-empty-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .5rem 1rem;
    border-radius: var(--radius-md);
    font-size: .8125rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.mk-empty-actions .btn-dim {
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--hairline);
}

.mk-empty-actions .btn-dim:hover {
    border-color: var(--accent);
    color: var(--heading);
}

/* ── Story kicker (legacy compat) ── */
.story-kicker {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--accent-2);
    font-weight: 700;
}

/* ── Form pages (login, submit, settings) ── */
.form-page {
    max-width: 32rem;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
}

.form-page h1 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    color: var(--heading);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-family: var(--font-mono);
    font-size: .6875rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--subtle);
    margin-bottom: .375rem;
    font-weight: 700;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--background);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    color: var(--body);
    padding: .625rem .75rem;
    font-size: .875rem;
    font-family: var(--font-sans);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft);
}

.form-page button[type="submit"] {
    background: var(--cta);
    color: var(--cloud-white);
    border: none;
    border-radius: var(--radius-md);
    padding: .625rem 1.5rem;
    font-size: .875rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--dur-1) var(--ease-out);
}

.form-page button[type="submit"]:hover {
    background: var(--cta-hover);
}

.form-page .error {
    color: var(--rig-rust);
    font-size: .8125rem;
    margin-top: 1rem;
    padding: .5rem .75rem;
    background: #1a0a0a;
    border: 1px solid var(--rig-rust);
    border-radius: var(--radius-sm);
}

.form-page .back-link {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--muted);
    font-size: .8125rem;
    text-decoration: none;
}

.form-page .back-link:hover {
    color: var(--heading);
}

.form-page hr {
    border-color: var(--hairline);
}
/* Authenticated navigation actions */
.rig-header__right .logout-form {
  display: flex;
  margin: 0;
}

.logout-button {
  appearance: none;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.rig-header__right .logout-button {
  padding: 0;
}

.mobile-logout-form {
  margin: 0;
}

.mobile-logout-button {
  width: 100%;
  padding: 0.75rem 0;
  text-align: left;
}

/* ================================================================
   SOCIAL TIMELINE
   ================================================================ */

.settings-signout {
    width: 100%;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.inline-logout {
    display: inline;
}

.logout-link-button {
    border: 0;
    padding: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.more-menu-group form {
    display: contents;
}

.more-signout {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.more-signout small {
    grid-column: 2;
}

/* Social application directory */
.more-social-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 16px;
    border-bottom: 1px solid var(--social-border);
    padding: 10px 16px;
    background: rgba(5, 7, 6, .94);
    backdrop-filter: blur(14px);
}

.more-social-header h1,
.more-social-header p,
.more-directory-section h2 {
    margin: 0;
    letter-spacing: 0;
}

.more-social-header h1 {
    font-size: 1.25rem;
    line-height: 1.25;
}

.more-social-header p {
    margin-top: 2px;
    color: var(--social-muted);
    font-size: .76rem;
}

.more-header-action {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid var(--social-border-strong);
    border-radius: 50%;
    color: var(--social-muted) !important;
}

.more-header-action:hover {
    color: var(--social-accent) !important;
    border-color: var(--social-accent);
    background: var(--social-accent-soft);
}

.more-signin-button {
    display: inline-grid;
    min-height: 36px;
    place-items: center;
    border-radius: 7px;
    padding: 0 14px;
    color: #031008 !important;
    background: var(--social-accent);
    font-size: .8rem;
    font-weight: 760;
}

.more-directory-section {
    border-bottom: 1px solid var(--social-border);
    padding: 20px 16px 8px;
}

.more-directory-section h2 {
    padding: 0 2px 11px;
    color: var(--social-muted);
    font-size: .76rem;
    font-weight: 740;
    text-transform: uppercase;
}

.more-directory-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.more-directory-link {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 18px;
    align-items: center;
    min-width: 0;
    min-height: 72px;
    gap: 11px;
    border-top: 1px solid var(--social-border);
    padding: 10px 10px 10px 2px;
    transition: background-color 130ms ease;
}

.more-directory-link:nth-child(odd) {
    border-right: 1px solid var(--social-border);
    padding-right: 13px;
}

.more-directory-link:nth-child(even) {
    padding-left: 13px;
}

.more-directory-link:hover {
    background: rgba(255, 255, 255, .025);
}

.more-directory-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--social-border-strong);
    border-radius: 8px;
    color: var(--social-accent);
    background: var(--social-panel);
}

.more-directory-icon svg {
    width: 1.18rem;
    height: 1.18rem;
}

.more-directory-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.more-directory-copy strong,
.more-directory-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
}

.more-directory-copy strong {
    color: var(--social-text);
    font-size: .88rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.more-directory-copy small {
    color: var(--social-muted);
    font-size: .72rem;
    white-space: nowrap;
}

.more-directory-arrow {
    width: 1rem !important;
    height: 1rem !important;
    color: var(--social-dim);
}

.more-directory-link:hover .more-directory-arrow {
    color: var(--social-accent);
}

@media (max-width: 680px) {
    .more-social-header {
        min-height: 61px;
        padding: 8px 13px;
    }

    .more-social-header p {
        display: none;
    }

    .more-directory-section {
        padding: 18px 12px 7px;
    }

    .more-directory-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .more-directory-link,
    .more-directory-link:nth-child(odd),
    .more-directory-link:nth-child(even) {
        min-height: 68px;
        border-right: 0;
        padding: 9px 3px;
    }
}

.social-body {
    --social-bg: #050706;
    --social-panel: #0b0e0c;
    --social-panel-2: #111512;
    --social-border: #242a25;
    --social-border-strong: #343c35;
    --social-text: #edf3ee;
    --social-muted: #8e9b91;
    --social-dim: #657068;
    --social-accent: #22d65f;
    --social-accent-hover: #35eb71;
    --social-accent-soft: rgba(34, 214, 95, .11);
    --social-blue: #49a8ff;
    --social-amber: #e9b949;
    margin: 0;
    min-height: 100vh;
    color: var(--social-text);
    background: var(--social-bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.social-body *,
.social-body *::before,
.social-body *::after {
    box-sizing: border-box;
}

.social-body button,
.social-body input,
.social-body textarea {
    font: inherit;
    letter-spacing: 0;
}

.social-body a {
    color: inherit;
    text-decoration: none;
}

.social-body a:hover {
    color: inherit !important;
}

.social-body svg {
    width: 1.35rem;
    height: 1.35rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.social-layout {
    display: grid;
    grid-template-columns: 248px minmax(0, 640px) 330px;
    width: min(100%, 1240px);
    min-height: 100vh;
    margin: 0 auto;
}

.social-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 16px 20px 12px 8px;
}

.social-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    min-height: 48px;
    margin: 0 0 10px 8px;
    font-size: 1.25rem;
    font-weight: 760;
}

.social-brand-mark {
    display: block;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 1px solid var(--social-border-strong);
    border-radius: 50%;
    object-fit: cover;
    filter: saturate(1.1) contrast(1.05);
}

.social-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.social-nav a {
    display: flex;
    align-items: center;
    gap: 18px;
    width: fit-content;
    min-width: 178px;
    min-height: 49px;
    padding: 0 15px;
    border-radius: 8px;
    color: var(--social-text);
    font-size: 1.05rem;
    font-weight: 540;
    transition: background-color 140ms ease, color 140ms ease;
}

.social-nav a:hover,
.social-nav a.active {
    color: var(--social-text) !important;
    background: var(--social-panel-2);
}

.social-nav a.active {
    font-weight: 740;
}

.social-nav a.active svg {
    color: var(--social-accent);
    fill: var(--social-accent-soft);
}

.social-post-button {
    display: grid;
    place-items: center;
    min-height: 48px;
    margin: 15px 6px 0;
    border-radius: 8px;
    color: #031008 !important;
    background: var(--social-accent);
    font-weight: 780;
    transition: background-color 140ms ease;
}

.social-post-button:hover {
    color: #031008 !important;
    background: var(--social-accent-hover);
}

.social-account {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-top: auto;
    padding: 9px 7px;
    border-radius: 8px;
}

.social-account:hover {
    background: var(--social-panel-2);
}

.social-account-link {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    flex: 1;
}

.social-account-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.social-account-copy strong,
.social-account-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.social-account-copy small {
    color: var(--social-muted);
    font-size: .72rem;
}

.icon-plain {
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
}

.social-main {
    min-width: 0;
    border-right: 1px solid var(--social-border);
    border-left: 1px solid var(--social-border);
}

.social-mobile-header {
    display: none;
}

.timeline-header {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid var(--social-border);
    background: rgba(5, 7, 6, .94);
    backdrop-filter: blur(14px);
}

.timeline-header h1 {
    margin: 0;
    padding: 13px 16px 8px;
    font-size: 1.25rem;
    line-height: 1.25;
}

.timeline-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.timeline-tabs a {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 47px;
    color: var(--social-muted);
    font-size: .88rem;
    font-weight: 650;
}

.timeline-tabs a:hover {
    color: var(--social-text) !important;
    background: rgba(255, 255, 255, .035);
}

.timeline-tabs a.active {
    color: var(--social-text);
}

.timeline-tabs a.active::after {
    position: absolute;
    bottom: 0;
    width: 54px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--social-accent);
    content: "";
}

.social-alert {
    padding: 11px 16px;
    border-bottom: 1px solid rgba(233, 185, 73, .35);
    color: #f2d486;
    background: rgba(233, 185, 73, .08);
    font-size: .86rem;
}

.social-composer {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 11px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--social-border);
}

.social-composer form {
    min-width: 0;
}

.social-composer textarea[name="text"] {
    display: block;
    width: 100%;
    min-height: 58px;
    max-height: 220px;
    resize: none;
    border: 0;
    outline: 0;
    color: var(--social-text);
    background: transparent;
    font-size: 1.16rem;
    line-height: 1.45;
}

.social-composer textarea[name="text"]::placeholder {
    color: var(--social-muted);
}

.social-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    overflow: hidden;
    border: 1px solid var(--social-border-strong);
    border-radius: 50%;
    color: var(--social-text);
    background: var(--social-panel-2);
    font-size: .62rem;
    font-weight: 760;
}

.self-avatar {
    color: #061109;
    border-color: var(--social-accent);
    background: var(--social-accent);
    font-size: .72rem;
}

.agent-avatar {
    border-color: rgba(73, 168, 255, .5);
    background: #0b151e;
}

.agent-avatar .agent-glyph {
    width: 1.35rem;
    height: 1.35rem;
    color: var(--social-blue);
}

.composer-options {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding-top: 7px;
    border-top: 1px solid var(--social-border);
}

.composer-tool,
.composer-more summary {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--social-accent);
    cursor: pointer;
}

.composer-tool:hover,
.composer-more summary:hover {
    background: var(--social-accent-soft);
}

.composer-tool input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.composer-more summary {
    list-style: none;
}

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

.composer-more > div {
    position: absolute;
    z-index: 30;
    top: 45px;
    left: 0;
    display: grid;
    width: min(390px, calc(100vw - 72px));
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--social-border-strong);
    border-radius: 8px;
    background: var(--social-panel-2);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .45);
}

.composer-more label {
    display: grid;
    gap: 5px;
    color: var(--social-muted);
    font-size: .76rem;
    font-weight: 650;
}

.composer-more input,
.composer-more textarea {
    width: 100%;
    resize: vertical;
    border: 1px solid var(--social-border-strong);
    border-radius: 5px;
    padding: 8px 9px;
    outline: 0;
    color: var(--social-text);
    background: var(--social-bg);
}

.composer-more input:focus,
.composer-more textarea:focus {
    border-color: var(--social-accent);
}

.composer-hint {
    color: var(--social-dim);
    font-size: .71rem;
}

.composer-actions {
    display: flex;
    gap: 7px;
    margin-left: auto;
}

.composer-actions button,
.agent-panel button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    border-radius: 7px;
    padding: 0 13px;
    font-size: .79rem;
    font-weight: 760;
    cursor: pointer;
}

.composer-actions button svg,
.agent-panel button svg {
    width: 1rem;
    height: 1rem;
}

.post-submit {
    border: 1px solid var(--social-accent);
    color: #031008;
    background: var(--social-accent);
}

.agent-submit {
    border: 1px solid rgba(73, 168, 255, .5);
    color: #bcdfff;
    background: rgba(73, 168, 255, .1);
}

.social-signin-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--social-border);
}

.social-signin-banner div {
    display: grid;
    gap: 3px;
}

.social-signin-banner span {
    color: var(--social-muted);
    font-size: .82rem;
}

.social-signin-banner a,
.timeline-empty a {
    flex: 0 0 auto;
    border-radius: 7px;
    padding: 8px 15px;
    color: #041008 !important;
    background: var(--social-accent);
    font-size: .82rem;
    font-weight: 760;
}

.timeline-empty {
    display: grid;
    justify-items: center;
    gap: 9px;
    padding: 70px 24px;
    text-align: center;
}

.timeline-empty svg {
    width: 2rem;
    height: 2rem;
    color: var(--social-accent);
}

.timeline-empty h2,
.timeline-empty p {
    margin: 0;
}

.timeline-empty p {
    color: var(--social-muted);
}

.social-post {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 11px;
    padding: 13px 16px 7px;
    border-bottom: 1px solid var(--social-border);
    transition: background-color 120ms ease;
}

.social-post:hover {
    background: rgba(255, 255, 255, .015);
}

.social-post.agent-post {
    box-shadow: inset 2px 0 0 rgba(73, 168, 255, .8);
}

.post-body {
    min-width: 0;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    color: var(--social-muted);
    font-size: .84rem;
}

.post-author > a:first-child {
    overflow: hidden;
    color: var(--social-text);
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-author > span:not(.verified-mark) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.verified-mark {
    display: inline-flex;
    color: var(--social-blue);
}

.verified-mark svg {
    width: 1rem;
    height: 1rem;
}

.post-time {
    color: var(--social-muted) !important;
    white-space: nowrap;
}

.post-menu {
    width: 28px;
    height: 28px;
    margin: -4px -3px -4px auto;
    border-radius: 50%;
    color: var(--social-muted);
}

.post-menu:hover {
    color: var(--social-blue);
    background: rgba(73, 168, 255, .1);
}

.post-overflow {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
}

.post-overflow summary {
    list-style: none;
}

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

.post-overflow .post-menu {
    margin: -4px -3px -4px 0;
}

.post-overflow[open] .post-menu {
    color: var(--social-blue);
    background: rgba(73, 168, 255, .1);
}

.post-overflow-menu {
    position: absolute;
    z-index: 80;
    top: calc(100% + 8px);
    right: 0;
    width: min(304px, calc(100vw - 24px));
    max-height: min(520px, 72vh);
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--social-border-strong);
    border-radius: 7px;
    background: var(--social-panel-2);
    box-shadow: 0 20px 56px rgba(0, 0, 0, .58);
    overscroll-behavior: contain;
}

.post-menu-group {
    padding: 5px;
}

.post-menu-group + .post-menu-group {
    border-top: 1px solid var(--social-border);
}

.post-menu-group form {
    margin: 0;
}

.post-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    border: 0;
    border-radius: 5px;
    color: var(--social-text) !important;
    background: transparent;
    font: inherit;
    font-size: .87rem;
    font-weight: 650;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.post-menu-item:hover,
.post-menu-item:focus-visible {
    background: rgba(255, 255, 255, .055);
    outline: none;
}

.post-menu-item > svg {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.post-menu-item > span {
    display: grid;
    min-width: 0;
    gap: 1px;
    overflow: visible !important;
    white-space: normal !important;
}

.post-menu-item small {
    color: var(--social-muted);
    font-size: .7rem;
    font-weight: 500;
}

.post-menu-danger {
    color: #ff7178 !important;
}

.post-menu-danger:hover,
.post-menu-danger:focus-visible {
    background: rgba(255, 71, 87, .1);
}

.post-context-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -2px 0 5px;
    color: var(--social-muted);
    font-size: .72rem;
    font-weight: 700;
}

.post-context-label svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.post-edited {
    flex: 0 0 auto;
    font-size: .75rem;
}

.post-action-dialog {
    width: min(520px, calc(100vw - 32px));
    max-width: none;
    max-height: min(760px, calc(100vh - 32px));
    padding: 0;
    border: 1px solid var(--social-border-strong);
    border-radius: 8px;
    color: var(--social-text);
    background: var(--social-panel);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .62);
}

.post-action-dialog::backdrop {
    background: rgba(0, 0, 0, .76);
    backdrop-filter: blur(2px);
}

.post-action-dialog > form {
    display: grid;
    max-height: min(760px, calc(100vh - 32px));
    margin: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.post-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 70px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--social-border);
}

.post-dialog-header h2,
.post-confirm-content h2 {
    margin: 2px 0 0;
    color: var(--social-text);
    font-size: 1.08rem;
}

.post-dialog-kicker {
    display: block;
    color: var(--social-muted);
    font-size: .66rem;
    font-weight: 750;
    text-transform: uppercase;
}

.post-dialog-close {
    display: grid;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: var(--social-muted);
    background: transparent;
    cursor: pointer;
}

.post-dialog-close:hover,
.post-dialog-close:focus-visible {
    color: var(--social-text);
    background: var(--social-panel-2);
    outline: none;
}

.post-dialog-close svg,
.post-policy-icon svg,
.post-visibility-options svg,
.post-confirm-icon svg,
.thread-reply-locked svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.post-dialog-close svg {
    width: 18px;
    height: 18px;
}

.post-dialog-content {
    display: grid;
    gap: 18px;
    overflow-y: auto;
    padding: 18px;
    overscroll-behavior: contain;
}

.post-dialog-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.post-dialog-field > span,
.post-visibility-options legend,
.post-report-reasons legend {
    color: var(--social-text);
    font-size: .78rem;
    font-weight: 700;
}

.post-dialog-field textarea,
.post-dialog-field input[type="text"] {
    width: 100%;
    border: 1px solid var(--social-border-strong);
    border-radius: 6px;
    padding: 10px 11px;
    color: var(--social-text);
    background: var(--social-panel-2);
    font: inherit;
    font-size: .9rem;
    line-height: 1.45;
    resize: vertical;
}

.post-dialog-field textarea:focus,
.post-dialog-field input[type="text"]:focus {
    border-color: var(--social-accent);
    outline: 2px solid rgba(34, 214, 102, .13);
}

.post-dialog-field > small {
    justify-self: end;
    color: var(--social-muted);
    font-size: .68rem;
}

.post-visibility-options,
.post-policy-options,
.post-report-reasons {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.post-visibility-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-visibility-options legend {
    width: 100%;
    margin-bottom: 7px;
}

.post-visibility-options label {
    flex: 1 1 150px;
}

.post-visibility-options input,
.post-policy-options input,
.post-report-reasons input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.post-visibility-options label > span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid var(--social-border-strong);
    border-radius: 6px;
    color: var(--social-muted);
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
}

.post-visibility-options label > span svg {
    width: 17px;
    height: 17px;
}

.post-visibility-options input:checked + span {
    border-color: rgba(34, 214, 102, .7);
    color: var(--social-text);
    background: rgba(34, 214, 102, .08);
}

.post-policy-options {
    display: grid;
}

.post-policy-options > label {
    display: grid;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 8px 2px;
    border-bottom: 1px solid var(--social-border);
    cursor: pointer;
    grid-template-columns: 38px minmax(0, 1fr) 20px;
}

.post-policy-options > label:last-child {
    border-bottom: 0;
}

.post-policy-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    color: var(--social-muted);
    background: var(--social-panel-2);
}

.post-policy-icon svg {
    width: 18px;
    height: 18px;
}

.post-policy-options label > span:nth-of-type(2) {
    display: grid;
    gap: 2px;
}

.post-policy-options strong {
    font-size: .86rem;
}

.post-policy-options small {
    color: var(--social-muted);
    font-size: .72rem;
}

.post-policy-check {
    width: 18px;
    height: 18px;
    opacity: 0;
    fill: none;
    stroke: var(--social-accent);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.post-policy-options input:checked ~ .post-policy-icon {
    color: var(--social-accent);
    background: rgba(34, 214, 102, .1);
}

.post-policy-options input:checked ~ .post-policy-check {
    opacity: 1;
}

.post-report-context {
    margin: 0;
    color: var(--social-muted);
    font-size: .82rem;
}

.post-report-context strong {
    color: var(--social-text);
}

.post-report-reasons {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-report-reasons legend {
    margin-bottom: 8px;
}

.post-report-reasons label > span {
    display: flex;
    align-items: center;
    min-height: 40px;
    border: 1px solid var(--social-border-strong);
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--social-muted);
    font-size: .78rem;
    font-weight: 650;
    cursor: pointer;
}

.post-report-reasons input:checked + span {
    border-color: rgba(255, 113, 120, .75);
    color: var(--social-text);
    background: rgba(255, 71, 87, .08);
}

.post-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    min-height: 66px;
    padding: 13px 18px;
    border-top: 1px solid var(--social-border);
}

.post-dialog-secondary,
.post-dialog-primary,
.post-dialog-danger {
    min-width: 92px;
    min-height: 39px;
    border-radius: 6px;
    padding: 8px 15px;
    font: inherit;
    font-size: .83rem;
    font-weight: 750;
    cursor: pointer;
}

.post-dialog-secondary {
    border: 1px solid var(--social-border-strong);
    color: var(--social-text);
    background: transparent;
}

.post-dialog-secondary:hover {
    background: var(--social-panel-2);
}

.post-dialog-primary {
    border: 1px solid var(--social-accent);
    color: #021108;
    background: var(--social-accent);
}

.post-dialog-primary:hover {
    filter: brightness(1.08);
}

.post-dialog-danger {
    border: 1px solid #ef4451;
    color: #fff;
    background: #d92f3d;
}

.post-dialog-danger:hover {
    background: #ef4451;
}

.post-confirm-dialog {
    width: min(410px, calc(100vw - 32px));
}

.post-confirm-dialog > form {
    grid-template-rows: minmax(0, 1fr) auto;
}

.post-confirm-content {
    padding: 24px 24px 19px;
}

.post-confirm-content p {
    margin: 8px 0 0;
    color: var(--social-muted);
    font-size: .86rem;
    line-height: 1.5;
}

.post-confirm-icon {
    display: grid;
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
    place-items: center;
    border-radius: 50%;
    color: #ff7178;
    background: rgba(255, 71, 87, .11);
}

.post-confirm-icon svg {
    width: 21px;
    height: 21px;
}

.post-action-toast {
    position: fixed;
    z-index: 160;
    bottom: 24px;
    left: 50%;
    min-width: 160px;
    max-width: min(360px, calc(100vw - 32px));
    padding: 10px 14px;
    border: 1px solid var(--social-border-strong);
    border-radius: 6px;
    color: var(--social-text);
    background: #121714;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .48);
    font-size: .8rem;
    font-weight: 700;
    text-align: center;
    opacity: 0;
    transform: translate(-50%, 8px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.post-action-toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.post-warning {
    width: fit-content;
    margin: 7px 0;
    border: 1px solid rgba(233, 185, 73, .35);
    border-radius: 5px;
    padding: 5px 8px;
    color: #f2d486;
    background: rgba(233, 185, 73, .07);
    font-size: .76rem;
}

.post-text {
    display: block;
    margin-top: 3px;
    overflow-wrap: anywhere;
    color: var(--social-text) !important;
    font-size: .95rem;
    line-height: 1.48;
    white-space: pre-wrap;
}

.post-text.truncated {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 7;
    white-space: normal;
}

.post-more {
    display: inline-block;
    margin-top: 4px;
    color: var(--social-blue) !important;
    font-size: .78rem;
}

.repost-context {
    display: grid;
    gap: 5px;
    margin-top: 10px;
    border: 1px solid var(--social-border-strong);
    border-radius: 8px;
    padding: 10px 12px;
}

.repost-context small {
    color: var(--social-muted);
}

.social-poll {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.social-poll button {
    display: flex;
    justify-content: space-between;
    width: 100%;
    border: 1px solid rgba(73, 168, 255, .55);
    border-radius: 7px;
    padding: 8px 11px;
    color: var(--social-text);
    background: transparent;
    cursor: pointer;
}

.social-poll button.selected {
    background: rgba(73, 168, 255, .12);
}

.social-media {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
    margin-top: 11px;
    overflow: hidden;
    border: 1px solid var(--social-border-strong);
    border-radius: 8px;
}

.social-media.count-1 {
    grid-template-columns: 1fr;
}

.social-media a {
    display: grid;
    min-height: 180px;
    place-items: center;
    overflow: hidden;
    background: var(--social-panel-2);
}

.social-media img {
    width: 100%;
    height: 100%;
    max-height: 520px;
    object-fit: cover;
}

.social-media a > span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--social-muted);
    font-size: .82rem;
}

.post-link {
    display: block;
    margin-top: 9px;
    overflow: hidden;
    color: var(--social-blue) !important;
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-sources,
.post-topics,
.post-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.post-sources a,
.post-topics a,
.post-metadata span {
    border-radius: 4px;
    padding: 3px 6px;
    color: var(--social-blue) !important;
    background: rgba(73, 168, 255, .08);
    font-size: .69rem;
}

.post-topics a {
    color: var(--social-accent) !important;
    background: var(--social-accent-soft);
}

.post-metadata span {
    color: var(--social-muted) !important;
    background: var(--social-panel-2);
    text-transform: capitalize;
}

.post-metadata .confidence-high {
    color: var(--social-accent) !important;
}

.post-metadata .confidence-medium {
    color: var(--social-amber) !important;
}

.post-actions {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    margin-top: 6px;
    color: var(--social-muted);
}

.post-actions form {
    display: contents;
}

.post-actions a,
.post-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: fit-content;
    min-width: 32px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    padding: 0 6px;
    color: var(--social-muted);
    background: transparent;
    font-size: .72rem;
    cursor: pointer;
}

.post-actions svg {
    width: 1.12rem;
    height: 1.12rem;
}

.post-actions a:hover,
.post-actions button:hover {
    color: var(--social-blue) !important;
    background: rgba(73, 168, 255, .09);
}

.post-actions form:nth-of-type(2) button:hover {
    color: #f05b87;
    background: rgba(240, 91, 135, .09);
}

.post-actions button.saved {
    color: var(--social-accent);
    fill: var(--social-accent-soft);
}

.post-actions button.shared {
    color: var(--social-accent);
}

.social-rail {
    position: sticky;
    top: 0;
    align-self: start;
    display: grid;
    gap: 14px;
    max-height: 100vh;
    padding: 9px 0 30px 24px;
    overflow-y: auto;
}

.social-search {
    position: sticky;
    z-index: 15;
    top: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 45px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0 13px;
    color: var(--social-muted);
    background: var(--social-panel-2);
}

.social-search:focus-within {
    border-color: var(--social-accent);
    color: var(--social-accent);
    background: var(--social-bg);
}

.social-search svg {
    width: 1.08rem;
    height: 1.08rem;
}

.social-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--social-text);
    background: transparent;
}

.social-search input::placeholder {
    color: var(--social-muted);
}

.agent-panel,
.rail-section {
    overflow: hidden;
    border: 1px solid var(--social-border);
    border-radius: 8px;
    background: var(--social-panel);
}

.agent-panel {
    padding: 14px;
}

.agent-panel header {
    display: flex;
    align-items: center;
    gap: 9px;
}

.agent-panel header > div {
    display: grid;
    line-height: 1.2;
}

.agent-panel header small {
    color: var(--social-muted);
}

.agent-online {
    margin-left: auto;
    color: var(--social-accent);
    font-size: .66rem;
    font-weight: 720;
    text-transform: uppercase;
}

.agent-panel textarea {
    width: 100%;
    margin-top: 12px;
    resize: vertical;
    border: 1px solid var(--social-border-strong);
    border-radius: 6px;
    padding: 9px 10px;
    outline: 0;
    color: var(--social-text);
    background: var(--social-bg);
    font-size: .82rem;
    line-height: 1.4;
}

.agent-panel textarea:focus {
    border-color: var(--social-blue);
}

.agent-panel button {
    width: 100%;
    margin-top: 8px;
    border: 1px solid rgba(73, 168, 255, .45);
    color: #cce8ff;
    background: rgba(73, 168, 255, .1);
}

.agent-panel p {
    margin: 12px 0 0;
    color: var(--social-muted);
    font-size: .8rem;
    line-height: 1.45;
}

.panel-action {
    display: inline-block;
    margin-top: 10px;
    color: var(--social-blue) !important;
    font-size: .8rem;
    font-weight: 700;
}

.rail-section h2 {
    margin: 0;
    padding: 13px 14px 8px;
    font-size: 1.08rem;
}

.rail-section > a {
    display: grid;
    gap: 2px;
    padding: 10px 14px;
}

.rail-section > a:hover {
    background: rgba(255, 255, 255, .035);
}

.rail-section a small,
.rail-section a span {
    color: var(--social-muted);
    font-size: .72rem;
}

.rail-section a strong {
    overflow-wrap: anywhere;
    font-size: .86rem;
}

.rail-section > a.rail-more {
    color: var(--social-accent) !important;
    font-size: .8rem;
}

.rail-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 0 5px;
    color: var(--social-dim);
    font-size: .68rem;
}

@media (max-width: 1100px) {
    .social-layout {
        grid-template-columns: 82px minmax(0, 640px) 310px;
        width: min(100%, 1032px);
    }

    .social-sidebar {
        align-items: center;
        padding-right: 10px;
        padding-left: 10px;
    }

    .social-logo {
        margin-left: 0;
    }

    .social-logo span,
    .social-nav a span,
    .social-account-copy {
        display: none;
    }

    .social-nav a {
        justify-content: center;
        min-width: 49px;
        width: 49px;
        padding: 0;
    }

    .social-post-button {
        width: 49px;
        min-height: 49px;
        overflow: hidden;
        color: transparent !important;
    }

    .social-post-button::before {
        color: #031008;
        content: "+";
        font-size: 1.5rem;
    }

    .social-account {
        padding: 6px 0;
    }

    .social-account form {
        display: none;
    }
}

@media (max-width: 900px) {
    .social-layout {
        grid-template-columns: 82px minmax(0, 640px);
        justify-content: center;
    }

    .social-rail {
        display: none;
    }
}

@media (max-width: 680px) {
    .social-body {
        padding-bottom: 62px;
    }

    .social-layout {
        display: block;
        width: 100%;
    }

    .social-sidebar {
        position: fixed;
        z-index: 50;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        display: block;
        width: 100%;
        height: 62px;
        padding: 0;
        border-top: 1px solid var(--social-border);
        background: rgba(5, 7, 6, .97);
        backdrop-filter: blur(14px);
    }

    .social-logo,
    .social-post-button,
    .social-account,
    .social-nav .desktop-primary {
        display: none;
    }

    .social-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        height: 100%;
        gap: 0;
    }

    .social-nav a {
        display: grid;
        width: 100%;
        min-width: 0;
        min-height: 61px;
        place-items: center;
        padding: 0;
        border-radius: 0;
    }

    .social-nav a span {
        display: none;
    }

    .social-main {
        width: 100%;
        border: 0;
    }

    .social-mobile-header {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        min-height: 53px;
        padding: 0 14px;
        border-bottom: 1px solid var(--social-border);
    }

    .social-mobile-header > :last-child {
        justify-self: end;
    }

    .mobile-brand-mark {
        display: block;
        width: 32px;
        height: 32px;
        border: 1px solid var(--social-border-strong);
        border-radius: 50%;
        object-fit: cover;
        filter: saturate(1.1) contrast(1.05);
    }

    .mobile-avatar {
        display: grid;
        width: 30px;
        height: 30px;
        place-items: center;
        border-radius: 50%;
        color: #041008 !important;
        background: var(--social-accent);
        font-size: .62rem;
        font-weight: 760;
    }

    .mobile-signin {
        color: var(--social-accent) !important;
        font-size: .78rem;
        font-weight: 720;
    }

    .timeline-header {
        top: 0;
    }

    .timeline-header h1 {
        display: none;
    }

    .timeline-tabs a {
        min-height: 48px;
    }

    .social-composer {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 9px;
        padding: 12px 13px 8px;
    }

    .social-composer > .social-avatar {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .social-composer textarea[name="text"] {
        font-size: 1rem;
    }

    .composer-hint {
        display: none;
    }

    .composer-actions {
        gap: 5px;
    }

    .composer-actions button {
        padding: 0 10px;
    }

    .agent-submit {
        font-size: 0 !important;
    }

    .agent-submit svg {
        width: 1.08rem !important;
        height: 1.08rem !important;
    }

    .social-signin-banner {
        padding: 13px;
    }

    .social-signin-banner span {
        display: none;
    }

    .social-post {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 9px;
        padding: 11px 12px 6px;
    }

    .social-post > .social-avatar {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .post-author {
        gap: 4px;
        font-size: .78rem;
    }

    .post-author > span:nth-of-type(2) {
        max-width: 94px;
    }

    .post-text {
        font-size: .93rem;
    }

    .social-media a {
        min-height: 130px;
    }

    .post-actions {
        margin-right: -3px;
    }
}

/* Human profiles, discovery, and activity */
.social-avatar img,
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-topbar,
.activity-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    min-height: 61px;
    border-bottom: 1px solid var(--social-border);
    padding: 8px 15px;
    background: rgba(5, 7, 6, .94);
    backdrop-filter: blur(14px);
}

.profile-topbar {
    gap: 14px;
}

.profile-topbar > div {
    display: grid;
    min-width: 0;
}

.profile-topbar h1,
.activity-header h1 {
    overflow: hidden;
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-topbar span {
    color: var(--social-muted);
    font-size: .7rem;
}

.profile-hero {
    border-bottom: 1px solid var(--social-border);
}

.profile-cover,
.profile-edit-cover {
    height: 154px;
    background: #17321f;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .05);
}

.profile-identity-row {
    display: flex;
    min-height: 61px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0 16px;
}

.profile-avatar {
    display: grid;
    width: 112px;
    height: 112px;
    flex: 0 0 112px;
    place-items: center;
    overflow: hidden;
    margin-top: -56px;
    border: 4px solid var(--social-bg);
    border-radius: 50%;
    color: #061109;
    background: var(--social-accent);
    font-size: 1.45rem;
    font-weight: 820;
}

.profile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 11px;
}

.profile-actions form {
    display: inline-flex;
}

.profile-outline-button,
.profile-primary-button {
    display: inline-grid;
    min-height: 34px;
    place-items: center;
    border-radius: 7px;
    padding: 0 14px;
    font-size: .78rem;
    font-weight: 760;
    cursor: pointer;
}

.profile-outline-button {
    border: 1px solid var(--social-border-strong);
    color: var(--social-text) !important;
    background: transparent;
}

.profile-outline-button:hover {
    border-color: var(--social-muted);
    background: var(--social-panel-2);
}

.profile-primary-button {
    border: 1px solid var(--social-text);
    color: #071009 !important;
    background: var(--social-text);
}

.profile-more {
    position: relative;
}

.profile-more summary {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--social-border-strong);
    border-radius: 50%;
    list-style: none;
    cursor: pointer;
}

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

.profile-more > div {
    position: absolute;
    z-index: 30;
    top: 40px;
    right: 0;
    width: 190px;
    overflow: hidden;
    border: 1px solid var(--social-border-strong);
    border-radius: 8px;
    background: var(--social-panel-2);
    box-shadow: 0 16px 38px rgba(0, 0, 0, .45);
}

.profile-more form,
.profile-more button {
    width: 100%;
}

.profile-more button {
    border: 0;
    padding: 10px 12px;
    color: var(--social-text);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.profile-more button:hover {
    background: rgba(255, 255, 255, .05);
}

.profile-copy {
    padding: 0 16px 15px;
}

.profile-copy h2 {
    margin: 7px 0 0;
    font-size: 1.28rem;
    line-height: 1.25;
}

.profile-handle {
    color: var(--social-muted);
    font-size: .86rem;
}

.profile-copy > p {
    margin: 13px 0 0;
    overflow-wrap: anywhere;
    font-size: .9rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.profile-meta,
.profile-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 15px;
    margin-top: 12px;
    color: var(--social-muted);
    font-size: .78rem;
}

.profile-meta span,
.profile-meta a {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
}

.profile-meta a {
    max-width: 260px;
    overflow: hidden;
    color: var(--social-blue) !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-meta svg {
    width: 1rem;
    height: 1rem;
}

.profile-stats strong {
    color: var(--social-text);
}

.profile-tabs,
.activity-tabs {
    display: grid;
    border-bottom: 1px solid var(--social-border);
}

.profile-tabs {
    grid-template-columns: repeat(3, 1fr);
}

.activity-tabs {
    grid-template-columns: repeat(2, 1fr);
}

.profile-tabs a,
.activity-tabs a {
    position: relative;
    display: grid;
    min-height: 48px;
    place-items: center;
    color: var(--social-muted);
    font-size: .83rem;
    font-weight: 680;
}

.profile-tabs a:hover,
.activity-tabs a:hover {
    background: rgba(255, 255, 255, .03);
}

.profile-tabs a.active,
.activity-tabs a.active {
    color: var(--social-text);
}

.profile-tabs a.active::after,
.activity-tabs a.active::after {
    position: absolute;
    bottom: 0;
    width: 54px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--social-accent);
    content: "";
}

.explore-header {
    position: sticky;
    z-index: 20;
    top: 0;
    padding: 8px 14px;
    border-bottom: 1px solid var(--social-border);
    background: rgba(5, 7, 6, .94);
    backdrop-filter: blur(14px);
}

.explore-search {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 30px;
    min-height: 45px;
    align-items: center;
    gap: 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0 11px;
    color: var(--social-muted);
    background: var(--social-panel-2);
}

.explore-search:focus-within {
    border-color: var(--social-accent);
    color: var(--social-accent);
    background: var(--social-bg);
}

.explore-search svg {
    width: 1.08rem;
    height: 1.08rem;
}

.explore-search input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--social-text);
    background: transparent;
}

.explore-search input::-webkit-search-cancel-button {
    display: none;
}

.explore-search > a {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
}

.people-results > header,
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 49px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--social-border);
}

.people-results h1,
.section-heading h2 {
    margin: 0;
    font-size: 1rem;
}

.section-heading span {
    color: var(--social-muted);
    font-size: .72rem;
}

.person-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--social-border);
}

.person-row:hover {
    background: rgba(255, 255, 255, .018);
}

.person-copy {
    display: grid;
    min-width: 0;
    line-height: 1.25;
}

.person-copy strong,
.person-copy > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-copy strong {
    font-size: .88rem;
}

.person-copy > span,
.person-copy small {
    color: var(--social-muted);
    font-size: .73rem;
}

.person-copy p {
    margin: 7px 0 4px;
    overflow-wrap: anywhere;
    color: var(--social-text);
    font-size: .82rem;
    line-height: 1.4;
}

.search-posts {
    border-top: 8px solid var(--social-panel);
}

.activity-list {
    min-height: 250px;
}

.activity-row {
    position: relative;
    display: grid;
    grid-template-columns: 28px 42px minmax(0, 1fr) 10px;
    align-items: start;
    gap: 10px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--social-border);
}

.activity-row:hover {
    background: rgba(255, 255, 255, .025);
}

.activity-row.unread {
    background: rgba(73, 168, 255, .045);
}

.activity-icon {
    display: grid;
    width: 28px;
    height: 36px;
    place-items: center;
    color: var(--social-blue);
}

.activity-icon.kind-follow {
    color: var(--social-accent);
}

.activity-icon.kind-reaction {
    color: #f05b87;
}

.activity-icon.kind-renote {
    color: #9f7aea;
}

.activity-icon svg {
    width: 1.22rem;
    height: 1.22rem;
}

.activity-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
    font-size: .84rem;
    line-height: 1.35;
}

.activity-copy > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-copy small,
.activity-copy time {
    color: var(--social-muted);
    font-size: .72rem;
}

.unread-dot {
    width: 7px;
    height: 7px;
    align-self: center;
    border-radius: 50%;
    background: var(--social-blue);
}

.profile-editor {
    min-height: calc(100vh - 61px);
}

.profile-edit-cover {
    height: 125px;
}

.profile-edit-avatar-row {
    display: flex;
    height: 59px;
    padding: 0 16px;
}

.editable-avatar {
    position: relative;
    width: 104px;
    height: 104px;
    flex-basis: 104px;
    margin-top: -52px;
    cursor: pointer;
}

.editable-avatar input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.avatar-camera {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: white;
    background: rgba(0, 0, 0, .38);
    opacity: 0;
    transition: opacity 120ms ease;
}

.editable-avatar:hover .avatar-camera,
.editable-avatar:focus-within .avatar-camera {
    opacity: 1;
}

.avatar-camera svg {
    width: 1.55rem;
    height: 1.55rem;
}

.profile-form-error {
    margin: 0 16px 14px;
    border: 1px solid rgba(240, 91, 135, .48);
    border-radius: 6px;
    padding: 9px 11px;
    color: #ffadc5;
    background: rgba(240, 91, 135, .08);
    font-size: .8rem;
}

.profile-fields {
    display: grid;
    gap: 13px;
    padding: 0 16px 20px;
}

.profile-fields > label,
.profile-field {
    display: grid;
    gap: 5px;
    color: var(--social-muted);
    font-size: .75rem;
    font-weight: 650;
}

.profile-field > label {
    color: var(--social-muted);
}

.profile-fields input,
.profile-fields textarea,
.handle-input {
    width: 100%;
    border: 1px solid var(--social-border-strong);
    border-radius: 6px;
    outline: 0;
    color: var(--social-text);
    background: var(--social-panel);
    font-size: .9rem;
    font-weight: 450;
}

.profile-fields input,
.profile-fields textarea {
    padding: 10px 11px;
}

.profile-fields textarea {
    resize: vertical;
    line-height: 1.45;
}

.profile-fields input:focus,
.profile-fields textarea:focus,
.handle-input:focus-within {
    border-color: var(--social-accent);
}

.handle-input {
    display: flex;
    align-items: center;
    padding-left: 11px;
}

.handle-input span {
    color: var(--social-muted);
}

.handle-input input {
    border: 0;
    background: transparent;
}

.profile-editor-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding: 13px 16px;
    border-top: 1px solid var(--social-border);
}

.profile-editor-actions a,
.profile-editor-actions button {
    display: grid;
    min-height: 36px;
    place-items: center;
    border-radius: 7px;
    padding: 0 15px;
    font-size: .8rem;
    font-weight: 730;
}

.profile-editor-actions a {
    border: 1px solid var(--social-border-strong);
}

.profile-editor-actions button {
    border: 1px solid var(--social-accent);
    color: #041008;
    background: var(--social-accent);
    cursor: pointer;
}

@media (max-width: 680px) {
    .profile-topbar,
    .activity-header {
        min-height: 53px;
        padding: 6px 12px;
    }

    .profile-cover {
        height: 112px;
    }

    .profile-avatar {
        width: 94px;
        height: 94px;
        flex-basis: 94px;
        margin-top: -47px;
    }

    .profile-identity-row,
    .profile-copy {
        padding-right: 13px;
        padding-left: 13px;
    }

    .profile-copy h2 {
        margin-top: 5px;
        font-size: 1.16rem;
    }

    .person-row {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        gap: 9px;
        padding: 11px 12px;
    }

    .person-row .social-avatar {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .person-copy p {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .activity-row {
        grid-template-columns: 24px 38px minmax(0, 1fr) 8px;
        gap: 8px;
        padding: 12px;
    }

    .activity-row .social-avatar {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .profile-editor {
        min-height: calc(100vh - 53px);
    }
}

/* Social conversation view */
.thread-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 61px;
    padding: 8px 15px;
    border-bottom: 1px solid var(--social-border);
    background: rgba(5, 7, 6, .94);
    backdrop-filter: blur(14px);
}

.thread-header h1,
.thread-header span {
    margin: 0;
}

.thread-header > div {
    display: grid;
    gap: 1px;
}

.thread-header h1 {
    font-size: 1.08rem;
    line-height: 1.2;
}

.thread-header span {
    color: var(--social-muted);
    font-size: .7rem;
}

.thread-back {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border-radius: 50%;
}

.thread-back:hover {
    background: var(--social-panel-2);
}

.thread-root {
    padding-top: 16px;
    padding-bottom: 4px;
}

.thread-root:hover {
    background: transparent;
}

.thread-post-text {
    margin-top: 9px;
    font-size: 1.1rem;
    line-height: 1.55;
}

.thread-timestamp {
    margin-top: 14px;
    padding: 11px 0;
    border-top: 1px solid var(--social-border);
    border-bottom: 1px solid var(--social-border);
    color: var(--social-muted);
    font-size: .78rem;
    text-transform: capitalize;
}

.thread-timestamp span {
    padding: 0 4px;
    color: var(--social-dim);
}

.thread-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.thread-reactions form {
    display: inline-flex;
}

.thread-reactions button,
.thread-reactions > span {
    min-height: 28px;
    border: 1px solid var(--social-border-strong);
    border-radius: 7px;
    padding: 3px 8px;
    color: var(--social-muted);
    background: var(--social-panel-2);
    font-size: .72rem;
}

.thread-reactions button {
    cursor: pointer;
}

.thread-reactions button:hover,
.thread-reactions button.selected {
    border-color: rgba(73, 168, 255, .45);
    color: var(--social-text);
    background: rgba(73, 168, 255, .1);
}

.thread-actions {
    min-height: 46px;
    margin-top: 2px;
}

.thread-composer {
    scroll-margin-top: 62px;
    padding-top: 12px;
    background: rgba(255, 255, 255, .012);
}

.thread-reply-locked {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 78px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--social-border);
    color: var(--social-muted);
    background: rgba(255, 255, 255, .012);
}

.thread-reply-locked > svg {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
}

.thread-reply-locked > div {
    display: grid;
    gap: 2px;
}

.thread-reply-locked strong {
    color: var(--social-text);
    font-size: .84rem;
}

.thread-reply-locked span {
    font-size: .75rem;
}

.replying-to {
    display: block;
    margin: 0 0 8px;
    color: var(--social-muted);
    font-size: .74rem;
}

.replying-to span {
    color: var(--social-blue);
}

.thread-replies {
    scroll-margin-top: 62px;
}

.thread-reply {
    position: relative;
}

.thread-reply::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 36px;
    width: 1px;
    background: var(--social-border);
    content: "";
}

.thread-reply > .social-avatar,
.thread-reply > .post-body {
    position: relative;
    z-index: 1;
}

.thread-empty {
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 42px 20px;
    border-bottom: 1px solid var(--social-border);
}

.thread-empty span {
    color: var(--social-muted);
    font-size: .8rem;
}

.thread-context > a + a {
    border-top: 1px solid var(--social-border);
}

@media (max-width: 680px) {
    .thread-header {
        min-height: 53px;
        padding: 6px 12px;
    }

    .thread-header h1 {
        font-size: 1rem;
    }

    .thread-root {
        grid-template-columns: 38px minmax(0, 1fr);
        padding-top: 13px;
    }

    .thread-post-text {
        font-size: 1rem;
    }

    .thread-reply::before {
        left: 30px;
    }

    .thread-composer {
        scroll-margin-top: 53px;
    }

    .post-overflow-menu {
        width: min(304px, calc(100vw - 16px));
        max-height: min(470px, calc(100vh - 150px));
    }

    .post-action-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }

    .post-action-dialog > form {
        max-height: calc(100vh - 16px);
    }

    .post-dialog-header {
        min-height: 62px;
        padding: 11px 14px;
    }

    .post-dialog-content {
        gap: 15px;
        padding: 15px;
    }

    .post-dialog-actions {
        min-height: 61px;
        padding: 11px 14px;
    }

    .post-report-reasons {
        grid-template-columns: 1fr;
    }

    .post-action-toast {
        bottom: 76px;
    }
}

/* ================================================================
   LEGACY SOCIAL ROUTES
   Shared shell for topics, channels, lists, drive, pages, DMs, and
   the remaining database-backed application views.
   ================================================================ */

body.mk-shell {
    --background: #050706;
    --surface: #0b0e0c;
    --surface-2: #111512;
    --hairline: #242a25;
    --hairline-strong: #343c35;
    --heading: #edf3ee;
    --body: #edf3ee;
    --muted: #8e9b91;
    --subtle: #657068;
    --accent: #22d65f;
    --accent-soft: rgba(34, 214, 95, .11);
    --accent-2: #49a8ff;
    --accent-2-soft: rgba(73, 168, 255, .11);
    --accent-3: #e9b949;
    --accent-3-soft: rgba(233, 185, 73, .11);
    --cta: #22d65f;
    --cta-hover: #35eb71;
    --cloud-white: #031008;
    --bg: #050706;
    --fg: #edf3ee;
    --fg-dim: #8e9b91;
    --border: #242a25;
    --alert: #f05b87;
    --warn: #e9b949;
    display: grid;
    grid-template-columns: 248px minmax(0, 640px) minmax(210px, 330px);
    justify-content: center;
    align-items: start;
    min-height: 100vh;
    margin: 0;
    color: var(--body);
    background: var(--background);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

body.mk-shell *,
body.mk-shell *::before,
body.mk-shell *::after {
    box-sizing: border-box;
}

body.mk-shell button,
body.mk-shell input,
body.mk-shell select,
body.mk-shell textarea {
    min-width: 0;
    color: inherit;
    font: inherit;
    letter-spacing: 0;
}

body.mk-shell img {
    display: block;
    max-width: 100%;
}

body.mk-shell a {
    color: inherit;
    text-decoration: none;
}

body.mk-shell a:hover {
    color: inherit !important;
}

body.mk-shell code {
    overflow-wrap: anywhere;
    color: var(--accent) !important;
    text-shadow: none;
}

body.mk-shell > .mk-nav {
    grid-column: 1;
}

body.mk-shell > .mk-main,
body.mk-shell > .composer-page {
    grid-column: 2;
}

body.mk-shell > .mk-widgets {
    grid-column: 3;
}

body.mk-shell .mk-nav {
    position: sticky;
    top: 0;
    display: flex;
    min-width: 0;
    height: 100vh;
    flex-direction: column;
    padding: 16px 20px 12px 8px;
}

body.mk-shell .mk-instance {
    display: flex;
    width: fit-content;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px 8px;
}

body.mk-shell .mk-instance > img.logo {
    display: block;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid var(--hairline-strong);
    border-radius: 50%;
    object-fit: cover;
    filter: saturate(1.1) contrast(1.05);
}

body.mk-shell .mk-instance > span {
    display: grid;
    min-width: 0;
    gap: 1px;
}

body.mk-shell .mk-instance strong,
body.mk-shell .mk-instance small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.mk-shell .mk-instance strong {
    color: var(--heading);
    font-size: 1.05rem;
    font-weight: 780;
}

body.mk-shell .mk-instance small {
    max-width: 154px;
    color: var(--muted);
    font-size: .68rem;
}

body.mk-shell .auth-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 8px 9px;
    color: var(--subtle);
    font-size: .69rem;
}

body.mk-shell .auth-status a,
body.mk-shell .logout-link-button {
    color: var(--accent);
}

body.mk-shell .sidebar-nav {
    display: flex;
    min-height: 0;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--hairline-strong) transparent;
}

body.mk-shell .sidebar-nav a {
    display: flex;
    width: fit-content;
    min-width: 178px;
    min-height: 45px;
    flex: 0 0 45px;
    align-items: center;
    gap: 15px;
    border-radius: 8px;
    padding: 0 14px;
    color: var(--heading);
    font-size: .94rem;
    font-weight: 540;
    transition: color 130ms ease, background-color 130ms ease;
}

body.mk-shell .sidebar-nav a > span {
    display: grid;
    width: 25px;
    flex: 0 0 25px;
    place-items: center;
    color: var(--muted);
    font-size: 1.12rem;
}

body.mk-shell .sidebar-nav a:hover,
body.mk-shell .sidebar-nav a.active {
    color: var(--heading) !important;
    background: var(--surface-2);
}

body.mk-shell .sidebar-nav a.active {
    font-weight: 740;
}

body.mk-shell .sidebar-nav a.active > span {
    color: var(--accent);
}

body.mk-shell .mk-post-button {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 13px 6px 0;
    border-radius: 8px;
    color: #031008 !important;
    background: var(--accent);
    font-size: .88rem;
    font-weight: 780;
}

body.mk-shell .mk-post-button:hover {
    color: #031008 !important;
    background: var(--cta-hover);
}

body.mk-shell .sidebar-footer {
    margin: auto 8px 0;
    padding-top: 12px;
    color: var(--subtle);
    font-size: .64rem;
    line-height: 1.4;
}

body.mk-shell .mk-main,
body.mk-shell .composer-page {
    min-width: 0;
    min-height: 100vh;
    border-right: 1px solid var(--hairline);
    border-left: 1px solid var(--hairline);
}

body.mk-shell .mk-page-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--hairline);
    padding: 10px 16px;
    background: rgba(5, 7, 6, .94);
    backdrop-filter: blur(14px);
}

body.mk-shell .mk-page-header > div {
    min-width: 0;
}

body.mk-shell .mk-page-header h1,
body.mk-shell .mk-page-header p {
    margin: 0;
    letter-spacing: 0;
}

body.mk-shell .mk-page-header h1 {
    overflow-wrap: anywhere;
    color: var(--heading);
    font-size: 1.2rem;
    line-height: 1.25;
}

body.mk-shell .mk-page-header p {
    margin-top: 3px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: .75rem;
    line-height: 1.35;
}

body.mk-shell .mk-icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid var(--hairline-strong);
    border-radius: 50%;
    color: var(--muted);
    background: transparent;
    font-size: 1.05rem;
}

body.mk-shell .mk-icon-button:hover {
    border-color: var(--accent);
    color: var(--accent) !important;
    background: var(--accent-soft);
}

body.mk-shell .mk-main > :not(.mk-page-header):not(.page-reader),
body.mk-shell .composer-page > :not(.mk-page-header) {
    margin-right: 16px;
    margin-left: 16px;
}

body.mk-shell .feed-header {
    display: flex;
    min-height: 45px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--hairline);
}

body.mk-shell .mode-indicator {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 740;
    text-transform: uppercase;
}

body.mk-shell .new-post-link {
    color: var(--accent);
    font-size: .78rem;
    font-weight: 720;
}

body.mk-shell .card,
body.mk-shell .composer-card,
body.mk-shell .mk-post-form,
body.mk-shell .mk-widget {
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 14px;
    color: var(--body);
    background: var(--surface);
}

body.mk-shell section.card,
body.mk-shell section.composer-card,
body.mk-shell section.mk-post-form,
body.mk-shell section.mk-widget,
body.mk-shell form.composer-card {
    margin-top: 14px;
    margin-bottom: 14px;
}

body.mk-shell .card > :first-child,
body.mk-shell .composer-card > :first-child,
body.mk-shell .mk-widget > :first-child {
    margin-top: 0;
}

body.mk-shell .card > :last-child,
body.mk-shell .composer-card > :last-child,
body.mk-shell .mk-widget > :last-child {
    margin-bottom: 0;
}

body.mk-shell .card h2,
body.mk-shell .card h3,
body.mk-shell .composer-card h2,
body.mk-shell .mk-widget h2 {
    margin: 0 0 10px;
    color: var(--heading);
    font-size: .9rem;
}

body.mk-shell .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

body.mk-shell .form-grid .wide {
    grid-column: 1 / -1;
}

body.mk-shell .form-group {
    min-width: 0;
    margin: 0;
}

body.mk-shell .form-group label,
body.mk-shell .topic-picker legend {
    display: block;
    margin: 0 0 6px;
    color: var(--muted);
    font-family: inherit;
    font-size: .67rem;
    font-weight: 740;
    letter-spacing: 0;
    text-transform: uppercase;
}

body.mk-shell .form-group input,
body.mk-shell .form-group select,
body.mk-shell .form-group textarea,
body.mk-shell .mk-main input[type="text"],
body.mk-shell .mk-main input[type="url"],
body.mk-shell .mk-main select,
body.mk-shell .mk-main textarea {
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--hairline);
    border-radius: 7px;
    outline: 0;
    padding: 10px 11px;
    color: var(--body);
    background: var(--background);
    font-size: .82rem;
    line-height: 1.4;
}

body.mk-shell .form-group textarea,
body.mk-shell .mk-main textarea {
    resize: vertical;
}

body.mk-shell .form-group input:focus,
body.mk-shell .form-group select:focus,
body.mk-shell .form-group textarea:focus,
body.mk-shell .mk-main input:focus,
body.mk-shell .mk-main select:focus,
body.mk-shell .mk-main textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

body.mk-shell input[type="file"] {
    max-width: 100%;
    border: 1px dashed var(--hairline-strong);
    border-radius: 7px;
    padding: 8px;
    color: var(--muted);
    background: var(--background);
    font-size: .75rem;
}

body.mk-shell .btn,
body.mk-shell .composer-card button[type="submit"],
body.mk-shell .mk-post-form button[type="submit"] {
    display: inline-grid;
    min-height: 36px;
    place-items: center;
    border: 1px solid var(--accent);
    border-radius: 7px;
    padding: 7px 13px;
    color: #031008 !important;
    background: var(--accent);
    font-size: .76rem;
    font-weight: 760;
    cursor: pointer;
}

body.mk-shell .btn:hover,
body.mk-shell .composer-card button[type="submit"]:hover,
body.mk-shell .mk-post-form button[type="submit"]:hover {
    color: #031008 !important;
    background: var(--cta-hover);
}

body.mk-shell .btn-dim {
    border-color: var(--hairline-strong);
    color: var(--muted) !important;
    background: var(--surface-2);
}

body.mk-shell .btn-dim:hover {
    border-color: var(--muted);
    color: var(--heading) !important;
    background: var(--surface-2);
}

body.mk-shell .btn-danger {
    border-color: rgba(240, 91, 135, .55);
    color: #ff9bbb !important;
    background: rgba(240, 91, 135, .1);
}

body.mk-shell .composer-card > button,
body.mk-shell .composer-card > form > button {
    margin-top: 12px;
}

body.mk-shell .composer-actions,
body.mk-shell .settings-actions,
body.mk-shell .mk-empty-actions,
body.mk-shell .reaction-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

body.mk-shell .composer-actions {
    margin-top: 15px;
}

body.mk-shell .topic-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 14px 0 0;
    border: 1px solid var(--hairline);
    border-radius: 7px;
    padding: 10px;
}

body.mk-shell .topic-picker legend {
    padding: 0 5px;
}

body.mk-shell .topic-picker label,
body.mk-shell .check-row {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: .75rem;
}

body.mk-shell .check-row {
    margin-top: 13px;
}

body.mk-shell input[type="checkbox"] {
    accent-color: var(--accent);
}

body.mk-shell .post-entry {
    display: flex;
    min-width: 0;
    gap: 11px;
    border-bottom: 1px solid var(--hairline);
    padding: 14px 2px;
}

body.mk-shell .post-body,
body.mk-shell .post-entry .post-body {
    min-width: 0;
    flex: 1;
}

body.mk-shell .post-title,
body.mk-shell .post-title a {
    overflow-wrap: anywhere;
    color: var(--heading);
    font-size: .91rem;
    font-weight: 690;
    line-height: 1.4;
}

body.mk-shell .post-title a:hover {
    color: var(--accent) !important;
}

body.mk-shell .post-meta {
    display: flex;
    gap: 5px 12px;
    flex-wrap: wrap;
    margin-top: 6px;
    color: var(--subtle);
    font-size: .69rem;
}

body.mk-shell .post-rank-detail {
    margin-top: 7px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.45;
}

body.mk-shell .mk-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    padding-bottom: 14px;
}

body.mk-shell .mk-note {
    min-width: 0;
    border-color: var(--hairline);
    border-radius: 8px;
    background: var(--surface);
}

body.mk-shell .mk-main > .mk-note {
    margin-top: 12px;
    margin-bottom: 12px;
}

body.mk-shell .mk-note-text,
body.mk-shell .mk-note-header,
body.mk-shell .mk-renote-card,
body.mk-shell .post-sources {
    overflow-wrap: anywhere;
}

body.mk-shell .mk-note-actions form,
body.mk-shell .reaction-bar form {
    display: inline-flex;
    margin: 0;
}

body.mk-shell .react-btn,
body.mk-shell .react-add-btn {
    min-height: 29px;
    border: 1px solid var(--hairline);
    border-radius: 7px;
    padding: 3px 8px;
    color: var(--muted);
    background: var(--surface-2);
    font-size: .7rem;
    cursor: pointer;
}

body.mk-shell .react-btn:hover,
body.mk-shell .react-add-btn:hover,
body.mk-shell .react-btn.reacted {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

body.mk-shell .mk-empty {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 14px;
    margin-bottom: 14px;
    border-style: solid;
    border-radius: 8px;
    padding: 18px;
    text-align: left;
}

body.mk-shell .mk-empty h2,
body.mk-shell .mk-empty p {
    margin: 0;
}

body.mk-shell .mk-empty h2 {
    font-size: .91rem;
}

body.mk-shell .mk-empty p {
    margin-top: 4px;
    font-size: .78rem;
    line-height: 1.45;
}

body.mk-shell .mk-empty-actions {
    justify-content: flex-start;
    margin-top: 11px;
}

body.mk-shell .mk-tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    border-bottom: 1px solid var(--hairline);
    padding: 10px 0;
}

body.mk-shell .mk-tab {
    flex: 0 0 auto;
    border: 1px solid var(--hairline);
    border-radius: 7px;
    padding: 6px 10px;
    color: var(--muted);
    font-size: .72rem;
}

body.mk-shell .mk-tab:hover,
body.mk-shell .mk-tab.active {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    background: var(--accent-soft);
}

body.mk-shell .mk-drive-grid,
body.mk-shell .emoji-grid,
body.mk-shell .settings-grid,
body.mk-shell .page-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 14px;
}

body.mk-shell .mk-drive-file,
body.mk-shell .emoji-card,
body.mk-shell .settings-card,
body.mk-shell .page-card {
    display: grid;
    min-width: 0;
    overflow: hidden;
    gap: 6px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 12px;
    color: var(--body);
    background: var(--surface);
}

body.mk-shell .mk-drive-file:hover,
body.mk-shell a.settings-card:hover,
body.mk-shell .page-card:hover {
    border-color: var(--hairline-strong);
    background: var(--surface-2);
}

body.mk-shell .mk-drive-thumb {
    display: grid;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    place-items: center;
    border-radius: 6px;
    color: var(--accent);
    background: var(--background);
    font-size: 1.6rem;
}

body.mk-shell .mk-drive-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.mk-shell .mk-drive-file strong,
body.mk-shell .mk-drive-file small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.mk-shell .mk-drive-file strong {
    font-size: .78rem;
}

body.mk-shell .mk-drive-file small {
    color: var(--subtle);
    font-size: .64rem;
}

body.mk-shell .emoji-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.mk-shell .emoji-card {
    justify-items: center;
    text-align: center;
}

body.mk-shell .emoji-card img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

body.mk-shell .emoji-card strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--heading);
    font-size: .76rem;
}

body.mk-shell .emoji-card small,
body.mk-shell .settings-card p,
body.mk-shell .settings-card small,
body.mk-shell .page-card p,
body.mk-shell .page-card small {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: .7rem;
    line-height: 1.4;
}

body.mk-shell .settings-card > span {
    color: var(--accent);
    font-size: 1.1rem;
}

body.mk-shell .settings-card > strong {
    color: var(--heading);
    font-size: .84rem;
}

body.mk-shell .settings-signout {
    min-height: 100%;
    cursor: pointer;
}

body.mk-shell .page-card h2 {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--heading);
    font-size: .92rem;
}

body.mk-shell .page-reader {
    min-width: 0;
}

body.mk-shell .page-reader > header {
    border-bottom: 1px solid var(--hairline);
    padding: 24px 22px 20px;
}

body.mk-shell .page-reader h1 {
    margin: 12px 0 6px;
    overflow-wrap: anywhere;
    color: var(--heading);
    font-size: 1.55rem;
    line-height: 1.2;
}

body.mk-shell .page-reader p,
body.mk-shell .page-reader small,
body.mk-shell .page-reader .back-link {
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.5;
}

body.mk-shell .page-reader .back-link:hover {
    color: var(--accent) !important;
}

body.mk-shell .page-body {
    padding: 22px;
    overflow-wrap: anywhere;
    color: var(--body);
    font-size: .92rem;
    line-height: 1.72;
    white-space: pre-wrap;
}

body.mk-shell .list-member,
body.mk-shell .moderation-list > div {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--hairline);
    padding: 9px 0;
}

body.mk-shell .list-member:first-of-type,
body.mk-shell .moderation-list > div:first-child {
    border-top: 0;
}

body.mk-shell .mk-dm-list,
body.mk-shell .mk-dm-messages {
    padding-top: 14px;
    padding-bottom: 14px;
}

body.mk-shell .mk-dm-thread {
    transition: border-color 130ms ease, background-color 130ms ease;
}

body.mk-shell .mk-dm-thread:hover {
    border-color: var(--hairline-strong);
    background: var(--surface-2);
}

body.mk-shell .mk-dm-bubble {
    overflow-wrap: anywhere;
}

body.mk-shell .mk-widgets {
    position: sticky;
    top: 0;
    min-width: 0;
    max-height: 100vh;
    overflow-y: auto;
    padding: 16px 8px 16px 24px;
}

body.mk-shell .widget {
    margin-bottom: 12px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 14px;
    background: var(--surface);
}

body.mk-shell .widget h2,
body.mk-shell .widget p {
    margin: 0;
}

body.mk-shell .widget h2 {
    color: var(--heading);
    font-size: .8rem;
}

body.mk-shell .widget p {
    margin-top: 7px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: .72rem;
    line-height: 1.5;
}

body.mk-shell .error {
    border: 1px solid rgba(240, 91, 135, .5);
    border-radius: 7px;
    padding: 10px;
    color: #ff9bbb;
    background: rgba(240, 91, 135, .09);
    font-size: .76rem;
}

@media (max-width: 1100px) {
    body.mk-shell {
        grid-template-columns: 82px minmax(0, 640px) minmax(220px, 310px);
    }

    body.mk-shell .mk-nav {
        align-items: center;
        padding-right: 10px;
        padding-left: 10px;
    }

    body.mk-shell .mk-instance {
        margin-left: 0;
    }

    body.mk-shell .mk-instance > span,
    body.mk-shell .auth-status,
    body.mk-shell .sidebar-footer {
        display: none;
    }

    body.mk-shell .sidebar-nav {
        width: 100%;
        align-items: center;
    }

    body.mk-shell .sidebar-nav a {
        width: 49px;
        min-width: 49px;
        justify-content: center;
        gap: 0;
        padding: 0;
        font-size: 0;
    }

    body.mk-shell .sidebar-nav a > span {
        font-size: 1.15rem;
    }

    body.mk-shell .mk-post-button {
        width: 49px;
        min-height: 49px;
        gap: 0;
        margin-right: 0;
        margin-left: 0;
        padding: 0;
        font-size: 0;
    }

    body.mk-shell .mk-post-button > span {
        font-size: 1.15rem;
    }
}

@media (max-width: 960px) {
    body.mk-shell {
        grid-template-columns: 82px minmax(0, 640px);
    }

    body.mk-shell > .mk-widgets {
        display: none;
    }
}

@media (max-width: 680px) {
    body.mk-shell {
        display: block;
        width: 100%;
        padding-bottom: 62px;
    }

    body.mk-shell > .mk-nav {
        position: fixed;
        z-index: 50;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        display: block;
        width: 100%;
        height: 62px;
        padding: 0;
        border-top: 1px solid var(--hairline);
        background: rgba(5, 7, 6, .97);
        backdrop-filter: blur(14px);
    }

    body.mk-shell .mk-instance,
    body.mk-shell .auth-status,
    body.mk-shell .mk-post-button,
    body.mk-shell .sidebar-footer {
        display: none;
    }

    body.mk-shell .sidebar-nav {
        display: flex;
        width: 100%;
        height: 61px;
        flex-direction: row;
        align-items: stretch;
        gap: 0;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    body.mk-shell .sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    body.mk-shell .sidebar-nav a {
        display: grid;
        width: auto;
        min-width: 56px;
        min-height: 61px;
        flex: 1 0 56px;
        place-items: center;
        border-radius: 0;
        padding: 0;
    }

    body.mk-shell .sidebar-nav a > span {
        width: auto;
    }

    body.mk-shell .mk-main,
    body.mk-shell .composer-page {
        width: 100%;
        min-height: calc(100vh - 62px);
        border: 0;
    }

    body.mk-shell .mk-page-header {
        min-height: 61px;
        padding: 8px 12px;
    }

    body.mk-shell .mk-page-header h1 {
        font-size: 1.02rem;
    }

    body.mk-shell .mk-page-header p {
        display: none;
    }

    body.mk-shell .mk-main > :not(.mk-page-header):not(.page-reader),
    body.mk-shell .composer-page > :not(.mk-page-header) {
        margin-right: 12px;
        margin-left: 12px;
    }

    body.mk-shell .form-grid,
    body.mk-shell .settings-grid,
    body.mk-shell .page-list {
        grid-template-columns: minmax(0, 1fr);
    }

    body.mk-shell .emoji-grid,
    body.mk-shell .mk-drive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.mk-shell .mk-main section[style*="display:grid"],
    body.mk-shell .mk-main form div[style*="display:grid"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.mk-shell .mk-main form div[style*="display:flex"],
    body.mk-shell .mk-main footer[style*="display:flex"] {
        flex-wrap: wrap !important;
    }

    body.mk-shell .mk-main input,
    body.mk-shell .mk-main select,
    body.mk-shell .mk-main textarea {
        min-width: 0 !important;
    }

    body.mk-shell .mk-empty {
        padding: 14px;
    }

    body.mk-shell .mk-note {
        gap: 9px;
        padding: 12px;
    }

    body.mk-shell .mk-note > .mk-avatar {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    body.mk-shell .mk-media-grid.count-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.mk-shell .mk-dm-bubble {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    body.mk-shell .page-reader > header,
    body.mk-shell .page-body {
        padding-right: 15px;
        padding-left: 15px;
    }

    body.mk-shell .page-reader h1 {
        font-size: 1.28rem;
    }
}

/* Standalone authentication and account pages. */
body:has(> main.form-page) {
    --background: #050706;
    --surface: #0b0e0c;
    --surface-2: #111512;
    --hairline: #242a25;
    --hairline-strong: #343c35;
    --heading: #edf3ee;
    --body: #edf3ee;
    --muted: #8e9b91;
    --subtle: #657068;
    --accent: #22d65f;
    --accent-soft: rgba(34, 214, 95, .11);
    --cta: #22d65f;
    --cta-hover: #35eb71;
    --cloud-white: #031008;
    --alert: #f05b87;
    display: flex;
    min-height: 100vh;
    align-items: flex-start;
    justify-content: center;
    margin: 0;
    padding: 64px 16px;
    color: var(--body);
    background: var(--background);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

body:has(> main.form-page) *,
body:has(> main.form-page) *::before,
body:has(> main.form-page) *::after {
    box-sizing: border-box;
}

body:has(> main.form-page) a {
    color: inherit;
    text-decoration: none;
}

body:has(> main.form-page) a:hover {
    color: inherit !important;
}

body:has(> main.form-page) > main.form-page {
    width: min(100%, 540px);
    max-width: 540px;
    margin: 0;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 24px;
    color: var(--body);
    background: var(--surface);
}

body:has(> main.form-page) > main.form-page::before {
    display: block;
    width: 38px;
    height: 38px;
    margin-bottom: 18px;
    border: 1px solid var(--hairline-strong);
    border-radius: 50%;
    background: url("/static/agent/mandala-mark.webp") center / cover no-repeat;
    content: "";
    filter: saturate(1.1) contrast(1.05);
}

body:has(> main.form-page) .form-page h1 {
    margin: 0 0 20px;
    color: var(--heading);
    font-family: inherit;
    font-size: 1.28rem;
    line-height: 1.25;
    letter-spacing: 0;
}

body:has(> main.form-page) .form-group {
    margin-bottom: 14px;
}

body:has(> main.form-page) .form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-family: inherit;
    font-size: .67rem;
    font-weight: 760;
    letter-spacing: 0;
    text-transform: uppercase;
}

body:has(> main.form-page) .form-group input,
body:has(> main.form-page) .form-group textarea,
body:has(> main.form-page) .form-group select {
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--hairline-strong);
    border-radius: 7px;
    outline: 0;
    padding: 11px 12px;
    color: var(--body);
    background: var(--background);
    font: inherit;
    font-size: .82rem;
    line-height: 1.45;
    letter-spacing: 0;
    resize: vertical;
}

body:has(> main.form-page) .form-group input:focus,
body:has(> main.form-page) .form-group textarea:focus,
body:has(> main.form-page) .form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

body:has(> main.form-page) .form-page button[type="submit"],
body:has(> main.form-page) .form-page .btn {
    display: inline-grid;
    min-height: 38px;
    place-items: center;
    border: 1px solid var(--accent);
    border-radius: 7px;
    padding: 8px 15px;
    color: #031008 !important;
    background: var(--accent);
    font: inherit;
    font-size: .78rem;
    font-weight: 780;
    cursor: pointer;
}

body:has(> main.form-page) .form-page button[type="submit"]:hover,
body:has(> main.form-page) .form-page .btn:hover {
    color: #031008 !important;
    background: var(--cta-hover);
}

body:has(> main.form-page) .form-page .btn-dim {
    border-color: var(--hairline-strong);
    color: var(--muted) !important;
    background: var(--surface-2);
}

body:has(> main.form-page) .form-page .btn-danger,
body:has(> main.form-page) .form-page button.btn-danger[type="submit"] {
    border-color: rgba(240, 91, 135, .55);
    color: #ff9bbb !important;
    background: rgba(240, 91, 135, .1);
}

body:has(> main.form-page) .form-page .back-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--muted);
    font-size: .76rem;
}

body:has(> main.form-page) .form-page .back-link:hover {
    color: var(--accent) !important;
}

body:has(> main.form-page) .form-page .error {
    margin: 14px 0 0;
    border: 1px solid rgba(240, 91, 135, .5);
    border-radius: 7px;
    padding: 10px 11px;
    color: #ff9bbb;
    background: rgba(240, 91, 135, .09);
    font-size: .76rem;
}

body:has(> main.form-page) .challenge-box {
    overflow: auto;
    margin: 12px 0;
    border: 1px solid var(--hairline-strong);
    border-radius: 7px;
    padding: 12px;
    color: var(--accent);
    background: var(--background);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .73rem;
    line-height: 1.5;
}

body:has(> main.form-page) .challenge-text {
    overflow-wrap: anywhere;
}

/* The original private profile uses the same account data with an older shell. */
body:has(> aside#sidebar + main.form-page) {
    display: grid;
    grid-template-columns: 248px minmax(0, 640px);
    align-items: start;
    padding: 0;
}

body:has(> aside#sidebar + main.form-page) > aside#sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 22px 28px;
}

body:has(> aside#sidebar + main.form-page) > aside#sidebar > img.logo {
    display: block;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid var(--hairline-strong);
    border-radius: 50%;
    object-fit: cover;
    filter: saturate(1.1) contrast(1.05);
}

body:has(> aside#sidebar + main.form-page) > aside#sidebar h1 {
    margin: 12px 0 0;
    color: var(--heading);
    font-size: 1.05rem;
}

body:has(> aside#sidebar + main.form-page) > aside#sidebar .tagline {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: .7rem;
}

body:has(> aside#sidebar + main.form-page) > aside#sidebar .sidebar-footer {
    margin-top: auto;
    color: var(--subtle);
    font-size: .65rem;
}

body:has(> aside#sidebar + main.form-page) > main.form-page {
    width: 100%;
    max-width: 640px;
    margin: 32px 0;
}

body:has(> aside#sidebar + main.form-page) > main.form-page::before {
    display: none;
}

body:has(> aside#sidebar + main.form-page) .profile-section {
    border-top: 1px solid var(--hairline);
    padding: 16px 0;
}

body:has(> aside#sidebar + main.form-page) .profile-section h2,
body:has(> aside#sidebar + main.form-page) .profile-section p {
    margin: 0;
}

body:has(> aside#sidebar + main.form-page) .profile-section h2 {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: .69rem;
    text-transform: uppercase;
}

body:has(> aside#sidebar + main.form-page) .profile-section p {
    overflow-wrap: anywhere;
    color: var(--body);
    font-size: .8rem;
    line-height: 1.5;
}

body:has(> aside#sidebar + main.form-page) .data-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

body:has(> aside#sidebar + main.form-page) .user-post {
    display: flex;
    min-width: 0;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--hairline);
    padding: 10px 0;
    overflow-wrap: anywhere;
    color: var(--body);
    font-size: .78rem;
    line-height: 1.45;
}

/* Standalone Git and graph-data viewers. */
body:has(> header + main > section.card) {
    --background: #050706;
    --surface: #0b0e0c;
    --surface-2: #111512;
    --hairline: #242a25;
    --hairline-strong: #343c35;
    --heading: #edf3ee;
    --body: #edf3ee;
    --muted: #8e9b91;
    --subtle: #657068;
    --accent: #22d65f;
    --accent-soft: rgba(34, 214, 95, .11);
    min-height: 100vh;
    margin: 0;
    color: var(--body);
    background: var(--background);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

body:has(> header + main > section.card) *,
body:has(> header + main > section.card) *::before,
body:has(> header + main > section.card) *::after {
    box-sizing: border-box;
}

body:has(> header + main > section.card) > header {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    width: min(100%, 900px);
    align-items: center;
    gap: 2px 12px;
    margin: 0 auto;
    border-bottom: 1px solid var(--hairline);
    padding: 28px 20px 20px;
}

body:has(> header + main > section.card) > header > img.logo {
    display: block;
    width: 38px;
    height: 38px;
    grid-row: 1 / span 2;
    border: 1px solid var(--hairline-strong);
    border-radius: 50%;
    object-fit: cover;
    filter: saturate(1.1) contrast(1.05);
}

body:has(> header + main > section.card) > header h1,
body:has(> header + main > section.card) > header p {
    grid-column: 2;
    margin: 0;
    overflow-wrap: anywhere;
    letter-spacing: 0;
}

body:has(> header + main > section.card) > header h1 {
    color: var(--heading);
    font-size: 1.22rem;
    line-height: 1.25;
}

body:has(> header + main > section.card) > header .subtitle {
    color: var(--muted);
    font-size: .75rem;
    line-height: 1.45;
}

body:has(> header + main > section.card) > main {
    width: min(100%, 900px);
    margin: 0 auto;
    padding: 18px 20px 40px;
}

body:has(> header + main > section.card) > main > .card {
    margin: 0 0 12px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 15px;
    color: var(--body);
    background: var(--surface);
}

body:has(> header + main > section.card) > main > .card h2 {
    margin: 0 0 10px;
    color: var(--heading);
    font-size: .82rem;
}

body:has(> header + main > section.card) .query-box,
body:has(> header + main > section.card) .result-box {
    max-width: 100%;
    overflow: auto;
    margin: 0;
    border: 1px solid var(--hairline);
    border-radius: 7px;
    padding: 12px;
    color: var(--accent) !important;
    background: var(--background);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .73rem;
    line-height: 1.55;
    text-shadow: none;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

body:has(> header + main > section.card) > main a {
    color: var(--accent) !important;
    font-size: .76rem;
}

body:has(> header + main > section.card) > footer {
    width: min(100%, 900px);
    margin: 0 auto;
    border-top: 1px solid var(--hairline);
    padding: 14px 20px 28px;
    color: var(--subtle);
    font-size: .68rem;
    text-align: center;
}

body:has(> header + main > section.card) > footer p {
    margin: 0;
}

@media (max-width: 900px) {
    body:has(> aside#sidebar + main.form-page) {
        grid-template-columns: 82px minmax(0, 640px);
    }

    body:has(> aside#sidebar + main.form-page) > aside#sidebar {
        align-items: center;
        padding-right: 12px;
        padding-left: 12px;
    }

    body:has(> aside#sidebar + main.form-page) > aside#sidebar h1,
    body:has(> aside#sidebar + main.form-page) > aside#sidebar .tagline,
    body:has(> aside#sidebar + main.form-page) > aside#sidebar .sidebar-footer {
        display: none;
    }
}

@media (max-width: 680px) {
    body:has(> main.form-page) {
        padding: 16px 12px;
    }

    body:has(> main.form-page) > main.form-page {
        padding: 18px;
    }

    body:has(> aside#sidebar + main.form-page) {
        display: block;
        padding: 0 12px 16px;
    }

    body:has(> aside#sidebar + main.form-page) > aside#sidebar {
        position: static;
        display: flex;
        width: calc(100% + 24px);
        height: 61px;
        flex-direction: row;
        align-items: center;
        margin-left: -12px;
        border-bottom: 1px solid var(--hairline);
        padding: 8px 12px;
    }

    body:has(> aside#sidebar + main.form-page) > aside#sidebar h1 {
        display: block;
        margin: 0 0 0 10px;
    }

    body:has(> aside#sidebar + main.form-page) > main.form-page {
        margin: 12px 0 0;
    }

    body:has(> header + main > section.card) > header {
        padding: 18px 13px 15px;
    }

    body:has(> header + main > section.card) > main {
        padding: 14px 12px 28px;
    }

    body:has(> header + main > section.card) > footer {
        padding-right: 13px;
        padding-left: 13px;
    }
}

/* Nostr identity login. */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    margin: -1px !important;
    border: 0 !important;
    padding: 0 !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
}

body:has(> main.identity-page) {
    padding-top: 38px;
    padding-bottom: 38px;
}

body:has(> main.form-page) > main.identity-page {
    width: min(100%, 510px);
    max-width: 510px;
    padding: 26px;
}

body:has(> main.form-page) > main.identity-page::before {
    display: none;
}

.identity-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--heading) !important;
    font-size: .82rem;
    font-weight: 780;
}

.identity-brand img {
    width: 32px;
    height: 32px;
    border: 1px solid var(--hairline-strong);
    border-radius: 50%;
    object-fit: cover;
}

.identity-heading {
    margin: 28px 0 22px;
}

.identity-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--accent);
    font-size: .65rem;
    font-weight: 780;
    text-transform: uppercase;
}

body:has(> main.form-page) .identity-heading h1 {
    margin: 0 0 7px;
    font-size: 1.42rem;
}

.identity-heading p {
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.5;
}

.identity-actions {
    display: grid;
    gap: 9px;
}

.identity-action {
    display: grid;
    width: 100%;
    min-height: 64px;
    grid-template-columns: 22px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--hairline-strong);
    border-radius: 7px;
    padding: 11px 13px;
    color: var(--body);
    background: var(--surface-2);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.identity-action-primary {
    border-color: rgba(34, 214, 95, .55);
    background: rgba(34, 214, 95, .075);
}

.identity-action > svg {
    width: 21px;
    height: 21px;
    color: var(--accent);
}

.identity-action > span {
    min-width: 0;
}

.identity-action strong,
.identity-action small {
    display: block;
    overflow-wrap: anywhere;
}

.identity-action strong {
    color: var(--heading);
    font-size: .82rem;
    line-height: 1.35;
}

.identity-action small {
    margin-top: 2px;
    color: var(--muted);
    font-size: .68rem;
    line-height: 1.35;
}

.identity-action > .identity-action-arrow {
    width: 17px;
    height: 17px;
    color: var(--subtle);
}

.identity-action:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.identity-action:focus-visible,
.identity-file:focus-within,
.identity-secondary:focus-visible,
.identity-enter:focus-visible,
.pgp-fallback summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.identity-action:disabled,
.identity-secondary:disabled,
.identity-enter:disabled {
    opacity: .5;
    cursor: wait;
}

.identity-separator {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    margin: 17px 0;
    color: var(--subtle);
    font-size: .65rem;
}

.identity-separator::before,
.identity-separator::after {
    height: 1px;
    background: var(--hairline);
    content: "";
}

.identity-file {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px dashed var(--hairline-strong);
    border-radius: 7px;
    color: var(--muted);
    background: transparent;
    font-size: .75rem;
    font-weight: 700;
    cursor: pointer;
}

.identity-file:hover {
    border-color: var(--accent);
    color: var(--heading);
}

.identity-file svg {
    width: 17px;
    height: 17px;
}

.identity-file input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.identity-ready {
    margin-top: 20px;
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
    padding: 18px 0;
}

.identity-ready-header {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.identity-ready-mark {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(34, 214, 95, .5);
    border-radius: 50%;
    color: var(--accent);
    background: var(--accent-soft);
}

.identity-ready-mark svg {
    width: 16px;
    height: 16px;
}

.identity-ready h2 {
    margin: 0 0 3px;
    color: var(--heading);
    font-size: .8rem;
}

.identity-ready code {
    display: block;
    overflow: hidden;
    color: var(--muted) !important;
    font-size: .65rem;
    text-overflow: ellipsis;
    text-shadow: none !important;
    white-space: nowrap;
}

.identity-security-note {
    margin: 13px 0;
    border-left: 2px solid #e4b84c;
    padding-left: 10px;
    color: #cabf9d;
    font-size: .7rem;
    line-height: 1.5;
}

.identity-secondary {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--hairline-strong);
    border-radius: 7px;
    padding: 7px 11px;
    color: var(--body);
    background: var(--surface-2);
    font: inherit;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
}

.identity-secondary svg {
    width: 16px;
    height: 16px;
}

.identity-confirm {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 14px 0;
    color: var(--body);
    font-size: .72rem;
    line-height: 1.4;
    cursor: pointer;
}

.identity-confirm[hidden] {
    display: none;
}

.identity-confirm input {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    margin: 1px 0 0;
    accent-color: var(--accent);
}

.identity-enter {
    display: flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--accent);
    border-radius: 7px;
    color: #031008;
    background: var(--accent);
    font: inherit;
    font-size: .78rem;
    font-weight: 780;
    cursor: pointer;
}

.identity-enter svg {
    width: 17px;
    height: 17px;
}

.identity-enter:disabled {
    border-color: var(--hairline-strong);
    color: var(--subtle);
    background: var(--surface-2);
    cursor: not-allowed;
}

.identity-status {
    min-height: 18px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: .7rem;
    line-height: 1.45;
}

.identity-status-error {
    color: #ff9bbb;
}

.pgp-fallback {
    margin-top: 6px;
    border-top: 1px solid var(--hairline);
    padding-top: 16px;
}

.pgp-fallback summary {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
}

.pgp-fallback[open] summary {
    color: var(--heading);
}

.pgp-fallback form {
    margin-top: 15px;
}

body:has(> main.identity-page) .back-link {
    margin-top: 17px;
}

@media (max-width: 540px) {
    body:has(> main.identity-page) {
        padding: 12px;
    }

    body:has(> main.form-page) > main.identity-page {
        border-right: 0;
        border-left: 0;
        padding: 20px 16px;
    }

    .identity-heading {
        margin-top: 24px;
    }

    .identity-action {
        padding-right: 11px;
        padding-left: 11px;
    }
}
