:root {
  color-scheme: light;
  font-family: "Noto Sans KR", system-ui, sans-serif;
  color: #1f2622;
  background: #f2f4f1;
  --green: #215944;
  --line: #dce3dd;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header { background: #17382d; color: white; padding: 19px max(24px, calc((100% - 1170px) / 2)); }
.brand { display: flex; gap: 11px; align-items: center; font-weight: 750; font-size: 1.2rem; }
.mark { width: 23px; height: 23px; border-radius: 6px; border: 2px solid #b8e4c5; box-shadow: inset 0 -7px #b8e4c5; }
main { display: grid; grid-template-columns: 255px minmax(0, 1fr); gap: 20px; max-width: 1218px; margin: 30px auto; padding: 0 24px; }
aside, .main-panel { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 20px; min-width: 0; }
aside { align-self: start; }
.section-title, .editor-heading, .instructions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
h2 { margin: 0; font-size: 1.08rem; }
button, select, input { font: inherit; }
button, select { border: 1px solid var(--line); background: white; color: inherit; border-radius: 9px; padding: 8px 12px; min-height: 40px; cursor: pointer; font-size: .875rem; }
button:hover:not(:disabled) { background: #ecf4ee; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--green); border-color: var(--green); color: white; font-weight: 650; }
button.primary:hover:not(:disabled) { background: #173e30; }
.camera { width: 100%; margin-top: 12px; }
#empty-library, #status, #hint { font-size: .875rem; color: #526359; }
#status:empty { display: none; }
#library { list-style: none; padding: 0; margin: 12px 0 0; max-height: 55vh; overflow: auto; }
#library button { width: 100%; text-align: left; margin: 3px 0; overflow-wrap: anywhere; }
#library button[aria-current], [aria-pressed="true"] { background: #def0e4; border-color: #a7cdb4; color: #15462e; }
#welcome { min-height: 540px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: #f7faf7; border-radius: 12px; padding: 22px; }
#welcome h1 { margin: 25px 0 0; font-size: clamp(1.45rem, 4vw, 2.3rem); letter-spacing: -.045em; }
#welcome p { color: #526359; margin: 10px 0 22px; }
.illustration { width: 153px; padding: 27px 23px; display: grid; gap: 9px; transform: rotate(-7deg); background: white; border: 1px solid #cddfd0; border-radius: 13px; box-shadow: 10px 10px #dcebe0; }
.illustration i { height: 7px; border-radius: 3px; background: #dce9df; }
.illustration i:nth-child(2n) { width: 62%; height: 11px; background: #285943; }
.editor-heading { margin-bottom: 14px; }
#rename { display: flex; gap: 6px; flex: 1; min-width: 0; }
#save-title { flex-shrink: 0; }
#title { min-width: 0; width: 100%; padding: 7px; font-size: 1.22rem; font-weight: 700; border: 1px solid var(--line); border-radius: 8px; }
.danger { color: #9a3030; flex-shrink: 0; }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.zoom { margin-left: auto; font-size: .875rem; }
.instructions { min-height: 52px; }
#viewport { overflow: auto; max-height: 72vh; background: #e8ede9; border-radius: 10px; }
#photo { position: relative; touch-action: none; line-height: 0; }
#photo[data-mode="study"] { touch-action: pan-x pan-y; }
#image { width: 100%; display: block; user-select: none; }
#overlay { position: absolute; inset: 0; }
.mask, .selection { position: absolute; padding: 0; min-height: 0; border: 0; border-radius: 2px; background: #183f31; }
button.mask:hover:not(:disabled) { background: #285d49; }
button.mask.revealed, button.mask.revealed:hover:not(:disabled) { background: transparent; outline: 2px dashed #267454; outline-offset: -2px; }
.selection { pointer-events: none; background: #72e5a53a; border: 2px dashed #137753; }
@media (max-width: 720px) {
  main { grid-template-columns: 1fr; padding: 0 12px; margin: 14px auto; gap: 12px; }
  aside, .main-panel { padding: 13px; }
  #welcome { min-height: 340px; }
  #library { max-height: 130px; }
}
