html, body { height: 100%; }
body { display: flex; flex-direction: column; background: var(--surface); overflow: hidden; }
.top { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.meta { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .dox-plan { margin: 0; min-width: 250px; }
.work { flex: 1; min-height: 0; display: flex; }
.tools { width: 86px; flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 10px 8px; background: var(--bg);
  border-right: 1px solid var(--border); overflow-y: auto; }
.tools button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--text); font: 11.5px var(--font); cursor: pointer; }
.tools button svg { width: 22px; height: 22px; }
.tools button:hover { background: var(--surface-hover); }
.tools button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.tools button:disabled { opacity: .35; cursor: default; }
.tools hr { width: 100%; border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.pro { font-style: normal; font-size: 9.5px; font-weight: 800; padding: 0 5px; border-radius: 999px; color: #fff; background: linear-gradient(95deg, var(--brand), var(--brand-2)); }
.colors { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 6px; }
.colors button { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid var(--border); justify-self: center; }
.colors button[aria-pressed="true"] { outline: 2px solid var(--brand); outline-offset: 2px; }
.size { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); text-align: center; }
.size input { width: 100%; accent-color: var(--brand); }
.stage { flex: 1; min-width: 0; overflow: auto; padding: 24px; display: flex; justify-content: center; align-items: flex-start; }
.canvas-wrap { position: relative; box-shadow: 0 8px 30px rgba(20, 20, 50, .18); background: #fff; line-height: 0; }
canvas { display: block; max-width: 100%; height: auto; cursor: crosshair; }
.loading { color: var(--muted); }
.text-box { position: absolute; min-width: 40px; padding: 2px 4px; border: 1.5px dashed var(--brand); background: rgba(255, 255, 255, .85);
  font: 600 20px/1.25 system-ui, 'Segoe UI', sans-serif; outline: none; white-space: pre; line-height: 1.25; }
.save { width: 230px; flex: none; display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--bg); border-left: 1px solid var(--border); overflow-y: auto; }
.save h2 { margin: 6px 0 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.save .btn { justify-content: center; text-decoration: none; }
.btn.ghost { background: transparent; }
.hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 8px); padding: 9px 16px; border-radius: 999px; background: var(--text); color: var(--bg);
  font-weight: 600; opacity: 0; pointer-events: none; transition: .15s; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 860px) { .save { width: 180px; } .top .dox-plan { display: none; } }
