/* Bellarine North Rotary roster. Rotary royal blue + gold, friendly and mobile first. */
:root {
  --blue: #17458f;
  --blue-dark: #0e2f66;
  --azure: #0067c8;
  --gold: #f7a81b;
  --gold-soft: #fff3da;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --text: #1a2233;
  --muted: #5d677a;
  --border: #e1e6ef;
  --green: #18804f;
  --green-soft: #e3f5ec;
  --red: #c42d47;
  --red-soft: #fdebee;
  --amber: #a76200;
  --amber-soft: #fff1dc;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(16 32 64 / 6%), 0 6px 20px rgb(16 32 64 / 6%);
  --shadow-hover: 0 2px 4px rgb(16 32 64 / 8%), 0 12px 32px rgb(16 32 64 / 12%);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 0.75em; }
a { color: var(--azure); }
img, svg { max-width: 100%; }

.wrap { width: min(960px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

.icon { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.18em; }

/* Header & footer */
.site-header { background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 rgb(16 32 64 / 3%); }
.site-header::after { content: ''; display: block; height: 4px; background: linear-gradient(90deg, #17458f 0 70%, #f7a81b 70%); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-logo { height: 68px; width: auto; display: block; }
.brand-tag { padding-left: 14px; border-left: 1px solid var(--border); color: var(--muted); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.74rem; line-height: 1.2; max-width: 80px; }
.site-nav { display: flex; gap: 4px; }
.site-nav a { color: #17458f; text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover { background: #eef2fa; }
.site-nav a[aria-current='page'] { background: #17458f; color: #fff; }
main { padding-block: 28px 56px; min-height: 60vh; }
.site-footer { border-top: 1px solid var(--border); padding-block: 24px; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: transform 0.1s, background 0.15s, box-shadow 0.15s;
  min-height: 44px;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold); border-color: var(--gold); color: #1a1a1a; }
.btn-primary:hover { background: #ffb836; }
.btn-outline { background: transparent; border-color: var(--blue); color: var(--blue); }
.btn-danger { color: var(--red); }
.btn-small { padding: 6px 12px; min-height: 34px; font-size: 0.88rem; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-link { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--azure); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-link.danger { color: var(--red); }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 0.9rem; }
.field input, .field textarea {
  font: inherit; font-weight: 400; font-size: 1rem; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 100%; min-height: 44px;
}
.field input:focus, .field textarea:focus { border-color: var(--azure); outline: 3px solid rgb(0 103 200 / 18%); }
.checkbox { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.checkbox input { width: 20px; height: 20px; accent-color: var(--blue); }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.span-2, .span-full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 16px; align-items: center; margin-top: 24px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }

/* Flash messages */
.flash { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; font-weight: 600; margin: 12px 0; }
.flash-ok { background: var(--green-soft); color: var(--green); }
.flash-error { background: var(--red-soft); color: var(--red); display: block; }
.flash ul { margin: 4px 0 0; padding-left: 20px; font-weight: 400; }
.flash p { margin: 0; }
.banner { background: var(--gold-soft); border: 1px solid var(--gold); padding: 10px 14px; border-radius: 10px; font-weight: 600; }

/* Hero */
.hero { padding: 8px 0 24px; max-width: 640px; }
.hero-small { padding-bottom: 12px; }
.eyebrow { color: var(--amber); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; margin-bottom: 6px; }
.lead { font-size: 1.12rem; color: var(--muted); }
.empty-state { text-align: center; padding: 48px 16px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }

/* Progress */
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin: 12px 0 10px; }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--azure), var(--blue)); transition: width 0.4s ease; }
.is-full .progress-bar { background: var(--green); }
.is-urgent .progress-bar { background: linear-gradient(90deg, var(--gold), #f08c00); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 38.5px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: linear-gradient(var(--gold), var(--blue)); opacity: 0.35; }
.timeline-month { margin: 8px 0 12px 96px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; }
.timeline-item { display: grid; grid-template-columns: 80px 1fr; gap: 16px; margin-bottom: 20px; position: relative; }
.timeline-marker { display: flex; justify-content: center; padding-top: 14px; }
.countdown {
  width: 72px; height: 72px; border-radius: 18px; background: var(--surface); border: 2px solid var(--blue);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  box-shadow: var(--shadow); position: relative; z-index: 1; flex: none; overflow: hidden;
}
.countdown strong { font-size: 1.75rem; line-height: 1; color: var(--blue); font-variant-numeric: tabular-nums; }
.countdown span { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 4px; line-height: 1; }
.countdown .countdown-word { font-size: 0.95rem; line-height: 1.15; padding: 0 4px; }
.is-urgent .countdown { border-color: var(--gold); background: var(--gold-soft); }
.is-urgent .countdown strong { color: var(--amber); }
.is-full .countdown { border-color: var(--green); background: var(--green-soft); }
.is-full .countdown strong { color: var(--green); }

.event-card {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
  color: inherit; text-decoration: none; box-shadow: var(--shadow); transition: box-shadow 0.2s, transform 0.2s;
}
.event-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.event-card h2 { font-size: 1.3rem; color: var(--blue-dark); }
.event-card-body { min-width: 0; }
.event-card-cta { grid-column: 2; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--azure); margin-top: 4px; }
.event-card:hover .event-card-cta .icon { transform: translateX(3px); }
.event-card-cta .icon { transition: transform 0.2s; }

.date-chip { width: 58px; border-radius: 12px; overflow: hidden; text-align: center; border: 1px solid var(--border); background: var(--surface); flex: none; }
.date-chip-month { display: block; background: var(--blue); color: #fff; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 0; }
.date-chip-day { display: block; font-size: 1.5rem; font-weight: 800; padding: 4px 0 0; line-height: 1.2; color: var(--text); }
.date-chip-weekday { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 0 0 6px; }

.event-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 0.95rem; margin: 0; }
.event-meta > * { display: inline-flex; align-items: center; gap: 6px; }
.event-meta a { color: var(--muted); }
.event-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.95rem; }
.stat { display: inline-flex; align-items: center; gap: 6px; }
.stat strong { font-size: 1.05rem; }
.stat-left { color: var(--amber); font-weight: 600; }
.stat-full { color: var(--green); font-weight: 700; }

/* Event page */
.back-link { display: inline-block; margin-bottom: 16px; font-weight: 600; text-decoration: none; }
.event-hero { background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); padding: 24px; box-shadow: var(--shadow); margin-bottom: 32px; }
.event-hero-top { display: flex; gap: 20px; align-items: center; margin-bottom: 12px; }
.event-hero h1 { margin-bottom: 8px; color: var(--blue-dark); }
.event-description { white-space: pre-line; max-width: 65ch; }
.admin-shortcuts { display: flex; gap: 16px; margin: 12px 0 0; font-weight: 600; }

.shift-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; align-items: start; }
.shift-day { grid-column: 1 / -1; margin: 12px 0 0; color: var(--muted); font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; }
.shift-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border-top: 5px solid var(--azure); }
.shift-card.is-full { border-top-color: var(--green); }
.shift-card.is-past { opacity: 0.65; border-top-color: var(--border); }
.shift-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.shift-card h3 { margin-bottom: 4px; }
.shift-time { margin: 0; color: var(--text); font-weight: 600; font-size: 0.95rem; }
.shift-time .muted { font-weight: 400; }
.shift-notes { font-size: 0.9rem; color: var(--muted); background: var(--surface-2); padding: 8px 10px; border-radius: 8px; }
.badge { flex: none; font-size: 0.8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); white-space: nowrap; }
.is-full .badge { background: var(--green-soft); color: var(--green); }
.is-past .badge { background: var(--surface-2); color: var(--muted); }
.names { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.name-chip { padding: 4px 12px; border-radius: 999px; background: #e8eefa; color: #17458f; font-weight: 600; font-size: 0.9rem; }
.name-chip.is-taken { background: #eef1f6; color: var(--muted); }
.name-chip.is-open { background: transparent; border: 1.5px dashed var(--border); color: var(--muted); font-weight: 500; }
.shift-actions { display: flex; flex-direction: column; gap: 8px; }
.shift-actions details[open] > summary.btn { display: none; }
.shift-actions details.remove[open] > summary { margin-bottom: 4px; }
.shift-actions summary.btn { width: 100%; }
.person-form { display: grid; gap: 10px; margin-top: 4px; }
.person-form .btn { width: 100%; }

/* My shifts */
.lookup-form { display: grid; gap: 14px; margin-bottom: 20px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.my-shift-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.my-shift { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.my-shift-event { font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; text-decoration: none; }
.my-shift h3 { margin: 2px 0 6px; }

/* Login */
.login { display: flex; justify-content: center; padding-top: 24px; }
.login-card { width: min(400px, 100%); display: grid; gap: 14px; }
.login-card h1 { margin: 0; }
.login-card p { margin: 0; }

/* Admin */
.admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-actions form { margin: 0; }
.tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.tabs a { padding: 6px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; color: var(--muted); border: 1px solid var(--border); background: var(--surface); }
.tabs a[aria-current='page'] { background: var(--blue); border-color: var(--blue); color: #fff; }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.admin-event { display: grid; gap: 14px; }
.admin-event-main { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.admin-event h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.admin-event h2 a { color: var(--blue-dark); text-decoration: none; }
.admin-event .progress { margin-bottom: 0; }
.tag { font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.04em; }
.tag-live { background: var(--green-soft); color: var(--green); border-color: transparent; }
.admin-form section { margin-bottom: 24px; }
.admin-form h2 { margin-top: 28px; }
#shift-rows { display: grid; gap: 14px; margin-bottom: 14px; }
.shift-row { margin: 0; border-left: 5px solid var(--azure); min-width: 0; }
.shift-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.shift-row-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 10px; }
.roster-shift { margin-bottom: 16px; border-left: 5px solid var(--azure); }
.roster-shift.is-full { border-left-color: var(--green); }
.roster-shift.is-over { border-left-color: var(--gold); }
.roster-shift-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.roster-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 0.95rem; }
.roster-table th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.roster-table td { padding: 8px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.roster-table .open-row td { color: var(--muted); font-style: italic; }
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; margin-top: 10px; }

/* Small screens */
@media (max-width: 640px) {
  main { padding-top: 20px; }
  .site-header-inner { padding-block: 10px; }
  .brand-logo { height: 50px; }
  .brand-tag { display: none; }
  .timeline::before { left: 27px; }
  .timeline-item { grid-template-columns: 56px 1fr; gap: 10px; }
  .timeline-month { margin-left: 66px; }
  .countdown { width: 56px; height: 56px; border-radius: 14px; }
  .countdown strong { font-size: 1.35rem; }
  .countdown span { font-size: 0.58rem; margin-top: 3px; }
  .countdown .countdown-word { font-size: 0.78rem; }
  .event-card { gap: 4px 12px; padding: 16px; }
  .date-chip { width: 48px; }
  .date-chip-day { font-size: 1.25rem; }
  .date-chip-month, .date-chip-weekday { font-size: 0.64rem; }
  .event-hero { padding: 18px; }
  .event-hero-top { align-items: flex-start; }
  .form-grid, .shift-grid, .inline-form { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .roster-table thead { display: none; }
  .roster-table tr { display: grid; grid-template-columns: 1fr auto; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .roster-table td { border: 0; padding: 2px 0; }
  .roster-table td:first-child { font-weight: 700; }
}

/* Print: a clean roster sheet */
@media print {
  :root { color-scheme: light; --text: #000; --muted: #444; --surface: #fff; --border: #bbb; }
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .no-print, .skip-link { display: none !important; }
  main { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; border-left-width: 1px; }
  a { color: #000; text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Roles */
.optional { font-weight: 400; color: var(--muted); }
select {
  font: inherit; font-size: 1rem; padding: 10px 36px 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d677a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 18px;
  color: var(--text); min-height: 44px; width: 100%; appearance: none;
}
select:focus { border-color: var(--azure); outline: 3px solid rgb(0 103 200 / 18%); }
.field select { font-weight: 400; }
.chip-role { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #fff; color: var(--amber); font-size: 0.76rem; font-weight: 700; }
.role-picker { display: flex; align-items: center; gap: 8px; }
.role-picker select { min-height: 36px; padding-block: 6px; font-size: 0.9rem; min-width: 140px; }
.saved { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.print-only { display: none; }
.role-change { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.role-change label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.role-change select { min-height: 36px; padding-block: 6px; font-size: 0.9rem; width: auto; min-width: 160px; }
.role-add { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.role-add .field { flex: 1 1 240px; }
.role-list { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; }
.role-row { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 14px 16px; }
.role-row.is-archived { background: var(--surface-2); box-shadow: none; }
.role-rename { display: flex; gap: 8px; align-items: center; flex: 1 1 260px; }
.role-rename input { font: inherit; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); min-height: 38px; flex: 1; min-width: 0; }
.role-name { flex: 1 1 200px; }
.role-usage { font-size: 0.88rem; }
.section-heading { margin-top: 28px; }
.admin-actions .btn[disabled] { opacity: 0.4; cursor: default; box-shadow: none; }
@media print { .print-only { display: inline; } }
.shift-time .icon { margin-right: 4px; }
.shift-time .muted { white-space: nowrap; }

/* Role counts per shift */
.role-counts { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; border: 0; margin: 0; padding: 0; min-width: 0; }
.role-counts legend { font-weight: 600; font-size: 0.9rem; padding: 0; margin-bottom: 6px; }
.role-count { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.role-count input {
  font: inherit; font-size: 1rem; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); width: 6rem; min-height: 40px;
}
.role-needs { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.88rem; color: var(--amber); }
.role-needs strong { font-weight: 700; }
.role-needs .is-full { color: var(--green); }

/* Backups */
.backup-names { font-size: 0.9rem; color: var(--muted); margin: 0 0 12px; }
.backup-label { font-weight: 700; }
.roster-backups-heading { font-size: 1rem; margin: 16px 0 0; }
.row-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.my-shift h3 .tag { margin-left: 8px; vertical-align: middle; }

/* Attendance log */
.recorder { margin-bottom: 20px; }
.recorder-now { margin: 0 0 6px; }
.recorder-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.recorder-form .field { flex: 1 1 240px; }
.log-shift { margin-bottom: 16px; border-left: 5px solid var(--azure); }
.log-shift > h2 { margin-bottom: 2px; }
.log-row {
  display: grid; grid-template-columns: minmax(150px, 1.3fr) auto auto minmax(160px, 2fr) 8.5rem;
  gap: 8px 14px; align-items: end; padding: 14px 0; border-top: 1px solid var(--border);
}
.log-row.is-in .log-person strong::before { content: "✓ "; color: var(--green); }
.log-person { display: flex; flex-direction: column; gap: 2px; align-self: center; }
.log-person .tag { align-self: flex-start; margin-top: 2px; }
.log-person-meta { color: var(--muted); font-size: 0.85rem; }
.log-time { display: flex; align-items: flex-end; gap: 6px; }
.log-time label, .log-notes { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.log-row input {
  font: inherit; font-size: 1rem; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); min-height: 40px; width: 100%;
}
.log-time input { width: 8.5rem; }
.log-save { display: flex; align-items: center; gap: 10px; }
.log-msg, .log-stamp { grid-column: 1 / -1; margin: 0; }
.log-stamp { font-size: 0.8rem; color: var(--muted); }
@media (max-width: 860px) {
  .log-row { grid-template-columns: 1fr 1fr; }
  .log-person, .log-notes, .log-save { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .log-row { grid-template-columns: 1fr; }
}

/* Incidents */
#incidents { margin-bottom: 16px; border-left: 5px solid var(--red); }
.incidents-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.incident { padding: 14px 0; border-top: 1px solid var(--border); }
.incident-body { display: grid; grid-template-columns: 9.5rem 1fr; gap: 4px 14px; margin: 0 0 6px; }
.incident-body dt { font-weight: 700; color: var(--muted); font-size: 0.85rem; padding-top: 2px; }
.incident-body dd { margin: 0; white-space: pre-line; }
.incident-history { margin-top: 28px; }
.incident-version { margin-bottom: 12px; background: var(--surface-2); box-shadow: none; }
@media (max-width: 560px) {
  .incident-body { grid-template-columns: 1fr; }
  .incident-body dd { margin-bottom: 6px; }
}
