/* Sealed. Ruhige Werkzeugoptik: kuehles Papier, Tinte, Siegelrot als Akzent. */

:root {
    --bg: #f6f6f3;
    --surface: #ffffff;
    --ink: #1c2026;
    --muted: #646b76;
    --line: #d8dad6;
    --seal: #8c2f39;
    --seal-ink: #ffffff;
    --focus: #2b5f8a;
    --broken: #9a6b00;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16181c;
        --surface: #1e2126;
        --ink: #e8e8e4;
        --muted: #9aa1ab;
        --line: #34383f;
        --seal: #b8515c;
        --seal-ink: #16181c;
        --focus: #7db2dd;
        --broken: #d0a53c;
    }
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.mono {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.shell {
    max-width: 46rem;
    height: 100dvh;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
}

.top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0 0.6rem;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

h1 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

h1::before {
    content: "";
    display: inline-block;
    width: 0.55em;
    height: 0.55em;
    margin-right: 0.5em;
    border-radius: 50%;
    background: var(--seal);
}

.expiry {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

section[hidden] {
    display: none;
}

.lead {
    max-width: 34rem;
    color: var(--muted);
    margin: 2.2rem 0 1.4rem;
}

.startrow {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

label {
    font-size: 0.85rem;
    color: var(--muted);
}

select, input[type="text"], textarea {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    font: inherit;
}

textarea {
    resize: vertical;
    min-height: 2.6rem;
}

button {
    font: inherit;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    padding: 0.5rem 0.9rem;
    cursor: pointer;
}

button:hover:not(:disabled) {
    border-color: var(--muted);
}

button:disabled {
    opacity: 0.55;
    cursor: default;
}

button.primary {
    background: var(--seal);
    border-color: var(--seal);
    color: var(--seal-ink);
    font-weight: 600;
}

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

:is(button, select, input, textarea, a):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.invite {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
}

.inviterow {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.3rem;
    flex-wrap: wrap;
}

#invite-link {
    flex: 1;
    min-width: 12rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.hint {
    margin: 0.45rem 0 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.9rem 0;
    min-height: 0;
}

.msg {
    margin-bottom: 0.85rem;
}

.msghead {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}

.msgname {
    font-weight: 600;
    font-size: 0.9rem;
}

.msgtime {
    font-size: 0.72rem;
    color: var(--muted);
}

.msgtext {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin-top: 0.1rem;
}

.msgtext.broken {
    color: var(--broken);
    font-style: italic;
}

.msgfile {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
    padding: 0.55rem 0.7rem;
    border: 1px dashed var(--line);
    border-radius: 6px;
    background: var(--surface);
    font-size: 0.9rem;
}

.msgfile img.preview {
    display: block;
    max-width: 100%;
    max-height: 320px;
    border-radius: 6px;
}

.savelink {
    color: var(--focus);
}

.composer {
    border-top: 1px solid var(--line);
    padding: 0.7rem 0 0.9rem;
}

.namerow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

#name {
    width: 11rem;
}

.sendrow {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

#text {
    flex: 1;
}

.status {
    min-height: 1.3rem;
    margin: 0;
    padding-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--seal);
}

.notice {
    margin: auto 0 0;
    padding: 0.7rem 0;
    border-top: 1px solid var(--line);
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--muted);
}

.notice p {
    margin: 0;
}

@media (max-width: 30rem) {
    .sendrow {
        flex-wrap: wrap;
    }
    #text {
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
