/* ── Selje shared layout & brand ───────────────────────────────── */
.svf-settings-page {
  --selje-brand: #2e7d7a;
  --selje-brand-light: #ebf5f4;
  background: var(--selje-brand-light);
  padding: 16px;
  border: 1px solid #dcdcde;
  border-radius: 6px;
}

/* Header card */
.svf-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  background: #fff;
  border: 1px solid #dcdcde;
  border-left: 3px solid var(--selje-brand);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.svf-settings-header h1 {
  margin: 0;
  font-size: 1.3em;
  line-height: 1.4;
}

.svf-settings-header__subtitle {
  color: #646970;
  margin-top: 4px;
  font-size: 13px;
}

.svf-settings-header__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* Version badge */
.svf-version {
  display: inline-block;
  background: #f6f7f7;
  border: 1px solid var(--selje-brand);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--selje-brand);
  font-size: 12px;
}

/* Two-column layout */
.svf-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: 16px;
  align-items: start;
}

.svf-settings-main {
  min-width: 0;
}

/* Main content card */
.svf-settings-card {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  padding: 14px 16px;
  min-width: 0;
}

/* Sidebar */
.svf-settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.svf-sidebar-box {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  padding: 12px;
  min-width: 0;
}

.svf-sidebar-box h3 {
  margin: 0 0 8px 0;
  font-size: 13px;
}

.svf-doc-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.svf-doc-links li {
  margin: 6px 0;
}

.svf-doc-links a {
  font-size: 13px;
}

/* Donate button sizing (colour kept via sgdl-donate-button) */
.svf-donate-button {
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.8;
  padding: 0 10px;
  min-height: auto;
}

/* Active tab brand colour */
.svf-settings-page .nav-tab-active,
.svf-settings-page .nav-tab-active:hover,
.svf-settings-page .nav-tab-active:focus {
  border-bottom-color: var(--selje-brand);
  color: var(--selje-brand);
}

@media (max-width: 782px) {
  .svf-settings-layout {
    grid-template-columns: 1fr;
  }
}
/* ─────────────────────────────────────────────────────────────── */

.sgdl-roles-row {
  margin-top: 8px;
}

.sgdl-library-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sgdl-library-actions form {
  margin: 0;
}

.sgdl-donate-button,
.sgdl-donate-button:visited {
  background: #ca6ce6;
  border-color: #ffffff;
  color: #ffffff;
  font-weight: 700;
}

.sgdl-donate-button:hover,
.sgdl-donate-button:focus {
  background: #b65fd1;
  border-color: #ffffff;
  color: #ffffff;
}

/* ── Tooltip info icons ─────────────────────────────────────────── */
.sgdl-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  background: #646970;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-style: normal;
  line-height: 1;
  cursor: help;
  position: relative;
  margin-left: 4px;
  vertical-align: middle;
  flex-shrink: 0;
  text-decoration: none;
}

.sgdl-tip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1d2327;
  color: #fff;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  width: 240px;
  max-width: 240px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.sgdl-tip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1d2327;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 9999;
}

.sgdl-tip:hover::after,
.sgdl-tip:hover::before {
  opacity: 1;
}

/* Flip tooltip above when near right edge */
.svf-settings-sidebar .sgdl-tip::after {
  left: auto;
  right: 0;
  transform: none;
}

.svf-settings-sidebar .sgdl-tip::before {
  left: auto;
  right: 4px;
  transform: none;
}

/* ── Redirect URI row ───────────────────────────────────────────── */
.sgdl-redirect-uri-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.sgdl-redirect-uri-row code {
  flex: 1 1 auto;
  word-break: break-all;
}

/* ── Sidebar section headings ───────────────────────────────────── */
.sgdl-dev-section-heading {
  margin: 0 0 10px 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1d2327;
  border-bottom: 1px solid #dcdcde;
  padding-bottom: 6px;
}

.sgdl-sidebar-heading {
  margin: 12px 0 4px 0;
  font-size: 12px;
  font-weight: 700;
  color: #1d2327;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Documentation modal ────────────────────────────────────────── */
.sgdl-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.sgdl-modal-box {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.28);
  width: 100%;
  max-width: 780px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sgdl-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #dcdcde;
  flex-shrink: 0;
}

.sgdl-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #646970;
  padding: 2px 6px;
  border-radius: 3px;
}

.sgdl-modal-close:hover {
  background: #f0f0f1;
  color: #1d2327;
}

.sgdl-modal-body {
  overflow-y: auto;
  padding: 16px 18px;
  flex: 1 1 auto;
}

.sgdl-readme-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
  color: #1d2327;
}
