:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --text: #1f2933;
    --muted: #616e7c;
    --border: #d9dee4;
    --primary: #2563a8;
    --primary-dark: #1d4f87;
    --danger: #b3261e;
    --notice-bg: #e6f1fb;
    --error-bg: #fbe9e7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

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

.topbar-user {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 0;
}

main {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

section {
    margin-bottom: 32px;
}

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

h2 {
    font-size: 1.05rem;
    margin: 0;
}

p {
    margin: 8px 0;
    overflow-wrap: anywhere;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

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

.login {
    max-width: 360px;
    margin: 48px auto;
}

.muted {
    color: var(--muted);
    font-size: 0.9rem;
}

.activity summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    list-style: none;
    cursor: pointer;
}

.activity summary::-webkit-details-marker {
    display: none;
}

.activity summary::before {
    content: "▸";
    color: var(--muted);
}

.activity[open] summary::before {
    content: "▾";
}

.activity-heading {
    flex: 1;
    min-width: 0;
}

.activity-links {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.activity summary .status {
    max-width: 50%;
    white-space: normal;
    text-align: right;
}

.activity summary:hover h2 {
    color: var(--primary);
}

.activity[open] summary {
    margin-bottom: 12px;
}

.submission-form {
    margin-top: 12px;
    border-top: 1px solid var(--border);
}

.status {
    color: #1b6e3c;
    font-size: 0.9rem;
    font-weight: 600;
}

.notice,
.error {
    padding: 8px 12px;
    border-radius: 6px;
}

.notice {
    background: var(--notice-bg);
}

.error {
    background: var(--error-bg);
    color: var(--danger);
}

label {
    display: block;
    margin-top: 12px;
    font-weight: 600;
}

input,
textarea {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
}

.hint {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 400;
}

button,
.button {
    display: inline-block;
    margin-top: 16px;
    padding: 8px 14px;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: var(--primary-dark);
}

.section-head .button {
    margin-top: 0;
}

button.link {
    margin: 0;
    padding: 0;
    background: none;
    color: var(--primary);
    font-weight: 400;
    text-decoration: underline;
}

button.danger {
    background: none;
    color: var(--danger);
    border: 1px solid var(--danger);
}

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

.actions {
    display: flex;
    gap: 16px;
    align-items: baseline;
}

.danger-zone {
    margin-top: 16px;
    padding-top: 4px;
    border-top: 1px solid var(--border);
}

.images {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.images img {
    display: block;
    max-width: 100%;
    max-height: 480px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.image-grid:empty {
    display: none;
}

.image-tile {
    margin: 0;
    font-weight: 400;
}

.image-tile img {
    display: block;
    width: 100%;
    height: 110px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.image-remove {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 4px;
    font-size: 0.9rem;
}

.image-remove input {
    width: auto;
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

tbody tr:last-child td {
    border-bottom: 0;
}

th {
    color: var(--muted);
    font-size: 0.85rem;
}

.right {
    text-align: right;
}
