:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef2f4;
  --surface-strong: #e3e8eb;
  --text: #171d24;
  --muted: #66717d;
  --subtle: #8a949f;
  --border: #d9e1e7;
  --accent: #16885f;
  --accent-strong: #0f6f4c;
  --accent-soft: #dcefe7;
  --amber: #a66e1d;
  --amber-soft: #f4ead8;
  --red: #b0413e;
  --red-soft: #f3dfdd;
  --blue: #246fb8;
  --blue-soft: #dce8f5;
  --green: #23744c;
  --green-soft: #dceee4;
  --shadow: 0 1px 2px rgba(20, 30, 40, 0.05);
  --radius: 8px;
  --sidebar-width: 248px;
  font-family:
    Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121416;
  --surface: #191c1f;
  --surface-soft: #202529;
  --surface-strong: #2a3035;
  --text: #eceff1;
  --muted: #a7b0b8;
  --subtle: #7e8993;
  --border: #303941;
  --accent: #62c99b;
  --accent-strong: #96e0bc;
  --accent-soft: #17392b;
  --amber: #d7a35c;
  --amber-soft: #3a2b18;
  --red: #e27a74;
  --red-soft: #3b201f;
  --blue: #7eb8f0;
  --blue-soft: #182c40;
  --green: #79c798;
  --green-soft: #1d3428;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  flex: 0 0 auto;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav-stack {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav-item.is-active {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.sidebar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
}

.content {
  min-width: 0;
  padding: 20px clamp(16px, 3vw, 34px) 42px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 0 20px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
}

.global-search,
.compact-search {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.global-search {
  width: min(720px, 100%);
  height: 48px;
  padding: 0 6px 0 14px;
}

.compact-search {
  width: min(320px, 100%);
  height: 42px;
  padding: 0 12px;
}

.global-search svg,
.compact-search svg {
  width: 18px;
  height: 18px;
  color: var(--subtle);
}

.global-search input,
.compact-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.global-search input {
  padding: 0 12px;
}

.compact-search input {
  padding: 0 0 0 10px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.command-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.command-button {
  flex: 0 0 auto;
  min-width: 64px;
  padding: 0 14px;
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
  white-space: nowrap;
}

.command-button:hover {
  background: var(--accent-strong);
}

.command-button svg {
  width: 17px;
  height: 17px;
}

.icon-button {
  width: 42px;
  height: 42px;
}

.icon-button:hover {
  background: var(--surface-soft);
}

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

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h1,
.panel-card h2,
.player-panel h2,
.stat-card h2 {
  margin: 0;
  letter-spacing: 0;
}

.section-heading h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pill,
.mini-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-layout,
.analytics-grid,
.calculator-layout,
.settings-grid {
  display: grid;
  gap: 14px;
}

.profile-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  align-items: start;
}

.analytics-grid,
.calculator-layout,
.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.player-panel,
.panel-card,
.stat-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.player-panel {
  padding: clamp(18px, 2vw, 24px);
}

.player-panel.emphasis {
  background: var(--surface);
}

.player-panel.tone-good {
  border-color: color-mix(in srgb, var(--green) 32%, var(--border));
}

.player-panel.tone-warning {
  border-color: color-mix(in srgb, var(--amber) 36%, var(--border));
}

.player-panel.tone-danger {
  border-color: color-mix(in srgb, var(--red) 36%, var(--border));
}

.player-title-row,
.panel-card-head,
.stat-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 20px;
  font-weight: 900;
}

.rank-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 18px;
  font-weight: 900;
}

.rank-avatar.grade-avatar {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.rank-avatar img,
.grade-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.rank-avatar.grade-avatar .grade-icon {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.18));
}

.grade-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.analysis-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface));
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.analysis-notice.is-danger {
  border-color: color-mix(in srgb, var(--red) 30%, var(--border));
  background: var(--red-soft);
  color: var(--red);
}

.analysis-notice svg {
  width: 16px;
  height: 16px;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.player-name h2 {
  overflow-wrap: anywhere;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.15;
}

.player-name p,
.stat-card p,
.panel-card p {
  margin: 0;
}

.player-name p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.summary-metrics,
.stat-metrics,
.result-grid {
  display: grid;
  gap: 10px;
}

.summary-metrics {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  margin-top: 22px;
}

.metric,
.result-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.metric span,
.result-card span,
.meta-line span,
.trend-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong,
.result-card strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.15;
}

.archetype-title {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(22px, 2.3vw, 30px);
  line-height: 1.18;
}

.archetype-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.evidence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.evidence-list .mini-pill {
  background: var(--surface-soft);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.weapon-stat-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.weapon-stat-row {
  display: grid;
  grid-template-columns: minmax(64px, 0.8fr) minmax(78px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.weapon-stat-row strong {
  font-size: 13px;
}

.weapon-stat-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stat-card {
  padding: 18px;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 900;
}

.rank-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tier-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.tier-icon-placeholder {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
}

.tier-icon-placeholder svg {
  width: 18px;
  height: 18px;
}

.score-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.stat-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.panel-card {
  padding: 18px;
}

.panel-card h2,
.stat-card h2 {
  font-size: 18px;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.trend-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.trend-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.trend-stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.trend-stat strong {
  font-size: 18px;
}

.trend-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 900;
}

.trend-status svg,
.movement svg {
  width: 18px;
  height: 18px;
}

.trend-status strong {
  font-size: 22px;
}

.trend-status span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.sparkline {
  width: 100%;
  height: 58px;
  margin-top: 12px;
}

.sparkline path,
.trend-mini path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline .spark-fill,
.trend-mini .spark-fill {
  fill: color-mix(in srgb, var(--accent) 18%, transparent);
  stroke: none;
}

.map-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.map-row {
  display: grid;
  grid-template-columns: minmax(108px, 0.85fr) minmax(120px, 1fr) 54px;
  align-items: center;
  gap: 12px;
}

.map-title {
  min-width: 0;
}

.map-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-title small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.map-rate {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.match-history-panel {
  margin-top: 14px;
}

.match-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.match-row {
  display: grid;
  grid-template-columns: 42px minmax(170px, 1fr) minmax(118px, 0.72fr) repeat(3, minmax(76px, 0.46fr));
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.match-result-badge {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-weight: 900;
}

.match-row.is-win .match-result-badge {
  background: var(--red-soft);
  color: var(--red);
}

.match-row.is-loss .match-result-badge {
  background: var(--blue-soft);
  color: var(--blue);
}

.match-main,
.match-stat {
  min-width: 0;
}

.match-main strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-main span,
.match-stat span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-stat strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.match-stat.kda strong {
  font-size: 15px;
}

.calculator-form,
.market-form {
  display: grid;
  gap: 12px;
}

.calculator-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.calculator-form label,
.market-form label {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.calculator-form span,
.market-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.calculator-form input,
.market-form input {
  width: 100%;
  min-height: 42px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: 0;
  background: var(--surface-soft);
  color: var(--text);
}

.calculator-form input:focus,
.market-form input:focus,
.global-search:focus-within,
.compact-search:focus-within {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: 1px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.segmented button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.segmented button.is-active {
  background: var(--surface);
  color: var(--accent-strong);
}

.result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.result-card.is-good {
  background: var(--green-soft);
  color: var(--green);
}

.result-card.is-warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.result-card.is-bad {
  background: var(--red-soft);
  color: var(--red);
}

.market-form {
  grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(120px, 0.7fr)) auto;
  align-items: end;
  margin-top: 16px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.market-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.market-table th,
.market-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.market-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.market-table tr:last-child td {
  border-bottom: 0;
}

.market-table td {
  color: var(--text);
  font-size: 14px;
}

.market-table .number {
  font-variant-numeric: tabular-nums;
}

.change-up {
  color: var(--red);
  font-weight: 800;
}

.change-down {
  color: var(--blue);
  font-weight: 800;
}

.movement {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 900;
}

.movement.is-up,
.trend-status.is-up {
  color: var(--red);
}

.movement.is-down,
.trend-status.is-down {
  color: var(--blue);
}

.movement.is-flat,
.trend-status.is-flat {
  color: var(--muted);
}

.trend-mini {
  width: 96px;
  height: 34px;
}

.delete-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.delete-button:hover {
  color: var(--red);
  background: var(--red-soft);
}

.delete-button svg {
  width: 16px;
  height: 16px;
}

.setting-list,
.ops-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.radio-row,
.ops-list div {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.radio-row input {
  margin-top: 3px;
}

.radio-row span,
.ops-list div {
  min-width: 0;
}

.radio-row strong,
.radio-row small,
.ops-list strong,
.ops-list span {
  display: block;
  overflow-wrap: anywhere;
}

.radio-row small,
.ops-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.radio-row.is-muted {
  opacity: 0.72;
}

.api-key-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.api-key-box label {
  display: grid;
  gap: 7px;
}

.api-key-box[data-mode="proxy"] label {
  display: none;
}

.api-key-box label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.api-key-box input {
  width: 100%;
  min-height: 42px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: 0;
  background: var(--surface-soft);
  color: var(--text);
}

.api-key-box input:focus {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: 1px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}

.ghost-button:hover {
  background: var(--surface-soft);
}

.settings-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-status[data-tone="success"] {
  color: var(--green);
  font-weight: 800;
}

.settings-status[data-tone="danger"] {
  color: var(--red);
  font-weight: 800;
}

.empty-state {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.span-all {
  grid-column: 1 / -1;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 0.92em;
}

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

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .brand {
    flex: 0 0 auto;
  }

  .nav-stack {
    display: flex;
    flex: 1 0 auto;
  }

  .nav-item {
    width: auto;
    white-space: nowrap;
  }

  .sidebar-meta {
    display: none;
  }

  .topbar {
    top: 0;
  }

  .profile-layout,
  .analytics-grid,
  .calculator-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .content {
    padding: 14px 12px 30px;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    align-self: flex-end;
  }

  .global-search {
    width: 100%;
  }

  .summary-metrics,
  .stat-grid,
  .stat-metrics,
  .trend-grid,
  .calculator-form,
  .result-grid,
  .market-form {
    grid-template-columns: 1fr;
  }

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

  .profile-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel-card-head,
  .player-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }

  .map-row {
    grid-template-columns: minmax(90px, 0.8fr) minmax(90px, 1fr) 48px;
    gap: 8px;
  }

  .match-row {
    grid-template-columns: 38px minmax(0, 1fr) minmax(94px, 0.58fr);
  }

  .match-stat:not(.kda) {
    display: none;
  }
}

@media (max-width: 500px) {
  .sidebar {
    gap: 12px;
  }

  .brand small {
    display: none;
  }

  .nav-item span {
    display: none;
  }

  .nav-item {
    width: 42px;
    justify-content: center;
    padding: 0;
  }

  .command-button {
    min-width: 60px;
    padding: 0 10px;
  }

  .global-search {
    height: auto;
    min-height: 48px;
  }

  .global-search input {
    padding: 10px;
  }

  .avatar,
  .rank-avatar {
    width: 44px;
    height: 44px;
  }

  .match-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .match-stat.kda {
    grid-column: 2;
  }
}
