.board-tools { height: auto; flex-wrap: wrap; }
.board-tools > .tool-group:first-child { flex-wrap: wrap; }
.history-tools { margin-left: auto; }
.paint-panel { padding: 13px 15px 9px; border-top: 1px solid #e0e6d8; background: #f7f9f1; }
.paint-panel [hidden], .paint-panel[hidden] { display: none !important; }
.paint-heading, .paint-heading > div, .paint-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.paint-heading { margin-bottom: 10px; }
.paint-heading strong { font-size: 13px; font-weight: 600; color: #3a5540; }
.paint-heading span { color: #8a9680; font-size: 11px; }
.paint-heading .action-button { color: #406b48; border-color: #d3dfc9; }
.paint-tools { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.paint-tool { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; padding: 7px 11px; border: 1px solid #dce2d3; border-radius: 6px; background: #fffefa; color: #66745e; font-size: 12px; white-space: nowrap; }
.paint-tool[aria-pressed='true'] { color: #fff; background: #426d4d; border-color: #426d4d; }
.paint-tool svg, .paint-panel .action-button svg { width: 16px; height: 16px; }
.paint-options, .paint-options label, .paint-color-options, #paint-swatches { display: flex; align-items: center; gap: 9px; }
.paint-options { min-height: 37px; flex-wrap: wrap; column-gap: 18px; font-size: 12px; color: #63725b; }
.paint-options small { font-size: 10px; color: #87917c; white-space: nowrap; }
.paint-color-options { flex-wrap: wrap; max-width: 100%; }
#paint-swatches { display: grid; grid-template-columns: repeat(10, 28px); gap: 6px; }
.paint-swatch { position: relative; width: 28px; height: 28px; border-radius: 6px; border: 3px solid #f7f9f1; background: var(--swatch-color); box-shadow: 0 0 0 1px #dce2d3; }
.paint-swatch[aria-pressed='true'] { box-shadow: 0 0 0 2px #42634b; }
.paint-swatch[aria-pressed='true']::after { content: ''; position: absolute; left: 7px; top: 4px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.paint-swatch[data-color='yellow'][aria-pressed='true']::after,
.paint-swatch[data-color='bright-yellow'][aria-pressed='true']::after { border-color: #26372b; }
.paint-options input, .paint-options select { min-height: 34px; border: 1px solid #d6decc; border-radius: 5px; padding: 5px 8px; background: #fffefa; color: #364d3c; font: inherit; }
.paint-options input { width: 67px; }
.paint-opacity-control { display: flex; align-items: center; flex-wrap: wrap; flex-basis: 100%; gap: 8px; margin: 5px 0 3px; }
.paint-opacity-control > label { white-space: nowrap; }
.paint-opacity-control input[type='range'] { width: 140px; min-width: 70px; max-width: 180px; flex: 1; height: 24px; min-height: 0; padding: 0; border: 0; background: transparent; accent-color: #426d4d; cursor: pointer; }
.paint-opacity-control .paint-opacity-value { gap: 4px; }
.paint-opacity-control input[type='number'] { width: 57px; padding: 5px; text-align: center; font-variant-numeric: tabular-nums; }
.paint-opacity-reset { padding: 6px 8px; border: 1px solid #d6decc; border-radius: 5px; background: #fffefa; color: #63725b; font: inherit; }
.paint-opacity-reset:not(:disabled):hover { background: #eaf0e2; }
.paint-opacity-control small { margin-left: 3px; }
.paint-range-options { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; flex-basis: 100%; }
.paint-range-shapes { display: flex; gap: 3px; padding: 3px; background: #eaf0e2; border: 1px solid #dce2d3; border-radius: 6px; }
.paint-shape { display: flex; align-items: center; gap: 4px; padding: 6px 9px; border: 0; border-radius: 4px; background: transparent; color: #748169; font: inherit; }
.paint-shape svg { width: 14px; height: 14px; }
.paint-shape[aria-pressed='true'] { color: #31583b; background: #fffefa; box-shadow: 0 1px 3px #233c2417; }
.paint-footer { margin-top: 6px; font-size: 11px; color: #859078; }
.paint-footer .action-button { flex-shrink: 0; font-size: 11px; }
.is-annotating, .is-annotating .cell, .is-annotating .unit { touch-action: none; user-select: none; cursor: crosshair; }
.annotation-fill { position: absolute; inset: 0; z-index: 4; background: color-mix(in srgb, var(--annotation-color) var(--annotation-opacity, 90%), transparent); box-shadow: inset 0 0 0 .5px #ffffffe6; pointer-events: none; }
.annotation-number { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 7; color: #fffef5; font-size: clamp(13px, 1.6vw, 23px); font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: -1px -1px 0 #203324, 1px -1px 0 #203324, -1px 1px 0 #203324, 1px 1px 0 #203324, 0 2px 3px #15231d80; pointer-events: none; user-select: none; }
.cell.has-annotation-number .spawn-order { display: none; }
.cell.annotation-target { outline: 1px dashed #fff8dd; outline-offset: -2px !important; }
@media (max-width:540px) {
  .paint-panel { padding: 11px 9px 7px; }
  .paint-tools { gap: 4px; }
  .paint-tool { padding: 7px 6px; gap: 3px; font-size: 11px; min-height: 37px; }
  .paint-tool svg { width: 14px; height: 14px; }
  .paint-color-options, .paint-options label { gap: 7px; }
  #paint-swatches { grid-template-columns: repeat(5, 27px); gap: 5px; }
  .paint-swatch { width: 27px; height: 27px; }
  .paint-opacity-control { column-gap: 6px; }
  .paint-opacity-control input[type='range'] { max-width: none; }
  .paint-opacity-control small { flex-basis: 100%; margin: 0; }
  .paint-footer { align-items: flex-start; gap: 5px; }
  #paint-hint { line-height: 1.6; padding-top: 7px; }
  .annotation-number { font-size: 12px; }
}
