/* 캐릭터 성장 비교 — 히스토리 탭 톤 */

.ehc-page {
  max-width: 1200px;
}

.ehc-shell {
  text-align: left;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.12));
  border-radius: 16px;
  box-shadow: 0 8px 28px var(--shadow-color, rgba(0, 0, 0, 0.08));
  overflow: hidden;
  color: var(--text-primary, #222);
}

.ehc-topbar {
  background: var(--card-bg, #fff);
  border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
  padding: 1.1rem 1.25rem;
}

.ehc-topbar-main {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .ehc-topbar-main {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.ehc-period-wrap {
  position: relative;
  min-width: 0;
  flex: 1 1 auto;
}

.ehc-topbar-period {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  min-width: 0;
}

.ehc-topbar-period-body {
  min-width: 0;
}

.ehc-topbar-kicker {
  display: block;
  color: var(--text-primary, #222);
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.15rem;
  line-height: 1.3;
}

.ehc-topbar-period-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
}

.ehc-topbar-range {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  word-break: keep-all;
}

.ehc-topbar-meta {
  color: var(--text-secondary, #888);
  font-size: 0.8rem;
}

.ehc-period-change {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: rgb(0, 140, 160);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  line-height: 1.3;
}

[data-bs-theme="dark"] .ehc-period-change {
  color: rgb(89, 221, 235);
}

.ehc-period-change:hover:not(:disabled) {
  color: rgb(0, 110, 130);
}

[data-bs-theme="dark"] .ehc-period-change:hover:not(:disabled) {
  color: #b8f4fa;
}

.ehc-period-change:disabled {
  opacity: 0.45;
  cursor: default;
  text-decoration: none;
}

.ehc-period-change[aria-expanded="true"] {
  color: rgb(0, 110, 130);
}

[data-bs-theme="dark"] .ehc-period-change[aria-expanded="true"] {
  color: #b8f4fa;
}

.ehc-period-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 20;
  width: max(100%, 300px);
  min-width: 300px;
  max-width: 360px;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
  background: var(--card-bg, #fff);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

[data-bs-theme="dark"] .ehc-period-panel {
  background: rgb(40, 46, 52);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.ehc-period-panel-hint {
  display: block;
  margin: 0 0 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary, #888);
  line-height: 1.35;
  word-break: keep-all;
}

.ehc-period-panel-hint:empty {
  display: none;
  margin: 0;
}

.ehc-period-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.ehc-period-preset {
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.12));
  background: transparent;
  color: var(--text-secondary, #888);
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}

.ehc-period-preset:hover {
  color: var(--text-primary, #222);
  border-color: rgba(89, 221, 235, 0.45);
}

.ehc-period-preset.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(0, rgb(55, 185, 209), rgb(69, 205, 225));
}

.ehc-period-panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.ehc-period-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary, #888);
}

.ehc-period-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.14));
  border-radius: 8px;
  padding: 0.35rem 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary, #222);
  background: rgba(0, 0, 0, 0.02);
}

[data-bs-theme="dark"] .ehc-period-input {
  background: rgba(0, 0, 0, 0.25);
  color: #eee;
  color-scheme: dark;
}

.ehc-period-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0.7rem;
}

.ehc-period-apply {
  padding: 0.35rem 1rem;
  font-size: 0.82rem;
}

.ehc-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

@media (min-width: 768px) {
  .ehc-toolbar-actions {
    justify-content: flex-end;
    flex: 0 0 auto;
    text-align: right;
  }
}

.ehc-toolbar-actions .ehc-hint {
  flex-basis: 100%;
  margin: 0;
  min-height: 0;
}

.ehc-hint {
  color: var(--text-secondary, #888);
  font-size: 0.78rem;
}

.ehc-btn {
  width: auto;
  padding: 0.45rem 1rem;
  border-radius: 50px;
  border: 2px solid transparent;
  color: #fff;
  font-size: 0.88rem;
  font-weight: bold;
  cursor: pointer;
  line-height: 1.2;
  box-shadow: 0 0 0 1px rgb(108, 119, 133);
  border-bottom: none;
}

.ehc-btn-cyan {
  border-color: rgb(89, 221, 235);
  background: linear-gradient(0, rgb(55, 185, 209), rgb(69, 205, 225));
  text-shadow: 1px 1px 0 rgb(35, 149, 175);
}

.ehc-btn-cyan:hover:not(:disabled) {
  text-shadow: 0 0 3px #fff;
}

.ehc-btn-coral {
  border-color: rgb(232, 120, 100);
  background: linear-gradient(0, rgb(210, 85, 70), rgb(232, 110, 95));
  text-shadow: 1px 1px 0 rgb(160, 55, 45);
}

.ehc-btn-coral:hover:not(:disabled) {
  text-shadow: 0 0 3px #fff;
}

.ehc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ehc-body {
  position: relative;
  padding: 1.6rem 1.35rem 2rem;
}

.ehc-section + .ehc-section {
  margin-top: 2.35rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
}

.ehc-section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.ehc-section-head-main {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  min-width: 0;
}

.ehc-section-index {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgb(0, 150, 170);
  background: rgba(89, 221, 235, 0.14);
  border: 1px solid rgba(89, 221, 235, 0.28);
}

[data-bs-theme="dark"] .ehc-section-index {
  color: rgb(89, 221, 235);
}

.ehc-section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary, #222);
}

.ehc-section-help {
  margin: 0.28rem 0 0;
  color: var(--text-secondary, #888);
  font-size: 0.82rem;
  line-height: 1.4;
}

.ehc-section-head-aside {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.ehc-count-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: rgb(0, 150, 170);
  background: rgba(89, 221, 235, 0.12);
  border: 1px solid rgba(89, 221, 235, 0.28);
}

[data-bs-theme="dark"] .ehc-count-pill {
  color: rgb(89, 221, 235);
}

.ehc-marker-legend {
  gap: 0.55rem;
}

.ehc-marker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary, #888);
}

.ehc-marker-shape {
  width: 0.7rem;
  height: 0.7rem;
  display: inline-block;
  background: rgb(89, 221, 235);
}

.ehc-marker-shape.is-tri {
  width: 0;
  height: 0;
  background: transparent;
  border-left: 0.35rem solid transparent;
  border-right: 0.35rem solid transparent;
  border-bottom: 0.6rem solid rgb(89, 221, 235);
}

.ehc-marker-shape.is-dia {
  transform: rotate(45deg);
  border-radius: 1px;
}

.ehc-marker-shape.is-dot-lg {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: rgb(89, 221, 235);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.ehc-marker-shape.is-star {
  width: auto;
  height: auto;
  background: transparent;
  color: #ffd54a;
  font-size: 0.85rem;
  line-height: 1;
}

.ehc-marker-shape.is-star::before {
  content: '★';
}

/* ---- slots = compare_character_wrap 톤 · 최대 6열 ---- */
.ehc-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: stretch;
}

@media (min-width: 768px) {
  .ehc-slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .ehc-slots {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.ehc-slot {
  position: relative;
  color: white;
  background-color: rgb(67, 78, 85);
  border: 2px solid rgb(100, 120, 129);
  box-shadow: 0 0 0 2px rgb(40, 47, 55);
  border-radius: 0.65em;
  padding: 8px 6px 8px;
  min-height: 210px;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  overflow: hidden;
}

.ehc-slot.is-filled {
  border-color: color-mix(in srgb, var(--ehc-accent, rgb(89, 221, 235)) 45%, rgb(100, 120, 129));
}

.ehc-slot.is-filled:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgb(40, 47, 55), 0 8px 18px rgba(0, 0, 0, 0.22);
}

.ehc-slot.is-editing {
  border-color: rgb(89, 221, 235);
  box-shadow: 0 0 0 2px rgb(40, 47, 55), 0 0 0 4px rgba(89, 221, 235, 0.22);
}

.ehc-slot.is-loading {
  opacity: 0.8;
}

.ehc-slot-color {
  position: absolute;
  top: 0;
  left: 8px;
  right: 8px;
  height: 6px;
  border-radius: 0 0 10px 10px;
}

.ehc-slot-remove {
  position: absolute;
  top: 5px;
  right: 2px;
  z-index: 1;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.ehc-slot-remove:hover {
  color: #fff;
  text-shadow: 0 0 3px #fff;
  background: rgba(255, 255, 255, 0.08);
}

.ehc-slot-thumb-wrap {
  height: 88px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 0 auto 0.25rem;
  width: 100%;
  flex-shrink: 0;
}

.ehc-slot-thumb {
  position: relative;
  height: 88px !important;
  width: auto;
  pointer-events: none;
  object-position: 1px 10px;
}

.ehc-slot-thumb.character_zoom {
  scale: 3;
  object-position: 1px 0px;
  pointer-events: none;
}

.ehc-slot-thumb.is-blank {
  scale: 1;
}

.ehc-slot-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.28rem;
  margin-top: 0px;
  min-height: 102px;
  padding: 4px 2px 0;
  width: 100%;
  flex-shrink: 0;
}

.ehc-slot-nick-pill {
  background-color: rgb(60, 193, 215);
  border-radius: 100px;
  width: 100%;
  max-width: 118px;
  color: white;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.12rem 0.45rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ehc-slot-sub {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.88);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.ehc-slot-sub img {
  height: 11px;
  vertical-align: -1px;
  margin-right: 2px;
}

.ehc-slot-dot {
  margin: 0 0.1rem;
  opacity: 0.65;
}

.ehc-slot-level {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffc107;
}

.ehc-slot-created {
  margin-top: 0.1rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.62);
  font-variant-numeric: tabular-nums;
}

.ehc-slot-mini {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.ehc-slot-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ehc-slot-chip.is-ready {
  background: rgba(102, 217, 139, 0.16);
  border-color: rgba(102, 217, 139, 0.35);
  color: rgb(160, 235, 185);
}

.ehc-slot-info-form {
  align-items: stretch;
  gap: 0.35rem;
}

.ehc-slot-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(40, 47, 55, 0.85);
  color: #fff;
  border-radius: 0.25em;
  padding: 0.4rem 0.45rem;
  font-size: 14px;
  text-align: center;
}

.ehc-slot-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.ehc-slot-input:focus {
  outline: none;
  border-color: rgb(89, 221, 235);
  box-shadow: 0 0 0 2px rgba(89, 221, 235, 0.2);
}

.ehc-slot-search-btn {
  width: 100%;
  border: 2px solid rgb(89, 221, 235);
  background: linear-gradient(0, rgb(55, 185, 209), rgb(69, 205, 225));
  color: white;
  text-shadow: 1px 1px 0 rgb(35, 149, 175);
  box-shadow: 0 0 0 1px rgb(108, 119, 133);
  border-radius: 0.25em;
  font-size: 0.82rem;
  font-weight: bold;
  padding: 0.4rem 0.35rem;
  cursor: pointer;
}

.ehc-slot-search-btn:hover:not(:disabled) {
  text-shadow: 0 0 3px white;
}

.ehc-slot-search-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ehc-slot-status {
  font-size: 0.68rem;
  color: #ff9b9b;
  text-align: center;
  line-height: 1.25;
  margin: 0;
}

.ehc-slot-addcard {
  border-style: dashed;
  border-color: rgb(127, 138, 153);
  background: rgb(67, 78, 85);
  box-shadow: 0 0 0 2px rgb(40, 47, 55);
  color: rgba(255, 255, 255, 0.75);
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  cursor: pointer;
  min-height: 210px;
  user-select: none;
}

.ehc-slot-addcard:hover,
.ehc-slot-addcard:focus {
  outline: none;
  border-color: rgb(89, 221, 235);
  color: #fff;
  background: rgb(67, 78, 85);
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.35);
}

.ehc-slot-addcard-plus {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: rgb(89, 221, 235);
}

.ehc-slot-addcard-label {
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---- metric tabs ---- */
.ehc-metric-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 1.05rem;
  padding: 0.3rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
}

[data-bs-theme="dark"] .ehc-metric-tabs {
  background: rgba(255, 255, 255, 0.03);
}

@media (min-width: 768px) {
  .ehc-metric-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.ehc-metric-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary, #777);
  border-radius: 9px;
  padding: 0.55rem 0.65rem;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
}

.ehc-metric-tab:hover {
  color: var(--text-primary, #222);
  background: rgba(89, 221, 235, 0.08);
}

.ehc-metric-tab.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, rgb(69, 205, 225), rgb(55, 185, 209));
  box-shadow: 0 4px 12px rgba(55, 185, 209, 0.28);
}

@media (max-width: 575.98px) {
  .ehc-toolbar-actions .ehc-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

.ehc-chart-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.35rem 0 0;
}

.ehc-chart-mode[hidden] {
  display: none !important;
}

.ehc-chart-mode-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.ehc-chart-mode-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
}

.ehc-chart-mode-btn:hover {
  color: #fff;
  border-color: rgba(89, 221, 235, 0.55);
}

.ehc-chart-mode-btn.active {
  color: #123;
  border-color: transparent;
  background: linear-gradient(0, rgb(55, 185, 209), rgb(89, 221, 235));
}

.ehc-chart-mode-hint {
  margin: 0 0 0.55rem;
  padding: 0 0.15rem;
  font-size: 0.72rem;
  color: rgba(180, 230, 240, 0.85);
  line-height: 1.35;
}

.ehc-chart-mode-hint[hidden] {
  display: none !important;
}

/* ---- chart ---- */
.ehc-chart-panel {
  position: relative;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(89, 221, 235, 0.08), transparent 28%),
    linear-gradient(rgb(38, 43, 49) 30%, rgb(50, 66, 74));
  border: 2px solid rgb(88, 115, 131);
  box-shadow: 0 0 0 2px rgb(34, 41, 49);
  padding: 0.85rem 0.75rem 0.7rem;
  min-height: 280px;
  color: #ddd;
}

.ehc-chart-panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  padding: 0 0.15rem;
}

.ehc-chart-panel-head-main {
  min-width: 0;
  flex: 1 1 auto;
}

.ehc-chart-panel-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.88);
}

.ehc-chart-series {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
}

.ehc-series-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  max-width: 120px;
}

.ehc-series-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--ehc-series, #59dde1);
}

.ehc-series-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ehc-chart-wrap {
  height: 220px;
  position: relative;
}

@media (min-width: 768px) {
  .ehc-chart-wrap {
    height: 340px;
  }
}

.ehc-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  padding: 1rem;
  text-align: center;
  pointer-events: none;
}

.ehc-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(30, 36, 42, 0.72);
  backdrop-filter: blur(2px);
  border-radius: 12px;
}

.ehc-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(89, 221, 235, 0.25);
  border-top-color: rgb(89, 221, 235);
  border-radius: 50%;
  animation: ehc-spin 0.8s linear infinite;
}

.ehc-loading-text {
  font-size: 0.85rem;
  color: #ddd;
}

@keyframes ehc-spin {
  to { transform: rotate(360deg); }
}

/* ---- summary dashboard ---- */
.ehc-summary-list {
  display: block;
}

.ehc-empty-block {
  text-align: center;
  color: var(--text-secondary, #888);
  padding: 1.6rem 0.75rem;
  border: 1px dashed var(--border-color, rgba(0, 0, 0, 0.12));
  border-radius: 12px;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.015);
}

.ehc-dash-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

@media (min-width: 992px) {
  .ehc-dash-overview {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.ehc-dash-kpi {
  position: relative;
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), transparent);
  overflow: hidden;
}

[data-bs-theme="dark"] .ehc-dash-kpi {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
}

.ehc-dash-kpi::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #94a3b8;
}

.ehc-dash-kpi.is-cyan::before { background: rgb(89, 221, 235); }
.ehc-dash-kpi.is-green::before { background: rgb(102, 217, 139); }
.ehc-dash-kpi.is-amber::before { background: #f0c14b; }

.ehc-dash-kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-secondary, #888);
  text-transform: uppercase;
}

.ehc-dash-kpi-value {
  margin-top: 0.35rem;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary, #222);
}

.ehc-dash-kpi.is-cyan .ehc-dash-kpi-value { color: rgb(0, 175, 200); }
.ehc-dash-kpi.is-green .ehc-dash-kpi-value { color: rgb(40, 167, 69); }
.ehc-dash-kpi.is-amber .ehc-dash-kpi-value { color: #c79100; }

[data-bs-theme="dark"] .ehc-dash-kpi.is-cyan .ehc-dash-kpi-value { color: rgb(89, 221, 235); }
[data-bs-theme="dark"] .ehc-dash-kpi.is-green .ehc-dash-kpi-value { color: rgb(102, 217, 139); }
[data-bs-theme="dark"] .ehc-dash-kpi.is-amber .ehc-dash-kpi-value { color: #f0c14b; }

.ehc-dash-kpi-unit {
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 0.15rem;
  opacity: 0.7;
}

.ehc-dash-kpi-sub {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary, #888);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ehc-dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .ehc-dash-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ehc-dash-card {
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
  border-radius: 14px;
  background: var(--card-bg, #fff);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

[data-bs-theme="dark"] .ehc-dash-card {
  background: rgba(255, 255, 255, 0.025);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.ehc-dash-card-top {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.9rem 0.95rem;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ehc-accent, #59dde1) 18%, transparent), transparent 70%);
  border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
}

.ehc-dash-card-profile {
  display: flex;
  gap: 0.65rem;
  min-width: 0;
  align-items: flex-start;
  flex: 1 1 auto;
}

.ehc-dash-card-thumb-wrap {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgb(67, 78, 85);
  border: 1px solid rgba(100, 120, 129, 0.8);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.ehc-dash-card-thumb {
  height: 52px;
  width: auto;
  pointer-events: none;
  object-position: 1px -2px;
}

.ehc-dash-card-thumb.character_zoom {
  scale: 3;
  object-position: 1px -2px;
}

.ehc-dash-card-meta {
  min-width: 0;
}

.ehc-dash-card-nick {
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--ehc-accent, #59dde1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ehc-dash-card-sub {
  font-size: 0.75rem;
  color: var(--text-secondary, #888);
  margin-top: 0.1rem;
}

.ehc-dash-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  margin-top: 0.35rem;
  max-width: 100%;
}

.ehc-dash-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.35;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary, #666);
}

.ehc-dash-badge.is-cyan {
  background: rgba(89, 221, 235, 0.16);
  color: rgb(0, 150, 170);
}

.ehc-dash-badge.is-green {
  background: rgba(102, 217, 139, 0.16);
  color: rgb(30, 140, 60);
}

.ehc-dash-badge.is-amber {
  background: rgba(240, 193, 75, 0.18);
  color: #a87800;
}

[data-bs-theme="dark"] .ehc-dash-badge.is-cyan { color: rgb(89, 221, 235); }
[data-bs-theme="dark"] .ehc-dash-badge.is-green { color: rgb(102, 217, 139); }
[data-bs-theme="dark"] .ehc-dash-badge.is-amber { color: #f0c14b; }

.ehc-dash-card-now {
  flex: 0 0 auto;
  min-width: 88px;
  text-align: right;
  padding-top: 0.1rem;
}

.ehc-dash-card-now-label {
  font-size: 0.68rem;
  color: var(--text-secondary, #888);
  font-weight: 700;
  text-transform: uppercase;
}

.ehc-dash-card-now-value {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
  margin-top: 0.1rem;
}

.ehc-dash-card-now-rate {
  font-size: 0.78rem;
  color: #ffc107;
  font-weight: 700;
}

[data-bs-theme="dark"] .ehc-dash-card-now-rate {
  color: #ffc107;
}

.ehc-dash-progress {
  margin-top: 0.35rem;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

[data-bs-theme="dark"] .ehc-dash-progress {
  background: rgba(255, 255, 255, 0.1);
}

.ehc-dash-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #e0a800, #ffc107, #ffda6a);
}

.ehc-dash-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.85rem 0.9rem 0.95rem;
}

.ehc-dash-metric {
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.07));
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  background: rgba(0, 0, 0, 0.015);
}

[data-bs-theme="dark"] .ehc-dash-metric {
  background: rgba(255, 255, 255, 0.03);
}

.ehc-dash-metric-wide {
  grid-column: 1 / -1;
}

.ehc-dash-metric-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary, #888);
  margin-bottom: 0.2rem;
}

.ehc-dash-metric-value {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-primary, #222);
  line-height: 1.3;
  word-break: break-word;
}

.ehc-dash-metric-value.is-cyan { color: rgb(0, 175, 200); }
.ehc-dash-metric-value.is-green { color: rgb(40, 167, 69); }
.ehc-dash-metric-value.is-amber { color: #c79100; }

[data-bs-theme="dark"] .ehc-dash-metric-value.is-cyan { color: rgb(89, 221, 235); }
[data-bs-theme="dark"] .ehc-dash-metric-value.is-green { color: rgb(102, 217, 139); }
[data-bs-theme="dark"] .ehc-dash-metric-value.is-amber { color: #f0c14b; }

.ehc-dash-muted {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #888);
}

.ehc-dash-metric-inline {
  font-size: 0.95rem;
}

.ehc-dash-activity {
  margin-top: 0.45rem;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.ehc-dash-activity-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgb(55, 185, 209), rgb(102, 217, 139));
}

.ehc-dash-activity-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: var(--text-secondary, #888);
}

/* ---- growth compare panels ---- */
.ehc-compare-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .ehc-compare-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ehc-compare-card-radar,
  .ehc-compare-card-heat {
    grid-column: span 3;
  }
}

@media (min-width: 992px) {
  .ehc-compare-card-radar {
    grid-column: span 1;
  }

  .ehc-compare-card-heat {
    grid-column: span 2;
  }
}

.ehc-compare-card {
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.015);
  padding: 0.9rem 0.95rem 1rem;
  min-width: 0;
}

[data-bs-theme="dark"] .ehc-compare-card {
  background: rgba(255, 255, 255, 0.03);
}

.ehc-compare-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.ehc-compare-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.3;
}

.ehc-compare-card-help {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: var(--text-secondary, #888);
  line-height: 1.4;
}

.ehc-pace-winner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.4rem;
  margin-top: 0.45rem;
  min-height: 1.35rem;
  font-size: 0.82rem;
}

.ehc-pace-winner.is-compact {
  margin-top: 0.35rem;
  margin-bottom: 0.15rem;
}

.ehc-pace-winner strong {
  font-weight: 800;
}

.ehc-pace-winner-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  background: var(--ehc-accent, rgb(89, 221, 235));
}

.ehc-pace-winner-value {
  font-weight: 800;
  color: rgb(0, 150, 170);
  font-variant-numeric: tabular-nums;
}

[data-bs-theme="dark"] .ehc-pace-winner-value {
  color: rgb(89, 221, 235);
}

.ehc-pace-winner-muted {
  color: var(--text-secondary, #888);
  font-size: 0.74rem;
  font-weight: 600;
}

.ehc-compare-chart-wrap {
  position: relative;
  margin-top: 0.55rem;
  width: 100%;
}

.ehc-compare-chart-wrap.is-bar {
  height: 150px;
}

.ehc-compare-chart-wrap.is-radar {
  height: 300px;
}

.ehc-heatmap {
  margin-top: 0.7rem;
  overflow-x: auto;
}

.ehc-heatmap-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary, #888);
}

.ehc-heatmap-legend-bar {
  width: 64px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 99, 71, 0.15), rgba(255, 99, 71, 0.95));
}

.ehc-heatmap-table {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 440px;
}

.ehc-heatmap-row {
  display: grid;
  grid-template-columns: minmax(5rem, 7rem) repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: stretch;
}

.ehc-heatmap-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary, #222);
}

.ehc-heatmap-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ehc-heatmap-label i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ehc-heatmap-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  border-radius: 9px;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary, #222);
  border: 1px solid rgba(255, 99, 71, 0.2);
  background: rgba(255, 99, 71, 0.08);
}

.ehc-heatmap-cell.is-best {
  box-shadow: inset 0 0 0 2px rgba(255, 99, 71, 0.75);
  font-weight: 800;
}

.ehc-heatmap-cell.is-head {
  border: 0;
  background: transparent;
  color: var(--text-secondary, #888);
  font-size: 0.7rem;
  min-height: 1.35rem;
}

.ehc-heatmap-cell.is-empty {
  color: var(--text-secondary, #aaa);
  background: rgba(0, 0, 0, 0.03);
  border-color: transparent;
  font-weight: 600;
}

[data-bs-theme="dark"] .ehc-heatmap-cell {
  color: #e8e8e8;
}

[data-bs-theme="dark"] .ehc-heatmap-cell.is-best {
  box-shadow: inset 0 0 0 2px rgba(255, 99, 71, 0.9);
}

[data-bs-theme="dark"] .ehc-heatmap-cell.is-empty {
  background: rgba(255, 255, 255, 0.04);
  color: #888;
}

[data-bs-theme="dark"] .ehc-heatmap-label {
  color: #eee;
}
