:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --text: #16212f;
  --muted: #617086;
  --navy: #12314b;
  --accent: #2b78b8;
  --line: rgba(18, 49, 75, 0.14);
  --shadow: 0 14px 32px rgba(18, 49, 75, 0.08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Aptos, "Segoe UI", Inter, Arial, sans-serif;
  background: linear-gradient(180deg, #f7fafc 0%, var(--bg) 100%);
  color: var(--text);
  padding: 24px;
}
button, input, select, textarea { font: inherit; }
.shell-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.page-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
}
.eyebrow { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); font-size: .75rem; font-weight: 700; }
h1 { margin: 0; color: var(--navy); font-size: clamp(2rem, 4vw, 3rem); }
.lede { margin: 10px 0 0; max-width: 64ch; color: var(--muted); }
.header-meta { display: grid; gap: 10px; min-width: 240px; }
.header-meta label, .form-grid label { display: grid; gap: 6px; }
.header-meta span, .form-grid span { color: var(--muted); font-size: .9rem; }
select, input, textarea, button {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
}
textarea { resize: vertical; }
button {
  background: var(--navy);
  color: #fff;
  border: 0;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}
button.secondary { background: #e9eff6; color: var(--navy); box-shadow: none; }
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.full-span { grid-column: 1 / -1; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2 { margin: 0; color: var(--navy); font-size: 1.1rem; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 12px;
  background: #edf4fa;
  color: var(--navy);
  font-size: .9rem;
  font-weight: 700;
}
.status-pill.good { background: #e7f6eb; color: #196c38; }
.status-pill.warn { background: #fff0d9; color: #8d5c00; }
.status-pill.bad { background: #fbe7ea; color: #9b1c31; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f9fbfe;
}
.checkbox-pill input { margin: 0; }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}
th, td {
  border-top: 1px solid var(--line);
  padding: 10px 10px;
  text-align: left;
  vertical-align: top;
  font-size: .92rem;
}
th { color: var(--navy); font-size: .84rem; text-transform: uppercase; letter-spacing: .08em; }
tr:hover td { background: #f8fbfe; }
.inline-link { color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; background: transparent; border: 0; padding: 0; box-shadow: none; }
.session-panel { overflow: hidden; }
.accordion-toggle {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.accordion-toggle .status-pill { flex: 0 0 auto; }
.accordion-toggle.collapsed { opacity: .92; }
.session-body { display: grid; gap: 14px; }
.session-summary-grid { display: grid; gap: 12px; }
.session-summary-grid.collapsed { display: none; }
.session-summary-row, .session-field { display: grid; gap: 6px; }
.session-summary-key, .session-field-label { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.session-summary-value { font-weight: 700; color: var(--navy); }
.session-field-value { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: #f9fbfe; }
.session-field-value span { min-width: 0; overflow-wrap: anywhere; }
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eaf2fa;
  color: var(--navy);
  box-shadow: none;
  flex: 0 0 auto;
}
.field-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 28, 44, 0.46);
  z-index: 40;
}
.field-editor {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 24px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  z-index: 41;
  box-shadow: 0 20px 48px rgba(18, 49, 75, 0.18);
}
.field-editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.field-editor-head h3 { margin: 0; color: var(--navy); }
.field-editor-body { margin: 14px 0; }
.field-editor-body input, .field-editor-body textarea { width: 100%; }
.field-editor-actions { justify-content: flex-end; }
.hidden { display: none !important; }
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
  .shell-header { flex-direction: column; }
  .header-meta { width: 100%; }
}
@media (max-width: 720px) {
  .page-shell {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    margin: 0 auto;
  }
  body { padding: 10px; }
  .grid { gap: 12px; }
  .panel { padding: 14px; border-radius: 18px; }
  .session-panel,
  #startSessionSection {
    width: 100%;
    margin-inline: 0;
  }
  .form-grid, .form-grid.two-col { grid-template-columns: 1fr; }
  .accordion-toggle { align-items: flex-start; }
  .accordion-toggle .status-pill { margin-top: 2px; }
  .session-summary-grid { grid-template-columns: 1fr; gap: 8px; }
  .session-summary-row:first-child,
  .session-summary-row:last-child,
  .session-field:nth-last-child(-n+2) { grid-column: auto; }
  .session-field-value { padding: 10px 12px; }
  .session-field-label, .session-summary-key { font-size: .72rem; }
  .icon-btn { width: 32px; height: 32px; }
  .field-editor { width: calc(100vw - 14px); bottom: 8px; padding: 12px; }
}
