:root {
    --bg: #0f1115;
    --surface: #171a21;
    --border: #2a2f3a;
    --text: #e6e8ec;
    --muted: #8b93a3;
    --accent: #4f8cff;
    --accent-hover: #6ba1ff;
    --error: #ff6b6b;
    --ok: #4cd97b;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    padding: 24px 16px;
}

.container {
    width: 100%;
    max-width: 520px;
}

.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

textarea {
    width: 100%;
    resize: vertical;
    min-height: 150px;
    max-height: 55vh;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color 0.15s ease;
}

textarea::placeholder {
    color: var(--muted);
}

textarea:focus {
    border-color: var(--accent);
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.attach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.attach-btn:hover {
    color: var(--text);
    border-color: var(--accent);
}

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 6px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.82rem;
}

.file-chip[hidden] {
    display: none;
}

.file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 130px;
}

.file-remove {
    width: 22px;
    height: 22px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 0.8rem;
    cursor: pointer;
}

.file-remove:hover {
    color: var(--error);
    background: transparent;
}

#submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 48px;
    height: 48px;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

#submit-btn:hover {
    background: var(--accent-hover);
}

#submit-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.status {
    min-height: 24px;
    margin: 12px 6px 0;
    font-size: 1.25rem;
    line-height: 24px;
    color: transparent;
}

.status.ok {
    color: var(--ok);
}

.status.error {
    color: var(--error);
}
