@font-face {
  font-family: TroubleSide;
  src: url('assets/fonts/TroubleSide.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  font-family: TroubleSide, "Segoe Print", cursive;
  font-synthesis: none;
  color: #19334c;
  background: #2464b5;
  --ink: #19334c;
  --green: #a8df78;
  --red: #ff766b;
  --yellow: #ffda59;
  --line: #b7d0e9;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { height: 100dvh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .4; }
button, input { outline-offset: 3px; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--green); }
button, a, input { touch-action: manipulation; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app-shell { width: 100%; height: 100%; padding: 0 clamp(14px,3vw,42px) 14px; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); gap: 10px; }
.site-header { display: flex; align-items: center; gap: 22px; height: 72px; border-bottom: 1px solid var(--line); }
.brand { font-size: clamp(26px,3vw,39px); letter-spacing: -.5px; white-space: nowrap; }
main { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr); }
.eyebrow { font-size: 10px; letter-spacing: 1.3px; margin: 0; color: #7b8375; }
#draw-view { min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: 12px; }
.prompt-card { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 44px; gap: 20px; align-items: center; background: #e8ecd9; border: 1px solid #dce1cd; border-radius: 9px; padding: 16px 22px; overflow: hidden; }
.small-dot { width: 5px; height: 5px; border-radius: 50%; background: #728766; display: inline-block; flex-shrink: 0; }
h1 { font-size: 30px; font-weight: 400; line-height: 1.1; margin: 0; overflow-wrap: anywhere; }
.prompt-copy p { color: #68745e; font-size: 13px; line-height: 1.45; margin: 6px 0 0; max-width: 1000px; }
.prompt-copy { position: relative; z-index: 1; }
.prompt-reset-button { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #cad3ba; border-radius: 7px; background: #f6f7ee; color: var(--green); }
.prompt-reset-button:not(:disabled):hover { background: white; border-color: #a9ba91; }
.prompt-reset-button svg { width: 21px; height: 21px; }
.button { border: 1px solid transparent; min-height: 40px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 18px; font-size: 13px; transition: background .15s, transform .15s; }
.button:not(:disabled):active { transform: translateY(1px); }
.button-primary { color: var(--ink); background: var(--green); }
.button-primary:not(:disabled):hover { background: #bbed8d; }
.button-secondary { background: var(--yellow); border-color: #19334c; }
.button-secondary:not(:disabled):hover { background: #ffe888; }
#new-drawing-button { font-size: 12px; min-height: 36px; white-space: nowrap; }
#new-drawing-button svg { width: 15px; height: 15px; }
.prompt-corner { width: 100px; height: 100px; position: absolute; right: -58px; bottom: -62px; border-radius: 50%; border: 1px solid #d1d9bf; box-shadow: 0 0 0 9px #e8ecd9,0 0 0 10px #d1d9bf,0 0 0 19px #e8ecd9,0 0 0 20px #d1d9bf; pointer-events: none; }
.workspace { min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 15px; }
.canvas-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto; background: #fdfcf9; border: 1px solid #d9dbd0; border-radius: 8px; overflow: hidden; }
.canvas-topline, .canvas-bottomline { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 7px 14px; font-size: 10px; color: #8b9085; }
.canvas-topline { border-bottom: 1px solid #e5e7dc; }
.history-controls { display: flex; gap: 8px; }
.history-button { display: flex; align-items: center; gap: 5px; padding: 3px 6px; background: none; border: 0; border-radius: 4px; font-size: 11px; }
.history-button svg { width: 16px; height: 16px; }
.history-button:not(:disabled):hover { background: #e8eddc; color: var(--green); }
.canvas-stage { min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; background: #eeeee6; }
.canvas-wrap { position: relative; width: 0; height: 0; container-type: inline-size; flex-shrink: 0; background: white; box-shadow: 0 0 0 1px #dfe0d6; overflow: hidden; }
#drawing-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.canvas-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; pointer-events: none; user-select: none; }
.placeholder-scribble { font-size: clamp(12px,5cqw,35px); transform: rotate(-5deg); color: #c6cbb8; text-align: center; }
.canvas-placeholder p { color: #a4a89b; font-size: 11px; margin: 0; }
.canvas-bottomline { border-top: 1px solid #e5e7dc; font-size: 9px; min-height: 24px; }
#history-status { white-space: nowrap; color: #8a947d; }
.brush-cursor { position: absolute; border: 1px solid #23352aba; border-radius: 50%; pointer-events: none; transform: translate(-50%,-50%); box-shadow: 0 0 0 1px #ffffffad; z-index: 2; }
.tools-panel { min-width: 0; min-height: 0; display: grid; grid-template-columns: 66px minmax(0,1fr); background: #fdfcf8; border: 1px solid #d9dbd0; border-radius: 8px; overflow: hidden; }
.tool-rail { display: flex; flex-direction: column; padding: 15px 5px; gap: 8px; border-right: 1px solid #e2e3d9; }
.rail-label { font-size: 9px; letter-spacing: 1px; text-align: center; color: #8b9184; margin-bottom: 8px; }
.tool-button { background: transparent; border: 1px solid transparent; border-radius: 5px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 2px; font-size: 11px; color: #75816f; }
.tool-button svg { width: 21px; height: 21px; }
.tool-button:hover { background: #efefe7; color: #344d40; }
.tool-button[aria-pressed="true"] { background: #e8eddc; border-color: #d5dfc7; color: #35583f; }
.rail-divider { height: 1px; background: #e2e3d9; margin: 4px 8px; }
.clear-button:hover { color: #a05748; background: #f4ece3; }
.tool-options-wrap { min-width: 0; padding: 18px 16px; background: #eeeee7; display: flex; flex-direction: column; }
.tools-panel:has(fieldset:enabled) .tool-options-wrap { background: #fdfcf8; }
.options-heading { font-size: 10px; letter-spacing: .7px; display: flex; align-items: center; justify-content: space-between; color: #747e6f; margin-bottom: 23px; }
#tool-active-dot { background: #c4c9bc; }
.tools-panel:has(fieldset:enabled) #tool-active-dot { background: #80a566; }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
fieldset:disabled { opacity: .4; }
fieldset:disabled button { opacity: 1; }
.option-group + .option-group { margin-top: 24px; }
.option-group { min-width: 0; }
.option-label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; margin-bottom: 10px; gap: 3px; }
.option-label > span, .option-label > output { color: #859078; font-size: 10px; }
.size-buttons { display: flex; justify-content: space-between; gap: 3px; }
.size-buttons button { width: 32px; height: 32px; border: 1px solid transparent; border-radius: 4px; padding: 0; display: grid; place-items: center; background: transparent; }
.size-buttons button[aria-pressed="true"] { background: #eff1e6; border-color: #cfd9bf; }
.size-buttons button:not(:disabled):hover { background: #edf0e5; }
.size-buttons button span { background: #4d6453; width: var(--dot-size); height: var(--dot-size); border-radius: 50%; }
#size-options.is-disabled { opacity: .3; }
input[type="range"] { width: 100%; margin: 0; height: 16px; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { background: #d4dcc8; height: 3px; border-radius: 4px; }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #4d6856; margin-top: -4.5px; border: 2px solid #fdfcf8; box-shadow: 0 0 0 1px #4d6856; }
input[type="range"]::-moz-range-track { background: #d4dcc8; height: 3px; border-radius: 4px; }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #4d6856; border: 2px solid #fdfcf8; }
.range-ticks { display: flex; justify-content: space-between; padding: 0 5px; margin-top: 4px; }
.range-ticks span { width: 1px; height: 3px; background: #bec8b3; }
.range-labels { display: flex; justify-content: space-between; margin-top: 5px; font-size: 9px; color: #9ca58f; }
.color-palette { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; }
.palette-swatch { display: block; width: 100%; padding: 0; aspect-ratio: 1; border-radius: 50%; background: var(--swatch); border: 1px solid #00000022; }
.palette-swatch[aria-pressed="true"] { outline: 2px solid #536b47; outline-offset: 2px; }
.palette-swatch:not(:disabled):hover { transform: scale(1.1); }
.drawing-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.drawing-actions .button { min-width: 195px; }
.sign-view { min-height: 0; display: grid; grid-template-columns: minmax(0,1.4fr) minmax(300px,.8fr); gap: clamp(24px,5vw,70px); padding: 15px 2vw; }
.artwork-slot { min-width: 0; min-height: 0; container-type: size; display: grid; place-items: center; }
.photo-frame { --frame-inset: 60px; width: min(100%,calc((100cqh - var(--frame-inset)) * 1.5 + var(--frame-inset))); padding: 10px; background: linear-gradient(135deg,#c7ab83,#e2cb9f 28%,#c7a77b 65%,#bda079); border: 1px solid #a9916c; box-shadow: 0 10px 24px #3c342018,inset 0 0 0 3px #ebd9b766,inset 0 0 0 5px #a98c6555; }
.frame-mat { background: #fffefa; padding: 18px; border: 1px solid #a48d6b; box-shadow: inset 0 2px 5px #52442c20; }
.frame-mat img { display: block; width: 100%; height: auto; aspect-ratio: 3/2; background: white; border: 1px solid #eae7df; }
.sign-copy { min-width: 0; align-self: center; width: 100%; max-width: 440px; }
.sign-copy h1 { font-size: 28px; }
.sign-description { color: #68745e; font-size: 13px; line-height: 1.5; margin: 10px 0 22px; }
#signature-form label { display: block; font-size: 13px; margin-bottom: 8px; }
#author-name { width: 100%; background: #fdfcf8; border: 1px solid #cfd5c3; border-radius: 5px; padding: 12px; font-family: 'Times New Roman', serif; font-size: 20px; }
#author-name::placeholder { color: #a0a793; font-size: 13px; }
.signature-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 13px; }
.signature-mode { display: flex; padding: 3px; gap: 3px; border: 1px solid #cfd5c3; border-radius: 8px; background: #eaece1; }
.signature-mode button { display: grid; place-items: center; width: 42px; height: 33px; border: 0; border-radius: 5px; background: transparent; }
.signature-mode button[aria-pressed="true"] { color: white; background: var(--green); box-shadow: 0 1px 3px #253c3820; }
.type-symbol { font: bold 25px/1 'Times New Roman', serif; }
.signature-tools, .signature-sizes { display: flex; align-items: center; gap: 5px; }
.signature-tools { padding: 6px; border: 1px solid #cfd5c3; border-bottom: 0; border-radius: 6px 6px 0 0; background: #fdfcf8; }
.signature-tools button { width: 32px; height: 30px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 4px; background: transparent; padding: 0; }
.signature-tools button[aria-pressed="true"] { border-color: #bdcbb0; background: #e8eddc; }
.signature-tools button:hover { background: #e8eddc; }
.signature-tools svg { width: 18px; height: 18px; }
.signature-sizes { padding-right: 5px; margin-right: 1px; border-right: 1px solid var(--line); }
.signature-sizes span { width: var(--dot-size); height: var(--dot-size); border-radius: 50%; background: black; }
#clear-signature { margin-left: auto; }
.signature-pad { position: relative; overflow: hidden; background: white; border: 1px solid #cfd5c3; border-radius: 0 0 6px 6px; }
#signature-canvas { display: block; width: 100%; aspect-ratio: 3 / 1; touch-action: none; }
#signature-canvas:focus-visible { outline-offset: -3px; }
#signature-placeholder { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; color: #a2aa97; font-size: 22px; }
.signature-count { margin: 6px 0 0; font-size: 10px; text-align: right; color: #68745e; }
.signature-error { font-size: 11px; color: #a14b37; min-height: 15px; margin: 7px 0 0; }
.sign-action { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.sign-action .button { font-size: 12px; padding-inline: 12px; }
.keep-view { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto auto; gap: 12px; text-align: center; padding-top: 8px; }
.keep-view .artwork-slot { width: min(100%,900px); justify-self: center; }
.finished-heading { max-width: 850px; justify-self: center; }
#finished-title { font-size: 26px; }
#finished-description { color: #68745e; font-size: 13px; line-height: 1.5; margin: 7px 0 0; }
.finished-actions { max-width: 100%; display: flex; justify-content: center; gap: 10px; }
.finished-actions .button { min-width: 0; }
.download-status { color: #949b88; font-size: 10px; margin: 0; }
.modal { padding: 30px; width: min(430px,calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 1px solid #d9ddcf; border-radius: 13px; color: var(--ink); background: #faf9f3; box-shadow: 0 24px 100px #192e2930; }
.modal::backdrop { background: #1e312964; backdrop-filter: blur(4px); }
.modal h2 { font-size: 26px; font-weight: 400; margin: 16px 0 12px; }
.modal p { font-size: 13px; color: #7d8673; line-height: 1.6; }
.modal-icon { width: 38px; height: 38px; border-radius: 50%; background: #e7ebda; color: #698159; display: grid; place-items: center; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
@media (max-width:1100px) {
  .site-header { height: 60px; }
  .workspace { grid-template-columns: minmax(0,1fr) 237px; gap: 12px; }
  .tools-panel { grid-template-columns: 59px minmax(0,1fr); }
  .tool-options-wrap { padding: 16px 12px; }
  .prompt-card { padding: 12px 16px; }
  .prompt-copy h1 { font-size: 27px; }
}
@media (max-height:800px) {
  .site-header { height: 57px; }
  .app-shell, main { gap: 8px; }
  #draw-view { gap: 9px; }
  .prompt-card { padding: 10px 16px; }
  .prompt-copy h1 { font-size: 25px; }
  .prompt-copy p { font-size: 12px; margin-top: 4px; }
  .options-heading { margin-bottom: 15px; }
  .option-group + .option-group { margin-top: 18px; }
  .tool-options-wrap { padding-top: 14px; padding-bottom: 12px; }
}
/* Narrow or short windows put the compact tools below the paper. */
@media (max-width:640px), (max-height:620px) {
  .app-shell { padding-inline: 14px; gap: 7px; }
  .site-header { height: 52px; gap: 15px; }
  .brand { font-size: 30px; }
  #new-drawing-button { font-size: 11px; padding: 6px 11px; min-height: 33px; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto; gap: 8px; }
  .tools-panel { grid-template-columns: 1fr; }
  .tool-rail { flex-direction: row; padding: 4px 10px; border-right: 0; border-bottom: 1px solid var(--line); align-items: center; justify-content: space-between; gap: 6px; }
  .rail-label { margin: 0; font-size: 8px; }
  .tool-button { flex-direction: row; gap: 6px; padding: 6px 9px; font-size: 10px; }
  .tool-button svg { width: 17px; height: 17px; }
  .rail-divider { width: 1px; height: 19px; margin: 0; }
  .tool-options-wrap { padding: 10px 12px; }
  .options-heading { display: none; }
  #tool-options { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,.9fr) minmax(0,1.3fr); gap: 17px; align-items: start; }
  #tool-options:has(#color-options[hidden]) { grid-template-columns: 1fr 1fr; }
  .option-group + .option-group { margin-top: 0; }
  .option-label { font-size: 10px; margin-bottom: 7px; }
  .option-label > span, .option-label > output { font-size: 9px; }
  .size-buttons { gap: 1px; }
  .size-buttons button { min-width: 0; width: 25%; height: 27px; }
  .size-buttons button span { width: min(var(--dot-size),85%); height: auto; aspect-ratio: 1; max-width: 21px; }
  .range-ticks { margin-top: 0; }
  .range-labels { margin-top: 4px; font-size: 8px; }
  .color-palette { gap: 5px; }
  .palette-swatch { max-width: 25px; max-height: 25px; justify-self: center; }
  .canvas-topline { padding: 4px 10px; }
  .canvas-bottomline { padding: 4px 10px; font-size: 8px; min-height: 21px; }
  .app-shell { grid-template-rows: auto minmax(0,1fr); padding-bottom: 10px; }
  .drawing-actions .button { min-width: 0; min-height: 36px; padding: 7px 13px; font-size: 12px; }
}
@media (max-width:640px) {
  #new-drawing-button { margin-left: auto; }
  .eyebrow { font-size: 8px; letter-spacing: .8px; }
  .prompt-card { grid-template-columns: minmax(0,1fr) 44px; gap: 6px 12px; padding: 10px 13px; }
  .prompt-copy h1 { font-size: 23px; }
  .prompt-copy p { font-size: 11px; line-height: 1.4; margin-top: 5px; }
  .canvas-placeholder p { font-size: 9px; }
  .sign-view { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto; gap: 12px; padding: 4px 0; }
  .sign-copy { width: min(100%,400px); margin: auto; }
  .sign-copy h1 { font-size: 23px; }
  .sign-description { font-size: 11px; margin: 10px 0; }
  .photo-frame { --frame-inset: 44px; padding: 8px; }
  .frame-mat { padding: 12px; }
  .sign-action { margin-top: 8px; }
  .signature-heading { margin-bottom: 8px; }
  #finished-title { font-size: 23px; }
  #finished-description { font-size: 11px; }
  .finished-actions .button { font-size: 12px; padding-inline: 13px; }
  .modal { padding: 24px; }
}
@media (max-width:400px) {
  .site-header { gap: 8px; }
  #new-drawing-button { padding-inline: 7px; font-size: 10px; gap: 6px; }
  .rail-label { display: none; }
  .tool-rail { gap: 3px; padding-inline: 6px; }
  .tool-button { padding-inline: 6px; gap: 4px; }
  #tool-options { gap: 11px; }
  .option-label, .option-label > span, .option-label > output { font-size: 9px; }
  .color-palette { gap: 4px; }
}
@media (max-height:620px) and (min-width:641px) {
  .app-shell, main, #draw-view { gap: 5px; }
  .site-header { height: 43px; }
  .prompt-card { padding: 7px 12px; gap: 12px; }
  .prompt-copy h1 { font-size: 23px; }
  .prompt-copy p { font-size: 11px; margin-top: 3px; }
  .workspace { grid-template-columns: minmax(0,1fr) 235px; grid-template-rows: minmax(0,1fr); }
  .tools-panel { grid-template-columns: 47px minmax(0,1fr); }
  .tool-rail { flex-direction: column; justify-content: space-around; gap: 0; padding: 4px 2px; border-bottom: 0; border-right: 1px solid var(--line); }
  .rail-label, .rail-divider { display: none; }
  .tool-button { flex-direction: column; padding: 4px 2px; gap: 3px; font-size: 9px; }
  #tool-options { display: flex; flex-direction: column; gap: 8px; }
  .option-group { width: 100%; }
  .tool-options-wrap { padding: 7px 12px; }
  .option-label { margin-bottom: 4px; font-size: 9px; }
  .size-buttons button { height: 23px; }
  .range-ticks, .range-labels { display: none; }
  .color-palette { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 4px; }
  .palette-swatch { max-width: 16px; max-height: 16px; }
  .sign-view { padding-block: 5px; gap: 25px; }
  .sign-description { margin: 10px 0; }
  .sign-copy h1 { font-size: 23px; }
  .sign-view { grid-template-columns: minmax(0,1fr) minmax(280px,340px); }
  .sign-description { font-size: 11px; margin: 5px 0 8px; }
  .signature-heading { margin-bottom: 5px; }
  .sign-action { margin-top: 5px; }
  .signature-error { margin-top: 3px; }
  .keep-view { gap: 6px; }
}
@media (max-height:650px) and (max-width:640px) {
  .app-shell, main, #draw-view { gap: 5px; }
  .site-header { height: 44px; }
  .brand { font-size: 26px; }
  .prompt-card { padding: 7px 11px; gap: 4px; }
  .prompt-copy h1 { font-size: 21px; }
  .prompt-copy p { font-size: 10px; margin-top: 3px; }
  .tool-options-wrap { padding-block: 8px; }
  .tool-button { padding-block: 4px; }
  .sign-copy h1 { font-size: 20px; }
  .sign-description { font-size: 10px; margin: 5px 0 7px; }
  .sign-view { gap: 7px; }
  .signature-heading { margin-bottom: 5px; }
  .signature-mode button { height: 27px; }
  .signature-tools { padding-block: 3px; }
  .signature-error { margin-top: 3px; }
  .sign-action { margin-top: 4px; }
  .sign-action .button { min-height: 34px; padding-block: 6px; }
  .download-status { font-size: 8px; }
}
@media (prefers-reduced-motion:reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
