* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: "Trebuchet MS", system-ui, sans-serif; background: #1d2b3a; color: #fff; -webkit-tap-highlight-color: transparent; }
.bar { display: flex; align-items: center; gap: 1rem; padding: .8rem 1rem; background: #14202c; }
.bar h1 { margin: 0; font-size: 1.3rem; }
.home { color: #ffd76a; text-decoration: none; font-weight: bold; white-space: nowrap; }
main { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.help { margin: .25rem 0 1rem; text-align: center; line-height: 1.5; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem 1rem; margin-bottom: 1rem; padding: .85rem; border: 1px solid #46647f; border-radius: 14px; background: #26394d; }
.tool-group { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .45rem; }
.color-button { width: 38px; height: 38px; padding: 0; border: 3px solid #fff; border-radius: 50%; cursor: pointer; }
.color-button[aria-pressed="true"] { outline: 3px solid #ffd76a; outline-offset: 2px; }
.color-button:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #ffd76a; outline-offset: 3px; }
.custom-color, .brush-size { display: flex; align-items: center; gap: .45rem; font-size: .95rem; font-weight: bold; }
.custom-color input { width: 42px; height: 38px; padding: 2px; border: 2px solid #fff; border-radius: 8px; background: transparent; cursor: pointer; }
.brush-size { flex-wrap: wrap; justify-content: center; }
.brush-size input { width: 100px; accent-color: #ffd76a; }
.brush-size output { min-width: 1.5rem; color: #ffd76a; }
.tool { min-height: 42px; padding: .5rem .75rem; border: 2px solid #ffd76a; border-radius: 999px; background: #14202c; color: #fff; font: inherit; font-weight: bold; cursor: pointer; }
.tool:hover:not(:disabled), .tool[aria-pressed="true"] { background: #ffd76a; color: #14202c; }
.tool:disabled { opacity: .5; cursor: not-allowed; }
.tool.save { background: #32814a; border-color: #83d89a; }
.tool.save:hover { background: #83d89a; }
.canvas-wrap { overflow: hidden; width: 100%; border: 5px solid #d5e0eb; border-radius: 14px; background: #fff; box-shadow: 0 8px 26px rgba(0,0,0,.35); }
canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; background: #fff; cursor: crosshair; touch-action: none; }
.status { min-height: 1.5rem; margin: .8rem 0 0; color: #ffd76a; text-align: center; font-weight: bold; }
@media (max-width: 600px) {
  .toolbar { gap: .8rem; }
  .actions { width: 100%; }
  .actions .tool { flex: 1 1 auto; }
  .canvas-wrap { border-width: 3px; border-radius: 9px; }
}
