:root {
    color-scheme: light;
    --ink: #1e2528;
    --muted: #657075;
    --line: #d9e0df;
    --paper: #ffffff;
    --soft: #f4f7f6;
    --accent: #0f766e;
    --accent-2: #b45309;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--soft);
    color: var(--ink);
}

a {
    color: var(--accent);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.brand {
    font-weight: 800;
    color: var(--ink);
    text-decoration: none;
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.topbar nav a {
    text-decoration: none;
    color: var(--muted);
    font-size: 14px;
}

.shell {
    width: min(1120px, calc(100% - 32px));
    margin: 28px auto 64px;
}

.auth-panel,
.panel,
.category-panel,
.danger-zone,
.report-page {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

.auth-panel {
    max-width: 440px;
    margin: 56px auto;
}

.page-head {
    margin-bottom: 22px;
}

h1,
h2,
h3 {
    line-height: 1.2;
}

h1 {
    font-size: 34px;
    margin: 0 0 8px;
}

h2 {
    font-size: 21px;
}

p {
    line-height: 1.6;
}

.muted,
.question {
    color: var(--muted);
}

form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

input,
textarea,
button {
    font: inherit;
}

input,
textarea {
    width: 100%;
    border: 1px solid #b7c2c0;
    border-radius: 6px;
    padding: 11px 12px;
    background: #fff;
}

textarea {
    resize: vertical;
}

button,
.primary-link {
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    padding: 11px 15px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.primary-link {
    margin-bottom: 22px;
}

button.danger {
    background: var(--danger);
}

.assessment-form {
    display: grid;
    gap: 18px;
}

.rating-grid {
    display: grid;
    grid-template-columns: repeat(9, minmax(42px, 1fr));
    gap: 8px;
    margin: 14px 0;
}

.rating-grid label {
    display: block;
}

.rating-grid input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rating-grid span {
    display: grid;
    place-items: center;
    min-height: 44px;
    border: 1px solid #b7c2c0;
    border-radius: 6px;
    font-weight: 800;
}

.rating-grid input:checked + span {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.submit-wide {
    width: 100%;
    min-height: 52px;
}

.table {
    display: grid;
    gap: 8px;
}

.table a,
.table div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 6px;
    text-decoration: none;
    color: var(--ink);
}

.flash,
.notice {
    padding: 13px 15px;
    border-radius: 6px;
    margin-bottom: 16px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.flash.success,
.notice.success {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.flash.error {
    background: #fef2f2;
    border-color: #fecaca;
}

.report-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.report-actions form {
    display: inline;
}

.report-page canvas {
    width: 100%;
    max-width: 760px;
    height: auto;
    display: block;
    margin: 20px auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.mini-card {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 14px;
    margin: 12px 0;
    background: #fbfcfc;
}

.disclaimer {
    color: var(--muted);
    font-size: 13px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

@media (max-width: 720px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .rating-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .columns {
        grid-template-columns: 1fr;
    }
}

@page {
    size: landscape;
    margin: 12mm;
}

@media print {
    body {
        background: #fff;
    }

    .topbar,
    .report-actions,
    .flash {
        display: none !important;
    }

    .shell {
        width: 100%;
        margin: 0;
    }

    .report-page {
        border: 0;
        padding: 0;
    }

    .mini-card {
        break-inside: avoid;
    }
}

