:root {
  --bg: #111418;
  --surface: #181c21;
  --surface-2: #20252c;
  --surface-3: #292f37;
  --line: #343b45;
  --line-strong: #4a535f;
  --text: #f3f5f7;
  --muted: #a6afb9;
  --faint: #747f8b;
  --accent: #f0b64a;
  --accent-ink: #201805;
  --blue: #62aef7;
  --green: #61d1ad;
  --red: #ee6c73;
  --purple: #b392f0;
  --normal: #c9ced4;
  --rare: #59b7f2;
  --epic: #aa7ee8;
  --unique: #f2a43a;
  --legendary: #55d4aa;
  --sidebar-width: 176px;
  --topbar-height: 58px;
  color-scheme: dark;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
}

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

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) auto;
  min-height: var(--topbar-height);
  border-bottom: 1px solid var(--line);
  background: rgba(17, 20, 24, 0.96);
  backdrop-filter: blur(10px);
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #d79c32;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 900;
}

.quick-status {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  padding: 0 18px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.quick-status strong {
  color: var(--text);
}

.quick-status.has-action-error {
  color: var(--red);
}

.quick-action-error {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}

.text-link {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.text-link:hover {
  color: var(--text);
}

.sidebar {
  position: sticky;
  top: var(--topbar-height);
  align-self: start;
  height: calc(100vh - var(--topbar-height));
  border-right: 1px solid var(--line);
  background: #15191e;
}

.primary-nav {
  display: grid;
  gap: 2px;
  padding: 14px 10px;
}

.primary-nav button {
  min-height: 39px;
  padding: 0 12px;
  border-left: 3px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}

.primary-nav button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.primary-nav button.is-active {
  border-left-color: var(--accent);
  background: #252a30;
  color: var(--text);
  font-weight: 700;
}

.main-content {
  min-width: 0;
  min-height: calc(100vh - var(--topbar-height));
  padding: 24px clamp(18px, 3vw, 44px) 64px;
  outline: none;
}

.page {
  width: min(1440px, 100%);
  min-width: 0;
  margin: 0 auto;
}

.page-head {
  display: flex;
  min-height: 46px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.page-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.head-actions,
.toolbar,
.button-row,
.segmented {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.head-action-stack {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.section {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

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

.section-head h2,
.section h2 {
  margin: 0;
  font-size: 15px;
}

.section-copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.button,
.icon-button,
.segmented button,
.menu-grid button {
  position: relative;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-weight: 650;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.button {
  padding: 0 14px;
  white-space: nowrap;
}

.button:hover,
.icon-button:hover,
.segmented button:hover,
.menu-grid button:hover {
  border-color: #697480;
  background: var(--surface-3);
}

.button:active,
.icon-button:active,
.segmented button:active,
.menu-grid button:active {
  background: #171b20;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
  transform: translateY(1px);
}

.button:disabled,
.icon-button:disabled,
.segmented button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.button-primary:hover {
  border-color: #ffd078;
  background: #f6c45e;
}

.button-danger {
  border-color: #a84d54;
  background: #6d3036;
  color: #fff;
}

.button-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.icon-button {
  width: 36px;
  padding: 0;
  font-size: 20px;
}

.segmented {
  gap: 0;
}

.segmented button {
  min-width: 72px;
  border-radius: 0;
  margin-left: -1px;
  padding: 0 12px;
}

.segmented button:first-child {
  margin-left: 0;
  border-radius: 5px 0 0 5px;
}

.segmented button:last-child {
  border-radius: 0 5px 5px 0;
}

.segmented button.is-active {
  position: relative;
  z-index: 1;
  border-color: var(--accent);
  background: #47391d;
  color: #ffd782;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span,
.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.input,
.select {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: none;
  background: #14181d;
  padding: 0 11px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.input:focus,
.select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(98, 174, 247, 0.17);
}

.search-input {
  min-width: min(280px, 100%);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.master-pane {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
  min-width: 0;
}

.master-tools {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.picker-heading {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.picker-heading strong {
  color: var(--text);
  font-size: 12px;
}

.filter-reset {
  width: 26px;
  height: 26px;
  display: grid;
  margin-left: auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 17px;
}

.filter-reset:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.master-list {
  max-height: calc(100vh - 238px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  scrollbar-gutter: stable;
}

.master-row {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid #2a3037;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background-color 150ms ease, box-shadow 150ms ease, color 150ms ease;
}

.master-row:last-child {
  border-bottom: 0;
}

.master-row:hover {
  background: #20252b;
}

.master-row.is-selected {
  background: #292f35;
  box-shadow: inset 0 0 0 1px #58616c;
}

.rarity-bar {
  align-self: stretch;
  background: var(--normal);
}

.rarity-bar[data-rarity="rare"] { background: var(--rare); }
.rarity-bar[data-rarity="epic"] { background: var(--epic); }
.rarity-bar[data-rarity="unique"] { background: var(--unique); }
.rarity-bar[data-rarity="legendary"] { background: var(--legendary); }

.row-main {
  min-width: 0;
}

.row-title {
  display: block;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.row-title b {
  color: var(--accent);
  font-weight: 800;
}

.row-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.empty-list {
  min-height: 150px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.row-side {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.detail-pane {
  min-width: 0;
}

.operation-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #1a1f24;
  padding: 14px 16px;
}

.operation-metrics {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0;
}

.operation-metrics > div {
  min-width: 112px;
  padding: 0 16px;
  border-left: 1px solid var(--line);
}

.operation-metrics > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.operation-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.operation-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.operation-bar .button-row,
.operation-bar .button-row .button {
  min-width: 0;
}

.equipment-operation .button-row {
  justify-content: flex-end;
}

.craft-operation.is-unavailable {
  border-color: #734047;
  background: #21191c;
}

.empty-state {
  min-height: 240px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.detail-header > div {
  min-width: 0;
}

.detail-header h2 {
  margin: 0;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.detail-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.stat-grid,
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.stat-cell,
.summary-cell {
  min-width: 0;
  background: var(--surface);
  padding: 14px;
}

.stat-cell span,
.summary-cell span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.stat-cell strong,
.summary-cell strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.profile-band {
  display: grid;
  grid-template-columns: minmax(250px, 1.4fr) repeat(3, minmax(120px, 0.55fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.profile-identity,
.profile-metric {
  background: var(--surface);
  padding: 18px;
}

.profile-identity h1 {
  margin: 0;
  font-size: 22px;
}

.profile-identity p,
.profile-metric span {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.profile-identity .profile-job-description {
  max-width: 68ch;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.profile-metric strong {
  display: block;
  margin-top: 7px;
  font-size: 18px;
}

.progress-track,
.hp-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  margin-top: 10px;
  border-radius: 3px;
  background: #0f1216;
}

.progress-track > span,
.hp-track > span {
  display: block;
  height: 100%;
  background: var(--blue);
  transition: width 420ms ease, background-color 220ms ease;
}

.hp-track > span {
  background: var(--red);
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.action-tile,
.entity-card,
.result-panel,
.boss-combat,
.potential-candidate {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.action-tile {
  min-height: 126px;
  display: grid;
  align-content: space-between;
  gap: 16px;
  padding: 16px;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.action-tile:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  box-shadow: inset 3px 0 0 var(--accent);
}

.action-tile:active {
  background: #14181c;
  box-shadow: inset 3px 0 0 var(--accent), inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

.action-tile strong {
  font-size: 15px;
}

.action-tile span {
  color: var(--muted);
  font-size: 12px;
}

.tag,
.status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}

.tag[data-rarity="normal"] { color: var(--normal); }
.tag[data-rarity="rare"] { color: var(--rare); }
.tag[data-rarity="epic"] { color: var(--epic); }
.tag[data-rarity="unique"] { color: var(--unique); }
.tag[data-rarity="legendary"] { color: var(--legendary); }
.status-pill.success { border-color: #347c67; color: var(--green); }
.status-pill.warning { border-color: #826829; color: #ffd277; }
.status-pill.danger { border-color: #8c4249; color: #ff9da2; }

.entity-list,
.skill-list,
.material-list,
.log-list {
  display: grid;
  gap: 8px;
}

.entity-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.entity-card > div,
.entity-card > label {
  min-width: 0;
}

.entity-card h3 {
  margin: 0;
  font-size: 14px;
}

.entity-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.entity-card.is-equipped {
  border-color: #47765f;
  background: #18241f;
}

.entity-card.is-missing {
  border-color: #734047;
  background: #21191c;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.check-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.skill-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.skill-row-static {
  grid-template-columns: minmax(0, 1fr) auto;
}

.skill-row:last-child {
  border-bottom: 0;
}

.skill-row h3 {
  margin: 0;
  font-size: 14px;
}

.skill-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.passive-description {
  white-space: pre-line;
}

.passive-row {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.passive-row:last-child {
  border-bottom: 1px solid var(--line);
}

.ability-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(128px, 0.45fr);
  gap: 8px;
  width: min(100%, 520px);
}

.skill-copy {
  min-width: 0;
}

.skill-effect,
.skill-note {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.skill-note {
  color: #c9a962 !important;
}

.skill-row.is-equipped {
  box-shadow: inset 3px 0 0 var(--green);
  background: #17221e;
}

.result-panel,
.boss-combat {
  padding: 16px;
}

.boss-page,
.boss-combat,
.combat-main,
.combat-sidebar,
.vital-block,
.ability-button {
  min-width: 0;
  max-width: 100%;
}

.result-panel h3,
.boss-combat h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.result-panel pre,
.combat-copy {
  margin: 0;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.compact-copy {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.boss-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.boss-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.boss-name-line h2 {
  margin: 0;
  font-size: 20px;
}

.boss-hp {
  margin: 18px 0 12px;
}

.vital-block {
  min-width: 0;
}

.vital-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.vital-label strong {
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.vital-label small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.vital-block .hp-track {
  height: 11px;
  margin-top: 8px;
  border: 1px solid #303740;
  border-radius: 5px;
}

.boss-health > span {
  background: var(--red);
}

.player-health.healthy > span {
  background: var(--green);
}

.player-health.warning > span {
  background: var(--accent);
}

.player-health.danger > span {
  background: var(--red);
}

.boss-state-strip {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 6px 12px;
  padding: 11px 0 14px;
  border-bottom: 1px solid var(--line);
}

.boss-state-strip > span,
.player-state-block > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.boss-state-strip p,
.player-state-block p {
  margin: 0;
  color: #d7dce1;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.boss-state-strip small {
  grid-column: 2;
  color: var(--accent);
  font-size: 11px;
}

.combat-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 24px;
  margin-top: 20px;
  align-items: start;
}

.combat-main {
  min-width: 0;
}

.combat-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.combat-status-grid > * {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #1b2025;
  padding: 11px 12px;
}

.combat-status-grid .boss-state-strip,
.combat-status-grid .player-state-block {
  display: block;
}

.combat-status-grid .boss-state-strip p,
.combat-status-grid .player-state-block p {
  margin-top: 6px;
}

.combat-status-grid .boss-state-strip small {
  display: block;
  margin-top: 5px;
}

.player-vitals {
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #171d1d;
}

.omen-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 3px solid var(--line-strong);
  background: #1b2025;
}

.omen-panel.is-active {
  border-left-color: var(--accent);
  background: #242116;
}

.omen-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.omen-heading strong {
  font-size: 13px;
}

.omen-heading span {
  color: var(--muted);
  font-size: 11px;
}

.omen-panel.is-active .omen-heading span {
  color: #ffd782;
}

.omen-panel p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.omen-panel.is-active p {
  color: #f8e5b3;
}

.player-state-block {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.combat-action-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
}

.combat-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(116px, 1fr));
  gap: 8px;
  width: min(100%, 340px);
}

.combat-command {
  min-height: 44px;
  font-size: 14px;
}

.combat-leave {
  color: #e68b91;
  font-size: 12px;
}

.combat-abilities {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.warning-box {
  margin: 12px 0;
  border-left: 3px solid var(--accent);
  background: #242116;
  padding: 11px 12px;
  color: #f8e5b3;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

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

.ability-button {
  position: relative;
  min-height: 96px;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  transition: transform 130ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.ability-button-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ability-button-head strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ability-state {
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.ability-summary {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ability-button.is-ready {
  border-color: #4f7568;
  background: #1b2924;
}

.ability-button.is-ready .ability-state {
  border-color: #347c67;
  color: var(--green);
}

.ability-button.is-ready:hover {
  border-color: var(--green);
  background: #20332c;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.ability-button.is-ready:active {
  box-shadow: none;
  transform: translateY(0) scale(0.99);
}

.ability-button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.ability-button:disabled .ability-summary {
  color: #9aa4ae;
}

.combat-sidebar {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
  min-width: 0;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.combat-details-terminal {
  position: static;
  margin-top: 16px;
  padding-left: 0;
  border-left: 0;
}

.combat-details > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.combat-details > summary::-webkit-details-marker {
  display: none;
}

.combat-details > summary::after {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--muted);
  content: "+";
  font-size: 20px;
}

.combat-details[open] > summary::after {
  content: "−";
}

.combat-details > summary span {
  font-size: 13px;
  font-weight: 750;
}

.combat-details > summary small {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.combat-detail-body {
  padding-top: 16px;
}

.damage-details h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

.log-list {
  max-height: 410px;
  overflow: auto;
  padding-right: 4px;
}

.log-line {
  border-left: 2px solid var(--line-strong);
  padding: 3px 0 3px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.log-line.is-latest {
  border-left-color: var(--blue);
  color: #dce8f3;
}

.damage-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.damage-details summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.damage-details[open] summary {
  margin-bottom: 10px;
  color: var(--text);
}

.potential-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.enhance-workspace {
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
}

.enhance-console {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.enhance-title {
  min-height: 108px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #1b2026;
}

.enhance-title > div {
  min-width: 0;
}

.enhance-title .eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.enhance-title h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.enhance-title h2 b {
  color: var(--accent);
}

.enhance-title p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.enhance-method {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.enhance-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.enhance-ledger > div {
  min-width: 0;
  padding: 17px 20px;
  border-right: 1px solid var(--line);
}

.enhance-ledger > div:last-child {
  border-right: 0;
}

.enhance-ledger span,
.chance span,
.enhance-materials span,
.enhance-delta > span,
.restore-summary span,
.potential-wallet span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.enhance-ledger strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(15px, 2vw, 21px);
  overflow-wrap: anywhere;
}

.enhance-ledger strong.cost {
  color: #ffb1b5;
}

.chance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 18px 20px 12px;
}

.chance {
  min-width: 0;
  padding-right: 16px;
}

.chance strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
}

.chance.success strong { color: var(--green); }
.chance.fail strong { color: #cbd1d7; }
.chance.destroy strong { color: var(--red); }

.chance-track {
  height: 6px;
  display: flex;
  overflow: hidden;
  margin: 0 20px 18px;
  border-radius: 3px;
  background: #0f1216;
}

.chance-track span {
  display: block;
  height: 100%;
}

.chance-track .success { background: var(--green); }
.chance-track .fail { background: #69727c; }
.chance-track .destroy { background: var(--red); }

.enhance-materials,
.enhance-delta {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
}

.enhance-materials strong,
.enhance-delta p {
  margin: 0;
  color: #dce1e6;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.enhance-actions {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: #171b20;
}

.enhance-submit {
  min-width: min(100%, 280px);
  min-height: 46px;
  font-size: 15px;
}

.enhance-outcome {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  background: #1b2025;
  animation: result-enter 180ms ease-out;
}

.enhance-outcome > span {
  min-width: 66px;
  font-size: 13px;
  font-weight: 850;
}

.enhance-outcome strong {
  font-size: 14px;
}

.enhance-outcome small {
  color: var(--muted);
  font-size: 11px;
}

.enhance-outcome.is-success {
  border-left: 4px solid var(--green);
  background: #17251f;
}

.enhance-outcome.is-success > span { color: var(--green); }
.enhance-outcome.is-failed { border-left: 4px solid #7e8791; }
.enhance-outcome.is-failed > span { color: #cbd1d7; }
.enhance-outcome.is-destroyed {
  border-left: 4px solid var(--red);
  background: #28191c;
}
.enhance-outcome.is-destroyed > span { color: #ff9da2; }

@keyframes result-enter {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.enhance-loading,
.empty-result {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--muted);
  font-size: 12px;
}

.enhance-loading .spinner {
  width: 22px;
  height: 22px;
}

.potential-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  border-bottom: 1px solid var(--line);
}

.current-potential {
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.current-potential h3,
.memorial-head h3 {
  margin: 0;
  font-size: 14px;
}

.potential-wallet {
  display: grid;
  align-content: center;
}

.potential-wallet > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}

.potential-wallet > div:last-child {
  border-bottom: 0;
}

.potential-wallet strong {
  font-size: 14px;
}

.memorial-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
}

.potential-workbench {
  border-top: 1px solid var(--line);
  background: #171b20;
}

.potential-reroll-actions {
  justify-content: flex-end;
}

.potential-required {
  margin: 0 20px 16px;
  border-left-color: var(--red);
  background: #28191c;
  color: #ffd5d7;
}

.potential-required strong,
.craft-shortage strong {
  display: block;
  margin-bottom: 3px;
}

.enhance-console .potential-grid {
  padding: 0 20px 20px;
}

.potential-candidate.is-tier-up {
  border-color: #3f806b;
  background: #17241f;
}

.potential-candidate.is-unavailable {
  border-color: #54383d;
  background: #1d181a;
  opacity: 0.72;
}

.potential-candidate .button {
  width: 100%;
  margin-top: 12px;
  white-space: normal;
}

.restore-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.restore-summary > div {
  padding: 16px 20px;
  border-right: 1px solid var(--line);
}

.restore-summary > div:last-child {
  border-right: 0;
}

.restore-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.gacha-console {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.gacha-pool-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.gacha-pool-head .eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.gacha-pool-head h2 {
  margin: 5px 0 0;
  font-size: 19px;
  overflow-wrap: anywhere;
}

.gacha-pool-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.gacha-wallet {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #171b20;
}

.gacha-wallet span {
  color: var(--muted);
  font-size: 12px;
}

.gacha-wallet strong {
  font-size: 21px;
}

.draw-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 20px;
}

.draw-option {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface-2);
  cursor: pointer;
}

.draw-option:hover {
  border-color: #6b7580;
  background: var(--surface-3);
}

.draw-option:active {
  background: #171b20;
  transform: translateY(1px);
}

.draw-option.is-primary {
  border-color: var(--accent);
  background: #3b311d;
}

.draw-option strong {
  font-size: 16px;
}

.draw-option span {
  color: var(--muted);
  font-size: 11px;
}

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

.gacha-result {
  border-top: 1px solid var(--line);
  padding: 18px 20px;
  background: #171b20;
  animation: result-enter 180ms ease-out;
}

.gacha-result h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.gacha-result pre {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  color: #dce1e6;
  font: inherit;
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.potential-candidate {
  min-width: 0;
  padding: 14px;
}

.potential-candidate h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.potential-lines {
  min-height: 76px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-line;
}

.mobile-nav {
  display: none;
}

.initial-loader {
  min-height: 60vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.is-busy {
  cursor: progress;
}

.is-busy::before {
  position: fixed;
  z-index: 90;
  top: var(--topbar-height);
  left: var(--sidebar-width);
  width: 28%;
  height: 2px;
  background: var(--accent);
  content: "";
  animation: request-progress 900ms ease-in-out infinite alternate;
}

@keyframes request-progress {
  from { transform: translateX(-70%); }
  to { transform: translateX(330%); }
}

.is-loading {
  color: transparent !important;
}

.is-loading > * {
  visibility: hidden;
}

.is-loading::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  color: var(--text);
  content: "";
  animation: spin 620ms linear infinite;
}

dialog {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(5, 7, 9, 0.72);
}

.confirm-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 20px;
}

.confirm-dialog h2 {
  margin: 0;
  font-size: 18px;
}

.confirm-dialog p {
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-line;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.sheet-dialog {
  width: min(480px, calc(100vw - 24px));
  padding: 12px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #111418;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background-image: url("world.png");
  background-position: center;
  background-size: cover;
}

.login-backdrop::after {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 12, 0.58);
  content: "";
}

.login-content {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 min(12vh, 120px);
}

.brand-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
}

.login-content h1 {
  margin: 0;
  font-size: 64px;
  line-height: 1;
}

.login-content p:not(.brand-kicker) {
  margin: 18px 0 24px;
  color: #d3d8dd;
  font-size: 16px;
}

.login-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

@media (max-width: 1000px) {
  .stat-grid,
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .profile-identity {
    grid-column: 1 / -1;
  }

  .activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .enhance-workspace {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  }

  .enhance-ledger,
  .potential-overview {
    grid-template-columns: 1fr;
  }

  .enhance-ledger > div,
  .current-potential {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .combat-sidebar {
    position: static;
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-height: 54px;
  }

  .app-shell {
    display: block;
    padding-bottom: 58px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: var(--topbar-height);
  }

  .brand-button {
    padding: 0 12px;
  }

  .brand-button > span:last-child,
  .text-link,
  .quick-status span:not(:first-child) {
    display: none;
  }

  .quick-status {
    padding: 0 8px;
  }

  .topbar-actions {
    padding: 0 10px 0 0;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    min-height: calc(100vh - var(--topbar-height) - 58px);
    padding: 18px 14px 38px;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .head-actions {
    width: 100%;
  }

  .head-actions .button {
    flex: 1;
  }

  .button {
    max-width: 100%;
    white-space: normal;
  }

  .workspace {
    display: block;
  }

  .master-pane {
    position: static;
    margin-bottom: 18px;
  }

  .master-list {
    max-height: min(46vh, 420px);
  }

  .enhance-workspace {
    display: block;
  }

  .enhance-title,
  .enhance-method,
  .enhance-actions,
  .memorial-head,
  .current-potential {
    padding-right: 14px;
    padding-left: 14px;
  }

  .enhance-title,
  .gacha-pool-head {
    flex-wrap: wrap;
  }

  .enhance-ledger,
  .chance-grid {
    grid-template-columns: 1fr;
  }

  .enhance-ledger > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 14px;
  }

  .enhance-ledger strong {
    margin-top: 0;
    font-size: 16px;
  }

  .chance-grid {
    gap: 9px;
    padding: 14px;
  }

  .chance {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0;
  }

  .chance strong {
    margin-top: 0;
    font-size: 16px;
  }

  .chance-track {
    margin: 0 14px 14px;
  }

  .enhance-materials,
  .enhance-delta {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 14px;
  }

  .enhance-outcome {
    grid-template-columns: 1fr auto;
    padding: 12px 14px;
  }

  .enhance-outcome small {
    grid-column: 1 / -1;
  }

  .enhance-submit {
    width: 100%;
  }

  .memorial-head {
    align-items: stretch;
    flex-direction: column;
  }

  .enhance-console .potential-grid {
    padding: 0 14px 14px;
  }

  .potential-required {
    margin: 0 14px 14px;
  }

  .potential-reroll-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .draw-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
  }

  .draw-option {
    min-width: 0;
  }

  .gacha-pool-head .segmented {
    width: 100%;
  }

  .gacha-pool-head .segmented button {
    min-width: 0;
    flex: 1;
  }

  .profile-band,
  .stat-grid,
  .summary-grid,
  .activity-grid {
    grid-template-columns: 1fr;
  }

  .boss-combat {
    padding: 10px;
  }

  .boss-title-row {
    align-items: flex-start;
    gap: 8px;
  }

  .boss-name-line h2 {
    font-size: 16px;
  }

  .boss-hp {
    margin: 10px 0 8px;
  }

  .boss-page .vital-label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: 6px;
  }

  .boss-page .vital-label > strong {
    min-width: 0;
    font-size: 12px;
    text-align: right;
  }

  .boss-page .vital-label small {
    margin-left: 3px;
  }

  .boss-page .vital-block .hp-track {
    height: 8px;
    margin-top: 5px;
  }

  .combat-hud-layout {
    gap: 8px;
    margin-top: 8px;
  }

  .combat-hud {
    display: flex;
    flex-direction: column;
  }

  .player-vitals {
    padding: 8px 10px;
  }

  .combat-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 7px;
  }

  .combat-status-grid > * {
    padding: 7px 8px;
  }

  .combat-status-grid .omen-panel {
    grid-column: 1 / -1;
    grid-row: 1;
    border-left-width: 3px;
  }

  .combat-status-grid .boss-state-strip,
  .combat-status-grid .player-state-block {
    grid-row: 2;
  }

  .combat-status-grid .omen-panel p,
  .combat-status-grid .boss-state-strip p,
  .combat-status-grid .player-state-block p {
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.4;
  }

  .combat-status-grid .omen-heading strong,
  .combat-status-grid .boss-state-strip > span,
  .combat-status-grid .player-state-block > span {
    font-size: 10px;
  }

  .hud-abilities {
    order: 3;
    padding-top: 9px;
  }

  .hud-abilities .section-head {
    margin-bottom: 6px;
  }

  .hud-abilities .ability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 0;
  }

  .hud-abilities .ability-button {
    min-height: 0;
    gap: 6px;
    padding: 8px;
  }

  .hud-abilities .ability-button-head {
    gap: 5px;
  }

  .hud-abilities .ability-button-head strong {
    font-size: 11px;
  }

  .hud-abilities .ability-state {
    padding: 1px 4px;
    font-size: 9px;
  }

  .hud-abilities .ability-summary {
    font-size: 10px;
    line-height: 1.4;
  }

  .combat-action-section {
    order: 4;
    position: sticky;
    z-index: 20;
    bottom: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin: 8px -10px 0;
    padding: 8px 10px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(24, 28, 33, 0.97);
    backdrop-filter: blur(10px);
  }

  .combat-primary-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    width: 100%;
  }

  .combat-leave {
    min-width: 0;
    padding: 0 4px;
  }

  .combat-details {
    position: static;
    width: 100%;
    padding: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .combat-details > summary {
    margin-top: 2px;
    border: 0;
    padding: 10px 0 0;
  }

  .combat-detail-body {
    padding-top: 12px;
  }

  .is-busy::before {
    left: 0;
  }

  .profile-identity {
    grid-column: auto;
  }

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

  .ability-filters {
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.45fr);
    width: 100%;
  }

  .operation-bar {
    grid-template-columns: 1fr;
  }

  .operation-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .operation-metrics > div {
    min-width: 0;
    padding: 0 9px;
  }

  .operation-bar > .button,
  .operation-bar > .button-row {
    width: 100%;
  }

  .operation-bar > .button,
  .operation-bar > .button-row .button {
    flex: 1;
    white-space: normal;
  }

  .mobile-nav {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    height: 58px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    background: rgba(18, 21, 25, 0.98);
    backdrop-filter: blur(10px);
  }

  .mobile-nav button {
    border-top: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
  }

  .mobile-nav button.is-active {
    border-top-color: var(--accent);
    color: var(--text);
    font-weight: 750;
  }

  .login-content {
    padding-bottom: 72px;
  }

  .login-content h1 {
    font-size: 44px;
  }
}

@media (max-width: 420px) {
  .passive-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .passive-row > .status-pill {
    justify-self: start;
  }

  .gacha-pool-head,
  .gacha-wallet {
    align-items: stretch;
    flex-direction: column;
  }

  .gacha-wallet {
    gap: 5px;
  }

  .operation-metrics {
    grid-template-columns: 1fr;
  }

  .operation-metrics > div {
    padding: 8px 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .operation-metrics > div:first-child {
    padding-top: 0;
    border-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
