:root {
    --bg: #f5f6f8;
    --surface: #fff;
    --text: #1a1a2e;
    --muted: #666;
    --border: #ddd;
    --primary: #2563eb;
    --danger: #dc2626;
    --success: #16a34a;
}

* { box-sizing: border-box; }
body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    line-height: 1.5;
}
.nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
}
.nav a { margin-right: 1rem; color: var(--primary); text-decoration: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
h1 { margin-top: 0; }
h2 { margin-top: 2rem; }
.form label { display: block; margin-bottom: 1rem; }
.form input[type="text"], .form input[type="url"], .form input[type="password"],
.form input[type="number"], .form select, .form textarea {
    display: block;
    width: 100%;
    max-width: 480px;
    padding: 0.5rem;
    margin-top: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}
.checkbox { display: flex; align-items: center; gap: 0.5rem; }
.checkbox input { width: auto; }
.btn, button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}
.btn-danger { background: var(--danger); }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.data-table th, .data-table td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    text-align: left;
    vertical-align: top;
}
.data-table th { background: #eef2ff; }
.error { color: var(--danger); }
.success { color: var(--success); }
.note { color: var(--muted); font-size: 0.9rem; }
.warning { color: #b45309; font-size: 0.9rem; background: #fffbeb; border: 1px solid #fcd34d; padding: 0.5rem 0.75rem; border-radius: 4px; }
.feed-url { font-size: 0.85rem; }
.inline-form { display: inline; }
.inline-form button { font-size: 0.8rem; padding: 0.25rem 0.5rem; }
.mask-row { margin-bottom: 0.75rem; }
.mask-row span { font-weight: 600; display: block; margin-bottom: 0.25rem; }
.mask-row label { display: inline; margin-right: 1rem; }
.checkbox-list label { display: block; }
fieldset { border: 1px solid var(--border); padding: 1rem; margin: 1rem 0; background: var(--surface); }
.danger-form { margin-top: 1.5rem; }
.events-inspector { margin-top: 2rem; }
.events-filters { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; margin-bottom: 1rem; }
.month-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.month-label { font-weight: 600; min-width: 10rem; text-align: center; }
.view-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.view-tab {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}
.view-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.events-filter-form label { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; }
.events-filter-form select { padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 4px; }
.data-table tr.warning-row { background: #fffbeb; }
.matrix-wrap { overflow-x: auto; margin-bottom: 2rem; }
.matrix-table { min-width: 100%; font-size: 0.85rem; }
.matrix-sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 12rem; }
.matrix-cell { text-align: center; white-space: nowrap; }
.matrix-origin { background: #ecfdf5; }
.matrix-echo { background: #fffbeb; color: #92400e; }
.matrix-missing { background: #fef2f2; color: #b91c1c; font-weight: 600; }
.matrix-empty { color: var(--muted); }
