/* Auth modal + role suggest dropdown */
.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(8, 16, 20, 0.45);
  backdrop-filter: blur(4px);
}

.auth-backdrop[hidden] {
  display: none !important;
}

.auth-card {
  position: relative;
  width: min(420px, 100%);
  padding: 1.25rem 1.35rem 1.1rem;
  border-radius: 16px;
  background: var(--panel-bg, var(--paper, #fff));
  color: var(--ink, #1a2428);
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
}

html[data-theme="dark"] .auth-card {
  background: #162422;
  color: #e6f2ef;
  border-color: rgba(45, 212, 191, 0.22);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .auth-card h2 {
  color: #e6f2ef;
}

html[data-theme="dark"] .auth-card p,
html[data-theme="dark"] .auth-card #auth-subtitle,
html[data-theme="dark"] .auth-hint,
html[data-theme="dark"] .auth-switch,
html[data-theme="dark"] .settings-hint,
html[data-theme="dark"] .settings-email {
  color: #a8c5bf;
}

html[data-theme="dark"] .auth-close {
  color: #a8c5bf;
}

html[data-theme="dark"] .auth-close:hover {
  color: #e6f2ef;
  background: rgba(45, 212, 191, 0.12);
}

html[data-theme="dark"] .settings-section h3 {
  color: #e6f2ef;
}

html[data-theme="dark"] .settings-theme-row .auth-btn {
  border-color: rgba(45, 212, 191, 0.28);
  color: #5eead4;
}

html[data-theme="dark"] .settings-theme-row .auth-btn.is-active-theme {
  background: rgba(45, 212, 191, 0.16);
  color: #5eead4;
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(8, 16, 20, 0.5);
  backdrop-filter: blur(4px);
}

.confirm-backdrop[hidden] {
  display: none !important;
}

.confirm-card {
  width: min(400px, 100%);
  padding: 1.25rem 1.3rem 1.15rem;
  border-radius: 16px;
  background: var(--panel-bg, var(--paper, #fff));
  color: var(--ink, #1a2428);
  border: 1px solid var(--border, rgba(13, 155, 138, 0.18));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
}

html[data-theme="dark"] .confirm-card {
  background: #162422;
  color: #e6f2ef;
  border-color: rgba(45, 212, 191, 0.22);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.confirm-title {
  margin: 0 0 0.45rem;
  font: 700 1.1rem/1.25 Sora, Manrope, sans-serif;
  color: inherit;
}

.confirm-message {
  margin: 0;
  color: var(--muted, #5a6b68);
  font: 500 0.92rem/1.45 Manrope, sans-serif;
}

.confirm-message[hidden] {
  display: none !important;
}

html[data-theme="dark"] .confirm-message {
  color: #a8c5bf;
}

.confirm-field {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.85rem;
}

.confirm-field[hidden] {
  display: none !important;
}

.confirm-field-label {
  font: 600 0.82rem/1.2 Manrope, sans-serif;
  color: var(--ink, #1a2428);
}

.confirm-field-label[hidden] {
  display: none !important;
}

html[data-theme="dark"] .confirm-field-label {
  color: #e6f2ef;
}

.confirm-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(13, 155, 138, 0.22);
  border-radius: 10px;
  background: #fff;
  color: var(--ink, #1a2428);
  font: 500 0.95rem/1.3 Manrope, sans-serif;
}

.confirm-input:focus {
  outline: 2px solid rgba(13, 155, 138, 0.35);
  outline-offset: 1px;
  border-color: var(--role, #0d9b8a);
}

html[data-theme="dark"] .confirm-input {
  background: #101a19;
  color: #e6f2ef;
  border-color: rgba(45, 212, 191, 0.28);
}

html[data-theme="dark"] .confirm-input:focus {
  outline-color: rgba(45, 212, 191, 0.4);
  border-color: #2dd4bf;
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.15rem;
}

.confirm-backdrop.is-prompt .confirm-actions {
  margin-top: 1rem;
}

.confirm-actions .auth-btn {
  min-width: 7rem;
}

.confirm-backdrop.is-danger .confirm-actions .auth-btn.is-danger {
  border-radius: 999px;
}

/* Materials (Stepik courses) — same shell as confirm/prompt, taller scroll list (~3×) */
.materials-card {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 42rem);
}

.materials-status {
  margin-bottom: 0.35rem;
}

.materials-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.5rem;
  margin: 0.5rem 0 0.25rem;
}

.materials-loading[hidden] {
  display: none !important;
}

.materials-spinner {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 2px solid rgba(13, 155, 138, 0.22);
  border-top-color: var(--role, #0d9b8a);
  animation: materials-spin 0.7s linear infinite;
}

html[data-theme="dark"] .materials-spinner {
  border-color: rgba(45, 212, 191, 0.22);
  border-top-color: #2dd4bf;
}

@keyframes materials-spin {
  to {
    transform: rotate(360deg);
  }
}

.materials-list {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  /* ~3× typical rename-dialog body height */
  max-height: min(60vh, 36rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(13, 155, 138, 0.18);
  border-radius: 12px;
  background: rgba(13, 155, 138, 0.03);
}

html[data-theme="dark"] .materials-list {
  border-color: rgba(45, 212, 191, 0.22);
  background: rgba(0, 0, 0, 0.22);
}

.materials-list[hidden] {
  display: none !important;
}

.materials-item {
  display: block;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid rgba(13, 155, 138, 0.12);
}

.materials-item:last-child {
  border-bottom: none;
}

html[data-theme="dark"] .materials-item {
  border-bottom-color: rgba(45, 212, 191, 0.14);
}

.materials-link {
  font: 600 0.92rem/1.35 Manrope, sans-serif;
  color: #1a5c52;
  text-decoration: none;
}

.materials-link:hover,
.materials-link:focus-visible {
  text-decoration: underline;
}

html[data-theme="dark"] .materials-link {
  color: #6ee7b7;
}

.materials-meta {
  font: 500 0.78rem/1.3 Manrope, sans-serif;
  color: var(--muted, #5a6b68);
}

html[data-theme="dark"] .materials-meta {
  color: #94a3af;
}

.materials-actions {
  margin-top: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted, #5a6b68);
  font: 500 1.35rem/1 Manrope, sans-serif;
  cursor: pointer;
}

.auth-close:hover {
  color: var(--ink, #1a2428);
  background: rgba(0, 0, 0, 0.05);
}

.auth-card h2 {
  margin: 0 0 1.1rem;
  font: 700 1.15rem/1.2 Sora, Manrope, sans-serif;
}

.auth-card p,
.auth-card #auth-subtitle {
  margin: 0 0 1rem;
  color: var(--muted, #5a6b68);
  font-size: 0.92rem;
}

.auth-card #auth-subtitle.auth-password-rules {
  margin: 0 0 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: rgba(180, 35, 24, 0.1);
  color: #b42318;
  border: 1px solid rgba(180, 35, 24, 0.16);
  font-size: 0.88rem;
  line-height: 1.4;
}

.auth-card p.auth-password-rules-lead {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: inherit;
  font-size: inherit;
}

.auth-password-rules ul {
  margin: 0;
  padding-left: 1.15rem;
}

.auth-password-rules li {
  margin: 0.1rem 0;
}

html[data-theme="dark"] .auth-card #auth-subtitle.auth-password-rules {
  background: rgba(249, 112, 102, 0.12);
  color: #f97066;
  border-color: rgba(249, 112, 102, 0.22);
}

.auth-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.auth-field[hidden],
#auth-subtitle[hidden],
#auth-forgot-link[hidden],
#auth-consent[hidden],
#auth-switch[hidden] {
  display: none !important;
}

.auth-field label {
  font-size: 0.82rem;
  font-weight: 600;
}

.auth-field input {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: #fff;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.auth-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font: 600 0.95rem/1 Manrope, sans-serif;
  cursor: pointer;
}

.auth-btn.is-block {
  display: block;
  width: 100%;
}

.auth-btn.is-primary {
  background: var(--role, #0d9b8a);
  color: #fff;
}

.auth-btn.is-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.auth-btn.is-ghost {
  background: transparent;
  color: var(--role, #0d9b8a);
}

.auth-btn.is-danger {
  background: rgba(180, 35, 24, 0.12);
  color: #b42318;
}

.auth-btn.is-danger:hover {
  background: rgba(180, 35, 24, 0.2);
}

.settings-card {
  width: min(440px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
}

.settings-email {
  margin: 0 0 1rem !important;
  word-break: break-all;
}

.settings-section {
  margin: 0 0 1.15rem;
  padding-top: 0.15rem;
}

.settings-section h3 {
  margin: 0 0 0.65rem;
  font: 700 0.92rem/1.2 Sora, Manrope, sans-serif;
  color: var(--ink, #1a2428);
}

.settings-hint {
  margin: 0 0 0.65rem !important;
  font-size: 0.82rem !important;
}

.settings-theme-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.settings-theme-row .auth-btn {
  border: 1px solid rgba(13, 155, 138, 0.25);
}

.settings-theme-row .auth-btn.is-active-theme {
  background: rgba(13, 155, 138, 0.12);
  color: var(--role-deep, #087a6d);
  font-weight: 700;
}

html[data-theme="dark"] .auth-field input {
  background: #101a19;
  color: #e6f2ef;
  border-color: rgba(45, 212, 191, 0.22);
}

html[data-theme="dark"] .auth-btn.is-danger {
  background: rgba(249, 112, 102, 0.14);
  color: #f97066;
}

.auth-card p.auth-switch {
  margin: 1.7rem 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted, #5a6b68);
}

.auth-switch-btn {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--role, #0d9b8a);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-switch-btn:hover {
  color: var(--role-deep, #087a6d);
}

.auth-hint {
  margin: 0 0 1rem;
  color: var(--muted, #5a6b68);
  font-size: 0.88rem;
}

#auth-forgot-link {
  text-align: right;
}

.auth-consent {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 1rem;
}

.auth-check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 0;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(13, 155, 138, 0.04);
  cursor: pointer;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted, #5a6b68);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.auth-check-label:hover {
  border-color: rgba(13, 155, 138, 0.35);
}

.auth-check-label.auth-check-label--error {
  border-color: rgba(180, 35, 24, 0.55);
  background: rgba(180, 35, 24, 0.08);
}

.auth-check-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-check-visual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  border-radius: 5px;
  border: 2px solid rgba(90, 107, 104, 0.45);
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.auth-check-tick {
  width: 0.72rem;
  height: 0.72rem;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.auth-check-input:enabled:hover + .auth-check-visual {
  border-color: var(--role, #0d9b8a);
}

.auth-check-input:focus-visible + .auth-check-visual {
  box-shadow: 0 0 0 2px rgba(13, 155, 138, 0.35);
}

.auth-check-input:checked + .auth-check-visual {
  border-color: var(--role, #0d9b8a);
  background: var(--role, #0d9b8a);
}

.auth-check-input:checked + .auth-check-visual .auth-check-tick {
  opacity: 1;
}

.auth-check-text a {
  font-weight: 700;
  color: var(--role, #0d9b8a);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-check-text a:hover {
  color: var(--role-deep, #087a6d);
}

.auth-check-text strong {
  font-weight: 700;
  color: var(--ink, #1a2428);
}

html[data-theme="dark"] .auth-check-label {
  border-color: rgba(45, 212, 191, 0.22);
  background: rgba(16, 26, 25, 0.65);
  color: #a8c5bf;
}

html[data-theme="dark"] .auth-check-label.auth-check-label--error {
  border-color: rgba(249, 112, 102, 0.55);
  background: rgba(127, 29, 29, 0.28);
}

html[data-theme="dark"] .auth-check-visual {
  background: #101a19;
  border-color: rgba(168, 197, 191, 0.45);
}

html[data-theme="dark"] .auth-check-text strong {
  color: #e6f2ef;
}

.auth-hint a {
  color: var(--role, #0d9b8a);
  font-weight: 700;
}

.auth-userbar {
  position: fixed;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 1200;
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.auth-userbar .auth-btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  background: var(--paper, #fff);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.role-suggest {
  position: absolute;
  z-index: 900;
  min-width: 220px;
  max-width: min(360px, 92vw);
  margin-top: 0.35rem;
  padding: 0.35rem;
  border-radius: 12px;
  background: var(--paper, #fff);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  list-style: none;
}

.role-suggest[hidden] {
  display: none !important;
}

.role-suggest-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: 600 0.88rem/1.2 Manrope, sans-serif;
  color: var(--ink, #1a2428);
  cursor: pointer;
}

.role-suggest-item:hover,
.role-suggest-item:focus-visible {
  background: rgba(13, 155, 138, 0.1);
}

html[data-theme="dark"] .role-suggest {
  background: #162422;
  border-color: rgba(45, 212, 191, 0.22);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .role-suggest-item {
  color: #fff;
}

html[data-theme="dark"] .role-suggest-item:hover,
html[data-theme="dark"] .role-suggest-item:focus-visible {
  background: rgba(45, 212, 191, 0.16);
  color: #fff;
}

.hub-wrap {
  position: relative;
}

.graph.is-readonly #graph-add-skill-btn,
.graph.is-readonly #graph-search-btn,
.graph.is-readonly #graph-share-btn {
  pointer-events: none;
  opacity: 0.35;
}

.graph.is-readonly .skill-tag {
  cursor: default;
}

.graph.is-share-view .hub-input {
  cursor: default;
  pointer-events: none;
}

.skill-toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.skill-toast {
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--paper, #fff);
  color: var(--ink, #1a2428);
  font: 600 0.88rem/1.35 Manrope, sans-serif;
  box-shadow: 0 12px 32px rgba(8, 16, 20, 0.14);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.skill-toast.is-in {
  opacity: 1;
  transform: translateY(0);
}

.skill-toast.is-out {
  opacity: 0;
  transform: translateY(6px);
}

.skill-toast.is-error {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff7f6;
  color: #b42318;
}

.skill-toast.is-success {
  border-color: rgba(13, 155, 138, 0.28);
  background: #f2fbf8;
  color: #087a6d;
}

.skill-toast.is-info {
  border-color: rgba(13, 155, 138, 0.18);
}

html[data-theme="dark"] .skill-toast {
  background: #162422;
  color: #e6f2ef;
  border-color: rgba(45, 212, 191, 0.22);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .skill-toast.is-error {
  background: #2a1818;
  color: #f97066;
  border-color: rgba(249, 112, 102, 0.35);
}

html[data-theme="dark"] .skill-toast.is-success {
  background: #14302c;
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.35);
}
