/* Shared chrome: <select>, avatar chip, inline editor, THE page-tab strip, decap mark. */
/* Canonical dropdown style — every <select> inherits this. Per-class rules override SIZING only, never bg/border/color. */
select,
.preset-select,
.ai-mode-select {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--bg-hover);
  border-radius: var(--border-radius);
  padding: 6px 10px;
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
select:hover,
.preset-select:hover,
.ai-mode-select:hover {
  border-color: var(--accent-gold);
}
select:focus,
.preset-select:focus,
.ai-mode-select:focus {
  outline: none;
  border-color: var(--accent-gold);
}
select option,
.preset-select option {
  background: var(--bg-panel);
  color: var(--text-primary);
}

/* Avatar monogram chip. Geometry lives HERE, not per host: every host re-declared the same
   circle + centring and .bkt-av forgot it, rendering a square with an off-centre letter. A host
   now sets only its size and font-size. */
.avatar-chip {
  border-radius: 50%;
  display: inline-grid; place-items: center;
  flex: none;
  overflow: hidden;
  font-family: var(--font-display); font-weight: 600;
  line-height: 1;
}
/* The .avatar-<color> class must out-rank each host's own background (incl. the admin gradient); the admin glow still applies on top. */
.avatar-chip.avatar-bronze   { background: var(--bronze-gradient); color: var(--on-bronze, #1a140a); }
.avatar-chip.avatar-lapis    { background: linear-gradient(180deg, var(--lapis-2), var(--lapis)); color: #fff; }
.avatar-chip.avatar-laurel   { background: linear-gradient(180deg, var(--laurel-2), var(--laurel)); color: #fff; }
.avatar-chip.avatar-porphyry { background: linear-gradient(180deg, var(--porphyry-2), var(--porphyry)); color: #fff; }
.avatar-chip.avatar-amethyst { background: linear-gradient(180deg, var(--amethyst-2), var(--amethyst)); color: #fff; }
.avatar-chip.has-img {
  background-size: cover;
  background-position: center;
  color: transparent;
}
/* Staff marker on GENERIC chips (avatarChipHtml appends is-admin from the wire role): the
   amethyst ring survives a custom colour or an uploaded image, so an admin reads as one
   everywhere. The three shell hosts are excluded — they carry their own glow in
   app-shell.css, and this rule (0,3,0: :not() counts its most specific argument) would
   otherwise beat that glow's (0,1,0) :where() base. */
.avatar-chip.is-admin:not(.app-user-avatar, .profile-avatar-large, .hq-avatar) {
  box-shadow: 0 0 0 1.5px var(--amethyst-2);
}

/* THE inline text editor (views/ui/inline-editor.js: clan charter, clan motto, HQ motto).
   is-single is the compact motto variant — mottos are short by design. */
.inline-ed { display: flex; flex-direction: column; gap: 8px; }
.inline-ed-ta {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px;
  background: var(--bg-0); border: 1px solid var(--border); border-radius: var(--radius-m);
  color: var(--ink); font: inherit; font-size: 0.9rem; line-height: 1.5;
  resize: vertical;
}
.inline-ed-ta.is-single {
  max-width: 420px; padding: 6px 8px; resize: none;
  background: var(--bg-2); border-radius: var(--radius-s);
}
.inline-ed-ta:focus-visible { outline: 2px solid var(--bronze); outline-offset: 1px; }
.inline-ed-acts { display: flex; gap: 8px; justify-content: flex-end; }
.inline-ed-acts.is-single { justify-content: flex-start; margin-bottom: 10px; max-width: 420px; }

.tr-lb-link {
  background: none; border: none; padding: 0;
  color: var(--ink); font: inherit; cursor: pointer;
}
.tr-lb-link:hover { color: var(--bronze-2); text-decoration: underline; }

/* The base display for every Tabs.html strip — .news-tabs is not in the list below and has no other. */
.page-tabs { display: flex; }

/* THE one page-tab style — every tabbed screen reuses a class from this list. Deliberately EXCLUDES .bf-seg (the segmented filter control) — folding it in would restyle half the app. */
.am-cats,
.profile-tabs,
.tr-tabs,
.cl-tabs,
.cl-subtabs,
.legal-tabs,
.tu-tabs,
.ag-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 18px 0;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 1px solid var(--divider);
  border-radius: 0;
  box-shadow: none;
}
.am-cat,
.profile-tab,
.tr-tab,
.cl-tab,
.cl-subtab,
.legal-tab,
.tu-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--bg-1);
  color: var(--ink-2);
  font-family: var(--font-sans); font-size: 0.92rem; font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.am-cat:hover,
.profile-tab:hover,
.tr-tab:hover,
.cl-tab:hover,
.cl-subtab:hover,
.legal-tab:hover,
.tu-tab:hover {
  border-color: var(--bronze); background: var(--bg-2); color: var(--ink);
}
/* Multiple "active" spellings kept to avoid churning call sites. Fill text is #fff (6.28:1 on --bronze-deep): --gold is 3.64:1, under AA, and --ink flips dark in the light theme while this fill stays dark in both. */
.am-cat.on,
.profile-tab-active,
.tr-tab.active,
.cl-tab.is-active,
.cl-subtab.is-active,
.legal-tab.is-active,
.tu-tab.is-active,
.am-tab.on,
/* The notif popup joins the SELECTED treatment only; its strip and sizing are its own
   (app-shell.css) because these page-tab rules carry page margins and a bottom rule. */
.app-notif-tab.is-active {
  background: var(--bronze-deep); border-color: var(--bronze); color: #fff;
}
.am-cat:focus-visible,
.profile-tab:focus-visible,
.tr-tab:focus-visible,
.cl-tab:focus-visible,
.cl-subtab:focus-visible,
.legal-tab:focus-visible,
.news-screen .news-tab:focus-visible,
.tu-tab:focus-visible {
  outline: 2px solid var(--bronze-2); outline-offset: 2px;
}
.cl-tab-count,
.ag-tab-count {
  font-size: 0.68rem; padding: 1px 7px; border-radius: 100px;
  background: var(--bg-3); color: var(--ink-2);
}
.cl-tab.is-active .cl-tab-count {
  background: color-mix(in srgb, var(--gold) 22%, transparent); color: var(--gold);
}
@media (prefers-reduced-motion: reduce) {
  .am-cat, .profile-tab, .tr-tab, .cl-tab, .cl-subtab, .legal-tab { transition: none; }
}

/* The dropdown half of every Tabs.html strip. Only the display swap is breakpoint-bound — the
   control's look is stated unconditionally, so a screen that swaps the two at its own breakpoint
   (armory's era filter, at the carousel's 1024) does not have to restate it. */
.page-tabs-dropdown {
  display: none; align-items: center; gap: 10px;
  margin: 18px 0;
}
.page-tab-select {
  flex: 1 1 auto; min-width: 0;
  appearance: none; -webkit-appearance: none;
  padding: 11px 34px 11px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-m);
  background-color: var(--bg-2);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--ink);
  font: inherit; font-size: 0.95rem;
  cursor: pointer;
}
.page-tab-select:focus-visible { outline: 2px solid var(--bronze-2); outline-offset: 2px; }

@media (max-width: 768px) {
  .page-tabs { display: none; }
  /* .bf-seg sets `display: flex` from a LATER sheet at the same (0,1,0), so a strip carrying both
     class names ignores the hide above and ships alongside its own dropdown. (0,2,0) settles it
     by specificity rather than by link order. */
  .page-tabs.bf-seg { display: none; }
  .page-tabs-dropdown { display: flex; }
}

/* Instant-victory mark (decapMarkHtml) — a struck-through porphyry crown, sized in em to follow the type scale it lands in. */
.decap-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.3em; height: 1.3em;
  vertical-align: -0.25em;
  color: var(--porphyry-2);
  cursor: help;
}
.decap-mark svg { width: 100%; height: 100%; }
/* Classic rule is the DEFAULT: an intact muted crown, so the struck porphyry one reads as the exception. */
.decap-mark.is-continue { color: var(--ink-3); }

