/* app.css — the ui shell's stylesheet.
   One accent colour (declared as a CSS custom property), large tap targets,
   visible focus rings, and system fonts only: the content-security policy
   allows no external resources, so nothing here is fetched from the network. */

:root {
    --accent: #2e6acf;
    --accent-hover: #2454a8;
    --accent-contrast: #ffffff;
    --page-bg: #f4f6f9;
    --panel-bg: #ffffff;
    --ink: #1f2733;
    --ink-soft: #5c6672;
    --line: #d5dbe3;
    --error: #9c2b21;
    --error-bg: #fbeae8;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    --tap-size: 48px;
    --focus-ring: 3px solid var(--accent);
    --radius: 12px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --accent: #7ea6ec;
        --accent-hover: #96b6f0;
        --accent-contrast: #10151d;
        --page-bg: #12161d;
        --panel-bg: #1c222c;
        --ink: #e8ecf2;
        --ink-soft: #a6b0bd;
        --line: #333c49;
        --error: #ff8a80;
        --error-bg: #32211f;
        --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }
}

* {
    box-sizing: border-box;
}

html {
    font-size: 100%;
}

/* The shell's column: the shared top bar and the view root share the
   viewport's height, with the body's 100vh floor as the shell's minimum, so a
   signed-in page is never taller than the screen merely because the bar
   exists. */
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--page-bg);
}

/* #app takes whatever height the bar leaves — all of the viewport when the
   bar is hidden — and keeps centring its child. A view taller than that share
   grows the body instead of being clipped, so long lists still scroll. */
#app {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

/* The shared top bar (chrome.js): one sign-out control for every signed-in
   screen, so no screen grows its own copy. It lives outside #app in the
   shell and stays in normal flow, so it can never cover the view; the
   palette custom properties carry both colour schemes. */
.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding: 10px 16px;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--line);
}

/* The markup starts hidden and chrome.js shows it when there is an identity
   and the screen is not one of the sign-in journey's. A display rule beats
   the hidden attribute's own, so the hidden state is spelled out — the same
   guard .auth-error[hidden] uses. */
.topbar[hidden] {
    display: none;
}

.topbar-identity {
    color: var(--ink-soft);
    font-size: 0.9375rem;
    overflow-wrap: anywhere;
}

.topbar-logout {
    margin-left: auto;
    min-height: var(--tap-size);
    padding: 0 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
}

.topbar-logout:hover {
    color: var(--accent-contrast);
    background: var(--accent);
}

.topbar-logout:disabled {
    opacity: 0.65;
    cursor: default;
}

/* The bar's own failure slot, on its own row of the wrapping flex. */
.topbar-error {
    flex-basis: 100%;
    margin: 0;
}

:focus-visible {
    outline: var(--focus-ring);
    outline-offset: 2px;
}

button,
input {
    font: inherit;
    color: inherit;
}

/* Shared title and link-button used by the sign-in card and the placeholder. */

.app-title {
    margin: 0;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
}

.button-link {
    display: inline-block;
    margin-top: 20px;
    min-height: var(--tap-size);
    line-height: var(--tap-size);
    padding: 0 24px;
    font-weight: 600;
    color: var(--accent-contrast);
    background: var(--accent);
    border-radius: var(--radius);
    text-decoration: none;
}

.button-link:hover {
    background: var(--accent-hover);
}

/* The sign-in screen. */

.auth {
    width: 100%;
    max-width: 360px;
    padding: 32px 28px;
    background: var(--panel-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-tagline {
    margin: 6px 0 28px;
    color: var(--ink-soft);
}

.auth-form {
    display: flex;
    flex-direction: column;
}

.field-label {
    margin-top: 14px;
    font-weight: 600;
    font-size: 0.9375rem;
}

.field-input {
    margin-top: 6px;
    min-height: var(--tap-size);
    padding: 10px 14px;
    font-size: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-bg);
}

.field-input:hover {
    border-color: var(--ink-soft);
}

/* The rule a field enforces, said before the user submits rather than after
   the server refuses. Quiet, so it never competes with the input. */
.field-hint {
    margin-top: 6px;
    font-size: 0.875rem;
    color: var(--ink-soft);
}

.auth-submit {
    margin-top: 22px;
    min-height: var(--tap-size);
    padding: 0 20px;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--accent-contrast);
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.auth-submit:hover {
    background: var(--accent-hover);
}

.auth-submit:disabled {
    opacity: 0.65;
    cursor: default;
}

.auth-error {
    margin: 18px 0 0;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--error-bg);
    color: var(--error);
    font-size: 0.9375rem;
}

.auth-error[hidden] {
    display: none;
}

.auth-error-frame {
    display: block;
}

.auth-error-literal {
    display: block;
    margin-top: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    font-style: normal;
}

/* The not-yet-implemented placeholder. */

.placeholder {
    max-width: 420px;
    text-align: center;
}

.placeholder-note {
    margin: 10px 0 0;
    color: var(--ink-soft);
}

/* The home screen: the cross-org feed first, the org doors under it. */

.home {
    /* #app centers its child; a feed taller than the viewport must start at
       the top of the page, not be pushed half off it. */
    align-self: flex-start;
    width: 100%;
    max-width: 720px;
    padding-bottom: 24px;
}

/* Beats the component display rules below on specificity, so the hidden
   attribute keeps working on the Older button and the garden form. */
.home [hidden] {
    display: none;
}

/* The home screen's own top row: the title. The sign-out control used to sit
   at its right end; it belongs to the shared top bar now, so the header's
   one remaining child takes the start of the row, where space-between on a
   single child already puts it. */
.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.band-title {
    margin: 0 0 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.feed,
.doors {
    margin-top: 24px;
    padding: 20px;
    background: var(--panel-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.feed-list,
.door-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.feed-item + .feed-item {
    border-top: 1px solid var(--line);
}

.feed-row {
    display: block;
    min-height: var(--tap-size);
    padding: 12px 8px;
    color: inherit;
    text-decoration: none;
    border-radius: var(--radius);
}

.feed-row:hover {
    background: var(--page-bg);
}

.feed-sentence {
    display: block;
}

.feed-actor {
    font-weight: 600;
}

.feed-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 4px;
    font-size: 0.875rem;
    color: var(--ink-soft);
}

.feed-org {
    font-weight: 600;
}

.feed-older,
.retry {
    min-height: var(--tap-size);
    padding: 0 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-contrast);
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.feed-older {
    margin-top: 16px;
}

.retry {
    margin-top: 10px;
}

.feed-older:hover,
.retry:hover {
    background: var(--accent-hover);
}

.feed-older:disabled {
    opacity: 0.65;
    cursor: default;
}

.loading-note,
.feed-empty,
.doors-empty {
    margin: 0;
    color: var(--ink-soft);
}

.feed-error,
.feed-more-error,
.doors-error {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--error-bg);
    color: var(--error);
    font-size: 0.9375rem;
}

.feed-more-error {
    margin-top: 12px;
}

.door-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.door {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 104px;
    padding: 18px 16px;
    color: inherit;
    text-decoration: none;
    background: var(--page-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.door:hover {
    border-color: var(--accent);
}

.door-name {
    font-size: 1.125rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.door-role {
    align-self: flex-start;
    padding: 2px 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
}

.door-quota {
    margin-top: auto;
    font-size: 0.875rem;
    color: var(--ink-soft);
}

.garden-band {
    margin-top: 20px;
}

.new-garden {
    min-height: var(--tap-size);
    padding: 0 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
}

.new-garden:hover {
    color: var(--accent-contrast);
    background: var(--accent);
}

.garden-form {
    display: flex;
    flex-direction: column;
}

.garden-submit {
    margin-top: 22px;
    min-height: var(--tap-size);
    padding: 0 20px;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--accent-contrast);
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.garden-submit:hover {
    background: var(--accent-hover);
}

.garden-submit:disabled {
    opacity: 0.65;
    cursor: default;
}

/* The org screen: the garden header, the folder/file list, and the
   per-file version expansion. */

.org {
    align-self: flex-start;
    width: 100%;
    max-width: 720px;
    padding-bottom: 24px;
}

/* Beats the component display rules below on specificity, so the hidden
   attribute keeps working on the inline rename/new-folder forms. */
.org [hidden] {
    display: none;
}

.org-back {
    margin: 6px 0 0;
}

.org-panel {
    margin-top: 20px;
    padding: 20px;
    background: var(--panel-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.org-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.org-name {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.org-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-left: auto;
}

.org-link {
    color: var(--accent);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
}

.org-link:hover {
    text-decoration: underline;
}

/* The loud Upload control: the button in this slot and the sheet it opens. */
.org-upload {
    flex-basis: 100%;
}

.upload-open {
    margin-top: 12px;
    min-height: var(--tap-size);
    padding: 0 22px;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--accent-contrast);
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.upload-open:hover {
    background: var(--accent-hover);
}

/* The sheet: everything above the panel's own white, in its own card. */
.upload-sheet {
    margin-top: 12px;
    padding: 16px;
    background: var(--page-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.upload-title {
    margin: 0 0 6px;
    font-size: 1.0625rem;
}

.upload-intro {
    margin: 0 0 10px;
    color: var(--ink-soft);
    font-size: 0.9375rem;
}

.upload-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 0 0 12px;
}

.upload-mode {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
}

.upload-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.upload-file-input {
    font-size: 0.9375rem;
}

.upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.upload-submit {
    min-height: var(--tap-size);
    padding: 0 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-contrast);
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.upload-submit:hover {
    background: var(--accent-hover);
}

.upload-submit:disabled {
    opacity: 0.65;
    cursor: default;
}

.upload-cancel,
.upload-row {
    min-height: var(--tap-size);
    padding: 0 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
}

.upload-cancel:hover,
.upload-row:hover {
    color: var(--accent-contrast);
    background: var(--accent);
}

/* The honest chunk bar: a native progress element — the CSP forbids style
   attributes, so there is no width-based fake bar. */
.upload-progress {
    display: block;
    width: 100%;
    margin-top: 10px;
    accent-color: var(--accent);
}

.upload-progress-line {
    margin: 0;
    font-size: 0.9375rem;
}

.upload-bytes {
    margin: 6px 0 0;
    color: var(--ink-soft);
    font-size: 0.875rem;
}

/* The soft post-commit heads-up of design §4.5: informs, never blocks. */
.upload-similarity {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    background: var(--panel-bg);
    font-size: 0.9375rem;
}

.upload-success {
    margin: 0;
    font-size: 0.9375rem;
}

.upload-error {
    margin: 14px 0 0;
}

.org-body {
    margin-top: 18px;
}

.org-empty,
.org-missing {
    margin: 0;
    color: var(--ink-soft);
}

.org-missing {
    padding: 8px 0;
}

.org-error {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--error-bg);
    color: var(--error);
    font-size: 0.9375rem;
}

.org-error + .folder-controls {
    margin-top: 16px;
}

.folder-controls {
    margin-bottom: 16px;
}

.new-folder {
    min-height: var(--tap-size);
    padding: 0 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
}

.new-folder:hover {
    color: var(--accent-contrast);
    background: var(--accent);
}

.folder-form {
    display: flex;
    flex-direction: column;
    margin-top: 12px;
}

.folder-submit,
.rename-save {
    margin-top: 16px;
    min-height: var(--tap-size);
    padding: 0 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-contrast);
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.folder-submit:hover,
.rename-save:hover {
    background: var(--accent-hover);
}

.folder-submit:disabled,
.rename-save:disabled {
    opacity: 0.65;
    cursor: default;
}

.folder + .folder {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.folder-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 4px;
}

.folder-name {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.folder-rename {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.file-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.file-row + .file-row {
    border-top: 1px solid var(--line);
}

.file-line {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 4px 6px;
}

.file-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: var(--tap-size);
    padding: 0;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.file-caret {
    flex: 0 0 1em;
    text-align: center;
    color: var(--ink-soft);
}

.file-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding-left: calc(1em + 8px);
    font-size: 0.875rem;
    color: var(--ink-soft);
}

.file-download,
.version-download {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.file-download:hover,
.version-download:hover {
    text-decoration: underline;
}

.file-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 0 4px 12px calc(1em + 8px);
}

.row-action {
    min-height: 40px;
    padding: 0 14px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
}

.row-action:hover {
    color: var(--accent-contrast);
    background: var(--accent);
}

.row-action:disabled {
    opacity: 0.65;
    cursor: default;
}

.row-action-danger {
    color: var(--error);
    border-color: var(--error);
}

.row-action-danger:hover {
    color: #ffffff;
    background: var(--error);
}

.move-select {
    min-height: 40px;
    padding: 0 10px;
    font: inherit;
    color: inherit;
    background: var(--panel-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.file-error {
    flex-basis: 100%;
    margin: 0;
}

.rename-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.rename-input {
    flex: 1 1 180px;
    min-height: 40px;
    padding: 8px 10px;
    font: inherit;
    color: inherit;
    background: var(--panel-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.rename-cancel {
    min-height: var(--tap-size);
    padding: 0 16px;
    font: inherit;
    font-weight: 600;
    color: var(--ink-soft);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
}

.rename-cancel:hover {
    color: var(--ink);
    border-color: var(--ink-soft);
}

.file-versions {
    margin: 0 4px 12px;
    padding: 0 10px 4px calc(1em + 8px);
    border-left: 3px solid var(--line);
}

.versions-error {
    margin: 8px 0;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--error-bg);
    color: var(--error);
    font-size: 0.9375rem;
}

.version-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.version-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    padding: 10px 0;
    font-size: 0.875rem;
}

.version-row + .version-row {
    border-top: 1px solid var(--line);
}

.version-size {
    min-width: 4.5em;
}

.version-uploader {
    color: var(--ink-soft);
    font-weight: 600;
}

.version-time {
    color: var(--ink-soft);
}

@media (max-width: 480px) {
    .feed,
    .doors {
        padding: 16px 14px;
    }

    .org-panel {
        padding: 16px 14px;
    }
}

noscript p {
    margin: 0;
    padding: 24px 16px;
    color: var(--ink-soft);
}

@media (max-width: 380px) {
    .auth {
        padding: 24px 18px;
    }
}

/* The trash screen: the garden header, the list of trashed files and
   versions with the drop-dead countdown, and the destruction controls. */

.trash {
    align-self: flex-start;
    width: 100%;
    max-width: 720px;
    padding-bottom: 24px;
}

/* Beats the component display rules below on specificity, so the hidden
   attribute keeps working on the per-row error boxes. */
.trash [hidden] {
    display: none;
}

.trash-back {
    margin: 6px 0 0;
}

.trash-panel {
    margin-top: 20px;
    padding: 20px;
    background: var(--panel-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.trash-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.trash-org-name {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.trash-heading {
    margin-left: auto;
    color: var(--accent);
    font-size: 0.9375rem;
    font-weight: 600;
}

.trash-body {
    margin-top: 18px;
}

.trash-empty,
.trash-missing {
    margin: 0;
    color: var(--ink-soft);
}

.trash-missing {
    padding: 8px 0;
}

.trash-error {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--error-bg);
    color: var(--error);
    font-size: 0.9375rem;
}

.trash-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.trash-row + .trash-row {
    border-top: 1px solid var(--line);
}

.trash-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    padding: 10px 4px 6px;
}

.trash-kind {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.trash-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.trash-remover,
.trash-time {
    color: var(--ink-soft);
    font-size: 0.875rem;
}

.trash-countdown {
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 600;
}

.trash-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 4px 10px;
}

.trash-row-error {
    flex-basis: 100%;
    margin: 0;
}

@media (max-width: 480px) {
    .trash-panel {
        padding: 16px 14px;
    }
}

/* The members screen: the admin-only list of a garden's people, their role
   controls, and the two distinct ways to bring someone in. */

.members {
    align-self: flex-start;
    width: 100%;
    max-width: 720px;
    padding-bottom: 24px;
}

/* Beats the component display rules below on specificity, so the hidden
   attribute keeps working on the per-row error boxes. */
.members [hidden] {
    display: none;
}

.members-back {
    margin: 6px 0 0;
}

.members-panel {
    margin-top: 20px;
    padding: 20px;
    background: var(--panel-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.members-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
}

.members-heading {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.members-tagline {
    color: var(--ink-soft);
    font-size: 0.9375rem;
}

.members-body {
    margin-top: 18px;
}

.members-unavailable,
.members-empty,
.members-solo {
    margin: 0;
    color: var(--ink-soft);
}

.members-error {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--error-bg);
    color: var(--error);
    font-size: 0.9375rem;
}

.member-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.member-row + .member-row {
    border-top: 1px solid var(--line);
}

.member-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    padding: 10px 4px 6px;
}

.member-email {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.member-you {
    padding: 2px 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
}

.member-joined {
    color: var(--ink-soft);
    font-size: 0.875rem;
}

.member-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 0 4px 12px;
}

.member-role {
    min-height: 40px;
    padding: 0 10px;
    font: inherit;
    color: inherit;
    background: var(--panel-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.member-role:disabled {
    opacity: 0.65;
    cursor: default;
}

.member-row-error {
    flex-basis: 100%;
    margin: 0;
}

.members-flows {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 22px;
}

.members-form-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

/* The invite flow reads as its own card with an accent edge, so an admin
   never mistakes it for the add-existing-account flow above it. */
.members-invite {
    background: var(--page-bg);
    border-left: 4px solid var(--accent);
}

.members-form-title {
    margin: 0 0 4px;
    font-size: 1.0625rem;
}

.members-form-note {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.9375rem;
}

.members-form {
    display: flex;
    flex-direction: column;
    margin-top: 12px;
}

.members-submit {
    margin-top: 16px;
    min-height: var(--tap-size);
    padding: 0 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-contrast);
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.members-submit:hover {
    background: var(--accent-hover);
}

.members-submit:disabled {
    opacity: 0.65;
    cursor: default;
}

/* The invite confirmation: the emailed sentence the raw-tokenless response
   allows, and nothing more. */
.members-note {
    margin: 12px 0 0;
    color: var(--accent);
    font-size: 0.9375rem;
    font-weight: 600;
}

@media (max-width: 480px) {
    .members-panel {
        padding: 16px 14px;
    }
}

/* The notification preferences screen and the home band's one-time nudge.
   The nudge is a line between the feed and the doors, never a modal; the
   screen renders one garden heading after another, each with a switch per
   event type, and the switches are the tap targets. */

.prefs-nudge {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 24px;
    padding: 14px 16px;
    background: var(--panel-bg);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.prefs-nudge-line {
    flex: 1 1 240px;
    margin: 0;
}

.prefs-nudge-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.prefs-nudge-link:hover {
    text-decoration: underline;
}

.prefs-nudge-dismiss {
    min-height: var(--tap-size);
    padding: 0 18px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
}

.prefs-nudge-dismiss:hover {
    color: var(--accent-contrast);
    background: var(--accent);
}

.prefs {
    align-self: flex-start;
    width: 100%;
    max-width: 720px;
    padding-bottom: 24px;
}

/* Beats the component display rules below on specificity, so the hidden
   attribute keeps working on the per-row error boxes. */
.prefs [hidden] {
    display: none;
}

.prefs-back {
    margin: 6px 0 0;
}

.prefs-panel {
    margin-top: 20px;
    padding: 20px;
    background: var(--panel-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.prefs-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
}

.prefs-heading {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.prefs-tagline {
    color: var(--ink-soft);
    font-size: 0.9375rem;
}

.prefs-body {
    margin-top: 18px;
}

.prefs-empty {
    margin: 0;
    color: var(--ink-soft);
}

.prefs-error {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--error-bg);
    color: var(--error);
    font-size: 0.9375rem;
}

.prefs-org + .prefs-org {
    margin-top: 22px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.prefs-org-name {
    margin: 0 0 6px;
    font-size: 1.0625rem;
    overflow-wrap: anywhere;
}

.pref-row + .pref-row {
    border-top: 1px solid var(--line);
}

.pref-label {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--tap-size);
    padding: 6px 4px;
    cursor: pointer;
}

.pref-toggle {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    accent-color: var(--accent);
}

.pref-text {
    overflow-wrap: anywhere;
}

.pref-row-error {
    margin: 0 4px 10px;
}

@media (max-width: 480px) {
    .prefs-panel {
        padding: 16px 14px;
    }
}

/* The superadmin takedown screen: one file in one garden, the irreversible
   consequence in plain words, one destructive control and one quiet way
   out. Deliberately not the trash screen: no countdown, no restore. */

.takedown {
    align-self: flex-start;
    width: 100%;
    max-width: 640px;
    padding-bottom: 24px;
}

.takedown-panel {
    margin-top: 20px;
    padding: 20px;
    background: var(--panel-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.takedown-heading {
    margin: 0 0 10px;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.takedown-warning {
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.takedown-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 22px;
    margin-top: 24px;
}

.takedown-confirm {
    min-height: var(--tap-size);
    padding: 0 22px;
    font-size: 1rem;
}

.takedown-cancel {
    color: var(--accent);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
}

.takedown-cancel:hover {
    text-decoration: underline;
}

.takedown-note {
    margin: 0;
    color: var(--ink-soft);
}

.takedown-back {
    margin: 6px 0 0;
}

.takedown-error {
    margin: 18px 0 0;
}

@media (max-width: 480px) {
    .takedown-panel {
        padding: 16px 14px;
    }
}
