@font-face { font-family: StudyHand; src: url('./Yomogi-Regular.ttf') format('truetype'); font-display: swap; }
:root { color-scheme: light; font-family: -apple-system,BlinkMacSystemFont,'Hiragino Kaku Gothic ProN','Yu Gothic',sans-serif; color: #49373b; background: #fffaf5; }
* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(180deg,#fff8f1,#fffdf9 50%,#fff6f4); min-height: 100vh; }
header { text-align: center; padding: 28px 16px; border-bottom: 1px solid #efd9cf; background: linear-gradient(125deg,#fff3df,#fff7ed 52%,#ffe9e8); }
h1 { margin: 8px 0; color: #925a4c; font-size: 32px; line-height: 1.3; }
h1 span { display: block; font-size: 17px; margin-top: 8px; }
header p { font-size: 13px; color: #8b6b69; }
.eyebrow { letter-spacing: .15em; font-size: 10px; }
.wrap { max-width: 880px; margin: 24px auto; padding: 0 17px; }
#steps { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; margin-bottom: 18px; }
button,.button { display: inline-block; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.5; cursor: pointer; background: #b97587; color: #fff; border: 1px solid transparent; border-radius: 10px; padding: 12px 16px; min-height: 46px; max-width: 100%; text-align: center; text-decoration: none; }
button:hover,.button:hover { background: #9e5e72; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible,.button:focus-within { outline: 3px solid #874a65; outline-offset: 2px; }
.secondary,#steps button { background: #f6eeeb; color: #795964; border-color: #e9d8d5; }
#steps button { padding: 12px 6px; font-size: 13px; }
#steps button.active,.motiongrid .active { background: #ae7081; border-color: #ae7081; color: #fff; }
.panel { background: #fffefd; border: 1px solid #ede1dc; border-radius: 17px; box-shadow: 0 7px 25px #7d5c4b0a; padding: 28px 32px; margin-bottom: 18px; }
h2 { color: #78535f; border-bottom: 1px solid #ebdeda; padding-bottom: 14px; margin: 0 0 16px; font-size: 23px; }
h3 { font-size: 16px; color: #78535f; margin: 20px 0 12px; }
p { line-height: 1.85; }
.hint { font-size: 13px; color: #816f74; }
.center { text-align: center; }
label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0; color: #72515e; }
input,select,textarea { display: block; width: 100%; font: inherit; font-size: 16px; border: 1px solid #e5d8d3; border-radius: 9px; background: #fff; padding: 12px; min-height: 44px; margin-top: 7px; }
input:focus,select:focus,textarea:focus { outline: none; border-color: #9d7480; box-shadow: 0 0 0 3px #efe3e6; }
input[type=range] { accent-color: #b65d7f; padding: 0; border: 0; min-height: 30px; }
input[type=color] { padding: 4px; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 18px; flex-shrink: 0; margin: 1px 0 0; accent-color: #b65d7f; }
.check { display: flex; align-items: flex-start; gap: 9px; line-height: 1.7; }
.notice { background: #fbf6f2; border: 1px solid #eee0da; border-radius: 12px; padding: 16px; margin: 16px 0; }
.notice h3 { margin-top: 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.end { justify-content: flex-end; }
.grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
#borderControls { grid-template-columns: repeat(4,minmax(0,1fr)); }
#sheetWrap { margin: 16px auto 0; width: min(100%,560px); }
canvas,img { max-width: 100%; height: auto; }
#original { display: block; max-height: 700px; margin: 16px auto; object-fit: contain; }
#sheetCanvas { display: block; width: 100%; }
.cutgrid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 16px; }
.cut { padding: 8px; background: #fff; border: 1px solid #eee1e5; border-radius: 10px; min-width: 0; }
.cut button { padding: 0; display: block; width: 100%; background: transparent; color: #795964; }
.cut canvas,.cut img { display: block; width: 100%; }
.cut p { font-size: 12px; margin: 7px 0; overflow-wrap: anywhere; }
.checker { background: repeating-conic-gradient(#ddd 0% 25%,#fff 0% 50%) 50% / 16px 16px; }
.live { width: 320px; aspect-ratio: 320/270; max-width: 100%; margin: 16px auto; border: 1px solid #ecdde0; border-radius: 12px; overflow: hidden; }
.live canvas { width: 100%; display: block; }
.choicegrid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; margin: 12px 0; }
.choicegrid button { background: #fff; color: #65424e; border: 2px solid #eee1e5; padding: 7px; font-size: 12px; min-width: 0; border-radius: 11px; overflow-wrap: anywhere; }
.choicegrid button.active { background: #f9f0ed; border-color: #a77a86; }
.choicegrid canvas { display: block; width: 100%; margin-bottom: 7px; }
.motiongrid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.motiongrid button { background: #fff; color: #795964; border-color: #e9d8d5; }
details { border: 1px solid #f1dfe0; border-radius: 12px; padding: 12px; background: #fffdfa; margin: 16px 0; }
summary { cursor: pointer; color: #8f5970; font-size: 14px; font-weight: 600; min-height: 28px; }
#eraserCanvas { display: block; width: 100%; touch-action: none; }
progress { width: 100%; margin-top: 20px; accent-color: #b97587; }
footer { text-align: center; color: #a28e89; font-size: 12px; padding: 8px 16px 30px; }
footer details { display: inline-block; margin-left: 8px; }
#error { background: #fff0ee; color: #a12424; padding: 16px; border-radius: 10px; }
[hidden] { display: none !important; }
@media(max-width:700px) {
  #steps { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .wrap { margin: 14px auto; padding: 0 10px; }
  .panel { padding: 18px 13px; }
  h2 { font-size: 19px; line-height: 1.5; }
  .choicegrid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #borderControls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .motiongrid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .actions > button,.actions > .button { flex: 1 1 145px; }
  .panel * { min-width: 0; overflow-wrap: anywhere; }
}
@media(prefers-reduced-motion:reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

.app-icon { display: block; width: 80px; height: 80px; object-fit: contain; margin: 0 auto 12px; border-radius: 16px; }
