:root { font: 16px/1.35 system-ui,sans-serif; color: #17253f; background: #f6f8fc; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.appbar,.toolbar,.inspector,.bottom { display: flex; align-items: center; gap: .45rem; padding: .46rem clamp(.45rem,2vw,1.3rem); background: white; border-bottom: 1px solid #dbe3ee; flex: none; }
.appbar { gap: .9rem; }
h1 { margin: 0 auto 0 0; font-size: 1.15rem; white-space: nowrap; }
h1 span { color: #2457d6; }
.project-name { flex: 1 1 13rem; min-width: 8rem; }
#project-name { width: 100%; font-weight: 650; }
.files,.controls,.zoom { display: flex; align-items: center; gap: .4rem; }
.toolbar,.inspector,.bottom { overflow-x: auto; }
.inspector { background: #edf3fd; }
button,select,input,textarea { font: inherit; }
button,select,input[type="number"],input[type="text"] { border: 1px solid #d0daea; background: #fff; border-radius: 8px; color: inherit; min-height: 38px; padding: .38rem .63rem; font-size: .875rem; }
button,select,input[type="color"],input[type="checkbox"] { cursor: pointer; }
button { white-space: nowrap; font-weight: 650; }
button:hover:not(:disabled),button[aria-pressed="true"] { background: #e6eeff; border-color: #7499ed; }
button.primary { background: #2457d6; color: white; border-color: #2457d6; }
button.primary:hover:not(:disabled) { background: #1944b1; color: white; }
button:disabled { opacity: .43; cursor: default; }
:focus-visible { outline: 2px solid #2457d6; outline-offset: -2px; }
.divider { width: 1px; align-self: stretch; background: #dbe3ee; margin-inline: .15rem; flex: none; }
.inspector label { display: inline-flex; gap: .3rem; align-items: center; white-space: nowrap; font-size: .875rem; }
input[type="color"] { width: 35px; height: 35px; border: 1px solid #d0daea; border-radius: 8px; background: #fff; padding: 3px; }
#weight { width: 62px; }
#label { width: 9rem; }
#stage { position: relative; overflow: hidden; flex: 1; min-height: 0; }
#board { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#board:active { cursor: grabbing; }
#board[data-mode] { cursor: crosshair; }
#editor { position: absolute; resize: none; background: white; border: 2px solid #2457d6; border-radius: 6px; padding: .45rem; z-index: 1; }
.hint { position: absolute; top: .7rem; left: 50%; transform: translateX(-50%); max-width: 90%; width: max-content; pointer-events: none; background: #1c3159; color: white; padding: .55rem .8rem; border-radius: 9px; box-shadow: 0 5px 20px #182b6122; font-size: .875rem; }
.bottom { justify-content: space-between; border: 0; border-top: 1px solid #dbe3ee; }
#status { font-size: .82rem; color: #425572; }
.zoom { flex: none; }
#reset { min-width: 70px; }
dialog { width: min(94vw,540px); color: inherit; background: #fff; border: 1px solid #dbe3ee; border-radius: 16px; padding: 1.25rem; box-shadow: 0 18px 55px #17253f35; }
dialog::backdrop { background: #17253f78; }
dialog h2 { margin: 0; font-size: 1.25rem; }
dialog form { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 630px) {
  .appbar { flex-wrap: wrap; gap: .4rem; }
  .files { order: 2; width: 100%; flex-wrap: wrap; }
  .project-name { flex-basis: 100%; }
  .bottom { flex-wrap: wrap; gap: .25rem; }
  .zoom { max-width: 100%; overflow-x: auto; }
  button,select { min-height: 41px; }
}
.inspector { position: absolute; z-index: 2; top: .55rem; left: .55rem; right: .55rem; width: max-content; max-width: calc(100% - 1.1rem); border: 1px solid #dbe3ee; border-radius: 12px; box-shadow: 0 5px 16px #182b611a; padding-inline: .5rem; }
#stage:has(.inspector:not([hidden])) .hint { top: 4.35rem; }
#shape { width: 7rem; }
#sticker { width: 7rem; }
#note-color, #font { max-width: 7rem; }
@media (max-width: 630px) {
  .toolbar { flex-wrap: wrap; }
  .toolbar .divider { display: none; }
}
.icon-button { display: grid; place-items: center; flex: none; width: 41px; padding: 0; }
.icon-button svg { display: block; width: 21px; height: 21px; }
#edit .confirm-icon, #edit[data-editing="true"] .edit-icon { display: none; }
#edit[data-editing="true"] .confirm-icon { display: block; }
#close-dialog { width: min(94vw, 630px); }
#close-dialog form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#close-dialog button { white-space: normal; overflow-wrap: anywhere; }
