:root {
    color-scheme: light;
    --ink: #17211d;
    --muted: #68736d;
    --line: #dfe6e2;
    --surface: #ffffff;
    --canvas: #f3f6f4;
    --green: #166534;
    --green-dark: #0e4b27;
    --danger: #b42318;
    --danger-dark: #8f1c13;
    --shadow: 0 18px 50px rgba(23, 33, 29, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--canvas);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button, input, textarea { font: inherit; }

.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 70px; }

.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.brand-mark, .preview-app-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: var(--green);
    color: #fff;
    font-weight: 800;
}
.brand-mark { width: 52px; height: 52px; border-radius: 15px; font-size: 1.45rem; }
.brand h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.15; }
.eyebrow { display: block; color: var(--green); font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.logout-form { margin-left: auto; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr); gap: 24px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.login-card { max-width: 500px; margin: 70px auto 0; }
.card-heading { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 24px; }
.card-heading h2 { margin: 0 0 3px; font-size: 1.2rem; }
.card-heading p { margin: 0; color: var(--muted); font-size: .92rem; }
.icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #e9f5ed; color: var(--green); }

.form-stack { display: grid; gap: 19px; }
label { display: grid; gap: 7px; font-weight: 700; font-size: .92rem; }
input, textarea { width: 100%; border: 1px solid #cbd5cf; border-radius: 11px; padding: 12px 13px; color: var(--ink); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(22, 101, 52, .1); }
textarea { resize: vertical; min-height: 110px; }
.field-meta { justify-self: end; margin-top: -3px; color: var(--muted); font-size: .78rem; font-weight: 500; }
.field-hint { color: var(--muted); font-size: .8rem; font-weight: 500; }

.button { border: 0; border-radius: 11px; padding: 11px 17px; cursor: pointer; font-weight: 800; transition: transform .1s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--green); color: #fff; }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.button-danger { background: var(--danger); color: #fff; padding: 14px 18px; }
.button-danger:hover { background: var(--danger-dark); }

.preview { border-radius: 14px; background: #eef1ef; padding: 16px; }
.preview-label { display: block; margin-bottom: 10px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.notification-preview { display: flex; gap: 12px; background: rgba(255,255,255,.94); border: 1px solid rgba(0,0,0,.06); border-radius: 14px; padding: 13px; box-shadow: 0 10px 25px rgba(0,0,0,.09); }
.preview-app-icon { width: 42px; height: 42px; border-radius: 10px; }
.notification-preview strong { display: block; font-size: .92rem; }
.notification-preview p { margin: 2px 0 4px; color: #34413a; font-size: .87rem; overflow-wrap: anywhere; }
.notification-preview small { color: var(--muted); }

.confirmation { grid-template-columns: 20px 1fr; align-items: start; gap: 10px; border: 1px solid #f2c6c2; border-radius: 12px; background: #fff7f6; padding: 13px; font-weight: 500; }
.confirmation input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--danger); }

.notice { margin-bottom: 20px; border-radius: 12px; padding: 13px 16px; }
.notice ul { margin: 7px 0 0; padding-left: 20px; }
.notice-success { color: #14532d; background: #dcfce7; border: 1px solid #bbf7d0; }
.notice-warning { color: #713f12; background: #fefce8; border: 1px solid #fde68a; }
.notice-error { color: #7f1d1d; background: #fef2f2; border: 1px solid #fecaca; }

.history-card { position: sticky; top: 20px; }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li { padding: 15px 0; border-top: 1px solid var(--line); }
.history-list li:first-child { border-top: 0; padding-top: 0; }
.history-list p { margin: 5px 0; color: #46524c; font-size: .88rem; }
.history-list small, .empty-state { color: var(--muted); font-size: .8rem; }
.history-topline { display: flex; justify-content: space-between; align-items: flex-start; gap: 9px; }
.status { flex: 0 0 auto; border-radius: 999px; padding: 3px 7px; font-size: .65rem; font-weight: 800; }
.status-sent { color: #166534; background: #dcfce7; }
.status-failed { color: #991b1b; background: #fee2e2; }

.setup-shell { max-width: 760px; }
.setup-card { margin-top: 44px; }
.code-output { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; overflow-wrap: anywhere; }
.copy-button { justify-self: start; margin-top: -10px; }
.setup-next { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; color: #46524c; font-size: .9rem; }
.setup-next code { border-radius: 5px; background: #edf1ee; padding: 2px 5px; color: var(--ink); }

@media (max-width: 820px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .history-card { position: static; }
}

@media (max-width: 520px) {
    .shell { width: min(100% - 20px, 1120px); padding-top: 20px; }
    .card { padding: 20px; border-radius: 16px; }
    .brand { align-items: flex-start; }
    .brand-mark { width: 44px; height: 44px; }
    .button-secondary { padding: 9px 11px; font-size: .82rem; }
}
