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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  background: radial-gradient(120% 92% at 42% 34%, #171d25, #0b0e12 74%);
  --color-font: #e8edf3;
  --color-muted: #9aa6b2;
  --color-dim: #5d6875;
  --color-panel-background: #12161c;
  --color-panel-header-background: #171c23;
  --color-card: #1a212a;
  --color-card-hover: #212a35;
  --color-selected: #243141;
  --color-field-border: #2a333f;
  --color-accent: #d9a44a;
  --color-accent-dim: rgba(217, 164, 74, 0.13);
  color: var(--color-font);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body[data-drag] {
  cursor: grabbing;
}

body[data-pick] {
  cursor: pointer;
}

input {
  font-family: inherit;
}

svg {
  display: block;
}

::-webkit-scrollbar {
  display: none;
}

.Logo {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 24px;
}
.Logo a {
  color: var(--color-font);
  font-family: "Quicksand", BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDGothic", meiryo, sans-serif;
  font-size: 18px;
  font-weight: 400;
  text-decoration: none;
}

.PanelControl {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
  padding: 0 32px;
}
.PanelControl-Item {
  display: flex;
  align-items: center;
  color: var(--color-dim);
  font-size: 13px;
  line-height: 21px;
  cursor: pointer;
  user-select: none;
  transition: color 0.18s;
}
.PanelControl-Item:hover {
  color: var(--color-muted);
}
.PanelControl-Item[data-open] {
  color: var(--color-font);
}

.Panel {
  position: absolute;
  display: flex;
  flex-direction: column;
  width: max-content;
  background: var(--color-panel-background);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.Panel[data-hidden] {
  display: none;
}
.Panel[data-edge-left] {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.Panel[data-edge-right] {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.Panel[data-edge-top] {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.Panel[data-edge-bottom] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.Panel-Header {
  flex-shrink: 0;
  height: 32px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.Panel-Header:active {
  cursor: grabbing;
}
.Panel-CloseIcon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  color: var(--color-dim);
  cursor: pointer;
}
.Panel-CloseIcon:hover {
  color: var(--color-font);
}
.Panel-Header:hover .Panel-CloseIcon {
  visibility: visible;
}
.Panel-Title {
  display: flex;
  align-items: center;
  height: 32px;
  background: var(--color-panel-header-background);
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-muted);
  border-bottom-right-radius: 12px;
}
.Panel-Title[data-end] {
  padding: 0 16px;
}
.Panel-Main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.Panel-Handle {
  position: absolute;
  z-index: 3;
}
.Panel-Handle[data-direction=n] {
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  cursor: ns-resize;
}
.Panel-Handle[data-direction=s] {
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  cursor: ns-resize;
}
.Panel-Handle[data-direction=e] {
  top: 0;
  bottom: 0;
  right: 0;
  width: 4px;
  cursor: ew-resize;
}
.Panel-Handle[data-direction=w] {
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  cursor: ew-resize;
}
.Panel-Handle[data-direction=ne] {
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  cursor: nesw-resize;
}
.Panel-Handle[data-direction=nw] {
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  cursor: nwse-resize;
}
.Panel-Handle[data-direction=se] {
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  cursor: nwse-resize;
}
.Panel-Handle[data-direction=sw] {
  bottom: 0;
  left: 0;
  width: 10px;
  height: 10px;
  cursor: nesw-resize;
}

.Crystal[data-fixed] .Panel {
  top: 56px;
  right: 24px;
  left: auto;
  width: max-content;
  height: auto;
  max-height: calc(100vh - 56px - 56px);
}
.Crystal[data-fixed] .Panel .Panel-Header {
  cursor: default;
}
.Crystal[data-fixed] .Panel .Panel-Handle {
  display: none;
}

.StructurePanel {
  max-height: calc(100vh - 56px - 56px);
}

.DetailChildPanel {
  position: fixed;
  display: none;
  width: 268px;
  overflow-y: auto;
  background: var(--color-panel-background);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.DetailChildPanel[data-open] {
  display: block;
}

.SelectList {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}
.SelectList-Item {
  display: flex;
  align-items: center;
  min-width: 168px;
  padding: 6px 10px;
  margin: 1px 8px;
  border-radius: 2px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-muted);
  cursor: pointer;
  user-select: none;
  transition: color 0.18s, background 0.18s;
}
.SelectList-Item:hover {
  color: var(--color-font);
  background: var(--color-card);
}
.SelectList-Item[data-current] {
  color: var(--color-font);
  background: var(--color-selected);
}

.RightLabelGrid {
  display: grid;
  grid-template-columns: max-content 1fr;
  padding: 8px 12px;
}
.RightLabelGrid-Row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1/-1;
  align-items: center;
  height: 36px;
  column-gap: 16px;
}
.RightLabelGrid-Row[data-clickable] {
  cursor: pointer;
}
.RightLabelGrid-Label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-muted);
  padding: 0 4px;
}

.SegmentInput {
  display: flex;
  justify-self: start;
  gap: 1px;
  padding: 3px;
  border-radius: 9px;
  background: var(--color-card);
}
.SegmentInput-Item {
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--color-dim);
  cursor: pointer;
  user-select: none;
  transition: color 0.18s, background 0.18s;
}
.SegmentInput-Item:hover {
  color: var(--color-muted);
}
.SegmentInput-Item[data-current] {
  background: var(--color-selected);
  color: var(--color-font);
}

.CheckInput {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  width: 18px;
  height: 18px;
  border: 1px solid var(--color-field-border);
  border-radius: 2px;
  cursor: pointer;
}
.CheckInput svg {
  visibility: hidden;
}
.CheckInput[data-checked] {
  background: var(--color-font);
  border-color: var(--color-font);
  color: var(--color-panel-background);
}
.CheckInput[data-checked] svg {
  visibility: visible;
}

.NumberInput {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-self: start;
}
.NumberInput-Arrow {
  position: relative;
  width: 24px;
  height: 24px;
  cursor: pointer;
}
.NumberInput-Arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 8px;
  width: 8px;
  height: 1px;
  background-color: var(--color-muted);
}
.NumberInput-Arrow[data-disabled] {
  opacity: 0.3;
  cursor: default;
}
.NumberInput-Next::after {
  content: "";
  position: absolute;
  top: calc(50% - 4px);
  left: 11px;
  width: 1px;
  height: 9px;
  background-color: var(--color-muted);
}
.NumberInput-Field {
  display: flex;
  align-items: center;
}
.NumberInput-Input {
  width: calc(4ch + 16px);
  height: 24px;
  padding: 0 4px;
  border-radius: 2px;
  background: var(--color-card);
  color: var(--color-font);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.NumberInput-Input:focus {
  outline: none;
}

.ZoomBar {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 32px;
}
.ZoomBar-Label {
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--color-dim);
}
.ZoomBar-Unit {
  font-size: 11.5px;
  color: var(--color-dim);
}

.Summary {
  width: 268px;
  padding: 12px 18px 4px;
}
.Summary-Name {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.025em;
  color: var(--color-font);
}
.Summary-Text {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--color-muted);
}
.Summary-Example {
  margin-top: 4px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--color-dim);
}

.MetricList {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 13px 18px 0;
}
.MetricList-Item {
  min-width: 0;
  padding: 10px 10px 9px;
  border-radius: 10px;
  background: var(--color-card);
  cursor: pointer;
  user-select: none;
  transition: background 0.18s;
}
.MetricList-Item:hover {
  background: var(--color-card-hover);
}
.MetricList-Item[data-current] {
  background: var(--color-accent-dim);
}
.MetricList-Label {
  min-height: 27px;
  font-size: 10.5px;
  line-height: 1.35;
  letter-spacing: 0.03em;
  color: var(--color-dim);
}
.MetricList-Value {
  margin-top: 5px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-font);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.MetricList-Item[data-current] .MetricList-Label {
  color: var(--color-accent);
}

.RoleList {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 12px 18px;
}
.RoleList-Row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: background 0.18s;
}
.RoleList-Row:hover {
  background: var(--color-card);
}
.RoleList-Row[data-current] {
  background: var(--color-selected);
}
.RoleList-Dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.RoleList-Name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--color-font);
}
.RoleList-Fraction {
  white-space: nowrap;
  font-size: 11px;
  color: var(--color-dim);
  font-variant-numeric: tabular-nums;
}

.Detail {
  padding: 16px 18px 20px;
}
.Detail-Reveal {
  animation: detail-rise 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.Detail-Hint {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--color-dim);
}
.Detail-Head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.Detail-Title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-accent);
}
.Detail-Close {
  flex: none;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--color-dim);
  cursor: pointer;
  transition: color 0.15s;
}
.Detail-Close:hover {
  color: var(--color-muted);
}
.Detail-Line {
  margin-top: 11px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--color-muted);
}
.Detail-Note {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--color-dim);
}
.Detail-Equation {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 13px;
  font-size: 14px;
  color: var(--color-font);
  font-variant-numeric: tabular-nums;
}
.Detail-Equation-Label {
  font-size: 11.5px;
  color: var(--color-muted);
}
.Detail-Dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.Detail-Operator {
  font-size: 12px;
  color: var(--color-dim);
}
.Detail-Result {
  font-weight: 600;
  color: var(--color-accent);
}
.Detail-Unit {
  margin-left: 3px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--color-muted);
}
.Detail-Relation {
  margin-top: 13px;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  color: var(--color-font);
  font-variant-numeric: tabular-nums;
}
.Detail-Total {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 18px;
}
.Detail-Total-Label {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--color-dim);
}
.Detail-Big {
  font-size: 33px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}
.Detail-Big-Unit {
  margin-left: 4px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-muted);
}

.Fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
  font-size: 12px;
}
.Fraction-Bar {
  align-self: stretch;
  height: 1px;
  margin: 2px 0;
  background: var(--color-muted);
}

@keyframes detail-rise {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .Detail-Reveal {
    animation-duration: 0.01s;
  }
}
.UsagePanel .Panel-Main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.Panel-Text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 268px;
  padding: 16px 18px;
}
.Panel-Text h1 {
  color: var(--color-font);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
}
.Panel-Text p {
  color: var(--color-muted);
  font-size: 13px;
  line-height: 21px;
}

.Crystal {
  position: fixed;
  inset: 0;
  overflow: hidden;
  color: var(--color-font);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
.Crystal-Canvas {
  display: block;
  touch-action: none;
}