:root {
  color-scheme: dark;
  --bg: #0b0714;
  --bg-deep: #120820;
  --panel: rgba(23, 16, 36, 0.82);
  --panel-strong: #211432;
  --border: rgba(169, 118, 255, 0.18);
  --border-bright: rgba(204, 166, 255, 0.38);
  --text: #f4efff;
  --muted: #b8accf;
  --dim: #837695;
  --purple: #986cff;
  --violet: #6f72ff;
  --pink: #ff68c8;
  --cyan: #53d7ff;
  --mint: #6ff1c5;
  --orange: #ffaf5a;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: Inter, "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  overflow-x: hidden;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(115deg, rgba(116, 76, 255, 0.12), transparent 34%),
    linear-gradient(245deg, rgba(255, 104, 200, 0.08), transparent 38%),
    linear-gradient(145deg, #0b0714 0%, #120820 42%, #160b2b 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 78%);
}

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

button {
  color: inherit;
}

.pageShell {
  width: min(100% - 48px, 1180px);
  margin: 0 auto;
  padding: 56px 0 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: stretch;
  margin-bottom: 28px;
}

.heroCopy,
.heroPanel,
.summaryCard,
.controls,
.serviceCard {
  position: relative;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.heroCopy {
  min-width: 0;
  padding: 42px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(33, 20, 50, 0.92), rgba(16, 9, 27, 0.88)),
    linear-gradient(110deg, rgba(152, 108, 255, 0.08), transparent 70%);
  border-radius: var(--radius-xl);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  margin: 0 0 22px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #dacbff;
  text-transform: uppercase;
  background: rgba(152, 108, 255, 0.12);
  border: 1px solid rgba(190, 154, 255, 0.26);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 28px rgba(152, 108, 255, 0.12);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(2.6rem, 7vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h1 span {
  display: inline-block;
  white-space: nowrap;
}

.subtitle {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(1.08rem, 2vw, 1.36rem);
  line-height: 1.75;
  color: #e8dcff;
}

.description {
  max-width: 720px;
  margin-bottom: 0;
  line-height: 1.9;
  color: var(--muted);
}

.heroPanel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 320px;
  padding: 28px;
  overflow: hidden;
  background:
    linear-gradient(130deg, rgba(111, 114, 255, 0.16), transparent 62%),
    linear-gradient(160deg, rgba(33, 20, 50, 0.9), rgba(16, 9, 27, 0.92));
  border-radius: var(--radius-xl);
}

.heroPanel::before {
  position: absolute;
  inset: 0;
  content: "";
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.panelLabel,
.sectionLabel,
.summaryMeta p {
  margin-bottom: 8px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--dim);
  text-transform: uppercase;
}

.panelValue {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.panelText {
  margin-bottom: 0;
  line-height: 1.7;
  color: var(--muted);
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.summaryCard {
  min-width: 0;
  min-height: 192px;
  padding: 28px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.revenueCard {
  background:
    linear-gradient(100deg, rgba(255, 104, 200, 0.12), transparent 70%),
    linear-gradient(135deg, rgba(152, 108, 255, 0.96), rgba(78, 84, 255, 0.92) 58%, rgba(68, 199, 255, 0.82));
  border-color: rgba(223, 206, 255, 0.38);
  box-shadow: 0 24px 70px rgba(112, 89, 255, 0.26);
}

.expenseCard {
  background:
    linear-gradient(135deg, rgba(255, 104, 200, 0.86), rgba(152, 108, 255, 0.62)),
    linear-gradient(150deg, rgba(33, 20, 50, 0.92), rgba(20, 12, 32, 0.94));
  border-color: rgba(255, 132, 213, 0.34);
  box-shadow: 0 24px 70px rgba(255, 104, 200, 0.16);
}

.profitCard {
  background:
    linear-gradient(135deg, rgba(255, 70, 135, 0.34), rgba(112, 42, 114, 0.3)),
    linear-gradient(150deg, rgba(33, 20, 50, 0.92), rgba(20, 12, 32, 0.94));
  border-color: rgba(255, 97, 150, 0.32);
  box-shadow: 0 24px 70px rgba(255, 70, 135, 0.12);
}

.roiCard {
  background:
    linear-gradient(135deg, rgba(83, 215, 255, 0.58), rgba(152, 108, 255, 0.42)),
    linear-gradient(150deg, rgba(33, 20, 50, 0.92), rgba(20, 12, 32, 0.94));
  border-color: rgba(83, 215, 255, 0.32);
  box-shadow: 0 24px 70px rgba(83, 215, 255, 0.12);
}

.expenseCard .summaryValue,
.profitCard .summaryValue {
  color: #fff0fa;
}

.roiCard .summaryValue {
  color: #f7fdff;
}

.countCard {
  background:
    linear-gradient(150deg, rgba(33, 20, 50, 0.92), rgba(20, 12, 32, 0.94));
}

.summaryMeta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 26px;
}

.summaryMeta p {
  margin-bottom: 0;
  color: rgba(244, 239, 255, 0.72);
}

.summaryIcon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 850;
  color: #fbf8ff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
}

.summaryValue {
  margin-bottom: 8px;
  font-size: clamp(32px, 2.3vw, 34px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  font-variant-numeric: tabular-nums;
}

.summaryCaption {
  margin-bottom: 0;
  color: rgba(244, 239, 255, 0.68);
}

.controls {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 22px;
  margin-bottom: 20px;
  background: rgba(23, 16, 36, 0.72);
  border-radius: var(--radius-lg);
}

.controls h2 {
  margin-bottom: 0;
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  letter-spacing: 0;
}

.filterButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
}

.filterButton {
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(190, 154, 255, 0.2);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.filterButton:hover,
.filterButton:focus-visible {
  background: rgba(152, 108, 255, 0.14);
  border-color: var(--border-bright);
  box-shadow: 0 0 28px rgba(152, 108, 255, 0.14);
  transform: translateY(-1px);
}

.filterButton:focus-visible {
  outline: 2px solid rgba(111, 241, 197, 0.7);
  outline-offset: 3px;
}

.filterButton.isActive {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(152, 108, 255, 0.88), rgba(255, 104, 200, 0.72));
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 30px rgba(152, 108, 255, 0.24);
}

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

.serviceCard {
  min-width: 0;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(152, 108, 255, 0.08), transparent 62%),
    linear-gradient(150deg, rgba(33, 20, 50, 0.9), rgba(20, 12, 31, 0.96));
  border-radius: var(--radius-lg);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.serviceCard:hover {
  border-color: var(--border-bright);
  box-shadow: 0 26px 66px rgba(0, 0, 0, 0.42), 0 0 34px rgba(152, 108, 255, 0.11);
  transform: translateY(-5px);
}

.accentLine {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--category-color);
  box-shadow: 0 0 26px var(--category-glow);
}

.cardHead {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.serviceIcon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  font-size: 0.92rem;
  font-weight: 850;
  color: #f9f4ff;
  background: rgba(152, 108, 255, 0.16);
  border: 1px solid rgba(205, 176, 255, 0.23);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 24px rgba(152, 108, 255, 0.12);
}

.serviceCard h3 {
  margin-bottom: 9px;
  font-size: 1.08rem;
  line-height: 1.35;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.categoryTag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--category-color);
  background: color-mix(in srgb, var(--category-color) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--category-color) 28%, transparent);
  border-radius: 999px;
}

.divider {
  height: 1px;
  margin: 24px 0 18px;
  background: linear-gradient(90deg, transparent, rgba(206, 181, 255, 0.24), transparent);
}

.priceRow {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
}

.priceRow span {
  font-size: 0.86rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.priceRow strong {
  font-size: clamp(28px, 2.4vw, 38px);
  line-height: 1;
  color: #fbf8ff;
  letter-spacing: -0.04em;
  text-shadow: 0 0 18px rgba(190, 154, 255, 0.22);
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  font-variant-numeric: tabular-nums;
}

.priceValue {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  min-width: 0;
}

.convertedPrice {
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1;
  color: #b8accf;
  white-space: nowrap;
}

.serviceCard[data-type="revenue"] {
  --category-color: var(--mint);
  --category-glow: rgba(111, 241, 197, 0.42);
}

.serviceCard[data-type="expense"] {
  --category-color: var(--pink);
  --category-glow: rgba(255, 104, 200, 0.45);
}

.serviceCard[data-type="expense"] .priceRow strong {
  color: #fff0fa;
}

.serviceCard[data-type="event"] {
  --category-color: var(--orange);
  --category-glow: rgba(255, 175, 90, 0.42);
}

@supports not (background: color-mix(in srgb, red 20%, transparent)) {
  .categoryTag {
    background: rgba(152, 108, 255, 0.13);
    border-color: rgba(190, 154, 255, 0.24);
  }
}

@media (max-width: 900px) {
  .pageShell {
    width: min(100% - 36px, 760px);
    padding-top: 34px;
  }

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

  .heroPanel {
    min-height: 240px;
  }

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

  .summaryValue {
    font-size: clamp(30px, 5vw, 46px);
  }

  .controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .filterButtons {
    justify-content: flex-start;
    width: 100%;
  }

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

@media (max-width: 640px) {
  .pageShell {
    width: min(100% - 28px, 460px);
    padding: 24px 0 48px;
  }

  .heroCopy,
  .heroPanel,
  .summaryCard,
  .controls,
  .serviceCard {
    border-radius: 20px;
  }

  .heroCopy {
    padding: 28px;
  }

  h1 {
    font-size: clamp(2.35rem, 11.5vw, 2.9rem);
  }

  .subtitle {
    font-size: 1rem;
  }

  .heroPanel {
    min-height: 220px;
    padding: 24px;
  }

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

  .summaryCard {
    min-height: 166px;
    padding: 24px;
  }

  .summaryValue {
    font-size: clamp(28px, 10vw, 40px);
  }

  .priceRow strong {
    font-size: clamp(24px, 8vw, 34px);
  }

  .filterButton {
    flex: 1 1 auto;
    min-width: calc(50% - 5px);
    padding-inline: 12px;
  }

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

@media (max-width: 380px) {
  .filterButton {
    min-width: 100%;
  }

  .cardHead {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .serviceIcon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .priceRow {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .priceValue {
    align-items: flex-start;
  }
}
