:root {
    color-scheme: light dark;

    --bg: #ffffff;
    --bg-secondary: #f5f5f5;
    --text: #111111;
    --text-muted: #666666;
    --border: #dcdcdc;
    --button: #2563eb;
    --button-hover: #1d4ed8;
    --button-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121212;
        --bg-secondary: #1e1e1e;
        --text: #f5f5f5;
        --text-muted: #a0a0a0;
        --border: #333333;
        --button: #3b82f6;
        --button-hover: #60a5fa;
        --button-text: #ffffff;
    }
}

* {
    box-sizing: border-box;
}

body {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
}

h1 {
    margin-top: 0;
    margin-bottom: 12px;
}

.small {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.share-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 8px;
    word-break: break-word;
}

.share-box a {
    color: inherit;
}

textarea {
    width: 100%;
    min-height: calc(100vh - 280px);
    padding: 16px;
    font-size: 16px; /* Prevents zoom on iOS */
    line-height: 1.5;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    resize: vertical;
}

.actions {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    padding-top: 12px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.button-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    flex: 1;
    min-height: 48px;
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    background: var(--button);
    color: var(--button-text);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background: var(--button-hover);
}

.counter {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: right;
}

@media (min-width: 768px) {
    body {
        padding: 24px;
    }

    button {
        flex: 0 0 auto;
    }

    textarea {
        min-height: 500px;
    }
}