/* The storage page (/dashboard/storage). Kept out of style.css because nothing else uses it.
   Colours come from the site's own variables, so dark mode follows for free. */

#storage .storage-back {
    margin: 0 0 0.25em;
    font-size: 0.9em;
}

#storage .hidden {
    display: none;
}

#storage-status {
    min-height: 1.4em;
    font-weight: bold;
}

#storage-status:empty {
    display: none;
}

/* What the account has synced, and the way to take a copy of it. */
#storage-account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em 1em;
    padding: 0.6em 1em;
    border: 0.0625em solid var(--border-color);
    border-radius: 1em;
}

#storage-account.hidden {
    display: none;
}

#storage .storage-download {
    display: inline-block;
    padding: 0.3em 0.9em;
    border: 0.0625em solid var(--border-color);
    border-radius: 0.6em;
    background: var(--button-background);
    color: var(--button-text-color);
    text-decoration: none;
    white-space: nowrap;
}

#storage .storage-kind-synced {
    border-color: var(--help-heading-color);
    color: var(--help-heading-color);
    font-weight: bold;
}

#storage .storage-synced-detail {
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

#storage-partial {
    font-size: 0.9em;
    color: var(--text-color-sub);
}

/* The same card the help sections use. Written out here because those rules
   reach only a section sitting directly inside the article. */
#storage .storage-group {
    margin: 0.75em 0;
    padding: 0.75em 1em;
    border: 0.125em solid var(--text-color);
    border-radius: 1em;
    background: var(--help-background);
}

#storage .storage-group>header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25em 0.75em;
}

#storage .storage-group h3 {
    margin: 0;
    flex: 1 1 8em;
    color: var(--help-heading-color);
    overflow-wrap: anywhere;
}

/* A group with no app behind it: a renamed game, an old build, something
   unpublished. Still listed and still removable, but marked as a leftover. */
#storage .storage-group.unknown h3 {
    font-family: monospace;
    color: var(--text-color);
}

#storage .storage-summary {
    order: 3;
    flex: 1 0 100%;
    margin: 0;
    font-size: 0.85em;
    color: var(--text-color-sub);
}

#storage .storage-list {
    list-style: none;
    margin: 0.5em 0 0;
    padding: 0;
}

#storage .storage-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75em;
    padding: 0.4em 0;
    border-top: 0.0625em solid var(--border-color);
}

/* min-width: 0 lets a long key or value wrap instead of pushing the delete
   button off the side of a phone. */
#storage .storage-row>details,
#storage .storage-row>.storage-db {
    flex: 1 1 auto;
    min-width: 0;
}

#storage summary {
    cursor: pointer;
    overflow-wrap: anywhere;
}

#storage .storage-name {
    font-family: monospace;
    overflow-wrap: anywhere;
}

#storage .storage-size {
    margin-left: 0.6em;
    font-size: 0.85em;
    color: var(--text-color-sub);
    white-space: nowrap;
}

#storage .storage-kind {
    display: inline-block;
    margin-right: 0.6em;
    padding: 0.05em 0.5em;
    border: 0.0625em solid var(--border-color);
    border-radius: 0.6em;
    font-size: 0.8em;
}

#storage .storage-note {
    flex: 0 1 14em;
    font-size: 0.85em;
    color: var(--text-color-sub);
}

#storage pre {
    margin: 0.4em 0 0.2em;
    padding: 0.5em;
    max-height: 16em;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.85em;
    border: 0.0625em solid var(--border-color);
    border-radius: 0.5em;
}

#storage .storage-delete {
    flex: 0 0 auto;
    min-height: 2.2em;
    padding: 0.2em 0.8em;
    border: 0.0625em solid var(--border-color);
    border-radius: 0.6em;
    background: var(--button-background);
    color: var(--button-text-color);
    font: inherit;
    font-size: 0.9em;
    cursor: pointer;
}

#storage .storage-delete.armed {
    background: #b3261e;
    border-color: #b3261e;
    color: #ffffff;
    font-weight: bold;
}

/* content.css tints every button under the pointer, and a phone leaves a
   button "under the pointer" after a tap. The warning stays red. */
#storage .storage-delete.armed:hover,
#storage .storage-delete.armed:active {
    filter: none;
}

#storage .storage-delete:disabled {
    opacity: 0.5;
    cursor: default;
}
