:root {
    color-scheme: light dark;
    --bg: #f6f5f3;
    --card: #ffffff;
    --text: #1c1c1c;
    --muted: #6b6b6b;
    --accent: #1877f2;
    --accent-dark: #145dbf;
    --danger: #d9363e;
    --border: #e4e2df;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #15171a;
        --card: #1f2226;
        --text: #f0f0f0;
        --muted: #a0a0a0;
        --border: #2c2f33;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    justify-content: center;
    padding: 24px 16px 64px;
}

.wrap { width: 100%; max-width: 480px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 16px;
}

h1 { font-size: 1.4rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
p.muted, .muted { color: var(--muted); font-size: 0.92rem; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.topbar a { color: var(--text); text-decoration: none; font-size: 0.9rem; }

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 0.9rem; }
input[type=text], input[type=number], input[type=url], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
}
textarea { min-height: 90px; resize: vertical; }

.btn {
    display: inline-block;
    padding: 11px 18px;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
    margin-top: 16px;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.error { color: var(--danger); font-size: 0.9rem; margin-top: 8px; }

.watcher {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}
.watcher .meta { font-size: 0.85rem; color: var(--muted); }
.progress {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}
.progress > div { height: 100%; background: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
td, th { padding: 8px 4px; border-bottom: 1px solid var(--border); text-align: left; }
