/* === Universal Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Base Reset & Body === */
body {
  font-family: system-ui, sans-serif;
  background: #f4f6f8;
  margin: 2rem;
  color: #222;
}

/* === Container === */
#entry-viewer {
  max-width: 700px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
}

/* === Entry Content === */
#entry-container {
  margin-bottom: 1.5rem;
}

/* === Section Labels (e.g. Time, New Messages) === */
#entry-container > div > strong {
  font-size: 1rem;
  display: inline-block;
  margin-bottom: 0.25rem;
}

/* === Message List === */
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* === Message Block === */
li[data-role] {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-left: 4px solid #ccc;
  border-radius: 6px;
  background: #f9f9f9;
  font-size: 0.92rem;
  line-height: 1.25;
}

/* === Role Label === */
.role-label {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
}

/* === Message Body === */
.message-body {
  line-height: 1.25;
}

/* === Role-specific colors === */
li[data-role="user"] {
  background: #e6f4ea;
  border-left-color: #28a745;
}

li[data-role="assistant"] {
  background: #e7f0fa;
  border-left-color: #007bff;
}

li[data-role="system"] {
  background: #f5f5f5;
  border-left-color: #888;
}

li[data-role="tool"] {
  background: #fff4e5;
  border-left-color: #e67e22;
}

.tool-call {
  background: #f0f0f0;
  padding: 0.5em;
  margin: 0.5em 0;
  border-left: 3px solid #888;
  font-family: monospace;
}

/* === Navigation Buttons === */
#nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #e9ecef;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover:not(:disabled) {
  background: #dee2e6;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

li[data-role="assistant"] .role-label { color: blue; }
li[data-role="user"] .role-label { color: green; }
li[data-role="system"] .role-label { color: gray; }
li[data-role="tool"] .role-label { color: purple; }

.tool-call-label {
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.tool-response {
  margin: 0.5em 0;
}

.tool-response-body {
  background: #f0f0f0;
  padding: 0.5em;
  border-left: 3px solid #888;
  font-family: monospace;
  white-space: pre-wrap;
}

.context-section {
  margin-top: 1rem;
}

.toggle-context {
  background: none;
  border: none;
  color: #007bff;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.25rem 0;
  text-align: left;
}

.context-list {
  margin-top: 0.5rem;
}

li.context-message,
li.context-message * {
  font-size: 0.7rem !important;
  line-height: 1.25;
  opacity: 0.85;
}