/*
  styles.css

  Global layout, typography, and component styles for Voux.
*/

/* -------------------------------------------------------------------------- */
/* Base reset + typography                                                    */
/* -------------------------------------------------------------------------- */
* {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

body {
      font-family: 'Inter', sans-serif;
      background: var(--bg-primary);
      color: var(--text-primary);
      line-height: 1.6;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

img {
      user-select: none;
    }

/* -------------------------------------------------------------------------- */
/* Selection                                                                  */
/* -------------------------------------------------------------------------- */
::selection {
      background: color-mix(in srgb, var(--accent) 28%, transparent);
      color: var(--text-primary);
    }

/* Support for ancient Firefox users too -.- */
::-moz-selection {
      background: color-mix(in srgb, var(--accent) 28%, transparent);
      color: var(--text-primary);
    }

/* -------------------------------------------------------------------------- */
/* Scrollbar                                                                  */
/* -------------------------------------------------------------------------- */

html {
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: var(--border-primary) var(--bg-secondary);
}

/* Chrome / Edge / Safari */
html::-webkit-scrollbar {
  width: 8px;
}

html::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

html::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 8px;
}

html::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* -------------------------------------------------------------------------- */
/* Layout                                                                     */
/* -------------------------------------------------------------------------- */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
}

/* -------------------------------------------------------------------------- */
/* Responsive layout                                                          */
/* -------------------------------------------------------------------------- */

@media (min-width: 768px) {
  .page {
    padding: 5rem 2rem 6rem;
  }
}

/* -------------------------------------------------------------------------- */
/* Input reset                                                                */
/* -------------------------------------------------------------------------- */
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  appearance: textfield;
  -moz-appearance: textfield;
}

/* -------------------------------------------------------------------------- */
/* 404 page                                                                   */
/* -------------------------------------------------------------------------- */
.page--compact {
  max-width: 640px;
  margin: 0 auto;
}

.page--centered {
  min-height: calc(100vh - 150px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.not-found-minimal {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.not-found-minimal h1 {
  font-size: clamp(4rem, 10vw, 6rem);
  line-height: 1;
}

.go-home{
  gap: 0.2rem;
}

.not-found-minimal p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* -------------------------------------------------------------------------- */
/* Hero + cards                                                               */
/* -------------------------------------------------------------------------- */
.eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 0.625rem;
      font-size: 0.875rem;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 1.5rem;
      letter-spacing: -0.01em;
    }

.eyebrow-logo {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: transparent;
}

.eyebrow-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

    .hero h1 {
      font-size: clamp(2.5rem, 5vw, 3.5rem);
      font-weight: 700;
      line-height: 1.15;
      letter-spacing: -0.02em;
      margin-bottom: 1rem;
      background: linear-gradient(180deg, #ffffff 0%, #a1a1a1 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .hero > p {
      font-size: 1.125rem;
      color: var(--text-secondary);
      max-width: 580px;
      margin-bottom: 1rem;
      line-height: 1.6;
    }

/* -------------------------------------------------------------------------- */
/* Cards                                                                      */
/* -------------------------------------------------------------------------- */
    .card {
      background: var(--bg-secondary);
      border: 1px solid var(--border-primary);
      border-radius: 16px;
      padding: 1.5rem;
      margin-bottom: 1.5rem;
    }

    .card a:not(.nav-link) {
      color: var(--accent);
      text-decoration: underline;
    }

    .branding-status {
      margin-top: 0.5rem;
      color: var(--accent);
      font-weight: 600;
    }

    @media (min-width: 768px) {
      .card {
        padding: 2rem;
      }
    }

/* -------------------------------------------------------------------------- */
/* Forms + fields                                                             */
/* -------------------------------------------------------------------------- */
    .form {
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
    }

    .field {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }

    .field textarea {
      font: inherit;
      min-height: 20px;
      background: var(--bg-tertiary);
      border: 1px solid var(--border-primary);
      border-radius: 10px;
      padding: 0.75rem 1rem;
      color: var(--text-primary);
      transition: all 0.15s ease;
      outline: none;
    }

    .field textarea::placeholder{
      color: var(--text-tertiary);
    }

    .field__head {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 0.75rem;
      flex-wrap: wrap;
    }

.field__label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.optional-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: transparent;
  opacity: 0.85;
}

/* -------------------------------------------------------------------------- */
/* Labels + hints                                                             */
/* -------------------------------------------------------------------------- */
    label {
      font-size: 0.9375rem;
      font-weight: 500;
      color: var(--text-primary);
    }

    .hint {
      font-size: 0.8125rem;
      color: var(--text-secondary);
    }

.form-error {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: #f87171;
  line-height: 1.4;
}

.login-card.loading {
  visibility: hidden;
}

/* -------------------------------------------------------------------------- */
/* Inputs + selects + textarea                                                */
/* -------------------------------------------------------------------------- */
    input,
    select,
    textarea {
      font: inherit;
      background: var(--bg-tertiary);
      border: 1px solid var(--border-primary);
      border-radius: 10px;
      padding: 0.75rem 1rem;
      color: var(--text-primary);
      font-size: 0.9375rem;
      transition: all 0.15s ease;
      outline: none;
    }

    input:focus,
    select:focus,
    textarea:focus {
      border-color: var(--accent);
    }

    .input-error {
      border-color: rgba(248, 113, 113, 0.9) !important;
      background: rgba(248, 113, 113, 0.08);
    }

    input::placeholder {
      color: var(--text-tertiary);
    }

    textarea {
      min-height: 140px;
      resize: vertical;
      font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
      font-size: 0.875rem;
      line-height: 1.6;
    }

    textarea#embedSnippet {
      width: 100%;
      background: #101013;
      border-color: var(--border-primary);
    }

    .input-icon {
      position: relative;
      display: flex;
      align-items: center;
      flex: 1;
      min-width: 220px;
      width: 100%;
    }

    .input-icon__icon,
    .password-field__icon {
      position: absolute;
      left: 0.85rem;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-tertiary);
      pointer-events: none;
      font-size: 0.95rem;
      line-height: 1;
      width: 1rem;
      height: 1rem;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .input-icon__icon i,
    .password-field__icon i,
    .password-toggle i {
      line-height: 1;
      display: block;
    }

    .input-icon input {
      width: 100%;
      padding-left: 2.35rem;
    }

    .password-field {
      position: relative;
      display: flex;
      align-items: center;
      flex: 1;
      min-width: 220px;
      width: 100%;
    }

    .password-field input {
      width: 100%;
      padding-left: 2.35rem;
      padding-right: 2.75rem;
    }

    .password-field--no-icon input {
      padding-left: 1rem;
    }

    .password-toggle {
      position: absolute;
      right: 0.6rem;
      top: 50%;
      transform: translateY(-50%);
      border: none;
      background: transparent;
      color: var(--text-tertiary);
      padding: 0;
      width: 1.85rem;
      height: 1.85rem;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: color 0.15s ease, opacity 0.15s ease;
    }

    .password-toggle:hover {
      color: var(--text-secondary);
    }

    .password-toggle:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
      border-radius: 6px;
    }

    .password-toggle i {
      font-size: 1.05rem;
    }

    button {
      background: var(--text-primary);
      color: var(--bg-primary);
      border: none;
      border-radius: 10px;
      padding: 0.75rem 1.5rem;
      font-size: 0.9375rem;
      font-weight: 400;
      cursor: pointer;
      outline: none;
      font-family: 'Inter', sans-serif; 
      transition: all 0.15s ease;
    }

    button:hover {
      opacity: 0.88;
    }

.hidden {
  display: none !important;
}


.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;
}

body.config-pending .config-guard {
  opacity: 0;
  pointer-events: none;
}

body.auth-pending main {
  opacity: 0;
  pointer-events: none;
}

/* -------------------------------------------------------------------------- */
/* Modals                                                                     */
/* -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 200;
}

.modal-overlay--open {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(3px);
}

body.modal-open {
  overflow: hidden;
}

.modal {
  width: 100%;
  max-width: 460px;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 18px;
  padding: 1.5rem;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-overlay--open .modal {
  transform: translateY(0) scale(1);
}

.modal__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.modal__message {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.modal__input-wrap {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.modal__input-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.modal__input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.modal__input::placeholder {
  color: var(--text-tertiary);
}

.modal__input-hint {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.modal__input-error {
  font-size: 0.82rem;
  color: #fca5a5;
  line-height: 1.2;
  min-height: 1.2em;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.modal__input-error.is-hidden {
  opacity: 0;
  transform: translateY(-4px);
  visibility: hidden;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.modal__button {
  min-width: 120px;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border 0.15s ease;
}

.modal__button--primary {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.modal__button--danger {
  background: #ef4444;
  color: #fff;
}

.modal__button--ghost {
  background: transparent;
  border-color: var(--border-primary);
  color: var(--text-primary);
}

.modal__button:hover {
  filter: brightness(1.05);
}

.modal__button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: none;
}

    .private-card {
      text-align: center;
    }

    .private-card .nav-link {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-top: 0.75rem;
    }

/* -------------------------------------------------------------------------- */
/* Builder result + preview                                                   */
/* -------------------------------------------------------------------------- */
    .result h2 {
      font-size: 1.25rem;
      font-weight: 600;
      margin-bottom: 0.75rem;
      letter-spacing: -0.01em;
    }

    .result > p {
      color: var(--text-secondary);
      margin-bottom: 1rem;
      font-size: 0.9375rem;
    }

    .preview {
      margin-top: 1rem;
      padding: 0;
      background: transparent;
      border: none;
    }

    #previewTarget,
    #adminPreviewTarget {
      min-height: 70px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--bg-secondary);
      border: 1px solid var(--border-primary);
      border-radius: 10px;
      padding: 1rem;
    }

    #previewTarget em,
    #adminPreviewTarget em {
      color: var(--text-tertiary);
      font-style: normal;
      font-size: 0.875rem;
    }

.instructions {
  background: var(--bg-secondary);
}

/* -------------------------------------------------------------------------- */
/* Guides expander                                                            */
/* -------------------------------------------------------------------------- */

.expander {
  padding: 0;
  overflow: hidden;
}

.expander summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
  position: relative;
  transition: color 0.2s ease, background 0.2s ease;
  border-bottom: 1px solid transparent;
  margin: 0;
}

.expander summary:hover {
  background: var(--bg-tertiary);
}

.expander[open] summary {
  border-bottom-color: var(--border-primary);
}

.expander summary span {
  position: relative;
  display: inline-block;
  padding-top: 0.05rem;
}

.expander summary::-webkit-details-marker {
  display: none;
}

.expander__content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease;
}

.expander[open] .expander__content {
  grid-template-rows: 1fr;
}

.expander__content > div {
  overflow: hidden;
}

.expander__content > div > .expander__content-inner {
  padding: 0 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.expander[open] .expander__content > div > .expander__content-inner {
  padding: 1rem 1.5rem 1.35rem;
}

.expander summary i {
  transition: transform 0.4s ease;
}

.expander[open] summary i {
  transform: rotate(180deg);
}

.instructions h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
    }

    .instructions p {
      color: var(--text-secondary);
      font-size: 0.9375rem;
    }

    .instructions p strong,
    .instructions p b {
      color: var(--text-primary);
    }

    .code-snippet {
      position: relative;
      background: #101013;
      border: 1px solid var(--border-primary);
      border-radius: 10px;
      padding: 1.25rem;
    }

    .code-snippet pre {
      margin: 0;
      padding: 0;
      padding-right: 1.25rem;
      background: transparent;
      border: none;
      overflow-x: auto;
    }

    .copy-button {
      position: absolute;
      top: 0.6rem;
      right: 0.6rem;
      background: transparent;
      border: 1px solid var(--border-primary);
      color: var(--text-secondary);
      padding: 0.3rem 0.5rem;
      border-radius: 4px;
      font-size: 0.7rem;
      font-weight: 500;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
    }

    .copy-button i {
      font-size: 0.8rem;
    }


.instructions code {
      font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
      font-size: 0.8125rem;
      line-height: 1.7;
      color: #e5e5e5;
      white-space: pre;
    }

    .code-inline {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-primary);
      padding: 0.125rem 0.375rem;
      border-radius: 4px;
      font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
      font-size: 0.8125rem;
      color: var(--text-primary);
    }

.self-host-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.self-host-list li {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.self-host-list li::before {
  content: '•';
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-primary);
  margin-top: 0.15rem;
}

.self-host-list li .code-inline {
  flex-shrink: 0;
}

    .admin-panel {
      background: var(--bg-tertiary);
    }

    .admin-form {
      display: flex;
      flex-wrap: wrap;
      gap: 0.75rem;
      margin-top: 1rem;
    }

    .admin-form input {
      flex: 1;
      min-width: 220px;
    }

    .admin-form button {
      flex: none;
    }

    .admin-form.login-form {
      flex-direction: column;
    }

    .admin-form.login-form input,
    .admin-form.login-form .password-field {
      width: 100%;
      min-width: 0;
    }

    .admin-form.login-form button[type="submit"] {
      width: 100%;
      min-width: 0;
    }

    .admin-form.login-form .password-field {
      display: flex;
      position: relative;
    }

    .admin-form.login-form .password-toggle {
      right: 0.6rem;
    }

.admin-controls {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-controls.is-loading {
  min-height: clamp(320px, calc(var(--admin-page-size, 5) * 9rem), 900px);
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-search {
  margin-bottom: 1rem;
  width: 100%;
}

.admin-search__field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  width: 100%;
  position: relative;
}

.admin-search__field i {
  color: var(--text-tertiary);
  font-size: 1rem;
}

.admin-search__field input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  border-radius: 0 !important;
  font-size: 1rem;
  color: var(--text-primary);
  min-width: 0;
  padding-right: 2rem;
}

.admin-search__field input::placeholder {
  color: var(--text-tertiary);
}

.admin-search__clear {
  font-size: 1rem;
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none !important;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}

/* -------------------------------------------------------------------------- */
/* Admin filters + tags                                                       */
/* -------------------------------------------------------------------------- */
.admin-filters {
  margin: 0.75rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
}

.admin-filter {
  display: inline-flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.admin-filter--toggle {
  align-items: flex-start;
}

.admin-filter--toggle .admin-toggle {
  margin-top: 0.45rem;
}

.admin-toggle {
  background: transparent;
  border: 1px solid var(--border-primary);
  border-radius: 100px;
  padding: 0.2rem;
  width: 46px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.admin-toggle__track {
  width: 100%;
  height: 100%;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}

.admin-toggle__thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: transform 0.2s ease, background 0.2s ease;
}

.admin-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
}

.admin-toggle[aria-pressed="true"] .admin-toggle__thumb {
  transform: translateX(18px);
  background: var(--bg-primary);
}

.admin-filter > span {
  cursor: default;
}

@media (max-width: 600px) {
  .admin-filter{
    margin-top: 0.5rem;
  }
}

.admin-filter select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
}

.admin-filter input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
}

.tag-filter {
  position: relative;
  align-self: flex-start;
}

.tag-filter__menu {
  position: absolute;
  top: 110%;
  left: 0;
  z-index: 5;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 0.75rem;
  min-width: 220px;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (max-width: 460px) {
  .tag-filter__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .tag-filter__footer button {
    width: auto;
    min-width: 110px;
  }

  .tag-filter__menu {

    min-width: 156px;
    max-width: 260px;
  }
}


.tag-filter__menu.hidden {
  display: none;
}

.tag-filter__list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding-right: 8px;
  scrollbar-width: thin;
  
}



.toggle-filter input {
  appearance: none;
      width: 1rem;
      height: 1rem;
      background: var(--bg-secondary);
      border: 1.5px solid var(--border-primary);
      border-radius: 4px;
      cursor: pointer;
      position: relative;
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      flex-shrink: 0;
}

.toggle-filter input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toggle-filter input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.toggle-filter input:checked::after {
  content: '';
  position: absolute;
  top: -0.05rem;
  left: 0.20em;
  width: 0.2rem;
  height: 0.55rem;
  border-right: 2px solid var(--bg-primary);
  border-bottom: 2px solid var(--bg-primary);
  transform: rotate(45deg);
}


.tag-filter__item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  word-break: break-word;
}

.tag-chip__edit {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0 0.2rem;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  font-size: 0.85rem;
}

.tag-filter__item input {
  width: 0.85rem;
  height: 0.85rem;
}

.tag-filter__footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.tag-count-hint {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  text-align: left;
}

.tag-picker {
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  background: var(--bg-tertiary);
  padding: 0.5rem;
  min-height: 2.5rem;
}

.tag-picker--disabled {
  opacity: 0.6;
  pointer-events: none;
}

.tag-picker__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  /* align-items: flex-start; */ /* enable this if u dont want the extra spacing for the tags */
}

.tag-picker__actions {
  margin-top: 0.4rem;
  display: flex;
  justify-content: flex-end;
}

.tag-inline-button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
}

.tag-inline-button.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.tag-disabled-hint {
  margin-bottom: 0.1rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.tag-disabled-hint strong {
  color: var(--text-primary);
}

.tag-inline-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tag-inline-hint {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.tag-pill {
  display: inline-flex;
  align-items: flex-start;
  flex-wrap: wrap;
  border: 1px solid var(--tag-color, var(--border-primary));
  border-radius: 15px;
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  gap: 0.25rem;
}

.tag-pill--selected {
  background: var(--tag-color, #4c6ef5);
  border-color: var(--tag-color, #4c6ef5);
  color: var(--tag-text-color, #fff);
}

.counter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.tag-chip {
  display: inline-flex;
  align-items: flex-start;
  flex-wrap: wrap;
  border: 1px solid var(--tag-color, var(--border-primary));
  color: var(--tag-text-color, var(--text-primary));
  border-radius: 15px;
  padding: 0.1rem 0.4rem;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 0;
  gap: 0.25rem;
  margin-bottom: 3px;
}

.tag-chip__label {
  display: inline-block;
  padding: 0 0.1rem;
  white-space: normal;
  word-break: break-word;
  max-width: 12rem;
  line-height: 1.3;
  align-self: flex-start;
  flex: 0 1 auto;
}

.tag-chip__remove {
  border: none;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  padding: 0;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  align-self: flex-start;
  flex: 0 0 auto;
}

.tag-chip__remove i {
  pointer-events: none;
}

.tag-chip__remove:hover {
  opacity: 1;
}

.tag-chip__edit {
  align-self: flex-start;
  flex: 0 0 auto;
}

.tag-dialog {
  max-width: 420px;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border-primary);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tag-dialog__title {
  margin: 0;
  font-size: 1.1rem;
}

.tag-dialog__hint {
  margin: 0rem 0 0.1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.tag-dialog__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tag-dialog__field input[type='text'] {
  border-radius: 10px;
  border: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  padding: 0.45rem 0.6rem;
  color: var(--text-primary);
}

.tag-dialog__color-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.tag-dialog__color-swatch {
  width: 46px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  cursor: pointer;
  padding: 0;
}

/* -------------------------------------------------------------------------- */
/* Pickr overrides                                                            */
/* -------------------------------------------------------------------------- */

.pickr {
  width: 100%;
}

.tag-dialog__color-value {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pcr-app {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 14px !important;
}

.pcr-app .pcr-selection .pcr-picker {
  box-shadow: 0 0 0 2px var(--bg-secondary), 0 0 0 3px var(--accent) !important;
}

.pcr-app .pcr-selection .pcr-color-preview::before {
  display: none !important;
}

.pcr-app .pcr-selection .pcr-color-preview {
  box-shadow: none !important;
  height: 1.5em !important;
}

.pcr-app .pcr-interaction input {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 8px !important;
}

.pcr-app .pcr-interaction .pcr-result {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace !important;
  min-width: 6.5em !important;
  flex: 0 1 7em !important;
}

.pcr-app button:focus,
.pcr-app input:focus,
.pcr-app .pcr-result:focus {
  outline: none !important;
  box-shadow: none !important;
}

.pcr-app .pcr-interaction .pcr-type,
.pcr-app .pcr-interaction .pcr-save,
.pcr-app .pcr-interaction .pcr-cancel,
.pcr-app .pcr-interaction .pcr-clear {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 8px !important;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease !important;
  font-family: 'Inter', sans-serif !important;
}

.pcr-app .pcr-interaction .pcr-type:hover,
.pcr-app .pcr-interaction .pcr-save:hover,
.pcr-app .pcr-interaction .pcr-clear:hover {
  border-color: var(--border-hover) !important;
  color: var(--text-primary) !important;
  background: var(--bg-tertiary) !important;
  
}

.pcr-app .pcr-interaction .pcr-type {
  display: none !important;
}

.pcr-app .pcr-interaction .pcr-save {
  background: var(--accent) !important;
  color: #0f1115 !important;
  border-color: var(--accent) !important;
}

.pcr-app .pcr-interaction .pcr-save:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
}

.pcr-app .pcr-interaction .pcr-clear {
  color: #f87171 !important;
  border-color: rgba(248, 113, 113, 0.6) !important;
}

.pcr-app .pcr-interaction .pcr-clear:hover {
  border-color: rgba(248, 113, 113, 0.9) !important;
}

.tag-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.activity-range {
  margin: 0.85rem 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.activity-range__label {
  font-size: 0.80rem;
  color: var(--text-secondary);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.03rem;
}

.activity-range__options {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.activity-range__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.activity-range__pageinfo {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-left: auto;
  white-space: nowrap;
}

@media (max-width: 540px) {
  .activity-range__row {
    flex-direction: column;
    align-items: flex-start;
  }
  .activity-range__pageinfo {
    margin-left: 0px;
  }
}

.activity-range__button {
  border-radius: 12px;
  border: 1px solid var(--border-primary);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 0.35rem 0.85rem;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.activity-range__button--active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text-primary);
}

.activity-range__button:not(.activity-range__button--active):hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.admin-panel__actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.admin-panel__delete-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------------------- */
/* Counters list                                                             */
/* -------------------------------------------------------------------------- */
.counter-total {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  background: var(--bg-secondary);
}

.counter-total__label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.counter-total__value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 2ch;
}

.counter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.selection-active .counter-actions .counter-delete-btn {
  display: none;
}

.counter-edit {
  /* max-width: 380px; */
  margin-top: 0.75rem;
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 0.75rem;
  background: var(--bg-tertiary);
}

.counter-edit.hidden {
  display: none;
}

.counter-edit__fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.counter-edit__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.counter-edit__field-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  font-weight: 600;
}

.counter-edit__field-label .optional-tag {
  font-size: 0.6rem;
  padding: 0.05rem 0.3rem;
  border-radius: 10px;
  opacity: 0.75;
}

.counter-edit__field-label--actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.counter-edit__field input,
.counter-edit__field textarea {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
}

.counter-edit__field textarea {
  resize: vertical;
  min-height: 60px;
}

.counter-edit__field input::placeholder,
.counter-edit__field textarea::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

.counter-edit__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* -------------------------------------------------------------------------- */
/* Toasts                                                                     */
/* -------------------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  z-index: 100;
  pointer-events: none;
}

.toast-stack--interactive {
  pointer-events: auto;
}

.toast {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 0.45rem;
  flex-wrap: nowrap;
  width: fit-content;
  max-width: min(360px, 90vw);
  padding: 0.55rem 0.9rem 0.75rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.6);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.85rem;
  color: #d1fae5;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  word-break: break-word;
  pointer-events: auto;
}

.toast span {
  min-width: 0;
  margin-top: 0.13rem;
}

.toast--action {
  pointer-events: auto;
}

.toast__action {
  border: 1px solid var(--border-primary);
  background: transparent;
  color: var(--text-primary);
  border-radius: 100px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.toast__action:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.toast i {
  font-size: 1rem;
}

.toast__timer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.toast__timer::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: currentColor;
  opacity: 0.6;
  transform-origin: left;
  animation: toast-timer var(--toast-duration, 2200ms) linear forwards;
}

.toast--paused .toast__timer::after {
  animation-play-state: paused;
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.6);
  color: #fee2e2;
}

@keyframes toast-timer {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.selection-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border: 1px dashed var(--border-primary);
  border-radius: 10px;
  background: var(--bg-secondary);
  margin-top: 1rem;
  position: sticky;
  top: 0.85rem;
  z-index: 2;
}

.selection-toolbar__count {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.selection-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.selection-toolbar__clear {
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .toast-stack {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 1rem;
    width: calc(100% - 2rem);
    align-items: center;
  }
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.admin-pagination.hidden {
  display: none;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

@media (max-width: 480px) {
  .admin-pagination {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .admin-pagination button {
    font-size: 0.90rem;
    padding: 0.4rem 0.75rem;
  }
  .pagination-info {
    font-size: 0.9rem;
  }
}

.counter-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.counter-list .hint {
  word-break: break-word;
  overflow-wrap: anywhere;
}

    .counter-row {
      position: relative;
      display: flex;
      flex-direction: column;
      gap: 0.85rem;
      padding: 0.85rem 2.5rem 0.85rem 1rem;
      
      border: 1px solid var(--border-primary);
      border-radius: 10px;
      background: var(--bg-secondary);
    }

    .counter-row--selected,
    .counter-row--editing {
      border-color: var(--accent);
      background: var(--bg-tertiary);
    }


    .counter-select {
      position: absolute;
      top: 0.65rem;
      right: 0.65rem;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0.05rem;
    }

    .counter-select input {
      appearance: none;
      width: 1rem;
      height: 1rem;
      background: var(--bg-secondary);
      border: 1.5px solid var(--border-primary);
      border-radius: 4px;
      cursor: pointer;
      position: relative;
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      flex-shrink: 0;
    }

    .counter-select input:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .counter-select input:checked {
      background: var(--accent);
      border-color: var(--accent);
    }

    .counter-select input:checked::after {
      content: "";
      position: absolute;
      top: 0rem;
      left: 0.25rem;
      width: 0.3rem;
      height: 0.55rem;
      border-right: 2px solid var(--bg-primary);
      border-bottom: 2px solid var(--bg-primary);
      transform: rotate(45deg);
    }

    .counter-meta {
      display: flex;
      flex-direction: column;
      gap: 0.15rem;
      min-width: 0;
      flex: 1;
    }

    .counter-meta__label {
      font-weight: 600;
      word-break: break-all;
      overflow-wrap: break-word;
    }

    .counter-meta__note {
      font-size: 0.78rem;
      color: var(--text-tertiary);
      margin-top: 0.30rem;
      margin-bottom: 0.10rem;
      word-break: break-word;
      white-space: pre-wrap;
    }

    .counter-meta__id {
      font-size: 0.75rem;
      color: var(--text-tertiary);
      word-break: break-all;
      overflow-wrap: break-word;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .counter-meta__value {
      font-size: 0.8rem;
      font-weight: 400;
      color: var(--text-secondary);
      opacity: 0.90;
      word-break: break-all;
      overflow-wrap: break-word;
    }

    .counter-meta__mode {
      font-size: 0.8rem;
      font-weight: 400;
      color: var(--text-secondary);
      opacity: 0.90;
      }

    .counter-meta__stats {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin-top: 0.45rem;
    }

    .counter-status {
      display: flex;
      flex-wrap: wrap;
      gap: 0.35rem;
      margin: 0.25rem 0 0.1rem;
    }

    .counter-status__badge {
      font-size: 0.68rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      border-radius: 0px;
      padding: 0.15rem 0.65rem;
      border: 1px solid var(--border-primary);
      background: var(--bg-tertiary);
      color: var(--text-tertiary);
    }

    .counter-status__badge--inactive {
      border-color: rgba(248, 113, 113, 0.5);
      color: #fca5a5;
      background: rgba(185, 28, 28, 0.08);
    }

    .counter-meta__stat {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      background: var(--bg-tertiary);
      border: 1px solid var(--border-primary);
      border-radius: 10px;
      padding: 0.2rem 0.75rem;
      font-size: 0.77rem;
      color: var(--text-secondary);
    }

    .counter-meta__value i,
    .counter-meta__mode i {
      font-size: 0.9rem;
      color: var(--text-tertiary);
    }

    .counter-meta__stat-label {
      text-transform: uppercase;
      letter-spacing: 0.06em;
      font-size: 0.72rem;
      font-weight: 500;
      color: var(--text-secondary);
    }

    .counter-meta__stat-value {
      font-weight: 600;
      color: var(--text-primary);
    }

    .counter-activity {
      margin-top: 0.6rem;
      position: relative;
    }

    .counter-activity__label {
      font-size: 0.7rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--text-tertiary);
      margin-bottom: 0.3rem;
    }

    .activity-bars {
      display: flex;
      align-items: flex-end;
      gap: 0.35rem;
      min-height: 58px;
    }

    .activity-bar {
      flex: 0 1 52px; /* change activity-bars from here */
      min-width: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.2rem;
    }

    .activity-bar__track {
      width: 100%;
      height: 52px;
      border-radius: 8px;
      border: 1px solid var(--border-primary);
      background: var(--bg-tertiary);
      display: flex;
      align-items: flex-end;
      overflow: hidden;
    }

    .activity-bar__fill {
      width: 100%;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.12));
      border-radius: 0px 0px 0 0;
      transition: height 0.2s ease, opacity 0.2s ease;
    }

    .activity-bar__fill--empty {
      opacity: 0.35;
    }

.activity-bar__fill[data-level='low'] {
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.65), rgba(37, 99, 235, 0.15));
}

.activity-bar__fill[data-level='mid'] {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.85), rgba(37, 99, 235, 0.3));
}

.activity-bar__fill[data-level='high'] {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.3));
}

.activity-bar__fill[data-level='max'] {
  background: linear-gradient(180deg, rgba(74, 222, 128, 1), rgba(22, 163, 74, 0.45));
}

    .activity-bar__label {
      font-size: 0.65rem;
      color: var(--text-tertiary);
    }

    .activity-bar:hover .activity-bar__track {
      border-color: var(--border-hover);
    }

.activity-tooltip {
  position: absolute;
  bottom: calc(80% + 0.45rem);
  transform: translate(-50%, 0.2rem);
  background: rgba(15, 17, 21, 0.95);
  border: 1px solid var(--border-primary);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.75rem;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.activity-tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border-primary);
}

.activity-tooltip::after {
  content: '';
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(15, 17, 21, 0.95);
}


.activity-tooltip--visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
/* -------------------------------------------------------------------------- */
/* Dashboard copy button                                                      */
/* -------------------------------------------------------------------------- */
.counter-copy-button {
  border: 1px solid var(--border-primary);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.counter-copy-button:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.counter-copy-button.copied {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

    .counter-meta__value .badge {
      background: rgba(255, 255, 255, 0.05);
      border-radius: 8px;
      padding: 0.1rem 0.6rem;
      font-size: 0.75rem;
      color: var(--text-secondary);
    }

    button.danger {
      background: #b91c1c;
      color: #fff;
      transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    }

    .buttons-toolbar__actions{
      padding: 7px;
    }

    .deleteclass{
      padding: 0.55rem 0.55rem;
    }

    .filter-button{
      padding: 0.55rem 1.00rem;
    }

    .filter-button2 {
      padding: 0.45rem 0.75rem;
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      white-space: nowrap;
    }


    button.danger.ghost {
      background: transparent;
      color: #fca5a5;
      border: 1px solid rgba(248, 113, 113, 0.5);
      transition: all 0.10s;
    }

    .branding-reset{
      margin-top: 10px;
    }

    .inactive-counters {
      padding: 0.85rem 1rem;
      border-radius: 8px;
      font-size: 0.875rem;
      white-space: nowrap;
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
    }

    @media (max-width: 680px) {
      .inactive-counters {
        white-space: normal;
        line-height: 1.35;
        text-align: left;
        align-items: flex-start;
      }
    }


    button.danger.ghost:hover {
      border-color: rgba(248, 113, 113, 0.9);
      color: #fee2e2;
    }

    button.ghost {
      background: transparent;
      border: 1px solid var(--border-primary);
      color: var(--text-secondary);
      transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    }

    button.ghost:hover {
      border-color: var(--border-hover);
      color: var(--text-primary);
    }

    .savebtn,
    .cancelbtn{ 
      margin-top: 0px;
    }

/* -------------------------------------------------------------------------- */
/* Footer                                                                     */
/* -------------------------------------------------------------------------- */
    .footer {
      padding: 2rem 1.5rem;
      border-top: 1px solid var(--border-primary);
      margin-top: 4rem;
    }

   .footer__content {
      max-width: 1200px; /* controls width on large screens */
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      gap: 2rem;
      width: 100%;
    }

    /* 
      MODIFY FOOTER FROM HERE 
    */
    .footer__grid {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 1.5rem;
    }

    /* Desktop layout: push Links and Social right */
    @media (min-width: 700px) {
      .footer__grid {
        grid-template-columns: 1.6fr 1fr 0.7fr; /* <-- MAINLY FROM HERE */
      }
    }

    /* Mobile: stack everything in one column */
    @media (max-width: 700px) {
      .footer__grid {
        grid-template-columns: 1fr;
      }
    }

    .footer__about,
    .footer__links,
    .footer__socials {
      display: flex;
      flex-direction: column;
      gap: 0.65rem;
    }

    .footer__links {
      align-items: flex-start;
    }

    .footer__links h3,
    .footer__socials h3,
    .footer__about h3{
      font-family: 'Inter', sans-serif;
      font-weight: 500;
      letter-spacing: -0.01em;
    }

    .footer__about p {
      max-width: 45ch;
      color: var(--text-tertiary);
      font-size: 0.9rem;
      line-height: 1.5;
    }


    .footer__links a {
      color: var(--text-secondary);
      text-decoration: none;
      font-size: 0.9rem;
      transition: color 0.15s ease;
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      
      border-radius: 6px;
    }

    .footer__links a:hover {
      color: var(--text-primary);
    }

    .noscript-overlay {
      position: fixed;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 1.5rem;
      background: rgba(0, 0, 0, 0.65);
      backdrop-filter: blur(6px);
      z-index: 999;
    }

    .noscript-overlay__card {
      max-width: 540px;
      width: 100%;
      background: rgba(15, 17, 21, 0.92);
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 16px;
      padding: 1.5rem;
      color: var(--text-primary);
      text-align: center;
    }

    .noscript-overlay__card h2 {
      margin-bottom: 0.5rem;
      font-size: 1.15rem;
    }

    .noscript-overlay__card p {
      color: var(--text-secondary);
      line-height: 1.6;
      font-size: 0.96rem;
    }

    [data-footer-root] {
      min-height: 220px;
    }

    body[data-page="dashboard"].dashboard-footer-hidden [data-footer-root] {
      display: none;
    }

    body[data-page="settings"].settings-footer-hidden [data-footer-root] {
      display: none;
    }

    .footer__social-links {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .footer__social-links a {
      width: 36px;
      height: 36px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      border: 1px solid var(--border-primary);
      color: var(--text-secondary);
      text-decoration: none;
      transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    }

    .footer__social-links a:hover {
      color: var(--text-primary);
      border-color: var(--border-hover);
      background: var(--bg-tertiary);
    }

    .footer__bottom {
      display: flex;
      flex-direction: column;
      gap: 0.4rem;
      font-size: 0.9rem;
      color: var(--text-tertiary);
    }

    .footer__version {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      color: var(--text-secondary);
      font-size: 0.85rem;
    }

    .footer__update-wrap {
      position: relative;
      display: inline-flex;
      align-items: center;
    }

    .footer__update {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: #ef4444;
      background: transparent;
      border: none;
      padding: 0;
      text-decoration: none;
      cursor: pointer;
    }

    .footer__update:hover {
      color: #f87171;
    }

    .footer__update-tooltip {
      position: absolute;
      bottom: calc(100% + 15px);
      left: 50%;
      transform: translate(-50%, 4px);
      background: var(--bg-secondary);
      border: 1px solid var(--border-primary);
      color: var(--text-primary);
      padding: 0.35rem 0.5rem;
      border-radius: 8px;
      font-size: 0.75rem;
      white-space: nowrap;
      opacity: 0;
      pointer-events: none;
      will-change: opacity;
      z-index: 2;
      text-decoration: none;
    }

    .footer__update-tooltip::after {
      content: '';
      position: absolute;
      left: 50%;
      top: 100%;
      width: 8px;
      height: 8px;
      background: var(--bg-secondary);
      border-right: 1px solid var(--border-primary);
      border-bottom: 1px solid var(--border-primary);
      transform: translate(-50%, -4px) rotate(45deg);
    }

    .footer__update-wrap.is-open .footer__update-tooltip {
      opacity: 1;
      pointer-events: auto;
      animation: footer-tooltip-in 0.18s ease;
    }

    .footer__update-wrap.is-closing .footer__update-tooltip {
      opacity: 0;
      pointer-events: none;
      animation: footer-tooltip-out 0.18s ease;
    }

    @keyframes footer-tooltip-in {
      from {
        opacity: 0;
      }
      to {
        opacity: 1;
      }
    }

    @keyframes footer-tooltip-out {
      from {
        opacity: 1;
      }
      to {
        opacity: 0;
      }
    }

    .footer__bottom a {
      color: inherit;
      text-decoration: none;
      transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    }

    .footer__bottom a:hover {
      color: var(--text-secondary);
    }

    .footer i {
      font-size: 1.125rem;
    }

/* -------------------------------------------------------------------------- */
/* Settings                                                                   */
/* -------------------------------------------------------------------------- */
.settings-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  padding: 0.75rem 0rem;
}

.hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.35rem;
  color: var(--text-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 50%;
  font-size: 0.7rem;
  vertical-align: middle;
  cursor: pointer;
  position: relative;
}

.hint-icon i {
  line-height: 1;
}

.hint-icon[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px) scale(0.96);
  background: var(--bg-secondary);
  border: 1px solid var(--accent);
  color: #fff;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  font-size: 0.80rem;
  white-space: normal;
  max-width: min(260px, 90vw);
  min-width: 180px;
  text-align: left;
  line-height: 1.35;
  z-index: 10;
  overflow-wrap: break-word;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hint-icon[data-tooltip].is-open::after,
.hint-icon[data-tooltip]:focus-visible::after {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(-8px) scale(1);
}

.hint-icon[data-tooltip].is-open::before,
.hint-icon[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

@media (max-width: 520px) {
  .hint-icon[data-tooltip]::after {
    max-width: min(220px, 90vw);
    min-width: 160px;
  }
}

.settings-card.hidden {
  display: none !important;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.settings-tab {
  border: 1px solid var(--border-primary);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 20px;
  padding: 0.4rem 0.8rem;
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.settings-tab:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.settings-tab--active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--accent);
}

.settings-tab--active i {
  color: inherit;
}

.mode-selector {
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 1rem;
  background: var(--bg-tertiary);
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mode-selector__head strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.mode-selector__head small {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.mode-selector__head p{
  font-size: 1.1rem;
  font-weight: 500;
}

.mode-selector__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.mode-chip {
  flex: 1 1 220px;
  min-width: 200px;
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  cursor: pointer;
  background: var(--bg-secondary);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.mode-chip input {
  margin-top: 0.2rem;
}

.mode-chip span {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mode-chip__title {
  font-weight: 600;
}

.mode-chip small {
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

.mode-chip input:checked + span .mode-chip__title {
  color: var(--accent);
}


.modal:focus,
.modal:focus-visible {
  outline: none;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.file-upload {
  border: 1px dashed var(--border-primary);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  cursor: pointer;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.file-upload:hover {
      border-color: var(--border-hover);
      color: var(--text-primary);
    }

.file-upload input {
  display: none;
}

.file-upload span {
  font-weight: 500;
}

.backup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 0.5rem;
}

/* -------------------------------------------------------------------------- */
/* API keys                                                                   */
/* -------------------------------------------------------------------------- */
.api-keys-list {
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 0.75rem;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  margin-top: 1rem;
}

.api-keys-list:empty::before {
  content: 'No API keys yet.';
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.api-key-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border-primary);
}

.api-key-row:last-child {
  border-bottom: none;
}

.api-key-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.api-key-meta strong {
  font-size: 0.95rem;
}

.api-key-meta small {
  color: var(--text-tertiary);
  font-size: 0.78rem;
}

.api-key-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.api-key-form {
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-secondary);
}

.api-key-form textarea {
  min-height: 80px;
}

#apiKeyCountersField.hidden {
  display: none;
}

.api-keys-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.25rem 0 1rem;
}

.api-keys-pagination.hidden {
  display: none;
}

/* -------------------------------------------------------------------------- */
/* Users (settings)                                                           */
/* -------------------------------------------------------------------------- */
.users-toolbar {
    width: 100%;
  }

  .users-toolbar select {
    margin-left: auto;
  }

.users-list {
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 0.75rem;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.users-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.users-head .settings-desc {
  display: block;
}

.users-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
}

.users-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  background: var(--bg-tertiary);
  flex: 1 1 220px;
  min-width: 0;
}

.users-search i {
  color: var(--text-tertiary);
  font-size: 0.95rem;
}

.users-search input[type="search"] {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 0.1rem;
  background: transparent;
  border-radius: 0 !important;
  appearance: none;
  -webkit-appearance: none;
}

.users-search input[type="search"]:focus {
  border: none;
}

.users-toolbar select {
  margin-left: auto;
}

@media (max-width: 640px) {
  .users-search {
    width: 100%;
  }

  .users-toolbar select {
    width: 100%;
    margin-left: 0;
  }
}

.users-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.25rem 0 1rem;
}

.users-pagination.hidden {
  display: none;
}

.users-list:empty::before {
  content: 'No users yet.';
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.user-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border-primary);
}

.user-row:last-child {
  border-bottom: none;
}

.user-row__meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.user-row__avatar {
  width: 32px;
  height: 32px;
  border-radius: 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.85rem;
  overflow: hidden;
}

.user-row__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-row__meta {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.user-row__meta strong,
.user-row__meta .hint {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.user-row__meta strong {
  font-size: 0.95rem;
}

.user-row__meta .hint {
  color: var(--text-tertiary);
}

.user-row__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.user-row__actions select {
  min-width: 120px;
}

.user-row__badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border-primary);
  border-radius: 5px;
  color: var(--text-secondary);
}

@media (max-width: 520px) {
  .user-row__actions {
    gap: 0.35rem;
  }

  .user-row__actions button {
    padding: 0.75rem 0.95rem;
    font-size: 1rem;
  }
}

/* -------------------------------------------------------------------------- */
/* Profile                                                                    */
/* -------------------------------------------------------------------------- */
.profile-avatar {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-avatar__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 1;
}

.profile-avatar__copy {
  display: flex;
  flex-direction: column;
}

.profile-avatar__button {
  width: 72px;
  height: 72px;
  border-radius: 100px;
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  padding: 0;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.profile-avatar__button:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.profile-avatar__button img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar__button span {
  position: relative;
  z-index: 1;
  font-weight: 600;
  font-size: 1.2rem;
}

.profile-avatar__meta p {
  margin: 0 0 0.2rem;
}

.profile-avatar__remove {
  align-self: center;
}

.profile-avatar__meta .hint {
  margin: 0;
}

@media (max-width: 520px) {
  .profile-avatar {
    align-items: flex-start;
    gap: 0.85rem;
  }

  .profile-avatar__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .profile-avatar__remove {
    align-self: flex-start;
  }
}

.profile-password-reset {
  align-self: flex-start;
  width: auto;
}

.profile-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.profile-display__value {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-display__edit {
  padding: 0.25rem 0.4rem;
}

.profile-username {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.profile-username__value {
  font-weight: 400;
  color: var(--text-primary);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-username__edit {
  padding: 0.25rem 0.4rem;
}

.profile-role-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.profile-role-inline__label {
  font-weight: 400;
  color: var(--text-secondary);
}

.profile-role-inline__value {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 100px;
  padding: 0rem 0.55rem;
}

.toggle--inline {
  margin-top: 0.5rem;
}

.toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  background: var(--bg-secondary);
  cursor: pointer;
}

.toggle input {
  appearance: none;
      width: 1rem;
      height: 1rem;
      background: var(--bg-secondary);
      border: 1.5px solid var(--border-primary);
      border-radius: 4px;
      cursor: pointer;
      position: relative;
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      flex-shrink: 0;
}

.toggle input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toggle input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.toggle input:checked::after {
  content: '';
  position: absolute;
  top: 0.05rem;
  left: 0.25rem;
  width: 0.3rem;
  height: 0.55rem;
  border-right: 2px solid var(--bg-primary);
  border-bottom: 2px solid var(--bg-primary);
  transform: rotate(45deg);
}

.toggle strong {
  display: block;
  font-weight: 600;
}

.toggle small {
  color: var(--text-secondary);
  font-size: 0.8rem;
}
    .counter-widget {
      display: inline-flex;
      flex-direction: row;
      flex-wrap: wrap;
      align-items: baseline;
      justify-content: center;
      gap: 0.35rem;
      font-family: 'Inter', sans-serif;
      font-weight: 400;
      font-size: 1rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      font-variant-numeric: tabular-nums;
      text-align: center;
      max-width: 100%;
      word-break: break-word;
      overflow-wrap: anywhere;
      color: inherit;
}

.toggle input:checked + span .mode-chip__title {
  color: var(--accent);
}


    .counter-widget__label,
    .counter-widget__value {
      font-size: inherit;
      word-break: break-word;
    }

    .counter-widget__label {
      opacity: 0.65;
      flex: 1 1 auto;
      min-width: 0;
      overflow-wrap: anywhere;
    }

    .counter-widget__value {
      font-weight: 700;
      color: var(--text-primary);
      flex: 0 0 auto;
    }

    .counter-widget--preview {
      font-size: 1.1rem;
    }

    @media (max-width: 640px) {
      .page {
        padding: 3rem 1.25rem 3rem;
      }

      .hero h1 {
        font-size: 2rem;
      }

      .hero > p {
        font-size: 1rem;
      }

      .footer__grid {
        grid-template-columns: 1fr;
      }

      .footer__social-links {
        flex-wrap: wrap;
      }

      .savebtn,
      .cancelbtn{ 
        padding: 0.75rem 1rem;
      }


      textarea::-webkit-resizer {
        display: none;
      }
    }

/* -------------------------------------------------------------------------- */
/* Navigation                                                                 */
/* -------------------------------------------------------------------------- */
.site-nav {
  max-width: 670px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border-primary);
  height: 90px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  flex: 0 0 auto;
}

.brand img {
  height: 48px;
  width: auto;
  max-width: 100%;
}

.nav-link {
  padding: 0.5rem 0.9rem;
  border-radius: 18px;
  border: 1px solid var(--border-primary);
  color: var(--text-primary) !important;
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  height: 44px;
  transition: all 0.2s ease;
}

.nav-link:hover{
  opacity: 0.88;
}

.nav-link.ghost {
  background: transparent;
}

.nav-account {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-account__button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 100px;
  line-height: 1;
}

.nav-account__button i {
  display: block;
  line-height: 1;
}

.nav-account__button.nav-account__button--avatar {
  padding: 0;
  width: 44px;
  height: 44px;
  border-radius: 100px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-account__avatar {
  width: 100%;
  height: 100%;
  border-radius: 100px;
  object-fit: cover;
  display: block;
  background: transparent;
  color: var(--text-primary);
  border: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.nav-account__avatar--fallback {
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-secondary);
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  z-index: 50;
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  transform-origin: top right;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.account-menu--open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}

.account-menu__link {
  transition: none;
}

.account-menu__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
}

.account-menu__link i {
  font-size: 1rem;
}

.account-menu__link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.account-menu__logout {
  text-align: left;
}

.account-menu__danger {
  color: #f87171;
}

.account-menu__danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

@media (max-width: 640px) {
  .site-nav {
    flex-wrap: nowrap;
    padding: 1rem 1.25rem;
  }

  .brand img {
    height: 40px;
  }

  .nav-link {
    padding: 0.45rem 0.8rem;
  }
}
/* -------------------------------------------------------------------------- */
/* Dashboard                                                                  */
/* -------------------------------------------------------------------------- */
.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* literally dont know if it looks good like this :/ */
.dashboard-head--card {
  padding: 0 1.25rem 1.2rem;
  margin: 0 -1.25rem 1.2rem;
  border-bottom: 0.5px solid var(--border-primary);
}

.dashboard-head > div {
  min-width: 0;
}

.dashboard-head .hint {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dashboard-head h2,
.admin-panel__header h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}



#dashboardCard {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 0;
}

.login-card h2{
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* meh idk if it looks good like this :/ */
.login-card p{
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-weight: 0;
}

.settings-card h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}


.settings-card p {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  letter-spacing: -0.01em;
}

.settings-desc {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.dashboard-card {
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 1.25rem;
  background: var(--bg-secondary);
}

.form.compact {
  gap: 0.75rem;
}

#adminEmbedSnippet {
  width: 100%;
  min-height: 70px;
  background: #0b0b0b;
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 0.75rem 2.5rem 0.75rem 0.75rem;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  font-size: 0.85rem;
}

#embedSnippet{
  width: 100%;
  min-height: 70px;
  background: #0b0b0b;
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 0.75rem 2.5rem 0.75rem 0.75rem;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
}

.embed-snippet {
  position: relative;
}

.embed-block {
  margin-top: 0.9rem;
}

.embed-block__head {
  margin-bottom: 0.5rem;
}

.embed-block__head h4 {
  margin: 0 0 0.2rem 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.embed-snippet__copy {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.embed-snippet__copy.copied,
.embed-snippet__copy.copied:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}


.error {
  color: #f87171;
}
