:root {
    --text: #111827;
    --muted: #6b7280;
    --background: #f3f4f6;
    --card: #ffffff;
    --border: #e5e7eb;
    --approve: #15803d;
    --reject: #b91c1c;
    --modify: #1d4ed8;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--background);
    line-height: 1.5;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.container { max-width: 860px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.4rem; margin: 0 0 12px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 16px 0 8px; }

.card {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin: 0 0 12px;
}

.card.narrow { max-width: 420px; margin: 24px auto; }
.list-item { color: var(--text); text-decoration: none; display: grid; gap: 2px; }
.list-item:hover { border-color: var(--modify); }

dl { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 6px 12px; margin: 0; }
dt { color: var(--muted); font-size: 0.9rem; }
dd { margin: 0; word-break: break-word; }
dd ul { margin: 0; padding-left: 18px; }

@media (max-width: 600px) {
    dl { grid-template-columns: 1fr; }
    dd { margin-bottom: 8px; }
}

pre.message {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    margin: 0;
}

iframe.message-html { width: 100%; min-height: 240px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.preview { width: 100%; max-height: 80vh; border: 1px solid var(--border); border-radius: 6px; margin: 12px 0; }
iframe.preview { height: 70vh; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--reject); }
.notice { background: #fef3c7; border-radius: 6px; padding: 8px 12px; }
.notice.danger { background: #fee2e2; }

.badge { display: inline-block; font-size: 0.75rem; font-weight: 400; padding: 1px 8px; border-radius: 10px; background: #f3f4f6; vertical-align: middle; }
.badge.ai { background: #e0e7ff; }
.badge.fact { background: #dcfce7; }
.badge.unverified { background: #fef3c7; }
.badge.proposal { background: #fce7f3; }
.badge.danger { background: #fee2e2; }

label { display: block; margin: 12px 0 4px; font-weight: 600; }
input, textarea { width: 100%; padding: 10px; font: inherit; border: 1px solid var(--border); border-radius: 6px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.actions form { margin: 0; }
.reject-form { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 4px; }
.inline { display: inline; }

.button {
    display: inline-block;
    padding: 12px 20px;
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    margin-top: 8px;
}

.button.primary, .button.modify { background: var(--modify); }
.button.approve { background: var(--approve); }
.button.reject { background: var(--reject); }
.button.secondary { background: #4b5563; }
.link-button { background: none; border: 0; color: var(--modify); cursor: pointer; font: inherit; }
.attachments { padding-left: 18px; }
.attachments li { margin-bottom: 6px; }
.button.actual { background: #7c2d12; color: #ffffff; }
.actual-recipient-form { margin-top: 16px; padding: 12px; border: 2px solid #7c2d12; border-radius: 8px; }
.actual-recipient-form h3 { margin-top: 0; }
label.confirm { display: block; margin: 8px 0; font-weight: 600; }
