/* App-only styles. Colour tokens live in theme.css. */

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background-color .18s ease, color .18s ease;
}

/* ---------- stage ---------- */

#stage {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 120px;
}

#empty {
  width: min(560px, 100%);
  padding: 64px 24px;
  border: 1px dashed var(--dropzone);
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
#empty:hover, #empty.over {
  border-color: var(--dropzone-hover);
  background: var(--dropzone-tint);
}
#empty .big { margin: 0 0 8px; font-size: 20px; font-weight: 600; }
#empty .small { margin: 0; font-size: 13px; color: var(--text-dim); }

#wrap { position: relative; line-height: 0; }

#canvas {
  display: block;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 144px);
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--canvas-edge), var(--shadow-canvas);
  cursor: crosshair;
  touch-action: none;
}

/* inline text editor */
#textinput {
  position: absolute;
  border: 0;
  outline: 0;
  border-radius: 6px;
  font-weight: 700;
  font-family: inherit;
  padding: 6px 10px;
  min-width: 40px;
  line-height: 1.15;
  box-shadow: 0 0 0 2px var(--focus-ring);
  /* background + colour are set from the active annotation colour */
}

/* ---------- info button ---------- */

#info {
  position: fixed;
  top: 20px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-toolbar);
  color: var(--icon);
  transition: background-color .12s, color .12s;
}
#info:hover { background: var(--surface-hover); color: var(--icon-strong); }
#info svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- download link ---------- */

/* mirrors #info in the opposite corner; stripped from the desktop build */
#download {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 19px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-toolbar);
  color: var(--icon);
  font-size: 13px;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
#download:hover { background: var(--surface-hover); color: var(--icon-strong); }
#download svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- toolbar ---------- */

#toolbar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-toolbar);
  user-select: none;
  transition: background-color .18s ease, border-color .18s ease;
}

#toolbar button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--icon);
  cursor: pointer;
  transition: background-color .12s, color .12s;
}
#toolbar button:hover { background: var(--surface-hover); color: var(--icon-strong); }
#toolbar button:active { transform: scale(.94); }
#toolbar .tool.active { background: var(--surface-active); color: var(--icon-strong); }

#toolbar svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sep {
  width: 1px;
  height: 24px;
  margin: 0 9px;
  background: var(--divider);
}

#colors { display: flex; align-items: center; gap: 6px; }

.swatch {
  width: 26px !important;
  height: 26px !important;
  background: var(--c) !important;
  box-shadow: inset 0 0 0 1px var(--swatch-edge);
}
.swatch:hover { transform: scale(1.08); }
.swatch.active {
  box-shadow: inset 0 0 0 1px var(--swatch-edge),
              0 0 0 2px var(--surface),
              0 0 0 4px var(--c);
}

/* copy confirms with a checkmark for a moment */
#copy .icon-check { display: none; }
#copy.done .icon-copy { display: none; }
#copy.done .icon-check { display: block; }
#toolbar button#copy.done,
#toolbar button#copy.done:hover { color: var(--ok); background: transparent; }

/* light / dark toggle shows the mode you are in */
#theme .icon-sun { display: none; }
:root[data-theme="dark"] #theme .icon-sun { display: block; }
:root[data-theme="dark"] #theme .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #theme .icon-sun { display: block; }
  :root:not([data-theme="light"]) #theme .icon-moon { display: none; }
}

/* ---------- toast ---------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(6px);
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--toast-bg);
  border: 1px solid var(--toast-border);
  color: var(--toast-text);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
