/* Interviewer notes panel, site tools and teacher PIN dialog */
.ide.notes-open { grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) minmax(300px, 42%); }
.ide.notes-open.explorer-collapsed { grid-template-columns: 34px minmax(0, 1fr) minmax(300px, 42%); }

.notes-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  border: 0;
  border-left: 1px solid var(--ide-border);
  background: transparent;
  color: var(--ide-tab-text);
  cursor: pointer;
}

.notes-toggle[hidden] { display: none; }

.notes-toggle svg { width: 18px; height: 18px; }
.notes-toggle:hover { color: var(--ide-tab-active-text); background: var(--ide-hover); }
.notes-toggle[aria-expanded="true"] { color: var(--ide-tab-accent); }
.notes-toggle:focus-visible { outline: 1px solid var(--ide-focus); outline-offset: -1px; }

.notes {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--ide-border);
  background: var(--ide-side);
  color: var(--ide-side-text);
}

.notes[hidden] { display: none; }

.notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  height: 35px;
  padding: 0 6px 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ide-side-title);
  border-bottom: 1px solid var(--ide-border);
}

.notes-close {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.notes-close:hover { background: var(--ide-hover); }
.notes-close:focus-visible { outline: 1px solid var(--ide-focus); }

.notes-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 16px 24px;
  font-size: 14px;
  line-height: 1.55;
}

.notes-body h2 { font-size: 1.05rem; text-transform: none; letter-spacing: 0; color: var(--ide-side-text); margin: 0 0 8px; }
.notes-body h3 { font-size: 0.95rem; margin: 18px 0 6px; color: var(--ide-side-text); }
.notes-body p, .notes-body ul, .notes-body ol { margin: 0 0 10px; max-width: none; }
.notes-body ul, .notes-body ol { padding-left: 20px; }
.notes-body li + li { margin-top: 4px; }
.notes-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.notes-body :not(pre) > code { padding: 1px 4px; border-radius: 3px; background: var(--ide-hover); }

.notes-body pre {
  margin: 0 0 12px;
  overflow-x: auto;
  border: 1px solid var(--ide-border);
  border-radius: 4px;
  background: var(--ide-editor);
}

.notes-body pre code,
.notes-body pre code.hljs {
  display: block;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  background: transparent;
  white-space: pre;
}

.interviewer-banner {
  margin: 0 0 16px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid #c76a00;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.9rem;
  max-width: none;
}

@media (max-width: 720px) {
  .ide.notes-open,
  .ide.notes-open.explorer-collapsed { grid-template-columns: minmax(0, 1fr); }

  .notes {
    position: absolute;
    inset: 0;
    z-index: 5;
    border-left: 0;
  }
}

.site-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.site-remaining { margin: 0; }

.site-lock {
  font: inherit;
  font-size: 0.85rem;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.site-lock:hover { background: var(--accent-soft); }

.site-lock:focus-visible,
.teacher-lock:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.teacher-lock {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.teacher-lock svg { width: 16px; height: 16px; }
.teacher-lock:hover { color: var(--text); background: var(--accent-soft); }
.teacher-lock[aria-pressed="true"] { color: var(--accent); }

/* Beat the UA dialog:modal rule (overflow, inset, max-width). */
dialog.pin-dialog {
  position: fixed;
  top: 50%;
  right: auto;
  bottom: auto;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(22rem, calc(100% - 2rem));
  max-width: min(22rem, calc(100% - 2rem));
  height: fit-content;
  max-height: calc(100% - 2rem);
  margin: 0;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--ide-border);
  border-radius: var(--radius);
  background: var(--ide-side);
  color: var(--ide-side-text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

dialog.pin-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

dialog.pin-dialog h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ide-side-text);
}

dialog.pin-dialog form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.pin-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

dialog.pin-dialog input {
  width: 100%;
  min-width: 0;
  margin: 0;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--ide-border);
  border-radius: var(--radius);
  background: var(--ide-editor);
  color: var(--ide-code-text);
}

.pin-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
}

dialog.pin-dialog .pin-cancel {
  font: inherit;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--ide-border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ide-side-title);
  cursor: pointer;
}

dialog.pin-dialog .pin-cancel:hover {
  background: var(--ide-hover);
  color: var(--ide-side-text);
}

dialog.pin-dialog button:focus-visible,
dialog.pin-dialog input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
