/* ============================================================
    FlatUI Monochrome - Journal
   ============================================================ */

/* ── Custom properties ─────────────────────────────────────── */
:root {
    --color-bg:        #ffffff;
    --color-surface:   #f7f7f7;
    --color-border:    #e0e0e0;
    --color-text:      #1a1a1a;
    --color-muted:     #777777;
    --color-accent:    #1a1a1a;
    --color-accent-fg: #ffffff;
    --color-danger:    #c0392b;
    --color-success:   #27ae60;

    --radius:  0px;
    --gap:     1.5rem;
    --sidebar: 260px;

    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --mono: 'Courier New', Courier, monospace;
}

[data-theme="dark"] {
    --color-bg:        #121212;
    --color-surface:   #1e1e1e;
    --color-border:    #2e2e2e;
    --color-text:      #e8e8e8;
    --color-muted:     #888888;
    --color-accent:    #e8e8e8;
    --color-accent-fg: #121212;
}

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

html { font-size: 16px; }

body {
    font-family: var(--font);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

a:hover { opacity: 0.7; }

/* ── Loading screen ────────────────────────────────────────── */
.loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-text);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Navigation ────────────────────────────────────────────── */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--gap);
    height: 56px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav__brand {
    font-size: .9375rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
}

.nav__brand:hover { opacity: .7; }

.nav__actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.nav__hamburger {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    border-radius: .35rem;
    align-items: center;
    justify-content: center;
    gap: .22rem;
    flex-direction: column;
    cursor: pointer;
}

.nav__hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--color-text);
    border-radius: 999px;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.nav__link {
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-muted);
    font-family: var(--font);
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: .42rem .65rem;
    border-radius: .35rem;
    cursor: pointer;
}

.nav__link:hover {
    color: var(--color-text);
    border-color: var(--color-border);
}

.nav__link.is-active {
    color: var(--color-text);
    border-color: var(--color-text);
}

.nav-drawer-backdrop,
.nav-drawer {
    display: none;
}

/* ── Main layout ───────────────────────────────────────────── */
.main {
    max-width: 820px;
    margin: 0 auto;
    padding: var(--gap);
}

/* ── Auth pages ────────────────────────────────────────────── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--gap);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--color-border);
    padding: 2.5rem;
    background: var(--color-bg);
}

.auth-card__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.75rem;
    letter-spacing: .02em;
}

.auth-card__footer {
    margin-top: 1.25rem;
    font-size: .875rem;
    color: var(--color-muted);
    text-align: center;
}

/* ── Form elements ─────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: .375rem;
    margin-bottom: 1.25rem;
}

.form-group:last-of-type { margin-bottom: 0; }

label {
    font-size: .8125rem;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--color-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: .625rem .875rem;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font);
    font-size: .9375rem;
    outline: none;
    transition: border-color .15s;
    appearance: none;
    -webkit-appearance: none;
}

select {
    padding-right: 2.25rem;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--color-muted) 50%),
        linear-gradient(135deg, var(--color-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 16px) calc(50% - 2px),
        calc(100% - 11px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    border-color: var(--color-text);
}

textarea {
    resize: vertical;
    min-height: 220px;
    line-height: 1.7;
    font-size: .9375rem;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem 1.125rem;
    border: 1px solid transparent;
    font-family: var(--font);
    font-size: .875rem;
    font-weight: 500;
    letter-spacing: .03em;
    cursor: pointer;
    user-select: none;
    transition: opacity .15s, background .15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { opacity: .8; }
.btn:active { opacity: .6; }
.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

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

.btn--outline {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn--outline:hover {
    border-color: var(--color-text);
    opacity: 1;
}

.btn--ghost {
    background: transparent;
    color: var(--color-muted);
    border-color: transparent;
}

.btn--ghost:hover {
    color: var(--color-text);
    opacity: 1;
}

.btn--danger {
    background: transparent;
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.btn--sm {
    padding: .3rem .75rem;
    font-size: .8125rem;
}

.btn--full { width: 100%; }

.btn--icon {
    padding: .4rem .5rem;
    border-color: transparent;
    background: transparent;
    color: var(--color-muted);
}

/* ── Error message ─────────────────────────────────────────── */
.form-error {
    font-size: .8125rem;
    color: var(--color-danger);
    margin-top: .5rem;
    display: none;
}

.form-error--visible { display: block; }

/* ── Dashboard header ──────────────────────────────────────── */
.dashboard-header {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-bottom: var(--gap);
}

.dashboard-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-header h1 {
    font-size: 1.125rem;
    font-weight: 600;
}

.search-bar {
    display: flex;
    gap: .5rem;
    width: 100%;
}

.search-bar input {
    margin: 0;
    flex: 1;
    min-width: 0;
}

/* ── Entry list ────────────────────────────────────────────── */
.entry-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    border: 1px solid var(--color-border);
}

.entry-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--color-bg);
    cursor: pointer;
    transition: background .1s;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.entry-card:hover {
    background: var(--color-surface);
}

.entry-card__meta {
    flex: 1;
    min-width: 0;
}

.entry-card__title {
    font-weight: 500;
    font-size: .9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: .125rem;
}

.entry-card__date {
    font-size: .8125rem;
    color: var(--color-muted);
}

.entry-card__actions {
    display: flex;
    gap: .25rem;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity .15s;
}

.entry-card:hover .entry-card__actions,
.entry-card:focus-within .entry-card__actions { opacity: 1; }

@media (hover: none) {
    .entry-card__actions { opacity: 1; }
}

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-muted);
    border: 1px solid var(--color-border);
}

.empty-state p { margin-bottom: 1rem; }

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: 1.25rem;
}

.pagination__info {
    font-size: .8125rem;
    color: var(--color-muted);
    padding: 0 .5rem;
}

/* ── Entry detail / editor ─────────────────────────────────── */
.entry-detail {
    max-width: 680px;
}

.entry-detail__header {
    margin-bottom: var(--gap);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.entry-detail__title {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: .375rem;
}

.entry-detail__date {
    font-size: .8125rem;
    color: var(--color-muted);
}

.entry-detail__actions {
    display: flex;
    gap: .5rem;
    margin-top: .875rem;
}

.entry-body {
    line-height: 1.8;
    font-size: .9375rem;
}

/* Markdown rendered output */
.entry-body h1, .entry-body h2, .entry-body h3 {
    margin: 1.25em 0 .5em;
    font-weight: 600;
}

.entry-body p { margin-bottom: .875em; }

.entry-body ul, .entry-body ol {
    padding-left: 1.5em;
    margin-bottom: .875em;
}

.entry-body li { margin-bottom: .25em; }

.entry-body code {
    font-family: var(--mono);
    font-size: .875em;
    background: var(--color-surface);
    padding: .1em .35em;
    border: 1px solid var(--color-border);
}

.entry-body pre {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1em;
}

.entry-body pre code {
    background: none;
    border: none;
    padding: 0;
}

.entry-body blockquote {
    border-left: 3px solid var(--color-border);
    padding-left: 1rem;
    color: var(--color-muted);
    margin-bottom: 1em;
}

/* ── Entry form (new/edit) ─────────────────────────────────── */
.entry-form {
    max-width: 680px;
}

.entry-form__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--gap);
}

.entry-form__header h1 {
    font-size: 1.125rem;
    font-weight: 600;
}

.entry-form__actions {
    display: flex;
    gap: .5rem;
    margin-top: 1.25rem;
    justify-content: flex-end;
}

.entry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .5rem;
}

.rich-editor {
    border: 1px solid var(--color-border);
    min-height: 220px;
    padding: .875rem;
    background: var(--color-bg);
    line-height: 1.7;
    outline: none;
}

.rich-editor:focus {
    border-color: var(--color-text);
}

.editor-tabs {
    display: flex;
    gap: 0;
    margin-bottom: .5rem;
    border-bottom: 1px solid var(--color-border);
}

.editor-tab {
    padding: .375rem .875rem;
    font-size: .8125rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--color-muted);
    font-family: var(--font);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.editor-tab:hover { color: var(--color-text); }

.editor-tab--active {
    color: var(--color-text);
    border-bottom-color: var(--color-text);
}

.editor-preview {
    border: 1px solid var(--color-border);
    padding: .875rem;
    min-height: 220px;
    background: var(--color-surface);
}

/* ── Notifications ─────────────────────────────────────────── */
.notification {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: .75rem 1.25rem;
    background: var(--color-text);
    color: var(--color-bg);
    font-size: .875rem;
    z-index: 9999;
    opacity: 0;
    transform: translateY(.5rem);
    transition: opacity .2s, transform .2s;
    max-width: 320px;
}

.notification--visible {
    opacity: 1;
    transform: none;
}

.notification--error {
    background: var(--color-danger);
    color: #fff;
}

/* ── Page header ───────────────────────────────────────────── */
.page-back {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-size: .875rem;
    color: var(--color-muted);
    cursor: pointer;
    margin-bottom: 1.25rem;
    background: none;
    border: none;
    font-family: var(--font);
    padding: 0;
}

.page-back:hover { color: var(--color-text); }

/* ── Dark mode toggle ──────────────────────────────────────── */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-size: .8125rem;
    color: var(--color-muted);
    cursor: pointer;
    user-select: none;
    background: none;
    border: none;
    font-family: var(--font);
    padding: .25rem;
}

.theme-toggle:hover { color: var(--color-text); }

/* ── Divider ───────────────────────────────────────────────── */
.divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 1.5rem 0;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
    .main { padding: 1rem; }
    .auth-card { padding: 1.75rem; }
    .entry-grid { grid-template-columns: 1fr; }

    .nav {
        gap: .6rem;
    }

    .nav__hamburger {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .nav__brand {
        font-size: .85rem;
        letter-spacing: .03em;
    }

    .nav__links,
    .nav__actions {
        display: none;
    }

    .nav-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 56px 0 0 0;
        background: rgba(0, 0, 0, .45);
        opacity: 0;
        pointer-events: none;
        transition: opacity .22s ease;
        z-index: 130;
    }

    .nav-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 56px;
        left: 0;
        width: min(82vw, 320px);
        height: calc(100dvh - 56px);
        padding: 1rem;
        gap: .35rem;
        background: var(--color-bg);
        border-right: 1px solid var(--color-border);
        transform: translateX(-100%);
        transition: transform .22s ease;
        z-index: 131;
    }

    .nav-drawer__item {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
    }

    .nav-drawer__item.is-active {
        border-color: var(--color-text);
        font-weight: 600;
    }

    .nav-drawer__item--danger {
        color: var(--color-danger);
    }

    .nav-drawer__divider {
        height: 1px;
        background: var(--color-border);
        margin: .35rem 0;
    }

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

    body.mobile-menu-open .nav-drawer-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    /* Nav: hide "Sign Out" label, show icon only */
    .signout-label { display: none; }
    .signout-icon  { display: inline; font-size: 1rem; line-height: 1; }
}

@media (min-width: 601px) {
    .signout-icon  { display: none; }
    .signout-label { display: inline; }
}

/* ── PWA / Mobile ──────────────────────────────────────────── */

/* Prevent text zoom on input focus (iOS) */
input, textarea, select {
    font-size: max(16px, 1rem);
}

/* Safe area insets for notch/home-bar devices */
.nav {
    padding-left:  max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}
.main {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

/* Minimum touch target size (44×44 px) */
.btn,
.nav__actions button,
.theme-toggle,
.entry-card__actions button,
.rich-toolbar button,
.pagination button {
    min-height: 44px;
    min-width:  44px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

/* Stand-alone PWA: hide browser chrome artifacts */
@media (display-mode: standalone) {
    .nav {
        padding-top: max(.75rem, env(safe-area-inset-top));
    }
}

/* Wider tap zone for entry cards on mobile */
@media (max-width: 600px) {
    .entry-card { cursor: pointer; }
    .btn { padding: .75rem 1rem; }

    /* Toolbar wraps nicely on small screens */
    .rich-toolbar { flex-wrap: wrap; gap: .25rem; }
    .rich-toolbar button { flex: 0 0 auto; }
}

/* ── Discover ────────────────────────────────────────────────── */
.discover-feed {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.discover-profile,
.discover-users {
    margin-bottom: 1rem;
}

.shared-section {
    margin-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
}

.shared-empty {
    color: var(--color-muted);
    font-size: .875rem;
}

.entry-card--shared {
    border-style: dashed;
    background: var(--color-surface);
}

.entry-card--shared .entry-card__title {
    font-weight: 600;
}

.discover-profile__card {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: 1rem;
}

.discover-profile__card--collapsible {
    padding: 0;
}

.discover-profile__toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: .75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--color-text);
    text-align: left;
}

.discover-profile__toggle:hover {
    background: var(--color-border);
}

.discover-profile__toggle-icon {
    font-size: .85rem;
    line-height: 1;
    flex-shrink: 0;
    margin-left: .5rem;
}

.discover-profile__body {
    padding: 0 1rem 1rem;
    overflow: hidden;
}

.discover-profile__body--collapsed {
    display: none;
}

.discover-profile__form textarea {
    min-height: 110px;
}

.discover-section__title {
    font-size: 1rem;
    margin-bottom: .75rem;
    letter-spacing: .02em;
}

.discover-users__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .75rem;
}

.discover-user-card {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: .85rem;
    display: flex;
    flex-direction: column;
    min-height: 170px;
}

.discover-user-card--self {
    border-color: var(--color-text);
}

.discover-user-card__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    margin-bottom: .4rem;
}

.discover-user-card__name {
    font-size: .95rem;
    font-weight: 600;
}

.discover-user-card__bio {
    font-size: .85rem;
    color: var(--color-text);
    margin-bottom: .5rem;
}

.discover-user-card__meta {
    font-size: .75rem;
    color: var(--color-muted);
    margin-top: auto;
}

.discover-user-card__actions {
    margin-top: .6rem;
    display: flex;
    justify-content: flex-end;
    gap: .4rem;
    flex-wrap: wrap;
}

.discover-user-card__actions .btn {
    min-width: 110px;
}

.share-entry-panel {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 1rem;
}

.share-entry-form__submit {
    display: flex;
    align-items: flex-end;
}

.share-entry-form__submit .btn {
    width: 100%;
}

.share-entry-current {
    margin-top: .8rem;
    border-top: 1px solid var(--color-border);
    padding-top: .7rem;
}

.share-entry-current__title {
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-muted);
    margin-bottom: .45rem;
}

.share-entry-current__empty,
.share-entry-current__loading {
    font-size: .85rem;
    color: var(--color-muted);
}

.share-recipient-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.share-recipient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .6rem;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    padding: .5rem .55rem;
}

.share-recipient-item__info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.share-recipient-item__name {
    font-size: .88rem;
    font-weight: 600;
}

.share-recipient-item__meta {
    font-size: .76rem;
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.requests-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.requests-grid > div {
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    padding: .65rem;
}

.requests-grid__label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-muted);
    margin-bottom: .4rem;
}

.request-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.request-item {
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    padding: .55rem .65rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
}

.request-item span {
    overflow-wrap: anywhere;
}

.request-item__actions {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.request-item--muted {
    color: var(--color-muted);
}

.discover-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: .5rem;
    padding: 1rem 1.25rem;
    transition: border-color .15s;
}

.discover-card:hover {
    border-color: var(--color-text);
}

.discover-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    margin-bottom: .4rem;
}

.discover-card__author {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: var(--color-text);
    color: var(--color-bg);
    padding: .15rem .5rem;
    border-radius: 3px;
}

.discover-card__date {
    font-size: .75rem;
    color: var(--color-muted);
}

.discover-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .25rem;
}

.discover-card__meta {
    font-size: .75rem;
    color: var(--color-muted);
}

/* Public badge on entry cards */
.badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .1rem .4rem;
    border-radius: 3px;
    vertical-align: middle;
}

.badge--public {
    background: var(--color-text);
    color: var(--color-bg);
}

/* Public toggle in entry form */
.form-group--inline {
    display: flex;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    font-size: .875rem;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--color-text);
    cursor: pointer;
}

@media (max-width: 600px) {
    .discover-users__grid {
        grid-template-columns: 1fr;
    }

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

    .discover-user-card__actions {
        justify-content: stretch;
    }

    .discover-user-card__actions .btn {
        width: 100%;
    }

    .request-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .request-item__actions {
        width: 100%;
    }

    .request-item__actions .btn,
    .share-recipient-item .btn {
        width: 100%;
    }

    .share-recipient-item {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Discover nav button */
.btn--nav {
    padding: .4rem .75rem;
    font-size: .8125rem;
    font-weight: 600;
}

/* ── Dashboard layout ────────────────────────────────────────── */
.dashboard-body {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    align-items: start;
}

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

/* ── Tasks widget ─────────────────────────────────────────────── */
.tasks-widget {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: 1rem;
    position: sticky;
    top: 1rem;
}

.tasks-widget__title {
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .02em;
    margin-bottom: .75rem;
}

.tasks-widget__form {
    display: flex;
    gap: .4rem;
    margin-bottom: .75rem;
}

.tasks-widget__input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    padding: .4rem .55rem;
    font-size: .85rem;
}

.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.task-item {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    padding: .3rem 0;
    border-bottom: 1px solid var(--color-border);
}

.task-item:last-child { border-bottom: none; }

.task-item--empty,
.task-item--loading {
    color: var(--color-muted);
    font-size: .8rem;
    border-bottom: none;
}

.task-item__check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    font-size: .7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.task-item--done .task-item__check {
    background: var(--color-text);
    color: var(--color-bg);
}

.task-item__text {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
}

.task-item--done .task-item__text {
    text-decoration: line-through;
    color: var(--color-muted);
}

.task-item__delete {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--color-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 .15rem;
}

.task-item__delete:hover {
    color: var(--color-danger);
}

/* ── Help page ────────────────────────────────────────────────── */
.help-page {
    max-width: 900px;
}

.help-page__header {
    margin-bottom: 1.5rem;
}

.help-page__intro {
    color: var(--color-muted);
    margin-top: .4rem;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.help-card {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: 1rem;
}

.help-card__title {
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: .6rem;
    letter-spacing: .01em;
}

.help-list {
    padding-left: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    font-size: .875rem;
    color: var(--color-muted);
}

.help-list li { color: var(--color-text); }
.help-list strong { font-weight: 600; }

@media (max-width: 600px) {
    .dashboard-body {
        grid-template-columns: 1fr;
    }

    .tasks-widget {
        position: static;
    }
}
