/* =====================================================================
   TIER MAKER — visual da área de tier lists (hub, criador e editor)
   Usa os tokens de theme.css; as cores das tiers são próprias, mais
   suaves que as antigas, e valem nos dois temas.
   ===================================================================== */
:root{
  --tier-S:#D9705B;--tier-A:#E39A4F;--tier-B:#D6BC4C;--tier-C:#8DAF5F;--tier-D:#5F95AE;--tier-F:#9283B0;
  --tier-ink:#1D2410;
}
.tm-c-S{background:var(--tier-S)}.tm-c-A{background:var(--tier-A)}.tm-c-B{background:var(--tier-B)}
.tm-c-C{background:var(--tier-C)}.tm-c-D{background:var(--tier-D)}.tm-c-F{background:var(--tier-F)}

.tm{max-width:1180px;margin:0 auto;display:flex;flex-direction:column;gap:22px}
.tm-kicker{font-family:var(--f-mono);font-size:11px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--accent)}

/* ---------- HERO ---------- */
.tm-hero{
  display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:28px;align-items:center;
  padding:clamp(22px,3vw,36px);border-radius:28px;
  background:
    radial-gradient(520px 260px at 100% 0%, rgba(var(--accent-rgb),.18), transparent 70%),
    var(--surface);
  border:1px solid var(--border);
  box-shadow:0 20px 50px -34px rgba(var(--shadow-rgb),.8);
}
.tm-hero-copy{display:flex;flex-direction:column;gap:12px;min-width:0}
.tm-hero h1{
  font-family:var(--f-display);font-weight:600;letter-spacing:-.025em;line-height:1.05;
  font-size:clamp(28px,3.6vw,46px);color:var(--text);margin:0;
}
.tm-hero p{color:var(--text2);font-size:15px;line-height:1.6;margin:0;max-width:46ch}
.tm-hero-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}
.tm-hero-stats{display:flex;gap:18px;color:var(--text3);font-size:13px;margin-top:4px}
.tm-hero-stats b{color:var(--text);font-weight:700}
.tm-hero-preview{
  display:flex;flex-direction:column;gap:8px;padding:14px;border-radius:20px;
  background:var(--bg);border:1px solid var(--border);
}
.tm-hero-row{display:flex;gap:8px;align-items:stretch}
.tm-hero-label{
  width:46px;flex-shrink:0;border-radius:12px;display:flex;align-items:center;justify-content:center;
  font-family:var(--f-display);font-weight:700;font-size:20px;color:var(--tier-ink);
}
.tm-hero-thumbs{display:flex;gap:6px;flex:1;min-width:0;overflow:hidden;padding:4px;border-radius:12px;background:rgba(var(--ink-rgb),.04)}
.tm-hero-thumbs img,.tm-hero-ph{width:44px;height:62px;border-radius:8px;object-fit:cover;flex-shrink:0;display:block}
.tm-hero-ph{background:rgba(var(--ink-rgb),.08)}

/* ---------- ABAS ---------- */
.tm-tabs{
  display:flex;gap:6px;padding:5px;border-radius:999px;align-self:flex-start;max-width:100%;overflow-x:auto;
  background:rgba(var(--ink-rgb),.06);
}
.tm-tab{
  all:unset;cursor:pointer;white-space:nowrap;padding:10px 18px;border-radius:999px;
  font-size:14px;font-weight:600;color:var(--text2);transition:background .15s ease,color .15s ease;
}
.tm-tab:hover{color:var(--text)}
.tm-tab:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tm-tab.active{background:var(--surface-hi);color:var(--text);box-shadow:0 4px 12px -6px rgba(var(--shadow-rgb),.5)}
:root[data-theme="dark"] .tm-tab.active{background:var(--surface2)}
.tm-tab-count{font-size:11px;font-weight:700;padding:1px 7px;border-radius:999px;background:rgba(var(--accent-rgb),.16);color:var(--accent);margin-left:4px}

/* ---------- SEÇÕES ---------- */
.tm-panel{display:flex;flex-direction:column;gap:30px}
.tm-section{display:flex;flex-direction:column;gap:14px}
.tm-section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
.tm-section-head h2{font-family:var(--f-display);font-weight:600;font-size:22px;letter-spacing:-.01em;color:var(--text);margin:0}
.tm-section-head p{font-size:13.5px;color:var(--text2);margin:2px 0 0}
.tm-link{all:unset;cursor:pointer;font-size:13.5px;font-weight:600;color:var(--accent);white-space:nowrap;border-radius:6px}
.tm-link:hover{text-decoration:underline;text-underline-offset:3px}
.tm-link:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tm-note{font-size:13px;color:var(--text3);margin:0 0 4px}
.tm-muted{color:var(--text3);font-size:13.5px;margin:6px 0}
.tm-muted.center{text-align:center}
.tm-empty-inline{
  padding:20px;border-radius:18px;border:1.5px dashed rgba(var(--ink-rgb),.16);
  color:var(--text2);font-size:14px;line-height:1.55;
}

/* Trilho de obras */
.tm-rail{display:flex;gap:14px;overflow-x:auto;padding:4px 2px 10px;scroll-snap-type:x proximity}
.tm-rail::-webkit-scrollbar{height:6px}
.tm-rail::-webkit-scrollbar-thumb{background:rgba(var(--ink-rgb),.14);border-radius:6px}
.tm-work{all:unset;cursor:pointer;width:132px;flex-shrink:0;display:flex;flex-direction:column;gap:6px;scroll-snap-align:start}
.tm-work-poster{
  position:relative;aspect-ratio:2/3;border-radius:16px;overflow:hidden;background:var(--bg3);
  border:1px solid var(--border);box-shadow:0 12px 24px -18px rgba(var(--shadow-rgb),.8);
}
.tm-work-poster img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .35s ease}
.tm-work:hover .tm-work-poster img{transform:scale(1.03)}
.tm-work-cta{
  position:absolute;left:8px;right:8px;bottom:8px;padding:7px 8px;border-radius:10px;text-align:center;
  font-size:12px;font-weight:700;background:var(--accent);color:var(--on-accent);
  opacity:0;transform:translateY(6px);transition:opacity .18s ease,transform .18s ease;
}
.tm-work:hover .tm-work-cta,.tm-work:focus-visible .tm-work-cta{opacity:1;transform:none}
@media (hover:none){.tm-work-cta{opacity:1;transform:none}}
.tm-work:focus-visible .tm-work-poster{outline:2px solid var(--accent);outline-offset:2px}
.tm-work-title{font-size:13px;font-weight:600;color:var(--text);line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tm-work-type{font-size:11.5px;color:var(--text3)}
.tm-thumb-fallback{display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:22px;background:var(--bg3)}

/* Ideias */
.tm-ideas{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px}
.tm-idea{
  all:unset;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;gap:4px;
  padding:16px;border-radius:18px;background:var(--surface);border:1px solid var(--border);
  transition:transform .15s ease,border-color .15s ease;
}
.tm-idea:hover{transform:translateY(-2px);border-color:rgba(var(--accent-rgb),.5)}
.tm-idea:active{transform:scale(.99)}
.tm-idea:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tm-idea-icon{font-size:24px;margin-bottom:6px}
.tm-idea-tag{font-family:var(--f-mono);font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--accent)}
.tm-idea-title{font-weight:700;font-size:15px;color:var(--text);line-height:1.3}
.tm-idea-desc{font-size:13px;color:var(--text2);line-height:1.45}

/* ---------- CARDS DE TIER LIST ---------- */
.tm-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:14px}
.tm-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;color:var(--text2);font-size:14px}
.tm-card{
  position:relative;cursor:pointer;display:flex;flex-direction:column;overflow:hidden;
  border-radius:20px;background:var(--surface);border:1px solid var(--border);
  box-shadow:0 12px 26px -22px rgba(var(--shadow-rgb),.8);
  transition:transform .18s ease,border-color .18s ease;
}
.tm-card:hover{transform:translateY(-2px);border-color:rgba(var(--accent-rgb),.45)}
.tm-card:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tm-card-preview{display:flex;flex-direction:column;gap:5px;padding:12px;background:var(--bg);min-height:132px;border-bottom:1px solid var(--border)}
.tm-card-row{display:flex;gap:6px;align-items:stretch}
.tm-card-label{
  width:32px;flex-shrink:0;border-radius:8px;display:flex;align-items:center;justify-content:center;
  font-size:11px;font-weight:800;color:var(--tier-ink);text-transform:uppercase;overflow:hidden;
}
.tm-card-thumbs{display:flex;gap:4px;flex:1;min-width:0;align-items:center}
.tm-thumb{width:28px;height:38px;border-radius:6px;overflow:hidden;flex-shrink:0;background:var(--bg3);display:block}
.tm-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.tm-thumb .tm-thumb-fallback{font-size:14px}
.tm-card-more{font-size:11px;font-weight:700;color:var(--text3);padding-left:4px}
.tm-card-blank{display:flex;align-items:center;justify-content:center;flex:1;color:var(--text3);font-size:13px;text-align:center;padding:0 12px}
.tm-card-info{padding:12px 14px 14px;display:flex;flex-direction:column;gap:6px}
.tm-card-title{font-family:var(--f-display);font-weight:600;font-size:17px;line-height:1.25;color:var(--text);
  display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;padding-right:28px}
.tm-card-meta{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--text2)}
.tm-pill{font-size:11px;font-weight:700;padding:3px 9px;border-radius:999px;background:rgba(var(--accent-rgb),.14);color:var(--accent)}
.tm-card-author{all:unset;cursor:pointer;align-self:flex-start;display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--text2);font-weight:600;border-radius:999px;padding:2px 8px 2px 2px;margin-left:-2px}
.tm-card-author:hover{background:rgba(var(--accent-rgb),.1);color:var(--accent)}
.tm-card-author:focus-visible{outline:2px solid var(--accent)}
.tm-mini-avatar{width:22px;height:22px;border-radius:50%;overflow:hidden;background:var(--accent);color:var(--on-accent);display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700}
.tm-mini-avatar img{width:100%;height:100%;object-fit:cover}
.tm-card-del{
  position:absolute;right:10px;bottom:12px;width:32px;height:32px;border-radius:10px;border:none;cursor:pointer;
  background:transparent;color:var(--text3);display:flex;align-items:center;justify-content:center;transition:background .15s ease,color .15s ease;
}
.tm-card-del svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tm-card-del:hover{background:rgba(var(--red-rgb),.12);color:var(--red)}
.tm-card-skel{min-height:230px;background:linear-gradient(90deg,var(--surface),var(--surface-hi),var(--surface));background-size:200% 100%;animation:tmShimmer 1.4s linear infinite;cursor:default}
@keyframes tmShimmer{to{background-position:-200% 0}}

/* Vazio */
.tm-empty{
  display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;
  padding:56px 20px;border:1.5px dashed rgba(var(--ink-rgb),.16);border-radius:24px;
}
.tm-empty.small{padding:32px 16px;border:none}
.tm-empty-icon{width:68px;height:68px;border-radius:22px;display:flex;align-items:center;justify-content:center;font-size:32px;background:rgba(var(--accent-rgb),.12);margin-bottom:6px}
.tm-empty h3{font-family:var(--f-display);font-weight:600;font-size:21px;color:var(--text);margin:0}
.tm-empty p{color:var(--text2);font-size:14px;max-width:420px;margin:0 0 8px;line-height:1.55}

/* ---------- CRIADORES ---------- */
.tm-creators{display:flex;gap:10px;overflow-x:auto;padding:2px 2px 8px}
.tm-creator{
  all:unset;box-sizing:border-box;cursor:pointer;flex-shrink:0;width:120px;display:flex;flex-direction:column;align-items:center;gap:4px;
  padding:14px 10px;border-radius:18px;background:var(--surface);border:1px solid var(--border);text-align:center;
  transition:transform .15s ease,border-color .15s ease;
}
.tm-creator:hover{transform:translateY(-2px);border-color:rgba(var(--accent-rgb),.5)}
.tm-creator:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tm-creator-avatar{width:56px;height:56px;border-radius:50%;overflow:hidden;background:var(--accent);color:var(--on-accent);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:20px;margin-bottom:4px}
.tm-creator-avatar img{width:100%;height:100%;object-fit:cover}
.tm-creator-name{font-size:13px;font-weight:700;color:var(--text);max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tm-creator-count{font-size:11.5px;color:var(--text3)}

/* ---------- PERFIL DE TIER LISTS ---------- */
.tm-user{display:flex;flex-direction:column;gap:12px}
.tm-user-back{align-self:flex-start}
.tm-user-card{
  display:flex;align-items:center;gap:18px;flex-wrap:wrap;padding:20px;border-radius:24px;
  background:radial-gradient(420px 200px at 100% 0%, rgba(var(--accent-rgb),.16), transparent 70%),var(--surface);border:1px solid var(--border);
}
.tm-user-avatar{width:84px;height:84px;border-radius:50%;overflow:hidden;flex-shrink:0;background:var(--accent);color:var(--on-accent);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:30px}
.tm-user-avatar img{width:100%;height:100%;object-fit:cover}
.tm-user-id{flex:1;min-width:180px;display:flex;flex-direction:column;gap:2px}
.tm-user-id h2{font-family:var(--f-display);font-weight:600;font-size:26px;letter-spacing:-.01em;color:var(--text);margin:0}
.tm-user-id > span{font-size:14px;color:var(--text2)}
.tm-user-stats{display:flex;gap:16px;font-size:13px;color:var(--text3);margin-top:6px}
.tm-user-stats b{color:var(--text)}
.tm-user-actions{display:flex;gap:8px;flex-wrap:wrap}
.tm-user-actions button{padding:10px 18px !important;font-size:13.5px !important}

/* ---------- CRIADOR (sheet) ---------- */
.tm-sheet-overlay{
  position:fixed;inset:0;z-index:1200;display:flex;align-items:center;justify-content:center;
  padding:24px 16px;background:rgba(var(--shadow-rgb),.5);backdrop-filter:blur(6px);
}
.tm-sheet-overlay.hidden{display:none}
.tm-sheet{
  width:min(860px,100%);max-height:min(92vh,900px);display:flex;flex-direction:column;overflow:hidden;
  background:var(--surface-hi);border:1px solid var(--border);border-radius:26px;box-shadow:var(--shadow-lg);
  animation:tmSheetIn .22s cubic-bezier(.2,.8,.2,1);
}
:root[data-theme="dark"] .tm-sheet{background:var(--surface)}
@keyframes tmSheetIn{from{opacity:0;transform:translateY(12px) scale(.985)}}
.tm-sheet-head{display:flex;align-items:center;gap:12px;padding:16px 18px;border-bottom:1px solid var(--border)}
.tm-sheet-titles{flex:1;min-width:0}
.tm-sheet-titles h3{font-family:var(--f-display);font-weight:600;font-size:21px;color:var(--text);margin:2px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tm-icon-btn{
  width:40px;height:40px;flex-shrink:0;border-radius:12px;border:1px solid var(--border);background:transparent;
  color:var(--text2);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:border-color .15s ease,color .15s ease;
}
.tm-icon-btn:hover{border-color:var(--accent);color:var(--accent)}
.tm-icon-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tm-sheet-body{flex:1;overflow-y:auto;padding:20px 22px;display:flex;flex-direction:column;gap:18px}
.tm-sheet-foot{display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:14px 18px;border-top:1px solid var(--border)}
.tm-sheet-foot:empty{display:none}
.tm-foot-count{margin-right:auto;color:var(--text2);font-size:14px}
.tm-foot-count b{color:var(--text)}
.tm-sheet-foot .btn-primary[disabled]{opacity:.45;cursor:not-allowed;transform:none;box-shadow:none}

/* Modos */
.tm-modes{display:grid;grid-template-columns:1.3fr 1fr;grid-template-rows:auto auto;gap:12px}
.tm-mode{
  all:unset;box-sizing:border-box;cursor:pointer;position:relative;display:flex;flex-direction:column;gap:6px;
  padding:20px;border-radius:20px;background:var(--surface);border:1.5px solid var(--border);
  transition:transform .15s ease,border-color .15s ease;
}
:root[data-theme="dark"] .tm-mode{background:var(--surface2)}
.tm-mode:hover{transform:translateY(-2px);border-color:var(--accent)}
.tm-mode:active{transform:scale(.99)}
.tm-mode:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tm-mode-hero{grid-row:1 / span 2;background:var(--accent) !important;border-color:var(--accent);justify-content:flex-end;min-height:230px}
.tm-mode-hero .tm-mode-title,.tm-mode-hero .tm-mode-desc{color:var(--on-accent)}
.tm-mode-hero .tm-mode-icon{font-size:40px;margin-bottom:auto}
.tm-mode-icon{font-size:26px}
.tm-mode-title{font-family:var(--f-display);font-weight:600;font-size:19px;color:var(--text)}
.tm-mode-desc{font-size:13.5px;color:var(--text2);line-height:1.5}
.tm-mode-badge{position:absolute;top:16px;right:16px;font-size:11px;font-weight:800;padding:4px 10px;border-radius:999px;background:var(--on-accent);color:var(--accent)}

/* Busca de obra */
.tm-search{
  display:flex;align-items:center;gap:12px;padding:13px 16px;border-radius:14px;cursor:text;
  background:var(--bg);border:1px solid rgba(var(--ink-rgb),.14);
}
.tm-search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.16)}
.tm-search svg{width:18px;height:18px;fill:none;stroke:var(--text2);stroke-width:2;stroke-linecap:round;flex-shrink:0}
.tm-search input{flex:1;min-width:0;background:none;border:none;outline:none;color:var(--text);font-family:var(--f-corpo);font-size:15px}
.tm-sub{font-family:var(--f-mono);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--text3);margin:4px 0 10px}
.tm-picks{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:12px;margin-bottom:12px}
.tm-pick{all:unset;cursor:pointer;display:flex;flex-direction:column;gap:5px;min-width:0}
.tm-pick-poster{aspect-ratio:2/3;border-radius:12px;overflow:hidden;background:var(--bg3);border:2px solid transparent;transition:border-color .15s ease,transform .15s ease}
.tm-pick-poster img{width:100%;height:100%;object-fit:cover;display:block}
.tm-pick:hover .tm-pick-poster{border-color:var(--accent);transform:translateY(-2px)}
.tm-pick:focus-visible .tm-pick-poster{border-color:var(--accent)}
.tm-pick-title{font-size:12.5px;font-weight:600;color:var(--text);line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tm-pick-meta{font-size:11px;color:var(--text3)}

/* Personagens */
.tm-work-head{display:flex;align-items:center;gap:14px}
.tm-work-head-poster{width:52px;height:74px;border-radius:10px;overflow:hidden;flex-shrink:0;background:var(--bg3)}
.tm-work-head-poster img{width:100%;height:100%;object-fit:cover}
.tm-work-head-title{font-weight:700;font-size:16px;color:var(--text)}
.tm-work-head-meta{font-size:13px;color:var(--text2)}
.tm-chars-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.tm-chips{display:flex;gap:6px;flex-wrap:wrap}
.tm-chip{
  all:unset;cursor:pointer;padding:8px 14px;border-radius:999px;font-size:13px;font-weight:600;
  color:var(--text2);border:1px solid rgba(var(--ink-rgb),.16);transition:all .15s ease;
}
.tm-chip small{opacity:.7;font-weight:700;margin-left:2px}
.tm-chip:hover{border-color:var(--accent);color:var(--accent)}
.tm-chip:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tm-chip.active{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.tm-chip.ghost{border-color:transparent}
.tm-chip.ghost:hover{background:rgba(var(--accent-rgb),.08)}
.tm-chars{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:12px}
.tm-char{all:unset;cursor:pointer;display:flex;flex-direction:column;gap:4px;min-width:0;text-align:center}
.tm-char-img{
  position:relative;aspect-ratio:3/4;border-radius:14px;overflow:hidden;background:var(--bg3);
  border:2.5px solid transparent;transition:border-color .15s ease,opacity .15s ease,transform .15s ease;opacity:.5;filter:grayscale(.6);
}
.tm-char-img img{width:100%;height:100%;object-fit:cover;display:block}
.tm-char.on .tm-char-img{opacity:1;filter:none;border-color:var(--accent)}
.tm-char:hover .tm-char-img{transform:translateY(-2px)}
.tm-char:focus-visible .tm-char-img{outline:2px solid var(--accent);outline-offset:2px}
.tm-char-check{
  position:absolute;top:6px;right:6px;width:22px;height:22px;border-radius:50%;
  background:var(--accent);color:var(--on-accent);display:flex;align-items:center;justify-content:center;
  transform:scale(0);transition:transform .15s ease;
}
.tm-char.on .tm-char-check{transform:scale(1)}
.tm-char-check svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.tm-char-name{font-size:12px;font-weight:600;color:var(--text);line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tm-char-role{font-size:10.5px;font-weight:700;color:var(--accent)}

/* Configurações */
.tm-settings{display:flex;flex-direction:column;gap:16px;padding-top:18px;border-top:1px solid var(--border)}
.tm-field{display:flex;flex-direction:column;gap:8px}
.tm-field > span{font-size:12.5px;font-weight:700;color:var(--text2)}
.tm-field input[type="text"]{
  padding:12px 14px;border-radius:12px;font-family:var(--f-corpo);font-size:15px;outline:none;
  background:var(--bg);border:1px solid rgba(var(--ink-rgb),.14);color:var(--text);
}
.tm-field input[type="text"]:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.16)}
.tm-templates{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.tm-template{
  all:unset;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:14px;
  border:1.5px solid var(--border);background:var(--bg);transition:border-color .15s ease;
}
.tm-template:hover{border-color:rgba(var(--accent-rgb),.5)}
.tm-template:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tm-template.on{border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.16)}
.tm-template-name{font-size:13px;font-weight:700;color:var(--text)}
.tm-template-rows{display:flex;flex-direction:column;gap:3px}
.tm-template-rows i{font-style:normal;font-size:10.5px;font-weight:700;color:var(--tier-ink);padding:2px 6px;border-radius:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tm-label-inputs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.tm-label-input{display:flex;align-items:center;gap:6px}
.tm-label-input i{font-style:normal;width:30px;height:38px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-weight:800;color:var(--tier-ink);flex-shrink:0}
.tm-label-input input{flex:1;min-width:0;padding:9px 10px !important;font-size:14px !important}
.tm-toggle{display:flex;align-items:center;gap:10px;cursor:pointer;font-size:14px;color:var(--text2)}
.tm-toggle input{position:absolute;opacity:0;pointer-events:none}
.tm-toggle-ui{width:40px;height:24px;border-radius:999px;background:rgba(var(--ink-rgb),.18);position:relative;flex-shrink:0;transition:background .15s ease}
.tm-toggle-ui::after{content:'';position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:var(--surface-hi);transition:transform .15s ease}
.tm-toggle input:checked + .tm-toggle-ui{background:var(--accent)}
.tm-toggle input:checked + .tm-toggle-ui::after{transform:translateX(16px)}
.tm-toggle input:focus-visible + .tm-toggle-ui{outline:2px solid var(--accent);outline-offset:2px}

.tm-lib-preview{display:flex;flex-wrap:wrap;gap:6px;padding:12px;border-radius:16px;background:var(--bg);min-height:62px;align-items:center}
.tm-lib-preview .tm-thumb{width:36px;height:50px}
.tm-thumb-more{display:flex !important;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:var(--text2)}

.tm-loading{display:flex;justify-content:center;gap:6px;padding:16px}
.tm-loading.big{padding:40px}
.tm-loading span{width:8px;height:8px;border-radius:50%;background:var(--accent);animation:tmDot 1s ease-in-out infinite}
.tm-loading span:nth-child(2){animation-delay:.15s}
.tm-loading span:nth-child(3){animation-delay:.3s}
@keyframes tmDot{0%,100%{opacity:.25;transform:translateY(0)}50%{opacity:1;transform:translateY(-4px)}}

/* ---------- EDITOR (repaginado) ---------- */
#page-tierlist-editor .back-btn{
  display:inline-flex;align-items:center;gap:6px;padding:8px 14px 8px 10px;border-radius:999px;margin-bottom:14px;
  background:transparent;border:1px solid var(--border);color:var(--text2);font-weight:600;cursor:pointer;
}
#page-tierlist-editor .back-btn:hover{border-color:var(--accent);color:var(--accent)}
#page-tierlist-editor .back-btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2}
#tierlist-editor-content{max-width:1180px;margin:0 auto}
.tl-editor-header h2{font-family:var(--f-display) !important;font-size:clamp(24px,3vw,34px) !important;letter-spacing:-.02em;color:var(--text) !important}
.tl-editor-hint{font-style:normal !important;color:var(--text3) !important;margin-bottom:16px !important}
.tl-tier-row{
  background:var(--surface) !important;border:1px solid var(--border) !important;border-radius:18px !important;
  box-shadow:0 10px 22px -20px rgba(var(--shadow-rgb),.8) !important;margin-bottom:10px !important;min-height:104px !important;
}
.tl-tier-label{width:96px !important;min-width:96px !important;border-radius:17px 0 0 17px !important}
.tl-tier-label::before{display:none}
.tier-S .tl-tier-label{background:var(--tier-S) !important}
.tier-A .tl-tier-label{background:var(--tier-A) !important}
.tier-B .tl-tier-label{background:var(--tier-B) !important}
.tier-C .tl-tier-label{background:var(--tier-C) !important}
.tier-D .tl-tier-label{background:var(--tier-D) !important}
.tier-F .tl-tier-label{background:var(--tier-F) !important}
.tl-tier-label-text{color:var(--tier-ink) !important;text-shadow:none !important;font-size:17px !important}
.tl-unranked-section{
  background:var(--bg) !important;border:1.5px dashed rgba(var(--ink-rgb),.18) !important;border-radius:18px !important;
}
.tl-card{border-radius:12px !important;background:var(--surface-hi) !important;border:1px solid var(--border) !important}
:root[data-theme="dark"] .tl-card{background:var(--surface2) !important}
.tl-card.selected{border-color:var(--accent) !important;box-shadow:0 0 0 3px rgba(var(--accent-rgb),.25) !important}
.tl-card-title{color:var(--text) !important}
.tl-card-sub{font-size:9.5px;color:var(--text3);line-height:1.2;padding:0 4px 4px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tl-card-character img{object-position:center 20%}
.tier-chip-S{background:var(--tier-S) !important}.tier-chip-A{background:var(--tier-A) !important}.tier-chip-B{background:var(--tier-B) !important}
.tier-chip-C{background:var(--tier-C) !important}.tier-chip-D{background:var(--tier-D) !important}.tier-chip-F{background:var(--tier-F) !important}

/* ---------- RESPONSIVO ---------- */
@media (max-width:900px){
  .tm-hero{grid-template-columns:1fr}
  .tm-templates{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:768px){
  .tm{gap:18px}
  .tm-hero{padding:18px;border-radius:22px;gap:18px}
  .tm-hero-actions .btn-primary,.tm-hero-actions .btn-secondary{flex:1;text-align:center}
  .tm-hero-thumbs img,.tm-hero-ph{width:38px;height:54px}
  .tm-tabs{align-self:stretch}
  .tm-tab{flex:1;text-align:center;padding:9px 6px;font-size:12.5px}
  .tm-tab-count{display:none}
  .tm-hero-preview{padding:10px;gap:6px}
  .tm-hero-row:nth-child(n+3){display:none}
  .tm-hero-label{width:38px;font-size:17px}
  .tm-sheet-titles h3{white-space:normal;font-size:19px;line-height:1.2}
  .tm-grid{grid-template-columns:1fr}
  .tm-ideas{grid-template-columns:1fr 1fr}
  .tm-sheet-overlay{padding:0;align-items:flex-end}
  .tm-sheet{width:100%;max-height:94vh;border-radius:24px 24px 0 0}
  .tm-sheet-body{padding:16px}
  .tm-modes{grid-template-columns:1fr}
  .tm-mode-hero{grid-row:auto;min-height:170px}
  .tm-chars{grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:10px}
  .tm-label-inputs{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tm-sheet-foot .btn-primary{flex:1}
}
@media (max-width:420px){
  .tm-ideas{grid-template-columns:1fr}
}
@media (max-width:768px){
  .tm-user-card{padding:16px;gap:14px}
  .tm-user-avatar{width:64px;height:64px;font-size:24px}
  .tm-user-id h2{font-size:22px}
  .tm-user-actions{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .tm-user-actions button{width:100%;margin:0 !important}
}

/* Procurar pessoas (aba Comunidade) */
.tm-people-search{max-width:560px;background:var(--surface-hi)}
:root[data-theme="dark"] .tm-people-search{background:var(--surface)}
.tm-people-search input::-webkit-search-cancel-button{display:none}
.tm-people-results{display:flex;flex-direction:column;gap:6px;max-width:560px}
.tm-people-results:empty{display:none}
.tm-person{
  all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:14px;
  background:var(--surface);border:1px solid var(--border);transition:border-color .15s ease,transform .15s ease;
}
.tm-person:hover{border-color:rgba(var(--accent-rgb),.5);transform:translateY(-1px)}
.tm-person:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tm-person-avatar{width:40px !important;height:40px !important;font-size:15px !important;flex-shrink:0}
.tm-person-id{flex:1;min-width:0;display:flex;flex-direction:column}
.tm-person-id b{font-size:14px;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tm-person-id span{font-size:12.5px;color:var(--text2)}
.tm-person-go{font-size:12.5px;font-weight:700;color:var(--accent);white-space:nowrap}
@media (max-width:480px){.tm-person-go{display:none}}
