:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #232720;
  background: #f8f8f2;
  font-synthesis: none;
  --blue: #3430f4;
  --muted: #6b7266;
  --line: #d8ddcf;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #aaa7ff; outline-offset: 4px;
}
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
.top, main, footer { width: 100%; margin: 0 auto; padding-inline: 20px; }
.top { max-width: 960px; height: 72px; flex: none; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 23px; font-weight: 700; letter-spacing: -.04em; text-decoration: none; min-height: 44px; }
.brand img { display: block; }
.byline { font-size: 13px; color: var(--muted); text-decoration: none; padding-block: 14px; }
main { max-width: 640px; flex: 1; }
.workspace { scroll-margin-top: 20px; outline: none; }
.intro { text-align: center; padding: 24px 0 26px; }
h1 { font-size: clamp(40px, 10vw, 58px); font-weight: 500; line-height: 1.02; letter-spacing: -.055em; }
h1 span { color: var(--blue); }
.intro p { font-size: 16px; line-height: 1.5; color: var(--muted); margin-top: 16px; }
.upload-box { border: 1.5px dashed #b5b5d1; border-radius: 20px; background: #efefff; transition: background .15s, border-color .15s; }
.upload-box:hover, .upload-box.drag { background: #e6e5ff; border-color: var(--blue); }
.upload-box.drag { outline: 3px solid #aaa7ff; outline-offset: 4px; }
.upload-target { width: 100%; border: 0; border-radius: 20px; background: none; padding: 26px 16px 22px; display: flex; align-items: center; flex-direction: column; gap: 16px; }
.mini-chart { height: 48px; display: flex; align-items: center; gap: 22px; }
.mini-pie { display: block; width: 48px; height: 48px; border-radius: 50%; background: conic-gradient(var(--blue) 0 45%, #a8a6ff 45% 75%, #dce66c 75%); }
.mini-bars { width: 50px; display: grid; gap: 6px; }
.mini-bars i { display: block; height: 10px; border-radius: 2px; background: var(--blue); }
.mini-bars i:nth-child(2) { width: 70%; background: #a8a6ff; }
.mini-bars i:nth-child(3) { width: 40%; background: #c6d04f; }
.upload-title { font-size: 19px; letter-spacing: -.025em; }
.upload-cta { display: block; width: 100%; max-width: 270px; padding: 15px 20px; border-radius: 10px; color: white; background: var(--blue); font-size: 16px; line-height: 1.25; }
.upload-hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.desktop-label { display: none; }
.micro { font-size: 12px; line-height: 1.5; color: var(--muted); margin-top: 12px; }
.centered { text-align: center; }
.alternatives { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 5px; color: #a1a497; }
.text-button { border: 0; background: none; padding: 12px 0; color: var(--blue); font-size: 14px; min-height: 44px; text-underline-offset: 4px; }
.text-button:hover { text-decoration: underline; }
.button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fffefa; padding: 14px 16px; min-height: 50px; font-size: 16px; line-height: 1.3; text-decoration: none; }
.button:hover { background: #eeeee6; }
.button.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.button.primary:hover { background: #2521dc; }
.full { width: 100%; }
.steps { display: flex; justify-content: center; gap: 22px; color: #7c8177; font-size: 12px; margin: 16px 0 25px; }
.steps span { display: flex; align-items: center; gap: 6px; }
.steps b { font-weight: 400; }
.steps .active { color: var(--blue); }
.stage-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
h2 { font-weight: 500; font-size: clamp(24px, 6vw, 30px); letter-spacing: -.04em; line-height: 1.15; }
.stage-heading .text-button { flex: none; font-size: 13px; }
.stage-note { color: var(--muted); font-size: 14px; line-height: 1.5; margin-bottom: 16px; }
.image-preview { background: #eeeee6; border: 1px solid var(--line); border-radius: 12px; min-height: 120px; padding: 12px; display: flex; align-items: center; justify-content: center; }
.crop-frame { position: relative; width: fit-content; max-width: 100%; overflow: hidden; line-height: 0; touch-action: pan-y; }
.crop-frame.cropping { touch-action: none; user-select: none; cursor: crosshair; }
.crop-frame img { display: block; width: auto; height: auto; max-width: 100%; max-height: 32svh; object-fit: contain; }
#crop-overlay { position: absolute; inset: 0; border: 2px solid var(--blue); box-shadow: 0 0 0 1000px #20251f80; pointer-events: none; }
summary { cursor: pointer; font-size: 14px; padding-block: 15px; min-height: 48px; }
.optional { float: right; color: var(--muted); font-size: 12px; padding-top: 2px; }
.crop-controls .micro { margin-top: 0; }
.crop-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.crop-sliders label { display: grid; gap: 8px; min-width: 0; }
.crop-sliders input { width: 100%; min-height: 28px; margin: 0; }
label { font-size: 13px; color: var(--muted); }
.consent { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.5; color: #454c3f; margin: 16px 0; padding-block: 6px; min-height: 44px; cursor: pointer; }
.consent input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--blue); }
input[type="range"], input[type="checkbox"] { accent-color: var(--blue); }
input:not([type="checkbox"]):not([type="range"]):not([type="file"]), select, textarea { width: 100%; min-width: 0; min-height: 46px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fffefa; color: #232720; margin-top: 7px; font-size: 16px; }
.data-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0; }
.data-settings > label:first-child { grid-column: 1/-1; }
.data-settings > label { min-width: 0; }
#review-image { display: block; max-width: 100%; max-height: 260px; margin: 0 auto 16px; object-fit: contain; }
.table-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { text-align: left; padding: 12px 8px; font-size: 12px; color: var(--muted); background: #eeefe6; font-weight: 400; }
th:first-child { width: 58%; }
th:last-child { width: 44px; }
td { border-top: 1px solid #e6e8df; padding: 6px 4px; }
td:first-child { padding-left: 8px; }
td input:not([type]), td input[type="number"] { margin: 0; padding-inline: 8px; }
.remove-row { background: none; border: 0; font-size: 25px; color: #6b7266; width: 40px; height: 46px; }
.table-footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: var(--muted); font-size: 13px; margin-top: 4px; }
.chart-card { border: 1px solid var(--line); border-radius: 12px; background: #fafaf5; overflow: hidden; padding-top: 6px; }
.sort-control { min-height: 40px; display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding-inline: 16px; font-size: 12px; cursor: pointer; }
#chart svg { width: 100%; height: auto; display: block; }
.bar { animation: grow .5s ease-out both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.download-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 22px; }
.download-actions .button { font-size: 14px; padding-inline: 10px; }
.description { font-size: 18px; line-height: 1.45; letter-spacing: -.015em; }
.disclosure { border-bottom: 1px solid var(--line); }
.disclosure p, .disclosure li { font-size: 14px; line-height: 1.6; color: var(--muted); }
.disclosure ul { padding-left: 20px; margin: 0 0 16px; }
.disclosure p { margin-bottom: 16px; }
#share-options label { display: block; margin: 16px 0 8px; }
#share-options textarea { line-height: 1.5; resize: vertical; }
.export-buttons, .actions { display: flex; flex-wrap: wrap; gap: 16px; }
.export-buttons .button { font-size: 14px; }
#another-chart { margin-top: 18px; }
.about { max-width: 540px; margin: 18px auto 12px; text-align: center; color: var(--muted); }
.about summary { font-size: 12px; }
.about p { font-size: 13px; line-height: 1.6; text-align: left; margin-bottom: 12px; }
.about a { display: inline-block; font-size: 13px; padding: 12px; }
footer { max-width: 640px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 16px max(16px, env(safe-area-inset-bottom)); font-size: 12px; color: var(--muted); }
footer nav { display: flex; gap: 20px; }
footer a { text-decoration: none; padding-block: 14px; }
#notice { margin: 12px 0 18px; padding: 14px 16px; background: #f0efe1; border-radius: 10px; line-height: 1.5; font-size: 14px; color: #514e2a; overflow-wrap: anywhere; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-width: 700px) {
  .top { height: 88px; padding-inline: 32px; }
  .intro { padding-top: 32px; padding-bottom: 32px; }
  .intro p { font-size: 17px; }
  .upload-target { padding: 34px; gap: 20px; }
  .desktop-label { display: inline; }
  .mobile-label { display: none; }
  .upload-cta { max-width: 220px; }
  .about { margin-top: 24px; }
  .crop-frame img { max-height: 380px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
