:root {
  --bg-0: #f3f6fb;
  --bg-1: #e9eef7;
  --ink: #1f2733;
  --ink-soft: #5b6675;
  --track: #d4dcea;
  --accent: #3b6fe0;
  --line: rgba(31, 39, 51, 0.08);
  --color-font: #1f2733;
  --color-group-header-font: #5b6675;
  --color-hex: #5b6675;
  --color-icon: #5b6675;
  --color-input-border: #d4dcea;
  --color-panel-background: rgba(255, 255, 255, 0.82);
  --color-panel-border: rgba(31, 39, 51, 0.08);
  --color-invalid: #e0615a;
}

*,
:before,
::before,
:after,
::after {
  box-sizing: border-box;
}

* {
  border: 0;
  border-radius: 0;
  margin: 0;
  outline: 0;
  padding: 0;
}

a,
blockquote,
button,
code,
div,
figcaption,
h1,
h2,
h3,
input[type=email],
input[type=text],
input[type=password],
li,
ol,
option,
p,
pre,
select,
span,
strong,
sub,
sup,
td,
textarea,
th,
ul {
  color: #1f1f1f;
}

a,
blockquote,
body,
br,
button,
code,
div,
figure,
figcaption,
h1,
h2,
h3,
html,
iframe,
img,
input,
li,
ol,
option,
p,
pre,
select,
span,
strong,
sub,
sup,
table,
tbody,
td,
th,
thead,
tr,
ul {
  -webkit-appearance: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-size: 100%;
  vertical-align: baseline;
}

html,
body {
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 0;
  line-height: 1;
  -webkit-text-size-adjust: 100%;
}

a {
  background: transparent;
  font-size: 0;
  margin: 0;
  padding: 0;
  text-decoration: none;
  vertical-align: baseline;
}

p a {
  font-size: 100%;
  font-weight: bold;
}

strong {
  font-size: 100%;
  vertical-align: baseline;
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

img {
  font-size: 0;
  max-width: 100%;
}

svg {
  border: 0;
  stroke-width: 0;
}

ol,
ul {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

td,
th {
  text-align: left;
  white-space: nowrap;
  word-break: break-all;
}

th {
  font-weight: bold;
}

blockquote {
  quotes: none;
}

blockquote::after,
blockquote::before {
  content: "";
}

pre code {
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Consolas, Menlo, "Liberation Mono", monospace;
}

input[type=text] {
  background-color: transparent;
}

input[type=file],
input[type=checkbox] {
  display: none;
}

textarea {
  background-color: transparent;
  resize: vertical;
  text-rendering: optimizeLegibility;
  width: 100%;
  overflow-y: scroll;
  overflow-anchor: none;
}

button {
  cursor: pointer;
  background-color: transparent;
  font-family: inherit;
}

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

::-webkit-calendar-picker-indicator {
  display: none;
}

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

iframe {
  display: block;
  max-width: 100%;
}

.App {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 90% at 50% 0%, var(--bg-1) 0%, var(--bg-0) 60%);
}

.Stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}
.Stage-Canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.Year {
  position: absolute;
  left: 16px;
  top: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: clamp(28px, 7vw, 44px);
  letter-spacing: 0.01em;
  color: var(--ink);
  opacity: 0.92;
  pointer-events: none;
}
.Year-Unit {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  opacity: 0.7;
  margin-top: 2px;
}

.Panel {
  position: fixed;
  z-index: 10;
  width: 248px;
  background: var(--color-panel-background);
  backdrop-filter: blur(14px);
  border: 1px solid var(--color-panel-border);
  border-radius: 2px;
  box-shadow: 0 10px 30px rgba(31, 39, 51, 0.16);
  overflow: hidden;
}
.Panel-Header {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.Panel-Header:active {
  cursor: grabbing;
}
.Panel-Grip {
  display: flex;
  width: 14px;
  color: var(--ink);
  opacity: 0.45;
}
.Panel-Title {
  flex: 1 1 auto;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.Panel-Collapse {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--ink-soft);
  transition: transform 0.15s ease;
}
.Panel-Main {
  display: block;
}
.Panel[data-collapsed] .Panel-Header {
  border-bottom: none;
}
.Panel[data-collapsed] .Panel-Main {
  display: none;
}
.Panel[data-collapsed] .Panel-Collapse {
  transform: rotate(-90deg);
}

.PanelGroup + .PanelGroup {
  border-top: 1px solid var(--line);
}
.PanelGroup-Header {
  display: flex;
  height: 28px;
  padding: 9px 12px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-group-header-font);
}

.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: 8px;
}
.RightLabelGrid-Row[data-clickable] {
  cursor: pointer;
}
.RightLabelGrid-Row-Label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  font-size: 12px;
  color: var(--color-font);
}

.NumberInput,
.ColorInput,
.ToggleInput {
  justify-self: start;
}

.NumberInput {
  display: flex;
  align-items: center;
  gap: 4px;
}
.NumberInput-Arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: var(--color-icon);
  cursor: pointer;
}
.NumberInput-Arrow[data-disabled] {
  opacity: 0.3;
  cursor: default;
}
.NumberInput-Field {
  display: flex;
  align-items: center;
  gap: 4px;
}
.NumberInput-Input {
  field-sizing: content;
  min-width: calc(2ch + 16px);
  max-width: calc(5ch + 16px);
  height: 24px;
  padding: 0 4px;
  border: 1px solid var(--color-input-border);
  border-radius: 2px;
  background: transparent;
  font-size: 12px;
  color: var(--color-font);
  text-align: center;
}
.NumberInput-Input:focus {
  outline: none;
}
.NumberInput-Unit {
  font-size: 12px;
  color: var(--color-font);
  user-select: none;
}

.ColorInput {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  cursor: pointer;
}
.ColorInput-Swatch {
  width: 20px;
  height: 20px;
  border: 1px solid var(--color-input-border);
  border-radius: 2px;
}
.ColorInput-Hex {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--color-hex);
  text-transform: uppercase;
}
.ColorInput-Native {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.ToggleInput {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}
.ToggleInput-Option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--color-font);
  cursor: pointer;
  user-select: none;
}
.ToggleInput [data-selected]::before, .ToggleInput [data-selected]::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
  pointer-events: none;
}
.ToggleInput [data-selected]::before {
  left: 0;
  border-left: 1px solid var(--color-input-border);
  border-top: 1px solid var(--color-input-border);
  border-bottom: 1px solid var(--color-input-border);
  border-top-left-radius: 2px;
  border-bottom-left-radius: 2px;
}
.ToggleInput [data-selected]::after {
  right: 0;
  border-right: 1px solid var(--color-input-border);
  border-top: 1px solid var(--color-input-border);
  border-bottom: 1px solid var(--color-input-border);
  border-top-right-radius: 2px;
  border-bottom-right-radius: 2px;
}

.DataPanel {
  width: 300px;
}
.DataPanel .Panel-Main {
  padding: 8px;
}

.DataInput {
  width: 100%;
  height: 200px;
  padding: 8px;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-font);
  resize: vertical;
}
.DataInput:focus {
  outline: none;
}
.DataInput[data-invalid] {
  box-shadow: inset 0 0 0 1px var(--color-invalid);
}

.Transport {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.Transport-Play {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease;
}
.Transport-Play:active {
  transform: scale(0.92);
}
.Transport-Play svg {
  width: 18px;
  height: 18px;
}
.Transport-Scrubber {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.Transport-Scrub {
  width: 100%;
  height: 6px;
  border-radius: 1px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--track);
  outline: none;
}
.Transport-Scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}
.Transport-Scrub::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  cursor: pointer;
}
.Transport-Ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}
.Transport-Export {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  transition: color 0.12s ease, background 0.12s ease;
}
.Transport-Export[data-active] {
  color: var(--accent);
  background: rgba(59, 111, 224, 0.12);
}
.Transport-Export svg {
  width: 18px;
  height: 18px;
}

.ExportPanel {
  display: none;
}
.ExportPanel[data-open] {
  display: block;
}
.ExportPanel-Size {
  justify-self: start;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 12px;
  color: var(--color-font);
  font-variant-numeric: tabular-nums;
}
.ExportPanel-Foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}
.ExportPanel-Run {
  height: 34px;
  border-radius: 2px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.12s ease;
}
.ExportPanel-Run[data-busy] {
  opacity: 0.6;
  cursor: default;
}
.ExportPanel-Progress {
  display: none;
}
.ExportPanel-Progress[data-active] {
  display: block;
}
.ExportPanel-Bar {
  display: block;
  height: 4px;
  border-radius: 1px;
  background: var(--track);
  overflow: hidden;
}
.ExportPanel-Bar-Fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.1s linear;
}
.ExportPanel-Message {
  min-height: 13px;
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
}
.ExportPanel-Message[data-error] {
  color: var(--color-invalid);
}

.ChoiceInput {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
}
.ChoiceInput-Option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--color-font);
  cursor: pointer;
  user-select: none;
  font-variant-numeric: tabular-nums;
}
.ChoiceInput-Option[data-selected]::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--color-input-border);
  border-radius: 2px;
  pointer-events: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
}