/* ============================================
/**
   WWM DPS Calculator v2.0 - Dark Theme Styles
   Tab-based Architecture
   ============================================ */

/* CSS Variables - Dark Theme (Default) */
:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-tertiary: #0f3460;
  --bg-input: #2d3748;

  --text-primary: #e8e8e8;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;

  --accent: #4ade80;
  --accent-hover: #22c55e;
  --negative: #f87171;
  --positive: #4ade80;
  --warning: #fbbf24;

  --border: #2d3748;
  --border-focus: #4a5568;
  --border-invalid: #f87171;

  --shadow: rgba(0, 0, 0, 0.3);
  --radius: 6px;
  --radius-lg: 12px;

  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

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

/* Base */
html {
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* App Container */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  text-align: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.app-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.app-header .subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ============================================
   Tab Navigation
   ============================================ */

.tab-nav-container {
  margin-bottom: 1rem;
  overflow-x: auto;
}

.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
  justify-content: stretch;
}

.tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex: 1;
  padding: 0.7rem 0.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -2px;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg-secondary);
}

.tab-icon {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-icon-img {
  vertical-align: middle;
  opacity: 0.8;
}

.tab-btn:hover .tab-icon-img,
.tab-btn.active .tab-icon-img {
  opacity: 1;
}

/* Gear slot and section icon images */
.gear-icon-img,
.section-icon {
  vertical-align: middle;
  opacity: 0.9;
}

.tab-label {
  display: inline;
}

@media (max-width: 900px) {
  .tab-btn {
    padding: 0.6rem 0.3rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 600px) {
  .tab-btn {
    padding: 0.5rem 0.2rem;
    font-size: 0.75rem;
  }
  .tab-label {
    display: none;
  }
}

/* Tab Panels */
.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Main Content */
.main-content {
  flex: 1;
}

/* ============================================
   Character Stats Tab (Tab 1)
   ============================================ */

.character-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.character-stats-panel,
.character-attunements-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.character-stats-panel h3,
.character-attunements-panel h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.panel-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Stats Grid */
.stats-grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stats-grid-header {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1px;
}

.stats-grid-header > div {
  background: var(--bg-tertiary);
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.stats-grid-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1px;
}

.stats-grid-row > div {
  background: var(--bg-secondary);
  padding: 0.4rem 0.75rem;
}

.stat-label-col {
  font-weight: 500;
  font-size: 0.85rem;
}

.stat-value-col {
  text-align: right;
}

.stats-section-divider {
  background: var(--bg-tertiary) !important;
  padding: 0.4rem 0.75rem !important;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.character-stat-input,
.character-attune-input {
  width: 100%;
  text-align: right;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  transition: border-color 0.2s;
}

.character-stat-input:focus,
.character-attune-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-input);
}

/* Attunement Slots */
.attune-slot-group {
  margin-bottom: 1rem;
}

.attune-slot-header {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.attune-slot-abilities {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.attune-ability-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
}

.attune-ability-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.attune-ability-row .character-attune-input {
  width: 80px;
}

/* ============================================
   Gear Compare Tab (Tab 2)
   ============================================ */

.gear-compare-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.gear-compare-stats-panel,
.gear-compare-attune-panel,
.gear-hawkwing-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.gear-compare-stats-panel {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
}

.gear-compare-attune-panel {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}

.gear-hawkwing-panel {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
}

.gear-compare-stats-panel h3,
.gear-compare-attune-panel h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* Gear Compare Table */
.gear-compare-table {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.gear-compare-header,
.gear-compare-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 0.75fr;
  gap: 1px;
}

.gear-compare-header > div,
.gear-compare-row > div {
  background: var(--bg-secondary);
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
}

.gear-compare-header > div {
  background: var(--bg-tertiary);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.gc-label {
  font-weight: 500;
}

.gc-current,
.gc-new,
.gc-delta {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.gc-input {
  width: 100%;
  text-align: right;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.2rem 0.3rem;
}

.gc-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Gear Slot Selector */
.gear-slot-selector {
  margin-bottom: 1rem;
}

.gear-slot-selector label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.gear-slot-selector select {
  width: 100%;
  padding: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
}

.gear-slot-selector select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Gear Attunement Table */
.gear-attune-table {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.gear-attune-header,
.gear-attune-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 0.75fr;
  gap: 1px;
}

.gear-attune-header > div,
.gear-attune-row > div {
  background: var(--bg-secondary);
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
}

.gear-attune-header > div {
  background: var(--bg-tertiary);
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.ga-ability {
  font-weight: 500;
}

.ga-current,
.ga-new,
.ga-delta {
  text-align: right;
  font-family: var(--font-mono);
}

.ga-input {
  width: 100%;
  text-align: right;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.15rem 0.25rem;
}

.ga-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ============================================
   Hawkwing Compare Panel
   ============================================ */

.hawkwing-compare-panel h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.hawkwing-rotations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.rotation-select label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.rotation-select select {
  width: 100%;
  padding: 0.4rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
}

.rotation-select select:focus {
  outline: none;
  border-color: var(--accent);
}

.hawkwing-comparison-table {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.hc-header,
.hc-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 0.75fr;
  gap: 1px;
}

.hc-header > div,
.hc-row > div {
  background: var(--bg-secondary);
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
}

.hc-header > div {
  background: var(--bg-tertiary);
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.hc-row-primary {
  background: var(--bg-tertiary);
}

.hc-row-primary > div {
  background: var(--bg-tertiary);
  font-weight: 600;
}

.hc-label {
  font-weight: 500;
}

.hc-current,
.hc-new,
.hc-delta {
  text-align: right;
  font-family: var(--font-mono);
}

.hawkwing-info {
  text-align: center;
  padding: 0.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  font-size: 0.75rem;
}

.hawkwing-info .info-label {
  color: var(--text-secondary);
}

.hawkwing-info .info-value {
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-mono);
}

.hawkwing-info .info-note {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-top: 0.25rem;
}

/* ============================================
   Rotations Tab (Tab 3)
   ============================================ */

.rotation-viewer-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
}

.rotation-selector-panel,
.rotation-details-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.rotation-selector-panel h3,
.rotation-details-panel h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.rotation-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rotation-btn {
  padding: 0.6rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.rotation-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.rotation-btn.active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
  font-weight: 600;
}

.rotation-btn.has-changes {
  border-color: var(--warning);
  color: var(--warning);
}

.rotation-btn.active.has-changes {
  background: var(--warning);
  color: var(--bg-primary);
  border-color: var(--warning);
}

.rotation-btn.is-custom {
  border-left: 3px solid var(--accent);
}

.rotation-btn.is-custom.active {
  border-left: 3px solid var(--bg-primary);
}

.rotation-btn.is-active-rotation {
  border-right: 3px solid var(--accent);
}

.rotation-btn.is-active-rotation.active {
  border-right: 3px solid var(--bg-primary);
}

/* Active rotation indicator */
.rotation-active-indicator {
  background: var(--bg-tertiary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rotation-active-indicator .active-label {
  color: var(--text-secondary);
}

.rotation-active-indicator .active-value {
  color: var(--accent);
  font-weight: 600;
}

/* DPS Preview Panel */
.rotation-dps-preview {
  display: flex;
  gap: 1.5rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.dps-preview-stat {
  display: flex;
  flex-direction: column;
}

.dps-preview-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dps-preview-value {
  font-size: 1.2rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.dps-preview-value.positive { color: var(--positive); }
.dps-preview-value.negative { color: var(--negative); }
.dps-preview-value.neutral { color: var(--text-muted); }

/* Rotation header actions */
.rotation-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.rotation-active-badge {
  background: var(--accent);
  color: var(--bg-primary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Success button */
.btn-success {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

/* Create Rotation Section */
.rotation-create-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.rotation-create-section .btn {
  width: 100%;
}

.rotation-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.rotation-header-row h3 {
  margin-bottom: 0;
}

/* Create Rotation Panel */
.rotation-create-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 500px;
  margin: 0 auto;
}

.rotation-create-panel h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  text-align: center;
}

.create-form .form-group {
  margin-bottom: 1.25rem;
}

.create-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.create-form .form-input,
.create-form .form-select {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.create-form .form-input:focus,
.create-form .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(58, 163, 148, 0.2);
}

.create-form small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.create-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.create-actions .btn {
  flex: 1;
}

/* Ability Actions Column */
.ab-actions {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
}

.btn-icon {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

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

.btn-icon.btn-remove:hover:not(:disabled) {
  background: var(--negative);
  color: var(--bg-primary);
  border-color: var(--negative);
}

/* Ability row with actions column */
.ability-header,
.ability-row {
  display: grid;
  grid-template-columns: 40px 50px 1fr 60px 60px 60px 80px 100px 110px;
  gap: 1px;
}

.ab-time {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ab-damage {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

.ab-buffs-col {
  display: flex;
  gap: 2px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

/* Buff tag styling */
.buff-tag {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
}

.buff-combo {
  background: var(--positive);
  color: var(--bg-primary);
}

.buff-windwall {
  background: var(--accent);
  color: var(--bg-primary);
}

.buff-bone {
  background: #9b59b6;
  color: white;
}

.buff-star {
  background: #f1c40f;
  color: #333;
}

.buff-star-below30 {
  background: #e67e22;
  color: white;
}

.buff-star-exhausted {
  background: #e74c3c;
  color: white;
}

.buff-dragon {
  background: #ef4444;
  color: white;
}

.buff-healer {
  background: #fbbf24;
  color: #333;
}

.team-buff-tag {
  border: 1px dashed rgba(255, 255, 255, 0.4);
}

.buff-none {
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

/* Buff applicability states */
.buff-tag.buff-applies {
  /* Bright, saturated - buff is active AND applies to this skill */
  filter: none;
  opacity: 1;
}

.buff-tag.buff-inactive {
  /* Dimmed - buff is active but doesn't apply to this skill */
  opacity: 0.4;
  filter: grayscale(50%);
}

.buff-tag.buff-trigger {
  /* Special styling for trigger buffs (like Lingering Bone) */
  opacity: 0.7;
  border: 1px dashed currentColor;
}

/* Buff Legend */
.buff-legend {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.buff-legend .legend-title {
  font-weight: 600;
  color: var(--text-primary);
}

.buff-legend .buff-tag {
  margin-right: 0.25rem;
}

.buff-legend .legend-divider {
  color: var(--text-tertiary);
  margin: 0 0.25rem;
}

.buff-legend .legend-note {
  font-size: 0.65rem;
  color: var(--text-tertiary);
}

.ability-row-add {
  display: flex;
  padding: 0.5rem;
  background: var(--bg-secondary);
  justify-content: center;
}

.ability-row-add .btn {
  flex: 1;
  max-width: 200px;
}

/* Rotation Summary */
.rotation-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.rotation-stat {
  background: var(--bg-tertiary);
  padding: 0.75rem;
  border-radius: var(--radius);
  text-align: center;
}

.rs-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.rs-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

/* Ability List */
.rotation-sequence h4,
.rotation-affinity-comparison h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.ability-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}

.ability-header > span,
.ability-row > span {
  background: var(--bg-secondary);
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
}

.ability-header > span {
  background: var(--bg-tertiary);
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.ab-num {
  text-align: center;
  font-family: var(--font-mono);
}

.ab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ab-uses,
.ab-hits,
.ab-cast {
  text-align: right;
  font-family: var(--font-mono);
}

/* Affinity Comparison */
.rotation-affinity-comparison {
  margin-top: 1.5rem;
}

.affinity-table {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.aff-header,
.aff-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 1px;
}

.aff-header > span,
.aff-row > span {
  background: var(--bg-secondary);
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
}

.aff-header > span {
  background: var(--bg-tertiary);
  font-weight: 600;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.aff-rate,
.aff-stacks,
.aff-bonus,
.aff-ramp {
  text-align: right;
  font-family: var(--font-mono);
}

.aff-highlight > span {
  background: var(--bg-tertiary) !important;
  font-weight: 600;
}

/* ============================================
   Profile Tab (Tab 5)
   ============================================ */

#profile-panel-container {
  max-width: 500px;
  margin: 0 auto;
}

.profile-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

/* Profile Selector Section */
.profile-selector-section {
  margin-bottom: 1rem;
}

.profile-selector-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.profile-selector-group {
  flex: 1;
  min-width: 200px;
}

.profile-selector-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.profile-select {
  width: 100%;
  padding: 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
}

.profile-select:focus {
  outline: none;
  border-color: var(--accent);
}

.profile-selector-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

.btn-sm .btn-icon {
  font-weight: bold;
  margin-right: 0.25rem;
}

.profile-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.profile-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.profile-panel h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.profile-name-input {
  margin-bottom: 1.5rem;
}

.profile-name-input label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.profile-name-input input {
  width: 100%;
  padding: 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.profile-name-input input:focus {
  outline: none;
  border-color: var(--accent);
}

.profile-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #1a1a2e;
}

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

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

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

.btn-danger {
  background: transparent;
  color: var(--negative);
  border: 1px solid var(--negative);
}

.btn-danger:hover {
  background: var(--negative);
  color: var(--bg-primary);
}

.btn-warning {
  background: transparent;
  color: #f59e0b;
  border: 1px solid #f59e0b;
}

.btn-warning:hover {
  background: #f59e0b;
  color: var(--bg-primary);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

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

.profile-last-saved {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1rem;
}

/* ============================================
   Delta Styling
   ============================================ */

.delta-positive {
  color: var(--positive);
}

.delta-negative {
  color: var(--negative);
}

.delta-zero {
  color: var(--text-muted);
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 350px;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  box-shadow: 0 4px 12px var(--shadow);
  animation: slideIn 0.3s ease;
  border-left: 3px solid var(--accent);
}

.toast-success { border-left-color: var(--positive); }
.toast-error { border-left-color: var(--negative); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--accent); }

.toast.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ============================================
   Footer
   ============================================ */

.app-footer {
  text-align: center;
  padding: 1rem 0;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* About/Credits Footer */
.footer-content {
  text-align: center;
  padding: 0.5rem 0;
}

.footer-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.footer-credits,
.footer-thanks,
.footer-special {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.25rem 0;
}

.footer-credits strong,
.footer-thanks strong,
.footer-special strong {
  color: var(--text-secondary);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 900px) {
  .character-layout,
  .gear-compare-layout {
    grid-template-columns: 1fr;
  }

  .gear-compare-stats-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .gear-compare-attune-panel,
  .gear-hawkwing-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .rotation-viewer-layout {
    grid-template-columns: 1fr;
  }

  .rotation-selector-panel {
    order: 1;
  }

  .rotation-list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .rotation-btn {
    flex: 1;
    min-width: 100px;
    text-align: center;
  }

  .rotation-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .gear-compare-header,
  .gear-compare-row {
    grid-template-columns: 1.5fr 0.75fr 0.75fr 0.5fr;
    font-size: 0.75rem;
  }

  .rotation-summary {
    grid-template-columns: 1fr;
  }

  .hawkwing-rotations {
    grid-template-columns: 1fr;
  }

  .ability-header,
  .ability-row {
    grid-template-columns: 30px 1.5fr 45px 45px 45px;
  }

  /* Hide damage column on small screens */
  .ab-damage {
    display: none;
  }

  .ability-header > span,
  .ability-row > span {
    font-size: 0.7rem;
    padding: 0.3rem;
  }
}

/* ============================================
   v2.1 Additions - Attunement Totals
   ============================================ */

.attune-totals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.attune-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
}

.attune-total-label {
  font-weight: 500;
  color: var(--text-primary);
}

.character-attune-total-input {
  width: 80px;
  padding: 0.4rem 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.character-attune-total-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--border-focus);
}

.attune-info-note {
  margin-top: 1rem;
  text-align: center;
  color: var(--text-muted);
}

/* ============================================
   v2.1 Additions - Damage Summary Panel
   ============================================ */

.gear-damage-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1rem;
}

.gear-damage-panel h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.damage-comparison {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.damage-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.damage-row.damage-header {
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
}

.damage-row.damage-percent {
  border-bottom: none;
}

.dmg-label {
  font-weight: 500;
}

.dmg-current,
.dmg-new,
.dmg-delta {
  text-align: right;
  font-family: var(--font-mono);
}

.damage-note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================
   v2.1 Additions - Gear Actions
   ============================================ */

.gear-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.gear-actions .btn {
  flex: 1;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
}

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

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--border-focus);
}

/* ============================================
   v2.1 Additions - Rotation Editing
   ============================================ */

.ability-row-editable {
  position: relative;
}

.ability-dropdown {
  width: 100%;
  padding: 0.3rem 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
}

.ability-dropdown:focus {
  outline: none;
  border-color: var(--accent);
}

.ability-uses-input {
  width: 45px;
  padding: 0.3rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.ability-uses-input:focus {
  outline: none;
  border-color: var(--accent);
}

.rotation-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.rotation-custom-note {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

/* Responsive adjustments for v2.1 */
@media (max-width: 768px) {
  .attune-totals-grid {
    grid-template-columns: 1fr;
  }

  .damage-row {
    grid-template-columns: 1fr 0.75fr 0.75fr 0.75fr;
    font-size: 0.85rem;
  }

  .gear-actions {
    flex-direction: column;
  }

  .character-damage-panel .damage-display {
    flex-direction: column;
  }
}

/* ============================================
   v2.4 Styles - Combat Settings Tab
   ============================================ */

.combat-settings-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.combat-settings-panel h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-section {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 1rem;
}

.settings-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row.toggle .toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.setting-row.toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.setting-row .setting-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

.setting-row.input label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.setting-input-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.setting-input-group input[type="number"] {
  width: 70px;
  padding: 0.35rem 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.setting-input-group input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
}

.setting-input-group .setting-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 40px;
}

.settings-info {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.settings-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.settings-info p:last-child {
  margin-bottom: 0;
}

.settings-actions {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.settings-actions .btn {
  min-width: 180px;
}

/* v2.7: Setting hints and info boxes */
.setting-row .setting-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
  flex: 1;
  text-align: right;
}

.setting-row .setting-description {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.setting-row.toggle {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.setting-info {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.setting-info .info-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.setting-info .info-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.setting-info .info-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Judgment Resistance warning indicator */
.setting-info.judgment-resistance-warning {
  background: rgba(255, 165, 0, 0.15);
  border: 1px solid rgba(255, 165, 0, 0.4);
  margin-top: 0.5rem;
}

.setting-info.judgment-resistance-warning .info-label {
  color: #ffa500;
  font-weight: 600;
}

.setting-info.judgment-resistance-warning .info-value {
  color: var(--text-secondary);
  font-weight: normal;
  font-size: 0.85rem;
}

/* Level input rows - compact inline layout */
.setting-row.level-input {
  justify-content: flex-start;
  gap: 1rem;
}

.setting-row.level-input label {
  min-width: 100px;
  font-size: 0.9rem;
}

.setting-row.level-input .setting-input-group {
  gap: 0.5rem;
}

.setting-row.level-input .input-suffix {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* v3.0: Inner Ways Section */
.inner-ways-section {
  margin-top: 1rem;
}

.inner-ways-section .section-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Inner Ways List (current selections) */
.inner-ways-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.inner-way-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.inner-way-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  min-width: 120px;
}

.inner-way-tier-badge {
  padding: 0.15rem 0.5rem;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.inner-way-item-desc {
  flex: 1;
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inner-way-remove-btn {
  padding: 0.25rem 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  transition: all 0.2s;
}

.inner-way-remove-btn:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.inner-way-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.5rem;
}

/* Add Inner Way Button */
.inner-way-add-btn {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s;
}

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

.inner-way-limit-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Inner Way Popup */
.inner-way-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.inner-way-popup-content {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  min-width: 320px;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
}

.inner-way-popup-content h5 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.inner-way-popup-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.popup-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.popup-field label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.popup-field select {
  padding: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
}

.popup-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.popup-tier-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 1.2rem;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.inner-way-popup-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.popup-cancel-btn,
.popup-save-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.popup-cancel-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.popup-cancel-btn:hover {
  background: var(--bg-secondary);
}

.popup-save-btn {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: white;
}

.popup-save-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.popup-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Popup checkbox field */
.popup-checkbox-field {
  margin-top: 0.5rem;
}

.popup-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.popup-checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.popup-checkbox-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0 1.5rem;
  font-style: italic;
}

/* Inner Way badges for source/added status */
.inner-way-item-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 200px;
}

.inner-way-source-badge {
  padding: 0.1rem 0.4rem;
  background: var(--success);
  color: white;
  border-radius: var(--radius);
  font-size: 0.65rem;
  font-weight: 600;
}

.inner-way-new-badge {
  padding: 0.1rem 0.4rem;
  background: var(--warning);
  color: #333;
  border-radius: var(--radius);
  font-size: 0.65rem;
  font-weight: 600;
}

/* Inner Ways Panel on Stats Page */
.character-inner-ways-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.character-inner-ways-panel h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: var(--accent);
}

.inner-ways-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Side-by-side top panels */
.character-top-panels {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.character-top-panels .character-damage-panel-wide {
  flex: 1;
  margin-bottom: 0;
}

/* Compact Inner Ways panel */
.character-inner-ways-compact {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.character-inner-ways-compact h3 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--accent);
}

.inner-ways-compact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
  align-content: flex-start;
}

.inner-way-empty-compact {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.inner-way-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  font-size: 0.75rem;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.inner-way-tag.in-source {
  border-color: var(--success);
  background: rgba(46, 160, 67, 0.15);
}

.inner-way-tag.added {
  border-color: var(--warning);
  background: rgba(227, 179, 65, 0.15);
}

.inner-way-tag-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1;
  margin-left: 0.15rem;
}

.inner-way-tag-remove:hover {
  color: var(--danger);
}

.inner-way-add-btn-small {
  padding: 0.25rem 0.5rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.5rem;
  align-self: flex-start;
}

.inner-way-add-btn-small:hover {
  background: var(--accent-hover);
}

/* Inner Ways DPS Contributions Panel */
.iw-contributions-panel {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

.iw-contrib-header {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.7fr;
  gap: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.65rem;
  text-transform: uppercase;
  line-height: 1.3;
}

.iw-contrib-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.7fr;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border-light, rgba(255,255,255,0.05));
}

.iw-contrib-row:last-child {
  border-bottom: none;
}

.iw-contrib-name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iw-contrib-dps {
  color: var(--danger, #e74c3c);
  text-align: right;
  font-family: monospace;
}

.iw-contrib-pct {
  color: var(--danger, #e74c3c);
  text-align: right;
  font-family: monospace;
}

.iw-contrib-total {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.7fr;
  gap: 0.75rem;
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--border);
  font-weight: 600;
}

.iw-contrib-total .iw-contrib-name {
  color: var(--text-muted);
}

.iw-contrib-total .iw-contrib-dps,
.iw-contrib-total .iw-contrib-pct {
  color: var(--danger, #e74c3c);
}

/* Character Stats Damage Panel */
.character-damage-panel {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 2px solid var(--accent);
  margin-bottom: 1rem;
}

.character-damage-panel h3 {
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.damage-display {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.damage-stat {
  text-align: center;
}

.damage-stat.primary .damage-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  display: block;
  line-height: 1.2;
}

.damage-stat .damage-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.damage-details {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.damage-detail {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Gear Compare Damage Delta Display */
.damage-delta-display {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.damage-delta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.damage-delta-row .delta-label {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.damage-delta-row .delta-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.damage-delta-row .delta-value.delta-positive {
  color: var(--positive);
}

.damage-delta-row .delta-value.delta-negative {
  color: var(--negative);
}

.damage-delta-row .delta-value.delta-zero {
  color: var(--text-muted);
}

.gear-damage-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border);
}

.gear-damage-panel h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.damage-note {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* v2.3 - Single Damage Delta (more prominent) */
.damage-delta-single {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.damage-delta-single .damage-delta-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.damage-delta-single .damage-delta-value.delta-positive {
  color: var(--positive);
}

.damage-delta-single .damage-delta-value.delta-negative {
  color: var(--negative);
}

.damage-delta-single .damage-delta-value.delta-zero {
  color: var(--text-muted);
}

/* v2.4.1 - Hawkwing Summary in Character Stats */
.hawkwing-summary {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.hawkwing-summary h4 {
  color: var(--warning);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.hawkwing-details {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.hawkwing-stat {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.hawkwing-stat strong {
  color: var(--warning);
}

/* v2.4.1 - Combat Uptimes Summary */
.uptime-summary {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.uptime-summary h4 {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.uptime-details {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.uptime-stat {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.uptime-stat strong {
  color: var(--text-primary);
}

/* v2.4.1 - Stat Priority Panel */
.character-priority-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border);
}

.character-priority-panel h3 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.character-priority-panel .panel-description {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.stat-priority-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-priority-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border-radius: var(--radius);
}

.stat-priority-row.top-priority {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  border: 1px solid var(--accent);
}

.priority-rank {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
}

.stat-priority-row.top-priority .priority-rank {
  color: var(--warning);
}

.priority-label {
  font-weight: 500;
  color: var(--text-primary);
}

.priority-value {
  color: var(--positive);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-align: right;
}

.priority-unit {
  color: var(--text-muted);
  font-size: 0.8rem;
  min-width: 60px;
}

/* v2.4.2 - Separate Hawkwing Panel in Character Stats */
.character-hawkwing-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--warning);
}

.character-hawkwing-panel h3 {
  margin-bottom: 0.5rem;
  color: var(--warning);
}

.character-hawkwing-panel .panel-description {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.hawkwing-stats-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hwk-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border-radius: var(--radius);
}

.hwk-row.hwk-row-primary {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  border: 1px solid var(--warning);
}

.hwk-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.hwk-value {
  text-align: right;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.hwk-row.hwk-row-primary .hwk-value {
  color: var(--warning);
  font-size: 1.1rem;
}

.hawkwing-info-note {
  margin-top: 0.75rem;
  text-align: center;
}

.hawkwing-info-note small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* v2.4.2 - Static Settings Display */
.settings-static-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.settings-static-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.setting-static-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border-radius: var(--radius);
}

.setting-static-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.setting-static-value {
  color: var(--text-primary);
  font-weight: 500;
  font-family: var(--font-mono);
}

/* ============================================
   v2.5.0 - Compact Character Stats Layout
   ============================================ */

/* v2.5.1 - Wide layout that fills the screen better */
.character-layout-wide {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.character-header-row {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}

.character-left-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 2;
}

.character-damage-panel-wide,
.character-hawkwing-panel-wide,
.character-ivorybloom-panel-wide {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  flex: 1;
}

.character-set-panel-wide {
  flex: 1;
  align-self: stretch;
}

.character-damage-panel-wide h3,
.character-hawkwing-panel-wide h3,
.character-ivorybloom-panel-wide h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.character-hawkwing-panel-wide h3 {
  color: var(--warning);
}

.character-ivorybloom-panel-wide h3 {
  color: #f0a8c8;
}

.ivory-grid-wide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: center;
}

.ivory-setting-wide {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ivory-label-wide {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.ivory-input-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ivory-input-wide {
  width: 60px;
  padding: 0.35rem 0.5rem;
  font-size: 1rem;
  font-family: var(--font-mono);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-align: center;
}

.ivory-input-wide:focus {
  outline: none;
  border-color: var(--accent);
}

.ivory-suffix {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ivory-stat-wide {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  background: var(--bg-input);
  border-radius: var(--radius);
  text-align: center;
}

.ivory-value-wide {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f0a8c8;
  font-family: var(--font-mono);
}

.ivory-hint {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.damage-display-wide {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.damage-stat-wide {
  display: flex;
  flex-direction: column;
}

.damage-value-wide {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
}

.damage-label-wide {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.damage-details-wide {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

/* 60s Normalized DPS Info */
.damage-60s-info {
  margin-top: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
}

.damage-60s-label {
  color: var(--text-muted);
  white-space: nowrap;
}

.damage-60s-value {
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.damage-60s-warning {
  color: var(--warning);
  font-size: 0.8rem;
  white-space: nowrap;
}

.damage-60s-buffer {
  color: var(--success);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* Skill Breakdown Toggle Button */
.btn-skill-breakdown {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 0.75rem;
  vertical-align: middle;
}

.btn-skill-breakdown:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--accent);
}

.btn-skill-breakdown.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Skill Breakdown Inline Panel */
.skill-breakdown-inline {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 0.75rem;
}

.skill-breakdown-inline h4 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.breakdown-chart {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.breakdown-bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 50px 50px 70px 80px;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
}

.breakdown-bar-row.breakdown-header {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
  margin-bottom: 0.2rem;
}

.breakdown-skill-name {
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breakdown-bar-container {
  height: 18px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.breakdown-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.breakdown-percent {
  text-align: right;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.breakdown-hits {
  text-align: right;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.breakdown-dps {
  text-align: right;
  color: var(--accent-color);
  font-family: var(--font-mono);
  font-weight: 500;
}

.breakdown-damage {
  text-align: right;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 500;
}

.no-breakdown {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

@media (max-width: 600px) {
  .breakdown-bar-row {
    grid-template-columns: 80px 1fr 40px 45px 60px;
  }
  .breakdown-damage {
    display: none;
  }
}

.hwk-grid-wide {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.hwk-stat-wide {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  background: var(--bg-input);
  border-radius: var(--radius);
}

.hwk-stat-wide.hwk-primary {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-input));
  border: 1px solid var(--warning);
}

.hwk-value-wide {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.hwk-stat-wide.hwk-primary .hwk-value-wide {
  color: var(--warning);
  font-size: 1.3rem;
}

.hwk-label-wide {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.character-content-row {
  display: grid;
  grid-template-columns: 1.1fr 0.7fr 1.2fr;
  gap: 1rem;
}

@media (max-width: 1100px) {
  .character-content-row {
    grid-template-columns: 1fr 1fr;
  }
  .character-priority-wide {
    grid-column: span 2;
  }
}

@media (max-width: 700px) {
  .character-header-row {
    grid-template-columns: 1fr;
  }
  .character-content-row {
    grid-template-columns: 1fr;
  }
  .character-priority-wide {
    grid-column: span 1;
  }
}

.character-stats-wide,
.character-attunements-wide,
.character-dmgbonus-wide,
.character-bonuses-combined,
.character-priority-wide {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.character-stats-wide h3,
.character-attunements-wide h3,
.character-dmgbonus-wide h3,
.character-priority-wide h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.character-bonuses-combined {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bonuses-section {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 0.4rem 0.5rem;
}

.bonuses-section h3 {
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
  color: var(--accent);
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.bonuses-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
}

/* For 2-column layout on damage bonuses when screen is wide enough */
.bonuses-grid.damage-bonuses {
  grid-template-columns: 1fr;
}

@media (min-width: 1400px) {
  .bonuses-grid.damage-bonuses {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dmgbonus-grid-wide {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem;
}

.stats-grid-wide {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem;
}

.stat-row-wide {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.5rem;
  background: var(--bg-input);
  border-radius: var(--radius);
  gap: 0.5rem;
}

.stat-label-wide {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: visible;
  text-overflow: ellipsis;
  flex: 1;
}

.stat-input-wide {
  width: 70px !important;
  padding: 0.25rem 0.4rem !important;
  font-size: 0.85rem !important;
  text-align: right;
}

.attune-grid-wide {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.attune-row-wide {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.5rem;
  background: var(--bg-input);
  border-radius: var(--radius);
  gap: 0.5rem;
}

.attune-label-wide {
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex: 1;
}

.attune-input-wide {
  width: 60px !important;
  padding: 0.25rem 0.4rem !important;
  font-size: 0.85rem !important;
  text-align: right;
}

/* Compact stat/attune rows inside bonuses section */
.bonuses-section .stat-row-wide,
.bonuses-section .attune-row-wide {
  padding: 0.2rem 0.35rem;
  gap: 0.3rem;
}

.bonuses-section .stat-label-wide,
.bonuses-section .attune-label-wide {
  font-size: 0.7rem;
}

.bonuses-section .stat-input-wide,
.bonuses-section .attune-input-wide {
  width: 50px !important;
  padding: 0.15rem 0.3rem !important;
  font-size: 0.75rem !important;
}

.stat-priority-scroll-wide {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 350px;
  overflow-y: auto;
}

.priority-row-wide {
  display: grid;
  grid-template-columns: 22px 1fr 50px 60px 50px;
  gap: 0.25rem;
  padding: 0.25rem 0.4rem;
  background: var(--bg-input);
  border-radius: var(--radius);
  align-items: center;
}

.priority-row-wide.top-priority {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-input));
  border-left: 2px solid var(--accent);
}

.priority-row-wide.zero-impact {
  opacity: 0.5;
}

.priority-rank-wide {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.priority-label-wide {
  font-size: 0.75rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.priority-max-wide {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  text-align: right;
}

.effective-value {
  font-size: 0.65rem;
  color: var(--warning);
  font-weight: 500;
  margin-left: 4px;
}

.priority-value-wide {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent);
  text-align: right;
}

.priority-percent-wide {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  text-align: right;
}

/* Priority header row */
.priority-header-row {
  display: grid;
  grid-template-columns: 22px 1fr 50px 60px 50px;
  gap: 0.25rem;
  padding: 0.25rem 0.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.15rem;
}

.priority-header-rank,
.priority-header-label,
.priority-header-max,
.priority-header-dps,
.priority-header-pct {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.priority-header-max {
  color: var(--text-secondary);
  text-align: right;
}

.priority-header-dps {
  color: var(--accent);
  text-align: right;
}

.priority-header-pct {
  text-align: right;
}

/* ============================================
   v2.5.2 - Skill Breakdown Tab
   ============================================ */

.skill-breakdown-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem;
}

.skill-breakdown-header {
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.skill-breakdown-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.breakdown-summary {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.breakdown-summary strong {
  color: var(--text-primary);
}

.skill-breakdown-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.skill-chart-container,
.skill-pie-container {
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
}

.skill-chart-container h3,
.skill-pie-container h3,
.skill-breakdown-table h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

/* Bar Chart */
.skill-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skill-bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 80px;
  gap: 0.75rem;
  align-items: center;
}

.skill-bar-label {
  font-size: 0.8rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-bar-track {
  height: 24px;
  background: var(--bg-input);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.skill-bar-percent {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  text-shadow: 0 0 4px var(--bg-primary);
}

.skill-bar-value {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  text-align: right;
}

/* Pie Chart */
.skill-pie-chart {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.pie-chart-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  box-shadow: 0 2px 8px var(--shadow);
}

.pie-chart-empty {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.skill-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.pie-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.pie-legend-label {
  flex: 1;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pie-legend-percent {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* Breakdown Table */
.skill-breakdown-table {
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
}

.breakdown-table th,
.breakdown-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.85rem;
}

.breakdown-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  border-bottom: 1px solid var(--border);
}

.breakdown-table td {
  border-bottom: 1px solid var(--border);
}

.breakdown-table tr:last-child td {
  border-bottom: none;
}

.breakdown-table tr:hover td {
  background: var(--bg-input);
}

.skill-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* Checkbox styling for combat settings */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

/* Radio group styling for timing mode */
.radio-group {
  display: flex;
  gap: 1rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.setting-row.qi-timing-mode {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-info.calculated-times {
  background: var(--bg-tertiary);
  padding: 0.5rem;
  border-radius: 4px;
  margin-top: 0.5rem;
}

/* ============================================
   v2.5.1 - Gear Compare Grouped Layout
   ============================================ */

.gear-compare-layout-grouped {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: end;
}

/* Make gear slot picker span full width */
.gear-compare-layout-grouped > .gear-slot-picker {
  grid-column: 1 / -1;
  align-self: start;
}

/* Make action buttons span full width and center */
.gear-compare-layout-grouped > .gear-actions-section {
  grid-column: 1 / -1;
}

.gear-compare-left,
.gear-compare-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-self: stretch;
}

.gear-stats-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.gear-stats-section h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Gear Compare stat rows - 4 column layout */
.gear-stats-section .gear-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gear-stats-section .gear-stat-row {
  display: grid;
  grid-template-columns: 1fr 70px 70px 60px;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  background: var(--bg-input);
  border-radius: var(--radius);
  align-items: center;
}

.gear-stats-section .gear-stat-row.gear-stat-header {
  background: transparent;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.gear-stats-section .gear-stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.gear-stats-section .gear-stat-input {
  width: 100%;
  text-align: right;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.2rem 0.35rem;
}

.gear-stats-section .gear-stat-delta {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  text-align: right;
}

/* Gear Compare Action Buttons */
.gear-actions-section {
  display: flex;
  gap: 1rem;
  justify-content: center;
  padding: 1rem;
  margin-top: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.gear-actions-section .btn {
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.gear-actions-section .btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
}

.gear-actions-section .btn-primary:hover {
  background: var(--accent-hover);
}

.gear-actions-section .btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.gear-actions-section .btn-secondary:hover {
  background: var(--bg-input);
  border-color: var(--text-secondary);
}

.gear-damage-summary {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
}

.gear-damage-summary h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.gear-attune-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.gear-attune-section h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

/* Gear Compare Attunement Grid */
.gear-attune-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gear-attune-grid .gear-attune-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 0.75fr;
  gap: 0.5rem;
  align-items: center;
}

.gear-attune-grid .ga-ability {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.gear-attune-grid .ga-input {
  width: 100%;
  text-align: right;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
}

.gear-attune-grid .ga-input:focus {
  outline: none;
  border-color: var(--accent);
}

.gear-attune-grid .ga-delta {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.gear-attune-grid .ga-delta.delta-positive {
  color: var(--positive);
}

.gear-attune-grid .ga-delta.delta-negative {
  color: var(--negative);
}

@media (max-width: 900px) {
  .gear-compare-layout-grouped {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Skill Editor Tab
   ============================================ */

.skill-editor-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
}

.skill-selector-panel,
.skill-details-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.skill-selector-panel h3,
.skill-details-panel h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.skill-filter {
  margin-bottom: 1rem;
}

.skill-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.skill-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 500px;
  overflow-y: auto;
}

.skill-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.skill-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.skill-btn.active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
  font-weight: 600;
}

.skill-btn.modified {
  border-color: var(--warning);
}

.skill-btn.modified.active {
  border-color: var(--accent);
}

.modified-badge {
  font-size: 0.7rem;
  color: var(--warning);
}

.skill-btn.active .modified-badge {
  color: var(--bg-primary);
}

.pending-indicator {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: var(--radius);
  font-weight: 600;
  margin-left: 0.5rem;
}

.skill-editor-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Skill Details Panel */
.skill-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.skill-header h3 {
  margin: 0;
  font-size: 1.1rem;
  word-break: break-word;
}

.modified-indicator {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: var(--warning);
  color: var(--bg-primary);
  border-radius: var(--radius);
  font-weight: 600;
}

/* Damage Preview Section */
.damage-preview-section {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.damage-preview-section h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.damage-preview-section .preview-subtitle {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.damage-preview-settings-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-align: center;
  font-style: italic;
}

.damage-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.damage-preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  background: var(--bg-input);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.damage-preview-item .preview-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.damage-preview-item .preview-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.damage-preview-item.abrasion .preview-value { color: var(--text-muted); }
.damage-preview-item.normal .preview-value { color: var(--text-secondary); }
.damage-preview-item.crit .preview-value { color: var(--accent); }
.damage-preview-item.affinity .preview-value { color: var(--warning); }

.damage-preview-summary {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.total-damage {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.total-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.skill-properties {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.property-group {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 1rem;
}

.property-group h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Buff Section Styles */
.buff-section {
  margin-bottom: 1rem;
}

.buff-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.base-name-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.base-name-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.buff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.buff-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.buff-checkbox-label:hover {
  border-color: var(--accent);
  background: var(--bg-primary);
}

.buff-checkbox-label:has(.buff-checkbox:checked) {
  border-color: var(--success);
  background: rgba(40, 167, 69, 0.1);
}

.buff-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--success);
}

.buff-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.buff-tag {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.buff-note {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.buff-note small {
  display: block;
}

.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.property-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.property-row.property-modified .property-label {
  color: var(--warning);
}

.property-row.property-pending .property-label {
  color: var(--accent);
}

.input-pending {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent);
}

.property-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: help;
}

.property-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-property-input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.skill-property-input:focus {
  outline: none;
  border-color: var(--accent);
}

.skill-property-input[type="number"] {
  max-width: 100px;
}

.skill-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.input-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.base-value {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

.skill-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Custom Skill Creation Section */
.skill-create-section {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.btn-full {
  width: 100%;
}

.skill-create-panel {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border: 1px solid var(--accent);
}

.skill-create-panel h4 {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.skill-create-panel .form-group {
  margin-bottom: 0.75rem;
}

.skill-create-panel .form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.skill-create-panel .form-input,
.skill-create-panel .form-select {
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.skill-create-panel .form-input:focus,
.skill-create-panel .form-select:focus {
  outline: none;
  border-color: var(--accent);
}

.skill-create-panel .form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.skill-create-panel .form-actions .btn {
  flex: 1;
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
}

/* Custom skill badge in skill header */
.custom-skill-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: var(--radius);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Custom skill in skill list */
.skill-btn.is-custom {
  border-left: 3px solid var(--accent);
  padding-left: calc(0.75rem - 2px);
}

.skill-btn.is-custom.active {
  border-left-color: var(--bg-primary);
}

/* Info text for custom skill count */
.skill-info-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .skill-editor-layout {
    grid-template-columns: 1fr;
  }

  .skill-list {
    max-height: 200px;
  }

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

/* ============================================
   v2.6.0 - Armor Set Comparison Panel
   ============================================ */

.character-set-panel-wide {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
}

.character-set-panel-wide h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.set-current-info {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border-radius: var(--radius);
}

.set-bonus-line {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding: 0.2rem 0;
}

.set-bonus-label {
  color: var(--text-muted);
  min-width: 30px;
}

.set-bonus-value {
  color: var(--text-primary);
}

.set-comparison-header {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.set-comp-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.set-comp-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.8;
}

.no-set-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.set-comparison-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.set-comparison-row {
  display: grid;
  grid-template-columns: 20px 1fr 80px 55px;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  background: var(--bg-input);
  border-radius: var(--radius);
  align-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.set-comparison-row:hover {
  background: var(--bg-tertiary);
  transform: translateX(2px);
}

.set-comparison-row.current-set {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-input));
  border-left: 2px solid var(--accent);
  cursor: pointer;
}

.set-comparison-row.current-set:hover {
  transform: translateX(2px);
  background: linear-gradient(135deg, var(--bg-input), var(--bg-tertiary));
}

.set-comparison-row.no-set-row {
  opacity: 0.85;
  border-left: 2px solid var(--text-muted);
}

.set-comparison-row.no-set-row .set-name {
  font-style: italic;
  color: var(--text-muted);
}

.set-comparison-row.no-set-row.current-set {
  border-left: 2px solid var(--accent);
  opacity: 1;
}

.set-comparison-row.no-set-row.current-set .set-name {
  font-style: normal;
  color: var(--text-primary);
}

.set-comparison-row.best-set:not(.current-set) {
  border-left: 2px solid var(--positive);
}

.set-rank {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.set-name {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.set-comparison-row.current-set .set-name {
  font-weight: 600;
}

.set-dps {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  text-align: right;
}

.set-delta {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  text-align: right;
}

.set-delta.positive {
  color: var(--positive);
}

.set-delta.negative {
  color: var(--negative);
}

.set-delta.neutral {
  color: var(--text-muted);
}

/* Armor Set Selector in Combat Settings */
.setting-select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
}

.setting-select:focus {
  outline: none;
  border-color: var(--accent);
}

.armor-set-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.armor-set-option {
  padding: 0.75rem;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.armor-set-option:hover {
  border-color: var(--border-focus);
  background: var(--bg-tertiary);
}

.armor-set-option.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-input));
}

.armor-set-option .set-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.armor-set-option.active .set-name {
  color: var(--accent);
}

.armor-set-option .set-bonus {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.armor-set-option .set-2pc {
  color: var(--text-muted);
}

.armor-set-option .set-4pc {
  color: var(--text-secondary);
  font-style: italic;
}

.setting-description {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.input-suffix {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .armor-set-selector {
    grid-template-columns: 1fr;
  }
}

/* Responsive adjustments for set panel */
@media (max-width: 1200px) {
  .character-header-row {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .character-header-row {
    grid-template-columns: 1fr 1fr;
  }

  .character-hawkwing-panel-wide {
    grid-column: span 2;
  }
}

/* ============================================
   Setup Wizard (First-time User Onboarding)
   ============================================ */

.wizard-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.wizard-modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  max-width: 700px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.wizard-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.wizard-header h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.wizard-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.wizard-content {
  padding: 1.5rem 2rem;
}

.wizard-step h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.wizard-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.wizard-description em {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Wizard Input Group (for base agility, etc.) */
.wizard-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 300px;
  margin: 0 auto;
}

.wizard-input-group label {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
}

.wizard-input {
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  text-align: center;
}

.wizard-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.wizard-input-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

.wizard-set-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.wizard-set-option {
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wizard-set-option:hover {
  border-color: var(--accent);
  background: rgba(74, 222, 128, 0.05);
}

.wizard-set-option.active {
  border-color: var(--accent);
  background: rgba(74, 222, 128, 0.1);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}

.wizard-set-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.wizard-set-bonuses {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wizard-bonus {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.wizard-bonus .bonus-label {
  color: var(--text-muted);
  min-width: 30px;
}

.wizard-2pc .bonus-value {
  color: var(--positive);
}

.wizard-4pc .bonus-value {
  color: var(--text-secondary);
}

.wizard-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.wizard-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

#wizard-continue-btn {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  min-width: 200px;
}

#wizard-continue-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Wizard Inner Ways (Step 2) */
.wizard-inner-ways-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.wizard-inner-way-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
}

.wizard-slot-label {
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent);
  min-width: 1.5rem;
}

.wizard-inner-way-select {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
}

.wizard-inner-way-select:focus {
  outline: none;
  border-color: var(--accent);
}

.wizard-inner-way-select option:disabled {
  color: var(--text-muted);
}

.wizard-inner-way-tier {
  width: 70px;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  cursor: pointer;
}

.wizard-inner-way-tier:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wizard-inner-way-tier:focus {
  outline: none;
  border-color: var(--accent);
}

.wizard-inner-ways-summary {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1rem;
  border-left: 3px solid var(--accent);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wizard-inner-ways-summary .summary-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.wizard-inner-ways-summary .summary-value {
  color: var(--positive);
}

.wizard-buttons {
  display: flex;
  gap: 1rem;
}

#wizard-back-btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

@media (max-width: 600px) {
  .wizard-set-grid {
    grid-template-columns: 1fr;
  }

  .wizard-header,
  .wizard-content,
  .wizard-footer {
    padding: 1rem;
  }
}

/* ============================================
   Import/Export Tab Styles
   ============================================ */

.import-export-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.ie-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.ie-section h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.ie-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.ie-status {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.ie-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ie-status.has-data {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid var(--positive);
  color: var(--positive);
}

.ie-status.no-data {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid var(--warning);
  color: var(--warning);
}

.ie-reset-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ie-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ie-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.ie-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  width: 100%;
}

.ie-input:focus {
  outline: none;
  border-color: var(--accent);
}

.ie-input::placeholder {
  color: var(--text-muted);
}

.ie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

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

.ie-btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

.ie-btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.ie-btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.ie-btn-secondary:hover:not(:disabled) {
  background: var(--border-focus);
}

.ie-btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.ie-btn-outline:hover:not(:disabled) {
  background: rgba(74, 222, 128, 0.1);
}

.ie-btn-danger {
  background: var(--negative);
  color: var(--bg-primary);
}

.ie-btn-danger:hover:not(:disabled) {
  background: #ef4444;
}

.ie-file-input {
  display: none;
}

.ie-file-name {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.ie-preview {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-input);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.ie-preview h4 {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.ie-preview pre {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Profile Export/Import highlight */
.ie-section-highlight {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(74, 222, 128, 0.05) 100%);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.ie-section-highlight h3 {
  color: var(--accent);
}

.ie-profile-info {
  background: var(--bg-input);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.ie-profile-info strong {
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .import-export-layout {
    padding: 0.5rem;
  }

  .ie-section {
    padding: 1rem;
  }
}

/* ============================================
   Simulation Tab Styles
   ============================================ */

.simulation-layout {
  padding: 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

.sim-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.sim-header h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.sim-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 600px;
  margin: 0 auto;
}

.sim-config {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.sim-config-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sim-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.sim-value {
  font-weight: 600;
  color: var(--accent);
}

.sim-input {
  width: 100px;
  padding: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1rem;
  text-align: center;
}

.sim-input:focus {
  outline: none;
  border-color: var(--accent);
}

.sim-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s;
}

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

.sim-btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

.sim-btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.sim-progress {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  text-align: center;
}

.sim-progress-bar {
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.sim-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.1s;
}

.sim-progress-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sim-results {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.sim-results-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.sim-results-header h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.sim-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sim-meta strong {
  color: var(--text-primary);
}

.sim-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.sim-summary-card {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
}

.sim-summary-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.sim-summary-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sim-summary-value.sim-best {
  color: var(--positive);
}

.sim-summary-value.sim-worst {
  color: var(--negative);
}

/* Simulation comparison section */
.sim-comparison {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.sim-comparison h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.sim-comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.sim-comparison-item {
  text-align: center;
}

.sim-comparison-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.sim-comparison-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sim-comparison-value.sim-match {
  color: var(--positive);
}

.sim-comparison-value.sim-low {
  color: var(--negative);
}

.sim-comparison-value.sim-high {
  color: var(--warning);
}

.sim-warning {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  padding: 0.75rem;
  font-size: 0.85rem;
  color: var(--warning);
}

.sim-warning ul {
  margin: 0.5rem 0 0 1.5rem;
  padding: 0;
}

.sim-warning li {
  margin-bottom: 0.25rem;
}

.sim-success {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid var(--positive);
  border-radius: var(--radius);
  padding: 0.75rem;
  font-size: 0.85rem;
  color: var(--positive);
}

.sim-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.sim-table th {
  background: var(--bg-tertiary);
  padding: 0.75rem 0.5rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
}

.sim-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.sim-table tr:last-child td {
  border-bottom: none;
}

.sim-row-highlight {
  background: var(--bg-tertiary);
}

.sim-row-highlight td {
  font-weight: 600;
}

.sim-cell-label {
  font-weight: 500;
}

.sim-cell-dps {
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-mono);
}

.sim-cell-dmg {
  font-family: var(--font-mono);
}

.sim-cell-pct {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.sim-averages {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: var(--radius);
}

.sim-averages h4 {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
}

.sim-avg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.sim-avg-item {
  text-align: center;
}

.sim-avg-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.sim-avg-value {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.sim-dist-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.sim-dist-table th,
.sim-dist-table td {
  padding: 0.5rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.sim-dist-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.sim-dist-label {
  text-align: left;
  font-weight: 500;
}

.sim-dmg-pct {
  color: var(--accent);
  font-weight: 600;
}

.sim-table-wide {
  min-width: 100%;
  font-size: 0.85rem;
}

.sim-table-wide th[colspan] {
  border-bottom: 1px solid var(--border);
}

.sim-table-container {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  clear: both;
}

.sim-table-container .sim-table {
  margin-bottom: 0;
}

.sim-subheader {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.sim-dmg-header {
  color: var(--accent);
}

.sim-dist-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .simulation-layout {
    padding: 0.5rem;
  }

  .sim-config {
    flex-direction: column;
  }

  .sim-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .sim-avg-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sim-table {
    font-size: 0.8rem;
  }

  .sim-table th,
  .sim-table td {
    padding: 0.5rem 0.25rem;
  }
}

/* ============================================
   Buff Manager Styles
   ============================================ */

.buff-manager-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem;
}

.buff-manager-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.buff-manager-header .panel-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.buff-manager-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.buff-section-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.buff-section-panel h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.buff-section-panel .section-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.buff-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.buff-item {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.buff-item.built-in {
  opacity: 0.85;
}

.buff-item.custom {
  border-left: 3px solid var(--accent);
}

.buff-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

.buff-tag {
  background: var(--accent);
  color: var(--bg-primary);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
}

.buff-label {
  font-weight: 500;
}

.buff-short {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.buff-description {
  color: var(--text-secondary);
  font-size: 0.85rem;
  flex: 2;
  min-width: 200px;
}

.buff-actions {
  display: flex;
  gap: 0.5rem;
}

.buff-actions .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.buff-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.buff-empty p {
  margin: 0.25rem 0;
}

.buff-add-btn {
  margin-top: 1rem;
  width: 100%;
}

/* Buff Modal */
.buff-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.buff-modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px var(--shadow);
}

.buff-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.buff-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

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

.buff-modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font-weight: 500;
  font-size: 0.9rem;
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.buff-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  .buff-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .buff-info {
    width: 100%;
  }

  .buff-description {
    width: 100%;
  }

  .buff-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.5rem;
  }

  .buff-modal-content {
      margin: 1rem;
      max-width: calc(100% - 2rem);
    }
}

/* ============================================
   Buff Dropdown and Chips (Skill Editor)
   ============================================ */

/* Applied buffs container */
.applied-buffs-container {
  margin-bottom: 1rem;
}

.no-buffs-applied {
  color: var(--text-muted);
  font-style: italic;
  padding: 0.5rem 0;
}

.applied-buffs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Buff chip (applied buff) */
.applied-buff-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 0.35rem 0.5rem 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.chip-tag {
  background: var(--accent);
  color: var(--bg-primary);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
}

.chip-label {
  color: var(--text-primary);
}

.chip-damage {
  color: var(--positive);
  font-size: 0.8rem;
  font-weight: 500;
}

.chip-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  margin-left: 0.25rem;
}

.chip-remove:hover {
  color: var(--negative);
}

/* Add buff container */
.add-buff-container {
  margin-top: 0.5rem;
}

.add-buff-container label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.buff-search-wrapper {
  position: relative;
  width: 100%;
  max-width: 300px;
}

.buff-search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.buff-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Buff dropdown */
.buff-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px var(--shadow);
}

.buff-dropdown-empty {
  padding: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

.buff-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}

.buff-dropdown-item:hover {
  background: var(--bg-tertiary);
}

.dropdown-tag {
  background: var(--accent);
  color: var(--bg-primary);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
}

.dropdown-label {
  color: var(--text-primary);
  flex: 1;
}

.dropdown-damage {
  color: var(--positive);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Buff damage display in Buff Manager */
.buff-damage {
  color: var(--positive);
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 120px;
}

/* Tag input wrapper for auto-brackets */
.tag-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 0.5rem;
}

.tag-input-wrapper:focus-within {
  border-color: var(--accent);
}

.tag-bracket {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
}

.tag-input {
  background: transparent;
  border: none;
  flex: 1;
  padding: 0.5rem 0.25rem;
}

.tag-input:focus {
  outline: none;
}

@media (max-width: 600px) {
  .applied-buffs-list {
    flex-direction: column;
  }

  .applied-buff-chip {
    width: 100%;
    justify-content: space-between;
  }

  .buff-search-wrapper {
    max-width: 100%;
  }
}

/* ============================================
   Gear Tracker Styles
   ============================================ */

.gear-tracker-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.gear-tracker-panels {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .gear-tracker-panels {
    grid-template-columns: 1fr;
  }
}

.gear-tracker-left,
.gear-tracker-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gear-contribution-panel,
.gear-editor-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border);
}

.gear-contribution-panel h3,
.gear-editor-panel h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.contribution-summary {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
}

.contribution-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contribution-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.contribution-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

.contribution-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contribution-header,
.contribution-row {
  display: grid;
  grid-template-columns: 1fr 100px 80px;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  align-items: center;
}

.contribution-header {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.contribution-row {
  background: var(--bg-input);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  border: 1px solid transparent;
}

.contribution-row:hover {
  background: var(--bg-tertiary);
}

.contribution-row.selected {
  border-color: var(--accent);
  background: var(--bg-tertiary);
}

.contribution-row.no-stats {
  opacity: 0.5;
}

.cont-slot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cont-icon {
  font-size: 1.2rem;
}

.cont-name {
  font-size: 0.9rem;
}

.cont-dps,
.cont-pct {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.cont-dps.positive,
.cont-pct.positive {
  color: var(--positive);
}

.cont-dps.negative,
.cont-pct.negative,
.total-value.negative {
  color: var(--negative);
}

.contribution-total {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem;
  margin-top: 0.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  font-weight: 600;
}

.total-label {
  color: var(--text-secondary);
}

.total-value {
  color: var(--accent);
}

/* Gear Slot Selector */
.gear-slot-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.gear-slot-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.gear-slot-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-focus);
}

.gear-slot-btn.active {
  border-color: var(--accent);
  background: var(--bg-tertiary);
}

.gear-slot-btn.has-stats::after {
  content: '•';
  position: absolute;
  top: 2px;
  right: 4px;
  color: var(--accent);
  font-size: 1.2rem;
}

.gear-slot-btn {
  position: relative;
}

.slot-icon {
  font-size: 1.5rem;
}

/* Gear Name Input */
.gear-name-input {
  margin-bottom: 1rem;
}

.gear-name-input label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.gear-name-input .form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.gear-name-input .form-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Gear Stats Grid - Gear Tracker specific (2 column layout for stats) */
.gear-editor-panel .gear-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gear-editor-panel .gear-stats-grid h4 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.gear-editor-panel .gear-stats-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.5rem;
}

@media (max-width: 600px) {
  .gear-editor-panel .gear-stats-columns {
    grid-template-columns: 1fr;
  }
}

.gear-editor-panel .gear-stat-row {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.25rem 0;
}

.gear-editor-panel .gear-stat-row.has-value .gear-stat-label {
  color: var(--text-primary);
}

.gear-editor-panel .gear-stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.gear-editor-panel .gear-stat-input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: right;
}

.gear-stat-input:focus {
  outline: none;
  border-color: var(--accent);
}

.gear-stat-input::placeholder {
  color: var(--text-muted);
}

/* Gear Attunements Section - Gear Tracker specific */
.gear-attunements-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.gear-attunements-section h4 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.gear-attunements-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.5rem;
}

@media (max-width: 600px) {
  .gear-attunements-grid {
    grid-template-columns: 1fr;
  }
}

.gear-attune-row {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.25rem 0;
}

.gear-attune-row.has-value .gear-attune-label {
  color: var(--text-primary);
}

.gear-attune-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.gear-attune-input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: right;
}

.gear-attune-input:focus {
  outline: none;
  border-color: var(--accent);
}

.gear-attune-input::placeholder {
  color: var(--text-muted);
}

/* Gear Editor Actions */
.gear-editor-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ============================================
   Prominent Gear Slot Picker (GearTracker & GearCompare)
   ============================================ */

.gear-slot-picker-prominent,
.gear-slot-picker {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.gear-slot-picker-prominent h3,
.gear-slot-picker h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.gear-slot-buttons-large,
.gear-slot-buttons {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .gear-slot-buttons-large,
  .gear-slot-buttons {
    grid-template-columns: repeat(4, 1fr);
  }
}

.gear-slot-pick-btn-large,
.gear-slot-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  min-height: 70px;
}

.gear-slot-pick-btn-large:hover,
.gear-slot-pick-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

.gear-slot-pick-btn-large.active,
.gear-slot-pick-btn.active {
  border-color: var(--accent);
  background: var(--bg-tertiary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.gear-slot-pick-btn-large.has-saved,
.gear-slot-pick-btn.has-saved {
  background: rgba(16, 185, 129, 0.1);
}

.gear-slot-pick-btn-large.has-saved.active,
.gear-slot-pick-btn.has-saved.active {
  background: rgba(16, 185, 129, 0.15);
}

.slot-icon-large {
  font-size: 1.75rem;
}

.gear-slot-pick-btn-large .slot-name,
.gear-slot-pick-btn .slot-name {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}

.saved-badge,
.saved-indicator {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.8rem;
  color: var(--positive);
}

/* Gear Load Actions (GearCompare) */
.gear-load-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.saved-gear-name {
  font-weight: 600;
  color: var(--text-primary);
}

.no-saved-gear {
  color: var(--text-muted);
  font-style: italic;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

/* Gear Tracker Panels Layout */
.gear-tracker-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .gear-tracker-panels {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Team Builder Styles
   ============================================ */

.team-builder-panel {
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
}

.team-builder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.team-builder-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.team-selector {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.team-select {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.team-results-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.team-dps-display {
  display: flex;
  flex-direction: column;
}

.team-dps-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.team-dps-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
}

.team-comparison {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

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

.comparison-value {
  font-weight: bold;
  font-size: 1.1rem;
}

.comparison-value.positive {
  color: var(--positive);
}

.comparison-value.negative {
  color: var(--negative);
}

.comparison-dps {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.group-buffs-summary {
  padding: 1rem 1.25rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.group-buffs-summary.empty {
  text-align: center;
  color: var(--text-muted);
}

.group-buffs-summary h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.buff-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.buff-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0.875rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  font-size: 0.875rem;
  border: 1px solid var(--border);
}

.buff-name {
  font-weight: 500;
  color: var(--text-primary);
}

.buff-uptime {
  color: var(--text-muted);
}

.buff-effect {
  color: var(--accent);
}

.no-buffs-hint {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.team-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.team-slot {
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease;
}

.team-slot:hover {
  border-color: var(--border-focus);
}

.team-slot.invalid {
  border-color: var(--negative);
}

.slot-header {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.slot-number {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: 50%;
  font-weight: bold;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.slot-profile-select {
  flex: 1;
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  min-width: 0;
}

.slot-stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.slot-stat {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}

.slot-stat .stat-label {
  color: var(--text-muted);
}

.slot-stat .stat-value {
  color: var(--text-primary);
}

.slot-stat.buffed .stat-value {
  color: var(--accent);
  font-weight: bold;
}

.slot-buff-indicator {
  font-size: 0.75rem;
  color: var(--accent);
  text-align: right;
  margin-top: 0.25rem;
}

.team-warnings {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid var(--negative);
  border-radius: var(--radius);
}

.warning-item {
  display: block;
  color: var(--negative);
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s ease;
}

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

.btn-danger {
  background: var(--negative);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
}

@media (max-width: 768px) {
  .team-results-summary {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .team-slots {
    grid-template-columns: 1fr;
  }
}
