/* ── Design tokens (identical to bookmarks) ───────────────────────────────── */
:root {
  --bg:              #f6f8fa;
  --panel:           #ffffff;
  --panel-soft:      #f6f8fa;
  --header:          #1f2328;
  --header-soft:     #2d333b;
  --text:            #24292f;
  --muted:           #57606a;
  --line:            #d0d7de;
  --line-strong:     #8c959f;
  --accent:          #0969da;
  --accent-soft:     #ddf4ff;
  --danger:          #cf222e;
  --danger-soft:     #ffebe9;
  --success:         #1a7f37;
  --success-soft:    #dafbe1;
  --warning:         #9a6700;
  --warning-soft:    #fff8c5;
  /* Orange for medium severity */
  --orange:          #e16b00;
  --orange-soft:     #fff3e0;
  /* Red alias (used for overdue ETA, critical tints) */
  --red:             #cf222e;
  /* Planned section tint */
  --planned:         #6639ba;
  --planned-soft:    #f5f0ff;
  --shadow:          0 1px 2px rgba(27, 31, 36, 0.04);
  --radius:          10px;
  --radius-lg:       14px;
  --max-width:       1280px;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 14px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

button, input, select, textarea, a { font: inherit; }
button   { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

h1 { font-size: 1.5rem;  line-height: 1.2; }
h2 { font-size: 1.22rem; line-height: 1.3; }
h3 { font-size: 1rem;    line-height: 1.4; }

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #eef2f6;
  color: var(--text);
}

.hidden { display: none !important; }

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--header);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 14px 20px;
}

/* ── Brand ────────────────────────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--header-soft);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-copy { display: grid; gap: 2px; }

.brand-copy strong {
  font-size: 0.98rem;
  font-weight: 600;
  white-space: nowrap;
}

.brand-copy span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.84rem;
  white-space: nowrap;
}

/* ── Live clock ───────────────────────────────────────────────────────────── */
.header-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}

.header-clock-time {
  font-size: 1.08rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.header-clock-date {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
}

/* ── Header controls (toggles group) ─────────────────────────────────────── */
.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── View toggle ──────────────────────────────────────────────────────────── */
.view-toggle {
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.view-toggle-btn {
  min-height: 32px;
  padding: 0 14px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  font-weight: 500;
  transition: background 120ms ease, color 120ms ease;
}

.view-toggle-btn:hover,
.view-toggle-btn:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  outline: none;
}

.view-toggle-btn-active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 600;
}


/* ── Header actions ───────────────────────────────────────────────────────── */
.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.top-button,
.list-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.top-button-primary,
.list-button-primary {
  background: var(--accent);
  color: #fff;
}

.top-button-primary:hover,
.list-button-primary:hover,
.top-button-primary:focus-visible,
.list-button-primary:focus-visible { background: #0550ae; }

.top-button-secondary,
.list-button-secondary,
.icon-button {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}

.top-button-secondary:hover,
.list-button-secondary:hover,
.icon-button:hover,
.top-button-secondary:focus-visible,
.list-button-secondary:focus-visible,
.icon-button:focus-visible { border-color: var(--line-strong); }

.list-button-danger {
  color: var(--danger);
  background: #fff;
  border-color: #f0b6b3;
}

.list-button-danger:hover,
.list-button-danger:focus-visible { background: var(--danger-soft); }

.top-button[disabled],
.list-button[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ── Page shell ───────────────────────────────────────────────────────────── */
.page-shell {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 16px 20px 48px;
  display: grid;
  gap: 16px;
}

/* ── Section panels ───────────────────────────────────────────────────────── */
.section-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px 24px;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-note,
.panel-note,
.bookmark-subtitle {
  color: var(--muted);
  line-height: 1.5;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

/* ── Status message (toast) ───────────────────────────────────────────────── */
.status-message {
  padding: 11px 14px;
  border: 1px solid #b6e3c2;
  border-radius: var(--radius);
  background: var(--success-soft);
  color: var(--success);
}

.status-message.error {
  border-color: #f0b6b3;
  background: var(--danger-soft);
  color: var(--danger);
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
  margin-top: 18px;
  padding: 32px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  text-align: center;
  color: var(--muted);
}

/* ── History hint ─────────────────────────────────────────────────────────── */
.history-hint {
  margin: 12px 0 0;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

/* ── Event cards ──────────────────────────────────────────────────────────── */
.event-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.event-card {
  border: 1px solid var(--line);
  border-left-width: 4px;          /* thickened left edge for severity accent */
  border-left-color: var(--line);  /* default — overridden below */
  border-radius: 12px;
  background: #fff;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.event-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 2px 8px rgba(27,31,36,0.08);
}

/* ── Severity-coloured left border + background tint (active events) ────── */
.event-card[data-severity="critical"][data-status="active"] {
  border-left-color: var(--danger);
  background: linear-gradient(100deg, #fff8f8 0%, #fff 120px);
}
.event-card[data-severity="medium"][data-status="active"] {
  border-left-color: var(--orange);
  background: linear-gradient(100deg, #fff9f3 0%, #fff 120px);
}
.event-card[data-severity="low"][data-status="active"] {
  border-left-color: var(--accent);
  background: linear-gradient(100deg, #f4f9ff 0%, #fff 120px);
}

/* Planned events: purple left edge */
.event-card[data-planned="true"] {
  border-left-color: var(--planned);
  background: linear-gradient(100deg, #f8f5ff 0%, #fff 120px);
}

/* Completed events: muted and receded */
.event-card[data-status="completed"] {
  border-left-color: var(--line);
  background: var(--panel-soft);
  opacity: 0.78;
}
.event-card[data-status="completed"]:hover { opacity: 1; }
.event-card[data-status="completed"] .event-card-title {
  color: var(--muted);
  font-weight: 500;
}

/* ── Critical pulsing dot ─────────────────────────────────────────────────── */
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0   rgba(207, 34, 46, 0.5); }
  60%       { box-shadow: 0 0 0 5px rgba(207, 34, 46, 0);   }
}
.event-card[data-severity="critical"][data-status="active"] .status-badge::before {
  animation: pulse-ring 2s ease-in-out infinite;
}

.event-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
}

.event-card-main { min-width: 0; }

.event-card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 6px;
}

.event-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.event-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: start;
  flex-shrink: 0;
}

.event-card-body {
  padding: 0 16px 12px;
  border-top: 1px solid var(--line);
  margin-top: 0;
}

.event-card-description {
  padding-top: 12px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.event-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
}

.event-timestamps {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.84rem;
  color: var(--muted);
}

.event-timestamps strong {
  font-weight: 600;
  color: var(--text);
}

/* ── Duration badge ───────────────────────────────────────────────────────── */
.duration-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ── ETA badge ────────────────────────────────────────────────────────────── */
.eta-badge {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.eta-active  { color: var(--success); }
.eta-overdue { color: var(--red, #c0392b); }
.eta-unknown { color: var(--muted); font-weight: 400; }

/* ── Status badges ────────────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge-active {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid #b6e3c2;
}

.status-badge-active::before { background: var(--success); }

.status-badge-completed {
  background: var(--panel-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

.status-badge-completed::before { background: var(--muted); }

.status-badge-planned {
  background: var(--planned-soft);
  color: var(--planned);
  border: 1px solid #c9b8e8;
}

.status-badge-planned::before { background: var(--planned); }

/* ── Severity badges ──────────────────────────────────────────────────────── */
.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.severity-badge-critical {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #f0b6b3;
}

.severity-badge-medium {
  background: var(--orange-soft);
  color: var(--orange);
  border: 1px solid #f9c784;
}

.severity-badge-low {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid #a8d4f9;
}

/* ── Event type badges ────────────────────────────────────────────────────── */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.type-badge-incident {
  background: #fff0f0;
  color: #a4000a;
  border: 1px solid #f5bebe;
}

.type-badge-maintenance {
  background: var(--planned-soft);
  color: var(--planned);
  border: 1px solid #cdbff5;
}

/* ── Section severity theming ─────────────────────────────────────────────── */
/* Active section changes accent colour based on highest severity in it */
#active-section[data-severity="critical"] {
  border-color: rgba(207, 34, 46, 0.35);
  box-shadow: 0 1px 4px rgba(207, 34, 46, 0.1);
}
#active-section[data-severity="critical"] .eyebrow { color: var(--danger); }
#active-section[data-severity="critical"] .summary-pill {
  background: var(--danger-soft);
  border-color: #f0b6b3;
  color: var(--danger);
}

#active-section[data-severity="medium"] {
  border-color: rgba(225, 107, 0, 0.3);
  box-shadow: 0 1px 4px rgba(225, 107, 0, 0.08);
}
#active-section[data-severity="medium"] .eyebrow { color: var(--orange); }
#active-section[data-severity="medium"] .summary-pill {
  background: var(--orange-soft);
  border-color: #f9c784;
  color: var(--orange);
}

#active-section[data-severity="low"] .eyebrow  { color: var(--accent); }
#active-section[data-severity="low"] .summary-pill {
  background: var(--accent-soft);
  border-color: #a8d4f9;
  color: var(--accent);
}

/* Planned section ─────────────────────────────────────────────────────────── */
#planned-section .eyebrow { color: var(--planned); }

/* ── Scheduled time badge ─────────────────────────────────────────────────── */
.time-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--accent-soft);
  border: 1px solid #a8d4f9;
  color: var(--accent);
  white-space: nowrap;
}

.time-badge-expired {
  background: var(--warning-soft);
  border-color: #f0d673;
  color: var(--warning);
}

/* ── Update count pill ────────────────────────────────────────────────────── */
.updates-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  cursor: pointer;
}

.updates-pill:hover { color: var(--accent); }

/* ── Calendar ─────────────────────────────────────────────────────────────── */
.calendar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-label {
  min-width: 130px;
  text-align: center;
  font-weight: 600;
  font-size: 0.96rem;
}

.calendar-wrap { margin-top: 18px; overflow-x: auto; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(40px, 1fr));
  gap: 4px;
  min-width: 300px;
}

.calendar-day-header {
  padding: 6px 4px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-day {
  min-height: 54px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  gap: 3px;
  align-content: start;
  transition: border-color 120ms ease, background 120ms ease;
}

.calendar-day-empty {
  background: var(--panel-soft);
  border-color: transparent;
}

.calendar-day-today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.calendar-day-has-events {
  cursor: pointer;
}

.calendar-day-has-events:hover,
.calendar-day-has-events:focus-visible {
  border-color: var(--line-strong);
  background: #f4f9ff;
  outline: none;
}

.calendar-day-selected {
  border-color: var(--accent);
  background: #f4f9ff;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.calendar-day-num {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.calendar-today-num { color: var(--accent); }

.calendar-dot-row {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.calendar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.calendar-dot-critical  { background: var(--danger); }
.calendar-dot-medium    { background: var(--orange); }
.calendar-dot-low       { background: var(--accent); }
.calendar-dot-planned   { background: var(--planned); }
.calendar-dot-completed { background: var(--muted); }
/* legacy alias kept for safety */
.calendar-dot-active    { background: var(--success); }

/* ── Backdrop + side panels ───────────────────────────────────────────────── */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 35, 40, 0.5);
  z-index: 9;
}

.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100%, 440px);
  height: 100vh;
  padding: 20px;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -6px 0 20px rgba(27, 31, 36, 0.12);
  overflow-y: auto;
  z-index: 10;
}

.side-panel-wide {
  width: min(100%, 580px);
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.icon-button {
  width: 34px;
  padding: 0;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.panel-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span,
.field > label > span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.field-hint {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}

.field-checkbox input[type="checkbox"] {
  width: 15px;
  min-height: 15px;
  height: 15px;
  flex-shrink: 0;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.12);
}

input[disabled],
textarea[disabled] {
  background: var(--panel-soft);
  color: var(--muted);
  cursor: not-allowed;
}

.panel-note {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.panel-actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.form-error {
  padding: 10px 12px;
  border: 1px solid #f0b6b3;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.88rem;
  line-height: 1.45;
}

/* ── Confirm dialog ───────────────────────────────────────────────────────── */
.confirm-backdrop { z-index: 19; }

.confirm-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(100% - 24px, 460px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(27, 31, 36, 0.18);
  transform: translate(-50%, -50%);
  z-index: 20;
}

.confirm-dialog-copy { display: grid; gap: 8px; }

.confirm-message {
  color: var(--text);
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.confirm-button-danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
}

.confirm-button-danger:hover,
.confirm-button-danger:focus-visible { background: #a40e26; }

/* ── Double-column field row ──────────────────────────────────────────────── */
.field-row-double {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Inline update thread on cards ───────────────────────────────────────── */
.card-updates {
  border-top: 1px solid var(--line);
  padding: 10px 16px 10px;
  background: #f9fafb;
  border-radius: 0 0 11px 11px;
}

.card-updates-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Timeline: a vertical rule with dots */
.card-update-row {
  position: relative;
  padding: 0 0 10px 22px;
  border-left: 2px solid var(--line);
  margin-left: 5px;
}

.card-update-row:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

/* Dot on the timeline */
.card-update-row::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #f9fafb;
  box-shadow: 0 0 0 1px var(--line);
}

.card-update-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.card-update-author {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.card-update-time {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Separator dot between author and time */
.card-update-meta::after {
  display: none; /* removed — using gap instead */
}

.card-update-content {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.card-updates-more {
  display: inline-block;
  margin-top: 8px;
  margin-left: 22px;
  font-size: 0.82rem;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Update thread ────────────────────────────────────────────────────────── */
.update-thread {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.update-entry {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.update-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.update-author {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
}

.update-time {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.update-content {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.update-delete-btn {
  background: none;
  border: none;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
  flex-shrink: 0;
}

.update-delete-btn:hover { color: var(--danger); }

.update-add-form {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.update-add-form textarea {
  min-height: 80px;
}

/* ── Details panel body ───────────────────────────────────────────────────── */
.details-section {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  margin-bottom: 12px;
}

.details-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.details-value {
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

body.panel-open { overflow: hidden; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .site-header-inner {
    flex-wrap: wrap;
    align-items: start;
  }

  .header-actions { margin-left: 0; }

  .event-card-head { flex-direction: column; }

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

@media (max-width: 640px) {
  .page-shell,
  .site-header-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .page-shell { padding-top: 14px; padding-bottom: 32px; }

  .section-panel { padding: 16px; }

  .view-toggle { order: -1; width: 100%; }

  .view-toggle-btn { flex: 1; }

  .header-actions,
  .panel-actions,
  .confirm-actions { flex-direction: column; }

  .top-button,
  .list-button { width: 100%; }

  .side-panel { width: 100%; padding: 16px; }

  .confirm-dialog { padding: 16px; }
}

/* ── Site footer ──────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 48px;
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer a:hover {
  color: var(--text);
}
