/* Lenci · Nawaa tools — the Hashtag studio (v3/nawaa-tools-ui/hashtags.js): the three tabs, the platform's rules card, the ready mix, the
   selection bar, the audit's score ring and rules, the tag-by-tag rows, relevance verdicts, groups and the A / B / C rotation. Builds on
   nawaa-tools.css (tokens from studio.css + nawaa.css); logical properties only, so Arabic mirrors itself. */
.nt-hg { display: grid; gap: 14px; min-width: 0; }
.nt-hg [hidden] { display: none !important; }
.nt-hg-pane { display: grid; gap: 14px; min-width: 0; }

/* tabs */
.nt-hg-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; border: 1px solid var(--line); background: rgba(10,10,16,.55); width: fit-content; max-width: 100%; box-sizing: border-box; }
.nt-hg-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: 600 13px/1.2 var(--display); cursor: pointer; white-space: nowrap; transition: background .2s var(--ease), color .2s, box-shadow .2s; }
[dir="rtl"] .nt-hg-tab { font-family: var(--arabic); }
.nt-hg-tab svg { width: 16px; height: 16px; flex: none; }
.nt-hg-tab small { font: 500 10px/1 var(--mono); padding: 3px 7px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--dim); }
.nt-hg-tab:hover { color: var(--ink); background: rgba(255,255,255,.04); }
.nt-hg-tab[aria-selected="true"] { color: #fff; background: linear-gradient(180deg, rgba(34,211,238,.22), rgba(99,102,241,.16)); box-shadow: inset 0 0 0 1px rgba(34,211,238,.45), 0 0 14px rgba(34,211,238,.12); }
.nt-hg-tab[aria-selected="true"] small { background: rgba(0,0,0,.28); color: #e0faff; }
.nt-hg-tab:focus-visible, .nt-hg-link:focus-visible, .nt-hg-src a:focus-visible { outline: 2px solid #22d3ee; outline-offset: 2px; }

/* the form */
.nt-hg-posthas { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); padding: 8px 12px; border-radius: 11px; background: rgba(34,211,238,.06); border: 1px dashed rgba(34,211,238,.28); }
.nt-hg-opts > .nt-field { flex: 1 1 220px; }
.nt-hg-goal .nw-chip { padding: 7px 12px; }
.nt-hg-out { padding-top: 4px; }
.nt-hg-empty { margin: 0; }
/* the studio draws its results inside the form: one dashed line (the History's) is enough */
.nt-form:has(> .nt-hg) { border-bottom: 0; padding-bottom: 4px; }

/* the platform's rules */
.nt-hg-guide { border-inline-start: 3px solid var(--pc, #8b5cf6); background: linear-gradient(90deg, rgba(255,255,255,.045), rgba(255,255,255,.015) 70%); }
.nt-hg-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.nt-hg-fact { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; line-height: 1.35; color: var(--ink); background: rgba(255,255,255,.05); border: 1px solid var(--line-2); }
.nt-hg-fact.rec { border-color: rgba(52,211,153,.45); color: #a7f3d0; background: rgba(52,211,153,.08); }
.nt-hg-fact.lim { border-color: rgba(244,114,182,.5); color: #fbcfe8; background: rgba(244,114,182,.08); }
.nt-hg-fact.safe { border-color: rgba(245,176,65,.45); color: #fde68a; background: rgba(245,176,65,.08); }
.nt-hg-notes { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.nt-hg-src { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--dim); }
.nt-hg-src a { color: #a5b4fc; text-decoration: none; overflow-wrap: anywhere; }
.nt-hg-src a:hover { text-decoration: underline; }

/* the ready mix + more local tags */
.nt-hg-mix { border-color: rgba(34,211,238,.38); background: linear-gradient(135deg, rgba(34,211,238,.08), rgba(139,92,246,.06)); }
.nt-hg-badge { font: 600 11px/1 var(--mono); padding: 3px 8px; border-radius: 999px; background: rgba(34,211,238,.16); color: #a5f3fc; }
.nt-hg-more { display: grid; gap: 8px; }
.nt-tag.static { cursor: default; }
.nt-hg .nt-tag { max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; }
.nt-hg .nt-tag bdi { min-width: 0; }
.nt-tag.static:hover { border-color: var(--line-2); }
/* a tag reported as restricted on Instagram: offered, never pre-selected, marked with "!" (its title and label say why) */
.nt-hg .nt-tag.flag { border-style: dashed; border-color: rgba(245,176,65,.5); }
.nt-hg-flag { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; font: 800 10px/1 var(--display); color: #1a1205; background: #f5b041; flex: none; }

/* the selection bar */
.nt-hg-bar { gap: 8px 10px; }
.nt-hg-countbox { display: inline-flex; flex-direction: column; gap: 2px; margin-inline-end: auto; min-width: 0; }
.nt-hg-countbox .nt-count { margin: 0; color: var(--ink); font-weight: 600; }
.nt-hg-limit { font-size: 11.5px; color: var(--dim); }
.nt-hg-limit.ok { color: #6ee7b7; } .nt-hg-limit.near { color: #fcd34d; } .nt-hg-limit.over { color: #fca5a5; } .nt-hg-limit.low { color: #93c5fd; }
.nt-hg-fmt .nw-chip { padding: 5px 10px; font-size: 11px; }
.nt-hg-saverow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nt-hg-saverow .nt-input { flex: 1 1 220px; width: auto; min-width: 0; padding: 8px 11px; font-size: 13px; }
.nt-hg-look summary { cursor: pointer; color: #a5f3fc; font-size: 12.5px; }
.nt-hg-look > .nt-hint { margin: 6px 0 0; }
.nt-hg-looklist { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.nt-hg-looklist li { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.02); border: 1px solid var(--line); }
.nt-hg-looklist li.nt-hint { border: 0; background: none; padding: 0; }
.nt-hg-links { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.nt-hg-link { font-size: 11px; line-height: 1.4; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); text-decoration: none; white-space: nowrap; }
.nt-hg-link:hover { color: #fff; border-color: rgba(34,211,238,.6); }
.nt-hg-tagname { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; unicode-bidi: plaintext; }

/* the audit: score + rules */
.nt-hg-scorebox { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.025); animation: panelIn .35s var(--ease) both; }
.nt-hg-ring { --p: 0; --c: #34d399; position: relative; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255,255,255,.07) 0); box-shadow: 0 0 24px rgba(0,0,0,.25); }
.nt-hg-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--panel-2); }
.nt-hg-ring > div { position: relative; display: grid; justify-items: center; gap: 3px; }
.nt-hg-ring strong { font: 700 30px/1 var(--display); color: var(--ink); }
.nt-hg-ring small { font-size: 11.5px; font-weight: 700; color: var(--c); }
.nt-hg-ring.good { --c: #22d3ee; } .nt-hg-ring.fair { --c: #f5b041; } .nt-hg-ring.weak { --c: #f87171; }
.nt-hg-scoreside { display: grid; gap: 8px; min-width: 0; }
.nt-hg-scoreside > .nt-hint { margin-top: -4px; }
.nt-hg-h { font-family: var(--display); font-size: 14px; }
.nt-hg-rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.nt-hg-rules li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; min-width: 0; }
.nt-hg-rules li > div { display: grid; gap: 1px; min-width: 0; }
.nt-hg-rules strong { font-size: 12.5px; }
.nt-hg-rules small { font-size: 11.5px; color: var(--dim); }
.nt-hg-pts { font: 600 12px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.nt-hg-rules li.full .nt-hg-pts { color: #6ee7b7; } .nt-hg-rules li.zero .nt-hg-pts { color: #fca5a5; }
.nt-hg-rbar { grid-column: 1 / -1; display: block; height: 4px; border-radius: 4px; background: rgba(255,255,255,.06); overflow: hidden; }
.nt-hg-rbar b { display: block; height: 100%; background: #34d399; border-radius: inherit; }
.nt-hg-rules li.part .nt-hg-rbar b { background: #f5b041; }
.nt-hg-platline { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.nt-hg-platline .nt-hg-limit { font-size: 12.5px; font-weight: 600; }
.nt-hg-chars { flex: 1 1 220px; display: grid; gap: 4px; min-width: 0; }
.nt-hg-chars small { color: var(--dim); font-size: 11.5px; }
.nt-hg-clean { border-color: rgba(52,211,153,.32); }

/* tag by tag */
.nt-hg-tagrows { display: grid; gap: 6px; }
.nt-hg-tagrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 10px; align-items: start; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.nt-hg-tagrow.error { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.05); }
.nt-hg-tagrow.warn { border-color: rgba(245,176,65,.3); background: rgba(245,176,65,.04); }
.nt-hg-sev { font-size: 10.5px; font-weight: 700; line-height: 1.5; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: rgba(52,211,153,.14); color: #6ee7b7; }
.nt-hg-sev.info { background: rgba(147,197,253,.14); color: #bfdbfe; } .nt-hg-sev.warn { background: rgba(245,176,65,.16); color: #fde68a; } .nt-hg-sev.error { background: rgba(239,68,68,.18); color: #fecaca; }
.nt-hg-tagmid { display: grid; gap: 3px; min-width: 0; }
.nt-hg-tagline { display: flex; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; min-width: 0; }
.nt-hg-was { color: var(--dim); font-size: 11px; unicode-bidi: plaintext; overflow-wrap: anywhere; }
.nt-hg-issues { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.nt-hg-issues li::before { content: "•"; margin-inline-end: 6px; }
.nt-hg-issues li.error { color: #fecaca; } .nt-hg-issues li.warn { color: #fde68a; }

/* relevance */
.nt-hg-rel { border-color: rgba(167,139,250,.3); }
.nt-hg-relbtn, .nt-hg-rotbtn { justify-self: start; display: inline-flex; align-items: center; gap: 8px; }
.nt-hg-relbtn.loading span::after, .nt-hg-rotbtn.loading span::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-inline-start: 8px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: ntSpin .8s linear infinite; vertical-align: -1px; }
.nt-hg-relout { display: grid; gap: 8px; }
.nt-hg-verdict { --vc: #a5b4fc; display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); border-inline-start: 3px solid var(--vc); background: rgba(10,10,16,.4); }
.nt-hg-verdict.relevant { --vc: #34d399; } .nt-hg-verdict.weak { --vc: #f5b041; } .nt-hg-verdict.irrelevant { --vc: #f87171; }
.nt-hg-pill { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: var(--vc); border: 1px solid currentColor; }
.nt-hg-reps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nt-hg-reps small { color: var(--dim); font-size: 11.5px; }
.nt-hg-rep { border-style: dashed; }

/* groups + rotation */
.nt-hg-sec { display: grid; gap: 10px; }
.nt-hg-sechead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; min-width: 0; }
.nt-hg-sechead > .nt-meta { margin: 0; }
#nt-hg-groups-h:focus { outline: none; } #nt-hg-groups-h:focus-visible { outline: 2px solid #22d3ee; outline-offset: 3px; border-radius: 4px; }
.nt-hg-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.nt-hg-groups > .nt-empty, .nt-hg-groups > .nt-hint, .nt-hg-groups > .nt-note { grid-column: 1 / -1; }
.nt-hg-group { border-top: 3px solid var(--pc, #8b5cf6); align-content: start; }
.nt-hg-group.focus { box-shadow: 0 0 0 2px rgba(34,211,238,.6), 0 10px 30px rgba(34,211,238,.12); }
.nt-hg-gname { overflow-wrap: anywhere; }
.nt-hg-group .nt-tags { max-height: 132px; overflow: auto; }
.nt-hg-new { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.nt-hg-new > * + * { margin-top: 10px; }
.nt-hg-new summary { cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 13px; }
.nt-hg-new .primary { display: inline-flex; }
.nt-hg-rot { border-color: rgba(139,92,246,.32); }
.nt-hg-rotout { display: grid; gap: 10px; }
.nt-hg-rotout:empty { display: none; }
.nt-hg-rotsets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nt-hg-rotset { display: grid; gap: 8px; align-content: start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(10,10,16,.45); min-width: 0; }
.nt-hg-setname { font: 700 13px var(--display); color: #c4b5fd; }
.nt-hg-rotout > .ghost { justify-self: start; }

/* the shell's History list is a grid whose implicit column grows to a long title (rows cut at 390 px): sized here for this tool; the
   same one-line fix belongs in nawaa-tools.css (.nt-history-list { grid-template-columns: minmax(0, 1fr) }) */
#tools[data-tool="hashtags"] .nt-history-list { grid-template-columns: minmax(0, 1fr); }

/* Arabic never goes through the mono face */
[dir="rtl"] .nt-hg-tab small, [dir="rtl"] .nt-hg-pts, [dir="rtl"] .nt-hg-badge { font-family: var(--arabic); letter-spacing: 0; }

@media (max-width: 1100px) {
  .nt-hg-rotsets, .nt-hg-rules { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .nt-hg-tabs { width: 100%; }
  .nt-hg-tab { flex: 1 1 0; justify-content: center; padding: 8px 6px; gap: 6px; }
  .nt-hg-tab small { display: none; }
  .nt-hg-scorebox { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 14px; }
  .nt-hg-scoreside { justify-self: stretch; }
  .nt-hg-tagrow { grid-template-columns: auto minmax(0, 1fr); }
  .nt-hg-tagrow > .nt-hg-links { grid-column: 2; }
  .nt-hg-countbox { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .nt-hg-scorebox { animation: none !important; } .nt-hg-relbtn.loading span::after, .nt-hg-rotbtn.loading span::after { animation: none !important; } }
