/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
    --blue:        #9600f7;
    --blue-dark:   #7300bc;
    --blue-light:  #f3e5ff;
    --dark:        #14171a;
    --medium:      #657786;
    --light:       #aab8c2;
    --extra-light: #e1e8ed;
    --off-white:   #f5f8fa;
    --white:       #ffffff;
    --red:         #e0245e;
    --red-light:   #fde8ef;
    --green:       #17bf63;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: var(--dark);
    background: var(--off-white);
    line-height: 1.4;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; font-size: inherit; }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.app-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    align-items: flex-start;
}

/* ── Left Sidebar ──────────────────────────────────────────────────────────── */
.sidebar-left {
    width: 260px;
    padding: 8px 12px 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.logo-link { display: block; }
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 9999px;
    color: var(--blue);
    transition: background 0.15s;
    margin-bottom: 4px;
}
.logo:hover { background: var(--blue-light); }
.logo-bird { width: 30px; height: 30px; flex-shrink: 0; } /* kept for safety */
.logo-text { font-size: 1.3rem; font-weight: 900; letter-spacing: -0.5px; }

.logo-mark {
    display: inline-flex; align-items: center;
    font-size: 1.55rem; font-weight: 900; flex-shrink: 0;
    line-height: 1; letter-spacing: -1px;
}
.logo-mark--auth { font-size: 2.2rem; }
.logo-diamond-char { display: inline-block; transform: scaleX(0.5); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 11px 16px;
    border-radius: 9999px;
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--dark);
    transition: background 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    text-align: left;
    width: 100%;
}
.nav-item:hover { background: var(--off-white); }
.nav-item.active { font-weight: 700; }
.nav-icon { width: 22px; height: 22px; flex-shrink: 0; }
.nav-logout { color: var(--medium); }
.nav-logout:hover { color: var(--red); background: var(--red-light); }

.compose-btn {
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 9999px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin: 8px 0 12px;
    transition: background 0.15s;
}
.compose-btn:hover { background: var(--blue-dark); }

.sidebar-profile-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 9999px;
    margin-top: auto;
    transition: background 0.15s;
    cursor: default;
}
.sidebar-profile-strip:hover { background: var(--off-white); }
.sidebar-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.sidebar-name   { font-size: 0.9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-handle { font-size: 0.82rem; color: var(--medium); }
.sidebar-profile-info { min-width: 0; }

.sidebar-cta-small { margin-top: auto; padding: 8px 4px; display: flex; flex-direction: column; }
.mt8 { margin-top: 8px; }

/* ── Main Content ──────────────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    max-width: 598px;
    min-width: 0;
    border-left: 1px solid var(--extra-light);
    border-right: 1px solid var(--extra-light);
    min-height: 100vh;
    background: var(--white);
}

.page-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 14px 16px;
    font-size: 1.1rem;
    font-weight: 800;
    border-bottom: 1px solid var(--extra-light);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-header-sub { font-size: 0.8rem; font-weight: 400; color: var(--medium); }

.back-btn {
    background: none; border: none; cursor: pointer; padding: 4px 8px;
    border-radius: 9999px; color: var(--dark); font-size: 1.1rem;
    transition: background 0.15s;
}
.back-btn:hover { background: var(--off-white); }

/* ── Compose Box ───────────────────────────────────────────────────────────── */
.compose-box {
    padding: 12px 16px;
    border-bottom: 1px solid var(--extra-light);
    display: flex;
    gap: 12px;
    background: var(--white);
}
.compose-avatar {
    width: 48px; height: 48px;
    border-radius: 50%; object-fit: cover; flex-shrink: 0;
    align-self: flex-start;
}
.compose-right { flex: 1; min-width: 0; }
.compose-textarea {
    width: 100%; border: none; outline: none;
    font-size: 1.1rem; resize: none; min-height: 72px;
    color: var(--dark); background: transparent;
    padding: 8px 0;
}
.compose-textarea::placeholder { color: var(--light); }
.compose-divider { border: none; border-top: 1px solid var(--extra-light); margin: 8px 0; }
.compose-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 6px;
}
.compose-tools { display: flex; align-items: center; gap: 4px; }
.compose-tool-btn {
    background: none; border: none; cursor: pointer;
    color: var(--blue); padding: 7px; border-radius: 50%;
    transition: background 0.15s; display: flex; align-items: center;
}
.compose-tool-btn:hover { background: var(--blue-light); }
.compose-tool-btn .nav-icon { width: 20px; height: 20px; }
.compose-tool-btn.has-image { color: #22c55e; position: relative; }
.compose-tool-btn.has-image::after {
    content: '✓';
    position: absolute; top: 2px; right: 2px;
    background: #22c55e; color: #fff; border-radius: 50%;
    width: 13px; height: 13px; font-size: 9px; font-weight: 700;
    line-height: 13px; text-align: center; pointer-events: none;
}

.char-counter {
    font-size: 0.85rem; color: var(--medium);
    min-width: 28px; text-align: right;
}
.char-counter.warning { color: #ffad1f; font-weight: 700; }
.char-counter.danger  { color: var(--red); font-weight: 700; }

.submit-btn {
    background: var(--blue); color: var(--white);
    border: none; border-radius: 9999px;
    padding: 8px 18px; font-weight: 700; cursor: pointer;
    transition: background 0.15s; white-space: nowrap;
}
.submit-btn:hover    { background: var(--blue-dark); }
.submit-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.image-preview { margin-top: 8px; position: relative; display: inline-block; max-width: 100%; }
.image-preview img { border-radius: 12px; border: 1px solid var(--extra-light); max-height: 280px; object-fit: cover; }
.image-preview-remove {
    position: absolute; top: 6px; right: 6px;
    background: rgba(0,0,0,0.55); color: var(--white);
    border: none; border-radius: 50%;
    width: 28px; height: 28px; cursor: pointer; font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.image-preview-remove:hover { background: rgba(0,0,0,0.75); }

/* ── Post Card ─────────────────────────────────────────────────────────────── */
.post-card {
    display: flex; gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--extra-light);
    transition: background 0.1s;
}
.post-card:hover { background: #f7f9fa; }
.post-avatar-link { flex-shrink: 0; }
.post-avatar {
    width: 48px; height: 48px;
    border-radius: 50%; object-fit: cover;
    transition: opacity 0.15s;
}
.post-avatar:hover { opacity: 0.85; }
.post-body-area { flex: 1; min-width: 0; }
.post-header {
    display: flex; align-items: baseline;
    flex-wrap: wrap; gap: 3px; margin-bottom: 4px;
}
.post-display-name { font-weight: 700; color: var(--dark); }
.post-display-name:hover { text-decoration: underline; }
.post-handle { color: var(--medium); font-size: 0.9rem; }
.post-dot    { color: var(--medium); }
.post-time   { color: var(--medium); font-size: 0.9rem; }
.post-content { color: var(--dark); line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.post-content .hashtag  { color: var(--blue); }
.post-content .hashtag:hover  { text-decoration: underline; }
.post-content .mention  { color: var(--blue); }
.post-content .mention:hover  { text-decoration: underline; }
.post-content .post-link { color: var(--blue); }
.post-content .post-link:hover { text-decoration: underline; }
.post-image { margin-top: 10px; }
.post-image img { border-radius: 14px; border: 1px solid var(--extra-light); max-height: 500px; object-fit: cover; width: 100%; }

.post-actions { display: flex; gap: 0; margin-top: 10px; }
.action-btn {
    background: none; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 5px;
    color: var(--medium); font-size: 0.88rem;
    padding: 5px 10px; border-radius: 9999px;
    transition: all 0.15s; font-weight: 400;
}
.action-btn:hover { background: var(--red-light); color: var(--red); }
.action-btn.liked { color: var(--red); }
.action-btn.liked .heart-icon { fill: var(--red); }
.heart-icon { width: 18px; height: 18px; fill: currentColor; }
.action-btn-static {
    display: flex; align-items: center; gap: 5px;
    color: var(--medium); font-size: 0.88rem;
    padding: 5px 10px;
}
.action-btn-static .heart-icon { width: 18px; height: 18px; fill: currentColor; }
.like-form { display: inline-flex; }

/* ── Post menu (···) ───────────────────────────────────────────────────────── */
.post-menu-wrap { position: relative; margin-left: auto; }
.post-menu-btn {
    background: none; border: none; cursor: pointer;
    color: var(--medium); font-size: 1.1rem; padding: 4px 8px;
    border-radius: 9999px; line-height: 1; transition: background .15s, color .15s;
}
.post-menu-btn:hover { background: var(--extra-light); color: var(--dark); }
.post-menu-dropdown {
    display: none; position: absolute; right: 0; top: 100%;
    background: var(--white); border: 1px solid var(--extra-light);
    border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
    min-width: 180px; z-index: 200; overflow: hidden;
}
.post-menu-dropdown.open { display: block; }
.post-menu-item {
    display: block; padding: 12px 16px; color: var(--dark);
    text-decoration: none; font-size: .9rem; cursor: pointer;
    background: none; border: none; width: 100%; text-align: left;
    transition: background .12s;
}
.post-menu-item:hover { background: var(--off-white); }
.post-menu-item.danger { color: var(--red); font-weight: 600; }
.post-menu-item.danger:hover { background: var(--red-light); }
.post-menu-item-form { margin: 0; }

/* ── Profile action buttons ────────────────────────────────────────────────── */
.profile-action-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-danger-outline {
    border-color: var(--red) !important;
    color: var(--red) !important;
}
.btn-danger-outline:hover { background: var(--red-light) !important; }
.blocked-notice {
    margin: 8px 0 0;
    color: var(--medium);
    font-size: .88rem;
    padding: 8px 12px;
    background: var(--off-white);
    border-radius: 8px;
    border: 1px solid var(--extra-light);
}

/* ── Flash message ─────────────────────────────────────────────────────────── */
.flash {
    padding: 12px 16px;
    margin: 0;
    font-size: .9rem;
    border-bottom: 1px solid transparent;
}
.flash-info { background: #e8f4fd; color: #0c5460; border-color: #bee5eb; }
.flash-error { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }

/* ── Report form ───────────────────────────────────────────────────────────── */
.report-option {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-radius: 8px; cursor: pointer;
    transition: background .12s; margin-bottom: 2px;
}
.report-option:hover { background: var(--off-white); }
.report-option input[type=radio] { accent-color: var(--blue); width: 16px; height: 16px; flex-shrink: 0; }

/* ── Verified badge ────────────────────────────────────────────────────────── */
.verified-badge {
    display: inline-block;
    width: 18px; height: 18px;
    vertical-align: middle;
    margin-left: 4px;
    flex-shrink: 0;
}
.post-display-name .verified-badge { width: 16px; height: 16px; }
.profile-display-name .verified-badge { width: 22px; height: 22px; }

/* ── Verification nudge on profile ────────────────────────────────────────── */
.verify-nudge { margin: 6px 0 2px; font-size: .85rem; }
.verify-nudge-link { color: var(--blue); text-decoration: none; display: inline-flex; align-items: center; }
.verify-nudge-link:hover { text-decoration: underline; }
.verify-status-pending { color: var(--medium); font-style: italic; }

/* ── Verification apply form ──────────────────────────────────────────────── */
.verify-intro { background: var(--off-white); border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; font-size: .9rem; line-height: 1.5; }
.verify-intro p { margin: 0 0 8px; }
.verify-intro p:last-child { margin-bottom: 0; }

.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-option {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 14px; border-radius: 8px; cursor: pointer;
    border: 1px solid var(--extra-light); transition: border-color .15s, background .15s;
}
.radio-option:hover { border-color: var(--blue); background: var(--off-white); }
.radio-option input[type=radio] { margin-top: 3px; accent-color: var(--blue); flex-shrink: 0; }
.radio-option span { display: flex; flex-direction: column; gap: 2px; }
.radio-option strong { font-size: .95rem; }
.radio-option small { color: var(--medium); font-size: .82rem; }

/* ── FAQ page ──────────────────────────────────────────────────────────────── */
.faq-wrap { padding: 0 0 40px; max-width: 680px; }
.faq-section { padding: 24px 16px 0; }
.faq-section-title {
    font-size: 1.1rem; font-weight: 800; margin: 0 0 16px;
    padding-bottom: 10px; border-bottom: 1px solid var(--extra-light);
    display: flex; align-items: center;
}
.faq-item { padding: 14px 0; border-bottom: 1px solid var(--extra-light); }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-weight: 700; font-size: .95rem; margin-bottom: 6px; cursor: pointer; }
.faq-a { color: var(--medium); font-size: .9rem; line-height: 1.55; }
.faq-a p { margin: 0 0 8px; }
.faq-a p:last-child { margin-bottom: 0; }

/* ── Policy pages (Terms, Privacy, etc.) ─────────────────────────────────── */
.policy-wrap {
    max-width: 680px;
    padding: 0 16px 60px;
}
.policy-updated {
    font-size: 0.82rem; color: var(--medium); margin: 8px 0 20px;
}
.policy-intro {
    font-size: 0.92rem; line-height: 1.65; color: var(--dark);
    margin-bottom: 14px;
}
.policy-section {
    padding: 24px 0 0;
    border-top: 1px solid var(--extra-light);
    margin-top: 8px;
}
.policy-section:first-of-type { border-top: none; }
.policy-section-title {
    font-size: 1rem; font-weight: 800;
    margin: 0 0 14px; color: var(--dark);
}
.policy-section p {
    font-size: 0.9rem; line-height: 1.65; color: var(--medium);
    margin: 0 0 12px;
}
.policy-section p:last-child { margin-bottom: 0; }
.policy-list {
    font-size: 0.9rem; line-height: 1.65; color: var(--medium);
    padding-left: 22px; margin: 10px 0;
}
.policy-list li { margin-bottom: 8px; }
.policy-list--alpha { list-style-type: lower-alpha; }
.policy-link { color: var(--blue); text-decoration: underline; }
.policy-link:hover { color: var(--blue-dark); }
.policy-contact {
    font-size: 0.9rem; line-height: 2; color: var(--medium);
    background: var(--off-white); border-radius: 8px;
    padding: 14px 18px; display: inline-block; margin-top: 8px;
}

.policy-callout {
    background: var(--blue-light);
    border-left: 4px solid var(--blue);
    border-radius: 0 8px 8px 0;
    padding: 14px 16px;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--dark);
    margin-bottom: 14px;
    font-weight: 500;
}

[data-theme="dark"] .policy-section  { border-color: #38444d; }
[data-theme="dark"] .policy-callout  { color: var(--dark); }

/* ── Notification badge on bell icon ──────────────────────────────────────── */
.notif-badge {
    position: absolute;
    top: 6px; left: 28px;
    background: var(--red);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
}

/* ── Notification list items ──────────────────────────────────────────────── */
.notif-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--extra-light);
    color: var(--dark);
    text-decoration: none;
    transition: background .12s;
}
.notif-item:hover { background: var(--off-white); }
.notif-icon-wrap { position: relative; flex-shrink: 0; }
.notif-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.notif-type-icon {
    position: absolute;
    bottom: -2px; right: -4px;
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}
.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: .92rem; line-height: 1.35; }
.notif-time { font-size: .8rem; color: var(--medium); margin-top: 3px; }

/* ── Settings section headings ────────────────────────────────────────────── */
.settings-section { padding: 20px 0 8px; }
.settings-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}
.settings-hint { font-size: .88rem; color: var(--medium); line-height: 1.45; margin-bottom: 4px; }

/* ── Right Sidebar ─────────────────────────────────────────────────────────── */
.sidebar-right {
    width: 348px;
    padding: 16px 16px 24px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-card {
    background: var(--off-white);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.sidebar-card-title { font-size: 1.05rem; font-weight: 800; margin-bottom: 10px; }

.trending-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0;
    border-top: 1px solid var(--extra-light);
    color: var(--dark);
    transition: background 0.1s;
}
.trending-item:first-of-type { border-top: none; }
.trending-item:hover .trending-hash { text-decoration: underline; }
.trending-hash  { font-weight: 700; font-size: 0.92rem; }
.trending-count { color: var(--medium); font-size: 0.8rem; }

.suggest-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 0; border-top: 1px solid var(--extra-light);
}
.suggest-item:first-of-type { border-top: none; }
.suggest-link {
    display: flex; align-items: center;
    gap: 8px; flex: 1; min-width: 0;
}
.suggest-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.suggest-info { min-width: 0; }
.suggest-name   { font-weight: 700; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-handle { color: var(--medium); font-size: 0.8rem; }

.sidebar-cta h3 { margin-bottom: 6px; }
.sidebar-cta p  { color: var(--medium); font-size: 0.88rem; margin-bottom: 12px; }

.sidebar-footer { color: var(--light); font-size: 0.78rem; padding: 4px 0; }
.sidebar-footer a { color: var(--light); }
.sidebar-footer a:hover { text-decoration: underline; }
.sidebar-footer p { margin-top: 4px; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 20px; border-radius: 9999px;
    font-weight: 700; cursor: pointer; border: 1px solid transparent;
    transition: all 0.15s; font-size: 0.95rem; text-decoration: none;
}
.btn-primary  { background: var(--blue); color: var(--white); border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: var(--white); }
.btn-dark     { background: var(--dark); color: var(--white); border-color: var(--dark); }
.btn-dark:hover { background: #2a2a2a; color: var(--white); }
.btn-outline  { background: transparent; color: var(--dark); border-color: var(--extra-light); }
.btn-outline:hover { background: var(--off-white); }
.btn-outline-blue { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-outline-blue:hover { background: var(--blue-light); }
.btn-full { display: flex; width: 100%; }
.btn-sm   { padding: 6px 14px; font-size: 0.88rem; }

/* Follow button */
.follow-btn {
    background: var(--dark); color: var(--white);
    border: 1px solid var(--dark); border-radius: 9999px;
    padding: 6px 14px; font-weight: 700; cursor: pointer;
    font-size: 0.85rem; white-space: nowrap; flex-shrink: 0;
    transition: all 0.15s;
}
.follow-btn:hover { background: #2a2a2a; }
.follow-btn.following {
    background: transparent; color: var(--dark);
    border-color: var(--light);
}
.follow-btn.following:hover {
    background: var(--red-light); border-color: var(--red); color: var(--red);
}
.follow-btn.follow-blue {
    background: var(--blue); border-color: var(--blue); color: var(--white);
}
.follow-btn.follow-blue:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

/* ── Profile Page ──────────────────────────────────────────────────────────── */
.profile-banner {
    height: 196px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    background-size: cover; background-position: center;
}
.profile-info-area {
    padding: 14px 16px 16px;
    border-bottom: 1px solid var(--extra-light);
}
.profile-avatar-row {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 12px;
}
.profile-page-avatar {
    width: 84px; height: 84px;
    border-radius: 50%; object-fit: cover;
    border: 4px solid var(--white);
    margin-top: -42px;
    background: var(--white);
}
.profile-display-name { font-size: 1.2rem; font-weight: 800; margin-bottom: 2px; }
.profile-handle { color: var(--medium); margin-bottom: 8px; }
.profile-bio { margin-bottom: 10px; line-height: 1.5; color: var(--dark); }
.profile-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.profile-stat { font-size: 0.92rem; }
.profile-stat strong { font-weight: 700; }
.profile-stat span   { color: var(--medium); }
.profile-stat a:hover { text-decoration: underline; }

.profile-private-notice {
    text-align: center; padding: 56px 24px;
}
.padlock-icon { font-size: 2.5rem; margin-bottom: 14px; display: block; }
.profile-private-notice h2 { font-size: 1.2rem; margin-bottom: 8px; }
.profile-private-notice p  { color: var(--medium); line-height: 1.5; }

/* ── Auth Forms ────────────────────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px 80px;
    background: var(--white);
}
.auth-box {
    width: 100%; max-width: 400px;
}
.auth-logo {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; margin-bottom: 28px; color: var(--blue);
}
.auth-logo svg, .auth-logo .logo-mark { width: 36px; height: 36px; }
.auth-logo-text { font-size: 1.5rem; font-weight: 900; }
.auth-title { font-size: 1.6rem; font-weight: 900; margin-bottom: 6px; }
.auth-sub   { color: var(--medium); margin-bottom: 24px; }

.form-group { margin-bottom: 14px; }
.form-label {
    display: block; font-size: 0.82rem; font-weight: 700;
    color: var(--medium); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.3px;
}
.form-input {
    width: 100%; padding: 11px 14px;
    border: 2px solid var(--extra-light); border-radius: 6px;
    font-size: 1rem; color: var(--dark); background: var(--white);
    transition: border-color 0.15s; outline: none;
}
.form-input:focus { border-color: var(--blue); }
.form-input.error { border-color: var(--red); }
.form-hint  { font-size: 0.8rem; color: var(--medium); margin-top: 3px; }
.form-error { font-size: 0.85rem; color: var(--red); margin-top: 4px; }

.form-footer { margin-top: 20px; text-align: center; color: var(--medium); font-size: 0.9rem; }
.form-footer a { color: var(--blue); font-weight: 700; }
.form-footer a:hover { text-decoration: underline; }

.flash {
    padding: 12px 16px; border-radius: 8px; margin-bottom: 16px;
    font-size: 0.92rem;
}
.flash-error   { background: var(--red-light); color: var(--red); }
.flash-success { background: #e3f9e5; color: #1a7a2a; }

/* ── Profile Create/Edit ───────────────────────────────────────────────────── */
.inner-form {
    padding: 20px 16px;
}
.upload-progress-wrap {
    margin-bottom: 14px; border-radius: 6px; overflow: hidden;
    background: var(--extra-light); position: relative; height: 6px;
}
.upload-progress-bar {
    height: 100%; width: 0%; background: var(--blue);
    transition: width 0.15s ease;
}
.upload-progress-label {
    position: absolute; top: 10px; left: 0; right: 0;
    font-size: 0.8rem; color: var(--medium); text-align: center;
}
.upload-progress-wrap.active { height: 28px; }
.banner-edit-wrap { margin-bottom: 4px; }
.banner-edit-preview {
    height: 140px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    background-size: cover; background-position: center;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    user-select: none;
}
.banner-edit-preview.has-image  { cursor: grab; }
.banner-edit-preview.dragging   { cursor: grabbing; }
.banner-drag-hint {
    position: absolute; bottom: 10px; left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.55); color: #fff;
    font-size: 0.72rem; font-weight: 500;
    padding: 4px 12px; border-radius: 20px;
    pointer-events: none; white-space: nowrap;
    opacity: 0; transition: opacity 0.2s;
    z-index: 1;
}
.banner-edit-preview.has-image .banner-drag-hint  { opacity: 1; }
.banner-edit-preview.dragging  .banner-drag-hint  { opacity: 0; }
.banner-edit-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex; align-items: center; justify-content: center; gap: 10px;
    opacity: 0; transition: opacity 0.18s;
    z-index: 2;
}
.banner-edit-preview:hover .banner-edit-overlay { opacity: 1; }
.banner-edit-preview.dragging .banner-edit-overlay { opacity: 0; }
.banner-edit-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(0,0,0,0.65); color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 6px; padding: 7px 13px;
    font-size: 0.83rem; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: background 0.15s;
}
.banner-edit-btn:hover { background: rgba(0,0,0,0.85); }
.banner-remove-btn { background: rgba(180,20,20,0.7); border-color: rgba(255,100,100,0.5); }
.banner-remove-btn:hover { background: rgba(180,20,20,0.95); }

.avatar-upload-row {
    display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
}
.avatar-preview-lg {
    width: 68px; height: 68px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--extra-light); flex-shrink: 0;
}
.toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; border-top: 1px solid var(--extra-light);
}
.toggle-info strong { display: block; font-size: 0.95rem; }
.toggle-info span   { font-size: 0.85rem; color: var(--medium); }
.toggle-switch { position: relative; width: 46px; height: 26px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; background: var(--extra-light);
    border-radius: 9999px; transition: 0.2s;
}
.toggle-slider::before {
    content: ''; position: absolute;
    width: 20px; height: 20px; left: 3px; bottom: 3px;
    background: white; border-radius: 50%; transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--blue); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Profile Switch ────────────────────────────────────────────────────────── */
.profile-list { list-style: none; }
.profile-list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--extra-light);
    cursor: pointer; transition: background 0.1s;
}
.profile-list-item:hover { background: var(--off-white); }
.profile-list-item.is-active { background: var(--blue-light); }
.pli-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.pli-info   { flex: 1; min-width: 0; }
.pli-name   { font-weight: 700; }
.pli-handle { color: var(--medium); font-size: 0.88rem; }
.pli-badge  {
    background: var(--blue); color: white;
    border-radius: 9999px; padding: 2px 10px;
    font-size: 0.78rem; font-weight: 700; flex-shrink: 0;
}

/* ── Modal Compose ─────────────────────────────────────────────────────────── */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.52); z-index: 100;
    align-items: flex-start; justify-content: center;
    padding-top: 56px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--white); border-radius: 16px;
    width: 100%; max-width: 580px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    overflow: hidden;
}
.modal-header {
    display: flex; align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--extra-light);
}
.modal-close {
    background: none; border: none; cursor: pointer;
    font-size: 1rem; color: var(--dark);
    padding: 5px 9px; border-radius: 50%;
    transition: background 0.15s;
}
.modal-close:hover { background: var(--off-white); }
.modal-body { padding: 0; }
.compose-box--modal { border-bottom: none; }

/* ── Empty State ───────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 60px 24px;
    color: var(--medium);
}
.empty-state h3 { font-size: 1.4rem; font-weight: 800; color: var(--dark); margin-bottom: 6px; }
.empty-state p  { line-height: 1.5; }
.empty-state .btn { margin-top: 16px; }

/* ── Hashtag Page Header ───────────────────────────────────────────────────── */
.tag-hero {
    padding: 24px 16px 20px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    color: white;
}
.tag-hero h1 { font-size: 1.6rem; font-weight: 900; margin-bottom: 4px; }
.tag-hero p  { font-size: 0.9rem; opacity: 0.85; }

/* ── Pagination ────────────────────────────────────────────────────────────── */
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 8px; padding: 24px 16px;
}
.pagination a, .pagination span {
    padding: 7px 14px; border-radius: 9999px;
    border: 1px solid var(--extra-light); font-weight: 600; font-size: 0.9rem;
}
.pagination a { color: var(--blue); transition: background 0.15s; }
.pagination a:hover { background: var(--blue-light); }
.pagination span { background: var(--blue); color: white; border-color: var(--blue); }

/* ── Dividers ──────────────────────────────────────────────────────────────── */
hr.divider { border: none; border-top: 1px solid var(--extra-light); }
.section-title {
    padding: 12px 16px 0; font-size: 0.8rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--medium);
}

/* ── Dark theme ────────────────────────────────────────────────────────────── */

/* Theme icon: show moon in light mode (click → go dark), sun in dark mode (click → go light) */
.theme-icon-sun                      { display: none; }
[data-theme="dark"] .theme-icon-sun  { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }

[data-theme="dark"] {
    --blue:        #9600f7;
    --blue-dark:   #7300bc;
    --blue-light:  #1e0035;
    --dark:        #e7e9ea;
    --medium:      #8899a6;
    --light:       #536471;
    --extra-light: #38444d;
    --off-white:   #192734;
    --white:       #1e2732;
    --red:         #f4212e;
    --red-light:   #2d1015;
    --green:       #00ba7c;
}

[data-theme="dark"] body       { background: #0f1923; }
[data-theme="dark"] .auth-page { background: #0f1923; }

/* Hardcoded hover colours */
[data-theme="dark"] .post-card:hover            { background: #1c2938; }
[data-theme="dark"] .profile-list-item:hover    { background: #1c2938; }
[data-theme="dark"] .sidebar-profile-strip:hover { background: #1c2938; }
[data-theme="dark"] .nav-item:hover             { background: #1c2938; }
[data-theme="dark"] .nav-logout:hover           { color: var(--red); background: var(--red-light); }
[data-theme="dark"] .logo:hover                 { background: var(--blue-light); }
[data-theme="dark"] .modal-close:hover          { background: #1c2938; }
[data-theme="dark"] .follow-btn:not(.following):not(.follow-blue):hover { background: #38444d; }
[data-theme="dark"] .btn-dark:hover             { background: #38444d; }

/* Page header backdrop blur */
[data-theme="dark"] .page-header { background: rgba(15, 25, 35, 0.88); }

/* Toggle slider dot */
[data-theme="dark"] .toggle-slider::before { background: #e7e9ea; }

/* Success flash */
[data-theme="dark"] .flash-success { background: #0c2318; color: #4caf6e; }

/* Browser autofill override */
[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px #1e2732 inset !important;
    -webkit-text-fill-color: #e7e9ea !important;
}

/* ── Mobile elements (hidden on desktop) ───────────────────────────────────── */
.mobile-topbar      { display: none; }
.mobile-nav-footer  { display: none; }
.mobile-more-overlay { display: none; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1060px) {
    .sidebar-right { display: none; }
    .main-content  { border-right: none; max-width: none; flex: 1; }
}

@media (max-width: 700px) {
    /* Hide the desktop left sidebar entirely */
    .sidebar-left { display: none; }

    /* Shift main content clear of the fixed top bar and bottom nav */
    .main-content { padding-top: 52px; padding-bottom: 60px; }

    /* Sticky page-header must sit below the mobile top bar */
    .page-header { top: 52px; }

    /* ── Mobile top bar ─────────────────────────────────── */
    .mobile-topbar {
        display: flex;
        position: fixed;
        top: 0; left: 0; right: 0;
        height: 52px;
        background: rgba(255,255,255,0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--extra-light);
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        z-index: 50;
    }
    .mobile-logo {
        display: flex; align-items: center; gap: 7px;
        color: var(--blue); font-weight: 900; font-size: 1.15rem; text-decoration: none;
    }
    .mobile-logo .logo-mark { font-size: 1.3rem; }
    .mobile-topbar-avatar {
        width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
        border: 2px solid var(--extra-light);
    }

    /* ── Mobile bottom nav ──────────────────────────────── */
    .mobile-nav-footer {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 60px;
        background: var(--white);
        border-top: 1px solid var(--extra-light);
        align-items: stretch;
        z-index: 50;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .mobile-nav-item {
        flex: 1;
        display: flex; flex-direction: column;
        align-items: center; justify-content: center;
        gap: 2px;
        color: var(--medium);
        font-size: 0.65rem; font-weight: 500;
        text-decoration: none;
        background: none; border: none;
        cursor: pointer; padding: 6px 2px;
        transition: color 0.15s; position: relative;
    }
    .mobile-nav-item.active { color: var(--blue); }
    .mobile-nav-item .nav-icon { width: 24px; height: 24px; }

    /* Compose tab — blue circle, no text */
    .mobile-nav-compose { flex: 1.2; color: var(--dark); }
    .mobile-compose-circle {
        width: 46px; height: 46px;
        background: var(--blue); border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        transition: background 0.15s;
    }
    .mobile-compose-circle .nav-icon { width: 22px; height: 22px; stroke: #fff; }
    .mobile-nav-compose:hover .mobile-compose-circle { background: var(--blue-dark); }

    /* Notification badge in mobile nav */
    .mobile-nav-icon-wrap {
        position: relative; display: inline-flex;
        align-items: center; justify-content: center;
    }
    .mobile-notif-badge {
        position: absolute; top: -4px; right: -7px;
        background: var(--red); color: #fff;
        font-size: .6rem; font-weight: 700;
        min-width: 14px; height: 14px; border-radius: 999px;
        padding: 0 3px; display: flex;
        align-items: center; justify-content: center;
        pointer-events: none;
    }

    /* ── More drawer ────────────────────────────────────── */
    .mobile-more-overlay {
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.48);
        z-index: 200; align-items: flex-end;
    }
    .mobile-more-overlay.open { display: flex; }

    .mobile-more-sheet {
        background: var(--white);
        border-radius: 20px 20px 0 0;
        width: 100%; max-height: 80vh; overflow-y: auto;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
        animation: mobileSheetUp 0.22s ease;
    }
    @keyframes mobileSheetUp {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .mobile-more-handle {
        width: 36px; height: 4px; background: var(--extra-light);
        border-radius: 2px; margin: 12px auto 8px;
    }
    .mobile-more-item {
        display: flex; align-items: center; gap: 14px;
        padding: 15px 20px; color: var(--dark); text-decoration: none;
        font-size: 1rem; font-weight: 500;
        background: none; border: none; width: 100%;
        text-align: left; cursor: pointer; transition: background 0.12s;
    }
    .mobile-more-item:hover { background: var(--off-white); }
    .mobile-more-item.danger { color: var(--red); }
    .mobile-more-item .nav-icon { width: 22px; height: 22px; flex-shrink: 0; }
}

/* ── Dark mode: mobile elements ────────────────────────────────────────────── */
[data-theme="dark"] .mobile-topbar {
    background: rgba(15,25,35,0.95);
}
[data-theme="dark"] .mobile-nav-footer {
    background: var(--white);
    border-color: var(--extra-light);
}
[data-theme="dark"] .mobile-more-sheet {
    background: var(--white);
}
[data-theme="dark"] .mobile-more-item:hover { background: #1c2938; }

[data-theme="dark"] .verify-intro       { background: #1c2938; }
[data-theme="dark"] .radio-option       { border-color: #38444d; }
[data-theme="dark"] .radio-option:hover { border-color: var(--blue); background: #1c2938; }
[data-theme="dark"] .faq-section-title  { border-color: #38444d; }
[data-theme="dark"] .faq-item           { border-color: #38444d; }
[data-theme="dark"] .flash-info         { background: #0c2135; color: #7ec8e3; border-color: #1a4a6b; }

[data-theme="dark"] .notif-item:hover  { background: #1c2938; }
[data-theme="dark"] .notif-type-icon   { border-color: var(--white); }

/* ── API Tokens page ─────────────────────────────────────────────────────────── */
.api-token-reveal {
    background: #fffbe6; border: 1px solid #f0c040; border-radius: 10px;
    padding: 14px 16px; margin-bottom: 20px;
}
.api-token-reveal-label { font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; }
.api-token-value {
    font-family: monospace; font-size: 0.88rem; word-break: break-all;
    background: #fff; border: 1px solid #e8d88a; border-radius: 6px;
    padding: 8px 10px; margin-bottom: 8px; user-select: all;
}
.api-token-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.api-token-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border: 1px solid var(--extra-light); border-radius: 8px; padding: 10px 14px;
}
.api-token-info { display: flex; flex-direction: column; gap: 2px; }
.api-token-info strong { font-size: 0.95rem; }
.api-token-info span   { font-size: 0.8rem; color: var(--medium); }
.btn-danger-outline {
    border: 1px solid var(--red); color: var(--red); background: transparent;
    border-radius: 6px; padding: 5px 12px; font-size: 0.82rem; cursor: pointer;
    white-space: nowrap;
}
.btn-danger-outline:hover { background: var(--red-light); }
.api-inline {
    font-family: monospace; font-size: 0.85em;
    background: var(--off-white); border: 1px solid var(--extra-light);
    border-radius: 4px; padding: 1px 5px;
}
.api-ref-table { display: flex; flex-direction: column; border: 1px solid var(--extra-light); border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.api-ref-row { display: grid; grid-template-columns: 80px 1fr 2fr; gap: 12px; padding: 9px 14px; font-size: 0.85rem; border-bottom: 1px solid var(--extra-light); align-items: center; }
.api-ref-row:last-child { border-bottom: none; }
.api-ref-header { background: var(--off-white); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--medium); }
.api-method { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 0.75rem; font-weight: 700; font-family: monospace; }
.api-method.get    { background: #e3f5e3; color: #1a7a2a; }
.api-method.post   { background: #f3e5ff; color: #7300bc; }
.api-method.delete { background: #fce8e8; color: #c0392b; }
.api-param { color: var(--medium); font-size: 0.8em; }
.shortcut-guide { padding-left: 20px; }
.shortcut-guide li { margin-bottom: 12px; font-size: 0.9rem; line-height: 1.5; }
.shortcut-guide ul { margin-top: 6px; padding-left: 18px; }
.shortcut-guide ul li { margin-bottom: 4px; }

[data-theme="dark"] .api-token-reveal { background: #2d2600; border-color: #6b5a00; }
[data-theme="dark"] .api-token-value  { background: #1a1a00; border-color: #6b5a00; }
[data-theme="dark"] .api-token-row    { border-color: var(--extra-light); }
[data-theme="dark"] .api-ref-header   { background: #1c2938; }
[data-theme="dark"] .api-method.get    { background: #0c2318; color: #4caf6e; }
[data-theme="dark"] .api-method.post   { background: #1e0035; color: #cb7aff; }
[data-theme="dark"] .api-method.delete { background: #350c0c; color: #f08080; }

/* ── Location compose strip & post display ───────────────────────────────────── */
.compose-loc-btn { color: var(--medium); transition: color 0.15s, opacity 0.15s; }
.compose-loc-btn:hover { color: var(--blue); background: var(--blue-light); }
.compose-loc-btn.compose-loc-active { color: var(--blue); }
.compose-loc-btn.compose-loc-active svg { fill: var(--blue); stroke: var(--blue); }
.compose-loc-btn.compose-loc-loading { cursor: wait; animation: loc-pulse 0.8s ease-in-out infinite; }
@keyframes loc-pulse {
    0%, 100% { opacity: 0.35; }
    50%       { opacity: 1; }
}

.compose-location-row {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.8rem; color: var(--blue);
    padding: 4px 0 2px; margin-bottom: 2px;
}

.post-location {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.78rem; color: var(--medium);
    margin-top: 6px;
}
.post-location svg { width: 11px; height: 11px; color: var(--blue); stroke: var(--blue); flex-shrink: 0; }

/* ── Delete account page ─────────────────────────────────────────────────────── */
.btn-danger {
    background: var(--red); color: #fff;
    border: 1px solid var(--red); border-radius: 9999px;
    padding: 10px 20px; font-size: 0.95rem; font-weight: 700;
    cursor: pointer; transition: background 0.15s; display: inline-block;
    text-align: center;
}
.btn-danger:hover { background: #c0392b; border-color: #c0392b; }
.btn-danger.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-danger.btn-full { width: 100%; box-sizing: border-box; display: block; }

.delete-warning-box {
    display: flex; gap: 16px; align-items: flex-start;
    background: var(--red-light); border: 1px solid var(--red);
    border-radius: 10px; padding: 16px;
    font-size: 0.9rem; line-height: 1.55;
}
.delete-warning-box strong { display: block; font-size: 1rem; margin-bottom: 8px; color: var(--red); }
.delete-warning-box ul { margin: 8px 0 0; padding-left: 18px; color: var(--dark); }
.delete-warning-box ul li { margin-bottom: 4px; }
.delete-warning-box p { margin: 0; color: var(--dark); }
.delete-warning-icon {
    width: 32px; height: 32px; flex-shrink: 0;
    color: var(--red); margin-top: 2px;
}

.delete-step-label {
    font-size: 0.95rem; font-weight: 700; margin-bottom: 4px;
    display: flex; align-items: center; gap: 10px;
}
.delete-step-num {
    font-size: 0.75rem; font-weight: 700; background: var(--red);
    color: #fff; border-radius: 9999px; padding: 2px 9px;
}
.delete-confirm-input {
    font-family: monospace; font-size: 1rem; letter-spacing: 0.05em;
    text-align: center;
}

/* ── Focus compose page ──────────────────────────────────────────────────────── */
.focus-compose-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--off-white);
}

/* Top bar */
.focus-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--extra-light);
    position: sticky;
    top: 0;
    background: var(--off-white);
    z-index: 10;
}
.focus-home-link { display: flex; align-items: center; text-decoration: none; }
.focus-topbar-right { display: flex; align-items: center; gap: 8px; }
.focus-theme-btn {
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer;
    color: var(--medium); border-radius: 50%;
    width: 38px; height: 38px;
    transition: background 0.15s, color 0.15s;
}
.focus-theme-btn:hover { background: var(--blue-light); color: var(--blue); }
.focus-theme-btn svg { width: 20px; height: 20px; }
[data-theme="dark"] .theme-icon-sun  { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none;  }
.theme-icon-sun  { display: none;  }
.theme-icon-moon { display: block; }

/* Main compose area */
.focus-main {
    flex: 1;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 20px 40px;
    box-sizing: border-box;
}

.focus-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.focus-avatar {
    width: 44px; height: 44px;
    border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.focus-author-name {
    font-weight: 700; font-size: 1rem; color: var(--dark);
    display: flex; flex-direction: column; gap: 1px;
}
.focus-author-name span { font-weight: 400; font-size: 0.85rem; color: var(--medium); }

.focus-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 220px;
    border: none;
    outline: none;
    resize: none;
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--dark);
    background: transparent;
    font-family: inherit;
    padding: 0;
    overflow: hidden;
}
.focus-textarea::placeholder { color: var(--light); }

/* Image preview */
.focus-img-preview {
    position: relative;
    margin: 12px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--extra-light);
}
.focus-img-preview img {
    width: 100%; max-height: 400px;
    object-fit: cover; display: block;
}
.focus-img-remove {
    position: absolute; top: 8px; right: 8px;
    background: rgba(0,0,0,0.55); color: #fff;
    border: none; border-radius: 50%;
    width: 28px; height: 28px; font-size: 0.75rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.focus-img-remove:hover { background: rgba(0,0,0,0.8); }

/* Footer: tools + submit */
.focus-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    margin-top: 8px;
    border-top: 1px solid var(--extra-light);
}
.focus-tools { display: flex; align-items: center; gap: 4px; }
.focus-tool-btn {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    color: var(--blue); cursor: pointer;
    transition: background 0.15s;
}
.focus-tool-btn:hover { background: var(--blue-light); }
.focus-tool-btn.has-image { color: #22c55e; position: relative; }
.focus-tool-btn.has-image::after {
    content: '✓';
    position: absolute; top: 2px; right: 2px;
    background: #22c55e; color: #fff; border-radius: 50%;
    width: 13px; height: 13px; font-size: 9px; font-weight: 700;
    line-height: 13px; text-align: center; pointer-events: none;
}

/* Circular progress counter */
.focus-counter-wrap {
    position: relative;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    margin-left: 6px;
}
.focus-counter-ring { width: 32px; height: 32px; }
.focus-ring-bg   { stroke: var(--extra-light); }
.focus-ring-fill { stroke: var(--blue); transition: stroke-dashoffset 0.1s, stroke 0.1s; }
.focus-counter-num {
    position: absolute;
    font-size: 0.65rem; font-weight: 700;
    color: var(--medium);
    line-height: 1;
}

/* Submit button */
.focus-submit {
    background: var(--blue); color: #fff;
    border: none; border-radius: 9999px;
    padding: 10px 24px;
    font-size: 1rem; font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.focus-submit:hover:not(:disabled) { background: var(--blue-dark); }
.focus-submit:disabled { opacity: 0.45; cursor: default; }

/* Dark mode overrides */
[data-theme="dark"] .focus-topbar    { background: var(--off-white); border-color: var(--extra-light); }
[data-theme="dark"] .focus-textarea  { color: var(--dark); }

/* Fullscreen compose overlay (home page tap-to-expand) */
.fc-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: var(--off-white);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}
.fc-overlay.open { transform: translateY(0); }
.fc-overlay-close {
    background: none; border: none; cursor: pointer;
    color: var(--dark); border-radius: 50%;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.fc-overlay-close:hover { background: var(--extra-light); }

/* Mobile tweaks */
@media (max-width: 600px) {
    .focus-main    { padding: 20px 16px 32px; }
    .focus-textarea { font-size: 1.1rem; min-height: 180px; }
    .focus-topbar  { padding: 10px 16px; }
}
