/* Generated by Claude (AI-assisted).
   Styles for the exercise toolbar and in-browser editor (sfl-lean.js).
   Colors come from the book theme (SFLMeta/Theme.lean) where it has them. */

.exercise-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4em;
}

.sfl-toolbar {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  font-size: 0.85rem;
}

.sfl-try, .sfl-run {
  font: inherit;
  padding: 0.2em 0.7em;
  border: 1px solid var(--sf-accent, #a00);
  border-radius: 3px;
  background: white;
  color: var(--sf-accent, #a00);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.sfl-try:hover, .sfl-run:hover:not(:disabled) {
  background: var(--sf-accent, #a00);
  color: white;
}
a.sfl-try, a.sfl-try:visited { color: var(--sf-accent, #a00); }
a.sfl-try:hover { color: white; }
.sfl-run:disabled { opacity: 0.5; cursor: default; }

.sfl-menu { position: relative; }
.sfl-menu-button {
  font: inherit;
  font-size: 1.1em;
  line-height: 1;
  width: 1.8em;
  height: 1.8em;
  border: 1px solid transparent;
  border-radius: 3px;
  background: none;
  color: var(--sf-text, #1a1208);
  cursor: pointer;
}
.sfl-menu-button:hover, .sfl-menu-button:focus-visible { border-color: var(--sf-rule, #dcdcda); background: white; }
.sfl-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 2px);
  z-index: 20;
  min-width: 17em;
  white-space: nowrap;
  padding: 0.25em 0;
  background: white;
  border: 1px solid var(--sf-rule, #dcdcda);
  border-radius: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.sfl-menu-list[hidden] { display: none; }
.sfl-menu-item, a.sfl-menu-item:visited {
  display: block;
  width: 100%;
  padding: 0.4em 0.9em;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  color: var(--sf-text, #1a1208);
  text-decoration: none;
  cursor: pointer;
}
.sfl-menu-item:hover, .sfl-menu-item:focus-visible { background: var(--sf-surface, #f4f4f3); }

/* The exercise's static code is hidden while the editor holds it. */
.sfl-replaced { display: none !important; }

.sfl-editor {
  margin: 0.6em 0;
  border-left: 3px solid var(--sf-accent, #a00);
  background: white;
}
.sfl-editor.sfl-solved { border-left-color: #2e7d32; }

.sfl-code {
  display: flex;
  font-family: var(--verso-code-font-family, ui-monospace, Menlo, Consolas, monospace);
  font-size: 0.9rem;
  line-height: 1.45;
}
.sfl-gutter {
  flex: none;
  padding: 0.6em 0.5em;
  min-width: 2.2em;
  text-align: right;
  color: #9a9a96;
  background: var(--sf-code-bg, #f1f1f0);
  user-select: none;
  overflow: hidden;
}
.sfl-area { position: relative; flex: 1; min-width: 0; }
.sfl-backdrop, .sfl-input {
  margin: 0;
  padding: 0.6em 0.9em;
  font: inherit;
  line-height: inherit;
  white-space: pre;
  overflow-wrap: normal;
  tab-size: 2;
}
/* The highlighted code is drawn here, under a textarea whose own text is
   transparent; both must lay text out identically. */
.sfl-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: var(--verso-code-color, var(--sf-text, #1a1208));
  pointer-events: none;
}
.sfl-tok-kw {
  color: var(--verso-code-keyword-color, #697f2f);
  font-weight: var(--verso-code-keyword-weight, bold);
}
.sfl-tok-const { color: var(--verso-code-const-color, #416DFF); }
.sfl-tok-comment { color: #6f6f68; font-style: italic; }
.sfl-tok-string { color: #a31515; }
.sfl-line.sfl-error { background: rgba(200, 0, 0, 0.12); }
.sfl-line.sfl-warning { background: rgba(230, 160, 0, 0.16); }
.sfl-line.sfl-info { background: rgba(40, 100, 200, 0.08); }
.sfl-input {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  outline: none;
  resize: none;
  overflow-x: auto;
  overflow-y: hidden;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: var(--sf-text, #1a1208);
}
.sfl-input::selection { background: rgba(65, 109, 255, 0.25); }

.sfl-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6em;
  padding: 0.4em 0.6em;
  border-top: 1px solid var(--sf-rule, #dcdcda);
  font-size: 0.85rem;
}
.sfl-hint { color: #8c8c88; }
.sfl-status { color: #55554f; }
.sfl-solved .sfl-status { color: #2e7d32; font-weight: 600; }

.sfl-messages:empty { display: none; }
.sfl-messages {
  border-top: 1px solid var(--sf-rule, #dcdcda);
  max-height: 22em;
  overflow: auto;
}
.sfl-message {
  display: flex;
  gap: 0.6em;
  padding: 0.35em 0.6em;
  border-left: 3px solid transparent;
  font-size: 0.85rem;
}
.sfl-message + .sfl-message { border-top: 1px solid var(--sf-rule, #dcdcda); }
.sfl-message.sfl-error { border-left-color: #c00; }
.sfl-message.sfl-warning { border-left-color: #d89000; }
.sfl-message.sfl-info { border-left-color: #2864c8; }
.sfl-message pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--verso-code-font-family, ui-monospace, Menlo, Consolas, monospace);
}
.sfl-where {
  flex: none;
  align-self: flex-start;
  font: inherit;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sf-link, #7a1a1a);
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
}

/* The goal view under the editor: proof state, not mistakes, so neutral
   rather than red. */
.sfl-goals {
  border-top: 1px solid var(--sf-rule, #dcdcda);
  padding: 0.5em 0.7em 0.6em;
  background: #fbfbf9;
  font-size: 0.85rem;
}
.sfl-goals.sfl-stale { opacity: 0.55; }
.sfl-goals-title {
  font-weight: 600;
  color: #55554f;
  margin-bottom: 0.35em;
}
.sfl-goals-note, .sfl-goals-done { margin: 0; color: #6f6f68; }
.sfl-goals-done { color: #2e7d32; }
.sfl-goal {
  margin: 0.35em 0 0;
  padding: 0.35em 0.6em;
  background: white;
  border: 1px solid var(--sf-rule, #dcdcda);
  border-left: 3px solid var(--verso-code-const-color, #416DFF);
  border-radius: 2px;
}
.sfl-goal-case { font-size: 0.8rem; color: #6f6f68; margin-bottom: 0.15em; }
/* The book theme frames every plain <pre> as a code block; inside the editor
   they are lines of a message or a goal. */
.sfl-editor .sfl-goal pre,
.sfl-editor .sfl-message pre {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.sfl-goal pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--verso-code-font-family, ui-monospace, Menlo, Consolas, monospace);
}
.sfl-target {
  margin-top: 0.2em !important;
  padding-top: 0.2em;
  border-top: 1px dashed var(--sf-rule, #dcdcda);
}
.sfl-turnstile { color: var(--verso-code-keyword-color, #697f2f); font-weight: bold; }
