/* ============================================
   CMO DB — Military Equipment Database
   Clean dark theme inspired by cmano-db.com
   ============================================ */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-card-hover: #1f2a42;
  --bg-input: #0f1626;
  --border: #1e2d4a;
  --border-light: #2a3f66;
  --text-primary: #e2e8f0;
  --text-secondary: #8b9dc3;
  --text-muted: #6b82a8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-dim: #1e40af;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --navy: #1e3a5f;
  --army: #2d4a1e;
  --airforce: #1e2d5f;
  --marines: #5f1e1e;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --transition: 150ms ease;
}

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

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

.hidden { display: none !important; }

/* ── Header ─────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.logo-icon {
  display: flex;
  align-items: center;
  color: var(--accent);
  opacity: 0.9;
  flex-shrink: 0;
}

.logo-name {
  display: inline;
  white-space: nowrap;
}

.logo-accent {
  color: var(--accent);
}

.logo-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  white-space: nowrap;
  border-right: 1px solid var(--border);
  padding-right: 16px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.country-select-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-input);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.country-select-btn:hover,
.country-select-btn[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.country-flag {
  display: block;
  border-radius: 2px;
  flex-shrink: 0;
}

.country-chevron {
  color: var(--text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.country-select-btn[aria-expanded="true"] .country-chevron {
  transform: rotate(180deg);
}

/* ── Country picker modal ─────────────── */
.modal-country {
  max-width: 860px;
  width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.country-search-wrapper {
  position: relative;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.country-search-wrapper .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.country-search-input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  box-sizing: border-box;
  font-size: 14px;
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding-right: 6px;
}

.country-tile {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.country-tile img {
  border-radius: 2px;
  flex-shrink: 0;
  width: 28px;
  height: 19px;
  object-fit: cover;
}

.country-tile span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-tile:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.country-tile.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
  color: var(--accent);
}

.coming-soon {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 1px 5px;
  border-radius: 3px;
}

.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 8px 12px 8px 32px;
  font-size: 13px;
  width: 280px;
  outline: none;
  transition: border-color var(--transition);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input::placeholder {
  color: #7b92b8;
}

/* ── Buttons ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-compare {
  border-color: var(--accent-dim);
}

.btn-compare:hover:not(:disabled) {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.btn-compare-clear {
  padding: 6px 10px;
  font-size: 16px;
  line-height: 1;
  border-color: var(--border-light);
  color: var(--text-muted);
  margin-left: -6px;
}
.btn-compare-clear:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(217, 74, 74, 0.1);
}

.btn-icon {
  padding: 7px 10px;
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-hover);
}

/* ── Navigation ─────────────────────────── */
.nav {
  display: flex;
  gap: 2px;
  padding: 0 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  border-bottom: 2px solid transparent;
  position: relative;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.05);
}

.nav-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}


/* ── Toolbar ────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.category-title {
  font-size: 20px;
  font-weight: 600;
}

.item-count {
  font-size: 13px;
  color: var(--text-muted);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-group label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-select option {
  background: var(--bg-secondary);
}

/* ── Type Icon Filters ──────────────────── */
.type-icon-filters {
  display: flex;
  width: 100%;
  gap: 6px;
  padding: 0 24px 12px;
}

.type-icon-filters:empty {
  display: none;
}

.type-icon-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 2px 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
  font-size: 8.5px;
  line-height: 1.1;
  min-height: 62px;
  text-align: center;
  user-select: none;
  min-width: 0;
  overflow: hidden;
  white-space: pre-line;
}

.type-icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

.type-icon-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.type-icon-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.type-icon-symbol svg {
  display: block;
}

/* ── Content Area ───────────────────────── */
.main {
  max-width: 1600px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.content {
  padding: 0 24px;
}

.loading {
  text-align: center;
  padding: 80px 0;
  color: var(--text-muted);
  font-size: 15px;
}

/* ── Grid View ──────────────────────────── */
.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  will-change: scroll-position;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  contain: layout style paint;
  content-visibility: auto;
  contain-intrinsic-size: auto 340px 320px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.3);
}

/* ── Card Images ───────────────────────── */
.card-image {
  position: relative;
  width: calc(100% + 36px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-input);
  margin: -18px -18px 14px -18px;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: opacity;
}

.card-image img.img-loaded {
  opacity: 1;
}

.card-image-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-input) 0%, var(--bg-card) 100%);
  color: var(--text-muted);
  transition: opacity 0.3s ease;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-year {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 8px;
}

.card-type {
  display: inline-block;
  font-size: 11px;
  color: #6b9edc;
  background: rgba(59, 130, 246, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-weight: 500;
}

.card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  margin-bottom: 10px;
}

.card-meta-item {
  font-size: 13px;
  display: flex;
  justify-content: space-between;
}

.card-meta-label {
  color: var(--text-muted);
}

.card-meta-value {
  color: var(--text-secondary);
  font-weight: 500;
  text-align: right;
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-operator {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.operator-navy { background: var(--navy); color: #9aacbf; }
.operator-army { background: var(--army); color: #98b89e; }
.operator-air-force { background: var(--airforce); color: #99a3bd; }
.operator-marine-corps { background: var(--marines); color: #b89a94; }
.operator-default { background: var(--bg-input); color: var(--text-secondary); }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.card-tag {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.card-compare {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-light);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.card-compare:hover {
  border-color: var(--accent);
}

.card-compare.selected {
  background: var(--accent);
  border-color: var(--accent);
}

/* ── List View ──────────────────────────── */
.list-view {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.list-view .card {
  display: grid;
  grid-template-columns: 60px 1fr auto auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  contain-intrinsic-size: auto 100% 48px;
}

.list-view .card-header { margin-bottom: 0; }
.list-view .card-meta { display: none; }
.list-view .card-desc { display: none; }
.list-view .card-footer { display: none; }
.list-view .card-image { display: none; }

/* ── List View Thumbnails ──────────────── */
.card-list-thumb {
  display: none;
}

.list-view .card-list-thumb {
  display: block;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-input);
  position: relative;
}

.card-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: opacity;
}

.card-list-thumb img.img-loaded {
  opacity: 1;
}

.card-image-placeholder-sm {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-input) 0%, var(--bg-card) 100%);
  color: var(--text-muted);
  transition: opacity 0.3s ease;
}

.card-image-placeholder-sm svg {
  width: 24px;
  height: 24px;
}

.list-view .card-list-stats {
  display: flex;
  gap: 24px;
  font-size: 12px;
  color: var(--text-secondary);
}

.list-view .card-list-stat-label {
  color: var(--text-muted);
  margin-right: 4px;
}

/* ── Modal ──────────────────────────────── */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 820px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-wide {
  max-width: 1100px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  z-index: 1;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal-title {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* ── Detail View ────────────────────────── */
.detail-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.detail-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.detail-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.detail-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
  padding: 14px;
  background: var(--bg-input);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.detail-section-title:hover {
  color: var(--accent-hover);
}

.detail-section-title::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-top: -3px;
}

.detail-section.collapsed .detail-section-title {
  margin-bottom: 0;
}

.detail-section.collapsed .detail-section-title::before {
  transform: rotate(-45deg);
  margin-top: 2px;
}

.detail-section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border-light);
}

.detail-section-body {
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  max-height: 5000px;
  opacity: 1;
}

.detail-section.collapsed .detail-section-body {
  max-height: 0;
  opacity: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-field {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.detail-field-label {
  color: var(--text-muted);
}

.detail-field-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.detail-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.detail-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.detail-table tr:hover td {
  background: rgba(59, 130, 246, 0.03);
}

.range-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
  min-width: 60px;
}

.range-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ── Loadout Accordion ────────────────── */
.loadout-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.loadout-item {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.loadout-item.open {
  border-color: var(--accent);
}

.loadout-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
  min-height: 36px;
}

.loadout-header:hover {
  background: rgba(74, 158, 255, 0.06);
}

.loadout-item.open .loadout-header {
  background: rgba(74, 158, 255, 0.08);
  border-bottom: 1px solid var(--border-light);
}

.loadout-chevron {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--text-secondary);
  border-bottom: 1.5px solid var(--text-secondary);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.loadout-item.open .loadout-chevron {
  transform: rotate(45deg);
}

.loadout-name {
  flex: 1;
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Loadout description layout */
.loadout-header-desc {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.loadout-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.loadout-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  opacity: 0.75;
  padding-left: 2px;
}

.loadout-badges {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
}

.loadout-sort-sel {
  background: #0d1b2a;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  padding: 3px 24px 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.35)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.loadout-sort-sel:hover,
.loadout-sort-sel:focus {
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.9);
}
.loadout-sort-sel option {
  background: #0d1b2a;
  color: rgba(255,255,255,0.85);
}

.loadout-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  white-space: nowrap;
}

.loadout-badge.air { color: #6ba3d4; background: rgba(107, 163, 212, 0.10); }
.loadout-badge.surf { color: #5a9e5e; background: rgba(90, 158, 94, 0.10); }
.loadout-badge.land { color: #b88a4e; background: rgba(184, 138, 78, 0.10); }
.loadout-badge.sensor-role {
  white-space: nowrap;
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 60px;
}

/* Propulsion band groups */
.perf-band-group {
  margin-bottom: 6px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  overflow: hidden;
}
.perf-band-group:last-child { margin-bottom: 0; }

.perf-band-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: color-mix(in srgb, var(--band-color) 10%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--band-color) 25%, transparent);
}
.perf-band-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--band-color);
  letter-spacing: 0.02em;
}
.perf-band-bucket {
  font-size: 10px;
  font-weight: 600;
  color: var(--band-color);
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: color-mix(in srgb, var(--band-color) 12%, transparent);
  padding: 1px 6px;
  border-radius: 3px;
}
.perf-band-rows .loadout-item {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.perf-band-rows .loadout-item:last-child {
  border-bottom: none;
}
.perf-band-rows .loadout-header:hover {
  background: color-mix(in srgb, var(--band-color, var(--accent)) 6%, transparent);
}

/* Altitude range labels in band header */
.band-alt-range {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  font-weight: 400;
}

.sig-rank-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  opacity: 0.5;
}
.sig-rank-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 0px 4px;
  border-radius: 2px;
  border: 1px solid currentColor;
  background: transparent;
  letter-spacing: 0.03em;
}
.sig-rank-prefix {
  font-weight: 400;
  opacity: 0.6;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sig-rank-num {
  opacity: 0.55;
}
.band-alt-ft {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  font-weight: 400;
}
.band-alt-ft::before {
  content: '/';
  margin: 0 4px;
  color: rgba(255,255,255,0.15);
}

/* Altitude visualization */
.perf-alt-viz-wrap {
  margin-top: 12px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);
}
.perf-alt-viz {
  display: block;
  width: 100%;
  height: auto;
}

/* Loadout mission role badges */
.loadout-role { white-space: nowrap; flex-shrink: 0; font-weight: 500; }
.loadout-role.role-aa { color: #64b5f6; background: rgba(100, 181, 246, 0.12); }
.loadout-role.role-strike { color: #ff8a65; background: rgba(255, 138, 101, 0.12); }
.loadout-role.role-cas { color: #a5d6a7; background: rgba(165, 214, 167, 0.12); }
.loadout-role.role-bomb { color: #e0e0e0; background: rgba(224, 224, 224, 0.10); }
.loadout-role.role-sead { color: #fff176; background: rgba(255, 241, 118, 0.12); }
.loadout-role.role-asuw { color: #4dd0e1; background: rgba(77, 208, 225, 0.12); }
.loadout-role.role-asw { color: #80cbc4; background: rgba(128, 203, 196, 0.12); }
.loadout-role.role-nuke { color: #ef5350; background: rgba(239, 83, 80, 0.15); }
.loadout-role.role-ew { color: #ce93d8; background: rgba(206, 147, 216, 0.12); }
.loadout-role.role-isr { color: #b0bec5; background: rgba(176, 190, 197, 0.12); }
.loadout-role.role-transport { color: #a1887f; background: rgba(161, 136, 127, 0.12); }
.loadout-role.role-sof { color: #66bb6a; background: rgba(102, 187, 106, 0.12); }
.loadout-role.role-sar { color: #ffa726; background: rgba(255, 167, 38, 0.12); }
.loadout-role.role-mine { color: #78909c; background: rgba(120, 144, 156, 0.12); }
.loadout-role.role-c2 { color: #9fa8da; background: rgba(159, 168, 218, 0.12); }
.loadout-role.role-drone { color: #90a4ae; background: rgba(144, 164, 174, 0.12); }
.loadout-role.role-train { color: #c5e1a5; background: rgba(197, 225, 165, 0.12); }

.loadout-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.loadout-item.open .loadout-body {
  max-height: 600px;
}

.loadout-body-inner {
  padding: 8px 12px 12px;
}

/* ── Detail Hero Image ─────────────────── */
.detail-hero {
  position: relative;
  width: calc(100% + 56px);
  margin: -28px -28px 24px -28px;
  max-height: 300px;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-input);
}

.detail-hero img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.detail-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(transparent, var(--bg-secondary));
  pointer-events: none;
}

.detail-hero img.img-loaded {
  opacity: 1;
}

.detail-hero-placeholder {
  height: 180px;
}

/* ── Clickable weapon chips ─────────────── */
.wpn-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.wpn-chip {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wpn-chip:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.wpn-link-name {
  color: var(--accent) !important;
  cursor: pointer !important;
}
.wpn-link-name:hover {
  text-decoration: underline;
}

/* ── Used By (weapon cross-reference) ──── */
.used-by-group {
  margin-bottom: 12px;
}
.used-by-group:last-child {
  margin-bottom: 0;
}
.used-by-cat {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.used-by-cat svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}
.used-by-units {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.used-by-unit {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.used-by-unit:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Compare View (Full-Screen) ─────────── */
.compare-fullscreen {
  max-width: none !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.compare-sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 80px;
  flex-shrink: 0;
}

.compare-header-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 120px;
  max-width: 180px;
  flex: 1;
  position: relative;
}

.compare-header-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg-card);
}

.compare-header-thumb-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-muted);
}

.compare-header-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.2;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-header-meta {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
}

.compare-header-color {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  margin-top: 2px;
}

.compare-header-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all var(--transition);
}

.compare-header-remove:hover {
  background: #ef5350;
  color: #fff;
  border-color: #ef5350;
}

.compare-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
}

.compare-section {
  margin-bottom: 32px;
}

.compare-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Compare table */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 13px;
}

.compare-table th,
.compare-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.compare-table th:first-child,
.compare-table td:first-child {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  min-width: 140px;
  background: var(--bg-card);
  position: sticky;
  left: 0;
  z-index: 1;
}

.compare-table th {
  background: var(--bg-card);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12px;
}

.compare-table td {
  color: var(--text-secondary);
}

.compare-table td.compare-best {
  color: var(--success) !important;
  font-weight: 600;
}

.compare-delta {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
  white-space: nowrap;
}

.compare-delta-bad {
  color: #ef5350;
  background: rgba(239, 83, 80, 0.12);
}

.compare-delta-good {
  color: #4caf50;
  background: rgba(76, 175, 80, 0.12);
}

.compare-table-wrap {
  overflow-x: auto;
}

/* Compare chart container */
/* Horizontal scroll row for all visualization charts */
.compare-charts-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin: 0 0 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.compare-charts-row::-webkit-scrollbar { height: 4px; }
.compare-charts-row::-webkit-scrollbar-track { background: transparent; }
.compare-charts-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.compare-chart {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0 16px;
}

/* Inline variant used inside the charts row */
.compare-chart.compare-chart-inline {
  flex: 0 0 540px;
  min-width: 450px;
  margin: 0;
}

/* Force all SVGs inside inline chart cards to fill width; viewBox maintains aspect ratio */
.compare-chart.compare-chart-inline svg {
  display: block;
  width: 100% !important;
  height: auto !important;
}

.compare-chart-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* Compare subsection for lists (sensors, weapons, etc.) */
.compare-list-section {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.compare-list-column {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.compare-list-column-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.compare-list-item {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.compare-list-item:last-child {
  border-bottom: none;
}

.compare-list-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(74, 158, 255, 0.15);
  color: var(--accent);
  white-space: nowrap;
}

/* Loading state */
.compare-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
  gap: 12px;
}

.compare-loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Scrollbar ──────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Footer ─────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  text-align: center;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-text {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.5px;
}


/* ── Responsive ─────────────────────────── */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .header-right {
    width: 100%;
  }

  .search-input {
    width: 100%;
  }

  .nav {
    padding: 0 8px;
    overflow-x: auto;
  }

  .nav-btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  .toolbar {
    padding: 12px 16px;
  }

  .toolbar-right {
    width: 100%;
  }

  .content {
    padding: 0 16px;
  }

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

  .modal-content {
    padding: 20px;
    width: 95%;
  }

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

  .detail-hero {
    width: calc(100% + 40px);
    margin: -20px -20px 20px -20px;
    max-height: 200px;
  }

  .detail-hero img {
    max-height: 200px;
  }
}

/* ── No results ─────────────────────────── */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.no-results h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* ── Animations ─────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-content {
  animation: fadeIn 0.2s ease;
}

/* ── Focus & Accessibility ─────────────── */
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.type-icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  z-index: 200;
  font-size: 14px;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Chart Styles ───────────────────────── */
.chart-tooltip {
  display: none;
  position: absolute;
  z-index: 10000;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-primary);
  pointer-events: none;
  max-width: 260px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.chart-container {
  width: 100%;
  margin: 8px 0;
}

.chart-container svg {
  width: 100%;
  height: auto;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 8px 0;
  font-size: 11px;
  color: var(--text-secondary);
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.detail-section .chart-container svg {
  max-height: 320px;
}

/* ── Analytics Tab ──────────────────────── */
.analytics-view {
  padding: 0 16px;
}

.analytics-toolbar {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
}

.analytics-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  min-height: 280px;
}

.analytics-panel-wide {
  grid-column: 2;
}

.analytics-panel-full {
  grid-column: 1 / -1;
}

.analytics-panel-hidden {
  display: none;
}

/* ── Tips & Tricks ── */
.tips-view {
  padding: 0 16px;
}

.tips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.tips-header-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.tips-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.tips-count {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Controls row */
.tips-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tips-search-wrap {
  position: relative;
  flex: 0 0 200px;
}

.tips-search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.45;
  pointer-events: none;
}

.tips-search {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 12px;
  padding: 6px 10px 6px 28px;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition);
}

.tips-search:focus {
  border-color: var(--accent);
}

.tips-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.tip-filter-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 11px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.tip-filter-pill:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.tip-filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tips-sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
}

.tips-empty {
  color: var(--text-secondary);
  text-align: center;
  padding: 40px 0;
  grid-column: 1 / -1;
}

.tips-submit-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.tips-submit-btn:hover {
  background: var(--accent-hover, #3a8ee0);
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background var(--transition), border-color var(--transition);
}

.tip-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.tip-category-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  align-self: flex-start;
}

.tip-category-badge.tactics  { background: rgba(217,74,74,0.12);    color: #d94a4a; }
.tip-category-badge.aircraft { background: rgba(107,163,212,0.12);  color: #6ba3d4; }
.tip-category-badge.ships    { background: rgba(90,158,94,0.12);    color: #5a9e5e; }
.tip-category-badge.weapons  { background: rgba(200,122,58,0.12);   color: #c87a3a; }
.tip-category-badge.sensors  { background: rgba(148,102,196,0.12);  color: #9466c4; }
.tip-category-badge.general  { background: rgba(128,144,160,0.12);  color: #8090a0; }

.tip-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.tip-card-excerpt {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.tip-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 4px;
}

.tip-read-more {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

/* Tip detail modal body */
.tip-modal-category {
  margin-bottom: 12px;
}

.tip-modal-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.tip-modal-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 8px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition);
}

.tip-modal-link:hover {
  background: var(--bg-card-hover);
}

/* Submit tip modal */
.submit-tip-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
}

.submit-tip-form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 4px;
}

.submit-tip-form input,
.submit-tip-form select,
.submit-tip-form textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color var(--transition);
}

.submit-tip-form input:focus,
.submit-tip-form select:focus,
.submit-tip-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.submit-tip-form textarea {
  min-height: 180px;
  resize: vertical;
}

.submit-tip-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.submit-tip-cancel {
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.submit-tip-send {
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.submit-tip-send:hover {
  background: var(--accent-hover, #3a8ee0);
}

@media (max-width: 900px) {
  .tips-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .tips-grid {
    grid-template-columns: 1fr;
  }
  .tips-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  .analytics-panel {
    min-height: 200px;
  }
}