:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --acc: #1f6f78; --acc-ink: #fff; --ink: #1c2429; --sub: #5d6a73; --line: #d5dbe0; --field: #f3f5f7; }
* { box-sizing: border-box; }
body { margin: 0; background: #f2f3f5; color: var(--ink); }
.app { width: min(100%, 760px); margin: 0 auto; padding: 20px 14px calc(28px + env(safe-area-inset-bottom)); }
.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
h1 { margin: 0 0 12px; font-size: 25px; }
.version { color: #687382; font-size: 12px; white-space: nowrap; }
.drag-help { margin: 8px 0 0; color: var(--sub); font-size: 12.5px; line-height: 1.4; text-align: center; }
.controls { display: grid; gap: 4px; padding: 14px 14px 6px; background: #fff; border-radius: 14px; box-shadow: 0 1px 4px #00000012; }
input, button { min-height: 44px; font: inherit; font-size: 16px; }
button, .file-label { border: 0; border-radius: 12px; padding: 10px 14px; background: #3d4653; color: #fff; text-align: center; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
.file-label input { display: none; }
.text-inputs { display: grid; gap: 6px; }
.text-row { display: grid; grid-template-columns: 30px 1fr 44px; align-items: center; gap: 6px; }
.color-dot { width: 22px; height: 22px; min-height: 22px; padding: 0; border-radius: 50%; border: 1px solid #555; cursor: pointer; }
.color-dot.dup { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.input-wrap { position: relative; }
.input-wrap input[type="text"] { width: 100%; min-height: 40px; height: 40px; border: 0; border-radius: 10px; padding: 6px 40px 6px 11px; background: var(--field); color: var(--ink); }
.clear-x { position: absolute; right: 0; top: 0; width: 40px; min-height: 40px; height: 40px; padding: 0; border-radius: 10px; background: transparent; color: var(--sub); font-size: 20px; line-height: 1; }
.clear-x[hidden] { display: none; }
.size-cycle-button { width: 44px; min-height: 44px; height: 44px; padding: 0; background: transparent; }
.size-glyph { display: grid; place-items: center; width: 32px; height: 32px; margin: auto; border: 1px solid var(--line); border-radius: 9px; color: var(--sub); font-weight: 700; line-height: 1; overflow: hidden; }
.text-link { justify-self: end; min-height: 44px; padding: 0 6px; background: transparent; color: var(--sub); font-size: 13px; }
.status { min-height: 1.2em; margin: 6px 0 0; color: #5e6873; }
.save-hint { margin: 8px 4px 0; color: var(--sub); font-size: 12.5px; line-height: 1.4; }
.editor { margin-top: 14px; }
.actions { display: flex; gap: 8px; margin-top: 12px; }
.actions > * { flex: 1; min-width: 0; font-weight: 700; }
.actions .file-label { display: flex; align-items: center; justify-content: center; background: transparent; color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
#saveButton { background: var(--acc); color: var(--acc-ink); }
/* The stage is intentionally not a flex item. Its explicit pixels are set from the canvas rect. */
.stage-area { width: 100%; text-align: center; overflow: hidden; }
.stage-wrap { position: relative; display: block; margin: 0 auto; line-height: 0; background: #ddd; transform-origin: 0 0; }
#photoCanvas { display: block; width: 100%; height: 100%; }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; touch-action: none; }
/* 배경, 모서리, 글자 그림자는 app.js의 BOX_* 상수로 정해짐(저장 이미지와 같은 값). 아래는 대비용 기본값. */
.caption { position: absolute; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; background: rgba(18, 22, 26, .60); border-radius: 4px; color: #fff; line-height: 1.25; font-weight: 700; user-select: none; -webkit-user-select: none; touch-action: none; cursor: grab; }
.caption.dragging { cursor: grabbing; }
.toast { position: fixed; left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); max-width: 732px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 4px 0 16px; border-radius: 12px; background: #2a3238; color: #eef1f3; font-size: 14px; box-shadow: 0 6px 18px #0000004d; }
.toast[hidden] { display: none; }
.toast button { background: transparent; color: #5fc0c9; font-weight: 700; }
@media (max-width: 400px) { .app { padding-inline: 10px; } }
