/* SPDX-License-Identifier: LicenseRef-SISL-1.5
   Unified theme toolbar for all interactive pages.
   All colours driven by --tb-* vars set from window.__TOOLBAR_CONFIG__.vars. */

.iris-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.6rem 1rem;
  background: var(--tb-bg);
  border-bottom: 1px solid var(--tb-border);
  position: sticky;
  top: 0;
  z-index: 10;
  font-family: system-ui, -apple-system, sans-serif;
}
.iris-toolbar .lbl {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tb-text-muted);
}
.iris-toolbar button {
  border: 1px solid var(--tb-border);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  background: var(--tb-btn-bg);
  color: var(--tb-text);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}
.iris-toolbar button[aria-pressed='true'] {
  background: var(--tb-btn-active-bg);
  color: var(--tb-btn-active-text);
  border-color: transparent;
}
.iris-toolbar .spacer { flex: 1; }
.iris-toolbar .link {
  background: none; border: 0; color: var(--tb-link);
  text-decoration: underline; padding: 0.35rem 0.3rem; cursor: pointer; font: inherit; font-size: 0.82rem;
}
.iris-toolbar .edit {
  background: none; border: 0; color: var(--tb-text-muted); cursor: pointer;
  padding: 0.35rem 0.15rem; margin-left: -0.35rem; font-size: 0.95rem; line-height: 1;
}
.iris-toolbar .edit:hover { color: var(--tb-link); }

/* Code drawer */
.iris-code-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(560px, 92vw);
  background: var(--tb-bg); border-left: 1px solid var(--tb-border);
  transform: translateX(100%); transition: transform 0.18s ease; z-index: 30;
  display: flex; flex-direction: column;
}
.iris-code-drawer.open { transform: none; }
.iris-code-drawer header { display: flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--tb-border); }
.iris-code-drawer header .t { font-weight: 600; font-size: 0.85rem; color: var(--tb-text); }
.iris-code-drawer header .x { margin-left: auto; border: 1px solid var(--tb-border); background: var(--tb-btn-bg); color: var(--tb-text); border-radius: 6px; cursor: pointer; padding: 0.25rem 0.55rem; font: inherit; }
.iris-code-drawer pre { margin: 0; padding: 1rem; overflow: auto; flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 0.72rem; line-height: 1.5; color: var(--tb-text); background: var(--tb-btn-bg); white-space: pre-wrap; word-break: break-word; }

/* Custom-theme modal */
.iris-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none; align-items: center; justify-content: center;
  padding: 1rem; z-index: 20;
  font-family: system-ui, -apple-system, sans-serif;
}
.iris-overlay.open { display: flex; }
.iris-modal {
  background: var(--tb-bg); color: var(--tb-text);
  border: 1px solid var(--tb-border); border-radius: 10px;
  max-width: 560px; width: 100%; max-height: 86vh; overflow: auto; padding: 1.2rem;
}
.iris-modal h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.iris-modal p { margin: 0 0 1rem; font-size: 0.82rem; color: var(--tb-text-muted); }
.iris-modal .name-row { display: block; font-size: 0.8rem; color: var(--tb-text-muted); margin: 0 0 1rem; }
.iris-modal .name-row input {
  display: block; width: 100%; margin-top: 0.25rem; padding: 0.45rem 0.55rem;
  border: 1px solid var(--tb-border); border-radius: 6px; background: var(--tb-btn-bg); color: var(--tb-text); font: inherit;
}
.iris-modal .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 0.9rem; }
@media (max-width: 520px) { .iris-modal .fields { grid-template-columns: 1fr; } }
.iris-modal .field { display: flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; }
.iris-modal .field input[type='color'] {
  width: 34px; height: 26px; padding: 0; border: 1px solid var(--tb-border); border-radius: 4px; background: none;
}
.iris-modal .field .fn { font-family: ui-monospace, Menlo, monospace; color: var(--tb-text-muted); word-break: break-all; }
.iris-modal .actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.1rem; }
.iris-modal .actions button {
  padding: 0.5rem 0.9rem; border-radius: 6px; font: inherit; cursor: pointer;
  border: 1px solid var(--tb-border); background: var(--tb-btn-bg); color: var(--tb-text);
}
.iris-modal .actions .save {
  background: var(--tb-btn-active-bg); color: var(--tb-btn-active-text); border-color: transparent;
}
