:root {
  color-scheme: light;
  --ink: #13233a;
  --muted: #59708d;
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --paper: #f6f4ee;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --border: rgba(19, 35, 58, 0.12);
  --shadow: 0 18px 50px rgba(10, 36, 77, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(13, 148, 136, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(251, 146, 60, 0.18), transparent 24%),
    linear-gradient(180deg, #f8f6f1 0%, #eef3f7 100%);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

body {
  padding: 24px;
}

.shell {
  max-width: 1440px;
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
  gap: 20px;
  margin-bottom: 24px;
}

.hero h1,
.panel h2,
.panel h3 {
  margin: 0;
  font-family: "Palatino Linotype", Georgia, serif;
}

.lede,
.status-line,
.meta-label,
label span,
.placeholder-copy,
.placeholder-subcopy,
.eyebrow,
.button,
input,
textarea,
select,
.visit-card,
.log-meta,
.tile-meta,
.tile-status,
.tile-actions {
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-meta,
.portal-grid,
.director-layout {
  display: grid;
  gap: 20px;
}

.hero-meta {
  grid-template-columns: 1fr;
}

.portal-grid {
  grid-template-columns: minmax(340px, 0.9fr) minmax(520px, 1.1fr);
}

.director-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: start;
}

.director-main {
  grid-column: 1;
}

.side-panel,
.avatar-panel {
  grid-column: 2;
}

.panel,
.meta-card,
.visit-card,
.station-card,
.station-tile,
.session-log li {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 20px;
}

.panel {
  padding: 20px;
}

.meta-card {
  padding: 16px;
}

.meta-label {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 13px;
}

.panel-header,
.panel-subheader,
.visit-card-header,
.tile-header,
.actions-row,
.session-actions,
.tile-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel-subheader {
  margin-top: 18px;
}

.visit-list,
.stations-editor,
.station-tiles,
.session-log {
  display: grid;
  gap: 14px;
}

.visit-card,
.station-card,
.station-tile {
  padding: 16px;
}

.visit-card-header {
  align-items: start;
}

.visit-actions,
.inline-grid {
  display: grid;
  gap: 10px;
}

.visit-actions {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  margin-top: 14px;
}

.visit-meta,
.tile-meta {
  color: var(--muted);
  font-size: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(13, 148, 136, 0.12);
  color: var(--accent-strong);
}

.status-pill.archived,
.tile-status.inactive {
  background: rgba(89, 112, 141, 0.14);
  color: var(--muted);
}

.status-pill.draft {
  background: rgba(251, 146, 60, 0.16);
  color: #b45309;
}

.visit-form,
.station-form,
.inline-grid {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(19, 35, 58, 0.16);
  padding: 12px 14px;
  font-size: 14px;
  background: var(--panel-strong);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.inline-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.16s ease, background-color 0.16s ease, opacity 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--accent);
  color: white;
}

.button.secondary {
  background: rgba(13, 148, 136, 0.12);
  color: var(--accent-strong);
}

.button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(19, 35, 58, 0.12);
}

.button.danger {
  background: var(--danger);
  color: white;
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.errors,
.warnings {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.errors div,
.warnings div {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.errors div {
  background: var(--danger-soft);
  color: var(--danger);
}

.warnings div {
  background: rgba(251, 146, 60, 0.14);
  color: #9a3412;
}

.hidden {
  display: none !important;
}

.station-tiles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.visit-narration {
  margin: 18px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--accent-strong);
  background: rgba(13, 148, 136, 0.08);
}

.visit-narration[hidden] {
  display: none;
}

.visit-narration h3 {
  margin: 0 0 6px;
}

.visit-narration p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.station-tile.current {
  border-color: rgba(13, 148, 136, 0.5);
  box-shadow: 0 20px 60px rgba(13, 148, 136, 0.18);
}

.tile-description {
  margin: 14px 0 8px;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
}

.tile-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tile-status span {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(13, 148, 136, 0.12);
  color: var(--accent-strong);
}

.tile-status span.off,
.tile-status span.hidden-state,
.tile-status span.inactive {
  background: rgba(89, 112, 141, 0.14);
  color: var(--muted);
}

.session-log {
  list-style: none;
  padding: 0;
  max-height: 520px;
  overflow: auto;
}

.session-log li {
  padding: 14px;
}

.log-meta {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.placeholder-copy {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 700;
}

.placeholder-subcopy {
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .hero,
  .portal-grid,
  .director-layout,
  .station-tiles,
  .inline-grid {
    grid-template-columns: 1fr;
  }

  .side-panel,
  .avatar-panel,
  .director-main {
    grid-column: auto;
  }
}
/* E8-S3: Session History Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  max-width: 800px;
  max-height: 80vh;
  width: 90%;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #111827;
}

.modal-header button {
  font-size: 28px;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  min-height: 0;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.history-sessions {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.history-session-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}

.history-session-card .session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.history-session-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.history-session-card .session-meta {
  margin: 0 0 16px;
  font-size: 13px;
  color: #6b7280;
}

.history-timeline {
  margin: 0;
  padding-left: 24px;
  list-style: none;
  position: relative;
}

.history-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #d1d5db;
}

.history-timeline li {
  position: relative;
  padding: 8px 0 8px 20px;
  font-size: 14px;
  color: #374151;
}

.history-timeline li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0d9488;
  border: 2px solid white;
  box-shadow: 0 0 0 1px #0d9488;
}

.history-time {
  font-weight: 600;
  color: #0d9488;
  margin-right: 8px;
}
