* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0b1014;
  color: #eef4ff;
}

body {
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(47, 139, 158, 0.12), transparent 34%),
    linear-gradient(160deg, #0b1014 0%, #111a20 48%, #0f1216 100%);
}

[hidden] {
  display: none !important;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  background: rgba(10, 14, 18, 0.96);
  border-bottom: 1px solid rgba(63, 175, 194, 0.34);
  backdrop-filter: blur(10px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1600px, calc(100% - 48px));
  min-height: 64px;
  margin: 0 auto;
  padding: 10px 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.nav-title {
  color: #fff;
  font-size: 1.18rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.nav-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid rgba(119, 201, 215, 0.26);
  border-radius: 8px;
  background: #226c7c;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 750;
  padding: 7px 14px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.nav-button.secondary {
  background: rgba(17, 42, 47, 0.92);
  color: #d8edf4;
}

.nav-button:hover,
.text-button:hover {
  background: #2f8b9e;
}

.nav-button.disabled,
.nav-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.nav-button.disabled:hover,
.nav-button:disabled:hover {
  background: #226c7c;
}

.text-button {
  min-height: 32px;
  background: transparent;
  color: #a9dce8;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(520px, 100%);
  min-width: 220px;
}

.global-search input,
.login-panel input {
  width: 100%;
  min-height: 38px;
  color: #eef4ff;
  background: rgba(8, 18, 22, 0.88);
  border: 1px solid rgba(119, 201, 215, 0.26);
  border-radius: 8px;
  outline: 0;
  padding: 8px 12px;
}

.global-search input:focus,
.login-panel input:focus {
  border-color: rgba(122, 219, 236, 0.72);
  box-shadow: 0 0 0 3px rgba(47, 139, 158, 0.18);
}

.dashboard {
  width: min(1600px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 34px;
}

.dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.server-title {
  display: grid;
  gap: 8px;
  width: 100%;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  flex: 0 0 48px;
  color: #081216;
  background: #77c9d7;
  border-radius: 8px;
  font-weight: 900;
}

.eyebrow {
  color: #8ccfdd;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  color: #fff;
  font-size: 1.1rem;
  letter-spacing: 0;
}

.lead {
  max-width: 780px;
  color: #a9b6c2;
  font-size: 1rem;
  line-height: 1.55;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.clan-list-section,
.search-results {
  margin-top: 22px;
}

.clan-list-section {
  position: relative;
}

.clan-list-heading {
  align-items: center;
}

.clan-list-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sort-button {
  position: relative;
  display: inline-grid;
  min-width: 52px;
  min-height: 36px;
  place-items: center;
  border: 1px solid rgba(119, 201, 215, 0.26);
  border-radius: 4px;
  background: rgba(17, 42, 47, 0.92);
  color: #d8edf4;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.sort-button:hover,
.sort-button.is-active {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(64, 64, 64, 0.56);
  color: #e5e5e5;
}

.sort-button .members-icon {
  width: 18px;
  height: 18px;
}

.sort-button.is-active::after {
  content: attr(data-direction-label);
  position: absolute;
  right: 3px;
  bottom: 1px;
  color: #f59e0b;
  font-size: 0.68rem;
  line-height: 1;
}

.filter-toggle {
  gap: 7px;
}

.filter-badge {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: #f59e0b;
  color: #000;
  font-size: 0.72rem;
  font-weight: 900;
}

.filter-popover {
  position: relative;
  z-index: 12;
}

.clan-filter-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  position: absolute;
  top: 0;
  right: 0;
  width: min(760px, 100%);
  margin-bottom: 0;
  padding: 12px;
  background: rgba(12, 19, 24, 0.72);
  border: 1px solid rgba(119, 201, 215, 0.16);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.clan-filter-panel label {
  display: grid;
  gap: 6px;
  color: #d8edf4;
  font-size: 0.84rem;
  font-weight: 750;
}

.clan-filter-panel input,
.clan-filter-panel select {
  width: 100%;
  min-height: 36px;
  color: #eef4ff;
  background: rgba(8, 18, 22, 0.88);
  border: 1px solid rgba(119, 201, 215, 0.26);
  border-radius: 8px;
  outline: 0;
  padding: 7px 10px;
}

.clan-filter-panel .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.clan-filter-panel .checkbox-label input {
  width: 18px;
  min-height: 18px;
}

.clan-grid,
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.clan-card,
.result-card,
.empty-state,
.login-panel {
  background: rgba(12, 19, 24, 0.86);
  border: 1px solid rgba(119, 201, 215, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.clan-card,
.result-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  min-height: 166px;
  color: inherit;
  text-decoration: none;
}

.clan-card-link:hover,
.result-card:hover {
  border-color: rgba(119, 201, 215, 0.44);
  background: rgba(16, 29, 36, 0.92);
  transform: translateY(-1px);
}

.clan-card__top {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.clan-logo,
.clan-logo-fallback {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  color: #081216;
  background: #77c9d7;
  border-radius: 8px;
  font-weight: 900;
}

.clan-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clan-title {
  display: grid;
  grid-template-rows: 18px minmax(24px, auto);
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.clan-title strong,
.result-card strong {
  color: #fff;
  overflow-wrap: anywhere;
}

.tag {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  color: #081216;
  background: #77c9d7;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 850;
}

.clan-card .tag {
  min-height: auto;
  padding: 0;
  color: #8ccfdd;
  background: transparent;
  border-radius: 0;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.description,
.muted,
.result-meta {
  color: #a9b6c2;
  line-height: 1.45;
}

.description {
  display: -webkit-box;
  min-height: 44px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: #8ccfdd;
  font-size: 0.86rem;
}

.member-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #a3a3a3;
  font-size: inherit;
  font-weight: inherit;
}

.members-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: 0 0 16px;
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 22px;
}

.profile-hero {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.profile-hero .clan-logo,
.profile-hero .clan-logo-fallback,
.player-avatar {
  width: 112px;
  height: 112px;
  border-radius: 8px;
  font-size: 1.4rem;
}

.profile-hero__body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.profile-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.clan-profile-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.clan-tags-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  color: #cbd5df;
  font-size: 0.92rem;
}

.clan-tag-main {
  color: #fff;
  font-weight: 900;
}

.clan-tag-secondary {
  color: #d8edf4;
  font-weight: 750;
}

.clan-tag-reserved {
  color: #7f909c;
  font-size: 0.86rem;
}

.clan-profile-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.clan-profile-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  color: #c8d6df;
  background: rgba(119, 201, 215, 0.11);
  border: 1px solid rgba(119, 201, 215, 0.16);
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 750;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  color: #d8edf4;
  background: rgba(17, 42, 47, 0.92);
  border: 1px solid rgba(119, 201, 215, 0.26);
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 800;
}

.goal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.goal-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  color: #d8edf4;
  background: rgba(119, 201, 215, 0.12);
  border: 1px solid rgba(119, 201, 215, 0.24);
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 750;
}

.back-link {
  width: fit-content;
  color: #8ccfdd;
  text-decoration: none;
  font-weight: 750;
}

.back-link:hover {
  color: #fff;
}

.player-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 112px;
  overflow: hidden;
  color: #081216;
  background: #77c9d7;
  font-weight: 900;
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-profile-hero {
  display: grid;
  gap: 18px;
  width: 100%;
}

.player-profile-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.player-profile-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.player-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.player-identity__body {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.player-identity__body h2 {
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  line-height: 1.03;
  overflow-wrap: anywhere;
}

.player-name-clan-tag {
  color: inherit;
  font: inherit;
  text-decoration: none;
}

.player-name-clan-tag:hover {
  color: #8ccfdd;
}

.player-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #a9b6c2;
  font-size: 0.98rem;
  font-weight: 750;
}

.player-steam-link {
  width: fit-content;
  color: #8ccfdd;
  text-decoration: none;
}

.player-steam-link:hover {
  color: #fff;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 14px;
  margin-bottom: 14px;
}

.profile-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: rgba(12, 19, 24, 0.86);
  border: 1px solid rgba(119, 201, 215, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.profile-text {
  color: #cbd5df;
  line-height: 1.58;
  white-space: pre-wrap;
}

.facts {
  display: grid;
  gap: 10px;
}

.facts div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(119, 201, 215, 0.12);
}

.facts dt {
  color: #8ccfdd;
  font-weight: 800;
}

.facts dd {
  color: #fff;
  text-align: right;
}

.facts.compact {
  gap: 6px;
}

.facts.compact div {
  padding-bottom: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.stats-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.profile-form {
  display: grid;
  gap: 14px;
}

.profile-form label,
.permission-group-form label {
  display: grid;
  gap: 7px;
  color: #d8edf4;
  font-size: 0.9rem;
  font-weight: 750;
}

.profile-form textarea,
.profile-form input,
.profile-form select,
.permission-group-form input,
.permission-group-form select {
  width: 100%;
  min-height: 38px;
  color: #eef4ff;
  background: rgba(8, 18, 22, 0.88);
  border: 1px solid rgba(119, 201, 215, 0.26);
  border-radius: 8px;
  outline: 0;
  padding: 8px 12px;
}

.profile-form textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.45;
}

.profile-form textarea:focus,
.profile-form input:focus,
.profile-form select:focus,
.permission-group-form input:focus,
.permission-group-form select:focus {
  border-color: rgba(122, 219, 236, 0.72);
  box-shadow: 0 0 0 3px rgba(47, 139, 158, 0.18);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 8, 11, 0.72);
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  display: grid;
  gap: 14px;
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 18px;
  background: #0f171d;
  border: 1px solid rgba(119, 201, 215, 0.26);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

.profile-form .checkbox-label,
.permission-group-form .checkbox-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 9px;
}

.profile-form .checkbox-label input,
.permission-group-form .checkbox-label input {
  width: 18px;
  min-height: 18px;
  accent-color: #77c9d7;
}

.permission-groups,
.permission-group-new,
.permission-group-form {
  display: grid;
  gap: 14px;
}

.permission-group-form {
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.permission-group-form select[multiple] {
  min-height: 118px;
}

.member-picker-field {
  display: grid;
  gap: 7px;
}

.field-label {
  color: #d8edf4;
  font-size: 0.9rem;
  font-weight: 750;
}

.member-picker {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  background: rgba(8, 18, 22, 0.58);
  border: 1px solid rgba(119, 201, 215, 0.18);
  border-radius: 8px;
}

.selected-members,
.member-search-results {
  display: grid;
  gap: 8px;
}

.member-search-label {
  display: grid;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px solid rgba(119, 201, 215, 0.12);
}

.permission-group-form .member-picker-item {
  width: 100%;
  justify-content: flex-start;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.035);
  border-radius: 7px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 12px;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.social-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.social-link {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.22);
}

.social-link img {
  width: 17px;
  height: 17px;
  display: block;
}

.application-panel .nav-button {
  width: fit-content;
}

.logo-upload-layout {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.logo-upload-layout .clan-logo,
.logo-upload-layout .clan-logo-fallback {
  width: 96px;
  height: 96px;
}

.incoming-applications {
  display: grid;
  gap: 12px;
}

.incoming-application-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.incoming-application-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.player-inline-link {
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}

.player-inline-link:hover {
  color: #8ccfdd;
}

.form-status {
  color: #8ccfdd;
  font-size: 0.9rem;
}

.member-group {
  display: grid;
  gap: 10px;
}

.roster-block {
  display: grid;
  gap: 8px;
}

.roster-block + .roster-block {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(119, 201, 215, 0.12);
}

.roster-block h3 {
  color: #d8edf4;
  font-size: 0.92rem;
  font-weight: 850;
}

.roster-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.roster-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.roster-player {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  color: #eef4ff;
  text-decoration: none;
  font-weight: 760;
}

.roster-player:hover {
  color: #8ccfdd;
}

.roster-tag {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.roster-row.owner .roster-player {
  color: #f4c96f;
}

.roster-row.officer .roster-player {
  color: #ff9f43;
}

.roster-row.recruit .roster-player {
  color: #cbd5df;
}

.roster-row .member-action {
  width: auto;
  min-height: 26px;
  padding: 3px 8px;
}

.member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.player-link {
  display: inline-grid;
  gap: 2px;
  min-width: 160px;
  padding: 9px 11px;
  color: #eef4ff;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  text-decoration: none;
}

.member-chip {
  display: inline-grid;
  gap: 6px;
  align-content: start;
}

.member-action {
  width: 100%;
  min-height: 28px;
  font-size: 0.78rem;
  padding: 4px 8px;
}

.player-link small {
  color: #a9b6c2;
}

.player-link.owner {
  color: #ffe1a3;
  border-color: rgba(244, 183, 74, 0.5);
}

.player-link.officer {
  color: #aee7ff;
  border-color: rgba(119, 201, 215, 0.5);
}

.player-link.recruiter {
  color: #b8f7cf;
  border-color: rgba(56, 193, 114, 0.44);
}

.player-link.recruit {
  color: #ffd0c2;
  border-color: rgba(255, 135, 102, 0.42);
}

.history-list {
  display: grid;
  gap: 6px;
}

.clan-log-panel {
  position: relative;
}

.clan-log-filter-panel {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  width: min(560px, 100%);
}

.clan-log-limit-note {
  margin-top: 8px;
  font-size: 0.78rem;
}

.history-item {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.history-reaction-item {
  margin-left: 14px;
}

.history-item strong {
  font-size: 0.92rem;
}

.history-item span,
.history-item p {
  color: #a9b6c2;
}

.history-time {
  font-size: 0.72rem;
}

.player-history-item strong {
  line-height: 1.35;
}

.player-history-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.player-history-line .history-time {
  flex: 0 0 auto;
}

.history-clan-link {
  color: inherit;
  text-decoration: none;
}

.history-clan-link:hover {
  color: #f59e0b;
}

.history-meta {
  font-size: 0.82rem;
}

.history-item p {
  font-size: 0.88rem;
  line-height: 1.4;
}

.history-reaction {
  display: grid;
  gap: 2px;
  margin-top: 5px;
  padding: 7px 9px;
  background: rgba(119, 201, 215, 0.08);
  border-left: 2px solid rgba(119, 201, 215, 0.7);
  border-radius: 6px;
}

.history-reaction strong {
  font-size: 0.86rem;
}

.notice {
  padding: 10px 12px;
  color: #ffd7d2;
  background: rgba(229, 72, 77, 0.16);
  border: 1px solid rgba(229, 72, 77, 0.36);
  border-radius: 8px;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 24px;
}

.login-panel label {
  display: grid;
  gap: 7px;
  color: #d8edf4;
  font-size: 0.9rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 860px) {
  .topbar-inner,
  .topbar-right,
  .dashboard-header,
  .profile-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-hero {
    display: flex;
  }

  .player-profile-heading,
  .player-identity {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-inner,
  .dashboard {
    width: min(100% - 24px, 1600px);
  }

  .global-search {
    width: 100%;
  }

  .topbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .clan-profile-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .clan-filter-panel {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .logo-upload-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .global-search {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .clan-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .clan-filter-panel {
    grid-template-columns: 1fr;
  }
}

/* SquadBrowser-inspired compact tactical theme */
:root {
  font-family: Roboto, "Segoe UI", Arial, sans-serif;
  background: #171717;
  color: #e5e5e5;
}

body {
  background:
    radial-gradient(circle at 18% 8%, rgba(245, 158, 11, 0.09), transparent 28%),
    radial-gradient(circle at 92% 24%, rgba(64, 64, 64, 0.34), transparent 32%),
    linear-gradient(135deg, #171717 0%, #111 46%, #18181b 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(23, 23, 23, 0.88), rgba(23, 23, 23, 0.88)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 28px);
}

.topbar {
  background: rgba(23, 23, 23, 0.86);
  border-bottom-color: #404040;
}

.topbar-inner,
.dashboard {
  width: min(1680px, calc(100% - 32px));
}

.nav-title {
  font-family: "Roboto Condensed", Roboto, "Segoe UI", Arial, sans-serif;
  font-size: 1.24rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav-button,
.text-button {
  border-color: #404040;
  border-radius: 4px;
  background: rgba(38, 38, 38, 0.78);
  color: #e5e5e5;
  font-weight: 800;
  box-shadow: none;
}

.nav-button.secondary {
  background: rgba(38, 38, 38, 0.58);
  color: #d4d4d8;
}

.sort-button {
  min-width: 52px;
  min-height: 36px;
  border-color: #404040;
  background: rgba(38, 38, 38, 0.58);
  color: #d4d4d8;
  font-weight: 800;
}

.nav-button:hover,
.text-button:hover,
.nav-button.secondary:hover {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(146, 64, 14, 0.52);
  color: #fde68a;
}

.sort-button:hover,
.sort-button.is-active {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(146, 64, 14, 0.52);
  color: #fde68a;
}

.nav-button.disabled,
.nav-button:disabled {
  background: rgba(38, 38, 38, 0.46);
}

.dashboard {
  padding-top: 22px;
}

.dashboard-header {
  align-items: center;
  margin-bottom: 18px;
}

h1 {
  font-family: "Roboto Condensed", Roboto, "Segoe UI", Arial, sans-serif;
  font-size: clamp(2.1rem, 4.2vw, 4rem);
  font-weight: 900;
  text-transform: uppercase;
}

h2 {
  font-size: 1rem;
  font-weight: 900;
}

.lead,
.description,
.muted,
.result-meta {
  color: #a3a3a3;
}

.global-search input,
.login-panel input,
.clan-filter-panel input,
.clan-filter-panel select,
.profile-form textarea,
.profile-form input,
.profile-form select,
.permission-group-form input,
.permission-group-form select {
  border-color: #404040;
  border-radius: 4px;
  background: rgba(38, 38, 38, 0.74);
  color: #e5e5e5;
}

.global-search input:focus,
.login-panel input:focus,
.clan-filter-panel input:focus,
.clan-filter-panel select:focus,
.profile-form textarea:focus,
.profile-form input:focus,
.profile-form select:focus,
.permission-group-form input:focus,
.permission-group-form select:focus {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.clan-filter-panel,
.profile-panel,
.result-card,
.empty-state,
.login-panel,
.permission-group-form,
.incoming-application-card,
.stats-card,
.modal-panel {
  border-color: #404040;
  border-radius: 4px;
  background: rgba(38, 38, 38, 0.84);
  box-shadow: 0 4px 8px -1px rgba(0, 0, 0, 0.34);
}

.clan-filter-panel {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  padding: 10px;
  gap: 9px;
  width: min(560px, calc(100vw - 48px));
  background: rgba(23, 23, 23, 0.96);
  backdrop-filter: blur(10px);
}

.clan-filter-panel .form-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.clan-filter-panel .checkbox-label {
  min-height: 34px;
  align-self: end;
  padding-bottom: 2px;
}

.clan-grid {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 10px;
}

.clan-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  min-height: 122px;
  padding: 12px;
  border: 1px solid #404040;
  border-radius: 4px;
  background: rgba(38, 38, 38, 0.84);
  box-shadow: 0 4px 8px -1px rgba(0, 0, 0, 0.34);
}

.clan-card__logo-link,
.clan-card__title-link,
.clan-card__description,
.clan-card__meta {
  color: inherit;
  text-decoration: none;
}

.clan-card__logo-link {
  display: block;
  width: 48px;
  height: 48px;
}

.clan-card-link:hover,
.clan-card:hover,
.result-card:hover {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(64, 64, 64, 0.56);
  transform: none;
}

.clan-card__logo-link > .clan-logo,
.clan-card__logo-link > .clan-logo-fallback {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: #262626;
  color: #f59e0b;
}

.clan-logo,
.clan-logo-fallback,
.player-avatar {
  border-radius: 4px;
  background: #262626;
  color: #f59e0b;
}

.clan-card__content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.clan-card__description,
.clan-card__meta {
  grid-column: 1 / -1;
}

.clan-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.clan-card__actions,
.clan-profile-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.clan-title {
  grid-template-rows: 17px minmax(22px, auto);
  gap: 3px;
}

.clan-card .tag {
  color: #c8ad7c;
  font-size: 0.76rem;
  font-weight: 900;
}

.tag {
  border-radius: 4px;
  background: #f59e0b;
  color: #000;
}

.clan-title strong {
  font-size: 1rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clan-card-status {
  flex: 0 0 auto;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #d4d4d8;
  padding-inline: 0;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00c758;
  box-shadow: 0 0 10px rgba(0, 199, 88, 0.7);
}

.status-dot.off {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
}

.clan-card .description {
  display: -webkit-box;
  min-height: 40px;
  font-size: 0.88rem;
  width: 100%;
}

.card-footer {
  justify-content: flex-start;
  gap: 7px;
  width: 100%;
}

.clan-card-chip,
.clan-profile-pill,
.goal-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  border: 1px solid #404040;
  border-radius: 4px;
  background: rgba(23, 23, 23, 0.44);
  color: #a3a3a3;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

.clan-card-chip.amber,
.goal-pill {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(146, 64, 14, 0.42);
  color: #fde68a;
}

.member-count {
  color: #a3a3a3;
  font-size: inherit;
  font-weight: inherit;
}

.members-icon {
  width: 15px;
  height: 15px;
}

.favorite-button {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  flex: 0 0 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #a3a3a3;
  padding: 0;
  cursor: pointer;
}

.favorite-button:hover {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.08);
}

.favorite-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.favorite-button svg {
  width: 18px;
  height: 18px;
  display: block;
}

.favorite-button path {
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.favorite-button.is-favorite {
  color: #f59e0b;
}

.favorite-button.is-favorite path {
  fill: currentColor;
}

.profile-hero {
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.profile-hero .clan-logo,
.profile-hero .clan-logo-fallback,
.player-avatar {
  width: 112px;
  height: 112px;
  border: 1px solid #404040;
  border-radius: 4px;
  background: #262626;
  color: #f59e0b;
}

.clan-tags-line {
  color: #a3a3a3;
}

.clan-tag-main {
  color: #fff;
  font-weight: 900;
}

.clan-tag-secondary {
  color: #d4d4d8;
}

.clan-tag-reserved {
  color: #71717b;
}

.profile-grid {
  gap: 12px;
}

.profile-panel {
  gap: 12px;
  padding: 14px;
}

.facts div {
  border-bottom-color: rgba(64, 64, 64, 0.72);
}

.facts dt {
  color: #a3a3a3;
}

.facts dd {
  color: #e5e5e5;
}

.social-link {
  border-color: #404040;
  border-radius: 4px;
  background: rgba(23, 23, 23, 0.44);
}

.social-link:hover {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(146, 64, 14, 0.52);
}

.roster-block + .roster-block {
  border-top-color: rgba(64, 64, 64, 0.72);
}

.roster-row.owner .roster-player {
  color: #fbbf24;
}

.roster-row.officer .roster-player {
  color: #fb923c;
}

.history-item {
  border-color: rgba(64, 64, 64, 0.72);
  border-radius: 4px;
  background: rgba(23, 23, 23, 0.38);
}

.history-reaction {
  border-left-color: rgba(245, 158, 11, 0.72);
  border-radius: 4px;
  background: rgba(146, 64, 14, 0.18);
}

.back-link,
.player-steam-link,
.link-action {
  color: #f59e0b;
}

.back-link:hover,
.player-steam-link:hover,
.link-action:hover {
  color: #fde68a;
}

.notice {
  border-color: rgba(239, 68, 68, 0.45);
  border-radius: 4px;
  background: rgba(127, 29, 29, 0.28);
}

.profile-form .checkbox-label input,
.permission-group-form .checkbox-label input,
.clan-filter-panel .checkbox-label input {
  accent-color: #f59e0b;
}

@media (max-width: 520px) {
  .clan-list-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .clan-list-tools {
    width: 100%;
    justify-content: space-between;
  }

  .clan-filter-panel {
    left: 0;
    right: auto;
    width: 100%;
  }

  .clan-grid {
    grid-template-columns: 1fr;
  }

  .clan-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .clan-card__logo-link,
  .clan-card__logo-link > .clan-logo,
  .clan-card__logo-link > .clan-logo-fallback {
    width: 44px;
    height: 44px;
  }

  .clan-card__heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

.clan-edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.clan-edit-form {
  gap: 10px;
}

.clan-edit-form label,
.clan-edit-form .field-label,
.permission-group-form label,
.permission-group-form .field-label {
  gap: 5px;
  font-size: 0.82rem;
}

.clan-edit-form input,
.clan-edit-form select,
.permission-group-form input,
.permission-group-form select {
  min-height: 34px;
  padding: 6px 9px;
}

.clan-edit-form textarea {
  padding: 7px 9px;
}

.clan-edit-form textarea[name="short_description"] {
  min-height: 64px;
}

.clan-edit-form textarea[name="description"] {
  min-height: 132px;
}

.compact-identity-row {
  grid-template-columns: minmax(110px, 150px) minmax(260px, 1fr);
}

.compact-tags-row {
  grid-template-columns: minmax(260px, 1fr) minmax(120px, 190px);
}

.compact-rules-row {
  grid-template-columns: minmax(84px, 110px) minmax(84px, 110px) minmax(120px, 170px) auto auto;
  align-items: end;
}

.social-fields-row {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.field-tag input,
.field-number input,
.field-hours input {
  font-weight: 900;
}

.compact-checkbox {
  min-height: 34px;
  align-self: end;
  padding: 0 2px 2px;
}

.clan-edit-form .permission-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 6px 10px;
}

.compact-logo-panel {
  gap: 10px;
}

.logo-upload-layout {
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.logo-upload-layout .clan-logo,
.logo-upload-layout .clan-logo-fallback {
  width: 72px;
  height: 72px;
}

.logo-upload-form {
  gap: 10px;
}

.logo-upload-form input[type="file"] {
  min-height: 34px;
  padding: 5px 8px;
  font-size: 0.82rem;
}

.permission-panel {
  margin-top: 12px;
}

.permission-groups {
  gap: 10px;
}

.permission-group-new {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(64, 64, 64, 0.72);
}

.permission-group-form {
  gap: 10px;
  padding: 12px;
}

.permission-group-head {
  display: grid;
  grid-template-columns: minmax(180px, 300px) minmax(220px, 1fr);
  gap: 10px;
  align-items: end;
}

.permission-group-actions {
  justify-content: flex-end;
  gap: 8px;
}

.permission-group-actions .nav-button {
  min-height: 32px;
  padding: 5px 10px;
}

.permission-group-body {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(280px, 1fr);
  gap: 12px;
  align-items: start;
}

.permission-block,
.permission-members-block {
  display: grid;
  gap: 7px;
}

.permission-group-form .permission-grid {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 6px 8px;
}

.permission-group-form .checkbox-label {
  min-height: 28px;
}

.member-picker {
  max-height: 188px;
  gap: 6px;
  padding: 8px;
  border-radius: 4px;
}

.selected-members,
.member-search-results {
  gap: 6px;
}

.permission-group-form .member-picker-item {
  min-height: 28px;
  padding: 5px 7px;
  border-radius: 4px;
  font-size: 0.82rem;
}

.owner-actions-panel {
  margin-top: 12px;
}

.owner-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
}

.owner-action-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(64, 64, 64, 0.72);
  border-radius: 4px;
  background: rgba(23, 23, 23, 0.42);
}

.owner-action-card h3 {
  margin: 0;
  font-size: 1rem;
}

.owner-action-form {
  display: grid;
  gap: 10px;
}

.owner-action-form select {
  min-height: 34px;
  padding: 6px 9px;
}

.owner-warning {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: 4px;
  background: rgba(146, 64, 14, 0.18);
  color: #fde68a;
  font-size: 0.88rem;
}

.owner-warning[hidden] {
  display: none;
}

.owner-warning.danger {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
}

.nav-button.danger {
  border-color: rgba(239, 68, 68, 0.58);
  background: rgba(127, 29, 29, 0.54);
  color: #fee2e2;
}

.nav-button.danger:hover {
  border-color: rgba(248, 113, 113, 0.75);
  background: rgba(153, 27, 27, 0.72);
  color: #fff;
}

.member-search-label {
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding-top: 7px;
}

.member-search-label input {
  min-height: 30px;
}

.player-comments-panel {
  display: grid;
  gap: 12px;
  width: min(880px, calc(100vw - 48px));
}

.player-comments-panel .section-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: start;
}

.player-comments-list {
  display: grid;
  gap: 8px;
}

.player-comment-item {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid rgba(64, 64, 64, 0.72);
}

.player-comment-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.player-comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.player-comment-text {
  margin: 0;
}

.player-comment-actions {
  display: flex;
  justify-content: flex-start;
}

.player-comment-form,
.player-comment-edit-form {
  display: grid;
  gap: 8px;
  width: 100%;
}

.player-comment-form textarea,
.player-comment-edit-form textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
}

.player-comment-form textarea::placeholder,
.player-comment-edit-form textarea::placeholder {
  color: #8b949e;
}

@media (max-width: 1080px) {
  .clan-edit-layout,
  .permission-group-body,
  .permission-group-head,
  .social-fields-row {
    grid-template-columns: 1fr;
  }

  .permission-group-actions {
    justify-content: flex-start;
  }

  .owner-actions-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .compact-identity-row,
  .compact-tags-row,
  .compact-rules-row,
  .clan-edit-form .permission-grid,
  .permission-group-form .permission-grid {
    grid-template-columns: 1fr;
  }
}
