:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --text: #1f2933;
    --muted: #6b7280;
    --border: #d7dbe0;
    --accent: #2563eb;
    --error: #b91c1c;
    --error-bg: #fdecec;
    --notice: #166534;
    --notice-bg: #e7f6ec;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.site-header .brand {
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
}

.site-nav a {
    margin-left: 16px;
    color: var(--accent);
    text-decoration: none;
}

.site-nav .nav-user {
    color: var(--muted);
    margin-left: 16px;
}

.site-main {
    max-width: 420px;
    margin: 40px auto;
    padding: 0 20px;
}

.site-main h1 {
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--muted);
}

.auth-form input,
.auth-form select,
.auth-form textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.auth-form button {
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}

.auth-form button:hover {
    opacity: 0.92;
}

.form-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid var(--error);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.9rem;
}

.form-notice {
    background: var(--notice-bg);
    color: var(--notice);
    border: 1px solid var(--notice);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 0.9rem;
}

.site-footer {
    text-align: center;
    color: var(--muted);
    padding: 24px 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.admin-table thead th {
    background: var(--bg);
    color: var(--muted);
    font-weight: 600;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr.me {
    background: #eef4ff;
    font-weight: 600;
}

.campaign-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.campaign-switch a {
    color: var(--accent);
    text-decoration: none;
}

.campaign-switch a.current {
    font-weight: 700;
    color: var(--text);
}

.row-actions {
    display: flex;
    gap: 8px;
}

.row-actions form {
    margin: 0;
}

.row-actions button {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.row-actions .btn-approve {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.row-actions .btn-reject {
    background: var(--card);
    color: var(--muted);
}

#msg-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 12px;
    height: 360px;
    overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

#msg-list .msg {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

#msg-list .msg:last-child {
    border-bottom: none;
}

#msg-list .msg-user {
    font-weight: 600;
    flex: 0 0 auto;
}

#msg-list .msg-body {
    flex: 1 1 auto;
    word-break: break-word;
}

#msg-list .msg-time {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.8rem;
}

.chat-form {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.chat-form textarea {
    flex: 1 1 auto;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
}

.chat-form button {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

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

.case-head {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}

.case-cat {
    font-size: 0.78rem;
    color: #fff;
    background: var(--accent);
    border-radius: 999px;
    padding: 2px 10px;
}

.case-body {
    white-space: pre-wrap;
    margin: 6px 0;
}

.case-meta {
    color: var(--muted);
    font-size: 0.82rem;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.radio-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-direction: row;
    color: var(--text);
    font-size: 0.95rem;
}
