@font-face { font-family: "Andika"; src: url("/assets/Andika-Bold.woff2?v=db0e812f") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Andika"; src: url("/assets/Andika-Regular.woff2?v=73da685b") format("woff2"); font-weight: 400; font-display: swap; }
:root { --paper: #fffaf2; --card: #ffffff; --line: #e8dfd0; --ink: #23262b; --ink-2: #5c5f66; --accent: #e8553d; --accent-2: #b93a26; --chip: #f3ece0; --sun: #ffcf4a; --c1: #ffd3c9; --c2: #ffe8a3; --c3: #cdeccf; --c4: #cfe6fb; --c5: #e6d7fb; --c6: #ffd9ec; --hf: "Andika", "Trebuchet MS", sans-serif; --bar: 64px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body.editor-page { overflow: hidden; overscroll-behavior: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, b { font-family: var(--hf); }
svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ed { position: fixed; inset: 0; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.ed-app { flex: 1; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); min-height: 0; min-width: 0; }
.ed-app > * { min-width: 0; }
.ed-top { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--card); border-bottom: 1px solid var(--line); position: relative; }
.ed-title { flex: 1; min-width: 0; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-topbtns { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 420px) { .ed-topbtns [data-act=png] { display: none; } .edb.icon { width: 44px; min-width: 44px; } .ed-title { font-size: 16px; } }
.ed-brand { font-family: var(--hf); font-weight: 700; font-size: 20px; text-decoration: none; color: inherit; display: flex; gap: 8px; align-items: center; }
.ed-brand span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; }
/* buttons: big, round, easy to hit */
.edb { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 48px; min-height: 48px; padding: 6px 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.edb.icon { padding: 0; width: 48px; font-size: 26px; }
.edb:disabled { opacity: .35; cursor: default; }
.edb[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.edb.big { min-height: 56px; padding: 10px 22px; font-size: 18px; }
.edb.primary { background: color-mix(in srgb, var(--accent) 78%, #000); border-color: transparent; color: #fff; }
.edb.danger { background: #b3261e; border-color: #b3261e; color: #fff; }
.ed-menu { position: absolute; right: 10px; top: 100%; z-index: 20; display: flex; flex-direction: column; min-width: 250px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 6px; }
.ed-menu > * { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px; border: 0; background: none; font: inherit; font-weight: 600; text-align: left; border-radius: 10px; cursor: pointer; color: inherit; }
.ed-menu > *:hover { background: var(--chip); } .ed-menu .danger { color: #b3261e; }
.ed-gap { flex-wrap: wrap; } .ed-gap input { flex: 1; min-width: 120px; }
/* drawing area */
.ed-stage { position: relative; overflow: hidden; background: color-mix(in srgb, var(--chip) 70%, var(--paper)); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: crosshair; }
.ed[data-tool="fill"] .ed-stage { cursor: pointer; }
.ed-board { position: absolute; left: 0; top: 0; transform-origin: 0 0; box-shadow: 0 6px 30px rgba(35,38,43,.18); background: #fff; }
.ed-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: auto; }
.ed-zoom { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.ed-zoom .edb { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.ed-status { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); margin: 0; padding: 8px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 15px; pointer-events: none; }
.ed-status[data-kind="error"] { background: #b3261e; }
/* tools */
.ed-tools { background: var(--card); border-top: 1px solid var(--line); padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; max-height: 42vh; overflow-y: auto; }
.ed-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ed-row label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.ed-row input[type=range] { width: 140px; height: 32px; accent-color: var(--accent); }
.edb.tool { flex-direction: column; gap: 2px; min-width: 76px; font-size: 13px; padding: 4px 10px; }
.ed-current { width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--ink); margin-left: auto; }
.edb.pat { min-height: 44px; font-size: 14px; padding: 4px 12px; }
.ed-patprev { width: 44px; height: 44px; border-radius: 10px; border: 2px solid var(--line); }
.ed-palette { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.sw { width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(0,0,0,.18); cursor: pointer; padding: 0; touch-action: manipulation; }
.sw[aria-pressed="true"] { outline: 4px solid var(--ink); outline-offset: 2px; }
.edb.pick { position: relative; overflow: hidden; font-size: 14px; }
.edb.pick input { width: 30px; height: 30px; border: 0; padding: 0; background: none; }
input[type=color] { width: 40px; height: 40px; border: 2px solid var(--line); border-radius: 10px; padding: 2px; background: var(--card); }
/* landscape on tablets and phones: tools on the left */
@media (orientation: landscape) and (min-width: 700px) {
  .ed-app { grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .ed-app > .ed-top { grid-column: 1 / -1; }
  .ed-tools { grid-row: 2; grid-column: 1; max-height: none; border-top: 0; border-right: 1px solid var(--line); }
  .ed-stage { grid-row: 2; grid-column: 2; }
}
@media (orientation: landscape) and (max-height: 500px) { .ed-top { padding: 4px 8px; } .ed-app { grid-template-columns: 250px minmax(0, 1fr); } .sw { width: 34px; height: 34px; } .edb.tool { min-width: 64px; } }
/* dialog */
.ed-dialog { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0,0,0,.4); padding: 20px; }
.ed-dialog > div { background: var(--card); border-radius: 20px; padding: 22px; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.ed-dialog p { font-size: 19px; font-weight: 600; margin: 0 0 18px; }
.ed-dlgbtns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
/* start screen */
.ed-start { flex: 1; overflow-y: auto; }
.ed-startbody { max-width: 900px; margin: 0 auto; padding: 24px 18px 60px; }
.ed-startbody h1 { font-size: clamp(28px, 5vw, 42px); margin: 0 0 8px; }
.ed-startbody .lead { color: var(--ink-2); font-size: 18px; } .meta { color: var(--ink-2); font-size: 14px; }
.ed-startbtns { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 6px; }
.ed-saved { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.ed-saved li { position: relative; } .ed-saved a { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; font-weight: 700; }
.ed-saved img { width: 100%; height: auto; aspect-ratio: 13 / 18; object-fit: contain; background: #fff; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.ed-saved .del { position: absolute; right: -6px; top: -6px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); font-size: 20px; cursor: pointer; }
.ed-print { display: none; }
@media print {
  @page { size: A4; margin: 8mm; }
  body.editor-page { overflow: visible; background: #fff; }
  .ed { position: static; padding: 0; } .ed > *:not(.ed-print) { display: none !important; }
  .ed-print { display: block; width: 100%; height: auto; max-height: 270mm; object-fit: contain; }
}
