/* styles.css */
:root{
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card: #ffffff;
  --shadow: 0 10px 22px rgba(17, 24, 39, .08), 0 1px 2px rgba(17, 24, 39, .06);

  --accent: #4cae74;     /* screenshot-like green */
  --accent-2: #2f8f5d;
  --accent-soft: rgba(76, 174, 116, .16);

  --radius: 10px;

  /* --- UI tokens (NEW) --- */
  --surface: var(--card);
  --surface-2: #f3f4f6;                 /* subtle raised surface */
  --border-strong: var(--border);
  --border-dashed: #cfd6df;             /* light dashed border */
  --note-border: rgba(0,0,0,.18);

  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);

  --btn-primary-bg: var(--accent);
  --btn-primary-fg: #fff;
  --btn-primary-border: var(--accent);

  --btn-ghost-bg: transparent;
  --btn-ghost-fg: var(--muted);
  --btn-ghost-border: var(--border-strong);

  --focus-border: rgba(76, 174, 116, .55);
  --focus-ring: 0 0 0 3px rgba(76, 174, 116, .18);

  --dropzone-bg: #fbfbfc;
  --dropzone-border: var(--border-dashed);
  --thumb-bg: #f3f4f6;
  --modal-player-bg: #f3f4f6;

  --icon-muted: #9ca3af;

  /* Footer (theme-aware) */
  --footer-bg: var(--bg);
  --footer-border: var(--border);
  --footer-text: var(--text);
  --footer-muted: var(--muted);
  --footer-accent: var(--accent);
  --footer-pill-bg: var(--surface-2);
  --footer-pill-border: var(--border);
  --footer-link: var(--text);
  --footer-link-hover: var(--accent-2);

}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* accessibility */
.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;
}

.muted{ color: var(--muted); }
.small{ font-size: 12px; }

/* Topbar */
.topbar{
  padding: 14px 18px;
}
.topbar__inner{
  max-width: 1080px;
  margin: 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color: var(--accent-2);
  font-weight: 700;
}
.brand__mark{
  display:grid; place-items:center;
  color: var(--accent);
}
.brand__name{
  font-size: 22px;
  letter-spacing: .2px;
}

.logo{
    width: 120px;
}

.avatar{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  background: var(--accent);
  color:#fff;
  font-weight: 700;
  font-size: 14px;
}

.avatar--guest{
  color:#fff;               /* icon color */
}

.avatar__icon{
  width: 18px;
  height: 18px;
  display: block;
}

/* Page container */
.page{
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 18px 0px;
}

/* Hero */
.hero{
  text-align:center;
  padding: 28px 0 22px;
}
.hero__title{
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.hero__sub{
  margin: 10px auto 0;
  max-width: 500px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

/* Cards grid (Search / Upload) */
.panel-grid{
  margin: 0 auto;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 10px 0 14px;
}
@media (max-width: 860px){
  .panel-grid{ grid-template-columns: 1fr; }
}

/* Card */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card--wide{
  margin: 14px auto 0;
}
.card__head{
  padding: 14px 16px 8px;
}
.card__head--row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
}
.card__title{
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}
.card__desc{
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.card__body{
  padding: 10px 16px 16px;
}

/* Inputs */
.textarea{
  width: 100%;
  resize: none;
  min-height: 132px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 10px;
  outline: none;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
}
.textarea:focus{
  border-color: var(--focus-border);
  box-shadow: var(--focus-ring);
}

.input, .select{
  width: 100%;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  outline: none;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
}
.input:focus, .select:focus{
  border-color: var(--focus-border);
  box-shadow: var(--focus-ring);
}

/* Buttons (token-driven; stable across themes) */
.btn{
  appearance: none;
  -webkit-appearance: none;

  border: 1px solid var(--btn-border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  cursor: pointer;

  background: var(--btn-bg);
  color: var(--btn-fg);

  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .02s ease;
}
.btn--block{ width: 100%; }

.btn:hover{ filter: brightness(0.98); }
.btn:active{ transform: translateY(0.5px); }

.btn:focus-visible{
  outline: none;
  border-color: var(--focus-border);
  box-shadow: var(--focus-ring);
}

.btn--primary{
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  border-color: var(--btn-primary-border);
}
.btn--primary:hover{ background: var(--accent-2); border-color: var(--accent-2); }

.btn--ghost{
  margin-top: 10px;
  background: var(--btn-ghost-bg);
  border-color: var(--btn-ghost-border);
  color: var(--btn-ghost-fg);
}

.btn:disabled{ opacity: .6; cursor: not-allowed; }

/* Dropzone (token-driven) */
.dropzone--light{
  width: 100%;
  border: 1px dashed var(--dropzone-border);
  border-radius: 10px;
  background: var(--dropzone-bg);
  padding: 16px;
  cursor: pointer;
  user-select:none;
}
.dropzone__inner{
  min-height: 120px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap: 10px;
  color: var(--muted);
  text-align:center;
}
.dropzone__icon{
  color: #9ca3af;
}
.dropzone__primary{
  font-size: 12px;
}
.dropzone__meta{
  font-size: 12px;
  color: #9ca3af;
}
.dropzone.dragover{
  border-color: rgba(76, 174, 116, .9);
  box-shadow: var(--focus-ring);
  background: rgba(76, 174, 116, .06);
}
.dropzone:focus{
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: rgba(76, 174, 116, .9);
}

/* Advanced settings */
.advanced{
  padding: 0 16px 16px;
}
.advanced__box{
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface);
}
.checkline{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  padding: 8px 6px;
  cursor: pointer;
}
.checkline input{ margin-top: 2px; }
.checkline__text{ display:flex; flex-direction:column; gap: 2px; }
.checkline strong{ font-size: 12px; }
.checkline .muted{ font-size: 11px; }

.accordion{
  margin-top: 2px;
  width: 100%;
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 8px 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--accent-2);
  font-size: 12px;
  text-align:left;
}
.accordion__chev{
  display:inline-block;
  width: 18px;
}

.accordion__panel{
  max-height: 0;
  overflow:hidden;
  transition: max-height .25s ease;
  padding: 0 6px;
}
.accordion__panel.is-visible{
  max-height: 300px;
  padding-top: 8px;
}

.slider-row{
  margin: 10px 0 8px;
}
.slider-row__label{
  display:flex;
  align-items:center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}
.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-weight: 700;
  font-size: 12px;
}

input[type="range"]{
  width: 100%;
  accent-color: var(--accent);
}

/* lower controls row */
.advanced__controls{
  display:grid;
  grid-template-columns: 120px 160px 1fr 1fr;
  gap: 10px;
  align-items:end;
  margin-top: 12px;
}
@media (max-width: 860px){
  .advanced__controls{ grid-template-columns: 1fr 1fr; }
}

.control__label{
  display:block;
  font-size: 11px;
  margin: 0 0 6px;
}

.chip{
  display:flex;
  align-items:center;
  gap: 8px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
}
.chip input{ margin: 0; }

/* Note + status */
.note{
    margin: 12px 0 0;
    font-size: 11px;
    padding-top: 10px;
    width: 100%;
    border-top: 1px dashed var(--note-border);
    color: var(--accent-2);
}

/* Status banner (prominent) */
.status{
  position: sticky;
  top: 10px;
  z-index: 40;

  margin: 10px 0 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);

  box-shadow: var(--shadow);
}

.status:empty{
  display: none;
}

.status__dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 10px;
  background: var(--muted);
  opacity: .9;
}

.status--info{
  border-color: rgba(76,174,116,.35);
  background: rgba(76,174,116,.10);
}
.status--info .status__dot{ background: var(--accent); }

.status--warn{
  border-color: rgba(245,158,11,.45);
  background: rgba(245,158,11,.14);
}
.status--warn .status__dot{ background: rgb(245,158,11); }

.status--success{
  border-color: rgba(34,197,94,.45);
  background: rgba(34,197,94,.12);
}
.status--success .status__dot{ background: rgb(34,197,94); }

.status--error{
  border-color: rgba(239,68,68,.45);
  background: rgba(239,68,68,.12);
}
.status--error .status__dot{ background: rgb(239,68,68); }

/* Switch */
.switch{
  position: relative;
  display:inline-flex;
  align-items:center;
}
.switch input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.switch__track{
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  transition: background .18s ease;
}
.switch__track::after{
  content:"";
  position:absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background:#fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  transition: transform .18s ease;
}
.switch input:checked + .switch__track{
  background: var(--accent);
}
.switch input:checked + .switch__track::after{
  transform: translateX(16px);
}

/* Disabled advanced state (when switch off) */
.advanced.is-disabled{
  opacity: .55;
}
.advanced.is-disabled .advanced__box,
.advanced.is-disabled .chip,
.advanced.is-disabled .input,
.advanced.is-disabled .select,
.advanced.is-disabled input[type="range"]{
  pointer-events:none;
}

/* Results (light styling) */
.results{
  max-width: 1080px;
  margin: 18px auto 0;
}
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

/* result cards */
.card-video{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: var(--shadow);
}
.thumb{
  width:100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--thumb-bg);
}
.meta{
  padding: 10px 12px 12px;
}
.title{
  margin: 0 0 6px;
  font-size: 14px;
}
.source{
  font-size: 12px;
  color: var(--muted);
}

/* Loader */
.grid.is-loading{
  min-height: 180px;
}
.loader-wrap{
  grid-column: 1 / -1;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 22px;
}
.loader{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(76, 174, 116, .2);
  border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}
.loader-text{
  margin-left: 10px;
  color: var(--muted);
  font-size: 12px;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* Modal */
.modal{ position: fixed; inset: 0; display:none; z-index: 50; }
.modal.is-open{ display:block; }
.modal__backdrop{ position:absolute; inset:0; background: rgba(0,0,0,.55); }
.modal__dialog{
  position: relative;
  max-width: 980px;
  margin: 6vh auto 0;
  width: calc(100% - 26px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow:hidden;
  box-shadow: 0 18px 80px rgba(0,0,0,.35);
}
.modal__header{ display:none; }
.modal__body{ padding: 12px; }
.modal__player{
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--modal-player-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow:hidden;
}
.modal__player iframe{ width:100%; height:100%; display:block; }

#btnSearch,
#btnImageSearch{
    margin-top: 10px;
}

/* Dropzone: has-file */
.dropzone.has-file {
  border-color: var(--accent);
  background: rgba(76, 174, 116, 0.05);
}
.dropzone.has-file .dropzone__icon { color: var(--accent); }
.dropzone.has-file .dropzone__primary {
  color: var(--accent-2);
  font-weight: 600;
}

/* Improve drag-over state */
.dropzone.dragover .dropzone__icon {
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Score display styles */
.score-info {
  margin: 8px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.score-tag {
  background: var(--accent-soft);
  color: var(--accent-2);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}
.score-sub {
  background: rgba(107, 114, 128, 0.1);
  color: var(--muted);
  padding: 3px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  display: inline-block;
}
.score-sub.exact-match {
  background: rgba(76, 174, 116, 0.2);
  color: var(--accent-2);
  font-weight: 600;
}
.exact-match-tag {
  background: var(--accent);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  display: inline-block;
  margin-left: 4px;
}
.exact-match-card {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.card-video .btn--primary {
  margin-top: 12px;
  width: 100%;
}

/* Consent banner */
.consent {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 80;
}
.consent__inner {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  color: var(--text);
}

/* Light theme specific */
:root[data-theme="light"] .consent__inner {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-strong);
}

/* Dark theme specific */
:root[data-theme="dark"] .consent__inner,
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .consent__inner {
    background: rgba(15, 27, 45, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
  }
}

.consent__text { 
  flex: 1;
  min-width: 0;
}
.consent__text strong {
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}
.consent__sub { 
  margin: 0;
  font-size: 13px; 
  color: var(--muted);
  line-height: 1.5;
}
.consent__actions { 
  display: flex; 
  gap: 12px; 
  align-items: center;
  flex-shrink: 0;
}

/* Links styling */
.consent__link { 
  color: var(--accent); 
  text-decoration: none; 
  font-size: 12px; 
  font-weight: 600;
  white-space: nowrap;
}
.consent__link:hover { 
  text-decoration: underline; 
}
.consent__dot { 
  color: var(--muted); 
  margin: 0 4px; 
  opacity: 0.6;
}

/* Consent buttons */
.consent__btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}
.consent__btn:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.consent__btn:active {
  transform: translateY(0);
}
.consent__btn--primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.consent__btn--primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

/* Links row */
.consent__links {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .consent__inner { 
    flex-direction: column; 
    align-items: stretch; 
    gap: 16px;
    padding: 16px;
  }
  .consent__actions { 
    width: 100%; 
    flex-direction: column;
    align-items: stretch;
  }
  .consent__links {
    order: -1;
    justify-content: center;
    margin-bottom: 8px;
  }
  .consent__btn {
    width: 100%;
    text-align: center;
  }
}

.primary{
  color:#fff;
  width: 100%;
  background-color: var(--accent);
}

/* Busy overlay */
.busy{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 90;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(3px);
}
.busy.is-open{ display: grid; place-items: center; }

.busy__card{
  width: min(520px, calc(100% - 26px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 14px;
  box-shadow: 0 18px 80px rgba(0,0,0,.35);
}

.busy__row{
  display:flex;
  gap: 12px;
  align-items:center;
}

.busy__title{
  font-weight: 800;
  font-size: 14px;
}

.busy__hint{
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.busy__sub{
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

@media screen and (max-width: 768px) {
  .modal__player { aspect-ratio: 9 / 16; }
}
@media (max-width: 720px) {
  .consent__inner { flex-direction: column; align-items: flex-start; }
}

/* =======================================================================
   ✅ UPDATED: Tokens + Avatar ONLY + Avatar Dropdown Menu (Desktop/Tablet/Mobile)
   - Removes old account__actions usage
   - Anchors dropdown to avatar
   ======================================================================= */

.topbar__right{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.account{
  position: relative;            /* required for dropdown positioning */
  display: flex;
  align-items: center;
  gap: 10px;
}

/* token pill (stable on small screens) */
.tokenpill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}

/* avatar clickable as <a> or <button> */
.avatar-btn{
  border: 0;
  padding: 0;
  background: var(--accent);
  cursor: pointer;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
}

/* focus ring for accessibility */
.avatar-btn:focus-visible{
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Dropdown menu container */
.account-menu{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 110;

  width: min(320px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;

  display: none;                /* default hidden */
}

.account-menu.is-open{
  display: block;
}

/* menu items */
.account-menu__item{
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.account-menu__item:hover{
  background: var(--surface-2);
}

/* separator */
.account-menu__sep{
  height: 1px;
  background: var(--border);
  margin: 8px 6px;
  opacity: .9;
}

/* theme row */
.account-menu__row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 6px 2px;
}

.account-menu__label{
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.account-menu__select{
  width: 160px;
  height: 34px;
}

/* logout emphasis */
.account-menu__danger{
  color: rgb(239,68,68);
}
:root[data-theme="dark"] .account-menu__danger,
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .account-menu__danger { color: rgb(248,113,113); }
}

/* mobile + small screens */
@media (max-width: 720px){
  .account{ gap: 8px; }
  .account-menu__select{ width: 150px; }
}

/* =======================================================================
   (Optional safety) If old markup is still present anywhere, hide it.
   You can remove these if you fully deleted account__actions in HTML.
   ======================================================================= */
.account__actions{ display:none !important; }
.account__buy, .account__link{ display:none !important; }

/* Dark mode (follows system) */
@media (prefers-color-scheme: dark) {
  :root{
    --bg: #0b1220;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: rgba(255,255,255,.10);
    --card: #0f1b2d;
    --shadow: 0 10px 22px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.35);

    --accent: #4cae74;
    --accent-2: #62c28a;
    --accent-soft: rgba(76, 174, 116, .18);

    /* token overrides */
    --surface: var(--card);
    --surface-2: rgba(255,255,255,.06);
    --border-strong: var(--border);
    --border-dashed: rgba(255,255,255,.16);
    --note-border: rgba(255,255,255,.18);

    --btn-bg: var(--surface-2);
    --btn-fg: var(--text);
    --btn-border: var(--border-strong);

    --dropzone-bg: rgba(255,255,255,.04);
    --dropzone-border: var(--border-dashed);

    --thumb-bg: rgba(255,255,255,.06);
    --modal-player-bg: rgba(255,255,255,.06);

    --footer-bg: var(--bg);
    --footer-border: var(--border);
    --footer-text: var(--text);
    --footer-muted: var(--muted);
    --footer-accent: var(--accent);
    --footer-pill-bg: rgba(255,255,255,.06);
    --footer-pill-border: rgba(255,255,255,.14);
    --footer-link: rgba(229,231,235,.88);
    --footer-link-hover: #ffffff;

  }

  /* Keep only non-token things here */
  .dropzone__icon{
    color: var(--icon-muted);
  }
}

/* Manual theme override (takes priority over system) */
:root[data-theme="light"]{
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card: #ffffff;
  --shadow: 0 10px 22px rgba(17, 24, 39, .08), 0 1px 2px rgba(17, 24, 39, .06);

  /* tokens */
  --surface: var(--card);
  --surface-2: #f3f4f6;
  --border-strong: var(--border);
  --border-dashed: #cfd6df;
  --note-border: rgba(0,0,0,.18);

  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);

  --dropzone-bg: #fbfbfc;
  --dropzone-border: var(--border-dashed);

  --thumb-bg: #f3f4f6;
  --modal-player-bg: #f3f4f6;

  --footer-bg: var(--bg);
  --footer-border: var(--border);
  --footer-text: var(--text);
  --footer-muted: var(--muted);
  --footer-accent: var(--accent);
  --footer-pill-bg: var(--surface-2);
  --footer-pill-border: var(--border);
  --footer-link: var(--text);
  --footer-link-hover: var(--accent-2);

}

:root[data-theme="dark"]{
  --bg: #0b1220;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: rgba(255,255,255,.10);
  --card: #0f1b2d;
  --shadow: 0 10px 22px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.35);

  --accent: #4cae74;
  --accent-2: #62c28a;
  --accent-soft: rgba(76, 174, 116, .18);

  /* tokens */
  --surface: var(--card);
  --surface-2: rgba(255,255,255,.06);
  --border-strong: var(--border);
  --border-dashed: rgba(255,255,255,.16);
  --note-border: rgba(255,255,255,.18);

  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);

  --dropzone-bg: rgba(255,255,255,.04);
  --dropzone-border: var(--border-dashed);

  --thumb-bg: rgba(255,255,255,.06);
  --modal-player-bg: rgba(255,255,255,.06);
  --icon-muted: rgba(255,255,255,.55);

  --footer-bg: var(--bg);
  --footer-border: var(--border);
  --footer-text: var(--text);
  --footer-muted: var(--muted);
  --footer-accent:  var(--accent);
  --footer-pill-bg: rgba(255,255,255,.06);
  --footer-pill-border: rgba(255,255,255,.14);
  --footer-link: rgba(229,231,235,.88);
  --footer-link-hover: #ffffff;
}

.footer-disclaimer{
  margin-top: 22px;
  padding: 16px 18px 6px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.footer-disclaimer p{
  font-size: 12px;
  line-height: 1.6;
  color: var(--footer-muted);
  margin: 0;
  text-align: center;
}

/* Footer */
.site-footer{
  margin-top: 34px;
  width: 100%;
  background: var(--footer-bg);
  border-top: 1px dotted var(--footer-border);
  color: var(--footer-text);
}

.site-footer__inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 18px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1.6fr;
  gap: 34px;
  align-items: start;
}

.footer-col{ min-width: 0; }

.footer-kicker{
  color: var(--footer-accent);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .6px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.footer-title{
  color: var(--footer-text);
  font-weight: 800;
  font-size: 16px;
  margin: 0 0 10px;
}

.footer-title--accent{ color: var(--footer-accent); }
.footer-title--spaced{ margin-top: 16px; }

.footer-muted{
  color: var(--footer-muted);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 10px;
}

.footer-link,
.footer-nav{
  display: inline-block;
  color: var(--footer-link);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.9;
}

.footer-link:hover,
.footer-nav:hover{
  color: var(--footer-link-hover);
  text-decoration: underline;
}

.footer-link--strong{ font-weight: 800; }

.footer-nav{ display: block; padding-left: 2px; }

.footer-payments{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.pay-badge{
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--footer-text);
  border: 1px solid var(--footer-pill-border);
  background: var(--footer-pill-bg);
}

@media (max-width: 920px){
  .site-footer__inner{
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

.t-primary{
  color:#4cae74;
}

.t-muted{
  color:var(--footer-link-hover);
}

.t-center{
  text-align: center;
}

/* Tooltip (bottom-center) */
.has-tooltip{
  position: relative;
}

.has-tooltip::after{
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 10px);   /* BELOW avatar */
  left: 50%;
  transform: translateX(-50%);

  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;

  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;

  box-shadow: var(--shadow);

  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}

.has-tooltip::before{
  content: "";
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);

  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent var(--border) transparent;

  opacity: 0;
  transition: opacity .15s ease;
}

/* Show on hover + keyboard focus */
.has-tooltip:hover::after,
.has-tooltip:hover::before,
.has-tooltip:focus-visible::after,
.has-tooltip:focus-visible::before{
  opacity: 1;
}

.card-icon{
  width: 60px;
}