.fw-annotation-canvas {
  position: absolute;
  z-index: 1000;
  left: 0;
  top: 0;
  display: block;
  pointer-events: none;
  touch-action: none;
}

.fw-annotation-canvas.is-active {
  pointer-events: auto;
  cursor: crosshair;
}

.fw-annotation-canvas.is-active[data-tool="eraser"] {
  cursor: cell;
}

.fw-annotation-canvas.is-active[data-tool="text"] {
  cursor: text;
}

.fw-annotation-panel-toggle {
  --annotation-accent: #3156d8;
  --annotation-accent-rgb: 49, 86, 216;
  position: fixed;
  z-index: 1020;
  right: 0;
  top: 50%;
  width: 42px;
  height: 112px;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  gap: 5px;
  padding: 10px 0 8px;
  border: 1px solid color-mix(in srgb, var(--annotation-accent) 35%, #d9e1ee);
  border-right: 0;
  border-radius: 16px 0 0 16px;
  background: var(--annotation-accent);
  color: #fff;
  font-family: inherit;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  box-shadow: 0 10px 26px rgba(var(--annotation-accent-rgb), .24);
  transition: right .2s ease, background .16s ease;
}

.fw-annotation-panel-toggle__label {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1;
}

.fw-annotation-panel-toggle__arrow {
  font-size: 20px;
  line-height: 1;
}

.fw-annotation-panel-toggle:hover {
  filter: brightness(.9);
}

.fw-annotation-panel-toggle:focus-visible {
  outline: 3px solid rgba(var(--annotation-accent-rgb), .32);
  outline-offset: 3px;
}

.fw-annotation-panel-toggle.is-open {
  right: 98px;
  background: #fff;
  color: var(--annotation-accent);
}

.fw-annotation-toolbar {
  --annotation-accent: #3156d8;
  --annotation-accent-rgb: 49, 86, 216;
  position: fixed;
  z-index: 1010;
  right: 14px;
  top: 50%;
  width: 76px;
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  transform: translateY(-50%);
  border: 1px solid rgba(196, 207, 223, .95);
  border-radius: 22px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 16px 38px rgba(21, 42, 75, .18);
  backdrop-filter: blur(12px);
}

.fw-annotation-toolbar[hidden] {
  display: none;
}

.fw-annotation-toolbar__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 2px 0 4px;
  color: #263a5e;
  font-size: 13px;
  font-weight: 900;
}

.fw-annotation-toolbar__status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aab4c3;
  box-shadow: 0 0 0 3px #eef1f5;
}

.fw-annotation-toolbar.is-drawing .fw-annotation-toolbar__status {
  background: var(--annotation-accent);
  box-shadow: 0 0 0 3px rgba(var(--annotation-accent-rgb), .15);
}

.fw-annotation-toggle,
.fw-annotation-tool,
.fw-annotation-action,
.fw-annotation-size {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid #dce3ee;
  background: #fff;
  color: #42516a;
  font-family: inherit;
  font-weight: 850;
  cursor: pointer;
  transition: .16s ease;
}

.fw-annotation-toggle:hover,
.fw-annotation-tool:hover,
.fw-annotation-action:hover,
.fw-annotation-size:hover {
  border-color: #9eb1d4;
  background: #f5f8ff;
}

.fw-annotation-toggle {
  min-height: 51px;
  flex-direction: column;
  gap: 2px;
  border-color: color-mix(in srgb, var(--annotation-accent) 34%, #d9e1ee);
  border-radius: 14px;
  color: var(--annotation-accent);
}

.fw-annotation-toggle__icon {
  font-size: 20px;
  line-height: 1;
}

.fw-annotation-toggle__label {
  font-size: 10px;
}

.fw-annotation-toolbar.is-drawing .fw-annotation-toggle {
  border-color: var(--annotation-accent);
  background: var(--annotation-accent);
  color: #fff;
}

.fw-annotation-tool {
  min-height: 40px;
  gap: 4px;
  border-radius: 12px;
  font-size: 11px;
}

.fw-annotation-tool__icon {
  font-size: 15px;
}

.fw-annotation-tool.is-active {
  border-color: var(--annotation-accent);
  background: rgba(var(--annotation-accent-rgb), .09);
  color: var(--annotation-accent);
  box-shadow: inset 0 0 0 1px rgba(var(--annotation-accent-rgb), .12);
}

.fw-annotation-divider {
  height: 1px;
  margin: 1px 5px;
  background: #e5eaf1;
}

.fw-annotation-label {
  margin: 0;
  color: #8995a7;
  font-size: 9px;
  font-weight: 850;
  text-align: center;
}

.fw-annotation-colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 0 3px;
}

.fw-annotation-color {
  width: 17px;
  height: 17px;
  margin: auto;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px #cad3df;
  cursor: pointer;
}

.fw-annotation-color.is-active {
  box-shadow: 0 0 0 2px var(--annotation-accent);
}

.fw-annotation-sizes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.fw-annotation-size {
  height: 27px;
  border-radius: 9px;
}

.fw-annotation-size::before {
  content: "";
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 50%;
  background: #42516a;
}

.fw-annotation-size.is-active {
  border-color: var(--annotation-accent);
  background: rgba(var(--annotation-accent-rgb), .09);
}

.fw-annotation-text-input {
  position: absolute;
  z-index: 1030;
  width: min(260px, calc(100vw - 32px));
  min-width: 180px;
  min-height: 54px;
  padding: 10px 12px;
  border: 2px solid #3156d8;
  border-radius: 11px;
  color: #172133;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 12px 30px rgba(49, 86, 216, .24);
  font-family: Pretendard, "Noto Sans KR", sans-serif;
  font-weight: 800;
  line-height: 1.35;
  resize: both;
  outline: none;
}

.fw-annotation-text-input:focus {
  box-shadow: 0 0 0 4px rgba(49, 86, 216, .16), 0 12px 30px rgba(49, 86, 216, .24);
}

.fw-annotation-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.fw-annotation-action {
  width: 100%;
  min-height: 30px;
  border-radius: 10px;
  font-size: 9px;
}

.fw-annotation-action--clear {
  color: #d74343;
}

.fw-annotation-help {
  margin: 0;
  color: #8894a7;
  font-size: 9px;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 820px) {
  .fw-annotation-toolbar {
    right: 8px;
    top: auto;
    bottom: 10px;
    max-height: calc(100vh - 20px);
    transform: none;
  }

  .fw-annotation-panel-toggle {
    top: auto;
    bottom: 34px;
    transform: none;
    width: 38px;
    height: 98px;
  }

  .fw-annotation-panel-toggle.is-open {
    right: 92px;
  }
}
