/* Faction HQ → Tools pop-up (owner 11/3: "Tools panel pop up on profile needs to be cleaner").
   Markup: hqToolsTabHtml() in app.js. Prefix .hqt- (free; .he- is Hold'em, .tc- cards, .fw- faction wars).
   Everything is scoped to #hq-tab-dialog .hqt because sidebar-nav.css paints every button/input in that
   dialog with !important. This file loads after it, so equal-specificity ties go our way. */
#hq-tab-dialog .hqt { --hqt-card: rgba(255,255,255,.035); --hqt-line: rgba(255,255,255,.09); --hqt-gold: #f1c40f; --hqt-cyan: #16d8ff; --hqt-red: #ff5468; --hqt-green: #19c97a;
  display: grid; gap: 12px; min-width: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: rgba(255,255,255,.9); }
#hq-tab-dialog .hqt-cols { display: grid; gap: 12px; min-width: 0; }
#hq-tab-dialog .hqt-col { display: grid; gap: 12px; align-content: start; min-width: 0; }
/* side by side in the 720px desktop dialog; the Faction Info card stretches to the right column's height
   and its description box takes up the slack, so neither column ends in a gap */
@media (min-width: 760px) {
  #hq-tab-dialog .hqt-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
  #hq-tab-dialog .hqt-col:first-child { align-content: stretch; }
  #hq-tab-dialog .hqt-col:first-child > .hqt-card { grid-template-rows: auto auto minmax(0, 1fr); }
  #hq-tab-dialog .hqt-col:first-child > .hqt-card > #faction-settings { grid-template-rows: auto minmax(76px, 1fr) auto auto; }
  #hq-tab-dialog .hqt-col:first-child #faction-settings textarea.hqt-input { height: 100%; max-height: 260px; }
}

/* cards */
#hq-tab-dialog .hqt-card { display: grid; gap: 14px; min-width: 0; margin: 0; padding: 16px; border-radius: 14px; background: var(--hqt-card); border: 1px solid var(--hqt-line); }
#hq-tab-dialog .hqt-head { display: flex; align-items: center; gap: 11px; min-width: 0; }
#hq-tab-dialog .hqt-head > div { flex: 1 1 auto; min-width: 0; }
#hq-tab-dialog .hqt h3 { margin: 0; font: 900 12.5px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 1.3px; text-transform: uppercase; color: var(--hqt-gold); text-shadow: none; }
#hq-tab-dialog .hqt-head p, #hq-tab-dialog .hqt-danger p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.4; color: rgba(255,255,255,.55); }
#hq-tab-dialog .hqt-ico { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid; }
#hq-tab-dialog .hqt-ico svg { width: 18px; height: 18px; }
#hq-tab-dialog .hqt-gold { color: var(--hqt-gold); background: rgba(241,196,15,.09); border-color: rgba(241,196,15,.28); }
#hq-tab-dialog .hqt-cyan { color: var(--hqt-cyan); background: rgba(22,216,255,.08); border-color: rgba(22,216,255,.28); }
#hq-tab-dialog .hqt-red { color: var(--hqt-red); background: rgba(255,84,104,.09); border-color: rgba(255,84,104,.32); }

/* the "How it works" guide chip, small, in the Members header */
#hq-tab-dialog .hqt button.hqt-guide { flex: 0 0 auto; align-self: flex-start; height: 28px; min-height: 0; padding: 0 10px !important; gap: 5px; border-radius: 99px !important; border: 1px solid rgba(255,255,255,.16) !important; background: rgba(255,255,255,.04) !important;
  color: rgba(255,255,255,.75) !important; font: 700 11.5px/1 system-ui, sans-serif; letter-spacing: .2px; text-transform: none; white-space: nowrap; }
#hq-tab-dialog .hqt button.hqt-guide:hover { border-color: rgba(22,216,255,.5) !important; background: rgba(22,216,255,.08) !important; color: #fff !important; }
#hq-tab-dialog .hqt-guide svg { width: 14px; height: 14px; pointer-events: none; }

/* forms, labels, fields */
#hq-tab-dialog .hqt form { display: grid; gap: 7px; min-width: 0; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
#hq-tab-dialog .hqt-label { display: block; margin: 4px 0 0; font: 800 11px/1.2 system-ui, sans-serif; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,.55); }
#hq-tab-dialog .hqt-form > .hqt-label:first-child { margin-top: 0; }
#hq-tab-dialog .hqt-inline { display: flex; align-items: center; gap: 8px; min-width: 0; }
#hq-tab-dialog .hqt-inline > .hqt-input { flex: 1 1 auto; min-width: 0; }
#hq-tab-dialog .hqt .hqt-input { box-sizing: border-box; width: 100%; height: 42px; min-height: 0; margin: 0; padding: 0 12px !important; border-radius: 10px !important; border: 1px solid rgba(255,255,255,.14) !important; background: #0b0b0e !important; color: #fff !important;
  font: 400 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif !important; letter-spacing: 0; text-transform: none; box-shadow: none; transition: border-color .15s, box-shadow .15s; }
#hq-tab-dialog .hqt textarea.hqt-input { height: auto; min-height: 76px; padding: 10px 12px !important; resize: vertical; }
#hq-tab-dialog .hqt select.hqt-input { padding-right: 34px !important; cursor: pointer; appearance: none; -webkit-appearance: none;
  background: #0b0b0e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f1c40f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center / 15px !important; }
#hq-tab-dialog .hqt .hqt-input::placeholder { color: rgba(255,255,255,.35); }
#hq-tab-dialog .hqt .hqt-input:focus { outline: none; border-color: var(--hqt-gold) !important; box-shadow: 0 0 0 3px rgba(241,196,15,.14); }
#hq-tab-dialog .hqt-help { display: block; font-size: 12px; line-height: 1.4; color: rgba(255,255,255,.45); }
#hq-tab-dialog .hqt-note { display: flex; align-items: center; gap: 8px; margin: 0; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; color: rgba(255,255,255,.6); background: rgba(255,255,255,.03); border: 1px dashed rgba(255,255,255,.12); }
#hq-tab-dialog .hqt-note svg { flex: 0 0 15px; width: 15px; height: 15px; color: rgba(255,255,255,.45); }
#hq-tab-dialog .hqt .faction-rename-status { font-size: 12.5px; }

/* buttons: all 42px; global button{padding:0 18px} reset on every one */
#hq-tab-dialog .hqt button.hqt-btn { flex: 0 0 auto; height: 42px; min-height: 0; margin: 0; padding: 0 16px !important; border-radius: 10px !important; font: 900 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif !important; letter-spacing: .6px; text-transform: uppercase; white-space: nowrap; cursor: pointer; box-shadow: none; transition: filter .15s, background .15s, border-color .15s; }
#hq-tab-dialog .hqt button.hqt-primary { border: 0 !important; background: linear-gradient(180deg, #ffd34d, #e0a915) !important; color: #141005 !important; }
#hq-tab-dialog .hqt button.hqt-primary:hover { filter: brightness(1.08); }
#hq-tab-dialog .hqt button.hqt-ghost { border: 1px solid rgba(241,196,15,.45) !important; background: rgba(241,196,15,.06) !important; color: #ffe08a !important; }
#hq-tab-dialog .hqt button.hqt-ghost:hover { border-color: var(--hqt-gold) !important; background: rgba(241,196,15,.14) !important; }
#hq-tab-dialog .hqt button.hqt-btn:disabled { opacity: .55; cursor: default; filter: none; }

/* recruitment: segmented Open / Closed (real radios, so FormData still sends recruitment_status) */
#hq-tab-dialog .hqt-seg { flex: 1 1 auto; display: grid; grid-template-columns: 1fr 1fr; min-width: 0; max-width: 240px; height: 42px; padding: 3px; border-radius: 10px; background: #0b0b0e; border: 1px solid rgba(255,255,255,.14); }
#hq-tab-dialog .hqt-seg label { position: relative; display: block; margin: 0; cursor: pointer; }
#hq-tab-dialog .hqt-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
#hq-tab-dialog .hqt-seg span { display: flex; align-items: center; justify-content: center; gap: 7px; height: 100%; border-radius: 7px; font: 800 13px/1 system-ui, sans-serif; color: rgba(255,255,255,.5); pointer-events: none; transition: background .15s, color .15s; }
#hq-tab-dialog .hqt-seg i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
#hq-tab-dialog .hqt-seg .hqt-open input:checked + span { background: rgba(25,201,122,.16); color: #6ff0a6; box-shadow: inset 0 0 0 1px rgba(25,201,122,.45); }
#hq-tab-dialog .hqt-seg .hqt-closed input:checked + span { background: rgba(255,84,104,.13); color: #ff9aa6; box-shadow: inset 0 0 0 1px rgba(255,84,104,.4); }
#hq-tab-dialog .hqt-seg input:checked + span i { opacity: 1; box-shadow: 0 0 8px currentColor; }
#hq-tab-dialog .hqt-seg input:focus-visible + span { outline: 2px solid var(--hqt-gold); outline-offset: 1px; }
#hq-tab-dialog #faction-settings .hqt-inline { justify-content: space-between; }

/* invite search */
#hq-tab-dialog #add-faction-member.hqt-invite { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 0; flex-direction: initial; }
#hq-tab-dialog .hqt-search { position: relative; min-width: 0; }
#hq-tab-dialog .hqt-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: rgba(255,255,255,.4); pointer-events: none; }
#hq-tab-dialog .hqt .hqt-search .hqt-input { padding-left: 36px !important; }
#hq-tab-dialog .hqt-invite .player-search-results { grid-column: 1 / -1; margin: 0; max-height: 200px; }
#hq-tab-dialog .hqt-invite .player-search-results:empty { display: none; }
#hq-tab-dialog .hqt-invite .player-search-result { min-height: 46px; padding: 0 12px !important; border-radius: 10px !important; border: 1px solid rgba(255,255,255,.12) !important; background: #0b0b0e !important; font: 600 14px/1.2 system-ui, sans-serif; }
#hq-tab-dialog .hqt-invite .player-search-result:hover:not(:disabled) { border-color: rgba(22,216,255,.5) !important; background: rgba(22,216,255,.07) !important; }
#hq-tab-dialog .hqt-invite .player-search-result, #hq-tab-dialog .hqt-invite .player-search-result * { font-family: system-ui, -apple-system, "Segoe UI", sans-serif !important; letter-spacing: 0 !important; text-transform: none !important; }
#hq-tab-dialog .hqt-invite .player-search-result strong { font-size: 14px; font-weight: 800; }
#hq-tab-dialog .hqt-invite .player-search-result span { font-size: 12.5px; color: var(--hqt-cyan); }
#hq-tab-dialog .hqt-invite .empty-state { margin: 0; padding: 8px 2px; font-size: 13px; color: rgba(255,255,255,.5); }

/* join requests */
#hq-tab-dialog .hqt-reqs { display: grid; min-width: 0; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.07); }
#hq-tab-dialog .hqt-sub { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font: 800 11px/1.2 system-ui, sans-serif; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,.55); }
#hq-tab-dialog .hqt-sub b { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 99px; font-size: 11px; letter-spacing: 0; color: #141005; background: var(--hqt-gold); }
#hq-tab-dialog .hqt-req { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.06); }
#hq-tab-dialog .hqt-sub + .hqt-req { border-top: 0; }
#hq-tab-dialog .hqt-av { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font: 900 14px/1 system-ui, sans-serif; color: #9ae9ff; background: rgba(22,216,255,.1); border: 1px solid rgba(22,216,255,.3); }
#hq-tab-dialog .hqt-req-txt { display: grid; gap: 2px; min-width: 0; }
#hq-tab-dialog .hqt-req-txt strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 800; color: #fff; }
#hq-tab-dialog .hqt .hqt-req-txt em { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-style: normal; font-size: 12.5px; line-height: 1.35; color: rgba(255,255,255,.6) !important; }
#hq-tab-dialog .hqt .hqt-req-txt em.none { font-style: italic; color: rgba(255,255,255,.35) !important; }
#hq-tab-dialog .hqt-req-act { display: flex; gap: 6px; }
#hq-tab-dialog .hqt button.hqt-icon { width: 36px; height: 36px; min-height: 0; margin: 0; padding: 0 !important; display: grid; place-items: center; border-radius: 50% !important; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
#hq-tab-dialog .hqt-icon svg { width: 17px; height: 17px; stroke-width: 2.6; pointer-events: none; }
#hq-tab-dialog .hqt button.hqt-yes { border: 1px solid rgba(25,201,122,.5) !important; background: rgba(25,201,122,.12) !important; color: #6ff0a6 !important; }
#hq-tab-dialog .hqt button.hqt-yes:hover { border-color: var(--hqt-green) !important; background: var(--hqt-green) !important; color: #04140c !important; }
#hq-tab-dialog .hqt button.hqt-no { border: 1px solid rgba(255,84,104,.45) !important; background: rgba(255,84,104,.08) !important; color: #ff8d9b !important; }
#hq-tab-dialog .hqt button.hqt-no:hover { border-color: var(--hqt-red) !important; background: var(--hqt-red) !important; color: #1a0306 !important; }
#hq-tab-dialog .hqt button.hqt-icon:disabled { opacity: .45; cursor: default; }
#hq-tab-dialog .hqt-empty { margin: 0; padding: 6px 0 0; font-size: 13px; color: rgba(255,255,255,.45); }

/* danger zone: its own red strip under everything */
#hq-tab-dialog .hqt-card.hqt-danger { grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 4px; border-color: rgba(255,84,104,.3); background: linear-gradient(90deg, rgba(255,84,104,.08), rgba(255,84,104,.02)); }
#hq-tab-dialog .hqt-danger h3 { color: #ff8d9b; }
#hq-tab-dialog .hqt button.hqt-kill { border: 1px solid rgba(255,84,104,.6) !important; background: rgba(255,84,104,.1) !important; color: #ff8d9b !important; }
#hq-tab-dialog .hqt button.hqt-kill:hover { border-color: var(--hqt-red) !important; background: var(--hqt-red) !important; color: #1a0306 !important; }

@media (max-width: 600px) {
  #hq-tab-dialog .hqt-card { padding: 14px; gap: 12px; }
  #hq-tab-dialog .hqt .hqt-input { font-size: 16px !important; } /* iOS doesn't zoom on 16px fields */
  #hq-tab-dialog .hqt-head p { font-size: 12px; }
  #hq-tab-dialog .hqt-card.hqt-danger { grid-template-columns: 34px minmax(0, 1fr); }
  #hq-tab-dialog .hqt-danger .hqt-kill { grid-column: 1 / -1; width: 100%; }
  /* "Pick a member…" + MAKE LEADER don't share 314px at 16px text: stack them */
  #hq-tab-dialog #faction-transfer .hqt-inline { flex-wrap: wrap; }
  #hq-tab-dialog #faction-transfer .hqt-inline > * { flex: 1 1 100%; }
}
