/* Watermark tool — additive to utility.css, which supplies the hero, drop
   zone, option groups, status line and result actions. */

.wm-workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; min-height: 540px; box-shadow: var(--shadow); }
/* An author `display` beats the UA's [hidden] rule, so these would otherwise
   render before there is anything to put in them. */
.wm-workspace[hidden], .wm-result[hidden], .drop-zone[hidden], .option-group[hidden] { display: none; }

.wm-options { padding: 22px; background: #fafbfc; border-right: 1px solid var(--line); }
.wm-options h2 { margin: 0 0 18px; font-size: 17px; }
.wm-options .button.wide { width: 100%; margin-bottom: 9px; }
.wm-options label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.wm-options input[type="text"], .wm-options select { border: 1px solid var(--line); border-radius: 8px; padding: 9px; font: inherit; color: var(--ink); background: #fff; }
.wm-options input[type="color"] { width: 100%; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.wm-options input[type="range"] { width: 100%; }
/* Name on the left, current value on the right, slider across both — a
   float cannot do this inside a grid label, it just drops to its own row. */
.wm-slider { grid-template-columns: 1fr auto; align-items: baseline; }
.wm-slider input[type="range"] { grid-column: 1 / -1; }
.wm-options label b { color: var(--ink); font-variant-numeric: tabular-nums; }

.option-label { font-weight: 700; font-size: 13px; }
.option-hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.wm-two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.wm-toggle { display: flex; gap: 6px; }
.wm-type { flex: 1; min-height: 40px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.wm-type.is-active { background: var(--purple); border-color: var(--purple); color: #fff; }

/* Nine buttons laid out as the nine places they represent — quicker to read
   than a list of words. */
.wm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; max-width: 150px; }
.wm-pos { aspect-ratio: 1; min-height: 40px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; position: relative; }
.wm-pos::after { content: ''; position: absolute; inset: 30%; border-radius: 2px; background: #c3cbd9; }
.wm-pos:hover { background: #f2f4f8; }
.wm-pos.is-active { border-color: var(--purple); background: #f0edff; }
.wm-pos.is-active::after { background: var(--purple); }

.wm-stage-wrap { padding: 22px; display: flex; flex-direction: column; min-width: 0; }
.wm-stage { position: relative; display: inline-block; align-self: center; max-width: 100%; line-height: 0; background: #fff repeating-conic-gradient(#eef1f6 0% 25%, #fff 0% 50%) 50% / 18px 18px; }
.wm-stage canvas { display: block; max-width: 100%; height: auto; }

.wm-handle { position: absolute; border: 2px dashed #fff; box-shadow: 0 0 0 1px #14203366; border-radius: 4px; cursor: move; touch-action: none; }
.wm-handle:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }

.wm-readout { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.wm-readout b { color: var(--ink); }

.wm-result { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; text-align: center; }
.wm-result img { max-width: 100%; max-height: 240px; border: 1px solid var(--line); border-radius: 10px; background: #fff repeating-conic-gradient(#eef1f6 0% 25%, #fff 0% 50%) 50% / 14px 14px; }
.wm-result .result-actions { justify-content: center; }

@media (max-width: 860px) {
  .wm-workspace { grid-template-columns: 1fr; }
  .wm-options { border-right: 0; border-bottom: 1px solid var(--line); }
  /* The whole point on a phone is that these stay thumb-sized. */
  .wm-pos { min-height: 44px; }
  .wm-grid { max-width: 100%; }
}
